rustc: Remove old_orphan_check entirely

This commit is contained in:
Alex Crichton 2015-03-31 13:40:39 -07:00
parent 5cf126ae2f
commit 608fff8582
9 changed files with 19 additions and 41 deletions

View File

@ -215,25 +215,21 @@ fn check_item(&self, item: &ast::Item) {
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;
}
}

View File

@ -102,9 +102,6 @@
// 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 @@ enum Status {
("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 @@ pub fn new() -> 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 @@ fn visit_item(&mut self, i: &ast::Item) {
},
_ => {}
}
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<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,

View File

@ -12,7 +12,7 @@
#![allow(unknown_features)]
#![feature(box_syntax)]
#![feature(old_orphan_check, rustc_private)]
#![feature(rustc_private)]
extern crate serialize;

View File

@ -13,7 +13,7 @@
// pretty-expanded FIXME #23616
#![feature(old_orphan_check, rustc_private)]
#![feature(rustc_private)]
extern crate serialize;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -13,7 +13,7 @@
// pretty-expanded FIXME #23616
#![feature(old_orphan_check, core)]
#![feature(core)]
use std::ops::Index;

View File

@ -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;