Skip to content

Remove the deprecated opt_out_copy feature #20740

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 8, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 2 additions & 21 deletions src/librustc/middle/traits/select.rs
Original file line number Diff line number Diff line change
Expand Up @@ -713,12 +713,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
debug!("obligation self ty is {}",
obligation.predicate.0.self_ty().repr(self.tcx()));

// If the user has asked for the older, compatibility
// behavior, ignore user-defined impls here. This will
// go away by the time 1.0 is released.
if !self.tcx().sess.features.borrow().opt_out_copy {
try!(self.assemble_candidates_from_impls(obligation, &mut candidates.vec));
}
try!(self.assemble_candidates_from_impls(obligation, &mut candidates.vec));

try!(self.assemble_builtin_bound_candidates(ty::BoundCopy,
stack,
Expand Down Expand Up @@ -1505,21 +1500,7 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
}

ty::BoundCopy => {
// This is an Opt-In Built-In Trait. So, unless
// the user is asking for the old behavior, we
// don't supply any form of builtin impl.
if !this.tcx().sess.features.borrow().opt_out_copy {
return Ok(ParameterBuiltin)
} else {
// Older, backwards compatibility behavior:
if
Some(def_id) == tcx.lang_items.no_copy_bound() ||
Some(def_id) == tcx.lang_items.managed_bound() ||
ty::has_dtor(tcx, def_id)
{
return Err(Unimplemented);
}
}
return Ok(ParameterBuiltin)
}

ty::BoundSync => {
Expand Down
5 changes: 1 addition & 4 deletions src/libsyntax/feature_gate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ static KNOWN_FEATURES: &'static [(&'static str, Status)] = &[
("issue_5723_bootstrap", Accepted),

// A way to temporarily opt out of opt in copy. This will *never* be accepted.
("opt_out_copy", Deprecated),
("opt_out_copy", Removed),

// A way to temporarily opt out of the new orphan rules. This will *never* be accepted.
("old_orphan_check", Deprecated),
Expand Down Expand Up @@ -123,7 +123,6 @@ pub struct Features {
pub import_shadowing: bool,
pub visible_private_types: bool,
pub quote: bool,
pub opt_out_copy: bool,
pub old_orphan_check: bool,
}

Expand All @@ -135,7 +134,6 @@ impl Features {
import_shadowing: false,
visible_private_types: false,
quote: false,
opt_out_copy: false,
old_orphan_check: false,
}
}
Expand Down Expand Up @@ -465,7 +463,6 @@ fn check_crate_inner<F>(cm: &CodeMap, span_handler: &SpanHandler, krate: &ast::C
import_shadowing: cx.has_feature("import_shadowing"),
visible_private_types: cx.has_feature("visible_private_types"),
quote: cx.has_feature("quote"),
opt_out_copy: cx.has_feature("opt_out_copy"),
old_orphan_check: cx.has_feature("old_orphan_check"),
},
unknown_features)
Expand Down
44 changes: 0 additions & 44 deletions src/test/compile-fail/opt-out-copy-bad.rs

This file was deleted.

46 changes: 0 additions & 46 deletions src/test/run-pass/opt-out-copy.rs

This file was deleted.