about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorFlavio Percoco <flaper87@gmail.com>2015-01-08 12:01:48 +0100
committerFlavio Percoco <flaper87@gmail.com>2015-01-08 13:39:14 +0100
commit0d0869ad738c1961ebbe75412303d360c7e951ba (patch)
treeb3f6c1498478b98dd1c7989f1e57ba55869ef00a /src
parent5b3cd3900ceda838f5798c30ab96ceb41f962534 (diff)
downloadrust-0d0869ad738c1961ebbe75412303d360c7e951ba.tar.gz
rust-0d0869ad738c1961ebbe75412303d360c7e951ba.zip
Remove the deprecated opt_out_copy feature
Diffstat (limited to 'src')
-rw-r--r--src/librustc/middle/traits/select.rs23
-rw-r--r--src/libsyntax/feature_gate.rs5
-rw-r--r--src/test/compile-fail/opt-out-copy-bad.rs44
-rw-r--r--src/test/run-pass/opt-out-copy.rs46
4 files changed, 3 insertions, 115 deletions
diff --git a/src/librustc/middle/traits/select.rs b/src/librustc/middle/traits/select.rs
index f42f43d2576..dad74612369 100644
--- a/src/librustc/middle/traits/select.rs
+++ b/src/librustc/middle/traits/select.rs
@@ -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,
@@ -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 => {
diff --git a/src/libsyntax/feature_gate.rs b/src/libsyntax/feature_gate.rs
index 2cfcd38d48f..9f023be4a53 100644
--- a/src/libsyntax/feature_gate.rs
+++ b/src/libsyntax/feature_gate.rs
@@ -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),
@@ -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,
 }
 
@@ -135,7 +134,6 @@ impl Features {
             import_shadowing: false,
             visible_private_types: false,
             quote: false,
-            opt_out_copy: false,
             old_orphan_check: false,
         }
     }
@@ -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)
diff --git a/src/test/compile-fail/opt-out-copy-bad.rs b/src/test/compile-fail/opt-out-copy-bad.rs
deleted file mode 100644
index 9e425fa8f2e..00000000000
--- a/src/test/compile-fail/opt-out-copy-bad.rs
+++ /dev/null
@@ -1,44 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(opt_out_copy)]
-//~^ WARNING feature is deprecated
-//~| WARNING feature is deprecated
-
-// Test that when using the `opt-out-copy` feature we still consider
-// destructors to be non-movable
-
-struct CantCopyThis;
-
-impl Drop for CantCopyThis {
-    fn drop(&mut self) { }
-}
-
-struct IWantToCopyThis {
-    but_i_cant: CantCopyThis,
-}
-
-impl Copy for IWantToCopyThis {}
-//~^ ERROR the trait `Copy` may not be implemented for this type
-
-enum CantCopyThisEither {
-    A,
-    B(::std::marker::NoCopy),
-}
-
-enum IWantToCopyThisToo {
-    ButICant(CantCopyThisEither),
-}
-
-impl Copy for IWantToCopyThisToo {}
-//~^ ERROR the trait `Copy` may not be implemented for this type
-
-fn main() {}
-
diff --git a/src/test/run-pass/opt-out-copy.rs b/src/test/run-pass/opt-out-copy.rs
deleted file mode 100644
index 8c7072cfdf5..00000000000
--- a/src/test/run-pass/opt-out-copy.rs
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2014 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
-#![feature(opt_out_copy)]
-
-// Test the opt-out-copy feature guard. This is the same as the
-// "opt-in-copy.rs" test from compile-fail, except that it is using
-// the feature guard, and hence the structureds in this file are
-// implicitly copyable, and hence we get no errors. This test can be
-// safely removed once the opt-out-copy "feature" is rejected.
-
-struct CantCopyThis;
-
-struct IWantToCopyThis {
-    but_i_cant: CantCopyThis,
-}
-
-impl Copy for IWantToCopyThis {}
-
-enum CantCopyThisEither {
-    A,
-    B,
-}
-
-enum IWantToCopyThisToo {
-    ButICant(CantCopyThisEither),
-}
-
-impl Copy for IWantToCopyThisToo {}
-
-fn is_copy<T:Copy>() { }
-
-fn main() {
-    is_copy::<CantCopyThis>();
-    is_copy::<CantCopyThisEither>();
-    is_copy::<IWantToCopyThis>();
-    is_copy::<IWantToCopyThisToo>();
-}
-