diff --git a/src/librustc/util/ppaux.rs b/src/librustc/util/ppaux.rs index 3252a2cd6ab0f6bcbfe35c54ae3ba41cd6cb36e2..4fe9c34c140cbdf8136258728b33931570fdffa0 100644 --- a/src/librustc/util/ppaux.rs +++ b/src/librustc/util/ppaux.rs @@ -1062,10 +1062,14 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { TyParam(ref param_ty) => write!(f, "{}", param_ty), TyAdt(def, substs) => cx.parameterized(f, substs, def.did, &[]), TyDynamic(data, r) => { - data.print(f, cx)?; let r = r.print_to_string(cx); if !r.is_empty() { - write!(f, " + {}", r) + write!(f, "(")?; + } + write!(f, "dyn ")?; + data.print(f, cx)?; + if !r.is_empty() { + write!(f, " + {})", r) } else { Ok(()) } diff --git a/src/test/compile-fail/cross-borrow-trait.rs b/src/test/compile-fail/cross-borrow-trait.rs index 847a82c082651f1a4550cc7bfc34aefa873f2fa3..7c76cf475d29afe415b27502c5451252a11eb354 100644 --- a/src/test/compile-fail/cross-borrow-trait.rs +++ b/src/test/compile-fail/cross-borrow-trait.rs @@ -18,6 +18,6 @@ impl Trait for Foo {} pub fn main() { let x: Box = Box::new(Foo); let _y: &Trait = x; //~ ERROR E0308 - //~| expected type `&Trait` - //~| found type `std::boxed::Box` + //~| expected type `&dyn Trait` + //~| found type `std::boxed::Box` } diff --git a/src/test/compile-fail/destructure-trait-ref.rs b/src/test/compile-fail/destructure-trait-ref.rs index 09bd3a2fc57d97a4f02744a84621c97622f16baa..b5acdc12ca048679c0f8ebe259a77995c66e02a0 100644 --- a/src/test/compile-fail/destructure-trait-ref.rs +++ b/src/test/compile-fail/destructure-trait-ref.rs @@ -33,23 +33,23 @@ fn main() { let &&x = &&(&1isize as &T); // n == m - let &x = &1isize as &T; //~ ERROR type `&T` cannot be dereferenced - let &&x = &(&1isize as &T); //~ ERROR type `&T` cannot be dereferenced - let box x = box 1isize as Box; //~ ERROR type `std::boxed::Box` cannot be dereferenced + let &x = &1isize as &T; //~ ERROR type `&dyn T` cannot be dereferenced + let &&x = &(&1isize as &T); //~ ERROR type `&dyn T` cannot be dereferenced + let box x = box 1isize as Box; //~ ERROR type `std::boxed::Box` cannot be dereferenced // n > m let &&x = &1isize as &T; //~^ ERROR mismatched types - //~| expected type `T` + //~| expected type `dyn T` //~| found type `&_` //~| expected trait T, found reference let &&&x = &(&1isize as &T); //~^ ERROR mismatched types - //~| expected type `T` + //~| expected type `dyn T` //~| found type `&_` //~| expected trait T, found reference let box box x = box 1isize as Box; //~^ ERROR mismatched types - //~| expected type `T` + //~| expected type `dyn T` //~| found type `std::boxed::Box<_>` } diff --git a/src/test/compile-fail/dst-bad-assign-3.rs b/src/test/compile-fail/dst-bad-assign-3.rs index 5bc6c6cda263afe3ca4762d48c83bd742198d714..2a209a2959bfd7bf08c84b4338d92a636de68c28 100644 --- a/src/test/compile-fail/dst-bad-assign-3.rs +++ b/src/test/compile-fail/dst-bad-assign-3.rs @@ -42,7 +42,7 @@ pub fn main() { let z: Box = Box::new(Bar1 {f: 36}); f5.2 = Bar1 {f: 36}; //~^ ERROR mismatched types - //~| expected type `ToBar` + //~| expected type `dyn ToBar` //~| found type `Bar1` //~| expected trait ToBar, found struct `Bar1` //~| ERROR the size for value values of type diff --git a/src/test/compile-fail/dst-bad-assign.rs b/src/test/compile-fail/dst-bad-assign.rs index 37b6056d1a762328eea2d61e52f245bdbd109547..e28586c4755e872320a026ee9b195ab5b623e1d6 100644 --- a/src/test/compile-fail/dst-bad-assign.rs +++ b/src/test/compile-fail/dst-bad-assign.rs @@ -44,7 +44,7 @@ pub fn main() { let z: Box = Box::new(Bar1 {f: 36}); f5.ptr = Bar1 {f: 36}; //~^ ERROR mismatched types - //~| expected type `ToBar` + //~| expected type `dyn ToBar` //~| found type `Bar1` //~| expected trait ToBar, found struct `Bar1` //~| ERROR the size for value values of type diff --git a/src/test/compile-fail/fn-trait-formatting.rs b/src/test/compile-fail/fn-trait-formatting.rs index 6d70f54edb4292a680f2ca0f5c0daf302934f987..56d64d77ee2581bccf1b10b293e23d3218defdd4 100644 --- a/src/test/compile-fail/fn-trait-formatting.rs +++ b/src/test/compile-fail/fn-trait-formatting.rs @@ -16,15 +16,15 @@ fn main() { let _: () = (box |_: isize| {}) as Box; //~^ ERROR mismatched types //~| expected type `()` - //~| found type `std::boxed::Box` + //~| found type `std::boxed::Box` let _: () = (box |_: isize, isize| {}) as Box; //~^ ERROR mismatched types //~| expected type `()` - //~| found type `std::boxed::Box` + //~| found type `std::boxed::Box` let _: () = (box || -> isize { unimplemented!() }) as Box isize>; //~^ ERROR mismatched types //~| expected type `()` - //~| found type `std::boxed::Box isize>` + //~| found type `std::boxed::Box isize>` needs_fn(1); //~^ ERROR : std::ops::Fn<(isize,)>` diff --git a/src/test/compile-fail/issue-13033.rs b/src/test/compile-fail/issue-13033.rs index 3d9d81471cb1e40da806c9348464d193ff9cfa98..f1fd617717a5ee5af533bf7bf3b51c44259688d2 100644 --- a/src/test/compile-fail/issue-13033.rs +++ b/src/test/compile-fail/issue-13033.rs @@ -17,8 +17,8 @@ trait Foo { impl Foo for Baz { fn bar(&mut self, other: &Foo) {} //~^ ERROR method `bar` has an incompatible type for trait - //~| expected type `fn(&mut Baz, &mut Foo)` - //~| found type `fn(&mut Baz, &Foo)` + //~| expected type `fn(&mut Baz, &mut dyn Foo)` + //~| found type `fn(&mut Baz, &dyn Foo)` } fn main() {} diff --git a/src/test/compile-fail/issue-20939.rs b/src/test/compile-fail/issue-20939.rs index 88197166ee08215b50af4204f551a269283c93e2..5282ce4bb8897dd43d09c6a61416193fe6b752e1 100644 --- a/src/test/compile-fail/issue-20939.rs +++ b/src/test/compile-fail/issue-20939.rs @@ -11,6 +11,6 @@ trait Foo {} impl<'a> Foo for Foo+'a {} -//~^ ERROR the object type `Foo + 'a` automatically implements the trait `Foo` +//~^ ERROR the object type `(dyn Foo + 'a)` automatically implements the trait `Foo` fn main() {} diff --git a/src/test/compile-fail/issue-32963.rs b/src/test/compile-fail/issue-32963.rs index e97e5a86a9d7d88567f4fd8249ddf996e9d83ddd..24db822f89ca0fc91cb443602836b7630b99712e 100644 --- a/src/test/compile-fail/issue-32963.rs +++ b/src/test/compile-fail/issue-32963.rs @@ -17,5 +17,5 @@ fn size_of_copy() -> usize { mem::size_of::() } fn main() { size_of_copy::(); //~^ ERROR only auto traits can be used as additional traits in a trait object - //~| ERROR the trait bound `Misc: std::marker::Copy` is not satisfied + //~| ERROR the trait bound `dyn Misc: std::marker::Copy` is not satisfied } diff --git a/src/test/compile-fail/issue-41139.rs b/src/test/compile-fail/issue-41139.rs index 15ca151c49a79b5079763d6b8029af21c17d88f8..0509a4387bae415f5999a640f5f55f477edd0626 100644 --- a/src/test/compile-fail/issue-41139.rs +++ b/src/test/compile-fail/issue-41139.rs @@ -14,5 +14,5 @@ fn get_function<'a>() -> &'a Fn() -> Trait { panic!("") } fn main() { let t : &Trait = &get_function()(); - //~^ ERROR cannot move a value of type Trait + 'static + //~^ ERROR cannot move a value of type (dyn Trait + 'static) } diff --git a/src/test/compile-fail/issue-5153.rs b/src/test/compile-fail/issue-5153.rs index b1d96f9b5277885dbb62dea04ef58c23e3b11f34..9b49886961d7b12b1655d172748e7c0c14521ba8 100644 --- a/src/test/compile-fail/issue-5153.rs +++ b/src/test/compile-fail/issue-5153.rs @@ -18,5 +18,5 @@ fn foo(self: Box) { } fn main() { (&5isize as &Foo).foo(); - //~^ ERROR: no method named `foo` found for type `&Foo` in the current scope + //~^ ERROR: no method named `foo` found for type `&dyn Foo` in the current scope } diff --git a/src/test/compile-fail/kindck-send-object.rs b/src/test/compile-fail/kindck-send-object.rs index a3eb47be3eed8a4212e2a9a7e233b5c0b25f6dee..82b97878549032dff3dc57a10051f0f7766d2628 100644 --- a/src/test/compile-fail/kindck-send-object.rs +++ b/src/test/compile-fail/kindck-send-object.rs @@ -20,12 +20,12 @@ trait Message : Send { } fn object_ref_with_static_bound_not_ok() { assert_send::<&'static (Dummy+'static)>(); - //~^ ERROR `Dummy + 'static` cannot be shared between threads safely [E0277] + //~^ ERROR `(dyn Dummy + 'static)` cannot be shared between threads safely [E0277] } fn box_object_with_no_bound_not_ok<'a>() { assert_send::>(); - //~^ ERROR `Dummy` cannot be sent between threads safely + //~^ ERROR `dyn Dummy` cannot be sent between threads safely } fn object_with_send_bound_ok() { diff --git a/src/test/compile-fail/kindck-send-object1.rs b/src/test/compile-fail/kindck-send-object1.rs index 673a6abc5f03df178b0abbf78bf8efc120e75c5b..853630aa41628a90f2c98d35dab6ee746a328d01 100644 --- a/src/test/compile-fail/kindck-send-object1.rs +++ b/src/test/compile-fail/kindck-send-object1.rs @@ -18,7 +18,7 @@ trait Dummy { } // careful with object types, who knows what they close over... fn test51<'a>() { assert_send::<&'a Dummy>(); - //~^ ERROR `Dummy + 'a` cannot be shared between threads safely [E0277] + //~^ ERROR `(dyn Dummy + 'a)` cannot be shared between threads safely [E0277] } fn test52<'a>() { assert_send::<&'a (Dummy+Sync)>(); @@ -37,7 +37,7 @@ fn test61() { // them not ok fn test_71<'a>() { assert_send::>(); - //~^ ERROR `Dummy + 'a` cannot be sent between threads safely + //~^ ERROR `(dyn Dummy + 'a)` cannot be sent between threads safely } fn main() { } diff --git a/src/test/compile-fail/kindck-send-object2.rs b/src/test/compile-fail/kindck-send-object2.rs index 3a935af200054a0e3d6f20460fb88038cbe15090..0265f888e7c317411a728d9e0021bc80add29c0d 100644 --- a/src/test/compile-fail/kindck-send-object2.rs +++ b/src/test/compile-fail/kindck-send-object2.rs @@ -15,12 +15,12 @@ trait Dummy { } fn test50() { assert_send::<&'static Dummy>(); - //~^ ERROR `Dummy + 'static` cannot be shared between threads safely [E0277] + //~^ ERROR `(dyn Dummy + 'static)` cannot be shared between threads safely [E0277] } fn test53() { assert_send::>(); - //~^ ERROR `Dummy` cannot be sent between threads safely + //~^ ERROR `dyn Dummy` cannot be sent between threads safely } // ...unless they are properly bounded diff --git a/src/test/compile-fail/map-types.rs b/src/test/compile-fail/map-types.rs index 9dcf902a69f916c7f343ebcd3de73f1853519ff9..e8ff9e817af2ca9d67bda5eda4bb9d4a2731fea1 100644 --- a/src/test/compile-fail/map-types.rs +++ b/src/test/compile-fail/map-types.rs @@ -25,5 +25,5 @@ fn main() { let x: Box> = box HashMap::new(); let x: Box> = x; let y: Box> = Box::new(x); - //~^ ERROR `std::boxed::Box>: Map` is not satisfied + //~^ ERROR `std::boxed::Box>: Map` is not satisfied } diff --git a/src/test/compile-fail/non-interger-atomic.rs b/src/test/compile-fail/non-interger-atomic.rs index a51a9e518ce5fe7e0d7aac6fd9f6b9b7922ac72f..2a6e148ca791157c491d92fecbcfe9e1951b0708 100644 --- a/src/test/compile-fail/non-interger-atomic.rs +++ b/src/test/compile-fail/non-interger-atomic.rs @@ -61,22 +61,22 @@ pub unsafe fn test_Foo_cxchg(p: &mut Foo, v: Foo) { pub unsafe fn test_Bar_load(p: &mut Bar, v: Bar) { intrinsics::atomic_load(p); - //~^ ERROR expected basic integer type, found `&std::ops::Fn()` + //~^ ERROR expected basic integer type, found `&dyn std::ops::Fn()` } pub unsafe fn test_Bar_store(p: &mut Bar, v: Bar) { intrinsics::atomic_store(p, v); - //~^ ERROR expected basic integer type, found `&std::ops::Fn()` + //~^ ERROR expected basic integer type, found `&dyn std::ops::Fn()` } pub unsafe fn test_Bar_xchg(p: &mut Bar, v: Bar) { intrinsics::atomic_xchg(p, v); - //~^ ERROR expected basic integer type, found `&std::ops::Fn()` + //~^ ERROR expected basic integer type, found `&dyn std::ops::Fn()` } pub unsafe fn test_Bar_cxchg(p: &mut Bar, v: Bar) { intrinsics::atomic_cxchg(p, v, v); - //~^ ERROR expected basic integer type, found `&std::ops::Fn()` + //~^ ERROR expected basic integer type, found `&dyn std::ops::Fn()` } pub unsafe fn test_Quux_load(p: &mut Quux, v: Quux) { 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 8babc734c84cc13afdf33ec6fcaf74f757461362..30f8d5e2f45698c5f37d1dd2b8b33d3f1c59c88a 100644 --- a/src/test/compile-fail/object-does-not-impl-trait.rs +++ b/src/test/compile-fail/object-does-not-impl-trait.rs @@ -14,5 +14,5 @@ trait Foo {} fn take_foo(f: F) {} fn take_object(f: Box) { take_foo(f); } -//~^ ERROR `std::boxed::Box: Foo` is not satisfied +//~^ ERROR `std::boxed::Box: Foo` is not satisfied fn main() {} diff --git a/src/test/compile-fail/object-safety-by-value-self-use.rs b/src/test/compile-fail/object-safety-by-value-self-use.rs index 36356cb7d527e2442b1bfdccdf7ca520acc1bc49..e575bbb6ceab102fe8f29e008412915a22962641 100644 --- a/src/test/compile-fail/object-safety-by-value-self-use.rs +++ b/src/test/compile-fail/object-safety-by-value-self-use.rs @@ -22,7 +22,7 @@ trait Baz { } fn use_bar(t: Box) { - t.bar() //~ ERROR cannot move a value of type Bar + t.bar() //~ ERROR cannot move a value of type (dyn Bar + 'static) } fn main() { } diff --git a/src/test/compile-fail/privacy/associated-item-privacy-type-binding.rs b/src/test/compile-fail/privacy/associated-item-privacy-type-binding.rs index c25616c54354d9f0d856927e915e1f383f5c83ba..6019369aa2ebb5111d556194a70186b9974e09c1 100644 --- a/src/test/compile-fail/privacy/associated-item-privacy-type-binding.rs +++ b/src/test/compile-fail/privacy/associated-item-privacy-type-binding.rs @@ -19,19 +19,19 @@ pub trait PubTr: PrivTr {} pub macro mac1() { let _: Box>; - //~^ ERROR type `priv_trait::PubTr + '` is private - //~| ERROR type `priv_trait::PubTr + '` is private + //~^ ERROR type `(dyn priv_trait::PubTr + ')` is private + //~| ERROR type `(dyn priv_trait::PubTr + ')` is private type InSignatureTy2 = Box>; - //~^ ERROR type `priv_trait::PubTr + 'static` is private + //~^ ERROR type `(dyn priv_trait::PubTr + 'static)` is private trait InSignatureTr2: PubTr {} //~^ ERROR trait `priv_trait::PrivTr` is private } pub macro mac2() { let _: Box>; - //~^ ERROR type `priv_trait::PrivTr + '` is private - //~| ERROR type `priv_trait::PrivTr + '` is private + //~^ ERROR type `(dyn priv_trait::PrivTr + ')` is private + //~| ERROR type `(dyn priv_trait::PrivTr + ')` is private type InSignatureTy1 = Box>; - //~^ ERROR type `priv_trait::PrivTr + 'static` is private + //~^ ERROR type `(dyn priv_trait::PrivTr + 'static)` is private trait InSignatureTr1: PrivTr {} //~^ ERROR trait `priv_trait::PrivTr` is private } diff --git a/src/test/compile-fail/private-inferred-type.rs b/src/test/compile-fail/private-inferred-type.rs index 5af8b063c1629f12e0fb6c3f348337b1bef51357..3ca8b1eb2ed3a3d61b36484b2deb13d96a512d41 100644 --- a/src/test/compile-fail/private-inferred-type.rs +++ b/src/test/compile-fail/private-inferred-type.rs @@ -129,7 +129,7 @@ fn main() { m::leak_anon2(); //~ ERROR type `m::Priv` is private m::leak_anon3(); //~ ERROR type `m::Priv` is private - m::leak_dyn1(); //~ ERROR type `m::Trait + 'static` is private + m::leak_dyn1(); //~ ERROR type `(dyn m::Trait + 'static)` is private m::leak_dyn2(); //~ ERROR type `m::Priv` is private m::leak_dyn3(); //~ ERROR type `m::Priv` is private diff --git a/src/test/compile-fail/trait-item-privacy.rs b/src/test/compile-fail/trait-item-privacy.rs index be0f7dd4e1cd73f34d35a8b2c7f1cbf3443eda21..f8e4f0d596e20d3a005514552b5ea0eecaa42e64 100644 --- a/src/test/compile-fail/trait-item-privacy.rs +++ b/src/test/compile-fail/trait-item-privacy.rs @@ -110,9 +110,9 @@ fn check_assoc_const() { // A, B, C are resolved as inherent items, their traits don't need to be in scope C::A; //~ ERROR associated constant `A` is private //~^ ERROR the trait `assoc_const::C` cannot be made into an object - //~| ERROR the trait bound `assoc_const::C: assoc_const::A` is not satisfied + //~| ERROR the trait bound `dyn assoc_const::C: assoc_const::A` is not satisfied C::B; // ERROR the trait `assoc_const::C` cannot be made into an object - //~^ ERROR the trait bound `assoc_const::C: assoc_const::B` is not satisfied + //~^ ERROR the trait bound `dyn assoc_const::C: assoc_const::B` is not satisfied C::C; // OK } diff --git a/src/test/compile-fail/traits-repeated-supertrait-ambig.rs b/src/test/compile-fail/traits-repeated-supertrait-ambig.rs index 3fc0d638dd6f1880be39caa81b4c71bdb4e4e35c..559871af72ed630e8b0e5d32f38930a077d974e8 100644 --- a/src/test/compile-fail/traits-repeated-supertrait-ambig.rs +++ b/src/test/compile-fail/traits-repeated-supertrait-ambig.rs @@ -33,7 +33,7 @@ fn same_as(&self, t: u64) -> bool { *self == (t as i64) } impl CompareToInts for i64 { } fn with_obj(c: &CompareToInts) -> bool { - c.same_as(22) //~ ERROR `CompareToInts: CompareTo` is not satisfied + c.same_as(22) //~ ERROR `dyn CompareToInts: CompareTo` is not satisfied } fn with_trait(c: &C) -> bool { @@ -41,7 +41,7 @@ fn with_trait(c: &C) -> bool { } fn with_ufcs1(c: &C) -> bool { - CompareToInts::same_as(c, 22) //~ ERROR `CompareToInts: CompareTo` is not satisfied + CompareToInts::same_as(c, 22) //~ ERROR `dyn CompareToInts: CompareTo` is not satisfied } fn with_ufcs2(c: &C) -> bool { diff --git a/src/test/compile-fail/trivial_casts.rs b/src/test/compile-fail/trivial_casts.rs index aabf0d26d5ba7db921d144fd43df73d2ab35edb5..3f2bd2ffabf4bad00cd416e10feec06f5092466d 100644 --- a/src/test/compile-fail/trivial_casts.rs +++ b/src/test/compile-fail/trivial_casts.rs @@ -59,25 +59,25 @@ pub fn main() { // unsize trait let x: &Bar = &Bar; - let _ = x as &Foo; //~ERROR trivial cast: `&Bar` as `&Foo` - let _ = x as *const Foo; //~ERROR trivial cast: `&Bar` as `*const Foo` + let _ = x as &Foo; //~ERROR trivial cast: `&Bar` as `&dyn Foo` + let _ = x as *const Foo; //~ERROR trivial cast: `&Bar` as `*const dyn Foo` let _: &Foo = x; let _: *const Foo = x; let x: &mut Bar = &mut Bar; - let _ = x as &mut Foo; //~ERROR trivial cast: `&mut Bar` as `&mut Foo` - let _ = x as *mut Foo; //~ERROR trivial cast: `&mut Bar` as `*mut Foo` + let _ = x as &mut Foo; //~ERROR trivial cast: `&mut Bar` as `&mut dyn Foo` + let _ = x as *mut Foo; //~ERROR trivial cast: `&mut Bar` as `*mut dyn Foo` let _: &mut Foo = x; let _: *mut Foo = x; let x: Box = Box::new(Bar); - let _ = x as Box; //~ERROR trivial cast: `std::boxed::Box` as `std::boxed::Box` + let _ = x as Box; //~ERROR `std::boxed::Box` as `std::boxed::Box` let x: Box = Box::new(Bar); let _: Box = x; // functions fn baz(_x: i32) {} - let _ = &baz as &Fn(i32); //~ERROR trivial cast: `&fn(i32) {main::baz}` as `&std::ops::Fn(i32)` + let _ = &baz as &Fn(i32); //~ERROR `&fn(i32) {main::baz}` as `&dyn std::ops::Fn(i32)` let _: &Fn(i32) = &baz; let x = |_x: i32| {}; let _ = &x as &Fn(i32); //~ERROR trivial cast diff --git a/src/test/compile-fail/type-mismatch-same-crate-name.rs b/src/test/compile-fail/type-mismatch-same-crate-name.rs index 4295d08a4709c701eaa8e63336ff5fac086e9e4d..7e93f626cfcfb38ef65c00769270576ecb249950 100644 --- a/src/test/compile-fail/type-mismatch-same-crate-name.rs +++ b/src/test/compile-fail/type-mismatch-same-crate-name.rs @@ -33,7 +33,7 @@ fn main() { //~^ ERROR mismatched types //~| Perhaps two different versions of crate `crate_a1` //~| expected trait `main::a::Bar` - //~| expected type `std::boxed::Box` - //~| found type `std::boxed::Box` + //~| expected type `std::boxed::Box<(dyn main::a::Bar + 'static)>` + //~| found type `std::boxed::Box` } } diff --git a/src/test/compile-fail/type-parameter-defaults-referencing-Self-ppaux.rs b/src/test/compile-fail/type-parameter-defaults-referencing-Self-ppaux.rs index 09687724656fa8febe373f1f01ed750e45efed27..08988353886451992f644ceac9ab7dcb2ca2a85c 100644 --- a/src/test/compile-fail/type-parameter-defaults-referencing-Self-ppaux.rs +++ b/src/test/compile-fail/type-parameter-defaults-referencing-Self-ppaux.rs @@ -23,5 +23,5 @@ fn main() { let x: i32 = 5; let y = x as MyAdd; //~^ ERROR E0038 - //~| ERROR cast to unsized type: `i32` as `MyAdd` + //~| ERROR cast to unsized type: `i32` as `dyn MyAdd` } diff --git a/src/test/run-pass/issue-21058.rs b/src/test/run-pass/issue-21058.rs index 19cd1cf3df717721c9bbfcdb85825b0699aa437a..862439e21f4f3737743737ac08e6ab66dcc36ade 100644 --- a/src/test/run-pass/issue-21058.rs +++ b/src/test/run-pass/issue-21058.rs @@ -26,5 +26,5 @@ fn main() { std::intrinsics::type_name::(), // DST std::intrinsics::type_name::() - )}, ("[u8]", "str", "std::marker::Send", "NT", "DST")); + )}, ("[u8]", "str", "dyn std::marker::Send", "NT", "DST")); } diff --git a/src/test/ui/anonymous-higher-ranked-lifetime.stderr b/src/test/ui/anonymous-higher-ranked-lifetime.stderr index 82f527f8cca88f6d6a286a2b5f88e3a66dca4618..809d111d74e65e2ac921756ffcadb05b68e4fae8 100644 --- a/src/test/ui/anonymous-higher-ranked-lifetime.stderr +++ b/src/test/ui/anonymous-higher-ranked-lifetime.stderr @@ -74,7 +74,7 @@ error[E0631]: type mismatch in closure arguments LL | g1(|_: (), _: ()| {}); //~ ERROR type mismatch | ^^ -------------- found signature of `fn((), ()) -> _` | | - | expected signature of `for<'r> fn(&'r (), std::boxed::Box std::ops::Fn(&'s ()) + 'static>) -> _` + | expected signature of `for<'r> fn(&'r (), std::boxed::Box<(dyn for<'s> std::ops::Fn(&'s ()) + 'static)>) -> _` | note: required by `g1` --> $DIR/anonymous-higher-ranked-lifetime.rs:33:1 @@ -102,7 +102,7 @@ error[E0631]: type mismatch in closure arguments LL | g3(|_: (), _: ()| {}); //~ ERROR type mismatch | ^^ -------------- found signature of `fn((), ()) -> _` | | - | expected signature of `for<'s> fn(&'s (), std::boxed::Box std::ops::Fn(&'r ()) + 'static>) -> _` + | expected signature of `for<'s> fn(&'s (), std::boxed::Box<(dyn for<'r> std::ops::Fn(&'r ()) + 'static)>) -> _` | note: required by `g3` --> $DIR/anonymous-higher-ranked-lifetime.rs:35:1 @@ -130,7 +130,7 @@ error[E0631]: type mismatch in closure arguments LL | h1(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch | ^^ ---------------------------- found signature of `fn((), (), (), ()) -> _` | | - | expected signature of `for<'r, 's> fn(&'r (), std::boxed::Box std::ops::Fn(&'t0 ()) + 'static>, &'s (), for<'t0, 't1> fn(&'t0 (), &'t1 ())) -> _` + | expected signature of `for<'r, 's> fn(&'r (), std::boxed::Box<(dyn for<'t0> std::ops::Fn(&'t0 ()) + 'static)>, &'s (), for<'t0, 't1> fn(&'t0 (), &'t1 ())) -> _` | note: required by `h1` --> $DIR/anonymous-higher-ranked-lifetime.rs:39:1 @@ -144,7 +144,7 @@ error[E0631]: type mismatch in closure arguments LL | h2(|_: (), _: (), _: (), _: ()| {}); //~ ERROR type mismatch | ^^ ---------------------------- found signature of `fn((), (), (), ()) -> _` | | - | expected signature of `for<'r, 't0> fn(&'r (), std::boxed::Box std::ops::Fn(&'s ()) + 'static>, &'t0 (), for<'s, 't1> fn(&'s (), &'t1 ())) -> _` + | expected signature of `for<'r, 't0> fn(&'r (), std::boxed::Box<(dyn for<'s> std::ops::Fn(&'s ()) + 'static)>, &'t0 (), for<'s, 't1> fn(&'s (), &'t1 ())) -> _` | note: required by `h2` --> $DIR/anonymous-higher-ranked-lifetime.rs:40:1 diff --git a/src/test/ui/arbitrary-self-types-not-object-safe.stderr b/src/test/ui/arbitrary-self-types-not-object-safe.stderr index b3f9cbc587bac86053d5c1bd287267b6a86f5d5f..ec9e65fc4c62d3fb8717c1886e4a5d13bfdf4a76 100644 --- a/src/test/ui/arbitrary-self-types-not-object-safe.stderr +++ b/src/test/ui/arbitrary-self-types-not-object-safe.stderr @@ -13,7 +13,7 @@ LL | let x = Box::new(5usize) as Box; | ^^^^^^^^^^^^^^^^ the trait `Foo` cannot be made into an object | = note: method `foo` has a non-standard `self` type - = note: required because of the requirements on the impl of `std::ops::CoerceUnsized>` for `std::boxed::Box` + = note: required because of the requirements on the impl of `std::ops::CoerceUnsized>` for `std::boxed::Box` error: aborting due to 2 previous errors diff --git a/src/test/ui/cast-to-unsized-trait-object-suggestion.stderr b/src/test/ui/cast-to-unsized-trait-object-suggestion.stderr index 67c33740f19695d772211396bb5b6ddbc23150ba..1e871d472842097a4df8383d24716837ed788c2b 100644 --- a/src/test/ui/cast-to-unsized-trait-object-suggestion.stderr +++ b/src/test/ui/cast-to-unsized-trait-object-suggestion.stderr @@ -1,4 +1,4 @@ -error[E0620]: cast to unsized type: `&{integer}` as `std::marker::Send` +error[E0620]: cast to unsized type: `&{integer}` as `dyn std::marker::Send` --> $DIR/cast-to-unsized-trait-object-suggestion.rs:12:5 | LL | &1 as Send; //~ ERROR cast to unsized @@ -6,7 +6,7 @@ LL | &1 as Send; //~ ERROR cast to unsized | | | help: try casting to a reference instead: `&Send` -error[E0620]: cast to unsized type: `std::boxed::Box<{integer}>` as `std::marker::Send` +error[E0620]: cast to unsized type: `std::boxed::Box<{integer}>` as `dyn std::marker::Send` --> $DIR/cast-to-unsized-trait-object-suggestion.rs:13:5 | LL | Box::new(1) as Send; //~ ERROR cast to unsized diff --git a/src/test/ui/const-unsized.stderr b/src/test/ui/const-unsized.stderr index 2cde4aec2b5d47b84e1fb8cc67a1264fbe88394f..d6fc5391ba83111c1f1c3f55461d65b3e99951dc 100644 --- a/src/test/ui/const-unsized.stderr +++ b/src/test/ui/const-unsized.stderr @@ -1,10 +1,10 @@ -error[E0277]: the size for value values of type `std::fmt::Debug + std::marker::Sync + 'static` cannot be known at compilation time +error[E0277]: the size for value values of type `(dyn std::fmt::Debug + std::marker::Sync + 'static)` cannot be known at compilation time --> $DIR/const-unsized.rs:13:29 | LL | const CONST_0: Debug+Sync = *(&0 as &(Debug+Sync)); | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `std::marker::Sized` is not implemented for `std::fmt::Debug + std::marker::Sync + 'static` + = help: the trait `std::marker::Sized` is not implemented for `(dyn std::fmt::Debug + std::marker::Sync + 'static)` = note: to learn more, visit = note: constant expressions must have a statically known size @@ -18,13 +18,13 @@ LL | const CONST_FOO: str = *"foo"; = note: to learn more, visit = note: constant expressions must have a statically known size -error[E0277]: the size for value values of type `std::fmt::Debug + std::marker::Sync + 'static` cannot be known at compilation time +error[E0277]: the size for value values of type `(dyn std::fmt::Debug + std::marker::Sync + 'static)` cannot be known at compilation time --> $DIR/const-unsized.rs:19:31 | LL | static STATIC_1: Debug+Sync = *(&1 as &(Debug+Sync)); | ^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `std::marker::Sized` is not implemented for `std::fmt::Debug + std::marker::Sync + 'static` + = help: the trait `std::marker::Sized` is not implemented for `(dyn std::fmt::Debug + std::marker::Sync + 'static)` = note: to learn more, visit = note: constant expressions must have a statically known size diff --git a/src/test/ui/did_you_mean/bad-assoc-ty.stderr b/src/test/ui/did_you_mean/bad-assoc-ty.stderr index 169a12ef92e987c1f8b6ad24aae7026ee01f52dd..33792d4f5b3fa4cb62efff4fe2ae71a42a6b3469 100644 --- a/src/test/ui/did_you_mean/bad-assoc-ty.stderr +++ b/src/test/ui/did_you_mean/bad-assoc-ty.stderr @@ -92,7 +92,7 @@ error[E0223]: ambiguous associated type LL | type G = 'static + (Send)::AssocTy; | ^^^^^^^^^^^^^^^^^^^^^^^^^ ambiguous associated type | - = note: specify the type using the syntax `::AssocTy` + = note: specify the type using the syntax `<(dyn std::marker::Send + 'static) as Trait>::AssocTy` error[E0223]: ambiguous associated type --> $DIR/bad-assoc-ty.rs:43:10 @@ -100,7 +100,7 @@ error[E0223]: ambiguous associated type LL | type H = Fn(u8) -> (u8)::Output; | ^^^^^^^^^^^^^^^^^^^^^^ ambiguous associated type | - = note: specify the type using the syntax ` u8 + 'static as Trait>::Output` + = note: specify the type using the syntax `<(dyn std::ops::Fn(u8) -> u8 + 'static) as Trait>::Output` error: aborting due to 15 previous errors diff --git a/src/test/ui/error-codes/E0033-teach.stderr b/src/test/ui/error-codes/E0033-teach.stderr index c74485781c123db6f0b12848b97881aeac3a3064..2fac6080f496a263edec158d5909b59270fd88bc 100644 --- a/src/test/ui/error-codes/E0033-teach.stderr +++ b/src/test/ui/error-codes/E0033-teach.stderr @@ -12,11 +12,11 @@ LL | let trait_obj: &SomeTrait = SomeTrait; | = note: method `foo` has no receiver -error[E0033]: type `&SomeTrait` cannot be dereferenced +error[E0033]: type `&dyn SomeTrait` cannot be dereferenced --> $DIR/E0033-teach.rs:23:9 | LL | let &invalid = trait_obj; - | ^^^^^^^^ type `&SomeTrait` cannot be dereferenced + | ^^^^^^^^ type `&dyn SomeTrait` cannot be dereferenced | = note: This error indicates that a pointer to a trait type cannot be implicitly dereferenced by a pattern. Every trait defines a type, but because the size of trait implementors isn't fixed, this type has no compile-time size. Therefore, all accesses to trait types must be through pointers. If you encounter this error you should try to avoid dereferencing the pointer. diff --git a/src/test/ui/error-codes/E0033.stderr b/src/test/ui/error-codes/E0033.stderr index a1e72d6f6695557da20d0500a1ee16393a35d3a4..5d789566beb066e9f0da6536ad9884840fe0123e 100644 --- a/src/test/ui/error-codes/E0033.stderr +++ b/src/test/ui/error-codes/E0033.stderr @@ -12,11 +12,11 @@ LL | let trait_obj: &SomeTrait = SomeTrait; | = note: method `foo` has no receiver -error[E0033]: type `&SomeTrait` cannot be dereferenced +error[E0033]: type `&dyn SomeTrait` cannot be dereferenced --> $DIR/E0033.rs:21:9 | LL | let &invalid = trait_obj; - | ^^^^^^^^ type `&SomeTrait` cannot be dereferenced + | ^^^^^^^^ type `&dyn SomeTrait` cannot be dereferenced error: aborting due to 3 previous errors diff --git a/src/test/ui/error-codes/E0657.stderr b/src/test/ui/error-codes/E0657.stderr index 23b9666de3cd9f0ea1e059125172bbb43825d062..fb7f88d5ca977e78adf9c3ef545d78fddbb6670e 100644 --- a/src/test/ui/error-codes/E0657.stderr +++ b/src/test/ui/error-codes/E0657.stderr @@ -16,7 +16,7 @@ error[E0308]: mismatched types LL | () //~ ERROR mismatched types | ^^ expected struct `std::boxed::Box`, found () | - = note: expected type `std::boxed::Box + 'static>` + = note: expected type `std::boxed::Box<(dyn Id<_> + 'static)>` found type `()` error[E0308]: mismatched types @@ -25,7 +25,7 @@ error[E0308]: mismatched types LL | () //~ ERROR mismatched types | ^^ expected struct `std::boxed::Box`, found () | - = note: expected type `std::boxed::Box + 'static>` + = note: expected type `std::boxed::Box<(dyn Id<_> + 'static)>` found type `()` error: aborting due to 4 previous errors diff --git a/src/test/ui/fat-ptr-cast.stderr b/src/test/ui/fat-ptr-cast.stderr index cf1dcfcb8ade39447de0a0951a0f477d469251b4..778a4cf1fa01f16de791a08cea0222409da44a71 100644 --- a/src/test/ui/fat-ptr-cast.stderr +++ b/src/test/ui/fat-ptr-cast.stderr @@ -52,7 +52,7 @@ error[E0607]: cannot cast thin pointer `*const i32` to fat pointer `*const [i32] LL | q as *const [i32]; //~ ERROR cannot cast | ^^^^^^^^^^^^^^^^^ -error[E0606]: casting `usize` as `*mut Trait + 'static` is invalid +error[E0606]: casting `usize` as `*mut (dyn Trait + 'static)` is invalid --> $DIR/fat-ptr-cast.rs:32:37 | LL | let t: *mut (Trait + 'static) = 0 as *mut _; //~ ERROR casting diff --git a/src/test/ui/feature-gate-trivial_bounds.stderr b/src/test/ui/feature-gate-trivial_bounds.stderr index db280f2d1f763540068c4d73fd5712b36ba610e8..19a6a8637957eb91de7eb2e4c15ea9d9ab5ae67d 100644 --- a/src/test/ui/feature-gate-trivial_bounds.stderr +++ b/src/test/ui/feature-gate-trivial_bounds.stderr @@ -98,7 +98,7 @@ LL | struct TwoStrs(str, str) where str: Sized; //~ ERROR = help: see issue #48214 = help: add #![feature(trivial_bounds)] to the crate attributes to enable -error[E0277]: the size for value values of type `A + 'static` cannot be known at compilation time +error[E0277]: the size for value values of type `(dyn A + 'static)` cannot be known at compilation time --> $DIR/feature-gate-trivial_bounds.rs:65:1 | LL | / fn unsized_local() where Dst: Sized { //~ ERROR @@ -106,9 +106,9 @@ LL | | let x: Dst = *(Box::new(Dst { x: 1 }) as Box>); LL | | } | |_^ doesn't have a size known at compile-time | - = help: within `Dst`, the trait `std::marker::Sized` is not implemented for `A + 'static` + = help: within `Dst<(dyn A + 'static)>`, the trait `std::marker::Sized` is not implemented for `(dyn A + 'static)` = note: to learn more, visit - = note: required because it appears within the type `Dst` + = note: required because it appears within the type `Dst<(dyn A + 'static)>` = help: see issue #48214 = help: add #![feature(trivial_bounds)] to the crate attributes to enable diff --git a/src/test/ui/fmt/send-sync.stderr b/src/test/ui/fmt/send-sync.stderr index 807b499155b855955c11df69b719a14717e25f6e..0d9239d72276e899c6424bd26de45e4666faf111 100644 --- a/src/test/ui/fmt/send-sync.stderr +++ b/src/test/ui/fmt/send-sync.stderr @@ -1,11 +1,11 @@ -error[E0277]: `*mut std::ops::Fn() + 'static` cannot be shared between threads safely +error[E0277]: `*mut (dyn std::ops::Fn() + 'static)` cannot be shared between threads safely --> $DIR/send-sync.rs:18:5 | LL | send(format_args!("{:?}", c)); //~ ERROR E0277 - | ^^^^ `*mut std::ops::Fn() + 'static` cannot be shared between threads safely + | ^^^^ `*mut (dyn std::ops::Fn() + 'static)` cannot be shared between threads safely | - = help: within `[std::fmt::ArgumentV1<'_>]`, the trait `std::marker::Sync` is not implemented for `*mut std::ops::Fn() + 'static` - = note: required because it appears within the type `std::marker::PhantomData<*mut std::ops::Fn() + 'static>` + = help: within `[std::fmt::ArgumentV1<'_>]`, the trait `std::marker::Sync` is not implemented for `*mut (dyn std::ops::Fn() + 'static)` + = note: required because it appears within the type `std::marker::PhantomData<*mut (dyn std::ops::Fn() + 'static)>` = note: required because it appears within the type `core::fmt::Void` = note: required because it appears within the type `&core::fmt::Void` = note: required because it appears within the type `std::fmt::ArgumentV1<'_>` @@ -18,14 +18,14 @@ note: required by `send` LL | fn send(_: T) {} | ^^^^^^^^^^^^^^^^^^^^^^ -error[E0277]: `*mut std::ops::Fn() + 'static` cannot be shared between threads safely +error[E0277]: `*mut (dyn std::ops::Fn() + 'static)` cannot be shared between threads safely --> $DIR/send-sync.rs:19:5 | LL | sync(format_args!("{:?}", c)); //~ ERROR E0277 - | ^^^^ `*mut std::ops::Fn() + 'static` cannot be shared between threads safely + | ^^^^ `*mut (dyn std::ops::Fn() + 'static)` cannot be shared between threads safely | - = help: within `std::fmt::Arguments<'_>`, the trait `std::marker::Sync` is not implemented for `*mut std::ops::Fn() + 'static` - = note: required because it appears within the type `std::marker::PhantomData<*mut std::ops::Fn() + 'static>` + = help: within `std::fmt::Arguments<'_>`, the trait `std::marker::Sync` is not implemented for `*mut (dyn std::ops::Fn() + 'static)` + = note: required because it appears within the type `std::marker::PhantomData<*mut (dyn std::ops::Fn() + 'static)>` = note: required because it appears within the type `core::fmt::Void` = note: required because it appears within the type `&core::fmt::Void` = note: required because it appears within the type `std::fmt::ArgumentV1<'_>` diff --git a/src/test/ui/in-band-lifetimes/impl/dyn-trait.stderr b/src/test/ui/in-band-lifetimes/impl/dyn-trait.stderr index 201470abe674cde98effb422f391cf95108a27a3..07b86228f61182466b75c15c17d784d6a8303cce 100644 --- a/src/test/ui/in-band-lifetimes/impl/dyn-trait.stderr +++ b/src/test/ui/in-band-lifetimes/impl/dyn-trait.stderr @@ -10,8 +10,8 @@ note: first, the lifetime cannot outlive the lifetime 'a as defined on the funct LL | fn with_dyn_debug_static<'a>(x: Box) { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ = note: ...so that the expression is assignable: - expected std::boxed::Box - found std::boxed::Box + expected std::boxed::Box + found std::boxed::Box<(dyn std::fmt::Debug + 'a)> = note: but, the lifetime must be valid for the static lifetime... = note: ...so that the types are compatible: expected StaticTrait diff --git a/src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.stderr b/src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.stderr index 37b586e1e3bd004dfb2e74007a750233aa0f85a1..169369c304eb22092fbfebaa2bc3ef638d08c3d3 100644 --- a/src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.stderr +++ b/src/test/ui/in-band-lifetimes/mismatched_trait_impl-2.stderr @@ -13,8 +13,8 @@ LL | | } | |_____^ = note: ...but the lifetime must also be valid for the static lifetime... = note: ...so that the method type is compatible with trait: - expected fn(&Struct) -> &Trait + 'static - found fn(&Struct) -> &Trait + expected fn(&Struct) -> &(dyn Trait + 'static) + found fn(&Struct) -> &dyn Trait error: aborting due to previous error diff --git a/src/test/ui/issue-17441.rs b/src/test/ui/issue-17441.rs index c7b077014616c725793202a48b7b3cf415834337..5432d5f5ed910007cd5b76c1505801a7ad7bc86f 100644 --- a/src/test/ui/issue-17441.rs +++ b/src/test/ui/issue-17441.rs @@ -13,10 +13,10 @@ fn main() { //~^ ERROR cast to unsized type: `&[usize; 2]` as `[usize]` let _bar = Box::new(1_usize) as std::fmt::Debug; - //~^ ERROR cast to unsized type: `std::boxed::Box` as `std::fmt::Debug` + //~^ ERROR cast to unsized type: `std::boxed::Box` as `dyn std::fmt::Debug` let _baz = 1_usize as std::fmt::Debug; - //~^ ERROR cast to unsized type: `usize` as `std::fmt::Debug` + //~^ ERROR cast to unsized type: `usize` as `dyn std::fmt::Debug` let _quux = [1_usize, 2] as [usize]; //~^ ERROR cast to unsized type: `[usize; 2]` as `[usize]` diff --git a/src/test/ui/issue-17441.stderr b/src/test/ui/issue-17441.stderr index 80ba49cce1a0cc5091469a2c11589463db269268..6c7e883f9f9c2c118c5354a6ec93cd9673a9e2c6 100644 --- a/src/test/ui/issue-17441.stderr +++ b/src/test/ui/issue-17441.stderr @@ -10,7 +10,7 @@ help: consider using an implicit coercion to `&[usize]` instead LL | let _foo = &[1_usize, 2] as [usize]; | ^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0620]: cast to unsized type: `std::boxed::Box` as `std::fmt::Debug` +error[E0620]: cast to unsized type: `std::boxed::Box` as `dyn std::fmt::Debug` --> $DIR/issue-17441.rs:15:16 | LL | let _bar = Box::new(1_usize) as std::fmt::Debug; @@ -18,7 +18,7 @@ LL | let _bar = Box::new(1_usize) as std::fmt::Debug; | | | help: try casting to a `Box` instead: `Box` -error[E0620]: cast to unsized type: `usize` as `std::fmt::Debug` +error[E0620]: cast to unsized type: `usize` as `dyn std::fmt::Debug` --> $DIR/issue-17441.rs:18:16 | LL | let _baz = 1_usize as std::fmt::Debug; diff --git a/src/test/ui/issue-20692.stderr b/src/test/ui/issue-20692.stderr index 1316773f6b789d3e088279779c94f1b9ac92c7f7..156ebd920f0d95e0955076b931625c61bd7a105e 100644 --- a/src/test/ui/issue-20692.stderr +++ b/src/test/ui/issue-20692.stderr @@ -13,7 +13,7 @@ LL | let _ = x | ^ the trait `Array` cannot be made into an object | = note: the trait cannot require that `Self : Sized` - = note: required because of the requirements on the impl of `std::ops::CoerceUnsized<&Array>` for `&T` + = note: required because of the requirements on the impl of `std::ops::CoerceUnsized<&dyn Array>` for `&T` error: aborting due to 2 previous errors diff --git a/src/test/ui/lint-ctypes.rs b/src/test/ui/lint-ctypes.rs index 4b20001457f78216b5a1feeb7f29d17feddb718b..7f22dc8739e76a6a42b47382d5eb282e95103ff5 100644 --- a/src/test/ui/lint-ctypes.rs +++ b/src/test/ui/lint-ctypes.rs @@ -59,7 +59,7 @@ pub struct StructWithProjectionAndLifetime<'a>( pub fn char_type(p: char); //~ ERROR uses type `char` pub fn i128_type(p: i128); //~ ERROR uses type `i128` pub fn u128_type(p: u128); //~ ERROR uses type `u128` - pub fn trait_type(p: &Clone); //~ ERROR uses type `std::clone::Clone` + pub fn trait_type(p: &Clone); //~ ERROR uses type `dyn std::clone::Clone` pub fn tuple_type(p: (i32, i32)); //~ ERROR uses type `(i32, i32)` pub fn tuple_type2(p: I32Pair); //~ ERROR uses type `(i32, i32)` pub fn zero_size(p: ZeroSize); //~ ERROR struct has no fields diff --git a/src/test/ui/lint-ctypes.stderr b/src/test/ui/lint-ctypes.stderr index 76b500e7d23bfe5058ff5a8590694296a54657f2..d1ef3a7a19c294b7983399a3c4813b724197b192 100644 --- a/src/test/ui/lint-ctypes.stderr +++ b/src/test/ui/lint-ctypes.stderr @@ -73,10 +73,10 @@ error: `extern` block uses type `u128` which is not FFI-safe: 128-bit integers d LL | pub fn u128_type(p: u128); //~ ERROR uses type `u128` | ^^^^ -error: `extern` block uses type `std::clone::Clone` which is not FFI-safe: trait objects have no C equivalent +error: `extern` block uses type `dyn std::clone::Clone` which is not FFI-safe: trait objects have no C equivalent --> $DIR/lint-ctypes.rs:62:26 | -LL | pub fn trait_type(p: &Clone); //~ ERROR uses type `std::clone::Clone` +LL | pub fn trait_type(p: &Clone); //~ ERROR uses type `dyn std::clone::Clone` | ^^^^^^ error: `extern` block uses type `(i32, i32)` which is not FFI-safe: tuples have unspecified layout diff --git a/src/test/ui/lub-glb/old-lub-glb-object.stderr b/src/test/ui/lub-glb/old-lub-glb-object.stderr index 6a69e7cc717208a2c0a19970802ff4d1ef9e0005..79442bd108a6759fe1ef27761d6e5309935bbf50 100644 --- a/src/test/ui/lub-glb/old-lub-glb-object.stderr +++ b/src/test/ui/lub-glb/old-lub-glb-object.stderr @@ -9,8 +9,8 @@ LL | | _ => y, LL | | }; | |_____^ expected bound lifetime parameter 'a, found concrete lifetime | - = note: expected type `&for<'a, 'b> Foo<&'a u8, &'b u8>` - found type `&for<'a> Foo<&'a u8, &'a u8>` + = note: expected type `&dyn for<'a, 'b> Foo<&'a u8, &'b u8>` + found type `&dyn for<'a> Foo<&'a u8, &'a u8>` = note: this was previously accepted by the compiler but has been phased out = note: for more information, see https://github.com/rust-lang/rust/issues/45852 diff --git a/src/test/ui/mismatched_types/cast-rfc0401.stderr b/src/test/ui/mismatched_types/cast-rfc0401.stderr index feaf492837f7f83b795717934763cd8890f760e8..9335795f6b8f322c0d3d0e6355f6ff61d0a025c1 100644 --- a/src/test/ui/mismatched_types/cast-rfc0401.stderr +++ b/src/test/ui/mismatched_types/cast-rfc0401.stderr @@ -162,13 +162,13 @@ error[E0607]: cannot cast thin pointer `*const u8` to fat pointer `*const [u8]` LL | let _ = v as *const [u8]; //~ ERROR cannot cast | ^^^^^^^^^^^^^^^^ -error[E0606]: casting `&Foo` as `*const str` is invalid +error[E0606]: casting `&dyn Foo` as `*const str` is invalid --> $DIR/cast-rfc0401.rs:64:13 | LL | let _ = foo as *const str; //~ ERROR is invalid | ^^^^^^^^^^^^^^^^^ -error[E0606]: casting `&Foo` as `*mut str` is invalid +error[E0606]: casting `&dyn Foo` as `*mut str` is invalid --> $DIR/cast-rfc0401.rs:65:13 | LL | let _ = foo as *mut str; //~ ERROR is invalid @@ -200,7 +200,7 @@ LL | let _ = fat_sv as usize; //~ ERROR is invalid | = help: cast through a thin pointer first -error[E0606]: casting `*const Foo` as `*const [u16]` is invalid +error[E0606]: casting `*const dyn Foo` as `*const [u16]` is invalid --> $DIR/cast-rfc0401.rs:78:13 | LL | let _ = cf as *const [u16]; //~ ERROR is invalid @@ -208,7 +208,7 @@ LL | let _ = cf as *const [u16]; //~ ERROR is invalid | = note: vtable kinds may not match -error[E0606]: casting `*const Foo` as `*const Bar` is invalid +error[E0606]: casting `*const dyn Foo` as `*const dyn Bar` is invalid --> $DIR/cast-rfc0401.rs:79:13 | LL | let _ = cf as *const Bar; //~ ERROR is invalid @@ -224,7 +224,7 @@ LL | let _ = fat_v as *const Foo; //~ ERROR the size for value values of typ | = help: the trait `std::marker::Sized` is not implemented for `[u8]` = note: to learn more, visit - = note: required for the cast to the object type `Foo` + = note: required for the cast to the object type `dyn Foo` error[E0277]: the size for value values of type `str` cannot be known at compilation time --> $DIR/cast-rfc0401.rs:72:13 @@ -234,7 +234,7 @@ LL | let _ = a as *const Foo; //~ ERROR the size for value values of type | = help: the trait `std::marker::Sized` is not implemented for `str` = note: to learn more, visit - = note: required for the cast to the object type `Foo` + = note: required for the cast to the object type `dyn Foo` error[E0606]: casting `&{float}` as `f32` is invalid --> $DIR/cast-rfc0401.rs:81:30 diff --git a/src/test/ui/mismatched_types/issue-19109.stderr b/src/test/ui/mismatched_types/issue-19109.stderr index c838c617ae4534beba91cc99724e2b0b55d671e8..018ea941d12da20a3aadde361ed388a64718f0ad 100644 --- a/src/test/ui/mismatched_types/issue-19109.stderr +++ b/src/test/ui/mismatched_types/issue-19109.stderr @@ -2,12 +2,12 @@ error[E0308]: mismatched types --> $DIR/issue-19109.rs:14:5 | LL | fn function(t: &mut Trait) { - | - help: try adding a return type: `-> *mut Trait` + | - help: try adding a return type: `-> *mut dyn Trait` LL | t as *mut Trait | ^^^^^^^^^^^^^^^ expected (), found *-ptr | = note: expected type `()` - found type `*mut Trait` + found type `*mut dyn Trait` error: aborting due to previous error diff --git a/src/test/ui/mismatched_types/trait-bounds-cant-coerce.stderr b/src/test/ui/mismatched_types/trait-bounds-cant-coerce.stderr index bbe9053430a1c8ff994b3fba02898a9d7f1cc1f9..15c9fd6bf8fe83d0ba22ea764f7eb148e854623c 100644 --- a/src/test/ui/mismatched_types/trait-bounds-cant-coerce.stderr +++ b/src/test/ui/mismatched_types/trait-bounds-cant-coerce.stderr @@ -4,8 +4,8 @@ error[E0308]: mismatched types LL | a(x); //~ ERROR mismatched types [E0308] | ^ expected trait `Foo + std::marker::Send`, found trait `Foo` | - = note: expected type `std::boxed::Box` - found type `std::boxed::Box` + = note: expected type `std::boxed::Box<(dyn Foo + std::marker::Send + 'static)>` + found type `std::boxed::Box<(dyn Foo + 'static)>` error: aborting due to previous error diff --git a/src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr b/src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr index 3689ca74adb8c304dc0b29796a0def435feba9ed..e07051135779ac6344bf4ba4fee317964e54fa76 100644 --- a/src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr +++ b/src/test/ui/nll/ty-outlives/projection-no-regions-closure.stderr @@ -20,7 +20,7 @@ LL | with_signature(x, |mut y| Box::new(y.next())) '_#1r, T, i32, - extern "rust-call" fn((std::boxed::Box,)) -> std::boxed::Box + extern "rust-call" fn((std::boxed::Box,)) -> std::boxed::Box<(dyn Anything + '_#2r)> ] = note: number of external vids: 3 = note: where ::Item: '_#2r @@ -60,7 +60,7 @@ LL | with_signature(x, |mut y| Box::new(y.next())) '_#1r, T, i32, - extern "rust-call" fn((std::boxed::Box,)) -> std::boxed::Box + extern "rust-call" fn((std::boxed::Box,)) -> std::boxed::Box<(dyn Anything + '_#2r)> ] = note: number of external vids: 3 = note: where ::Item: '_#2r @@ -92,7 +92,7 @@ LL | with_signature(x, |mut y| Box::new(y.next())) '_#2r, T, i32, - extern "rust-call" fn((std::boxed::Box,)) -> std::boxed::Box + extern "rust-call" fn((std::boxed::Box,)) -> std::boxed::Box<(dyn Anything + '_#3r)> ] = note: number of external vids: 4 = note: where ::Item: '_#3r @@ -134,7 +134,7 @@ LL | with_signature(x, |mut y| Box::new(y.next())) '_#2r, T, i32, - extern "rust-call" fn((std::boxed::Box,)) -> std::boxed::Box + extern "rust-call" fn((std::boxed::Box,)) -> std::boxed::Box<(dyn Anything + '_#3r)> ] = note: number of external vids: 4 = note: where ::Item: '_#3r diff --git a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr index 59a8a39a7b0857359cbf8d220c3b6ee4ed7053cf..39ad96cc6cd8e9ac47a75859080aadccc4a2df21 100644 --- a/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr +++ b/src/test/ui/nll/ty-outlives/ty-param-closure-outlives-from-return-type.stderr @@ -20,7 +20,7 @@ LL | with_signature(x, |y| y) '_#1r, T, i32, - extern "rust-call" fn((std::boxed::Box,)) -> std::boxed::Box + extern "rust-call" fn((std::boxed::Box,)) -> std::boxed::Box<(dyn std::fmt::Debug + '_#2r)> ] = note: number of external vids: 3 = note: where T: '_#2r diff --git a/src/test/ui/resolve/issue-5035-2.stderr b/src/test/ui/resolve/issue-5035-2.stderr index efcd0b3624811c76d4db90ee6c2329df367588ef..72bd270165fd09240f7bf584f4fff4466e0e96f5 100644 --- a/src/test/ui/resolve/issue-5035-2.stderr +++ b/src/test/ui/resolve/issue-5035-2.stderr @@ -1,10 +1,10 @@ -error[E0277]: the size for value values of type `I + 'static` cannot be known at compilation time +error[E0277]: the size for value values of type `(dyn I + 'static)` cannot be known at compilation time --> $DIR/issue-5035-2.rs:14:8 | LL | fn foo(_x: K) {} | ^^ doesn't have a size known at compile-time | - = help: the trait `std::marker::Sized` is not implemented for `I + 'static` + = help: the trait `std::marker::Sized` is not implemented for `(dyn I + 'static)` = note: to learn more, visit = note: all local variables must have a statically known size diff --git a/src/test/ui/span/borrowck-object-mutability.nll.stderr b/src/test/ui/span/borrowck-object-mutability.nll.stderr index cf615eed55691d3fc1db747ee184707042d3c7b8..b318e778f8766b6c78f3d23290252a2bbdf67a3e 100644 --- a/src/test/ui/span/borrowck-object-mutability.nll.stderr +++ b/src/test/ui/span/borrowck-object-mutability.nll.stderr @@ -2,7 +2,7 @@ error[E0596]: cannot borrow immutable item `*x` as mutable --> $DIR/borrowck-object-mutability.rs:19:5 | LL | fn borrowed_receiver(x: &Foo) { - | ---- help: consider changing this to be a mutable reference: `&mut Foo` + | ---- help: consider changing this to be a mutable reference: `&mut dyn Foo` LL | x.borrowed(); LL | x.borrowed_mut(); //~ ERROR cannot borrow | ^ `x` is a `&` reference, so the data it refers to cannot be borrowed as mutable diff --git a/src/test/ui/suggestions/confuse-field-and-method/issue-2392.stderr b/src/test/ui/suggestions/confuse-field-and-method/issue-2392.stderr index bd5efcd9fee7a756c81f25cee7e1804599eb3105..9049ffd40909007a94d56a40f5d664da56753e1c 100644 --- a/src/test/ui/suggestions/confuse-field-and-method/issue-2392.stderr +++ b/src/test/ui/suggestions/confuse-field-and-method/issue-2392.stderr @@ -75,7 +75,7 @@ LL | w.wrap.not_closure(); | = help: did you mean to write `w.wrap.not_closure` instead of `w.wrap.not_closure(...)`? -error[E0599]: no method named `closure` found for type `Obj + 'static>>` in the current scope +error[E0599]: no method named `closure` found for type `Obj + 'static)>>` in the current scope --> $DIR/issue-2392.rs:72:24 | LL | struct Obj where F: FnOnce() -> u32 { diff --git a/src/test/ui/trivial-bounds-inconsistent-sized.stderr b/src/test/ui/trivial-bounds-inconsistent-sized.stderr index ee2ff7d7861396d5353f2b5e9817e1ca389b2fd1..e18018c6f0c0172a074abe4e32b98f6034df6591 100644 --- a/src/test/ui/trivial-bounds-inconsistent-sized.stderr +++ b/src/test/ui/trivial-bounds-inconsistent-sized.stderr @@ -6,7 +6,7 @@ LL | struct S(str, str) where str: Sized; | = note: #[warn(trivial_bounds)] on by default -warning: Trait bound for<'a> T: std::marker::Sized does not depend on any type or lifetime parameters +warning: Trait bound for<'a> T<(dyn A + 'a)>: std::marker::Sized does not depend on any type or lifetime parameters --> $DIR/trivial-bounds-inconsistent-sized.rs:26:1 | LL | / fn unsized_local() where for<'a> T: Sized { diff --git a/src/test/ui/trivial-bounds-inconsistent.stderr b/src/test/ui/trivial-bounds-inconsistent.stderr index ee3c7518294773e9dfee69b672440a4c2cbee720..85b16b17042f640862c23da564c98a017d038434 100644 --- a/src/test/ui/trivial-bounds-inconsistent.stderr +++ b/src/test/ui/trivial-bounds-inconsistent.stderr @@ -78,7 +78,7 @@ warning: Trait bound str: std::marker::Sized does not depend on any type or life LL | struct TwoStrs(str, str) where str: Sized; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -warning: Trait bound for<'a> Dst: std::marker::Sized does not depend on any type or lifetime parameters +warning: Trait bound for<'a> Dst<(dyn A + 'a)>: std::marker::Sized does not depend on any type or lifetime parameters --> $DIR/trivial-bounds-inconsistent.rs:65:1 | LL | / fn unsized_local() where for<'a> Dst: Sized { diff --git a/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr b/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr index 98249d3f2b567cbfac23e87ff46a620e8dc97b8c..cb545ca008d6581f503d6360ece9a41723367cfc 100644 --- a/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr +++ b/src/test/ui/underscore-lifetime/dyn-trait-underscore.stderr @@ -19,8 +19,8 @@ LL | Box::new(items.iter()) //~ ERROR cannot infer an appropriate lifetime | ^^^^^ = note: but, the lifetime must be valid for the static lifetime... = note: ...so that the expression is assignable: - expected std::boxed::Box + 'static> - found std::boxed::Box> + expected std::boxed::Box<(dyn std::iter::Iterator + 'static)> + found std::boxed::Box> error: aborting due to previous error diff --git a/src/test/ui/unsized-enum2.stderr b/src/test/ui/unsized-enum2.stderr index ff2aa1d1ef91778321049ab8101d545a0732b494..1f30c815d30a8be7bba90b1ecee850bfa4bddff6 100644 --- a/src/test/ui/unsized-enum2.stderr +++ b/src/test/ui/unsized-enum2.stderr @@ -82,43 +82,43 @@ LL | VH{u: isize, x: [u32]}, = note: to learn more, visit = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `Foo + 'static` cannot be known at compilation time +error[E0277]: the size for value values of type `(dyn Foo + 'static)` cannot be known at compilation time --> $DIR/unsized-enum2.rs:63:8 | LL | VM(Foo), | ^^^ doesn't have a size known at compile-time | - = help: the trait `std::marker::Sized` is not implemented for `Foo + 'static` + = help: the trait `std::marker::Sized` is not implemented for `(dyn Foo + 'static)` = note: to learn more, visit = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `Bar + 'static` cannot be known at compilation time +error[E0277]: the size for value values of type `(dyn Bar + 'static)` cannot be known at compilation time --> $DIR/unsized-enum2.rs:65:8 | LL | VN{x: Bar}, | ^^^^^^ doesn't have a size known at compile-time | - = help: the trait `std::marker::Sized` is not implemented for `Bar + 'static` + = help: the trait `std::marker::Sized` is not implemented for `(dyn Bar + 'static)` = note: to learn more, visit = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `FooBar + 'static` cannot be known at compilation time +error[E0277]: the size for value values of type `(dyn FooBar + 'static)` cannot be known at compilation time --> $DIR/unsized-enum2.rs:67:15 | LL | VO(isize, FooBar), | ^^^^^^ doesn't have a size known at compile-time | - = help: the trait `std::marker::Sized` is not implemented for `FooBar + 'static` + = help: the trait `std::marker::Sized` is not implemented for `(dyn FooBar + 'static)` = note: to learn more, visit = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `BarFoo + 'static` cannot be known at compilation time +error[E0277]: the size for value values of type `(dyn BarFoo + 'static)` cannot be known at compilation time --> $DIR/unsized-enum2.rs:69:18 | LL | VP{u: isize, x: BarFoo}, | ^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `std::marker::Sized` is not implemented for `BarFoo + 'static` + = help: the trait `std::marker::Sized` is not implemented for `(dyn BarFoo + 'static)` = note: to learn more, visit = note: no field of an enum variant may have a dynamically sized type @@ -162,46 +162,46 @@ LL | VT{u: isize, x: <&'static [i32] as Deref>::Target}, = note: to learn more, visit = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `PathHelper1 + 'static` cannot be known at compilation time +error[E0277]: the size for value values of type `(dyn PathHelper1 + 'static)` cannot be known at compilation time --> $DIR/unsized-enum2.rs:53:8 | LL | VI(Path1), | ^^^^^ doesn't have a size known at compile-time | - = help: within `Path1`, the trait `std::marker::Sized` is not implemented for `PathHelper1 + 'static` + = help: within `Path1`, the trait `std::marker::Sized` is not implemented for `(dyn PathHelper1 + 'static)` = note: to learn more, visit = note: required because it appears within the type `Path1` = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `PathHelper2 + 'static` cannot be known at compilation time +error[E0277]: the size for value values of type `(dyn PathHelper2 + 'static)` cannot be known at compilation time --> $DIR/unsized-enum2.rs:55:8 | LL | VJ{x: Path2}, | ^^^^^^^^ doesn't have a size known at compile-time | - = help: within `Path2`, the trait `std::marker::Sized` is not implemented for `PathHelper2 + 'static` + = help: within `Path2`, the trait `std::marker::Sized` is not implemented for `(dyn PathHelper2 + 'static)` = note: to learn more, visit = note: required because it appears within the type `Path2` = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `PathHelper3 + 'static` cannot be known at compilation time +error[E0277]: the size for value values of type `(dyn PathHelper3 + 'static)` cannot be known at compilation time --> $DIR/unsized-enum2.rs:57:15 | LL | VK(isize, Path3), | ^^^^^ doesn't have a size known at compile-time | - = help: within `Path3`, the trait `std::marker::Sized` is not implemented for `PathHelper3 + 'static` + = help: within `Path3`, the trait `std::marker::Sized` is not implemented for `(dyn PathHelper3 + 'static)` = note: to learn more, visit = note: required because it appears within the type `Path3` = note: no field of an enum variant may have a dynamically sized type -error[E0277]: the size for value values of type `PathHelper4 + 'static` cannot be known at compilation time +error[E0277]: the size for value values of type `(dyn PathHelper4 + 'static)` cannot be known at compilation time --> $DIR/unsized-enum2.rs:59:18 | LL | VL{u: isize, x: Path4}, | ^^^^^^^^ doesn't have a size known at compile-time | - = help: within `Path4`, the trait `std::marker::Sized` is not implemented for `PathHelper4 + 'static` + = help: within `Path4`, the trait `std::marker::Sized` is not implemented for `(dyn PathHelper4 + 'static)` = note: to learn more, visit = note: required because it appears within the type `Path4` = note: no field of an enum variant may have a dynamically sized type