Skip to content

Commit

Permalink
rustc: Remove old_orphan_check entirely
Browse files Browse the repository at this point in the history
  • Loading branch information
alexcrichton committed Mar 31, 2015
1 parent 5cf126a commit 608fff8
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 41 deletions.
30 changes: 13 additions & 17 deletions src/librustc_typeck/coherence/orphan.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<T>`); 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<T>`); only traits defined in \
the current crate can be implemented for a type parameter",
param_ty.user_string(self.tcx));
return;
}
}

Expand Down
17 changes: 0 additions & 17 deletions src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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),

Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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
Expand All @@ -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(),
Expand Down Expand Up @@ -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");
}
}

_ => {}
Expand Down Expand Up @@ -737,7 +721,6 @@ fn check_crate_inner<F>(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,
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/deriving-encodable-decodable-box.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

#![allow(unknown_features)]
#![feature(box_syntax)]
#![feature(old_orphan_check, rustc_private)]
#![feature(rustc_private)]

extern crate serialize;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

// pretty-expanded FIXME #23616

#![feature(old_orphan_check, rustc_private)]
#![feature(rustc_private)]

extern crate serialize;

Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/deriving-global.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-11881.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-14021.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion src/test/run-pass/issue-15734.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

// pretty-expanded FIXME #23616

#![feature(old_orphan_check, core)]
#![feature(core)]

use std::ops::Index;

Expand Down
1 change: 0 additions & 1 deletion src/test/run-pass/issue-3743.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit 608fff8

Please sign in to comment.