diff --git a/src/librustc_typeck/coherence/orphan.rs b/src/librustc_typeck/coherence/orphan.rs index 7b76f3681c163..b450e6b398a6a 100644 --- a/src/librustc_typeck/coherence/orphan.rs +++ b/src/librustc_typeck/coherence/orphan.rs @@ -215,25 +215,21 @@ impl<'cx, 'tcx> OrphanChecker<'cx, 'tcx> { match traits::orphan_check(self.tcx, def_id) { Ok(()) => { } Err(traits::OrphanCheckErr::NoLocalInputType) => { - if !ty::has_attr(self.tcx, trait_def_id, "old_orphan_check") { - span_err!( - self.tcx.sess, item.span, E0117, - "the impl does not reference any \ - types defined in this crate; \ - only traits defined in the current crate can be \ - implemented for arbitrary types"); - return; - } + span_err!( + self.tcx.sess, item.span, E0117, + "the impl does not reference any \ + types defined in this crate; \ + only traits defined in the current crate can be \ + implemented for arbitrary types"); + return; } Err(traits::OrphanCheckErr::UncoveredTy(param_ty)) => { - if !ty::has_attr(self.tcx, trait_def_id, "old_orphan_check") { - span_err!(self.tcx.sess, item.span, E0210, - "type parameter `{}` must be used as the type parameter for \ - some local type (e.g. `MyStruct`); only traits defined in \ - the current crate can be implemented for a type parameter", - param_ty.user_string(self.tcx)); - return; - } + span_err!(self.tcx.sess, item.span, E0210, + "type parameter `{}` must be used as the type parameter for \ + some local type (e.g. `MyStruct`); only traits defined in \ + the current crate can be implemented for a type parameter", + param_ty.user_string(self.tcx)); + return; } } diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs index 1b03a18072011..7bad26f58f76c 100644 --- a/src/libsyntax/feature_gate.rs +++ b/src/libsyntax/feature_gate.rs @@ -102,9 +102,6 @@ const KNOWN_FEATURES: &'static [(&'static str, &'static str, Status)] = &[ // A way to temporarily opt out of opt in copy. This will *never* be accepted. ("opt_out_copy", "1.0.0", Removed), - // A way to temporarily opt out of the new orphan rules. This will *never* be accepted. - ("old_orphan_check", "1.0.0", Deprecated), - // OIBIT specific features ("optin_builtin_traits", "1.0.0", Active), @@ -277,9 +274,6 @@ pub const KNOWN_ATTRIBUTES: &'static [(&'static str, AttributeType)] = &[ ("stable", Whitelisted), ("unstable", Whitelisted), - // FIXME: #19470 this shouldn't be needed forever - ("old_orphan_check", Whitelisted), - ("rustc_paren_sugar", Gated("unboxed_closures", "unboxed_closures are still evolving")), ("rustc_reflect_like", Gated("reflect", @@ -327,7 +321,6 @@ pub struct Features { pub allow_trace_macros: bool, pub allow_internal_unstable: bool, pub allow_custom_derive: bool, - pub old_orphan_check: bool, pub simd_ffi: bool, pub unmarked_api: bool, /// spans of #![feature] attrs for stable language features. for error reporting @@ -349,7 +342,6 @@ impl Features { allow_trace_macros: false, allow_internal_unstable: false, allow_custom_derive: false, - old_orphan_check: false, simd_ffi: false, unmarked_api: false, declared_stable_lang_features: Vec::new(), @@ -573,14 +565,6 @@ impl<'a, 'v> Visitor<'v> for PostExpansionVisitor<'a> { }, _ => {} } - - if attr::contains_name(&i.attrs[..], - "old_orphan_check") { - self.gate_feature( - "old_orphan_check", - i.span, - "the new orphan check rules will eventually be strictly enforced"); - } } _ => {} @@ -737,7 +721,6 @@ fn check_crate_inner(cm: &CodeMap, span_handler: &SpanHandler, allow_trace_macros: cx.has_feature("trace_macros"), allow_internal_unstable: cx.has_feature("allow_internal_unstable"), allow_custom_derive: cx.has_feature("custom_derive"), - old_orphan_check: cx.has_feature("old_orphan_check"), simd_ffi: cx.has_feature("simd_ffi"), unmarked_api: cx.has_feature("unmarked_api"), declared_stable_lang_features: accepted_features, diff --git a/src/test/run-pass/deriving-encodable-decodable-box.rs b/src/test/run-pass/deriving-encodable-decodable-box.rs index 17f4d93e24c17..6ccedb0ad982f 100644 --- a/src/test/run-pass/deriving-encodable-decodable-box.rs +++ b/src/test/run-pass/deriving-encodable-decodable-box.rs @@ -12,7 +12,7 @@ #![allow(unknown_features)] #![feature(box_syntax)] -#![feature(old_orphan_check, rustc_private)] +#![feature(rustc_private)] extern crate serialize; diff --git a/src/test/run-pass/deriving-encodable-decodable-cell-refcell.rs b/src/test/run-pass/deriving-encodable-decodable-cell-refcell.rs index d116c2dfc2ac2..d216062bb2da3 100644 --- a/src/test/run-pass/deriving-encodable-decodable-cell-refcell.rs +++ b/src/test/run-pass/deriving-encodable-decodable-cell-refcell.rs @@ -13,7 +13,7 @@ // pretty-expanded FIXME #23616 -#![feature(old_orphan_check, rustc_private)] +#![feature(rustc_private)] extern crate serialize; diff --git a/src/test/run-pass/deriving-global.rs b/src/test/run-pass/deriving-global.rs index 2ca34e91b62a1..105d421b40415 100644 --- a/src/test/run-pass/deriving-global.rs +++ b/src/test/run-pass/deriving-global.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(old_orphan_check, rand, rustc_private)] +#![feature(rand, rustc_private)] extern crate serialize; extern crate rand; diff --git a/src/test/run-pass/issue-11881.rs b/src/test/run-pass/issue-11881.rs index 811926826dd12..35c25b33a9764 100644 --- a/src/test/run-pass/issue-11881.rs +++ b/src/test/run-pass/issue-11881.rs @@ -10,7 +10,7 @@ // pretty-expanded FIXME #23616 -#![feature(old_orphan_check, rustc_private, old_io)] +#![feature(rustc_private, old_io)] extern crate rbml; extern crate serialize; diff --git a/src/test/run-pass/issue-14021.rs b/src/test/run-pass/issue-14021.rs index e773f03f21217..907967d115d58 100644 --- a/src/test/run-pass/issue-14021.rs +++ b/src/test/run-pass/issue-14021.rs @@ -8,7 +8,7 @@ // option. This file may not be copied, modified, or distributed // except according to those terms. -#![feature(old_orphan_check, rustc_private)] +#![feature(rustc_private)] extern crate serialize; diff --git a/src/test/run-pass/issue-15734.rs b/src/test/run-pass/issue-15734.rs index d058cb7371177..67ce6a1c44f0d 100644 --- a/src/test/run-pass/issue-15734.rs +++ b/src/test/run-pass/issue-15734.rs @@ -13,7 +13,7 @@ // pretty-expanded FIXME #23616 -#![feature(old_orphan_check, core)] +#![feature(core)] use std::ops::Index; diff --git a/src/test/run-pass/issue-3743.rs b/src/test/run-pass/issue-3743.rs index 03699ff8d6036..7f66b6b25b8d2 100644 --- a/src/test/run-pass/issue-3743.rs +++ b/src/test/run-pass/issue-3743.rs @@ -10,7 +10,6 @@ // If `Mul` used an associated type for its output, this test would // work more smoothly. -#![feature(old_orphan_check)] use std::ops::Mul;