From 0791f9f406053d84dc7136c2be015a469304d7f0 Mon Sep 17 00:00:00 2001 From: Alex Crichton Date: Fri, 17 Apr 2015 22:12:20 -0700 Subject: [PATCH] test: Fix fallout in tests --- src/test/auxiliary/issue_3907.rs | 6 +-- src/test/auxiliary/private_trait_xc.rs | 4 +- src/test/auxiliary/rustdoc-default-impl.rs | 2 +- src/test/auxiliary/svh-a-base.rs | 7 +-- src/test/auxiliary/svh-a-change-lit.rs | 7 +-- .../auxiliary/svh-a-change-significant-cfg.rs | 7 +-- .../auxiliary/svh-a-change-trait-bound.rs | 7 +-- src/test/auxiliary/svh-a-change-type-arg.rs | 7 +-- src/test/auxiliary/svh-a-change-type-ret.rs | 7 +-- .../auxiliary/svh-a-change-type-static.rs | 6 +-- src/test/auxiliary/svh-a-comment.rs | 7 +-- src/test/auxiliary/svh-a-doc.rs | 7 +-- src/test/auxiliary/svh-a-macro.rs | 7 +-- src/test/auxiliary/svh-a-no-change.rs | 7 +-- src/test/auxiliary/svh-a-redundant-cfg.rs | 7 +-- src/test/auxiliary/svh-a-whitespace.rs | 7 +-- src/test/auxiliary/trait_impl_conflict.rs | 4 +- ...lt_trait_impl_cross_crate_coherence_lib.rs | 4 +- .../associated-types-eq-expr-path.rs | 2 +- .../associated-types-issue-17359.rs | 2 +- ...sociated-types-multiple-types-one-trait.rs | 2 +- ...sociated-types-no-suitable-supertrait-2.rs | 2 +- ...associated-types-no-suitable-supertrait.rs | 2 +- .../associated-types-unconstrained.rs | 2 +- src/test/compile-fail/bad-sized.rs | 2 +- ...nket-conflicts-with-blanket-implemented.rs | 5 +- ...et-conflicts-with-blanket-unimplemented.rs | 4 +- ...herence-conflicting-negative-trait-impl.rs | 2 +- .../coherence-default-trait-impl.rs | 8 ++- ..._copy_like_err_fundamental_struct_tuple.rs | 4 +- .../coherence_copy_like_err_struct.rs | 4 +- .../coherence_copy_like_err_tuple.rs | 4 +- src/test/compile-fail/dst-bad-coerce2.rs | 2 +- src/test/compile-fail/dst-bad-coercions.rs | 4 +- src/test/compile-fail/implicit-method-bind.rs | 4 +- src/test/compile-fail/issue-13853.rs | 4 +- src/test/compile-fail/issue-14853.rs | 3 +- src/test/compile-fail/issue-16747.rs | 4 +- src/test/compile-fail/issue-18107.rs | 4 +- src/test/compile-fail/issue-18389.rs | 7 +-- src/test/compile-fail/issue-18611.rs | 4 +- src/test/compile-fail/issue-18819.rs | 4 +- src/test/compile-fail/issue-2063.rs | 4 +- src/test/compile-fail/issue-20831-debruijn.rs | 3 +- src/test/compile-fail/issue-23080-2.rs | 4 +- src/test/compile-fail/issue-3702-2.rs | 7 ++- src/test/compile-fail/issue-5035-2.rs | 4 +- src/test/compile-fail/issue-5883.rs | 6 +-- src/test/compile-fail/issue-7575.rs | 8 ++- src/test/compile-fail/kindck-copy.rs | 3 +- .../compile-fail/kindck-impl-type-params-2.rs | 4 +- src/test/compile-fail/kindck-send-object.rs | 4 +- src/test/compile-fail/kindck-send-object1.rs | 4 +- src/test/compile-fail/kindck-send-object2.rs | 4 +- .../lint-visible-private-types.rs | 2 +- .../object-does-not-impl-trait.rs | 4 +- .../compile-fail/object-safety-no-static.rs | 2 +- src/test/compile-fail/phantom-oibit.rs | 4 +- src/test/compile-fail/privacy-ns2.rs | 8 ++- .../region-object-lifetime-in-coercion.rs | 2 +- ...gions-close-associated-type-into-object.rs | 4 +- .../regions-close-over-borrowed-ref-in-obj.rs | 4 +- .../trait-as-struct-constructor.rs | 2 +- .../trait-bounds-on-structs-and-enums.rs | 4 +- src/test/compile-fail/trait-bounds-sugar.rs | 4 +- src/test/compile-fail/trait-impl-1.rs | 4 +- .../type-params-in-different-spaces-1.rs | 6 +-- ...-default-trait-impl-constituent-types-2.rs | 4 +- ...ck-default-trait-impl-constituent-types.rs | 4 +- .../typeck-default-trait-impl-negation.rs | 6 +-- .../typeck-default-trait-impl-precedence.rs | 6 +-- .../typeck-default-trait-impl-superregion.rs | 2 - .../typeck-default-trait-impl-supertrait.rs | 4 +- ...k-default-trait-impl-trait-where-clause.rs | 6 +-- src/test/compile-fail/unsized6.rs | 4 +- src/test/compile-fail/unsized7.rs | 4 +- src/test/run-make/save-analysis/foo.rs | 3 -- src/test/run-pass/associated-types-basic.rs | 7 +-- .../run-pass/associated-types-issue-20371.rs | 6 +-- .../associated-types-nested-projections.rs | 3 +- ...iated-types-normalize-in-bounds-binding.rs | 5 +- ...om-type-param-via-bound-in-where-clause.rs | 7 +-- src/test/run-pass/const-binops.rs | 1 - src/test/run-pass/derive-no-std.rs | 1 - src/test/run-pass/deriving-primitive.rs | 39 --------------- src/test/run-pass/early-ret-binop-add.rs | 4 +- src/test/run-pass/exponential-notation.rs | 39 --------------- src/test/run-pass/extern-methods.rs | 7 +-- src/test/run-pass/float-nan.rs | 11 ++--- src/test/run-pass/intrinsics-math.rs | 1 - src/test/run-pass/issue-11736.rs | 3 -- src/test/run-pass/issue-13105.rs | 6 +-- src/test/run-pass/issue-8460.rs | 49 +++++++++---------- ...nomorphized-callees-with-ty-params-3314.rs | 6 +-- .../run-pass/numeric-method-autoexport.rs | 9 ---- src/test/run-pass/overloaded-autoderef.rs | 4 -- src/test/run-pass/syntax-trait-polarity.rs | 6 +-- src/test/run-pass/trait-bounds-basic.rs | 4 +- .../trait-bounds-on-structs-and-enums.rs | 4 +- src/test/run-pass/trait-bounds-recursion.rs | 8 ++- src/test/run-pass/trait-inheritance-num.rs | 11 ++--- src/test/run-pass/trait-inheritance-num0.rs | 5 +- src/test/run-pass/trait-inheritance-num1.rs | 7 ++- src/test/run-pass/trait-inheritance-num2.rs | 9 +--- src/test/run-pass/trait-inheritance-num3.rs | 10 ++-- src/test/run-pass/trait-inheritance-num5.rs | 14 ++++-- .../trait-inheritance-self-in-supertype.rs | 3 -- .../run-pass/trait-inheritance-static2.rs | 7 +-- ...nfer-argument-types-from-expected-bound.rs | 10 ++-- ...rgument-types-from-expected-object-type.rs | 10 ++-- ...-with-bound-regions-from-expected-bound.rs | 10 ++-- src/test/run-pass/utf8_idents.rs | 2 - 112 files changed, 205 insertions(+), 466 deletions(-) delete mode 100644 src/test/run-pass/deriving-primitive.rs delete mode 100644 src/test/run-pass/exponential-notation.rs diff --git a/src/test/auxiliary/issue_3907.rs b/src/test/auxiliary/issue_3907.rs index 3d5e52d709df3..6472c08c22296 100644 --- a/src/test/auxiliary/issue_3907.rs +++ b/src/test/auxiliary/issue_3907.rs @@ -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(); } diff --git a/src/test/auxiliary/private_trait_xc.rs b/src/test/auxiliary/private_trait_xc.rs index dc08033602c99..37ee10c8d3733 100644 --- a/src/test/auxiliary/private_trait_xc.rs +++ b/src/test/auxiliary/private_trait_xc.rs @@ -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 {} diff --git a/src/test/auxiliary/rustdoc-default-impl.rs b/src/test/auxiliary/rustdoc-default-impl.rs index 8f11629be6cc8..c2ff7a0054f19 100644 --- a/src/test/auxiliary/rustdoc-default-impl.rs +++ b/src/test/auxiliary/rustdoc-default-impl.rs @@ -14,7 +14,7 @@ pub mod bar { use std::marker; - pub trait Bar: marker::MarkerTrait + 'static {} + pub trait Bar: 'static {} impl Bar for .. {} diff --git a/src/test/auxiliary/svh-a-base.rs b/src/test/auxiliary/svh-a-base.rs index 7e10d2158ede0..31a97f695f06c 100644 --- a/src/test/auxiliary/svh-a-base.rs +++ b/src/test/auxiliary/svh-a-base.rs @@ -14,16 +14,13 @@ //! (#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 () {} diff --git a/src/test/auxiliary/svh-a-change-lit.rs b/src/test/auxiliary/svh-a-change-lit.rs index c5f3880551165..5339fc8295c6f 100644 --- a/src/test/auxiliary/svh-a-change-lit.rs +++ b/src/test/auxiliary/svh-a-change-lit.rs @@ -14,16 +14,13 @@ //! (#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 () {} diff --git a/src/test/auxiliary/svh-a-change-significant-cfg.rs b/src/test/auxiliary/svh-a-change-significant-cfg.rs index 3168e747eb6e6..2a5d9446f879a 100644 --- a/src/test/auxiliary/svh-a-change-significant-cfg.rs +++ b/src/test/auxiliary/svh-a-change-significant-cfg.rs @@ -14,16 +14,13 @@ //! (#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 () {} diff --git a/src/test/auxiliary/svh-a-change-trait-bound.rs b/src/test/auxiliary/svh-a-change-trait-bound.rs index f86a43494f78e..61f2f2803ab18 100644 --- a/src/test/auxiliary/svh-a-change-trait-bound.rs +++ b/src/test/auxiliary/svh-a-change-trait-bound.rs @@ -14,16 +14,13 @@ //! (#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 () {} diff --git a/src/test/auxiliary/svh-a-change-type-arg.rs b/src/test/auxiliary/svh-a-change-type-arg.rs index dc412b700447b..270ce95be2bb6 100644 --- a/src/test/auxiliary/svh-a-change-type-arg.rs +++ b/src/test/auxiliary/svh-a-change-type-arg.rs @@ -14,16 +14,13 @@ //! (#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 () {} diff --git a/src/test/auxiliary/svh-a-change-type-ret.rs b/src/test/auxiliary/svh-a-change-type-ret.rs index 0cfcbbb0554e6..de4cc85a7dc47 100644 --- a/src/test/auxiliary/svh-a-change-type-ret.rs +++ b/src/test/auxiliary/svh-a-change-type-ret.rs @@ -14,16 +14,13 @@ //! (#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 () {} diff --git a/src/test/auxiliary/svh-a-change-type-static.rs b/src/test/auxiliary/svh-a-change-type-static.rs index e1e32095b5cb4..62f7986f1c3bd 100644 --- a/src/test/auxiliary/svh-a-change-type-static.rs +++ b/src/test/auxiliary/svh-a-change-type-static.rs @@ -16,14 +16,12 @@ #![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 () {} diff --git a/src/test/auxiliary/svh-a-comment.rs b/src/test/auxiliary/svh-a-comment.rs index 9fd97376b6681..22e40822eecfc 100644 --- a/src/test/auxiliary/svh-a-comment.rs +++ b/src/test/auxiliary/svh-a-comment.rs @@ -14,16 +14,13 @@ //! (#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 () {} diff --git a/src/test/auxiliary/svh-a-doc.rs b/src/test/auxiliary/svh-a-doc.rs index e64bde096b016..3d8a728967a4a 100644 --- a/src/test/auxiliary/svh-a-doc.rs +++ b/src/test/auxiliary/svh-a-doc.rs @@ -14,16 +14,13 @@ //! (#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 () {} diff --git a/src/test/auxiliary/svh-a-macro.rs b/src/test/auxiliary/svh-a-macro.rs index b16338f1e128c..41d7eb7b18645 100644 --- a/src/test/auxiliary/svh-a-macro.rs +++ b/src/test/auxiliary/svh-a-macro.rs @@ -14,16 +14,13 @@ //! (#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 () {} diff --git a/src/test/auxiliary/svh-a-no-change.rs b/src/test/auxiliary/svh-a-no-change.rs index 7e10d2158ede0..31a97f695f06c 100644 --- a/src/test/auxiliary/svh-a-no-change.rs +++ b/src/test/auxiliary/svh-a-no-change.rs @@ -14,16 +14,13 @@ //! (#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 () {} diff --git a/src/test/auxiliary/svh-a-redundant-cfg.rs b/src/test/auxiliary/svh-a-redundant-cfg.rs index 8cadd7bdf4174..e405c337abe4a 100644 --- a/src/test/auxiliary/svh-a-redundant-cfg.rs +++ b/src/test/auxiliary/svh-a-redundant-cfg.rs @@ -14,16 +14,13 @@ //! (#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 () {} diff --git a/src/test/auxiliary/svh-a-whitespace.rs b/src/test/auxiliary/svh-a-whitespace.rs index fcaf77909554d..9ef788c984273 100644 --- a/src/test/auxiliary/svh-a-whitespace.rs +++ b/src/test/auxiliary/svh-a-whitespace.rs @@ -14,16 +14,13 @@ //! (#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 () {} diff --git a/src/test/auxiliary/trait_impl_conflict.rs b/src/test/auxiliary/trait_impl_conflict.rs index 0adedfd4eeb22..c3ecbb014dc6b 100644 --- a/src/test/auxiliary/trait_impl_conflict.rs +++ b/src/test/auxiliary/trait_impl_conflict.rs @@ -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 { diff --git a/src/test/auxiliary/typeck_default_trait_impl_cross_crate_coherence_lib.rs b/src/test/auxiliary/typeck_default_trait_impl_cross_crate_coherence_lib.rs index 5a7a3e7bcc694..2e425ac96c55f 100644 --- a/src/test/auxiliary/typeck_default_trait_impl_cross_crate_coherence_lib.rs +++ b/src/test/auxiliary/typeck_default_trait_impl_cross_crate_coherence_lib.rs @@ -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 } diff --git a/src/test/compile-fail/associated-types-eq-expr-path.rs b/src/test/compile-fail/associated-types-eq-expr-path.rs index 0d68b960f3135..1f9dfdb18470b 100644 --- a/src/test/compile-fail/associated-types-eq-expr-path.rs +++ b/src/test/compile-fail/associated-types-eq-expr-path.rs @@ -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; } diff --git a/src/test/compile-fail/associated-types-issue-17359.rs b/src/test/compile-fail/associated-types-issue-17359.rs index 5c36e3356a5c0..82258f124d323 100644 --- a/src/test/compile-fail/associated-types-issue-17359.rs +++ b/src/test/compile-fail/associated-types-issue-17359.rs @@ -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; } diff --git a/src/test/compile-fail/associated-types-multiple-types-one-trait.rs b/src/test/compile-fail/associated-types-multiple-types-one-trait.rs index 5632f148da67c..9436f825de89d 100644 --- a/src/test/compile-fail/associated-types-multiple-types-one-trait.rs +++ b/src/test/compile-fail/associated-types-multiple-types-one-trait.rs @@ -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; } diff --git a/src/test/compile-fail/associated-types-no-suitable-supertrait-2.rs b/src/test/compile-fail/associated-types-no-suitable-supertrait-2.rs index 5f1cd2444d3c4..bda16c8a85de1 100644 --- a/src/test/compile-fail/associated-types-no-suitable-supertrait-2.rs +++ b/src/test/compile-fail/associated-types-no-suitable-supertrait-2.rs @@ -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; } diff --git a/src/test/compile-fail/associated-types-no-suitable-supertrait.rs b/src/test/compile-fail/associated-types-no-suitable-supertrait.rs index 24429a482057c..233532a608580 100644 --- a/src/test/compile-fail/associated-types-no-suitable-supertrait.rs +++ b/src/test/compile-fail/associated-types-no-suitable-supertrait.rs @@ -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; } diff --git a/src/test/compile-fail/associated-types-unconstrained.rs b/src/test/compile-fail/associated-types-unconstrained.rs index 8832028f9aba1..aecbf217a5b25 100644 --- a/src/test/compile-fail/associated-types-unconstrained.rs +++ b/src/test/compile-fail/associated-types-unconstrained.rs @@ -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; } diff --git a/src/test/compile-fail/bad-sized.rs b/src/test/compile-fail/bad-sized.rs index 5878e9a9f649b..fca74e457c21e 100644 --- a/src/test/compile-fail/bad-sized.rs +++ b/src/test/compile-fail/bad-sized.rs @@ -10,7 +10,7 @@ use std::cell::RefCell; -trait Trait : ::std::marker::MarkerTrait {} +trait Trait {} pub fn main() { let x: Vec = Vec::new(); diff --git a/src/test/compile-fail/coherence-blanket-conflicts-with-blanket-implemented.rs b/src/test/compile-fail/coherence-blanket-conflicts-with-blanket-implemented.rs index 98a9c713e84c3..b771b959d3e50 100644 --- a/src/test/compile-fail/coherence-blanket-conflicts-with-blanket-implemented.rs +++ b/src/test/compile-fail/coherence-blanket-conflicts-with-blanket-implemented.rs @@ -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 { } diff --git a/src/test/compile-fail/coherence-blanket-conflicts-with-blanket-unimplemented.rs b/src/test/compile-fail/coherence-blanket-conflicts-with-blanket-unimplemented.rs index 57d25a3bf586d..d3b0e7f10b91b 100644 --- a/src/test/compile-fail/coherence-blanket-conflicts-with-blanket-unimplemented.rs +++ b/src/test/compile-fail/coherence-blanket-conflicts-with-blanket-unimplemented.rs @@ -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 MyTrait for T { //~ ERROR E0119 fn get(&self) -> usize { 0 } diff --git a/src/test/compile-fail/coherence-conflicting-negative-trait-impl.rs b/src/test/compile-fail/coherence-conflicting-negative-trait-impl.rs index a225f6cf47304..55c9ba2a0e89a 100644 --- a/src/test/compile-fail/coherence-conflicting-negative-trait-impl.rs +++ b/src/test/compile-fail/coherence-conflicting-negative-trait-impl.rs @@ -10,7 +10,7 @@ #![feature(optin_builtin_traits)] -trait MyTrait : ::std::marker::MarkerTrait {} +trait MyTrait {} struct TestType(::std::marker::PhantomData); diff --git a/src/test/compile-fail/coherence-default-trait-impl.rs b/src/test/compile-fail/coherence-default-trait-impl.rs index 062a4a43b694b..cccc8b05b3038 100644 --- a/src/test/compile-fail/coherence-default-trait-impl.rs +++ b/src/test/compile-fail/coherence-default-trait-impl.rs @@ -10,21 +10,19 @@ #![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 diff --git a/src/test/compile-fail/coherence_copy_like_err_fundamental_struct_tuple.rs b/src/test/compile-fail/coherence_copy_like_err_fundamental_struct_tuple.rs index c4e95e772356a..a6b62d17bc4e6 100644 --- a/src/test/compile-fail/coherence_copy_like_err_fundamental_struct_tuple.rs +++ b/src/test/compile-fail/coherence_copy_like_err_fundamental_struct_tuple.rs @@ -17,11 +17,9 @@ extern crate coherence_copy_like_lib as lib; -use std::marker::MarkerTrait; - struct MyType { x: i32 } -trait MyTrait : MarkerTrait { } +trait MyTrait { } impl MyTrait for T { } //~ ERROR E0119 diff --git a/src/test/compile-fail/coherence_copy_like_err_struct.rs b/src/test/compile-fail/coherence_copy_like_err_struct.rs index f768a475ee820..5a9f440f8bb6a 100644 --- a/src/test/compile-fail/coherence_copy_like_err_struct.rs +++ b/src/test/compile-fail/coherence_copy_like_err_struct.rs @@ -15,11 +15,9 @@ extern crate coherence_copy_like_lib as lib; -use std::marker::MarkerTrait; - struct MyType { x: i32 } -trait MyTrait : MarkerTrait { } +trait MyTrait { } impl MyTrait for T { } //~ ERROR E0119 // `MyStruct` is not declared fundamental, therefore this would diff --git a/src/test/compile-fail/coherence_copy_like_err_tuple.rs b/src/test/compile-fail/coherence_copy_like_err_tuple.rs index 0c78fffd2dfab..ee0d5550fd61f 100644 --- a/src/test/compile-fail/coherence_copy_like_err_tuple.rs +++ b/src/test/compile-fail/coherence_copy_like_err_tuple.rs @@ -15,11 +15,9 @@ extern crate coherence_copy_like_lib as lib; -use std::marker::MarkerTrait; - struct MyType { x: i32 } -trait MyTrait : MarkerTrait { } +trait MyTrait { } impl MyTrait for T { } //~ ERROR E0119 // Tuples are not fundamental, therefore this would require that diff --git a/src/test/compile-fail/dst-bad-coerce2.rs b/src/test/compile-fail/dst-bad-coerce2.rs index aa687266acb8f..160197368d6d9 100644 --- a/src/test/compile-fail/dst-bad-coerce2.rs +++ b/src/test/compile-fail/dst-bad-coerce2.rs @@ -15,7 +15,7 @@ struct Fat { } struct Foo; -trait Bar : ::std::marker::MarkerTrait {} +trait Bar {} impl Bar for Foo {} pub fn main() { diff --git a/src/test/compile-fail/dst-bad-coercions.rs b/src/test/compile-fail/dst-bad-coercions.rs index 8ec1034bc4d28..b30eada162b84 100644 --- a/src/test/compile-fail/dst-bad-coercions.rs +++ b/src/test/compile-fail/dst-bad-coercions.rs @@ -10,10 +10,8 @@ // 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 { diff --git a/src/test/compile-fail/implicit-method-bind.rs b/src/test/compile-fail/implicit-method-bind.rs index 6a9c304805274..e116966670d2b 100644 --- a/src/test/compile-fail/implicit-method-bind.rs +++ b/src/test/compile-fail/implicit-method-bind.rs @@ -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 } diff --git a/src/test/compile-fail/issue-13853.rs b/src/test/compile-fail/issue-13853.rs index cd3f337c4ab65..251da2c6b3ee9 100644 --- a/src/test/compile-fail/issue-13853.rs +++ b/src/test/compile-fail/issue-13853.rs @@ -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(); } diff --git a/src/test/compile-fail/issue-14853.rs b/src/test/compile-fail/issue-14853.rs index 0b846651acf46..51deb99a4f2cd 100644 --- a/src/test/compile-fail/issue-14853.rs +++ b/src/test/compile-fail/issue-14853.rs @@ -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(_: Option, thing: &[T]); diff --git a/src/test/compile-fail/issue-16747.rs b/src/test/compile-fail/issue-16747.rs index b4abef0bd280b..a3529c9ea90b6 100644 --- a/src/test/compile-fail/issue-16747.rs +++ b/src/test/compile-fail/issue-16747.rs @@ -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; } diff --git a/src/test/compile-fail/issue-18107.rs b/src/test/compile-fail/issue-18107.rs index 60ab616d5983b..6300a1dc15d60 100644 --- a/src/test/compile-fail/issue-18107.rs +++ b/src/test/compile-fail/issue-18107.rs @@ -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 diff --git a/src/test/compile-fail/issue-18389.rs b/src/test/compile-fail/issue-18389.rs index 271c31bd37548..41be78dd7b96e 100644 --- a/src/test/compile-fail/issue-18389.rs +++ b/src/test/compile-fail/issue-18389.rs @@ -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 { fn call(&self, p: P, r: R); diff --git a/src/test/compile-fail/issue-18611.rs b/src/test/compile-fail/issue-18611.rs index e81a576fa63d5..a662e9ca98ee8 100644 --- a/src/test/compile-fail/issue-18611.rs +++ b/src/test/compile-fail/issue-18611.rs @@ -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: ::State) { //~^ ERROR the trait `HasState` is not implemented for the type `isize` } -trait HasState : MarkerTrait { +trait HasState { type State; } diff --git a/src/test/compile-fail/issue-18819.rs b/src/test/compile-fail/issue-18819.rs index 01fc4fef03b1d..d89b2c6ce8cb0 100644 --- a/src/test/compile-fail/issue-18819.rs +++ b/src/test/compile-fail/issue-18819.rs @@ -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; } diff --git a/src/test/compile-fail/issue-2063.rs b/src/test/compile-fail/issue-2063.rs index 9e63cc203f4d5..20bd8af7c3ef5 100644 --- a/src/test/compile-fail/issue-2063.rs +++ b/src/test/compile-fail/issue-2063.rs @@ -12,11 +12,9 @@ // cause compiler to loop. Note that no instances // of such a type could ever be constructed. -use std::marker::MarkerTrait; - struct t(Box); //~ ERROR this type cannot be instantiated -trait to_str_2 : MarkerTrait { +trait to_str_2 { fn my_to_string() -> String; } diff --git a/src/test/compile-fail/issue-20831-debruijn.rs b/src/test/compile-fail/issue-20831-debruijn.rs index 5b623ac377b21..a38278eae2411 100644 --- a/src/test/compile-fail/issue-20831-debruijn.rs +++ b/src/test/compile-fail/issue-20831-debruijn.rs @@ -14,10 +14,9 @@ // away. use std::cell::RefCell; -use std::marker::MarkerTrait; use std::ops::{Shl, Shr}; -pub trait Subscriber : MarkerTrait { +pub trait Subscriber { type Input; } diff --git a/src/test/compile-fail/issue-23080-2.rs b/src/test/compile-fail/issue-23080-2.rs index ff5ac9de8d944..b77230a8b340d 100644 --- a/src/test/compile-fail/issue-23080-2.rs +++ b/src/test/compile-fail/issue-23080-2.rs @@ -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; } diff --git a/src/test/compile-fail/issue-3702-2.rs b/src/test/compile-fail/issue-3702-2.rs index 2b732899ea42f..026ee89c0b2b5 100644 --- a/src/test/compile-fail/issue-3702-2.rs +++ b/src/test/compile-fail/issue-3702-2.rs @@ -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; diff --git a/src/test/compile-fail/issue-5035-2.rs b/src/test/compile-fail/issue-5035-2.rs index d316b44794ad6..9e324cdd61eb0 100644 --- a/src/test/compile-fail/issue-5035-2.rs +++ b/src/test/compile-fail/issue-5035-2.rs @@ -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 diff --git a/src/test/compile-fail/issue-5883.rs b/src/test/compile-fail/issue-5883.rs index b0db990619535..9ff957b6e6dea 100644 --- a/src/test/compile-fail/issue-5883.rs +++ b/src/test/compile-fail/issue-5883.rs @@ -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() {} diff --git a/src/test/compile-fail/issue-7575.rs b/src/test/compile-fail/issue-7575.rs index 9c019f6ec47fb..6b320f400a809 100644 --- a/src/test/compile-fail/issue-7575.rs +++ b/src/test/compile-fail/issue-7575.rs @@ -10,14 +10,12 @@ // 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 @@ impl Myisize { } } -trait ManyImplTrait : MarkerTrait { +trait ManyImplTrait { fn is_str() -> bool { //~ NOTE candidate false } diff --git a/src/test/compile-fail/kindck-copy.rs b/src/test/compile-fail/kindck-copy.rs index 1925caf6870ee..d43ddff6b9500 100644 --- a/src/test/compile-fail/kindck-copy.rs +++ b/src/test/compile-fail/kindck-copy.rs @@ -10,12 +10,11 @@ // Test which of the builtin types are considered POD. -use std::marker::MarkerTrait; use std::rc::Rc; fn assert_copy() { } -trait Dummy : MarkerTrait { } +trait Dummy { } #[derive(Copy, Clone)] struct MyStruct { diff --git a/src/test/compile-fail/kindck-impl-type-params-2.rs b/src/test/compile-fail/kindck-impl-type-params-2.rs index fd0789421e004..66297d70ef505 100644 --- a/src/test/compile-fail/kindck-impl-type-params-2.rs +++ b/src/test/compile-fail/kindck-impl-type-params-2.rs @@ -10,9 +10,7 @@ #![feature(box_syntax)] -use std::marker::MarkerTrait; - -trait Foo : MarkerTrait { +trait Foo { } impl Foo for T { diff --git a/src/test/compile-fail/kindck-send-object.rs b/src/test/compile-fail/kindck-send-object.rs index 0c68401bb2b95..570f7ad7fe3bf 100644 --- a/src/test/compile-fail/kindck-send-object.rs +++ b/src/test/compile-fail/kindck-send-object.rs @@ -12,10 +12,8 @@ // 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() { } -trait Dummy : MarkerTrait { } +trait Dummy { } trait Message : Send { } // careful with object types, who knows what they close over... diff --git a/src/test/compile-fail/kindck-send-object1.rs b/src/test/compile-fail/kindck-send-object1.rs index f86eac8b16bd2..48d5215b7085b 100644 --- a/src/test/compile-fail/kindck-send-object1.rs +++ b/src/test/compile-fail/kindck-send-object1.rs @@ -12,10 +12,8 @@ // 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() { } -trait Dummy : MarkerTrait { } +trait Dummy { } // careful with object types, who knows what they close over... fn test51<'a>() { diff --git a/src/test/compile-fail/kindck-send-object2.rs b/src/test/compile-fail/kindck-send-object2.rs index 08516e67318ce..d3d166e2a6916 100644 --- a/src/test/compile-fail/kindck-send-object2.rs +++ b/src/test/compile-fail/kindck-send-object2.rs @@ -10,10 +10,8 @@ // Continue kindck-send-object1.rs. -use std::marker::MarkerTrait; - fn assert_send() { } -trait Dummy : MarkerTrait { } +trait Dummy { } fn test50() { assert_send::<&'static Dummy>(); //~ ERROR the trait `core::marker::Sync` is not implemented diff --git a/src/test/compile-fail/lint-visible-private-types.rs b/src/test/compile-fail/lint-visible-private-types.rs index 918b4ee209ca7..c6dc3b70bef37 100644 --- a/src/test/compile-fail/lint-visible-private-types.rs +++ b/src/test/compile-fail/lint-visible-private-types.rs @@ -105,7 +105,7 @@ impl PrivTrait for (Private,) { fn bar(&self) -> Private { panic!() } } -pub trait ParamTrait : marker::MarkerTrait { +pub trait ParamTrait { fn foo() -> T; } diff --git a/src/test/compile-fail/object-does-not-impl-trait.rs b/src/test/compile-fail/object-does-not-impl-trait.rs index 607ab13d12201..efbf3782f9796 100644 --- a/src/test/compile-fail/object-does-not-impl-trait.rs +++ b/src/test/compile-fail/object-does-not-impl-trait.rs @@ -11,9 +11,7 @@ // Test that an object type `Box` is not considered to implement the // trait `Foo`. Issue #5087. -use std::marker::MarkerTrait; - -trait Foo : MarkerTrait {} +trait Foo {} fn take_foo(f: F) {} fn take_object(f: Box) { take_foo(f); } //~^ ERROR the trait `Foo` is not implemented diff --git a/src/test/compile-fail/object-safety-no-static.rs b/src/test/compile-fail/object-safety-no-static.rs index aae829ec7b563..6a010d49692d2 100644 --- a/src/test/compile-fail/object-safety-no-static.rs +++ b/src/test/compile-fail/object-safety-no-static.rs @@ -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(); } diff --git a/src/test/compile-fail/phantom-oibit.rs b/src/test/compile-fail/phantom-oibit.rs index c912d084daa86..071b4db40f86f 100644 --- a/src/test/compile-fail/phantom-oibit.rs +++ b/src/test/compile-fail/phantom-oibit.rs @@ -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 .. {} diff --git a/src/test/compile-fail/privacy-ns2.rs b/src/test/compile-fail/privacy-ns2.rs index 67bb566ea682c..7fe0574ab7d9a 100644 --- a/src/test/compile-fail/privacy-ns2.rs +++ b/src/test/compile-fail/privacy-ns2.rs @@ -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; diff --git a/src/test/compile-fail/region-object-lifetime-in-coercion.rs b/src/test/compile-fail/region-object-lifetime-in-coercion.rs index 1bb2bb5a15450..f95ee405895a9 100644 --- a/src/test/compile-fail/region-object-lifetime-in-coercion.rs +++ b/src/test/compile-fail/region-object-lifetime-in-coercion.rs @@ -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. diff --git a/src/test/compile-fail/regions-close-associated-type-into-object.rs b/src/test/compile-fail/regions-close-associated-type-into-object.rs index f80b0ffa5aadf..fdc97ecaf21e2 100644 --- a/src/test/compile-fail/regions-close-associated-type-into-object.rs +++ b/src/test/compile-fail/regions-close-associated-type-into-object.rs @@ -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; diff --git a/src/test/compile-fail/regions-close-over-borrowed-ref-in-obj.rs b/src/test/compile-fail/regions-close-over-borrowed-ref-in-obj.rs index 2341d2397c9b0..25b8137d29cad 100644 --- a/src/test/compile-fail/regions-close-over-borrowed-ref-in-obj.rs +++ b/src/test/compile-fail/regions-close-over-borrowed-ref-in-obj.rs @@ -10,9 +10,7 @@ #![feature(box_syntax)] -use std::marker::MarkerTrait; - -trait Foo : MarkerTrait { } +trait Foo { } impl<'a> Foo for &'a isize { } diff --git a/src/test/compile-fail/trait-as-struct-constructor.rs b/src/test/compile-fail/trait-as-struct-constructor.rs index 1fd711ca4fb2c..b864e6ca9578b 100644 --- a/src/test/compile-fail/trait-as-struct-constructor.rs +++ b/src/test/compile-fail/trait-as-struct-constructor.rs @@ -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 }; diff --git a/src/test/compile-fail/trait-bounds-on-structs-and-enums.rs b/src/test/compile-fail/trait-bounds-on-structs-and-enums.rs index ce0a7d3bb36cf..c18c5b386e8b2 100644 --- a/src/test/compile-fail/trait-bounds-on-structs-and-enums.rs +++ b/src/test/compile-fail/trait-bounds-on-structs-and-enums.rs @@ -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 { x: T, diff --git a/src/test/compile-fail/trait-bounds-sugar.rs b/src/test/compile-fail/trait-bounds-sugar.rs index e4058a0943aad..0a36fcbed6905 100644 --- a/src/test/compile-fail/trait-bounds-sugar.rs +++ b/src/test/compile-fail/trait-bounds-sugar.rs @@ -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) { } diff --git a/src/test/compile-fail/trait-impl-1.rs b/src/test/compile-fail/trait-impl-1.rs index 2f4793b4d888f..dadcbd5bce710 100644 --- a/src/test/compile-fail/trait-impl-1.rs +++ b/src/test/compile-fail/trait-impl-1.rs @@ -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) {} diff --git a/src/test/compile-fail/type-params-in-different-spaces-1.rs b/src/test/compile-fail/type-params-in-different-spaces-1.rs index 88d8788d63a3d..155b835bbc6e0 100644 --- a/src/test/compile-fail/type-params-in-different-spaces-1.rs +++ b/src/test/compile-fail/type-params-in-different-spaces-1.rs @@ -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 { fn broken_add(&self, rhs: T) -> Self { *self + rhs //~ ERROR mismatched types //~| expected `Self` @@ -20,7 +20,7 @@ trait BrokenAdd: Int { } } -impl BrokenAdd for T {} +impl> BrokenAdd for T {} pub fn main() { let foo: u8 = 0; diff --git a/src/test/compile-fail/typeck-default-trait-impl-constituent-types-2.rs b/src/test/compile-fail/typeck-default-trait-impl-constituent-types-2.rs index 0f3453da43137..a27f7f7ebbe0f 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-constituent-types-2.rs +++ b/src/test/compile-fail/typeck-default-trait-impl-constituent-types-2.rs @@ -10,9 +10,7 @@ #![feature(optin_builtin_traits)] -use std::marker::MarkerTrait; - -trait MyTrait: MarkerTrait {} +trait MyTrait {} impl MyTrait for .. {} diff --git a/src/test/compile-fail/typeck-default-trait-impl-constituent-types.rs b/src/test/compile-fail/typeck-default-trait-impl-constituent-types.rs index 524f467e01700..24819bb4f08d6 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-constituent-types.rs +++ b/src/test/compile-fail/typeck-default-trait-impl-constituent-types.rs @@ -10,9 +10,7 @@ #![feature(optin_builtin_traits)] -use std::marker::MarkerTrait; - -trait MyTrait: MarkerTrait {} +trait MyTrait {} impl MyTrait for .. {} impl !MyTrait for *mut T {} diff --git a/src/test/compile-fail/typeck-default-trait-impl-negation.rs b/src/test/compile-fail/typeck-default-trait-impl-negation.rs index a1ca0e3e0fada..4b91d0b7a736c 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-negation.rs +++ b/src/test/compile-fail/typeck-default-trait-impl-negation.rs @@ -10,13 +10,11 @@ #![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 .. {} diff --git a/src/test/compile-fail/typeck-default-trait-impl-precedence.rs b/src/test/compile-fail/typeck-default-trait-impl-precedence.rs index 4006eb2e83ed9..c67fc92313c3a 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-precedence.rs +++ b/src/test/compile-fail/typeck-default-trait-impl-precedence.rs @@ -15,15 +15,13 @@ #![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() { } -trait Signed : MarkerTrait { } +trait Signed { } impl Signed for i32 { } fn main() { diff --git a/src/test/compile-fail/typeck-default-trait-impl-superregion.rs b/src/test/compile-fail/typeck-default-trait-impl-superregion.rs index 4a6a77ac7b440..aa918119fbcee 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-superregion.rs +++ b/src/test/compile-fail/typeck-default-trait-impl-superregion.rs @@ -13,8 +13,6 @@ #![feature(optin_builtin_traits)] -use std::marker::MarkerTrait; - trait MyTrait : 'static {} impl MyTrait for .. {} diff --git a/src/test/compile-fail/typeck-default-trait-impl-supertrait.rs b/src/test/compile-fail/typeck-default-trait-impl-supertrait.rs index 7f24058e475fa..c9bfdff6c0e49 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-supertrait.rs +++ b/src/test/compile-fail/typeck-default-trait-impl-supertrait.rs @@ -13,9 +13,7 @@ #![feature(optin_builtin_traits)] -use std::marker::MarkerTrait; - -trait NotImplemented: MarkerTrait { } +trait NotImplemented { } trait MyTrait : NotImplemented {} diff --git a/src/test/compile-fail/typeck-default-trait-impl-trait-where-clause.rs b/src/test/compile-fail/typeck-default-trait-impl-trait-where-clause.rs index c970aaaf5d471..4f572e87639f0 100644 --- a/src/test/compile-fail/typeck-default-trait-impl-trait-where-clause.rs +++ b/src/test/compile-fail/typeck-default-trait-impl-trait-where-clause.rs @@ -15,11 +15,9 @@ #![feature(optin_builtin_traits)] -use std::marker::MarkerTrait; +trait NotImplemented { } -trait NotImplemented: MarkerTrait { } - -trait MyTrait: MarkerTrait +trait MyTrait where Option : NotImplemented {} diff --git a/src/test/compile-fail/unsized6.rs b/src/test/compile-fail/unsized6.rs index f31a6ffdc0d7c..3f18f359d306e 100644 --- a/src/test/compile-fail/unsized6.rs +++ b/src/test/compile-fail/unsized6.rs @@ -10,9 +10,7 @@ // Test `?Sized` local variables. -use std::marker; - -trait T : marker::MarkerTrait { } +trait T {} fn f1(x: &X) { let _: X; // <-- this is OK, no bindings created, no initializer. diff --git a/src/test/compile-fail/unsized7.rs b/src/test/compile-fail/unsized7.rs index 6ea3d0720eeeb..0245a1b5cf2c8 100644 --- a/src/test/compile-fail/unsized7.rs +++ b/src/test/compile-fail/unsized7.rs @@ -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 diff --git a/src/test/run-make/save-analysis/foo.rs b/src/test/run-make/save-analysis/foo.rs index fe0f32d97d6b1..4d75e58aad938 100644 --- a/src/test/run-make/save-analysis/foo.rs +++ b/src/test/run-make/save-analysis/foo.rs @@ -25,8 +25,6 @@ use sub::sub2 as msalias; 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: Option<::Item>) { // import tests fn foo(x: &One) {} - let _: Option = from_i32(45); let x = 42; diff --git a/src/test/run-pass/associated-types-basic.rs b/src/test/run-pass/associated-types-basic.rs index 06521e0ec78e8..2617a05fe2414 100644 --- a/src/test/run-pass/associated-types-basic.rs +++ b/src/test/run-pass/associated-types-basic.rs @@ -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; } diff --git a/src/test/run-pass/associated-types-issue-20371.rs b/src/test/run-pass/associated-types-issue-20371.rs index a601dc0739a46..c93a0b76a9560 100644 --- a/src/test/run-pass/associated-types-issue-20371.rs +++ b/src/test/run-pass/associated-types-issue-20371.rs @@ -13,10 +13,6 @@ // 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() {} diff --git a/src/test/run-pass/associated-types-nested-projections.rs b/src/test/run-pass/associated-types-nested-projections.rs index a26b428a4eacf..83f0d360e6122 100644 --- a/src/test/run-pass/associated-types-nested-projections.rs +++ b/src/test/run-pass/associated-types-nested-projections.rs @@ -14,10 +14,9 @@ #![feature(core)] -use std::marker::MarkerTrait; use std::slice; -trait Bound : MarkerTrait {} +trait Bound {} impl<'a> Bound for &'a i32 {} diff --git a/src/test/run-pass/associated-types-normalize-in-bounds-binding.rs b/src/test/run-pass/associated-types-normalize-in-bounds-binding.rs index d95ad2e883471..7e2d1aa23149d 100644 --- a/src/test/run-pass/associated-types-normalize-in-bounds-binding.rs +++ b/src/test/run-pass/associated-types-normalize-in-bounds-binding.rs @@ -13,12 +13,9 @@ // pretty-expanded FIXME #23616 -#![feature(core)] #![allow(dead_code)] -use std::marker::MarkerTrait; - -pub trait Integral : MarkerTrait { +pub trait Integral { type Opposite; } diff --git a/src/test/run-pass/associated-types-project-from-type-param-via-bound-in-where-clause.rs b/src/test/run-pass/associated-types-project-from-type-param-via-bound-in-where-clause.rs index dfd468884a167..1830b41d0b506 100644 --- a/src/test/run-pass/associated-types-project-from-type-param-via-bound-in-where-clause.rs +++ b/src/test/run-pass/associated-types-project-from-type-param-via-bound-in-where-clause.rs @@ -12,17 +12,14 @@ // `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; diff --git a/src/test/run-pass/const-binops.rs b/src/test/run-pass/const-binops.rs index 4b32ee352311d..a29953bea887b 100644 --- a/src/test/run-pass/const-binops.rs +++ b/src/test/run-pass/const-binops.rs @@ -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); diff --git a/src/test/run-pass/derive-no-std.rs b/src/test/run-pass/derive-no-std.rs index fbc6c28fd4a58..0234d7b0b6376 100644 --- a/src/test/run-pass/derive-no-std.rs +++ b/src/test/run-pass/derive-no-std.rs @@ -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 index 4399d741cad1e..0000000000000 --- a/src/test/run-pass/deriving-primitive.rs +++ /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 or the MIT license -// , 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 = FromPrimitive::from_int(isize::MAX); - assert_eq!(x, Some(A::Foo)); - - let x: Option = FromPrimitive::from_int(1); - assert_eq!(x, Some(A::Bar)); - - let x: Option = FromPrimitive::from_int(3); - assert_eq!(x, Some(A::Baz)); - - let x: Option = FromPrimitive::from_int(4); - assert_eq!(x, Some(A::Qux)); - - let x: Option = FromPrimitive::from_int(5); - assert_eq!(x, None); -} diff --git a/src/test/run-pass/early-ret-binop-add.rs b/src/test/run-pass/early-ret-binop-add.rs index 7bd292e66f258..0a490466ef73b 100644 --- a/src/test/run-pass/early-ret-binop-add.rs +++ b/src/test/run-pass/early-ret-binop-add.rs @@ -10,8 +10,8 @@ // pretty-expanded FIXME #23616 -use std::num::Int; +use std::ops::Add; -fn wsucc(n: T) -> T { n + { return n } } +fn wsucc + 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 index 4d54bb4ef7250..0000000000000 --- a/src/test/run-pass/exponential-notation.rs +++ /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 or the MIT license -// , 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"); -} diff --git a/src/test/run-pass/extern-methods.rs b/src/test/run-pass/extern-methods.rs index 28a076113d1f0..421b19f2864fe 100644 --- a/src/test/run-pass/extern-methods.rs +++ b/src/test/run-pass/extern-methods.rs @@ -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); } diff --git a/src/test/run-pass/float-nan.rs b/src/test/run-pass/float-nan.rs index 298f2a4719db9..856599431fd18 100644 --- a/src/test/run-pass/float-nan.rs +++ b/src/test/run-pass/float-nan.rs @@ -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); diff --git a/src/test/run-pass/intrinsics-math.rs b/src/test/run-pass/intrinsics-math.rs index 8db29ebaa6d3e..37ceaae373b94 100644 --- a/src/test/run-pass/intrinsics-math.rs +++ b/src/test/run-pass/intrinsics-math.rs @@ -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); diff --git a/src/test/run-pass/issue-11736.rs b/src/test/run-pass/issue-11736.rs index fde04efc8bad9..b4621a2d053b1 100644 --- a/src/test/run-pass/issue-11736.rs +++ b/src/test/run-pass/issue-11736.rs @@ -12,10 +12,7 @@ #![feature(collections)] -extern crate collections; - use std::collections::BitVec; -use std::num::Float; fn main() { // Generate sieve of Eratosthenes for n up to 1e6 diff --git a/src/test/run-pass/issue-13105.rs b/src/test/run-pass/issue-13105.rs index 14de9e90306bc..ca68272d2d0f2 100644 --- a/src/test/run-pass/issue-13105.rs +++ b/src/test/run-pass/issue-13105.rs @@ -10,11 +10,7 @@ // pretty-expanded FIXME #23616 -#![feature(core)] - -use std::marker::MarkerTrait; - -trait Foo : MarkerTrait { +trait Foo { fn quux(u8) {} } diff --git a/src/test/run-pass/issue-8460.rs b/src/test/run-pass/issue-8460.rs index 2469dec994727..4ebc43163ede8 100644 --- a/src/test/run-pass/issue-8460.rs +++ b/src/test/run-pass/issue-8460.rs @@ -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::min_value() } -fn zero() -> T { Int::zero() } - fn main() { - assert!(thread::spawn(move|| { min_val::() / -1; }).join().is_err()); - assert!(thread::spawn(move|| { min_val::() / -1; }).join().is_err()); - assert!(thread::spawn(move|| { min_val::() / -1; }).join().is_err()); - assert!(thread::spawn(move|| { min_val::() / -1; }).join().is_err()); - assert!(thread::spawn(move|| { min_val::() / -1; }).join().is_err()); - assert!(thread::spawn(move|| { 1isize / zero::(); }).join().is_err()); - assert!(thread::spawn(move|| { 1i8 / zero::(); }).join().is_err()); - assert!(thread::spawn(move|| { 1i16 / zero::(); }).join().is_err()); - assert!(thread::spawn(move|| { 1i32 / zero::(); }).join().is_err()); - assert!(thread::spawn(move|| { 1i64 / zero::(); }).join().is_err()); - assert!(thread::spawn(move|| { min_val::() % -1; }).join().is_err()); - assert!(thread::spawn(move|| { min_val::() % -1; }).join().is_err()); - assert!(thread::spawn(move|| { min_val::() % -1; }).join().is_err()); - assert!(thread::spawn(move|| { min_val::() % -1; }).join().is_err()); - assert!(thread::spawn(move|| { min_val::() % -1; }).join().is_err()); - assert!(thread::spawn(move|| { 1isize % zero::(); }).join().is_err()); - assert!(thread::spawn(move|| { 1i8 % zero::(); }).join().is_err()); - assert!(thread::spawn(move|| { 1i16 % zero::(); }).join().is_err()); - assert!(thread::spawn(move|| { 1i32 % zero::(); }).join().is_err()); - assert!(thread::spawn(move|| { 1i64 % 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()); + 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()); } diff --git a/src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs b/src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs index 12162ba9022ae..b7de1b5f4cbb5 100644 --- a/src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs +++ b/src/test/run-pass/monomorphized-callees-with-ty-params-3314.rs @@ -10,11 +10,7 @@ // pretty-expanded FIXME #23616 -#![feature(core)] - -use std::marker::MarkerTrait; - -trait Serializer : MarkerTrait { +trait Serializer { } trait Serializable { diff --git a/src/test/run-pass/numeric-method-autoexport.rs b/src/test/run-pass/numeric-method-autoexport.rs index d5f64c1c7b1aa..b1d71abc78599 100644 --- a/src/test/run-pass/numeric-method-autoexport.rs +++ b/src/test/run-pass/numeric-method-autoexport.rs @@ -15,11 +15,7 @@ // 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); } diff --git a/src/test/run-pass/overloaded-autoderef.rs b/src/test/run-pass/overloaded-autoderef.rs index ddd6ae4d0a090..5e924d015b619 100644 --- a/src/test/run-pass/overloaded-autoderef.rs +++ b/src/test/run-pass/overloaded-autoderef.rs @@ -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); diff --git a/src/test/run-pass/syntax-trait-polarity.rs b/src/test/run-pass/syntax-trait-polarity.rs index ba8a3f77aacef..f69b857981d78 100644 --- a/src/test/run-pass/syntax-trait-polarity.rs +++ b/src/test/run-pass/syntax-trait-polarity.rs @@ -10,15 +10,13 @@ // 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 {} diff --git a/src/test/run-pass/trait-bounds-basic.rs b/src/test/run-pass/trait-bounds-basic.rs index 50c9c43ba2b8b..558e69664ecf9 100644 --- a/src/test/run-pass/trait-bounds-basic.rs +++ b/src/test/run-pass/trait-bounds-basic.rs @@ -10,9 +10,7 @@ // pretty-expanded FIXME #23616 -#![feature(core)] - -trait Foo : ::std::marker::MarkerTrait { +trait Foo { } fn b(_x: Box) { diff --git a/src/test/run-pass/trait-bounds-on-structs-and-enums.rs b/src/test/run-pass/trait-bounds-on-structs-and-enums.rs index 60c1816b1632c..bb8ae8247fa99 100644 --- a/src/test/run-pass/trait-bounds-on-structs-and-enums.rs +++ b/src/test/run-pass/trait-bounds-on-structs-and-enums.rs @@ -12,10 +12,10 @@ #![feature(core)] -trait U : ::std::marker::MarkerTrait {} +trait U {} trait T { fn get(self) -> X; } -trait S2 : ::std::marker::MarkerTrait { +trait S2 { fn m(x: Box+'static>) {} } diff --git a/src/test/run-pass/trait-bounds-recursion.rs b/src/test/run-pass/trait-bounds-recursion.rs index 250390f70b448..d984e9cdc990f 100644 --- a/src/test/run-pass/trait-bounds-recursion.rs +++ b/src/test/run-pass/trait-bounds-recursion.rs @@ -10,21 +10,19 @@ // pretty-expanded FIXME #23616 -#![feature(core)] - trait I { fn i(&self) -> Self; } -trait A : ::std::marker::MarkerTrait { +trait A { fn id(x:T) -> T { x.i() } } trait J { fn j(&self) -> T; } -trait B> : ::std::marker::MarkerTrait { +trait B> { fn id(x:T) -> T { x.j() } } -trait C : ::std::marker::MarkerTrait { +trait C { fn id>(x:T) -> T { x.j() } } diff --git a/src/test/run-pass/trait-inheritance-num.rs b/src/test/run-pass/trait-inheritance-num.rs index 4af049fc0c3af..e5390ac8a6256 100644 --- a/src/test/run-pass/trait-inheritance-num.rs +++ b/src/test/run-pass/trait-inheritance-num.rs @@ -10,16 +10,11 @@ // 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(n: &T) -> bool { *n > NumCast::from(1).unwrap() } -fn greater_than_one_float(n: &T) -> bool { *n > NumCast::from(1).unwrap() } +fn greater_than_one(n: &T) -> bool { loop {} } +fn greater_than_one_float(n: &T) -> bool { loop {} } pub fn main() {} diff --git a/src/test/run-pass/trait-inheritance-num0.rs b/src/test/run-pass/trait-inheritance-num0.rs index b7f9534935697..83c2a9ad33926 100644 --- a/src/test/run-pass/trait-inheritance-num0.rs +++ b/src/test/run-pass/trait-inheritance-num0.rs @@ -15,7 +15,10 @@ #![feature(core)] use std::cmp::PartialOrd; -use std::num::NumCast; + +pub trait NumCast { + fn from(i: i32) -> Option; +} pub trait Num { fn from_int(i: isize) -> Self; diff --git a/src/test/run-pass/trait-inheritance-num1.rs b/src/test/run-pass/trait-inheritance-num1.rs index 02ebf6bfa5375..14a6a9a0c664c 100644 --- a/src/test/run-pass/trait-inheritance-num1.rs +++ b/src/test/run-pass/trait-inheritance-num1.rs @@ -10,10 +10,9 @@ // pretty-expanded FIXME #23616 -#![feature(core)] - -use std::cmp::PartialOrd; -use std::num::NumCast; +pub trait NumCast { + fn from(i: i32) -> Option; +} pub trait NumExt: NumCast + PartialOrd { } diff --git a/src/test/run-pass/trait-inheritance-num2.rs b/src/test/run-pass/trait-inheritance-num2.rs index 773fc387a2a34..5f8541a6da1e8 100644 --- a/src/test/run-pass/trait-inheritance-num2.rs +++ b/src/test/run-pass/trait-inheritance-num2.rs @@ -10,12 +10,7 @@ // 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 {} diff --git a/src/test/run-pass/trait-inheritance-num3.rs b/src/test/run-pass/trait-inheritance-num3.rs index b5cf25bc5a8f4..abf8d2baf8732 100644 --- a/src/test/run-pass/trait-inheritance-num3.rs +++ b/src/test/run-pass/trait-inheritance-num3.rs @@ -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; +} pub trait NumExt: PartialEq + PartialOrd + NumCast {} impl NumExt for f32 {} +impl NumCast for f32 { + fn from(i: i32) -> Option { Some(i as f32) } +} fn num_eq_one(n: T) { println!("{}", n == NumCast::from(1).unwrap()) diff --git a/src/test/run-pass/trait-inheritance-num5.rs b/src/test/run-pass/trait-inheritance-num5.rs index b2c3900bc0282..c6f8a5d4f1d99 100644 --- a/src/test/run-pass/trait-inheritance-num5.rs +++ b/src/test/run-pass/trait-inheritance-num5.rs @@ -10,16 +10,22 @@ // pretty-expanded FIXME #23616 -#![feature(core)] - -use std::cmp::PartialEq; -use std::num::NumCast; +pub trait NumCast { + fn from(i: i32) -> Option; +} pub trait NumExt: PartialEq + NumCast {} impl NumExt for f32 {} impl NumExt for isize {} +impl NumCast for f32 { + fn from(i: i32) -> Option { Some(i as f32) } +} +impl NumCast for isize { + fn from(i: i32) -> Option { Some(i as isize) } +} + fn num_eq_one() -> T { NumCast::from(1).unwrap() } diff --git a/src/test/run-pass/trait-inheritance-self-in-supertype.rs b/src/test/run-pass/trait-inheritance-self-in-supertype.rs index ac9485594eb3e..c7e206cb474b8 100644 --- a/src/test/run-pass/trait-inheritance-self-in-supertype.rs +++ b/src/test/run-pass/trait-inheritance-self-in-supertype.rs @@ -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 { diff --git a/src/test/run-pass/trait-inheritance-static2.rs b/src/test/run-pass/trait-inheritance-static2.rs index 62feecf045b54..67bea3864a772 100644 --- a/src/test/run-pass/trait-inheritance-static2.rs +++ b/src/test/run-pass/trait-inheritance-static2.rs @@ -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; } diff --git a/src/test/run-pass/unboxed-closures-infer-argument-types-from-expected-bound.rs b/src/test/run-pass/unboxed-closures-infer-argument-types-from-expected-bound.rs index d408612f9b856..c4944548e17f0 100644 --- a/src/test/run-pass/unboxed-closures-infer-argument-types-from-expected-bound.rs +++ b/src/test/run-pass/unboxed-closures-infer-argument-types-from-expected-bound.rs @@ -13,14 +13,18 @@ // 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(val: T, f: &F) where F : Fn(T) { - f.call((val,)) + f(val) } pub fn main() { diff --git a/src/test/run-pass/unboxed-closures-infer-argument-types-from-expected-object-type.rs b/src/test/run-pass/unboxed-closures-infer-argument-types-from-expected-object-type.rs index c1e1ff3cd8e93..9cad7d61e32c5 100644 --- a/src/test/run-pass/unboxed-closures-infer-argument-types-from-expected-object-type.rs +++ b/src/test/run-pass/unboxed-closures-infer-argument-types-from-expected-object-type.rs @@ -13,11 +13,15 @@ // 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(val: T, f: &Fn(T)) { f.call((val,)) } +fn doit(val: T, f: &Fn(T)) { f(val) } pub fn main() { doit(0, &|x /*: isize*/ | { x.to_int(); }); diff --git a/src/test/run-pass/unboxed-closures-infer-argument-types-with-bound-regions-from-expected-bound.rs b/src/test/run-pass/unboxed-closures-infer-argument-types-with-bound-regions-from-expected-bound.rs index 99e2149de966a..bdd1932182bdc 100644 --- a/src/test/run-pass/unboxed-closures-infer-argument-types-with-bound-regions-from-expected-bound.rs +++ b/src/test/run-pass/unboxed-closures-infer-argument-types-with-bound-regions-from-expected-bound.rs @@ -13,14 +13,18 @@ // 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(val: T, f: &F) where F : Fn(&T) { - f.call((&val,)) + f(&val) } pub fn main() { diff --git a/src/test/run-pass/utf8_idents.rs b/src/test/run-pass/utf8_idents.rs index 559afcd164148..579070a295adf 100644 --- a/src/test/run-pass/utf8_idents.rs +++ b/src/test/run-pass/utf8_idents.rs @@ -11,8 +11,6 @@ #![feature(non_ascii_idents)] -use std::num::Float; - pub fn main() { let ε = 0.00001f64; let Π = 3.14f64;