Skip to content

Commit 608fff8

Browse files
committed
rustc: Remove old_orphan_check entirely
1 parent 5cf126a commit 608fff8

9 files changed

+19
-41
lines changed

src/librustc_typeck/coherence/orphan.rs

+13-17
Original file line numberDiff line numberDiff line change
@@ -215,25 +215,21 @@ impl<'cx, 'tcx> OrphanChecker<'cx, 'tcx> {
215215
match traits::orphan_check(self.tcx, def_id) {
216216
Ok(()) => { }
217217
Err(traits::OrphanCheckErr::NoLocalInputType) => {
218-
if !ty::has_attr(self.tcx, trait_def_id, "old_orphan_check") {
219-
span_err!(
220-
self.tcx.sess, item.span, E0117,
221-
"the impl does not reference any \
222-
types defined in this crate; \
223-
only traits defined in the current crate can be \
224-
implemented for arbitrary types");
225-
return;
226-
}
218+
span_err!(
219+
self.tcx.sess, item.span, E0117,
220+
"the impl does not reference any \
221+
types defined in this crate; \
222+
only traits defined in the current crate can be \
223+
implemented for arbitrary types");
224+
return;
227225
}
228226
Err(traits::OrphanCheckErr::UncoveredTy(param_ty)) => {
229-
if !ty::has_attr(self.tcx, trait_def_id, "old_orphan_check") {
230-
span_err!(self.tcx.sess, item.span, E0210,
231-
"type parameter `{}` must be used as the type parameter for \
232-
some local type (e.g. `MyStruct<T>`); only traits defined in \
233-
the current crate can be implemented for a type parameter",
234-
param_ty.user_string(self.tcx));
235-
return;
236-
}
227+
span_err!(self.tcx.sess, item.span, E0210,
228+
"type parameter `{}` must be used as the type parameter for \
229+
some local type (e.g. `MyStruct<T>`); only traits defined in \
230+
the current crate can be implemented for a type parameter",
231+
param_ty.user_string(self.tcx));
232+
return;
237233
}
238234
}
239235

src/libsyntax/feature_gate.rs

-17
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,6 @@ const KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[
102102
// A way to temporarily opt out of opt in copy. This will *never* be accepted.
103103
("opt_out_copy", "1.0.0", Removed),
104104

105-
// A way to temporarily opt out of the new orphan rules. This will *never* be accepted.
106-
("old_orphan_check", "1.0.0", Deprecated),
107-
108105
// OIBIT specific features
109106
("optin_builtin_traits", "1.0.0", Active),
110107

@@ -277,9 +274,6 @@ pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType)] = &[
277274
("stable", Whitelisted),
278275
("unstable", Whitelisted),
279276

280-
// FIXME: #19470 this shouldn't be needed forever
281-
("old_orphan_check", Whitelisted),
282-
283277
("rustc_paren_sugar", Gated("unboxed_closures",
284278
"unboxed_closures are still evolving")),
285279
("rustc_reflect_like", Gated("reflect",
@@ -327,7 +321,6 @@ pub struct Features {
327321
pub allow_trace_macros: bool,
328322
pub allow_internal_unstable: bool,
329323
pub allow_custom_derive: bool,
330-
pub old_orphan_check: bool,
331324
pub simd_ffi: bool,
332325
pub unmarked_api: bool,
333326
/// spans of #![feature] attrs for stable language features. for error reporting
@@ -349,7 +342,6 @@ impl Features {
349342
allow_trace_macros: false,
350343
allow_internal_unstable: false,
351344
allow_custom_derive: false,
352-
old_orphan_check: false,
353345
simd_ffi: false,
354346
unmarked_api: false,
355347
declared_stable_lang_features: Vec::new(),
@@ -573,14 +565,6 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> {
573565
},
574566
_ => {}
575567
}
576-
577-
if attr::contains_name(&i.attrs[..],
578-
"old_orphan_check") {
579-
self.gate_feature(
580-
"old_orphan_check",
581-
i.span,
582-
"the new orphan check rules will eventually be strictly enforced");
583-
}
584568
}
585569

586570
_ => {}
@@ -737,7 +721,6 @@ fn check_crate_inner<F>(cm: &CodeMap, span_handler: &SpanHandler,
737721
allow_trace_macros: cx.has_feature("trace_macros"),
738722
allow_internal_unstable: cx.has_feature("allow_internal_unstable"),
739723
allow_custom_derive: cx.has_feature("custom_derive"),
740-
old_orphan_check: cx.has_feature("old_orphan_check"),
741724
simd_ffi: cx.has_feature("simd_ffi"),
742725
unmarked_api: cx.has_feature("unmarked_api"),
743726
declared_stable_lang_features: accepted_features,

src/test/run-pass/deriving-encodable-decodable-box.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
#![allow(unknown_features)]
1414
#![feature(box_syntax)]
15-
#![feature(old_orphan_check, rustc_private)]
15+
#![feature(rustc_private)]
1616

1717
extern crate serialize;
1818

src/test/run-pass/deriving-encodable-decodable-cell-refcell.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
// pretty-expanded FIXME #23616
1515

16-
#![feature(old_orphan_check, rustc_private)]
16+
#![feature(rustc_private)]
1717

1818
extern crate serialize;
1919

src/test/run-pass/deriving-global.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(old_orphan_check, rand, rustc_private)]
11+
#![feature(rand, rustc_private)]
1212

1313
extern crate serialize;
1414
extern crate rand;

src/test/run-pass/issue-11881.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010

1111
// pretty-expanded FIXME #23616
1212

13-
#![feature(old_orphan_check, rustc_private, old_io)]
13+
#![feature(rustc_private, old_io)]
1414

1515
extern crate rbml;
1616
extern crate serialize;

src/test/run-pass/issue-14021.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
#![feature(old_orphan_check, rustc_private)]
11+
#![feature(rustc_private)]
1212

1313
extern crate serialize;
1414

src/test/run-pass/issue-15734.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
// pretty-expanded FIXME #23616
1515

16-
#![feature(old_orphan_check, core)]
16+
#![feature(core)]
1717

1818
use std::ops::Index;
1919

src/test/run-pass/issue-3743.rs

-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010

1111
// If `Mul` used an associated type for its output, this test would
1212
// work more smoothly.
13-
#![feature(old_orphan_check)]
1413

1514
use std::ops::Mul;
1615

0 commit comments

Comments
 (0)