diff --git a/src/test/auxiliary/issue13507.rs b/src/test/auxiliary/issue13507.rs index 7d82e79f949..78d0394a6e5 100644 --- a/src/test/auxiliary/issue13507.rs +++ b/src/test/auxiliary/issue13507.rs @@ -72,7 +72,6 @@ pub mod testtypes { // Tests TyTrait pub trait FooTrait { fn foo_method(&self) -> usize; - fn foo_static_method() -> usize; } // Tests TyStruct diff --git a/src/test/compile-fail/cast-to-unsized-trait-object-suggestion.rs b/src/test/compile-fail/cast-to-unsized-trait-object-suggestion.rs index 4e6ae96e3fc..d18746cdf0b 100644 --- a/src/test/compile-fail/cast-to-unsized-trait-object-suggestion.rs +++ b/src/test/compile-fail/cast-to-unsized-trait-object-suggestion.rs @@ -9,12 +9,12 @@ // except according to those terms. fn main() { - &1 as Copy; + &1 as Send; //~^ ERROR cast to unsized type //~| HELP try casting to a reference instead: - //~| SUGGESTION &1 as &Copy; - Box::new(1) as Copy; + //~| SUGGESTION &1 as &Send; + Box::new(1) as Send; //~^ ERROR cast to unsized type //~| HELP try casting to a `Box` instead: - //~| SUGGESTION Box::new(1) as Box; + //~| SUGGESTION Box::new(1) as Box; } diff --git a/src/test/compile-fail/infinite-instantiation.rs b/src/test/compile-fail/infinite-instantiation.rs index 559e0e9a292..9b02bf4cb85 100644 --- a/src/test/compile-fail/infinite-instantiation.rs +++ b/src/test/compile-fail/infinite-instantiation.rs @@ -15,7 +15,7 @@ // so for now just live with it. // This test case was originally for issue #2258. -trait ToOpt { +trait ToOpt: Sized { fn to_option(&self) -> Option; } diff --git a/src/test/compile-fail/issue-18959.rs b/src/test/compile-fail/issue-18959.rs index ebda2481803..95176da9020 100644 --- a/src/test/compile-fail/issue-18959.rs +++ b/src/test/compile-fail/issue-18959.rs @@ -21,10 +21,11 @@ impl Foo for Thing { fn foo(b: &Bar) { b.foo(&0) //~^ ERROR the trait `Foo` is not implemented for the type `Bar` + //~| ERROR E0038 } fn main() { let mut thing = Thing; - let test: &Bar = &mut thing; //~ ERROR cannot convert to a trait object + let test: &Bar = &mut thing; //~ ERROR E0038 foo(test); } diff --git a/src/test/compile-fail/issue-19380.rs b/src/test/compile-fail/issue-19380.rs index dbc0e410cf9..e24e6bbeb7b 100644 --- a/src/test/compile-fail/issue-19380.rs +++ b/src/test/compile-fail/issue-19380.rs @@ -18,11 +18,11 @@ impl Qiz for Foo { } struct Bar { +//~^ ERROR E0038 foos: &'static [&'static (Qiz + 'static)] } const FOO : Foo = Foo; const BAR : Bar = Bar { foos: &[&FOO]}; -//~^ ERROR: cannot convert to a trait object because trait `Qiz` is not object-safe [E0038] fn main() { } diff --git a/src/test/compile-fail/issue-19538.rs b/src/test/compile-fail/issue-19538.rs index b9c90755b2c..a6190500582 100644 --- a/src/test/compile-fail/issue-19538.rs +++ b/src/test/compile-fail/issue-19538.rs @@ -25,5 +25,6 @@ impl Bar for Thing { } fn main() { let mut thing = Thing; let test: &mut Bar = &mut thing; - //~^ ERROR cannot convert to a trait object because trait `Bar` is not object-safe + //~^ ERROR E0038 + //~| ERROR E0038 } diff --git a/src/test/compile-fail/object-safety-generics.rs b/src/test/compile-fail/object-safety-generics.rs index fd20accfa1e..63e5718537c 100644 --- a/src/test/compile-fail/object-safety-generics.rs +++ b/src/test/compile-fail/object-safety-generics.rs @@ -23,14 +23,15 @@ trait Quux { fn make_bar(t: &T) -> &Bar { t - //~^ ERROR `Bar` is not object-safe + //~^ ERROR E0038 //~| NOTE method `bar` has generic type parameters } fn make_bar_explicit(t: &T) -> &Bar { t as &Bar - //~^ ERROR `Bar` is not object-safe + //~^ ERROR E0038 //~| NOTE method `bar` has generic type parameters + //~| ERROR E0038 } fn make_quux(t: &T) -> &Quux { diff --git a/src/test/compile-fail/object-safety-issue-22040.rs b/src/test/compile-fail/object-safety-issue-22040.rs index edf32131b68..f49ed42fe44 100644 --- a/src/test/compile-fail/object-safety-issue-22040.rs +++ b/src/test/compile-fail/object-safety-issue-22040.rs @@ -18,7 +18,7 @@ trait Expr: Debug + PartialEq { //#[derive(PartialEq)] #[derive(Debug)] -struct SExpr<'x> { +struct SExpr<'x> { //~ ERROR E0038 elements: Vec>, } @@ -43,8 +43,8 @@ impl <'x> Expr for SExpr<'x> { } fn main() { - let a: Box = Box::new(SExpr::new()); //~ ERROR trait `Expr` is not object-safe - let b: Box = Box::new(SExpr::new()); //~ ERROR trait `Expr` is not object-safe + let a: Box = Box::new(SExpr::new()); + let b: Box = Box::new(SExpr::new()); assert_eq!(a , b); } diff --git a/src/test/compile-fail/object-safety-mentions-Self.rs b/src/test/compile-fail/object-safety-mentions-Self.rs index b546774ccbd..55b78090635 100644 --- a/src/test/compile-fail/object-safety-mentions-Self.rs +++ b/src/test/compile-fail/object-safety-mentions-Self.rs @@ -26,26 +26,28 @@ trait Quux { fn make_bar(t: &T) -> &Bar { t - //~^ ERROR `Bar` is not object-safe + //~^ ERROR E0038 //~| NOTE method `bar` references the `Self` type in its arguments or return type } fn make_bar_explicit(t: &T) -> &Bar { t as &Bar - //~^ ERROR `Bar` is not object-safe + //~^ ERROR E0038 //~| NOTE method `bar` references the `Self` type in its arguments or return type + //~| ERROR E0038 } fn make_baz(t: &T) -> &Baz { t - //~^ ERROR `Baz` is not object-safe + //~^ ERROR E0038 //~| NOTE method `bar` references the `Self` type in its arguments or return type } fn make_baz_explicit(t: &T) -> &Baz { t as &Baz - //~^ ERROR `Baz` is not object-safe + //~^ ERROR E0038 //~| NOTE method `bar` references the `Self` type in its arguments or return type + //~| ERROR E0038 } fn make_quux(t: &T) -> &Quux { diff --git a/src/test/compile-fail/object-safety-no-static.rs b/src/test/compile-fail/object-safety-no-static.rs index 6a010d49692..2dc7983d1b5 100644 --- a/src/test/compile-fail/object-safety-no-static.rs +++ b/src/test/compile-fail/object-safety-no-static.rs @@ -17,14 +17,15 @@ trait Foo { fn foo_implicit(b: Box) -> Box { b - //~^ ERROR cannot convert to a trait object + //~^ ERROR E0038 //~| NOTE method `foo` has no receiver } fn foo_explicit(b: Box) -> Box { b as Box - //~^ ERROR cannot convert to a trait object + //~^ ERROR E0038 //~| NOTE method `foo` has no receiver + //~| ERROR E0038 } fn main() { diff --git a/src/test/compile-fail/object-safety-sized-2.rs b/src/test/compile-fail/object-safety-sized-2.rs index 3a02461bbb2..401602bd681 100644 --- a/src/test/compile-fail/object-safety-sized-2.rs +++ b/src/test/compile-fail/object-safety-sized-2.rs @@ -19,14 +19,15 @@ trait Bar fn make_bar(t: &T) -> &Bar { t - //~^ ERROR `Bar` is not object-safe + //~^ ERROR E0038 //~| NOTE the trait cannot require that `Self : Sized` } fn make_bar_explicit(t: &T) -> &Bar { t as &Bar - //~^ ERROR `Bar` is not object-safe + //~^ ERROR E0038 //~| NOTE the trait cannot require that `Self : Sized` + //~| ERROR E0038 } fn main() { diff --git a/src/test/compile-fail/object-safety-sized.rs b/src/test/compile-fail/object-safety-sized.rs index bc214f6f3d9..29b4e4db65c 100644 --- a/src/test/compile-fail/object-safety-sized.rs +++ b/src/test/compile-fail/object-safety-sized.rs @@ -17,14 +17,15 @@ trait Bar : Sized { fn make_bar(t: &T) -> &Bar { t - //~^ ERROR `Bar` is not object-safe + //~^ ERROR E0038 //~| NOTE the trait cannot require that `Self : Sized` } fn make_bar_explicit(t: &T) -> &Bar { t as &Bar - //~^ ERROR `Bar` is not object-safe + //~^ ERROR E0038 //~| NOTE the trait cannot require that `Self : Sized` + //~| ERROR E0038 } fn main() { diff --git a/src/test/compile-fail/object-safety-supertrait-mentions-Self.rs b/src/test/compile-fail/object-safety-supertrait-mentions-Self.rs index d3f9dc73020..ba82635a401 100644 --- a/src/test/compile-fail/object-safety-supertrait-mentions-Self.rs +++ b/src/test/compile-fail/object-safety-supertrait-mentions-Self.rs @@ -24,7 +24,7 @@ fn make_bar>(t: &T) -> &Bar { fn make_baz(t: &T) -> &Baz { t - //~^ ERROR `Baz` is not object-safe + //~^ ERROR E0038 //~| NOTE the trait cannot use `Self` as a type parameter in the supertrait listing } diff --git a/src/test/run-pass/issue-21058.rs b/src/test/run-pass/issue-21058.rs index 5fe3434e499..0ca93687814 100644 --- a/src/test/run-pass/issue-21058.rs +++ b/src/test/run-pass/issue-21058.rs @@ -21,10 +21,10 @@ fn main() { // str std::intrinsics::type_name::(), // Trait - std::intrinsics::type_name::(), + std::intrinsics::type_name::(), // Newtype std::intrinsics::type_name::(), // DST std::intrinsics::type_name::() - )}, ("[u8]", "str", "core::marker::Copy + 'static", "NT", "DST")); + )}, ("[u8]", "str", "core::marker::Send + 'static", "NT", "DST")); }