diff --git a/tests/ui/allocator/auxiliary/helper.rs b/tests/ui/allocator/auxiliary/helper.rs index c638546a9475f..4267b901ca07f 100644 --- a/tests/ui/allocator/auxiliary/helper.rs +++ b/tests/ui/allocator/auxiliary/helper.rs @@ -6,6 +6,6 @@ extern crate alloc; use alloc::fmt; -pub fn work_with(p: &fmt::Debug) { +pub fn work_with(p: &dyn fmt::Debug) { drop(p); } diff --git a/tests/ui/coercion/retslot-cast.rs b/tests/ui/coercion/retslot-cast.rs index ae500cb15dfdd..a87ac35a8e1e0 100644 --- a/tests/ui/coercion/retslot-cast.rs +++ b/tests/ui/coercion/retslot-cast.rs @@ -1,7 +1,7 @@ #![allow(warnings)] -pub fn fail(x: Option<&(Iterator+Send)>) - -> Option<&Iterator> { +pub fn fail(x: Option<&(dyn Iterator+Send)>) + -> Option<&dyn Iterator> { // This call used to trigger an LLVM assertion because the return // slot had type "Option<&Iterator>"* instead of // "Option<&(Iterator+Send)>"* -- but this now yields a @@ -13,8 +13,8 @@ pub fn fail(x: Option<&(Iterator+Send)>) inner(x) //~ ERROR mismatched types } -pub fn inner(x: Option<&(Iterator+Send)>) - -> Option<&(Iterator+Send)> { +pub fn inner(x: Option<&(dyn Iterator+Send)>) + -> Option<&(dyn Iterator+Send)> { x } diff --git a/tests/ui/coercion/retslot-cast.stderr b/tests/ui/coercion/retslot-cast.stderr index dac21a7f25b2b..a5242c13edd1b 100644 --- a/tests/ui/coercion/retslot-cast.stderr +++ b/tests/ui/coercion/retslot-cast.stderr @@ -1,8 +1,8 @@ error[E0308]: mismatched types --> $DIR/retslot-cast.rs:13:5 | -LL | -> Option<&Iterator> { - | -------------------------- expected `Option<&dyn Iterator>` because of return type +LL | -> Option<&dyn Iterator> { + | ------------------------------ expected `Option<&dyn Iterator>` because of return type ... LL | inner(x) | ^^^^^^^^ expected trait `Iterator`, found trait `Iterator + Send` diff --git a/tests/ui/coroutine/auxiliary/xcrate.rs b/tests/ui/coroutine/auxiliary/xcrate.rs index 52f188135bd1b..524eaafc75299 100644 --- a/tests/ui/coroutine/auxiliary/xcrate.rs +++ b/tests/ui/coroutine/auxiliary/xcrate.rs @@ -12,7 +12,7 @@ pub fn foo() -> impl Coroutine<(), Yield = (), Return = ()> { } } -pub fn bar(t: T) -> Box + Unpin> { +pub fn bar(t: T) -> Box + Unpin> { Box::new( #[coroutine] || { diff --git a/tests/ui/deprecation/deprecation-lint.rs b/tests/ui/deprecation/deprecation-lint.rs index dc11a4d56a2d6..5eda38732c8c9 100644 --- a/tests/ui/deprecation/deprecation-lint.rs +++ b/tests/ui/deprecation/deprecation-lint.rs @@ -71,7 +71,7 @@ mod cross_crate { ::trait_deprecated_text(&foo); //~ ERROR use of deprecated method `deprecation_lint::Trait::trait_deprecated_text`: text } - fn test_method_object(foo: &Trait) { + fn test_method_object(foo: &dyn Trait) { foo.trait_deprecated(); //~ ERROR use of deprecated method `deprecation_lint::Trait::trait_deprecated` foo.trait_deprecated_text(); //~ ERROR use of deprecated method `deprecation_lint::Trait::trait_deprecated_text`: text } @@ -299,7 +299,7 @@ mod this_crate { ::trait_deprecated_text(&foo); //~ ERROR use of deprecated method `this_crate::Trait::trait_deprecated_text`: text } - fn test_method_object(foo: &Trait) { + fn test_method_object(foo: &dyn Trait) { foo.trait_deprecated(); //~ ERROR use of deprecated method `this_crate::Trait::trait_deprecated` foo.trait_deprecated_text(); //~ ERROR use of deprecated method `this_crate::Trait::trait_deprecated_text`: text } diff --git a/tests/ui/dyn-drop/dyn-drop.rs b/tests/ui/dyn-drop/dyn-drop.rs index e1668a3f188d5..f336949d2cb74 100644 --- a/tests/ui/dyn-drop/dyn-drop.rs +++ b/tests/ui/dyn-drop/dyn-drop.rs @@ -1,8 +1,7 @@ #![deny(dyn_drop)] -#![allow(bare_trait_objects)] fn foo(_: Box) {} //~ ERROR fn bar(_: &dyn Drop) {} //~ERROR -fn baz(_: *mut Drop) {} //~ ERROR +fn baz(_: *mut dyn Drop) {} //~ ERROR struct Foo { _x: Box //~ ERROR } diff --git a/tests/ui/dyn-drop/dyn-drop.stderr b/tests/ui/dyn-drop/dyn-drop.stderr index 1b1dbc4d12d4c..8210d8a4c48f9 100644 --- a/tests/ui/dyn-drop/dyn-drop.stderr +++ b/tests/ui/dyn-drop/dyn-drop.stderr @@ -1,5 +1,5 @@ error: types that do not implement `Drop` can still have drop glue, consider instead using `std::mem::needs_drop` to detect whether a type is trivially dropped - --> $DIR/dyn-drop.rs:3:19 + --> $DIR/dyn-drop.rs:2:19 | LL | fn foo(_: Box) {} | ^^^^ @@ -11,25 +11,25 @@ LL | #![deny(dyn_drop)] | ^^^^^^^^ error: types that do not implement `Drop` can still have drop glue, consider instead using `std::mem::needs_drop` to detect whether a type is trivially dropped - --> $DIR/dyn-drop.rs:4:16 + --> $DIR/dyn-drop.rs:3:16 | LL | fn bar(_: &dyn Drop) {} | ^^^^ error: types that do not implement `Drop` can still have drop glue, consider instead using `std::mem::needs_drop` to detect whether a type is trivially dropped - --> $DIR/dyn-drop.rs:5:16 + --> $DIR/dyn-drop.rs:4:20 | -LL | fn baz(_: *mut Drop) {} - | ^^^^ +LL | fn baz(_: *mut dyn Drop) {} + | ^^^^ error: types that do not implement `Drop` can still have drop glue, consider instead using `std::mem::needs_drop` to detect whether a type is trivially dropped - --> $DIR/dyn-drop.rs:7:15 + --> $DIR/dyn-drop.rs:6:15 | LL | _x: Box | ^^^^ error: types that do not implement `Drop` can still have drop glue, consider instead using `std::mem::needs_drop` to detect whether a type is trivially dropped - --> $DIR/dyn-drop.rs:14:16 + --> $DIR/dyn-drop.rs:13:16 | LL | type T = dyn Drop; | ^^^^ diff --git a/tests/ui/error-codes/E0657.rs b/tests/ui/error-codes/E0657.rs index 212c1d9e581a2..f046788153d58 100644 --- a/tests/ui/error-codes/E0657.rs +++ b/tests/ui/error-codes/E0657.rs @@ -7,7 +7,7 @@ impl<'a> Lt<'a> for () {} impl Id for T {} fn free_fn_capture_hrtb_in_impl_trait() - -> Box Id>> + -> Box Id>> //~^ ERROR `impl Trait` cannot capture higher-ranked lifetime from `dyn` type { Box::new(()) @@ -16,7 +16,7 @@ fn free_fn_capture_hrtb_in_impl_trait() struct Foo; impl Foo { fn impl_fn_capture_hrtb_in_impl_trait() - -> Box Id>> + -> Box Id>> //~^ ERROR `impl Trait` cannot capture higher-ranked lifetime from `dyn` type { Box::new(()) diff --git a/tests/ui/error-codes/E0657.stderr b/tests/ui/error-codes/E0657.stderr index c539007cdcf19..c9dfc9eb9069d 100644 --- a/tests/ui/error-codes/E0657.stderr +++ b/tests/ui/error-codes/E0657.stderr @@ -1,26 +1,26 @@ error[E0657]: `impl Trait` cannot capture higher-ranked lifetime from `dyn` type - --> $DIR/E0657.rs:10:31 + --> $DIR/E0657.rs:10:35 | -LL | -> Box Id>> - | ^^ +LL | -> Box Id>> + | ^^ | note: lifetime declared here - --> $DIR/E0657.rs:10:16 + --> $DIR/E0657.rs:10:20 | -LL | -> Box Id>> - | ^^ +LL | -> Box Id>> + | ^^ error[E0657]: `impl Trait` cannot capture higher-ranked lifetime from `dyn` type - --> $DIR/E0657.rs:19:35 + --> $DIR/E0657.rs:19:39 | -LL | -> Box Id>> - | ^^ +LL | -> Box Id>> + | ^^ | note: lifetime declared here - --> $DIR/E0657.rs:19:20 + --> $DIR/E0657.rs:19:24 | -LL | -> Box Id>> - | ^^ +LL | -> Box Id>> + | ^^ error: aborting due to 2 previous errors diff --git a/tests/ui/intrinsics/non-integer-atomic.rs b/tests/ui/intrinsics/non-integer-atomic.rs index dd129e5594510..5464bf747faed 100644 --- a/tests/ui/intrinsics/non-integer-atomic.rs +++ b/tests/ui/intrinsics/non-integer-atomic.rs @@ -8,7 +8,7 @@ use std::intrinsics::{self, AtomicOrdering}; #[derive(Copy, Clone)] pub struct Foo(i64); -pub type Bar = &'static Fn(); +pub type Bar = &'static dyn Fn(); pub type Quux = [u8; 100]; pub unsafe fn test_bool_load(p: &mut bool, v: bool) {