]> git.lizzy.rs Git - rust.git/commitdiff
test: Fix fallout in tests
authorAlex Crichton <alex@alexcrichton.com>
Sat, 18 Apr 2015 05:12:20 +0000 (22:12 -0700)
committerAlex Crichton <alex@alexcrichton.com>
Tue, 21 Apr 2015 18:37:43 +0000 (11:37 -0700)
112 files changed:
src/test/auxiliary/issue_3907.rs
src/test/auxiliary/private_trait_xc.rs
src/test/auxiliary/rustdoc-default-impl.rs
src/test/auxiliary/svh-a-base.rs
src/test/auxiliary/svh-a-change-lit.rs
src/test/auxiliary/svh-a-change-significant-cfg.rs
src/test/auxiliary/svh-a-change-trait-bound.rs
src/test/auxiliary/svh-a-change-type-arg.rs
src/test/auxiliary/svh-a-change-type-ret.rs
src/test/auxiliary/svh-a-change-type-static.rs
src/test/auxiliary/svh-a-comment.rs
src/test/auxiliary/svh-a-doc.rs
src/test/auxiliary/svh-a-macro.rs
src/test/auxiliary/svh-a-no-change.rs
src/test/auxiliary/svh-a-redundant-cfg.rs
src/test/auxiliary/svh-a-whitespace.rs
src/test/auxiliary/trait_impl_conflict.rs
src/test/auxiliary/typeck_default_trait_impl_cross_crate_coherence_lib.rs
src/test/compile-fail/associated-types-eq-expr-path.rs
src/test/compile-fail/associated-types-issue-17359.rs
src/test/compile-fail/associated-types-multiple-types-one-trait.rs
src/test/compile-fail/associated-types-no-suitable-supertrait-2.rs
src/test/compile-fail/associated-types-no-suitable-supertrait.rs
src/test/compile-fail/associated-types-unconstrained.rs
src/test/compile-fail/bad-sized.rs
src/test/compile-fail/coherence-blanket-conflicts-with-blanket-implemented.rs
src/test/compile-fail/coherence-blanket-conflicts-with-blanket-unimplemented.rs
src/test/compile-fail/coherence-conflicting-negative-trait-impl.rs
src/test/compile-fail/coherence-default-trait-impl.rs
src/test/compile-fail/coherence_copy_like_err_fundamental_struct_tuple.rs
src/test/compile-fail/coherence_copy_like_err_struct.rs
src/test/compile-fail/coherence_copy_like_err_tuple.rs
src/test/compile-fail/dst-bad-coerce2.rs
src/test/compile-fail/dst-bad-coercions.rs
src/test/compile-fail/implicit-method-bind.rs
src/test/compile-fail/issue-13853.rs
src/test/compile-fail/issue-14853.rs
src/test/compile-fail/issue-16747.rs
src/test/compile-fail/issue-18107.rs
src/test/compile-fail/issue-18389.rs
src/test/compile-fail/issue-18611.rs
src/test/compile-fail/issue-18819.rs
src/test/compile-fail/issue-2063.rs
src/test/compile-fail/issue-20831-debruijn.rs
src/test/compile-fail/issue-23080-2.rs
src/test/compile-fail/issue-3702-2.rs
src/test/compile-fail/issue-5035-2.rs
src/test/compile-fail/issue-5883.rs
src/test/compile-fail/issue-7575.rs
src/test/compile-fail/kindck-copy.rs
src/test/compile-fail/kindck-impl-type-params-2.rs
src/test/compile-fail/kindck-send-object.rs
src/test/compile-fail/kindck-send-object1.rs
src/test/compile-fail/kindck-send-object2.rs
src/test/compile-fail/lint-visible-private-types.rs
src/test/compile-fail/object-does-not-impl-trait.rs
src/test/compile-fail/object-safety-no-static.rs
src/test/compile-fail/phantom-oibit.rs
src/test/compile-fail/privacy-ns2.rs
src/test/compile-fail/region-object-lifetime-in-coercion.rs
src/test/compile-fail/regions-close-associated-type-into-object.rs
src/test/compile-fail/regions-close-over-borrowed-ref-in-obj.rs
src/test/compile-fail/trait-as-struct-constructor.rs
src/test/compile-fail/trait-bounds-on-structs-and-enums.rs
src/test/compile-fail/trait-bounds-sugar.rs
src/test/compile-fail/trait-impl-1.rs
src/test/compile-fail/type-params-in-different-spaces-1.rs
src/test/compile-fail/typeck-default-trait-impl-constituent-types-2.rs
src/test/compile-fail/typeck-default-trait-impl-constituent-types.rs
src/test/compile-fail/typeck-default-trait-impl-negation.rs
src/test/compile-fail/typeck-default-trait-impl-precedence.rs
src/test/compile-fail/typeck-default-trait-impl-superregion.rs
src/test/compile-fail/typeck-default-trait-impl-supertrait.rs
src/test/compile-fail/typeck-default-trait-impl-trait-where-clause.rs
src/test/compile-fail/unsized6.rs
src/test/compile-fail/unsized7.rs
src/test/run-make/save-analysis/foo.rs
src/test/run-pass/associated-types-basic.rs
src/test/run-pass/associated-types-issue-20371.rs
src/test/run-pass/associated-types-nested-projections.rs
src/test/run-pass/associated-types-normalize-in-bounds-binding.rs
src/test/run-pass/associated-types-project-from-type-param-via-bound-in-where-clause.rs
src/test/run-pass/const-binops.rs
src/test/run-pass/derive-no-std.rs
src/test/run-pass/deriving-primitive.rs [deleted file]
src/test/run-pass/early-ret-binop-add.rs
src/test/run-pass/exponential-notation.rs [deleted file]
src/test/run-pass/extern-methods.rs
src/test/run-pass/float-nan.rs
src/test/run-pass/intrinsics-math.rs
src/test/run-pass/issue-11736.rs
src/test/run-pass/issue-13105.rs
src/test/run-pass/issue-8460.rs
src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs
src/test/run-pass/numeric-method-autoexport.rs
src/test/run-pass/overloaded-autoderef.rs
src/test/run-pass/syntax-trait-polarity.rs
src/test/run-pass/trait-bounds-basic.rs
src/test/run-pass/trait-bounds-on-structs-and-enums.rs
src/test/run-pass/trait-bounds-recursion.rs
src/test/run-pass/trait-inheritance-num.rs
src/test/run-pass/trait-inheritance-num0.rs
src/test/run-pass/trait-inheritance-num1.rs
src/test/run-pass/trait-inheritance-num2.rs
src/test/run-pass/trait-inheritance-num3.rs
src/test/run-pass/trait-inheritance-num5.rs
src/test/run-pass/trait-inheritance-self-in-supertype.rs
src/test/run-pass/trait-inheritance-static2.rs
src/test/run-pass/unboxed-closures-infer-argument-types-from-expected-bound.rs
src/test/run-pass/unboxed-closures-infer-argument-types-from-expected-object-type.rs
src/test/run-pass/unboxed-closures-infer-argument-types-with-bound-regions-from-expected-bound.rs
src/test/run-pass/utf8_idents.rs

index 3d5e52d709df3ec4c1966eafc87252acd368efc0..6472c08c222965b6a6ba1a4e411747d3b26bc0ee 100644 (file)
@@ -8,10 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(core)]
-
-use std::marker::MarkerTrait;
-
-pub trait Foo : MarkerTrait {
+pub trait Foo {
     fn bar();
 }
index dc08033602c99dfa9a6f9f3aed31ce6ddf1c7412..37ee10c8d37333ec6e64793919ab8a1f504e14ca 100644 (file)
@@ -8,6 +8,4 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(core)]
-
-trait Foo : ::std::marker::MarkerTrait {}
+trait Foo {}
index 8f11629be6cc83c054a577b22e3618b00e05112b..c2ff7a0054f19712bf95d0c3c34c0c5f4cf5d8e8 100644 (file)
@@ -14,7 +14,7 @@
 pub mod bar {
     use std::marker;
 
-    pub trait Bar: marker::MarkerTrait + 'static {}
+    pub trait Bar: 'static {}
 
     impl Bar for .. {}
 
index 7e10d2158ede08bda3eeba69d6cc8729f5b8c8b5..31a97f695f06cdbfcf20cd27edf87cb961020bb0 100644 (file)
 //! (#14132).
 
 #![crate_name = "a"]
-#![feature(core)]
-
-use std::marker::MarkerTrait;
 
 macro_rules! three {
     () => { 3 }
 }
 
-pub trait U : MarkerTrait {}
-pub trait V : MarkerTrait {}
+pub trait U {}
+pub trait V {}
 impl U for () {}
 impl V for () {}
 
index c5f38805511650925110d59c68159481bf2d0028..5339fc8295c6f57f56cfd7820e41cdb3d88be0fc 100644 (file)
 //! (#14132).
 
 #![crate_name = "a"]
-#![feature(core)]
-
-use std::marker::MarkerTrait;
 
 macro_rules! three {
     () => { 3 }
 }
 
-pub trait U : MarkerTrait {}
-pub trait V : MarkerTrait {}
+pub trait U {}
+pub trait V {}
 impl U for () {}
 impl V for () {}
 
index 3168e747eb6e694c6222848a08c389458f23ef14..2a5d9446f879ac65f8d8a4dff31c9616e89c7993 100644 (file)
 //! (#14132).
 
 #![crate_name = "a"]
-#![feature(core)]
-
-use std::marker::MarkerTrait;
 
 macro_rules! three {
     () => { 3 }
 }
 
-pub trait U : MarkerTrait {}
-pub trait V : MarkerTrait {}
+pub trait U {}
+pub trait V {}
 impl U for () {}
 impl V for () {}
 
index f86a43494f78e740718e55b9306b5d6758550f98..61f2f2803ab1891dc586ab781cea0158d513b8ed 100644 (file)
 //! (#14132).
 
 #![crate_name = "a"]
-#![feature(core)]
-
-use std::marker::MarkerTrait;
 
 macro_rules! three {
     () => { 3 }
 }
 
-pub trait U : MarkerTrait {}
-pub trait V : MarkerTrait {}
+pub trait U {}
+pub trait V {}
 impl U for () {}
 impl V for () {}
 
index dc412b700447beade18887dd4b577e60b3a393c4..270ce95be2bb62d70a0366920373362fb5a8e2ae 100644 (file)
 //! (#14132).
 
 #![crate_name = "a"]
-#![feature(core)]
-
-use std::marker::MarkerTrait;
 
 macro_rules! three {
     () => { 3 }
 }
 
-pub trait U : MarkerTrait {}
-pub trait V : MarkerTrait {}
+pub trait U {}
+pub trait V {}
 impl U for () {}
 impl V for () {}
 
index 0cfcbbb0554e684f7304a64001ad78234195afec..de4cc85a7dc4746bc238bbf344b797eb212de426 100644 (file)
 //! (#14132).
 
 #![crate_name = "a"]
-#![feature(core)]
-
-use std::marker::MarkerTrait;
 
 macro_rules! three {
     () => { 3 }
 }
 
-pub trait U : MarkerTrait {}
-pub trait V : MarkerTrait {}
+pub trait U {}
+pub trait V {}
 impl U for () {}
 impl V for () {}
 
index e1e32095b5cb40d4e4c9dc5582ae5679dec65234..62f7986f1c3bd729b67c8f50677d01395f20914e 100644 (file)
 #![crate_name = "a"]
 #![feature(core)]
 
-use std::marker::MarkerTrait;
-
 macro_rules! three {
     () => { 3 }
 }
 
-pub trait U : MarkerTrait {}
-pub trait V : MarkerTrait {}
+pub trait U {}
+pub trait V {}
 impl U for () {}
 impl V for () {}
 
index 9fd97376b6681232843fcea84aa0b42d06ec2ce9..22e40822eecfc8b52055dbeece2d9b99e58e88e4 100644 (file)
 //! (#14132).
 
 #![crate_name = "a"]
-#![feature(core)]
-
-use std::marker::MarkerTrait;
 
 macro_rules! three {
     () => { 3 }
 }
 
-pub trait U : MarkerTrait {}
-pub trait V : MarkerTrait {}
+pub trait U {}
+pub trait V {}
 impl U for () {}
 impl V for () {}
 
index e64bde096b0169b0a334ce420492f434f6a17e32..3d8a728967a4a64bcc274b11818dedc1690d5a2f 100644 (file)
 //! (#14132).
 
 #![crate_name = "a"]
-#![feature(core)]
-
-use std::marker::MarkerTrait;
 
 macro_rules! three {
     () => { 3 }
 }
 
-pub trait U : MarkerTrait {}
-pub trait V : MarkerTrait {}
+pub trait U {}
+pub trait V {}
 impl U for () {}
 impl V for () {}
 
index b16338f1e128c87d0bb3d6b7b44e41f1fb38b8e3..41d7eb7b18645f3ee181fee3406ec62aaea899fd 100644 (file)
 //! (#14132).
 
 #![crate_name = "a"]
-#![feature(core)]
-
-use std::marker::MarkerTrait;
 
 macro_rules! three {
     () => { 3 }
 }
 
-pub trait U : MarkerTrait {}
-pub trait V : MarkerTrait {}
+pub trait U {}
+pub trait V {}
 impl U for () {}
 impl V for () {}
 
index 7e10d2158ede08bda3eeba69d6cc8729f5b8c8b5..31a97f695f06cdbfcf20cd27edf87cb961020bb0 100644 (file)
 //! (#14132).
 
 #![crate_name = "a"]
-#![feature(core)]
-
-use std::marker::MarkerTrait;
 
 macro_rules! three {
     () => { 3 }
 }
 
-pub trait U : MarkerTrait {}
-pub trait V : MarkerTrait {}
+pub trait U {}
+pub trait V {}
 impl U for () {}
 impl V for () {}
 
index 8cadd7bdf4174e1faeca675ebde218ea6563c8e0..e405c337abe4aeb7ef7214625a275c5fc4931b75 100644 (file)
 //! (#14132).
 
 #![crate_name = "a"]
-#![feature(core)]
-
-use std::marker::MarkerTrait;
 
 macro_rules! three {
     () => { 3 }
 }
 
-pub trait U : MarkerTrait {}
-pub trait V : MarkerTrait {}
+pub trait U {}
+pub trait V {}
 impl U for () {}
 impl V for () {}
 
index fcaf77909554dd8bad665175ef690055b2540a61..9ef788c98427392bfa95bf1156149d7df9a99232 100644 (file)
 //! (#14132).
 
 #![crate_name = "a"]
-#![feature(core)]
-
-use std::marker::MarkerTrait;
 
 macro_rules! three {
     () => { 3 }
 }
 
-pub trait U : MarkerTrait {}
-pub trait V : MarkerTrait {}
+pub trait U {}
+pub trait V {}
 impl U for () {}
 impl V for () {}
 
index 0adedfd4eeb22c9f61c96b88c94b04fdc6d0f02b..c3ecbb014dc6b0aac1dfa9e077383a15e86b79cd 100644 (file)
@@ -8,9 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(core)]
-
-pub trait Foo : ::std::marker::MarkerTrait {
+pub trait Foo {
 }
 
 impl Foo for isize {
index 5a7a3e7bcc6942ac1b5a7495bd8a569990674cd1..2e425ac96c55f9de510c0358e93105c48424d3ba 100644 (file)
@@ -11,9 +11,7 @@
 #![feature(optin_builtin_traits, core)]
 #![crate_type = "rlib"]
 
-use std::marker::MarkerTrait;
-
-pub trait DefaultedTrait : MarkerTrait { }
+pub trait DefaultedTrait { }
 impl DefaultedTrait for .. { }
 
 pub struct Something<T> { t: T }
index 0d68b960f31356d2227f227ced2ff65ff402a2f8..1f9dfdb18470b3718b97289e62345b762f748e65 100644 (file)
@@ -10,7 +10,7 @@
 
 // Check that an associated type cannot be bound in an expression path.
 
-trait Foo : ::std::marker::MarkerTrait {
+trait Foo {
     type A;
     fn bar() -> isize;
 }
index 5c36e3356a5c026c8d3175fc64d567eae3355179..82258f124d3233da297edae2e9447118e814e45a 100644 (file)
@@ -11,7 +11,7 @@
 // Test that we do not ICE when an impl is missing an associated type (and that we report
 // a useful error, of course).
 
-trait Trait : ::std::marker::MarkerTrait {
+trait Trait {
     type Type;
 }
 
index 5632f148da67ce2e1d00f4f0738c07406c00f88d..9436f825de89dd4b95a51cc7e6f7ce4ad320bcdd 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-trait Foo : ::std::marker::MarkerTrait {
+trait Foo {
     type X;
     type Y;
 }
index 5f1cd2444d3c4870ad7295fc0df47162a576e307..bda16c8a85de15d03c00c2470688bb3cb34b158a 100644 (file)
@@ -19,7 +19,7 @@
 // which checks that the trait interface itself is not considered an
 // error as long as all impls satisfy the constraint.
 
-trait Get : ::std::marker::MarkerTrait {
+trait Get {
     type Value;
 }
 
index 24429a482057c7e71067a70137f1457f58dbf570..233532a6085803400c5ae04f9edbf1d70b4f94a9 100644 (file)
@@ -19,7 +19,7 @@
 // which checks that the trait interface itself is not considered an
 // error as long as all impls satisfy the constraint.
 
-trait Get : ::std::marker::MarkerTrait {
+trait Get {
     type Value;
 }
 
index 8832028f9aba1e87781545bb2426653882439b3c..aecbf217a5b25e916155829b81188bf7401049ac 100644 (file)
@@ -10,7 +10,7 @@
 
 // Check that an associated type cannot be bound in an expression path.
 
-trait Foo : ::std::marker::MarkerTrait {
+trait Foo {
     type A;
     fn bar() -> isize;
 }
index 5878e9a9f649be3b1e80adb796ba44f634305bb5..fca74e457c21e17be2a9889919730ee6926c32d4 100644 (file)
@@ -10,7 +10,7 @@
 
 use std::cell::RefCell;
 
-trait Trait : ::std::marker::MarkerTrait {}
+trait Trait {}
 
 pub fn main() {
     let x: Vec<Trait + Sized> = Vec::new();
index 98a9c713e84c331c9d305a63ff0ffa0cb79cec4f..b771b959d3e507ef1cf5001777109b9f1cef7e94 100644 (file)
@@ -10,7 +10,6 @@
 
 use std::fmt::Debug;
 use std::default::Default;
-use std::marker::MarkerTrait;
 
 // Test that two blanket impls conflict (at least without negative
 // bounds).  After all, some other crate could implement Even or Odd
@@ -20,9 +19,9 @@ trait MyTrait {
     fn get(&self) -> usize;
 }
 
-trait Even : MarkerTrait { }
+trait Even { }
 
-trait Odd : MarkerTrait { }
+trait Odd { }
 
 impl Even for isize { }
 
index 57d25a3bf586dcab40fe8df4857095ca8db25ed7..d3b0e7f10b91bc815a32a1f21384bc2bfd9fd5e9 100644 (file)
@@ -19,9 +19,9 @@ trait MyTrait {
     fn get(&self) -> usize;
 }
 
-trait Even : ::std::marker::MarkerTrait { }
+trait Even {}
 
-trait Odd : ::std::marker::MarkerTrait { }
+trait Odd {}
 
 impl<T:Even> MyTrait for T { //~ ERROR E0119
     fn get(&self) -> usize { 0 }
index a225f6cf473041387b09124fbe54803d4f65f645..55c9ba2a0e89aeda6cfb43ea13f0bdd4e8ba049f 100644 (file)
@@ -10,7 +10,7 @@
 
 #![feature(optin_builtin_traits)]
 
-trait MyTrait : ::std::marker::MarkerTrait {}
+trait MyTrait {}
 
 struct TestType<T>(::std::marker::PhantomData<T>);
 
index 062a4a43b694b14ae86ef57172f3032a5b25e286..cccc8b05b3038b8ae719f192badcb5906edc43b5 100644 (file)
 
 #![feature(optin_builtin_traits)]
 
-use std::marker::MarkerTrait;
-
-trait MyTrait: MarkerTrait {}
+trait MyTrait {}
 
 impl MyTrait for .. {}
 
 impl MyTrait for .. {}
 //~^ ERROR conflicting implementations for trait `MyTrait`
 
-trait MySafeTrait: MarkerTrait {}
+trait MySafeTrait {}
 
 unsafe impl MySafeTrait for .. {}
 //~^ ERROR implementing the trait `MySafeTrait` is not unsafe
 
-unsafe trait MyUnsafeTrait: MarkerTrait {}
+unsafe trait MyUnsafeTrait {}
 
 impl MyUnsafeTrait for .. {}
 //~^ ERROR the trait `MyUnsafeTrait` requires an `unsafe impl` declaration
index c4e95e772356a8f471b59632b41914ccf459ed98..a6b62d17bc4e6aa9ac34540d80911fa8b0865294 100644 (file)
 
 extern crate coherence_copy_like_lib as lib;
 
-use std::marker::MarkerTrait;
-
 struct MyType { x: i32 }
 
-trait MyTrait : MarkerTrait { }
+trait MyTrait { }
 
 impl<T: lib::MyCopy> MyTrait for T { } //~ ERROR E0119
 
index f768a475ee820701332512b21ed921a36fd433e0..5a9f440f8bb6a98900bb406b1976d6a056232c1b 100644 (file)
 
 extern crate coherence_copy_like_lib as lib;
 
-use std::marker::MarkerTrait;
-
 struct MyType { x: i32 }
 
-trait MyTrait : MarkerTrait { }
+trait MyTrait { }
 impl<T: lib::MyCopy> MyTrait for T { } //~ ERROR E0119
 
 // `MyStruct` is not declared fundamental, therefore this would
index 0c78fffd2dfab2ca1a7094eb6fcf21508143f2ef..ee0d5550fd61f0ea8e514bec49a723935cf31ac6 100644 (file)
 
 extern crate coherence_copy_like_lib as lib;
 
-use std::marker::MarkerTrait;
-
 struct MyType { x: i32 }
 
-trait MyTrait : MarkerTrait { }
+trait MyTrait { }
 impl<T: lib::MyCopy> MyTrait for T { } //~ ERROR E0119
 
 // Tuples are not fundamental, therefore this would require that
index aa687266acb8f701c9bae3461bb8b71c1c63c3e8..160197368d6d983c673f924eb1508fbd62e1a3b1 100644 (file)
@@ -15,7 +15,7 @@ struct Fat<T: ?Sized> {
 }
 
 struct Foo;
-trait Bar : ::std::marker::MarkerTrait {}
+trait Bar {}
 impl Bar for Foo {}
 
 pub fn main() {
index 8ec1034bc4d28abda4abda17968fad6296a7f160..b30eada162b84707134573888de917956f8ca50c 100644 (file)
 
 // Test implicit coercions involving DSTs and raw pointers.
 
-use std::marker::MarkerTrait;
-
 struct S;
-trait T : MarkerTrait {}
+trait T {}
 impl T for S {}
 
 struct Foo<T: ?Sized> {
index 6a9c30480527470f6f6e20c018822761bf9ca44f..e116966670d2b7bda22c03def4a8c3f930e065f3 100644 (file)
@@ -8,8 +8,6 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::num::SignedInt;
-
 fn main() {
-    let _f = 10.abs; //~ ERROR attempted to take value of method
+    let _f = 10i32.abs; //~ ERROR attempted to take value of method
 }
index cd3f337c4ab658e2194dc2ab8686eaaac2105eb7..251da2c6b3ee979c020bf7e21c55d490c5a4dadd 100644 (file)
@@ -8,9 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::marker::MarkerTrait;
-
-trait Node : MarkerTrait {
+trait Node {
     fn zomg();
 }
 
index 0b846651acf46dbf0e51056e8d31742859ddeb4c..51deb99a4f2cda7747feae6e2df16f83c0f80e9e 100644 (file)
@@ -9,9 +9,8 @@
 // except according to those terms.
 
 use std::fmt::Debug;
-use std::marker::MarkerTrait;
 
-trait Str : MarkerTrait {}
+trait Str {}
 
 trait Something {
     fn yay<T: Debug>(_: Option<Self>, thing: &[T]);
index b4abef0bd280b914aa20d155a0ac18f07740f432..a3529c9ea90b671d21d9274c51166f826da4aa34 100644 (file)
@@ -8,9 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::marker::MarkerTrait;
-
-trait ListItem<'a> : MarkerTrait {
+trait ListItem<'a> {
     fn list_name() -> &'a str;
 }
 
index 60ab616d5983bf25a4dcad218fa39f5a321caf18..6300a1dc15d6015cec6aea8b0c34743a529f13f4 100644 (file)
@@ -8,9 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::marker::MarkerTrait;
-
-pub trait AbstractRenderer : MarkerTrait {}
+pub trait AbstractRenderer {}
 
 fn _create_render(_: &()) ->
     AbstractRenderer
index 271c31bd375484c6ef7c763e8c67f5079433ce75..41be78dd7b96eede5f0c9aa46bf702cad8fe9ca1 100644 (file)
@@ -8,14 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(unboxed_closures)]
-
 use std::any::Any;
 use std::any::TypeId;
-use std::marker::MarkerTrait;
 
-pub trait Pt : MarkerTrait {}
-pub trait Rt : MarkerTrait {}
+pub trait Pt {}
+pub trait Rt {}
 
 trait Private<P: Pt, R: Rt> {
     fn call(&self, p: P, r: R);
index e81a576fa63d50d9267acf4e1eb82d70ba183fd0..a662e9ca98ee812086e338e874234fd0a00a1f91 100644 (file)
@@ -8,13 +8,11 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::marker::MarkerTrait;
-
 fn add_state(op: <isize as HasState>::State) {
 //~^ ERROR the trait `HasState` is not implemented for the type `isize`
 }
 
-trait HasState : MarkerTrait {
+trait HasState {
     type State;
 }
 
index 01fc4fef03b1ddd5a4112662992e37df184108e4..d89b2c6ce8cb0221e9a64a922e4e8f683909da57 100644 (file)
@@ -8,9 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::marker::MarkerTrait;
-
-trait Foo : MarkerTrait {
+trait Foo {
     type Item;
 }
 
index 9e63cc203f4d5951a024d3cfe350d1f7f26bb9de..20bd8af7c3ef5ecf3e18cee657cfdc24276765e3 100644 (file)
 // cause compiler to loop.  Note that no instances
 // of such a type could ever be constructed.
 
-use std::marker::MarkerTrait;
-
 struct t(Box<t>); //~ ERROR this type cannot be instantiated
 
-trait to_str_2 : MarkerTrait {
+trait to_str_2 {
     fn my_to_string() -> String;
 }
 
index 5b623ac377b21260948f9ddbbb34a95dab1998f5..a38278eae2411f1c92871586e0d33d907f51faab 100644 (file)
 // away.
 
 use std::cell::RefCell;
-use std::marker::MarkerTrait;
 use std::ops::{Shl, Shr};
 
-pub trait Subscriber : MarkerTrait {
+pub trait Subscriber {
     type Input;
 }
 
index ff5ac9de8d9443872de7b03f350ba1f0c3652dc4..b77230a8b340d1dfb145b608b7c034409b9eeec3 100644 (file)
@@ -12,9 +12,7 @@
 
 #![feature(optin_builtin_traits)]
 
-use std::marker::MarkerTrait;
-
-unsafe trait Trait: MarkerTrait {
+unsafe trait Trait {
 //~^ error: traits with default impls (`e.g. unsafe impl Trait for ..`) must have no methods or associated items
     type Output;
 }
index 2b732899ea42fb222bcd21faa287520dbd955e61..026ee89c0b2b5a4dd940e0ec690a6412891516aa 100644 (file)
@@ -8,7 +8,12 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::num::ToPrimitive;
+pub trait ToPrimitive {
+    fn to_int(&self) -> isize { 0 }
+}
+
+impl ToPrimitive for i32 {}
+impl ToPrimitive for isize {}
 
 trait Add {
     fn to_int(&self) -> isize;
index d316b44794ad6e38c1a6749aad984e84060b8ace..9e324cdd61eb0e82f40308131b51c72d1d1ce360 100644 (file)
@@ -8,9 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::marker::MarkerTrait;
-
-trait I : MarkerTrait {}
+trait I {}
 type K = I+'static;
 
 fn foo(_x: K) {} //~ ERROR: the trait `core::marker::Sized` is not implemented
index b0db990619535534dc4bf8b7c5baebef9bab6203..9ff957b6e6deac4904d0d5066390bd4dd53e2803 100644 (file)
@@ -8,9 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::marker::MarkerTrait;
-
-trait A : MarkerTrait {}
+trait A {}
 
 struct Struct {
     r: A+'static
@@ -22,6 +20,6 @@ fn new_struct(r: A+'static)
     Struct { r: r }
 }
 
-trait Curve : MarkerTrait {}
+trait Curve {}
 enum E {X(Curve+'static)}
 fn main() {}
index 9c019f6ec47fb91a1d17733f737fd44083f7cc58..6b320f400a8091dcc9e8f5e31c1f7a26d009fe39 100644 (file)
 
 // Test the mechanism for warning about possible missing `self` declarations.
 
-use std::marker::MarkerTrait;
-
 trait CtxtFn {
     fn f8(self, usize) -> usize;
     fn f9(usize) -> usize; //~ NOTE candidate
 }
 
-trait OtherTrait : MarkerTrait {
+trait OtherTrait {
     fn f9(usize) -> usize; //~ NOTE candidate
 }
 
@@ -26,7 +24,7 @@ trait OtherTrait : MarkerTrait {
 // declaration to match against, so we wind up prisizeing it as a
 // candidate. This seems not unreasonable -- perhaps the user meant to
 // implement it, after all.
-trait UnusedTrait : MarkerTrait {
+trait UnusedTrait {
     fn f9(usize) -> usize; //~ NOTE candidate
 }
 
@@ -54,7 +52,7 @@ fn fff(i: isize) -> isize { //~ NOTE candidate
     }
 }
 
-trait ManyImplTrait : MarkerTrait {
+trait ManyImplTrait {
     fn is_str() -> bool { //~ NOTE candidate
         false
     }
index 1925caf6870eef80aab0daa80651683ffbbe46d8..d43ddff6b9500af1b7a8d0abcd056e7f9c418945 100644 (file)
 
 // Test which of the builtin types are considered POD.
 
-use std::marker::MarkerTrait;
 use std::rc::Rc;
 
 fn assert_copy<T:Copy>() { }
 
-trait Dummy : MarkerTrait { }
+trait Dummy { }
 
 #[derive(Copy, Clone)]
 struct MyStruct {
index fd0789421e0045fb4a5c45f25076c139a8ac7e2c..66297d70ef505cccb7e3f7f9f7c0a1dfa22bad8a 100644 (file)
@@ -10,9 +10,7 @@
 
 #![feature(box_syntax)]
 
-use std::marker::MarkerTrait;
-
-trait Foo : MarkerTrait {
+trait Foo {
 }
 
 impl<T:Copy> Foo for T {
index 0c68401bb2b955222bbd712a92ee02f8603ae50e..570f7ad7fe3bf214adae00a7ac6644053305dd6c 100644 (file)
 // in this file all test the "kind" violates detected during kindck.
 // See all `regions-bounded-by-send.rs`
 
-use std::marker::MarkerTrait;
-
 fn assert_send<T:Send>() { }
-trait Dummy : MarkerTrait { }
+trait Dummy { }
 trait Message : Send { }
 
 // careful with object types, who knows what they close over...
index f86eac8b16bd2bcfdb158fbb58315b6dd1d4c2d8..48d5215b7085be78f389d72df0139f2efa25130e 100644 (file)
 // is broken into two parts because some errors occur in distinct
 // phases in the compiler. See kindck-send-object2.rs as well!
 
-use std::marker::MarkerTrait;
-
 fn assert_send<T:Send+'static>() { }
-trait Dummy : MarkerTrait { }
+trait Dummy { }
 
 // careful with object types, who knows what they close over...
 fn test51<'a>() {
index 08516e67318ce2b5ff0e31efd4a9ef16a0eb8445..d3d166e2a6916181d24c32984ed212bca92a07e6 100644 (file)
 
 // Continue kindck-send-object1.rs.
 
-use std::marker::MarkerTrait;
-
 fn assert_send<T:Send>() { }
-trait Dummy : MarkerTrait { }
+trait Dummy { }
 
 fn test50() {
     assert_send::<&'static Dummy>(); //~ ERROR the trait `core::marker::Sync` is not implemented
index 918b4ee209ca7ac6106a3fcd18d3b7d17e7185ea..c6dc3b70bef37d881f3e12196ecb84b493cc0045 100644 (file)
@@ -105,7 +105,7 @@ impl PrivTrait for (Private<isize>,) {
     fn bar(&self) -> Private<isize> { panic!() }
 }
 
-pub trait ParamTrait<T> : marker::MarkerTrait {
+pub trait ParamTrait<T> {
     fn foo() -> T;
 }
 
index 607ab13d122015d6f8ff42e92c56a5a3d5ed8062..efbf3782f9796a4b34ed979e293f60837032e67e 100644 (file)
@@ -11,9 +11,7 @@
 // Test that an object type `Box<Foo>` is not considered to implement the
 // trait `Foo`. Issue #5087.
 
-use std::marker::MarkerTrait;
-
-trait Foo : MarkerTrait {}
+trait Foo {}
 fn take_foo<F:Foo>(f: F) {}
 fn take_object(f: Box<Foo>) { take_foo(f); }
 //~^ ERROR the trait `Foo` is not implemented
index aae829ec7b5636c124b55bd953b59f78cbcff1fe..6a010d49692d26450a4d95225eb3695c4509b0cd 100644 (file)
@@ -11,7 +11,7 @@
 // Check that we correctly prevent users from making trait objects
 // from traits with static methods.
 
-trait Foo : ::std::marker::MarkerTrait {
+trait Foo {
     fn foo();
 }
 
index c912d084daa86f1ad4ddf3b09b7f452d6f9f1f58..071b4db40f86f5c7a60a4869093715f993a6d90f 100644 (file)
@@ -14,9 +14,9 @@
 
 #![feature(optin_builtin_traits)]
 
-use std::marker::{MarkerTrait, PhantomData};
+use std::marker::{PhantomData};
 
-unsafe trait Zen: MarkerTrait {}
+unsafe trait Zen {}
 
 unsafe impl Zen for .. {}
 
index 67bb566ea682c07b1568202a6c213156d3a92d46..7fe0574ab7d9a663902dd9433fcc6a01145f3b4c 100644 (file)
@@ -17,9 +17,7 @@
 
 // public type, private value
 pub mod foo1 {
-    use std::marker::MarkerTrait;
-
-    pub trait Bar : MarkerTrait {
+    pub trait Bar {
     }
     pub struct Baz;
 
@@ -41,7 +39,7 @@ fn test_list1() {
 
 // private type, public value
 pub mod foo2 {
-    trait Bar : ::std::marker::MarkerTrait {
+    trait Bar {
     }
     pub struct Baz;
 
@@ -62,7 +60,7 @@ fn test_list2() {
 
 // neither public
 pub mod foo3 {
-    trait Bar : ::std::marker::MarkerTrait {
+    trait Bar {
     }
     pub struct Baz;
 
index 1bb2bb5a15450f3aa774ded692b1ac6f0e610626..f95ee405895a9c78cd286b54e98e09ea255d2fc5 100644 (file)
@@ -11,7 +11,7 @@
 // Test that attempts to implicitly coerce a value into an
 // object respect the lifetime bound on the object type.
 
-trait Foo : ::std::marker::MarkerTrait {}
+trait Foo {}
 impl<'a> Foo for &'a [u8] {}
 
 // FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
index f80b0ffa5aadf09eb20cc9447601b900dc949f3c..fdc97ecaf21e271949bed51a125266d3cefb9781 100644 (file)
@@ -12,9 +12,7 @@
 
 // FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
 
-use std::marker::MarkerTrait;
-
-trait X : MarkerTrait {}
+trait X {}
 
 trait Iter {
     type Item: X;
index 2341d2397c9b04d5f635fe6ade7e86c675ae5853..25b8137d29cade512868ecfdaa54e2a228611ea8 100644 (file)
@@ -10,9 +10,7 @@
 
 #![feature(box_syntax)]
 
-use std::marker::MarkerTrait;
-
-trait Foo : MarkerTrait { }
+trait Foo { }
 
 impl<'a> Foo for &'a isize { }
 
index 1fd711ca4fb2c4eb898df30eaacf112ae0307693..b864e6ca9578b7878d0b62a1bb6d7279a3173ad3 100644 (file)
@@ -8,7 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-trait TraitNotAStruct : ::std::marker::MarkerTrait { }
+trait TraitNotAStruct {}
 
 fn main() {
     TraitNotAStruct{ value: 0 };
index ce0a7d3bb36cf1bca80b0de8ba253f9450c2335d..c18c5b386e8b21816be1abd6ff4e38818ea86978 100644 (file)
@@ -8,9 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::marker::MarkerTrait;
-
-trait Trait : MarkerTrait {}
+trait Trait {}
 
 struct Foo<T:Trait> {
     x: T,
index e4058a0943aadb770f92e4edfe031b2fd91c18f7..0a36fcbed690513e6137d88b715b87db25dd8de6 100644 (file)
@@ -10,9 +10,7 @@
 
 // Tests for "default" bounds inferred for traits with no bounds list.
 
-use std::marker::MarkerTrait;
-
-trait Foo : MarkerTrait {}
+trait Foo {}
 
 fn a(_x: Box<Foo+Send>) {
 }
index 2f4793b4d888f094ea5eaf8fa4594608d640def9..dadcbd5bce710291c706ad4a4209374352549d1b 100644 (file)
@@ -12,9 +12,7 @@
 // trait impl is only applied to a trait object, not concrete types which implement
 // the trait.
 
-use std::marker::MarkerTrait;
-
-trait T : MarkerTrait {}
+trait T {}
 
 impl<'a> T+'a {
     fn foo(&self) {}
index 88d8788d63a3de54bdcdc0f8dc3b1313558f709a..155b835bbc6e0704d4e24657cb40398c6d7f7615 100644 (file)
@@ -8,9 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-use std::num::Int;
+use std::ops::Add;
 
-trait BrokenAdd: Int {
+trait BrokenAdd: Copy + Add<Output=Self> {
     fn broken_add<T>(&self, rhs: T) -> Self {
         *self + rhs //~  ERROR mismatched types
                     //~| expected `Self`
@@ -20,7 +20,7 @@ fn broken_add<T>(&self, rhs: T) -> Self {
     }
 }
 
-impl<T: Int> BrokenAdd for T {}
+impl<T: Copy + Add<Output=T>> BrokenAdd for T {}
 
 pub fn main() {
     let foo: u8 = 0;
index 0f3453da43137ef6892aed003a15005e7c0fed69..a27f7f7ebbe0f4b405d5d701bbb8309bd9de464f 100644 (file)
@@ -10,9 +10,7 @@
 
 #![feature(optin_builtin_traits)]
 
-use std::marker::MarkerTrait;
-
-trait MyTrait: MarkerTrait {}
+trait MyTrait {}
 
 impl MyTrait for .. {}
 
index 524f467e017002c21a36e0f92530ffb5fa0c36e6..24819bb4f08d63a51f7db7752df8bfbdf14766f3 100644 (file)
@@ -10,9 +10,7 @@
 
 #![feature(optin_builtin_traits)]
 
-use std::marker::MarkerTrait;
-
-trait MyTrait: MarkerTrait {}
+trait MyTrait {}
 
 impl MyTrait for .. {}
 impl<T> !MyTrait for *mut T {}
index a1ca0e3e0fada28d79303481a32dedf925a282e1..4b91d0b7a736c6f1c1f5d4b692c23fa854333894 100644 (file)
 
 #![feature(optin_builtin_traits)]
 
-use std::marker::MarkerTrait;
-
-trait MyTrait: MarkerTrait {}
+trait MyTrait {}
 
 impl MyTrait for .. {}
 
-unsafe trait MyUnsafeTrait: MarkerTrait {}
+unsafe trait MyUnsafeTrait {}
 
 unsafe impl MyUnsafeTrait for .. {}
 
index 4006eb2e83ed92383d1e755b09c398c2b24e459b..c67fc92313c3a58d29e714db80e0b8003cb55419 100644 (file)
 
 #![feature(optin_builtin_traits)]
 
-use std::marker::MarkerTrait;
-
-trait Defaulted : MarkerTrait { }
+trait Defaulted { }
 impl Defaulted for .. { }
 impl<'a,T:Signed> Defaulted for &'a T { }
 impl<'a,T:Signed> Defaulted for &'a mut T { }
 fn is_defaulted<T:Defaulted>() { }
 
-trait Signed : MarkerTrait { }
+trait Signed { }
 impl Signed for i32 { }
 
 fn main() {
index 4a6a77ac7b440950c3c7b4df4a337977ae1bb4cf..aa918119fbceef87840dcd9cb859562c23a51442 100644 (file)
@@ -13,8 +13,6 @@
 
 #![feature(optin_builtin_traits)]
 
-use std::marker::MarkerTrait;
-
 trait MyTrait : 'static {}
 
 impl MyTrait for .. {}
index 7f24058e475facaae3e247488dae5a3e89d06299..c9bfdff6c0e495cd78a089e0d4b2d96fcc2fe421 100644 (file)
@@ -13,9 +13,7 @@
 
 #![feature(optin_builtin_traits)]
 
-use std::marker::MarkerTrait;
-
-trait NotImplemented: MarkerTrait { }
+trait NotImplemented { }
 
 trait MyTrait : NotImplemented {}
 
index c970aaaf5d471ce69254c4338234d0ea206499db..4f572e87639f051208ba7efa78d14a961e8e35ab 100644 (file)
 
 #![feature(optin_builtin_traits)]
 
-use std::marker::MarkerTrait;
+trait NotImplemented { }
 
-trait NotImplemented: MarkerTrait { }
-
-trait MyTrait: MarkerTrait
+trait MyTrait
     where Option<Self> : NotImplemented
 {}
 
index f31a6ffdc0d7caed0084f23af4f661bd4df45f64..3f18f359d306e711ee4be2c654e0382d38a8d8c7 100644 (file)
@@ -10,9 +10,7 @@
 
 // Test `?Sized` local variables.
 
-use std::marker;
-
-trait T : marker::MarkerTrait { }
+trait T {}
 
 fn f1<X: ?Sized>(x: &X) {
     let _: X; // <-- this is OK, no bindings created, no initializer.
index 6ea3d0720eeeb716e3ae07325963865ce5d70b0e..0245a1b5cf2c8628e39abbf80b87c47d5c868b88 100644 (file)
@@ -10,9 +10,7 @@
 
 // Test sized-ness checking in substitution in impls.
 
-use std::marker::MarkerTrait;
-
-trait T : MarkerTrait {}
+trait T {}
 
 // I would like these to fail eventually.
 // impl - bounded
index fe0f32d97d6b102c07e0d49cd80293934503436c..4d75e58aad938a05cb65590936ea8f9636c78e7c 100644 (file)
@@ -25,8 +25,6 @@
 use sub::sub2;
 use sub::sub2::nested_struct as sub_struct;
 use std::num::One;
-use std::num::cast;
-use std::num::{from_int,from_i8,from_i32};
 
 use std::mem::size_of;
 
@@ -42,7 +40,6 @@ fn test_alias<I: Iterator>(i: Option<<I as Iterator>::Item>) {
 
     // import tests
     fn foo(x: &One) {}
-    let _: Option<u8> = from_i32(45);
 
     let x = 42;
 
index 06521e0ec78e8164d3d37dbbb0f37cf31326ae09..2617a05fe24141e42a33e7aa438fff4e5a7807b1 100644 (file)
@@ -8,12 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![feature(core)]
-
-use std::marker::MarkerTrait;
-
-trait Foo : MarkerTrait {
+trait Foo {
     type T;
 }
 
index a601dc0739a467715a400448c1fd4945a0f9c7bd..c93a0b76a95600c31ec10a6a7be9089f6f5de019 100644 (file)
 
 // pretty-expanded FIXME #23616
 
-#![feature(core)]
-
-use std::marker::MarkerTrait;
-
 impl X for f64 { type Y = isize; }
-trait X : MarkerTrait { type Y; }
+trait X { type Y; }
 fn main() {}
index a26b428a4eacf2db945eb1b0654ff920bc31b996..83f0d360e6122cd7b6f5572ecb8af8c1267efa01 100644 (file)
 
 #![feature(core)]
 
-use std::marker::MarkerTrait;
 use std::slice;
 
-trait Bound : MarkerTrait {}
+trait Bound {}
 
 impl<'a> Bound for &'a i32 {}
 
index d95ad2e883471dacb595f5db819e22428758ff6f..7e2d1aa23149dea229d017bbac6c56951b5bc58a 100644 (file)
 
 // pretty-expanded FIXME #23616
 
-#![feature(core)]
 #![allow(dead_code)]
 
-use std::marker::MarkerTrait;
-
-pub trait Integral : MarkerTrait {
+pub trait Integral {
     type Opposite;
 }
 
index dfd468884a167ec2df94020703dfb1b3c615d3da..1830b41d0b50681ee7a986b259ae0ca1d7e4655a 100644 (file)
 // `Item` originates in a where-clause, not the declaration of
 // `T`. Issue #20300.
 
-
-#![feature(core)]
-
-use std::marker::{MarkerTrait, PhantomData};
+use std::marker::{PhantomData};
 use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT};
 use std::sync::atomic::Ordering::SeqCst;
 
 static COUNTER: AtomicUsize = ATOMIC_USIZE_INIT;
 
 // Preamble.
-trait Trait : MarkerTrait { type Item; }
+trait Trait { type Item; }
 struct Struct;
 impl Trait for Struct {
     type Item = u32;
index 4b32ee352311d1d50c3eefa7c585a2e1b4d32807..a29953bea887bbb0869515b499ac1347c673639c 100644 (file)
@@ -11,7 +11,6 @@
 
 macro_rules! assert_approx_eq {
     ($a:expr, $b:expr) => ({
-        use std::num::Float;
         let (a, b) = (&$a, &$b);
         assert!((*a - *b).abs() < 1.0e-6,
                 "{} is not approximately equal to {}", *a, *b);
index fbc6c28fd4a580e6e43e208aa5cdbe385d3cd773..0234d7b0b6376e06fa6d4982a597ee0ee8d5fb5a 100644 (file)
@@ -31,7 +31,6 @@ enum Bar {
     Quux(u32),
 }
 
-#[derive(FromPrimitive)]
 enum Baz { A=0, B=5, }
 
 fn main() {
diff --git a/src/test/run-pass/deriving-primitive.rs b/src/test/run-pass/deriving-primitive.rs
deleted file mode 100644 (file)
index 4399d74..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-// Copyright 2013-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(core)]
-
-use std::num::FromPrimitive;
-use std::isize;
-
-#[derive(PartialEq, FromPrimitive, Debug)]
-enum A {
-    Foo = isize::MAX,
-    Bar = 1,
-    Baz = 3,
-    Qux,
-}
-
-pub fn main() {
-    let x: Option<A> = FromPrimitive::from_int(isize::MAX);
-    assert_eq!(x, Some(A::Foo));
-
-    let x: Option<A> = FromPrimitive::from_int(1);
-    assert_eq!(x, Some(A::Bar));
-
-    let x: Option<A> = FromPrimitive::from_int(3);
-    assert_eq!(x, Some(A::Baz));
-
-    let x: Option<A> = FromPrimitive::from_int(4);
-    assert_eq!(x, Some(A::Qux));
-
-    let x: Option<A> = FromPrimitive::from_int(5);
-    assert_eq!(x, None);
-}
index 7bd292e66f2585975499986084be4eb6fd63132d..0a490466ef73b3f109b38b62e50ed2e7c9402fdc 100644 (file)
@@ -10,8 +10,8 @@
 
 // pretty-expanded FIXME #23616
 
-use std::num::Int;
+use std::ops::Add;
 
-fn wsucc<T:Int>(n: T) -> T { n + { return n } }
+fn wsucc<T:Add<Output=T> + Copy>(n: T) -> T { n + { return n } }
 
 pub fn main() { }
diff --git a/src/test/run-pass/exponential-notation.rs b/src/test/run-pass/exponential-notation.rs
deleted file mode 100644 (file)
index 4d54bb4..0000000
+++ /dev/null
@@ -1,39 +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(std_misc)]
-
-use std::num::strconv::ExponentFormat::{ExpBin, ExpDec};
-use std::num::strconv::SignificantDigits::DigMax;
-use std::num::strconv::SignFormat::{SignAll, SignNeg};
-use std::num::strconv::float_to_str_common as to_string;
-
-macro_rules! t {
-    ($a:expr, $b:expr) => { { let (r, _) = $a; assert_eq!(r, $b.to_string()); } }
-}
-
-pub fn main() {
-    // Basic usage
-    t!(to_string(1.2345678e-5f64, 10, true, SignNeg, DigMax(6), ExpDec, false),
-             "1.234568e-5");
-
-    // Hexadecimal output
-    t!(to_string(7.281738281250e+01f64, 16, true, SignAll, DigMax(6), ExpBin, false),
-              "+1.2345p+6");
-    t!(to_string(-1.777768135071e-02f64, 16, true, SignAll, DigMax(6), ExpBin, false),
-             "-1.2345p-6");
-
-    // Some denormals
-    t!(to_string(4.9406564584124654e-324f64, 10, true, SignNeg, DigMax(6), ExpBin, false),
-             "1p-1074");
-    t!(to_string(2.2250738585072009e-308f64, 10, true, SignNeg, DigMax(6), ExpBin, false),
-             "1p-1022");
-}
index 28a076113d1f093d257e1e86a1ab8014013fa45f..421b19f2864fe6050edbf81576e87640adba5567 100644 (file)
@@ -8,12 +8,7 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![feature(core)]
-
-use std::marker::MarkerTrait;
-
-trait A : MarkerTrait {
+trait A {
     extern "fastcall" fn test1(i: i32);
     extern fn test2(i: i32);
 }
index 298f2a4719db9f4ebbb84331e3fc660b441ed5d7..856599431fd18149dfec2e84e1072f0c9076b45c 100644 (file)
@@ -8,17 +8,14 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-
-#![feature(std_misc)]
-
-use std::num::Float;
+use std::f64;
 
 pub fn main() {
-  let nan: f64 = Float::nan();
+  let nan: f64 = f64::NAN;
   assert!((nan).is_nan());
 
-  let inf: f64 = Float::infinity();
-  let neg_inf: f64 = Float::neg_infinity();
+  let inf: f64 = f64::INFINITY;
+  let neg_inf: f64 = -f64::INFINITY;
   assert_eq!(-inf, neg_inf);
 
   assert!( nan !=  nan);
index 8db29ebaa6d3e90eacb40e6af37a366e95409aed..37ceaae373b9468a0c6392493be126d533b372af 100644 (file)
@@ -13,7 +13,6 @@
 
 macro_rules! assert_approx_eq {
     ($a:expr, $b:expr) => ({
-        use std::num::Float;
         let (a, b) = (&$a, &$b);
         assert!((*a - *b).abs() < 1.0e-6,
                 "{} is not approximately equal to {}", *a, *b);
index fde04efc8bad9c63f204da244196403c0c719475..b4621a2d053b1de4dae9e8d12d889575b2b75115 100644 (file)
 
 #![feature(collections)]
 
-extern crate collections;
-
 use std::collections::BitVec;
-use std::num::Float;
 
 fn main() {
     // Generate sieve of Eratosthenes for n up to 1e6
index 14de9e90306bc6b8adf31f455d1298c61fe272fd..ca68272d2d0f295f605d6df8b89f22a0f664ec49 100644 (file)
 
 // pretty-expanded FIXME #23616
 
-#![feature(core)]
-
-use std::marker::MarkerTrait;
-
-trait Foo : MarkerTrait {
+trait Foo {
     fn quux(u8) {}
 }
 
index 2469dec9947273205e9ef4e0481ba379b5a38841..4ebc43163ede894d451b8a85d612a218ff334271 100644 (file)
@@ -8,35 +8,30 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+#![feature(zero_one)]
 
-#![feature(core)]
-
-use std::num::Int;
+use std::num::Zero;
 use std::thread;
 
-// Avoid using constants, which would trigger compile-time errors.
-fn min_val<T: Int>() -> T { Int::min_value() }
-fn zero<T: Int>() -> T { Int::zero() }
-
 fn main() {
-    assert!(thread::spawn(move|| { min_val::<isize>() / -1; }).join().is_err());
-    assert!(thread::spawn(move|| { min_val::<i8>() / -1; }).join().is_err());
-    assert!(thread::spawn(move|| { min_val::<i16>() / -1; }).join().is_err());
-    assert!(thread::spawn(move|| { min_val::<i32>() / -1; }).join().is_err());
-    assert!(thread::spawn(move|| { min_val::<i64>() / -1; }).join().is_err());
-    assert!(thread::spawn(move|| { 1isize / zero::<isize>(); }).join().is_err());
-    assert!(thread::spawn(move|| { 1i8 / zero::<i8>(); }).join().is_err());
-    assert!(thread::spawn(move|| { 1i16 / zero::<i16>(); }).join().is_err());
-    assert!(thread::spawn(move|| { 1i32 / zero::<i32>(); }).join().is_err());
-    assert!(thread::spawn(move|| { 1i64 / zero::<i64>(); }).join().is_err());
-    assert!(thread::spawn(move|| { min_val::<isize>() % -1; }).join().is_err());
-    assert!(thread::spawn(move|| { min_val::<i8>() % -1; }).join().is_err());
-    assert!(thread::spawn(move|| { min_val::<i16>() % -1; }).join().is_err());
-    assert!(thread::spawn(move|| { min_val::<i32>() % -1; }).join().is_err());
-    assert!(thread::spawn(move|| { min_val::<i64>() % -1; }).join().is_err());
-    assert!(thread::spawn(move|| { 1isize % zero::<isize>(); }).join().is_err());
-    assert!(thread::spawn(move|| { 1i8 % zero::<i8>(); }).join().is_err());
-    assert!(thread::spawn(move|| { 1i16 % zero::<i16>(); }).join().is_err());
-    assert!(thread::spawn(move|| { 1i32 % zero::<i32>(); }).join().is_err());
-    assert!(thread::spawn(move|| { 1i64 % zero::<i64>(); }).join().is_err());
+    assert!(thread::spawn(move|| { isize::min_value() / -1; }).join().is_err());
+    assert!(thread::spawn(move|| { i8::min_value() / -1; }).join().is_err());
+    assert!(thread::spawn(move|| { i16::min_value() / -1; }).join().is_err());
+    assert!(thread::spawn(move|| { i32::min_value() / -1; }).join().is_err());
+    assert!(thread::spawn(move|| { i64::min_value() / -1; }).join().is_err());
+    assert!(thread::spawn(move|| { 1isize / isize::zero(); }).join().is_err());
+    assert!(thread::spawn(move|| { 1i8 / i8::zero(); }).join().is_err());
+    assert!(thread::spawn(move|| { 1i16 / i16::zero(); }).join().is_err());
+    assert!(thread::spawn(move|| { 1i32 / i32::zero(); }).join().is_err());
+    assert!(thread::spawn(move|| { 1i64 / i64::zero(); }).join().is_err());
+    assert!(thread::spawn(move|| { isize::min_value() % -1; }).join().is_err());
+    assert!(thread::spawn(move|| { i8::min_value() % -1; }).join().is_err());
+    assert!(thread::spawn(move|| { i16::min_value() % -1; }).join().is_err());
+    assert!(thread::spawn(move|| { i32::min_value() % -1; }).join().is_err());
+    assert!(thread::spawn(move|| { i64::min_value() % -1; }).join().is_err());
+    assert!(thread::spawn(move|| { 1isize % isize::zero(); }).join().is_err());
+    assert!(thread::spawn(move|| { 1i8 % i8::zero(); }).join().is_err());
+    assert!(thread::spawn(move|| { 1i16 % i16::zero(); }).join().is_err());
+    assert!(thread::spawn(move|| { 1i32 % i32::zero(); }).join().is_err());
+    assert!(thread::spawn(move|| { 1i64 % i64::zero(); }).join().is_err());
 }
index 12162ba9022aec3b0a6a07c526e0322f6124aef0..b7de1b5f4cbb536efd0a3276093f0bae9f24b05b 100644 (file)
 
 // pretty-expanded FIXME #23616
 
-#![feature(core)]
-
-use std::marker::MarkerTrait;
-
-trait Serializer : MarkerTrait {
+trait Serializer {
 }
 
 trait Serializable {
index d5f64c1c7b1aa406023621a3691f7b5fc78eed92..b1d71abc78599c0bb908e08513fa12cedb0d6df9 100644 (file)
 // necessary. Testing the methods of the impls is done within the source
 // file for each numeric type.
 
-
-#![feature(core)]
-
 use std::ops::Add;
-use std::num::ToPrimitive;
 
 pub fn main() {
 // ints
@@ -37,9 +33,4 @@ pub fn main() {
     assert_eq!(15_u16.add(6u16), 21_u16);
     assert_eq!(15_u32.add(6u32), 21_u32);
     assert_eq!(15_u64.add(6u64), 21_u64);
-
-// floats
-    // num
-    assert_eq!(10_f32.to_i32().unwrap(), 10);
-    assert_eq!(10_f64.to_i32().unwrap(), 10);
 }
index ddd6ae4d0a090cf4fcce7c5973f50b677d3bf4a3..5e924d015b619ca712aa6101f2c89794d21199a5 100644 (file)
@@ -13,7 +13,6 @@
 
 use std::cell::RefCell;
 use std::rc::Rc;
-use std::num::ToPrimitive;
 
 #[derive(PartialEq, Debug)]
 struct Point {
@@ -23,9 +22,6 @@ struct Point {
 
 pub fn main() {
     let box_5: Box<_> = box 5_usize;
-    assert_eq!(Rc::new(5_usize).to_uint(), Some(5));
-    // FIXME (#22405): Replace `Box::new` with `box` here when/if possible.
-    assert_eq!((Box::new(&Box::new(&Rc::new(Box::new(Box::new(&box_5)))))).to_uint(), Some(5));
     let point = Rc::new(Point {x: 2, y: 4});
     assert_eq!(point.x, 2);
     assert_eq!(point.y, 4);
index ba8a3f77aacefe0b65d679f6403fe70de64372db..f69b857981d788f735983ad3ebf87e70d129c181 100644 (file)
 
 // pretty-expanded FIXME #23616
 
-#![feature(optin_builtin_traits, core)]
-
-use std::marker::{MarkerTrait, Send};
+#![feature(optin_builtin_traits)]
 
 struct TestType;
 
 impl TestType {}
 
-trait TestTrait : MarkerTrait {}
+trait TestTrait {}
 
 impl !Send for TestType {}
 
index 50c9c43ba2b8ba892fb5d9348e02811cc9ee4af9..558e69664ecf9c840f74cd2f09f483ef929b9e0e 100644 (file)
@@ -10,9 +10,7 @@
 
 // pretty-expanded FIXME #23616
 
-#![feature(core)]
-
-trait Foo : ::std::marker::MarkerTrait {
+trait Foo {
 }
 
 fn b(_x: Box<Foo+Send>) {
index 60c1816b1632c2df873681e958595f964f9f23ff..bb8ae8247fa99abe9d4b36e1d0cbabde496af10a 100644 (file)
 
 #![feature(core)]
 
-trait U : ::std::marker::MarkerTrait {}
+trait U {}
 trait T<X: U> { fn get(self) -> X; }
 
-trait S2<Y: U> : ::std::marker::MarkerTrait {
+trait S2<Y: U> {
     fn m(x: Box<T<Y>+'static>) {}
 }
 
index 250390f70b448b29d9f8cecca1fbe4a002f9540f..d984e9cdc990fb3cda395eb31f0d98b39af857a1 100644 (file)
 
 // pretty-expanded FIXME #23616
 
-#![feature(core)]
-
 trait I { fn i(&self) -> Self; }
 
-trait A<T:I> : ::std::marker::MarkerTrait {
+trait A<T:I> {
     fn id(x:T) -> T { x.i() }
 }
 
 trait J<T> { fn j(&self) -> T; }
 
-trait B<T:J<T>> : ::std::marker::MarkerTrait {
+trait B<T:J<T>> {
     fn id(x:T) -> T { x.j() }
 }
 
-trait C : ::std::marker::MarkerTrait {
+trait C {
     fn id<T:J<T>>(x:T) -> T { x.j() }
 }
 
index 4af049fc0c3af92b3892ae1ff7e7816fc0680146..e5390ac8a6256c96d5c238f7a6299be828696823 100644 (file)
 
 // pretty-expanded FIXME #23616
 
-#![feature(core)]
-
-use std::cmp::{PartialEq, PartialOrd};
-use std::num::NumCast;
-
-pub trait NumExt: NumCast + PartialEq + PartialOrd {}
+pub trait NumExt: PartialEq + PartialOrd {}
 
 pub trait FloatExt: NumExt {}
 
-fn greater_than_one<T: NumExt>(n: &T) -> bool { *n > NumCast::from(1).unwrap() }
-fn greater_than_one_float<T: FloatExt>(n: &T) -> bool { *n > NumCast::from(1).unwrap() }
+fn greater_than_one<T: NumExt>(n: &T) -> bool { loop {} }
+fn greater_than_one_float<T: FloatExt>(n: &T) -> bool { loop {} }
 
 pub fn main() {}
index b7f9534935697b4f20afa7ff4ac60a92b078cee0..83c2a9ad33926281c369c1729ded5099dc684254 100644 (file)
 #![feature(core)]
 
 use std::cmp::PartialOrd;
-use std::num::NumCast;
+
+pub trait NumCast {
+    fn from(i: i32) -> Option<Self>;
+}
 
 pub trait Num {
     fn from_int(i: isize) -> Self;
index 02ebf6bfa5375afd029f202c5adca1e65f400002..14a6a9a0c664ce1fd1c5f61526db25c0ced5e6b3 100644 (file)
 
 // pretty-expanded FIXME #23616
 
-#![feature(core)]
-
-use std::cmp::PartialOrd;
-use std::num::NumCast;
+pub trait NumCast {
+    fn from(i: i32) -> Option<Self>;
+}
 
 pub trait NumExt: NumCast + PartialOrd { }
 
index 773fc387a2a34370bbff8732a942ad621c2d4755..5f8541a6da1e88c2a360eff74c0254a6389ee8d9 100644 (file)
 
 // A more complex example of numeric extensions
 
-#![feature(core)]
-
-use std::cmp::{PartialEq, PartialOrd};
-use std::num::NumCast;
-
-pub trait TypeExt : ::std::marker::MarkerTrait { }
+pub trait TypeExt {}
 
 impl TypeExt for u8 {}
 impl TypeExt for u16 {}
@@ -33,7 +28,7 @@ impl TypeExt for f32 {}
 impl TypeExt for f64 {}
 
 
-pub trait NumExt: TypeExt + PartialEq + PartialOrd + NumCast {}
+pub trait NumExt: TypeExt + PartialEq + PartialOrd {}
 
 impl NumExt for u8 {}
 impl NumExt for u16 {}
index b5cf25bc5a8f4cd6664824a9fa7c191b2f4d273d..abf8d2baf8732154115bbe5e674c73c4e22bf512 100644 (file)
@@ -8,14 +8,16 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-#![feature(core)]
-
-use std::cmp::{PartialEq, PartialOrd};
-use std::num::NumCast;
+pub trait NumCast {
+    fn from(i: i32) -> Option<Self>;
+}
 
 pub trait NumExt: PartialEq + PartialOrd + NumCast {}
 
 impl NumExt for f32 {}
+impl NumCast for f32 {
+    fn from(i: i32) -> Option<f32> { Some(i as f32) }
+}
 
 fn num_eq_one<T: NumExt>(n: T) {
     println!("{}", n == NumCast::from(1).unwrap())
index b2c3900bc0282886157664c1b0c5144a353d93ad..c6f8a5d4f1d99f98bda8a384088d0f6123528326 100644 (file)
 
 // pretty-expanded FIXME #23616
 
-#![feature(core)]
-
-use std::cmp::PartialEq;
-use std::num::NumCast;
+pub trait NumCast {
+    fn from(i: i32) -> Option<Self>;
+}
 
 pub trait NumExt: PartialEq + NumCast {}
 
 impl NumExt for f32 {}
 impl NumExt for isize {}
 
+impl NumCast for f32 {
+    fn from(i: i32) -> Option<f32> { Some(i as f32) }
+}
+impl NumCast for isize {
+    fn from(i: i32) -> Option<isize> { Some(i as isize) }
+}
+
 fn num_eq_one<T:NumExt>() -> T {
     NumCast::from(1).unwrap()
 }
index ac9485594eb3ede417355f26c172f7717cde0be9..c7e206cb474b86d81d0dbf3f66484972faf09b26 100644 (file)
@@ -10,9 +10,6 @@
 
 // Test for issue #4183: use of Self in supertraits.
 
-
-use std::num::Float as StdFloat;
-
 pub static FUZZY_EPSILON: f64 = 0.1;
 
 pub trait FuzzyEq<Eps> {
index 62feecf045b54bc6c974333538a588f1a602ad55..67bea3864a7720ffac467765398ee852071c3665 100644 (file)
@@ -8,12 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
+pub trait MyEq {}
 
-#![feature(core)]
-
-pub trait MyEq : ::std::marker::MarkerTrait { }
-
-pub trait MyNum : ::std::marker::MarkerTrait {
+pub trait MyNum {
     fn from_int(isize) -> Self;
 }
 
index d408612f9b8569e2846a5b91b950b901f38dabdd..c4944548e17f02c1eedf7113eaa4a107f4f24580 100644 (file)
 
 // pretty-expanded FIXME #23616
 
-#![feature(unboxed_closures, core)]
+pub trait ToPrimitive {
+    fn to_int(&self) {}
+}
 
-use std::num::ToPrimitive;
+impl ToPrimitive for isize {}
+impl ToPrimitive for i32 {}
+impl ToPrimitive for usize {}
 
 fn doit<T,F>(val: T, f: &F)
     where F : Fn(T)
 {
-    f.call((val,))
+    f(val)
 }
 
 pub fn main() {
index c1e1ff3cd8e93738c5404c50c52f5b0ac65d72b4..9cad7d61e32c5e6d1977ee66be876b86190166bd 100644 (file)
 
 // pretty-expanded FIXME #23616
 
-#![feature(unboxed_closures, core)]
+pub trait ToPrimitive {
+    fn to_int(&self) {}
+}
 
-use std::num::ToPrimitive;
+impl ToPrimitive for isize {}
+impl ToPrimitive for i32 {}
+impl ToPrimitive for usize {}
 
-fn doit<T>(val: T, f: &Fn(T)) { f.call((val,)) }
+fn doit<T>(val: T, f: &Fn(T)) { f(val) }
 
 pub fn main() {
     doit(0, &|x /*: isize*/ | { x.to_int(); });
index 99e2149de966a3e759a19c2d31a75fcba12dc020..bdd1932182bdcbc19507fef7bbb25abacbe81854 100644 (file)
 
 // pretty-expanded FIXME #23616
 
-#![feature(unboxed_closures, core)]
+pub trait ToPrimitive {
+    fn to_int(&self) {}
+}
 
-use std::num::ToPrimitive;
+impl ToPrimitive for isize {}
+impl ToPrimitive for i32 {}
+impl ToPrimitive for usize {}
 
 fn doit<T,F>(val: T, f: &F)
     where F : Fn(&T)
 {
-    f.call((&val,))
+    f(&val)
 }
 
 pub fn main() {
index 559afcd164148998bbdbd1f4ef955ef9d474c834..579070a295adf90a0f4c40b668701eef3ff6147d 100644 (file)
@@ -11,8 +11,6 @@
 
 #![feature(non_ascii_idents)]
 
-use std::num::Float;
-
 pub fn main() {
     let ε = 0.00001f64;
     let Π = 3.14f64;