diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs index daead99b977c1..185dbaa21ac49 100644 --- a/compiler/rustc_middle/src/ty/print/pretty.rs +++ b/compiler/rustc_middle/src/ty/print/pretty.rs @@ -352,6 +352,17 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write { /// will always be printed.) fn should_print_optional_region(&self, region: ty::Region<'tcx>) -> bool; + /// Whether `pretty_print_type` should wrap a multi-bound `impl` / `dyn` + /// inner in parens at positions where the bare form would be parser- + /// ambiguous: after a prefix type constructor (`&`, `&mut`, `*const`, + /// `*mut`) where `&T + B` parses as `(&T) + B`, and in the function- + /// pointer / `Fn(..) -> T` return position where `-> T + B` parses as + /// the outer signature picking up an extra bound. Byte-stable printers + /// (mangling, etc.) override this to `false`. + fn add_disambiguating_parens(&self) -> bool { + true + } + fn reset_type_limit(&mut self) {} // Defaults (should not be overridden): @@ -723,7 +734,7 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write { } ty::RawPtr(ty, mutbl) => { write!(self, "*{} ", mutbl.ptr_str())?; - ty.print(self)?; + self.print_inner_with_disambiguating_parens(ty)?; } ty::Ref(r, ty, mutbl) => { write!(self, "&")?; @@ -731,7 +742,9 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write { r.print(self)?; write!(self, " ")?; } - ty::TypeAndMut { ty, mutbl }.print(self)?; + // `&mut (impl A + B)`, not `&(mut impl A + B)`: emit `mut ` before the parens. + write!(self, "{}", mutbl.prefix_str())?; + self.print_inner_with_disambiguating_parens(ty)?; } ty::Never => write!(self, "!")?, ty::Tuple(tys) => { @@ -806,16 +819,11 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write { } ty::Adt(def, args) => self.print_def_path(def.did(), args)?, ty::Dynamic(data, r) => { - let print_r = self.should_print_optional_region(r); - if print_r { - write!(self, "(")?; - } write!(self, "dyn ")?; data.print(self)?; - if print_r { + if self.should_print_optional_region(r) { write!(self, " + ")?; r.print(self)?; - write!(self, ")")?; } } ty::Foreign(def_id) => self.print_def_path(def_id, &[])?, @@ -1071,6 +1079,117 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write { Ok(()) } + /// Prints `ty` after a prefix type constructor, wrapping in parens iff + /// [`Self::inner_needs_disambiguating_parens`] returns `true`. + fn print_inner_with_disambiguating_parens(&mut self, ty: Ty<'tcx>) -> Result<(), PrintError> { + let need_paren = self.inner_needs_disambiguating_parens(ty); + if need_paren { + write!(self, "(")?; + } + ty.print(self)?; + if need_paren { + write!(self, ")")?; + } + Ok(()) + } + + /// Whether `ty`, sitting right after a prefix type constructor, would + /// print with a top-level `+`. Without the wrap, `&impl A + B` parses as + /// the ambiguous `(&impl A) + B`. + fn inner_needs_disambiguating_parens(&self, ty: Ty<'tcx>) -> bool { + if !self.add_disambiguating_parens() || self.should_print_verbose() { + return false; + } + match ty.kind() { + // RPITIT trait-side appears as `Projection`, not `Opaque`. + ty::Alias(ty::AliasTy { kind: ty::Opaque { def_id }, .. }) => { + self.opaque_has_multiple_bounds(*def_id) + } + ty::Alias(ty::AliasTy { kind: ty::Projection { def_id }, .. }) + if self.tcx().is_impl_trait_in_trait(*def_id) => + { + self.opaque_has_multiple_bounds(*def_id) + } + ty::Dynamic(predicates, region) => { + // Projections inline into the principal as ``; + // only principal/auto traits produce a top-level `+`. An + // explicit (printable) region adds one more `+`-joined part. + let trait_count = predicates + .iter() + .filter(|pred| { + matches!( + pred.skip_binder(), + ty::ExistentialPredicate::Trait(_) + | ty::ExistentialPredicate::AutoTrait(_) + ) + }) + .count(); + let region_count = usize::from(self.should_print_optional_region(*region)); + trait_count + region_count > 1 + } + _ => false, + } + } + + /// Whether `Alias(Opaque)` would print with more than one top-level + /// `+`-joined component. Must stay in sync with + /// `pretty_print_opaque_impl_type`'s sized-bound handling. `?Sized` and + /// the synthetic `Sized` / `?Sized` / `MetaSized` / `PointeeSized` suffix + /// each contribute one top-level joinable component. Regressions land in + /// `tests/ui/impl-trait/in-trait/refine-rustfix-parens.rs`. + fn opaque_has_multiple_bounds(&self, def_id: DefId) -> bool { + let tcx = self.tcx(); + let bounds = tcx.explicit_item_bounds(def_id); + + // Mirror `pretty_print_opaque_impl_type`'s sized-bound handling: + // positive `Sized` and `MetaSized` are absorbed into the synthetic + // suffix below; negative `Sized` (`?Sized`) falls through and is + // printed inline. We only ever look at clause *kinds* here, so the + // identity-instantiated bounds carry all the information we need. + let mut trait_emits = 0usize; + let mut lifetimes_count = 0usize; + let mut has_sized_bound = false; + let mut has_negative_sized_bound = false; + let mut has_meta_sized_bound = false; + + for (predicate, _) in bounds.iter_identity_copied().map(Unnormalized::skip_norm_wip) { + match predicate.kind().skip_binder() { + ty::ClauseKind::Trait(pred) => match tcx.as_lang_item(pred.def_id()) { + Some(LangItem::Sized) => match pred.polarity { + ty::PredicatePolarity::Positive => { + has_sized_bound = true; + } + ty::PredicatePolarity::Negative => { + has_negative_sized_bound = true; + trait_emits += 1; + } + }, + Some(LangItem::MetaSized) => { + has_meta_sized_bound = true; + } + Some(LangItem::PointeeSized) => {} + _ => trait_emits += 1, + }, + ty::ClauseKind::TypeOutlives(_) => lifetimes_count += 1, + _ => {} + } + } + + // The synthetic suffix in `pretty_print_opaque_impl_type` emits at most + // one extra bound (`Sized` / `?Sized` / `MetaSized` / `PointeeSized`). + let using_sized_hierarchy = tcx.features().sized_hierarchy(); + let add_sized = has_sized_bound && (trait_emits == 0 || has_negative_sized_bound); + let add_maybe_sized = + has_meta_sized_bound && !has_negative_sized_bound && !using_sized_hierarchy; + let has_pointee_sized = + !has_sized_bound && !has_meta_sized_bound && !has_negative_sized_bound; + let synthetic = add_sized + || add_maybe_sized + || (using_sized_hierarchy && (has_meta_sized_bound || has_pointee_sized)); + + trait_emits + lifetimes_count + usize::from(synthetic) > 1 + } + fn pretty_print_opaque_impl_type( &mut self, def_id: DefId, @@ -1544,7 +1663,10 @@ pub trait PrettyPrinter<'tcx>: Printer<'tcx> + fmt::Write { write!(self, ")")?; if !output.is_unit() { write!(self, " -> ")?; - output.print(self)?; + // `Fn(..) -> X + B` parses as if `+ B` extended the outer signature, + // so wrap if `X` would print with `+`-joined bounds. Same machinery + // as the `&T`, `*const T`, `*mut T` prefix arms. + self.print_inner_with_disambiguating_parens(output)?; } Ok(()) diff --git a/compiler/rustc_symbol_mangling/src/legacy.rs b/compiler/rustc_symbol_mangling/src/legacy.rs index c13300a735c3c..69d2596c76a98 100644 --- a/compiler/rustc_symbol_mangling/src/legacy.rs +++ b/compiler/rustc_symbol_mangling/src/legacy.rs @@ -477,6 +477,12 @@ impl<'tcx> PrettyPrinter<'tcx> for LegacySymbolMangler<'tcx> { false } + // Mangled symbols are ABI-stable; don't pick up the default printer's + // parser-disambiguating parens. + fn add_disambiguating_parens(&self) -> bool { + false + } + // Identical to `PrettyPrinter::comma_sep` except there is no space after each comma. fn comma_sep(&mut self, mut elems: impl Iterator) -> Result<(), PrintError> where diff --git a/src/tools/clippy/tests/ui/crashes/ice-3969.stderr b/src/tools/clippy/tests/ui/crashes/ice-3969.stderr index b820ecf7e3326..bb4449b8bf92c 100644 --- a/src/tools/clippy/tests/ui/crashes/ice-3969.stderr +++ b/src/tools/clippy/tests/ui/crashes/ice-3969.stderr @@ -7,7 +7,7 @@ LL | str: Sized; = note: `-D trivial-bounds` implied by `-D warnings` = help: to override `-D warnings` add `#[allow(trivial_bounds)]` -error: trait bound for<'a> Dst<(dyn A + 'a)>: std::marker::Sized does not depend on any type or lifetime parameters +error: trait bound for<'a> Dst: std::marker::Sized does not depend on any type or lifetime parameters --> tests/ui/crashes/ice-3969.rs:25:30 | LL | for<'a> Dst: Sized, diff --git a/src/tools/miri/tests/fail/dyn-upcast-nop-wrong-trait.stderr b/src/tools/miri/tests/fail/dyn-upcast-nop-wrong-trait.stderr index 86a695f62fc0f..80cb5d5b99713 100644 --- a/src/tools/miri/tests/fail/dyn-upcast-nop-wrong-trait.stderr +++ b/src/tools/miri/tests/fail/dyn-upcast-nop-wrong-trait.stderr @@ -1,4 +1,4 @@ -error: Undefined Behavior: constructing invalid value of type *const dyn std::fmt::Debug + std::marker::Send + std::marker::Sync: wrong trait in wide pointer vtable: expected `std::fmt::Debug + std::marker::Send + std::marker::Sync`, but encountered `std::fmt::Display` +error: Undefined Behavior: constructing invalid value of type *const (dyn std::fmt::Debug + std::marker::Send + std::marker::Sync): wrong trait in wide pointer vtable: expected `std::fmt::Debug + std::marker::Send + std::marker::Sync`, but encountered `std::fmt::Display` --> tests/fail/dyn-upcast-nop-wrong-trait.rs:LL:CC | LL | let ptr: *const (dyn fmt::Debug + Send + Sync) = unsafe { std::mem::transmute(ptr) }; diff --git a/src/tools/miri/tests/fail/tail_calls/cc-mismatch.stderr b/src/tools/miri/tests/fail/tail_calls/cc-mismatch.stderr index a9440caa3e3b1..07d73a91d541c 100644 --- a/src/tools/miri/tests/fail/tail_calls/cc-mismatch.stderr +++ b/src/tools/miri/tests/fail/tail_calls/cc-mismatch.stderr @@ -13,13 +13,13 @@ LL | extern "rust-call" fn call_once(self, args: Args) -> Self::Output; at RUSTLIB/std/src/sys/backtrace.rs:LL:CC 2: std::rt::lang_start::<()>::{closure#0} at RUSTLIB/std/src/rt.rs:LL:CC - 3: std::ops::function::impls:: for &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>::call_once + 3: std::ops::function::impls:: for &(dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe)>::call_once at RUSTLIB/core/src/ops/function.rs:LL:CC - 4: std::panicking::catch_unwind::do_call::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32> + 4: std::panicking::catch_unwind::do_call::<&(dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe), i32> at RUSTLIB/std/src/panicking.rs:LL:CC - 5: std::panicking::catch_unwind:: i32 + std::marker::Sync + std::panic::RefUnwindSafe> + 5: std::panicking::catch_unwind:: i32 + std::marker::Sync + std::panic::RefUnwindSafe)> at RUSTLIB/std/src/panicking.rs:LL:CC - 6: std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32> + 6: std::panic::catch_unwind::<&(dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe), i32> at RUSTLIB/std/src/panic.rs:LL:CC 7: std::rt::lang_start_internal::{closure#0} at RUSTLIB/std/src/rt.rs:LL:CC diff --git a/src/tools/miri/tests/pass/backtrace/backtrace-global-alloc.stderr b/src/tools/miri/tests/pass/backtrace/backtrace-global-alloc.stderr index bf443274a958f..2ab6e988cfae5 100644 --- a/src/tools/miri/tests/pass/backtrace/backtrace-global-alloc.stderr +++ b/src/tools/miri/tests/pass/backtrace/backtrace-global-alloc.stderr @@ -6,13 +6,13 @@ at RUSTLIB/std/src/sys/backtrace.rs:LL:CC 3: std::rt::lang_start::<()>::{closure#0} at RUSTLIB/std/src/rt.rs:LL:CC - 4: std::ops::function::impls:: for &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>::call_once + 4: std::ops::function::impls:: for &(dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe)>::call_once at RUSTLIB/core/src/ops/function.rs:LL:CC - 5: std::panicking::catch_unwind::do_call::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32> + 5: std::panicking::catch_unwind::do_call::<&(dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe), i32> at RUSTLIB/std/src/panicking.rs:LL:CC - 6: std::panicking::catch_unwind:: i32 + std::marker::Sync + std::panic::RefUnwindSafe> + 6: std::panicking::catch_unwind:: i32 + std::marker::Sync + std::panic::RefUnwindSafe)> at RUSTLIB/std/src/panicking.rs:LL:CC - 7: std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32> + 7: std::panic::catch_unwind::<&(dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe), i32> at RUSTLIB/std/src/panic.rs:LL:CC 8: std::rt::lang_start_internal::{closure#0} at RUSTLIB/std/src/rt.rs:LL:CC diff --git a/src/tools/miri/tests/pass/backtrace/backtrace-std.stderr b/src/tools/miri/tests/pass/backtrace/backtrace-std.stderr index ee0c65fa6eb67..e4c6910613726 100644 --- a/src/tools/miri/tests/pass/backtrace/backtrace-std.stderr +++ b/src/tools/miri/tests/pass/backtrace/backtrace-std.stderr @@ -14,13 +14,13 @@ at RUSTLIB/std/src/sys/backtrace.rs:LL:CC 7: std::rt::lang_start::<()>::{closure#0} at RUSTLIB/std/src/rt.rs:LL:CC - 8: std::ops::function::impls:: for &dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe>::call_once + 8: std::ops::function::impls:: for &(dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe)>::call_once at RUSTLIB/core/src/ops/function.rs:LL:CC - 9: std::panicking::catch_unwind::do_call::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32> + 9: std::panicking::catch_unwind::do_call::<&(dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe), i32> at RUSTLIB/std/src/panicking.rs:LL:CC - 10: std::panicking::catch_unwind:: i32 + std::marker::Sync + std::panic::RefUnwindSafe> + 10: std::panicking::catch_unwind:: i32 + std::marker::Sync + std::panic::RefUnwindSafe)> at RUSTLIB/std/src/panicking.rs:LL:CC - 11: std::panic::catch_unwind::<&dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe, i32> + 11: std::panic::catch_unwind::<&(dyn std::ops::Fn() -> i32 + std::marker::Sync + std::panic::RefUnwindSafe), i32> at RUSTLIB/std/src/panic.rs:LL:CC 12: std::rt::lang_start_internal::{closure#0} at RUSTLIB/std/src/rt.rs:LL:CC diff --git a/tests/ui/abi/invalid-self-parameter-type-56806.stderr b/tests/ui/abi/invalid-self-parameter-type-56806.stderr index ac249b8f10880..6f3b5bca9b4d4 100644 --- a/tests/ui/abi/invalid-self-parameter-type-56806.stderr +++ b/tests/ui/abi/invalid-self-parameter-type-56806.stderr @@ -1,4 +1,4 @@ -error[E0307]: invalid `self` parameter type: `Box<(dyn Trait + 'static)>` +error[E0307]: invalid `self` parameter type: `Box` --> $DIR/invalid-self-parameter-type-56806.rs:3:34 | LL | fn dyn_instead_of_self(self: Box); diff --git a/tests/ui/argument-suggestions/display-is-suggestable.stderr b/tests/ui/argument-suggestions/display-is-suggestable.stderr index 921cc12333870..807b401b7bc50 100644 --- a/tests/ui/argument-suggestions/display-is-suggestable.stderr +++ b/tests/ui/argument-suggestions/display-is-suggestable.stderr @@ -2,7 +2,7 @@ error[E0061]: this function takes 1 argument but 0 arguments were supplied --> $DIR/display-is-suggestable.rs:6:5 | LL | foo(); - | ^^^-- argument #1 of type `&dyn std::fmt::Display + Send` is missing + | ^^^-- argument #1 of type `&(dyn std::fmt::Display + Send)` is missing | note: function defined here --> $DIR/display-is-suggestable.rs:3:4 @@ -11,8 +11,8 @@ LL | fn foo(x: &(dyn Display + Send)) {} | ^^^ ------------------------ help: provide the argument | -LL | foo(/* &dyn std::fmt::Display + Send */); - | +++++++++++++++++++++++++++++++++++ +LL | foo(/* &(dyn std::fmt::Display + Send) */); + | +++++++++++++++++++++++++++++++++++++ error: aborting due to 1 previous error diff --git a/tests/ui/associated-types/issue-43924.stderr b/tests/ui/associated-types/issue-43924.stderr index 5bf8ee730e618..ddd2fad4f8796 100644 --- a/tests/ui/associated-types/issue-43924.stderr +++ b/tests/ui/associated-types/issue-43924.stderr @@ -1,8 +1,8 @@ -error[E0277]: the trait bound `(dyn ToString + 'static): Default` is not satisfied +error[E0277]: the trait bound `dyn ToString + 'static: Default` is not satisfied --> $DIR/issue-43924.rs:8:45 | LL | type Out: Default + ToString + ?Sized = dyn ToString; - | ^^^^^^^^^^^^ the trait `Default` is not implemented for `(dyn ToString + 'static)` + | ^^^^^^^^^^^^ the trait `Default` is not implemented for `dyn ToString + 'static` | note: required by a bound in `Foo::Out` --> $DIR/issue-43924.rs:8:15 @@ -10,11 +10,11 @@ note: required by a bound in `Foo::Out` LL | type Out: Default + ToString + ?Sized = dyn ToString; | ^^^^^^^ required by this bound in `Foo::Out` -error[E0599]: no associated function or constant named `default` found for trait object `(dyn ToString + 'static)` in the current scope +error[E0599]: no associated function or constant named `default` found for trait object `dyn ToString + 'static` in the current scope --> $DIR/issue-43924.rs:15:39 | LL | assert_eq!(<() as Foo>::Out::default().to_string(), "false"); - | ^^^^^^^ associated function or constant not found in `(dyn ToString + 'static)` + | ^^^^^^^ associated function or constant not found in `dyn ToString + 'static` error: aborting due to 2 previous errors diff --git a/tests/ui/associated-types/issue-59324.stderr b/tests/ui/associated-types/issue-59324.stderr index 3e2b0f4188973..af28b61b6e3d1 100644 --- a/tests/ui/associated-types/issue-59324.stderr +++ b/tests/ui/associated-types/issue-59324.stderr @@ -83,13 +83,13 @@ LL | pub trait Foo: NotFoo { | ^^^^^^^^^^^^^^^^^^^^^ = note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no` -error[E0277]: the size for values of type `(dyn ThriftService<(), AssocType = _> + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn ThriftService<(), AssocType = _> + 'static` cannot be known at compilation time --> $DIR/issue-59324.rs:24:29 | LL | fn with_factory(factory: dyn ThriftService<()>) {} | ^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn ThriftService<(), AssocType = _> + 'static)` + = help: the trait `Sized` is not implemented for `dyn ThriftService<(), AssocType = _> + 'static` = help: unsized fn params are gated as an unstable feature help: you can use `impl Trait` as the argument type | diff --git a/tests/ui/associated-types/projection-dyn-associated-type.rs b/tests/ui/associated-types/projection-dyn-associated-type.rs index 32328f8793c71..30c6dae2b574d 100644 --- a/tests/ui/associated-types/projection-dyn-associated-type.rs +++ b/tests/ui/associated-types/projection-dyn-associated-type.rs @@ -21,8 +21,8 @@ impl Mirror for A { pub fn foo<'a>( x: &'a ::Assoc ) -> &'a ::Assoc { - //~^ ERROR the trait bound `(dyn B + 'static): Mirror` is not satisfied [E0277] - //~| ERROR the trait bound `(dyn B + 'static): Mirror` is not satisfied [E0277] + //~^ ERROR the trait bound `dyn B + 'static: Mirror` is not satisfied [E0277] + //~| ERROR the trait bound `dyn B + 'static: Mirror` is not satisfied [E0277] static } //~ ERROR expected identifier, found `}` diff --git a/tests/ui/associated-types/projection-dyn-associated-type.stderr b/tests/ui/associated-types/projection-dyn-associated-type.stderr index 58eb8cff163db..2ab6b889459d7 100644 --- a/tests/ui/associated-types/projection-dyn-associated-type.stderr +++ b/tests/ui/associated-types/projection-dyn-associated-type.stderr @@ -29,11 +29,11 @@ error[E0207]: the type parameter `T` is not constrained by the impl trait, self LL | impl Mirror for A { | ^ unconstrained type parameter -error[E0277]: the trait bound `(dyn B + 'static): Mirror` is not satisfied +error[E0277]: the trait bound `dyn B + 'static: Mirror` is not satisfied --> $DIR/projection-dyn-associated-type.rs:23:6 | LL | ) -> &'a ::Assoc { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Mirror` is not implemented for `(dyn B + 'static)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Mirror` is not implemented for `dyn B + 'static` | help: the trait `Mirror` is implemented for `dyn A` --> $DIR/projection-dyn-associated-type.rs:14:1 @@ -41,11 +41,11 @@ help: the trait `Mirror` is implemented for `dyn A` LL | impl Mirror for A { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0277]: the trait bound `(dyn B + 'static): Mirror` is not satisfied +error[E0277]: the trait bound `dyn B + 'static: Mirror` is not satisfied --> $DIR/projection-dyn-associated-type.rs:23:6 | LL | ) -> &'a ::Assoc { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Mirror` is not implemented for `(dyn B + 'static)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Mirror` is not implemented for `dyn B + 'static` | help: the trait `Mirror` is implemented for `dyn A` --> $DIR/projection-dyn-associated-type.rs:14:1 diff --git a/tests/ui/async-await/async-closures/fn-exception-target-features.stderr b/tests/ui/async-await/async-closures/fn-exception-target-features.stderr index f0846bfdb1250..95ec1f756a05a 100644 --- a/tests/ui/async-await/async-closures/fn-exception-target-features.stderr +++ b/tests/ui/async-await/async-closures/fn-exception-target-features.stderr @@ -1,4 +1,4 @@ -error[E0277]: the trait bound `#[target_features] fn() -> Pin + 'static)>> {target_feature}: AsyncFn()` is not satisfied +error[E0277]: the trait bound `#[target_features] fn() -> Pin + 'static>> {target_feature}: AsyncFn()` is not satisfied --> $DIR/fn-exception-target-features.rs:15:10 | LL | test(target_feature); @@ -6,7 +6,7 @@ LL | test(target_feature); | | | required by a bound introduced by this call | - = help: the trait `AsyncFn()` is not implemented for fn item `#[target_features] fn() -> Pin + 'static)>> {target_feature}` + = help: the trait `AsyncFn()` is not implemented for fn item `#[target_features] fn() -> Pin + 'static>> {target_feature}` note: required by a bound in `test` --> $DIR/fn-exception-target-features.rs:12:17 | diff --git a/tests/ui/async-await/async-closures/fn-exception.stderr b/tests/ui/async-await/async-closures/fn-exception.stderr index aa74ed234df00..488adf5f921c8 100644 --- a/tests/ui/async-await/async-closures/fn-exception.stderr +++ b/tests/ui/async-await/async-closures/fn-exception.stderr @@ -1,8 +1,8 @@ -error[E0277]: the trait bound `unsafe fn() -> Pin + 'static)>> {unsafety}: AsyncFn()` is not satisfied +error[E0277]: the trait bound `unsafe fn() -> Pin + 'static>> {unsafety}: AsyncFn()` is not satisfied --> $DIR/fn-exception.rs:17:10 | LL | test(unsafety); - | ---- ^^^^^^^^ the trait `AsyncFn()` is not implemented for fn item `unsafe fn() -> Pin + 'static)>> {unsafety}` + | ---- ^^^^^^^^ the trait `AsyncFn()` is not implemented for fn item `unsafe fn() -> Pin + 'static>> {unsafety}` | | | required by a bound introduced by this call | @@ -12,11 +12,11 @@ note: required by a bound in `test` LL | fn test(f: impl AsyncFn()) {} | ^^^^^^^^^ required by this bound in `test` -error[E0277]: the trait bound `extern "C" fn() -> Pin + 'static)>> {abi}: AsyncFn()` is not satisfied +error[E0277]: the trait bound `extern "C" fn() -> Pin + 'static>> {abi}: AsyncFn()` is not satisfied --> $DIR/fn-exception.rs:18:10 | LL | test(abi); - | ---- ^^^ the trait `AsyncFn()` is not implemented for fn item `extern "C" fn() -> Pin + 'static)>> {abi}` + | ---- ^^^ the trait `AsyncFn()` is not implemented for fn item `extern "C" fn() -> Pin + 'static>> {abi}` | | | required by a bound introduced by this call | diff --git a/tests/ui/async-await/higher-ranked-auto-trait-12.no_assumptions.stderr b/tests/ui/async-await/higher-ranked-auto-trait-12.no_assumptions.stderr index 63e71cbc40c75..de6824e0d5a36 100644 --- a/tests/ui/async-await/higher-ranked-auto-trait-12.no_assumptions.stderr +++ b/tests/ui/async-await/higher-ranked-auto-trait-12.no_assumptions.stderr @@ -11,8 +11,8 @@ LL | | yield_now().await; LL | | }); | |______^ implementation of `Robot` is not general enough | - = note: `Box<(dyn Robot + Send + '0)>` must implement `Robot`, for any lifetime `'0`... - = note: ...but `Robot` is actually implemented for the type `Box<(dyn Robot + Send + 'static)>` + = note: `Box + Send + '0>` must implement `Robot`, for any lifetime `'0`... + = note: ...but `Robot` is actually implemented for the type `Box + Send + 'static>` error: aborting due to 1 previous error diff --git a/tests/ui/async-await/higher-ranked-auto-trait-9.no_assumptions.stderr b/tests/ui/async-await/higher-ranked-auto-trait-9.no_assumptions.stderr index 809cbcf0cad13..0f21e248e3048 100644 --- a/tests/ui/async-await/higher-ranked-auto-trait-9.no_assumptions.stderr +++ b/tests/ui/async-await/higher-ranked-auto-trait-9.no_assumptions.stderr @@ -4,8 +4,8 @@ error: implementation of `Debug` is not general enough LL | let fut: &(dyn Future + Send) = &fut as _; | ^^^^^^^^^ implementation of `Debug` is not general enough | - = note: `(dyn Any + '0)` must implement `Debug`, for any lifetime `'0`... - = note: ...but `Debug` is actually implemented for the type `(dyn Any + 'static)` + = note: `dyn Any + '0` must implement `Debug`, for any lifetime `'0`... + = note: ...but `Debug` is actually implemented for the type `dyn Any + 'static` error: aborting due to 1 previous error diff --git a/tests/ui/borrowck/unconstrained-closure-lifetime-generic.stderr b/tests/ui/borrowck/unconstrained-closure-lifetime-generic.stderr index df86ce79f09c7..f85fd0ea00d45 100644 --- a/tests/ui/borrowck/unconstrained-closure-lifetime-generic.stderr +++ b/tests/ui/borrowck/unconstrained-closure-lifetime-generic.stderr @@ -111,7 +111,7 @@ LL | self.bar = Box::new(|baz| Box::new(f(baz))); LL | } | - `f` dropped here while still borrowed | - = note: due to object lifetime defaults, `Box Fn(&'a usize) -> Box<(dyn Any + 'a)>>` actually means `Box<(dyn for<'a> Fn(&'a usize) -> Box<(dyn Any + 'a)> + 'static)>` + = note: due to object lifetime defaults, `Box Fn(&'a usize) -> Box>` actually means `Box Fn(&'a usize) -> Box + 'static>` error: aborting due to 8 previous errors diff --git a/tests/ui/cast/casts-differing-anon.stderr b/tests/ui/cast/casts-differing-anon.stderr index fc4882d2d2774..573df25fb7dee 100644 --- a/tests/ui/cast/casts-differing-anon.stderr +++ b/tests/ui/cast/casts-differing-anon.stderr @@ -1,4 +1,4 @@ -error[E0606]: casting `*mut impl Debug + ?Sized` as `*mut impl Debug + ?Sized` is invalid +error[E0606]: casting `*mut (impl Debug + ?Sized)` as `*mut (impl Debug + ?Sized)` is invalid --> $DIR/casts-differing-anon.rs:21:13 | LL | b_raw = f_raw as *mut _; diff --git a/tests/ui/cast/ptr-to-ptr-indirect-different-regions.stderr b/tests/ui/cast/ptr-to-ptr-indirect-different-regions.stderr index 43609fa570cbb..48bddcc607707 100644 --- a/tests/ui/cast/ptr-to-ptr-indirect-different-regions.stderr +++ b/tests/ui/cast/ptr-to-ptr-indirect-different-regions.stderr @@ -24,7 +24,7 @@ LL + fn bar<'a>(a: *mut MyWrap<(dyn Trait + 'a)>) -> *mut MyWrap<(dyn Trait + 'a help: alternatively, add an explicit `'static` bound to this reference | LL - fn bar<'a>(a: *mut MyWrap<(dyn Trait + 'a)>) -> *mut MyWrap<(dyn Trait + 'static)> { -LL + fn bar<'a>(a: *mut MyWrap<(dyn Trait + 'static)>) -> *mut MyWrap<(dyn Trait + 'static)> { +LL + fn bar<'a>(a: *mut MyWrap) -> *mut MyWrap<(dyn Trait + 'static)> { | error: aborting due to 1 previous error diff --git a/tests/ui/cast/ptr-to-ptr-principalless.rs b/tests/ui/cast/ptr-to-ptr-principalless.rs index 0b1032d2669d7..7231fcd831762 100644 --- a/tests/ui/cast/ptr-to-ptr-principalless.rs +++ b/tests/ui/cast/ptr-to-ptr-principalless.rs @@ -61,14 +61,14 @@ fn unprincipled3_static<'a>(x: *mut (dyn Trait + Send + 'a)) -> *mut (dyn Send + fn unprincipled_wrap3<'a, 'b>(x: *mut (dyn Trait + Send + 'a)) -> *mut Wrapper { x as _ - //~^ ERROR: casting `*mut (dyn Trait + Send + 'a)` as `*mut Wrapper<(dyn Send + 'b)>` is invalid + //~^ ERROR: casting `*mut (dyn Trait + Send + 'a)` as `*mut Wrapper` is invalid } fn unprincipled_wrap3_static<'a>( x: *mut (dyn Trait + Send + 'a) ) -> *mut Wrapper { x as _ - //~^ ERROR: casting `*mut (dyn Trait + Send + 'a)` as `*mut Wrapper<(dyn Send + 'static)>` is invalid + //~^ ERROR: casting `*mut (dyn Trait + Send + 'a)` as `*mut Wrapper` is invalid } fn main() {} diff --git a/tests/ui/cast/ptr-to-ptr-principalless.stderr b/tests/ui/cast/ptr-to-ptr-principalless.stderr index 78f949232a1ca..ec00ed11e17ed 100644 --- a/tests/ui/cast/ptr-to-ptr-principalless.stderr +++ b/tests/ui/cast/ptr-to-ptr-principalless.stderr @@ -1,4 +1,4 @@ -error[E0606]: casting `*mut (dyn Trait + Send + 'a)` as `*mut Wrapper<(dyn Send + 'b)>` is invalid +error[E0606]: casting `*mut (dyn Trait + Send + 'a)` as `*mut Wrapper` is invalid --> $DIR/ptr-to-ptr-principalless.rs:63:5 | LL | x as _ @@ -6,7 +6,7 @@ LL | x as _ | = note: the trait objects may have different vtables -error[E0606]: casting `*mut (dyn Trait + Send + 'a)` as `*mut Wrapper<(dyn Send + 'static)>` is invalid +error[E0606]: casting `*mut (dyn Trait + Send + 'a)` as `*mut Wrapper` is invalid --> $DIR/ptr-to-ptr-principalless.rs:70:5 | LL | x as _ diff --git a/tests/ui/closure_context/issue-26046-fn-mut.stderr b/tests/ui/closure_context/issue-26046-fn-mut.stderr index 0b58180bcca77..d48cc03eb6334 100644 --- a/tests/ui/closure_context/issue-26046-fn-mut.stderr +++ b/tests/ui/closure_context/issue-26046-fn-mut.stderr @@ -9,7 +9,7 @@ LL | num += 1; LL | Box::new(closure) | ----------------- the requirement to implement `Fn` derives from here | - = note: required for the cast from `Box<{closure@$DIR/issue-26046-fn-mut.rs:4:19: 4:21}>` to `Box<(dyn Fn() + 'static)>` + = note: required for the cast from `Box<{closure@$DIR/issue-26046-fn-mut.rs:4:19: 4:21}>` to `Box` error: aborting due to 1 previous error diff --git a/tests/ui/closure_context/issue-26046-fn-once.stderr b/tests/ui/closure_context/issue-26046-fn-once.stderr index 66fb1856cbbbf..9de6700d1db82 100644 --- a/tests/ui/closure_context/issue-26046-fn-once.stderr +++ b/tests/ui/closure_context/issue-26046-fn-once.stderr @@ -9,7 +9,7 @@ LL | vec LL | Box::new(closure) | ----------------- the requirement to implement `Fn` derives from here | - = note: required for the cast from `Box<{closure@$DIR/issue-26046-fn-once.rs:4:19: 4:26}>` to `Box<(dyn Fn() -> Vec + 'static)>` + = note: required for the cast from `Box<{closure@$DIR/issue-26046-fn-once.rs:4:19: 4:26}>` to `Box Vec + 'static>` error: aborting due to 1 previous error diff --git a/tests/ui/closures/capture-unsized-by-move.rs b/tests/ui/closures/capture-unsized-by-move.rs index 72f6a5501e83c..933f5a31f93b3 100644 --- a/tests/ui/closures/capture-unsized-by-move.rs +++ b/tests/ui/closures/capture-unsized-by-move.rs @@ -5,6 +5,6 @@ pub fn f(k: dyn std::fmt::Display) { let k2 = move || { k.to_string(); - //~^ ERROR the size for values of type `(dyn std::fmt::Display + 'static)` cannot be known at compilation time + //~^ ERROR the size for values of type `dyn std::fmt::Display + 'static` cannot be known at compilation time }; } diff --git a/tests/ui/closures/capture-unsized-by-move.stderr b/tests/ui/closures/capture-unsized-by-move.stderr index 686bbab883951..c59f3b34efb2d 100644 --- a/tests/ui/closures/capture-unsized-by-move.stderr +++ b/tests/ui/closures/capture-unsized-by-move.stderr @@ -1,4 +1,4 @@ -error[E0277]: the size for values of type `(dyn std::fmt::Display + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn std::fmt::Display + 'static` cannot be known at compilation time --> $DIR/capture-unsized-by-move.rs:7:9 | LL | let k2 = move || { @@ -6,7 +6,7 @@ LL | let k2 = move || { LL | k.to_string(); | ^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn std::fmt::Display + 'static)` + = help: the trait `Sized` is not implemented for `dyn std::fmt::Display + 'static` = note: all values captured by value by a closure must have a statically known size error: aborting due to 1 previous error diff --git a/tests/ui/closures/closure-arg-borrow-ice-issue-152331.stderr b/tests/ui/closures/closure-arg-borrow-ice-issue-152331.stderr index 7cfc9f0576ecc..442225e06ffd5 100644 --- a/tests/ui/closures/closure-arg-borrow-ice-issue-152331.stderr +++ b/tests/ui/closures/closure-arg-borrow-ice-issue-152331.stderr @@ -7,7 +7,7 @@ LL | h2(|_: (), _: (), _: (), x: &_| {}); | | found signature defined here | expected due to this | - = note: expected closure signature `for<'a, 't0> fn(&'a (), Box<(dyn for<'a> Fn(&'a ()) + 'static)>, &'t0 (), for<'a, 'b> fn(&'a (), &'b ())) -> _` + = note: expected closure signature `for<'a, 't0> fn(&'a (), Box Fn(&'a ()) + 'static>, &'t0 (), for<'a, 'b> fn(&'a (), &'b ())) -> _` found closure signature `fn((), (), (), &_) -> _` note: required by a bound in `h2` --> $DIR/closure-arg-borrow-ice-issue-152331.rs:8:8 diff --git a/tests/ui/closures/issue-111932.stderr b/tests/ui/closures/issue-111932.stderr index 2d10a2657aa00..b926c9995edfd 100644 --- a/tests/ui/closures/issue-111932.stderr +++ b/tests/ui/closures/issue-111932.stderr @@ -1,10 +1,10 @@ -error[E0277]: the size for values of type `(dyn Foo + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Foo + 'static` cannot be known at compilation time --> $DIR/issue-111932.rs:4:20 | LL | foos.for_each(|foo| { | ^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Foo + 'static)` + = help: the trait `Sized` is not implemented for `dyn Foo + 'static` = note: all function arguments must have a statically known size = help: unsized fn params are gated as an unstable feature diff --git a/tests/ui/coercion/coerce-issue-49593-box-never.e2021.stderr b/tests/ui/coercion/coerce-issue-49593-box-never.e2021.stderr index 214c37febc06b..85a7cae1af8a6 100644 --- a/tests/ui/coercion/coerce-issue-49593-box-never.e2021.stderr +++ b/tests/ui/coercion/coerce-issue-49593-box-never.e2021.stderr @@ -4,7 +4,7 @@ error[E0277]: the trait bound `(): std::error::Error` is not satisfied LL | Box::new(x) | ^^^^^^^^^^^ the trait `std::error::Error` is not implemented for `()` | - = note: required for the cast from `Box<()>` to `Box<(dyn std::error::Error + 'static)>` + = note: required for the cast from `Box<()>` to `Box` error[E0277]: the trait bound `(): std::error::Error` is not satisfied --> $DIR/coerce-issue-49593-box-never.rs:33:5 diff --git a/tests/ui/coercion/pin-dyn-dispatch-sound.stderr b/tests/ui/coercion/pin-dyn-dispatch-sound.stderr index 45860bfcfc760..019d139e14fdc 100644 --- a/tests/ui/coercion/pin-dyn-dispatch-sound.stderr +++ b/tests/ui/coercion/pin-dyn-dispatch-sound.stderr @@ -1,4 +1,4 @@ -error[E0321]: cross-crate traits with a default impl, like `Unpin`, can only be implemented for a struct/enum type, not `(dyn MyUnpinTrait + 'static)` +error[E0321]: cross-crate traits with a default impl, like `Unpin`, can only be implemented for a struct/enum type, not `dyn MyUnpinTrait + 'static` --> $DIR/pin-dyn-dispatch-sound.rs:12:1 | LL | impl Unpin for dyn MyUnpinTrait {} diff --git a/tests/ui/coherence/coherence-impl-trait-for-marker-trait-negative.stderr b/tests/ui/coherence/coherence-impl-trait-for-marker-trait-negative.stderr index bc81dd6f286dd..98ca99b95e94e 100644 --- a/tests/ui/coherence/coherence-impl-trait-for-marker-trait-negative.stderr +++ b/tests/ui/coherence/coherence-impl-trait-for-marker-trait-negative.stderr @@ -1,4 +1,4 @@ -error[E0321]: traits with a default impl, like `Marker1`, cannot be implemented for trait object `(dyn Object + Marker2 + 'static)` +error[E0321]: traits with a default impl, like `Marker1`, cannot be implemented for trait object `dyn Object + Marker2 + 'static` --> $DIR/coherence-impl-trait-for-marker-trait-negative.rs:15:1 | LL | impl !Marker1 for dyn Object + Marker2 {} @@ -6,13 +6,13 @@ LL | impl !Marker1 for dyn Object + Marker2 {} | = note: a trait object implements `Marker1` if and only if `Marker1` is one of the trait object's trait bounds -error[E0371]: the object type `(dyn Object + Marker2 + 'static)` automatically implements the trait `Marker1` +error[E0371]: the object type `dyn Object + Marker2 + 'static` automatically implements the trait `Marker1` --> $DIR/coherence-impl-trait-for-marker-trait-negative.rs:15:1 | LL | impl !Marker1 for dyn Object + Marker2 {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Object + Marker2 + 'static)` automatically implements trait `Marker1` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `dyn Object + Marker2 + 'static` automatically implements trait `Marker1` -error[E0321]: traits with a default impl, like `Marker2`, cannot be implemented for trait object `(dyn Object + Marker2 + 'static)` +error[E0321]: traits with a default impl, like `Marker2`, cannot be implemented for trait object `dyn Object + Marker2 + 'static` --> $DIR/coherence-impl-trait-for-marker-trait-negative.rs:18:1 | LL | impl !Marker2 for dyn Object + Marker2 {} @@ -20,13 +20,13 @@ LL | impl !Marker2 for dyn Object + Marker2 {} | = note: a trait object implements `Marker2` if and only if `Marker2` is one of the trait object's trait bounds -error[E0371]: the object type `(dyn Object + Marker2 + 'static)` automatically implements the trait `Marker2` +error[E0371]: the object type `dyn Object + Marker2 + 'static` automatically implements the trait `Marker2` --> $DIR/coherence-impl-trait-for-marker-trait-negative.rs:18:1 | LL | impl !Marker2 for dyn Object + Marker2 {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Object + Marker2 + 'static)` automatically implements trait `Marker2` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `dyn Object + Marker2 + 'static` automatically implements trait `Marker2` -error[E0321]: traits with a default impl, like `Marker2`, cannot be implemented for trait object `(dyn Object + 'static)` +error[E0321]: traits with a default impl, like `Marker2`, cannot be implemented for trait object `dyn Object + 'static` --> $DIR/coherence-impl-trait-for-marker-trait-negative.rs:26:1 | LL | impl !Marker2 for dyn Object {} @@ -46,13 +46,13 @@ LL | impl !Send for dyn Marker2 {} = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead -error[E0321]: cross-crate traits with a default impl, like `Send`, can only be implemented for a struct/enum type, not `(dyn Object + 'static)` +error[E0321]: cross-crate traits with a default impl, like `Send`, can only be implemented for a struct/enum type, not `dyn Object + 'static` --> $DIR/coherence-impl-trait-for-marker-trait-negative.rs:27:1 | LL | impl !Send for dyn Object {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type -error[E0321]: cross-crate traits with a default impl, like `Send`, can only be implemented for a struct/enum type, not `(dyn Object + Marker2 + 'static)` +error[E0321]: cross-crate traits with a default impl, like `Send`, can only be implemented for a struct/enum type, not `dyn Object + Marker2 + 'static` --> $DIR/coherence-impl-trait-for-marker-trait-negative.rs:28:1 | LL | impl !Send for dyn Object + Marker2 {} diff --git a/tests/ui/coherence/coherence-impl-trait-for-marker-trait-positive.stderr b/tests/ui/coherence/coherence-impl-trait-for-marker-trait-positive.stderr index f38aeaed0aaca..56fa4b59dc07e 100644 --- a/tests/ui/coherence/coherence-impl-trait-for-marker-trait-positive.stderr +++ b/tests/ui/coherence/coherence-impl-trait-for-marker-trait-positive.stderr @@ -1,10 +1,10 @@ -error[E0371]: the object type `(dyn Object + Marker2 + 'static)` automatically implements the trait `Marker1` +error[E0371]: the object type `dyn Object + Marker2 + 'static` automatically implements the trait `Marker1` --> $DIR/coherence-impl-trait-for-marker-trait-positive.rs:15:1 | LL | impl Marker1 for dyn Object + Marker2 {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Object + Marker2 + 'static)` automatically implements trait `Marker1` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `dyn Object + Marker2 + 'static` automatically implements trait `Marker1` -error[E0321]: traits with a default impl, like `Marker1`, cannot be implemented for trait object `(dyn Object + Marker2 + 'static)` +error[E0321]: traits with a default impl, like `Marker1`, cannot be implemented for trait object `dyn Object + Marker2 + 'static` --> $DIR/coherence-impl-trait-for-marker-trait-positive.rs:15:1 | LL | impl Marker1 for dyn Object + Marker2 {} @@ -12,13 +12,13 @@ LL | impl Marker1 for dyn Object + Marker2 {} | = note: a trait object implements `Marker1` if and only if `Marker1` is one of the trait object's trait bounds -error[E0371]: the object type `(dyn Object + Marker2 + 'static)` automatically implements the trait `Marker2` +error[E0371]: the object type `dyn Object + Marker2 + 'static` automatically implements the trait `Marker2` --> $DIR/coherence-impl-trait-for-marker-trait-positive.rs:18:1 | LL | impl Marker2 for dyn Object + Marker2 {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Object + Marker2 + 'static)` automatically implements trait `Marker2` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `dyn Object + Marker2 + 'static` automatically implements trait `Marker2` -error[E0321]: traits with a default impl, like `Marker2`, cannot be implemented for trait object `(dyn Object + Marker2 + 'static)` +error[E0321]: traits with a default impl, like `Marker2`, cannot be implemented for trait object `dyn Object + Marker2 + 'static` --> $DIR/coherence-impl-trait-for-marker-trait-positive.rs:18:1 | LL | impl Marker2 for dyn Object + Marker2 {} @@ -26,7 +26,7 @@ LL | impl Marker2 for dyn Object + Marker2 {} | = note: a trait object implements `Marker2` if and only if `Marker2` is one of the trait object's trait bounds -error[E0321]: traits with a default impl, like `Marker2`, cannot be implemented for trait object `(dyn Object + 'static)` +error[E0321]: traits with a default impl, like `Marker2`, cannot be implemented for trait object `dyn Object + 'static` --> $DIR/coherence-impl-trait-for-marker-trait-positive.rs:26:1 | LL | impl Marker2 for dyn Object {} @@ -46,13 +46,13 @@ LL | unsafe impl Send for dyn Marker2 {} = note: for more information see https://doc.rust-lang.org/reference/items/implementations.html#orphan-rules = note: define and implement a trait or new type instead -error[E0321]: cross-crate traits with a default impl, like `Send`, can only be implemented for a struct/enum type, not `(dyn Object + 'static)` +error[E0321]: cross-crate traits with a default impl, like `Send`, can only be implemented for a struct/enum type, not `dyn Object + 'static` --> $DIR/coherence-impl-trait-for-marker-trait-positive.rs:27:1 | LL | unsafe impl Send for dyn Object {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't implement cross-crate trait with a default impl for non-struct/enum type -error[E0321]: cross-crate traits with a default impl, like `Send`, can only be implemented for a struct/enum type, not `(dyn Object + Marker2 + 'static)` +error[E0321]: cross-crate traits with a default impl, like `Send`, can only be implemented for a struct/enum type, not `dyn Object + Marker2 + 'static` --> $DIR/coherence-impl-trait-for-marker-trait-positive.rs:28:1 | LL | unsafe impl Send for dyn Object + Marker2 {} diff --git a/tests/ui/coherence/coherence-impl-trait-for-trait.stderr b/tests/ui/coherence/coherence-impl-trait-for-trait.stderr index cf0b38c5bb8b6..543f116ba14a1 100644 --- a/tests/ui/coherence/coherence-impl-trait-for-trait.stderr +++ b/tests/ui/coherence/coherence-impl-trait-for-trait.stderr @@ -1,20 +1,20 @@ -error[E0371]: the object type `(dyn Baz + 'static)` automatically implements the trait `Foo` +error[E0371]: the object type `dyn Baz + 'static` automatically implements the trait `Foo` --> $DIR/coherence-impl-trait-for-trait.rs:9:1 | LL | impl Foo for dyn Baz { } - | ^^^^^^^^^^^^^^^^^^^^ `(dyn Baz + 'static)` automatically implements trait `Foo` + | ^^^^^^^^^^^^^^^^^^^^ `dyn Baz + 'static` automatically implements trait `Foo` -error[E0371]: the object type `(dyn Baz + 'static)` automatically implements the trait `Bar` +error[E0371]: the object type `dyn Baz + 'static` automatically implements the trait `Bar` --> $DIR/coherence-impl-trait-for-trait.rs:11:1 | LL | impl Bar for dyn Baz { } - | ^^^^^^^^^^^^^^^^^^^^ `(dyn Baz + 'static)` automatically implements trait `Bar` + | ^^^^^^^^^^^^^^^^^^^^ `dyn Baz + 'static` automatically implements trait `Bar` -error[E0371]: the object type `(dyn Baz + 'static)` automatically implements the trait `Baz` +error[E0371]: the object type `dyn Baz + 'static` automatically implements the trait `Baz` --> $DIR/coherence-impl-trait-for-trait.rs:13:1 | LL | impl Baz for dyn Baz { } - | ^^^^^^^^^^^^^^^^^^^^ `(dyn Baz + 'static)` automatically implements trait `Baz` + | ^^^^^^^^^^^^^^^^^^^^ `dyn Baz + 'static` automatically implements trait `Baz` error: aborting due to 3 previous errors diff --git a/tests/ui/const-generics/adt_const_params/unsizing-wfcheck-issue-126272.stderr b/tests/ui/const-generics/adt_const_params/unsizing-wfcheck-issue-126272.stderr index f520413927c36..5ea4d380b12e5 100644 --- a/tests/ui/const-generics/adt_const_params/unsizing-wfcheck-issue-126272.stderr +++ b/tests/ui/const-generics/adt_const_params/unsizing-wfcheck-issue-126272.stderr @@ -1,10 +1,10 @@ -error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Debug + 'static` cannot be known at compilation time --> $DIR/unsizing-wfcheck-issue-126272.rs:11:13 | LL | nested: &'static Bar, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)` + = help: the trait `Sized` is not implemented for `dyn Debug + 'static` note: required by an implicit `Sized` bound in `Bar` --> $DIR/unsizing-wfcheck-issue-126272.rs:20:12 | @@ -29,23 +29,23 @@ LL | LL | nested: &'static Bar, | ----------------------------------------- this field does not implement `ConstParamTy_` | -note: the `ConstParamTy_` impl for `&'static Bar<(dyn Debug + 'static)>` requires that `(dyn Debug + 'static): ConstParamTy_` +note: the `ConstParamTy_` impl for `&'static Bar` requires that `dyn Debug + 'static: ConstParamTy_` --> $DIR/unsizing-wfcheck-issue-126272.rs:11:13 | LL | nested: &'static Bar, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: the `ConstParamTy_` impl for `&'static Bar<(dyn Debug + 'static)>` requires that `(dyn Debug + 'static): Eq` +note: the `ConstParamTy_` impl for `&'static Bar` requires that `dyn Debug + 'static: Eq` --> $DIR/unsizing-wfcheck-issue-126272.rs:11:13 | LL | nested: &'static Bar, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -note: the `ConstParamTy_` impl for `&'static Bar<(dyn Debug + 'static)>` requires that `(dyn Debug + 'static): Sized` +note: the `ConstParamTy_` impl for `&'static Bar` requires that `dyn Debug + 'static: Sized` --> $DIR/unsizing-wfcheck-issue-126272.rs:11:13 | LL | nested: &'static Bar, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Debug + 'static` cannot be known at compilation time --> $DIR/unsizing-wfcheck-issue-126272.rs:11:5 | LL | #[derive(Debug, PartialEq, Eq, ConstParamTy)] @@ -54,13 +54,13 @@ LL | #[derive(Debug, PartialEq, Eq, ConstParamTy)] LL | nested: &'static Bar, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)` + = help: the trait `Sized` is not implemented for `dyn Debug + 'static` help: the trait `Debug` is implemented for `Bar` --> $DIR/unsizing-wfcheck-issue-126272.rs:19:10 | LL | #[derive(Debug, PartialEq, Eq, ConstParamTy)] | ^^^^^ -note: required for `Bar<(dyn Debug + 'static)>` to implement `Debug` +note: required for `Bar` to implement `Debug` --> $DIR/unsizing-wfcheck-issue-126272.rs:20:8 | LL | #[derive(Debug, PartialEq, Eq, ConstParamTy)] @@ -69,8 +69,8 @@ LL | struct Bar(T); | ^^^ - unsatisfied trait bound = help: consider manually implementing `Debug` to avoid undesired bounds = note: 2 redundant requirements hidden - = note: required for `&&'static Bar<(dyn Debug + 'static)>` to implement `Debug` - = note: required for the cast from `&&&'static Bar<(dyn Debug + 'static)>` to `&dyn Debug` + = note: required for `&&'static Bar` to implement `Debug` + = note: required for the cast from `&&&'static Bar` to `&dyn Debug` error[E0369]: binary operation `==` cannot be applied to type `&Bar` --> $DIR/unsizing-wfcheck-issue-126272.rs:11:5 @@ -131,13 +131,13 @@ LL | struct Bar(T); | | | this could be changed to `T: ?Sized`... -error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Debug + 'static` cannot be known at compilation time --> $DIR/unsizing-wfcheck-issue-126272.rs:25:33 | LL | let x: Test<{ Foo { nested: &Bar(4) } }> = Test; | ^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)` + = help: the trait `Sized` is not implemented for `dyn Debug + 'static` note: required by an implicit `Sized` bound in `Bar` --> $DIR/unsizing-wfcheck-issue-126272.rs:20:12 | diff --git a/tests/ui/const-generics/generic_const_exprs/size_of-dyn-trait-2.rs b/tests/ui/const-generics/generic_const_exprs/size_of-dyn-trait-2.rs index ee5d65cf4b2ba..7fbea110c8752 100644 --- a/tests/ui/const-generics/generic_const_exprs/size_of-dyn-trait-2.rs +++ b/tests/ui/const-generics/generic_const_exprs/size_of-dyn-trait-2.rs @@ -13,6 +13,6 @@ struct A + ?Sized> { fn foo(x: A) {} //~^ ERROR mismatched types -//~| ERROR the size for values of type `(dyn Send + 'static)` cannot be known at compilation time +//~| ERROR the size for values of type `dyn Send + 'static` cannot be known at compilation time fn main() {} diff --git a/tests/ui/const-generics/generic_const_exprs/size_of-dyn-trait-2.stderr b/tests/ui/const-generics/generic_const_exprs/size_of-dyn-trait-2.stderr index 71fea4df163d1..a9456fefb7c2c 100644 --- a/tests/ui/const-generics/generic_const_exprs/size_of-dyn-trait-2.stderr +++ b/tests/ui/const-generics/generic_const_exprs/size_of-dyn-trait-2.stderr @@ -12,14 +12,14 @@ note: required by a bound in `A` LL | struct A + ?Sized> { | ^^^^^^^ required by this bound in `A` -error[E0277]: the size for values of type `(dyn Send + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Send + 'static` cannot be known at compilation time --> $DIR/size_of-dyn-trait-2.rs:14:11 | LL | fn foo(x: A) {} | ^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Send + 'static)` -note: required for `(dyn Send + 'static)` to implement `Size<8>` + = help: the trait `Sized` is not implemented for `dyn Send + 'static` +note: required for `dyn Send + 'static` to implement `Size<8>` --> $DIR/size_of-dyn-trait-2.rs:8:16 | LL | impl Size<{ std::mem::size_of::() }> for T {} diff --git a/tests/ui/const-generics/issues/issue-63322-forbid-dyn.full.stderr b/tests/ui/const-generics/issues/issue-63322-forbid-dyn.full.stderr index 1301ca92f015c..a60917af3de7a 100644 --- a/tests/ui/const-generics/issues/issue-63322-forbid-dyn.full.stderr +++ b/tests/ui/const-generics/issues/issue-63322-forbid-dyn.full.stderr @@ -4,7 +4,7 @@ error[E0741]: `&'static (dyn A + 'static)` can't be used as a const parameter ty LL | fn test() { | ^^^^^^^^^^^^^^ | - = note: `(dyn A + 'static)` must implement `ConstParamTy_`, but it does not + = note: `dyn A + 'static` must implement `ConstParamTy_`, but it does not error: aborting due to 1 previous error diff --git a/tests/ui/consts/const-unsized.stderr b/tests/ui/consts/const-unsized.stderr index a37a6df71f83c..c3b35c07c9ec2 100644 --- a/tests/ui/consts/const-unsized.stderr +++ b/tests/ui/consts/const-unsized.stderr @@ -1,10 +1,10 @@ -error[E0277]: the size for values of type `(dyn Debug + Sync + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Debug + Sync + 'static` cannot be known at compilation time --> $DIR/const-unsized.rs:3:16 | LL | const CONST_0: dyn Debug + Sync = *(&0 as &(dyn Debug + Sync)); | ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)` + = help: the trait `Sized` is not implemented for `dyn Debug + Sync + 'static` = note: statics and constants must have a statically known size error[E0277]: the size for values of type `str` cannot be known at compilation time @@ -16,13 +16,13 @@ LL | const CONST_FOO: str = *"foo"; = help: the trait `Sized` is not implemented for `str` = note: statics and constants must have a statically known size -error[E0277]: the size for values of type `(dyn Debug + Sync + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Debug + Sync + 'static` cannot be known at compilation time --> $DIR/const-unsized.rs:11:1 | LL | static STATIC_1: dyn Debug + Sync = *(&1 as &(dyn Debug + Sync)); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Debug + Sync + 'static)` + = help: the trait `Sized` is not implemented for `dyn Debug + Sync + 'static` = note: statics and constants must have a statically known size error[E0277]: the size for values of type `str` cannot be known at compilation time diff --git a/tests/ui/consts/const_refs_to_static-ice-121413.rs b/tests/ui/consts/const_refs_to_static-ice-121413.rs index d0f89283ed049..a20bc2ef7edcd 100644 --- a/tests/ui/consts/const_refs_to_static-ice-121413.rs +++ b/tests/ui/consts/const_refs_to_static-ice-121413.rs @@ -9,10 +9,10 @@ const REF_INTERIOR_MUT: &usize = { static FOO: Sync = AtomicUsize::new(0); //~^ ERROR cannot find //~| WARN trait objects without an explicit `dyn` are deprecated - //~| ERROR the size for values of type `(dyn Sync + 'static)` cannot be known at compilation time + //~| ERROR the size for values of type `dyn Sync + 'static` cannot be known at compilation time //~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! //~| HELP if this is a dyn-compatible trait, use `dyn` - //~| HELP the trait `Sized` is not implemented for `(dyn Sync + 'static)` + //~| HELP the trait `Sized` is not implemented for `dyn Sync + 'static` unsafe { &*(&FOO as *const _ as *const usize) } }; pub fn main() {} diff --git a/tests/ui/consts/const_refs_to_static-ice-121413.stderr b/tests/ui/consts/const_refs_to_static-ice-121413.stderr index 2787109769324..be8005215be78 100644 --- a/tests/ui/consts/const_refs_to_static-ice-121413.stderr +++ b/tests/ui/consts/const_refs_to_static-ice-121413.stderr @@ -23,13 +23,13 @@ help: if this is a dyn-compatible trait, use `dyn` LL | static FOO: dyn Sync = AtomicUsize::new(0); | +++ -error[E0277]: the size for values of type `(dyn Sync + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Sync + 'static` cannot be known at compilation time --> $DIR/const_refs_to_static-ice-121413.rs:9:5 | LL | static FOO: Sync = AtomicUsize::new(0); | ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Sync + 'static)` + = help: the trait `Sized` is not implemented for `dyn Sync + 'static` = note: statics and constants must have a statically known size error: aborting due to 2 previous errors; 1 warning emitted diff --git a/tests/ui/deref/box-pattern-trait-object-cannot-deref.stderr b/tests/ui/deref/box-pattern-trait-object-cannot-deref.stderr index 451fbf4fbcd35..2a06ea9749548 100644 --- a/tests/ui/deref/box-pattern-trait-object-cannot-deref.stderr +++ b/tests/ui/deref/box-pattern-trait-object-cannot-deref.stderr @@ -1,8 +1,8 @@ -error[E0033]: type `Box<(dyn MyTrait + 'static)>` cannot be dereferenced +error[E0033]: type `Box` cannot be dereferenced --> $DIR/box-pattern-trait-object-cannot-deref.rs:15:25 | LL | TraitWrapper::A(box ref map) => map, - | ^^^^^^^^^^^ type `Box<(dyn MyTrait + 'static)>` cannot be dereferenced + | ^^^^^^^^^^^ type `Box` cannot be dereferenced error: aborting due to 1 previous error diff --git a/tests/ui/did_you_mean/bad-assoc-ty.edition2015.stderr b/tests/ui/did_you_mean/bad-assoc-ty.edition2015.stderr index af0a9d064d571..2d23e143d3b52 100644 --- a/tests/ui/did_you_mean/bad-assoc-ty.edition2015.stderr +++ b/tests/ui/did_you_mean/bad-assoc-ty.edition2015.stderr @@ -173,10 +173,10 @@ error[E0223]: ambiguous associated type LL | type G = dyn 'static + (Send)::AssocTy; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | -help: if there were a trait named `Example` with associated type `AssocTy` implemented for `(dyn Send + 'static)`, you could use the fully-qualified path +help: if there were a trait named `Example` with associated type `AssocTy` implemented for `dyn Send + 'static`, you could use the fully-qualified path | LL - type G = dyn 'static + (Send)::AssocTy; -LL + type G = <(dyn Send + 'static) as Example>::AssocTy; +LL + type G = ::AssocTy; | warning: trait objects without an explicit `dyn` are deprecated @@ -202,10 +202,10 @@ LL | type H = Fn(u8) -> (u8)::Output; help: use fully-qualified syntax | LL - type H = Fn(u8) -> (u8)::Output; -LL + type H = <(dyn Fn(u8) -> u8 + 'static) as BitOr>::Output; +LL + type H = u8 + 'static as BitOr>::Output; | LL - type H = Fn(u8) -> (u8)::Output; -LL + type H = <(dyn Fn(u8) -> u8 + 'static) as IntoFuture>::Output; +LL + type H = u8 + 'static as IntoFuture>::Output; | error[E0223]: ambiguous associated type diff --git a/tests/ui/did_you_mean/bad-assoc-ty.edition2021.stderr b/tests/ui/did_you_mean/bad-assoc-ty.edition2021.stderr index 2ee8ab2760a92..9c98a725a02ee 100644 --- a/tests/ui/did_you_mean/bad-assoc-ty.edition2021.stderr +++ b/tests/ui/did_you_mean/bad-assoc-ty.edition2021.stderr @@ -173,10 +173,10 @@ error[E0223]: ambiguous associated type LL | type G = dyn 'static + (Send)::AssocTy; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | -help: if there were a trait named `Example` with associated type `AssocTy` implemented for `(dyn Send + 'static)`, you could use the fully-qualified path +help: if there were a trait named `Example` with associated type `AssocTy` implemented for `dyn Send + 'static`, you could use the fully-qualified path | LL - type G = dyn 'static + (Send)::AssocTy; -LL + type G = <(dyn Send + 'static) as Example>::AssocTy; +LL + type G = ::AssocTy; | error[E0782]: expected a type, found a trait diff --git a/tests/ui/dropck/dropck_trait_cycle_checked.stderr b/tests/ui/dropck/dropck_trait_cycle_checked.stderr index f32736f1a674c..9f21f79b3b4df 100644 --- a/tests/ui/dropck/dropck_trait_cycle_checked.stderr +++ b/tests/ui/dropck/dropck_trait_cycle_checked.stderr @@ -9,7 +9,7 @@ LL | o1.set0(&o2); LL | } | - `o2` dropped here while still borrowed | - = note: due to object lifetime defaults, `Box>` actually means `Box<(dyn Obj<'_> + 'static)>` + = note: due to object lifetime defaults, `Box>` actually means `Box + 'static>` error[E0597]: `o3` does not live long enough --> $DIR/dropck_trait_cycle_checked.rs:112:13 @@ -23,7 +23,7 @@ LL | o1.set1(&o3); LL | } | - `o3` dropped here while still borrowed | - = note: due to object lifetime defaults, `Box>` actually means `Box<(dyn Obj<'_> + 'static)>` + = note: due to object lifetime defaults, `Box>` actually means `Box + 'static>` error[E0597]: `o2` does not live long enough --> $DIR/dropck_trait_cycle_checked.rs:113:13 @@ -37,7 +37,7 @@ LL | o2.set0(&o2); LL | } | - `o2` dropped here while still borrowed | - = note: due to object lifetime defaults, `Box>` actually means `Box<(dyn Obj<'_> + 'static)>` + = note: due to object lifetime defaults, `Box>` actually means `Box + 'static>` error[E0597]: `o3` does not live long enough --> $DIR/dropck_trait_cycle_checked.rs:114:13 @@ -51,7 +51,7 @@ LL | o2.set1(&o3); LL | } | - `o3` dropped here while still borrowed | - = note: due to object lifetime defaults, `Box>` actually means `Box<(dyn Obj<'_> + 'static)>` + = note: due to object lifetime defaults, `Box>` actually means `Box + 'static>` error[E0597]: `o1` does not live long enough --> $DIR/dropck_trait_cycle_checked.rs:115:13 @@ -65,7 +65,7 @@ LL | o3.set1(&o2); LL | } | - `o1` dropped here while still borrowed | - = note: due to object lifetime defaults, `Box>` actually means `Box<(dyn Obj<'_> + 'static)>` + = note: due to object lifetime defaults, `Box>` actually means `Box + 'static>` error[E0597]: `o2` does not live long enough --> $DIR/dropck_trait_cycle_checked.rs:116:13 @@ -78,7 +78,7 @@ LL | o3.set1(&o2); LL | } | - `o2` dropped here while still borrowed | - = note: due to object lifetime defaults, `Box>` actually means `Box<(dyn Obj<'_> + 'static)>` + = note: due to object lifetime defaults, `Box>` actually means `Box + 'static>` error: aborting due to 6 previous errors diff --git a/tests/ui/dyn-compatibility/assoc_type_bounds_implicit_sized.stderr b/tests/ui/dyn-compatibility/assoc_type_bounds_implicit_sized.stderr index 9bb770ce43199..20abaff07518b 100644 --- a/tests/ui/dyn-compatibility/assoc_type_bounds_implicit_sized.stderr +++ b/tests/ui/dyn-compatibility/assoc_type_bounds_implicit_sized.stderr @@ -1,10 +1,10 @@ -error[E0277]: the size for values of type `(dyn Trait + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Trait + 'static` cannot be known at compilation time --> $DIR/assoc_type_bounds_implicit_sized.rs:9:17 | LL | type Item = dyn Trait; | ^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Trait + 'static)` + = help: the trait `Sized` is not implemented for `dyn Trait + 'static` note: required by a bound in `TraitWithAType::Item` --> $DIR/assoc_type_bounds_implicit_sized.rs:4:5 | diff --git a/tests/ui/dyn-compatibility/avoid-ice-on-warning-2.old.stderr b/tests/ui/dyn-compatibility/avoid-ice-on-warning-2.old.stderr index 265bfb01de13a..4203c46196e7b 100644 --- a/tests/ui/dyn-compatibility/avoid-ice-on-warning-2.old.stderr +++ b/tests/ui/dyn-compatibility/avoid-ice-on-warning-2.old.stderr @@ -36,24 +36,24 @@ LL | fn id(f: Copy) -> usize { = note: for a trait to be dyn compatible it needs to allow building a vtable for more information, visit -error[E0618]: expected function, found `(dyn Copy + 'static)` +error[E0618]: expected function, found `dyn Copy + 'static` --> $DIR/avoid-ice-on-warning-2.rs:12:5 | LL | fn id(f: Copy) -> usize { - | - `f` has type `(dyn Copy + 'static)` + | - `f` has type `dyn Copy + 'static` ... LL | f() | ^-- | | | call expression requires function -error[E0277]: the size for values of type `(dyn Copy + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Copy + 'static` cannot be known at compilation time --> $DIR/avoid-ice-on-warning-2.rs:4:13 | LL | fn id(f: Copy) -> usize { | ^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Copy + 'static)` + = help: the trait `Sized` is not implemented for `dyn Copy + 'static` = help: unsized fn params are gated as an unstable feature help: you can use `impl Trait` as the argument type | diff --git a/tests/ui/dyn-compatibility/avoid-ice-on-warning-2.rs b/tests/ui/dyn-compatibility/avoid-ice-on-warning-2.rs index 312e0d666f1a9..bc82a51700037 100644 --- a/tests/ui/dyn-compatibility/avoid-ice-on-warning-2.rs +++ b/tests/ui/dyn-compatibility/avoid-ice-on-warning-2.rs @@ -4,12 +4,12 @@ fn id(f: Copy) -> usize { //[new]~^ ERROR expected a type, found a trait //[old]~^^ ERROR the trait `Copy` is not dyn compatible -//[old]~| ERROR the size for values of type `(dyn Copy + 'static)` +//[old]~| ERROR the size for values of type `dyn Copy + 'static` //[old]~| WARN trait objects without an explicit `dyn` are deprecated //[old]~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! //[old]~| WARN trait objects without an explicit `dyn` are deprecated //[old]~| WARN this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! f() - //[old]~^ ERROR: expected function, found `(dyn Copy + 'static)` + //[old]~^ ERROR: expected function, found `dyn Copy + 'static` } fn main() {} diff --git a/tests/ui/dyn-compatibility/dyn-compatible-trait-implementation-20939.rs b/tests/ui/dyn-compatibility/dyn-compatible-trait-implementation-20939.rs index c7938b275e944..81972999fc004 100644 --- a/tests/ui/dyn-compatibility/dyn-compatible-trait-implementation-20939.rs +++ b/tests/ui/dyn-compatibility/dyn-compatible-trait-implementation-20939.rs @@ -2,6 +2,6 @@ trait Foo {} impl<'a> Foo for dyn Foo + 'a {} -//~^ ERROR the object type `(dyn Foo + 'a)` automatically implements the trait `Foo` +//~^ ERROR the object type `dyn Foo + 'a` automatically implements the trait `Foo` fn main() {} diff --git a/tests/ui/dyn-compatibility/dyn-compatible-trait-implementation-20939.stderr b/tests/ui/dyn-compatibility/dyn-compatible-trait-implementation-20939.stderr index 196d8b6a880e2..a562c25c4e098 100644 --- a/tests/ui/dyn-compatibility/dyn-compatible-trait-implementation-20939.stderr +++ b/tests/ui/dyn-compatibility/dyn-compatible-trait-implementation-20939.stderr @@ -1,8 +1,8 @@ -error[E0371]: the object type `(dyn Foo + 'a)` automatically implements the trait `Foo` +error[E0371]: the object type `dyn Foo + 'a` automatically implements the trait `Foo` --> $DIR/dyn-compatible-trait-implementation-20939.rs:4:1 | LL | impl<'a> Foo for dyn Foo + 'a {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `(dyn Foo + 'a)` automatically implements trait `Foo` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `dyn Foo + 'a` automatically implements trait `Foo` error: aborting due to 1 previous error diff --git a/tests/ui/ergonomic-clones/closure/fn-once.stderr b/tests/ui/ergonomic-clones/closure/fn-once.stderr index 40f1200695cc3..191c698341552 100644 --- a/tests/ui/ergonomic-clones/closure/fn-once.stderr +++ b/tests/ui/ergonomic-clones/closure/fn-once.stderr @@ -9,7 +9,7 @@ LL | vec LL | Box::new(closure) | ----------------- the requirement to implement `Fn` derives from here | - = note: required for the cast from `Box<{closure@$DIR/fn-once.rs:7:19: 7:25}>` to `Box<(dyn Fn() -> Vec + 'static)>` + = note: required for the cast from `Box<{closure@$DIR/fn-once.rs:7:19: 7:25}>` to `Box Vec + 'static>` error: aborting due to 1 previous error diff --git a/tests/ui/error-emitter/highlighting.svg b/tests/ui/error-emitter/highlighting.svg index c82c7a168643f..2ca4d77b04e7f 100644 --- a/tests/ui/error-emitter/highlighting.svg +++ b/tests/ui/error-emitter/highlighting.svg @@ -1,4 +1,4 @@ - + + 'static)>) -> Box { +LL + fn i<'a, T, U>(v: Box + 'static>) -> Box { | error[E0515]: cannot return value referencing local data `*v` diff --git a/tests/ui/resolve/issue-3907-2.stderr b/tests/ui/resolve/issue-3907-2.stderr index 40cdfb7a30255..0102c503e770d 100644 --- a/tests/ui/resolve/issue-3907-2.stderr +++ b/tests/ui/resolve/issue-3907-2.stderr @@ -11,13 +11,13 @@ note: for a trait to be dyn compatible it needs to allow building a vtable LL | fn bar(); | ^^^ the trait is not dyn compatible because associated function `bar` has no `self` parameter -error[E0277]: the size for values of type `(dyn issue_3907::Foo + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn issue_3907::Foo + 'static` cannot be known at compilation time --> $DIR/issue-3907-2.rs:11:12 | LL | fn bar(_x: Foo) {} | ^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn issue_3907::Foo + 'static)` + = help: the trait `Sized` is not implemented for `dyn issue_3907::Foo + 'static` = help: unsized fn params are gated as an unstable feature help: function arguments must have a statically known size, borrowed types always have a known size | diff --git a/tests/ui/resolve/issue-5035-2.stderr b/tests/ui/resolve/issue-5035-2.stderr index ade0d6b4a359d..532e1002fb8e0 100644 --- a/tests/ui/resolve/issue-5035-2.stderr +++ b/tests/ui/resolve/issue-5035-2.stderr @@ -1,10 +1,10 @@ -error[E0277]: the size for values of type `(dyn I + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn I + 'static` cannot be known at compilation time --> $DIR/issue-5035-2.rs:4:12 | LL | fn foo(_x: K) {} | ^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn I + 'static)` + = help: the trait `Sized` is not implemented for `dyn I + 'static` = help: unsized fn params are gated as an unstable feature help: function arguments must have a statically known size, borrowed types always have a known size | diff --git a/tests/ui/static/issue-24446.stderr b/tests/ui/static/issue-24446.stderr index 497ce8ccfb6e9..c20dbebea2d76 100644 --- a/tests/ui/static/issue-24446.stderr +++ b/tests/ui/static/issue-24446.stderr @@ -1,10 +1,10 @@ -error[E0277]: the size for values of type `(dyn Fn() -> u32 + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Fn() -> u32 + 'static` cannot be known at compilation time --> $DIR/issue-24446.rs:2:5 | LL | static foo: dyn Fn() -> u32 = || -> u32 { | ^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Fn() -> u32 + 'static)` + = help: the trait `Sized` is not implemented for `dyn Fn() -> u32 + 'static` = note: statics and constants must have a statically known size error: aborting due to 1 previous error diff --git a/tests/ui/static/issue-5216.stderr b/tests/ui/static/issue-5216.stderr index 9748223e3d1df..6a2eb6aa095d7 100644 --- a/tests/ui/static/issue-5216.stderr +++ b/tests/ui/static/issue-5216.stderr @@ -6,7 +6,7 @@ LL | pub static C: S = S(f); | | | arguments to this struct are incorrect | - = note: expected struct `Box<(dyn FnMut() + Sync + 'static)>` + = note: expected struct `Box` found fn item `fn() {f}` note: tuple struct defined here --> $DIR/issue-5216.rs:2:8 @@ -22,7 +22,7 @@ LL | pub static D: T = g; | | | expected because of the type of the static | - = note: expected struct `Box<(dyn FnMut() + Sync + 'static)>` + = note: expected struct `Box` found fn item `fn() {g}` error: aborting due to 2 previous errors diff --git a/tests/ui/statics/unsizing-wfcheck-issue-127299.stderr b/tests/ui/statics/unsizing-wfcheck-issue-127299.stderr index e401277a0209f..0f7ad2621a21e 100644 --- a/tests/ui/statics/unsizing-wfcheck-issue-127299.stderr +++ b/tests/ui/statics/unsizing-wfcheck-issue-127299.stderr @@ -21,13 +21,13 @@ help: alternatively, consider constraining `bar` so it does not apply to trait o LL | fn bar() -> i32 where Self: Sized; | +++++++++++++++++ -error[E0277]: `(dyn Qux + 'static)` cannot be shared between threads safely +error[E0277]: `dyn Qux + 'static` cannot be shared between threads safely --> $DIR/unsizing-wfcheck-issue-127299.rs:12:13 | LL | static FOO: &Lint = &Lint { desc: "desc" }; - | ^^^^^ `(dyn Qux + 'static)` cannot be shared between threads safely + | ^^^^^ `dyn Qux + 'static` cannot be shared between threads safely | - = help: within `&'static Lint`, the trait `Sync` is not implemented for `(dyn Qux + 'static)` + = help: within `&'static Lint`, the trait `Sync` is not implemented for `dyn Qux + 'static` = note: required because it appears within the type `&'static (dyn Qux + 'static)` note: required because it appears within the type `Lint` --> $DIR/unsizing-wfcheck-issue-127299.rs:7:12 diff --git a/tests/ui/structs/field-implied-unsizing-wfcheck.rs b/tests/ui/structs/field-implied-unsizing-wfcheck.rs index a46c9b5a68b49..fa2383f4113c8 100644 --- a/tests/ui/structs/field-implied-unsizing-wfcheck.rs +++ b/tests/ui/structs/field-implied-unsizing-wfcheck.rs @@ -1,19 +1,19 @@ struct FooStruct { nested: &'static Bar, - //~^ ERROR the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time + //~^ ERROR the size for values of type `dyn Debug + 'static` cannot be known at compilation time } struct FooTuple(&'static Bar); -//~^ ERROR the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time +//~^ ERROR the size for values of type `dyn Debug + 'static` cannot be known at compilation time enum FooEnum1 { Struct { nested: &'static Bar }, - //~^ ERROR the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time + //~^ ERROR the size for values of type `dyn Debug + 'static` cannot be known at compilation time } enum FooEnum2 { Tuple(&'static Bar), - //~^ ERROR the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time + //~^ ERROR the size for values of type `dyn Debug + 'static` cannot be known at compilation time } struct Bar(T); @@ -22,11 +22,11 @@ fn main() { // Ensure there's an error at the construction site, for error tainting purposes. FooStruct { nested: &Bar(4) }; - //~^ ERROR the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time + //~^ ERROR the size for values of type `dyn Debug + 'static` cannot be known at compilation time FooTuple(&Bar(4)); - //~^ ERROR the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time + //~^ ERROR the size for values of type `dyn Debug + 'static` cannot be known at compilation time FooEnum1::Struct { nested: &Bar(4) }; - //~^ ERROR the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time + //~^ ERROR the size for values of type `dyn Debug + 'static` cannot be known at compilation time FooEnum2::Tuple(&Bar(4)); - //~^ ERROR the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time + //~^ ERROR the size for values of type `dyn Debug + 'static` cannot be known at compilation time } diff --git a/tests/ui/structs/field-implied-unsizing-wfcheck.stderr b/tests/ui/structs/field-implied-unsizing-wfcheck.stderr index 47d486ffa3311..6d8199153b844 100644 --- a/tests/ui/structs/field-implied-unsizing-wfcheck.stderr +++ b/tests/ui/structs/field-implied-unsizing-wfcheck.stderr @@ -1,10 +1,10 @@ -error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Debug + 'static` cannot be known at compilation time --> $DIR/field-implied-unsizing-wfcheck.rs:2:13 | LL | nested: &'static Bar, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)` + = help: the trait `Sized` is not implemented for `dyn Debug + 'static` note: required by an implicit `Sized` bound in `Bar` --> $DIR/field-implied-unsizing-wfcheck.rs:19:12 | @@ -18,13 +18,13 @@ LL | struct Bar(T); | | | this could be changed to `T: ?Sized`... -error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Debug + 'static` cannot be known at compilation time --> $DIR/field-implied-unsizing-wfcheck.rs:6:17 | LL | struct FooTuple(&'static Bar); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)` + = help: the trait `Sized` is not implemented for `dyn Debug + 'static` note: required by an implicit `Sized` bound in `Bar` --> $DIR/field-implied-unsizing-wfcheck.rs:19:12 | @@ -38,13 +38,13 @@ LL | struct Bar(T); | | | this could be changed to `T: ?Sized`... -error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Debug + 'static` cannot be known at compilation time --> $DIR/field-implied-unsizing-wfcheck.rs:10:22 | LL | Struct { nested: &'static Bar }, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)` + = help: the trait `Sized` is not implemented for `dyn Debug + 'static` note: required by an implicit `Sized` bound in `Bar` --> $DIR/field-implied-unsizing-wfcheck.rs:19:12 | @@ -58,13 +58,13 @@ LL | struct Bar(T); | | | this could be changed to `T: ?Sized`... -error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Debug + 'static` cannot be known at compilation time --> $DIR/field-implied-unsizing-wfcheck.rs:15:11 | LL | Tuple(&'static Bar), | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)` + = help: the trait `Sized` is not implemented for `dyn Debug + 'static` note: required by an implicit `Sized` bound in `Bar` --> $DIR/field-implied-unsizing-wfcheck.rs:19:12 | @@ -78,13 +78,13 @@ LL | struct Bar(T); | | | this could be changed to `T: ?Sized`... -error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Debug + 'static` cannot be known at compilation time --> $DIR/field-implied-unsizing-wfcheck.rs:24:25 | LL | FooStruct { nested: &Bar(4) }; | ^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)` + = help: the trait `Sized` is not implemented for `dyn Debug + 'static` note: required by an implicit `Sized` bound in `Bar` --> $DIR/field-implied-unsizing-wfcheck.rs:19:12 | @@ -98,13 +98,13 @@ LL | struct Bar(T); | | | this could be changed to `T: ?Sized`... -error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Debug + 'static` cannot be known at compilation time --> $DIR/field-implied-unsizing-wfcheck.rs:26:14 | LL | FooTuple(&Bar(4)); | ^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)` + = help: the trait `Sized` is not implemented for `dyn Debug + 'static` note: required by an implicit `Sized` bound in `Bar` --> $DIR/field-implied-unsizing-wfcheck.rs:19:12 | @@ -118,13 +118,13 @@ LL | struct Bar(T); | | | this could be changed to `T: ?Sized`... -error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Debug + 'static` cannot be known at compilation time --> $DIR/field-implied-unsizing-wfcheck.rs:28:32 | LL | FooEnum1::Struct { nested: &Bar(4) }; | ^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)` + = help: the trait `Sized` is not implemented for `dyn Debug + 'static` note: required by an implicit `Sized` bound in `Bar` --> $DIR/field-implied-unsizing-wfcheck.rs:19:12 | @@ -138,13 +138,13 @@ LL | struct Bar(T); | | | this could be changed to `T: ?Sized`... -error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Debug + 'static` cannot be known at compilation time --> $DIR/field-implied-unsizing-wfcheck.rs:30:21 | LL | FooEnum2::Tuple(&Bar(4)); | ^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)` + = help: the trait `Sized` is not implemented for `dyn Debug + 'static` note: required by an implicit `Sized` bound in `Bar` --> $DIR/field-implied-unsizing-wfcheck.rs:19:12 | diff --git a/tests/ui/suggestions/ambiguous-assoc-type-path-suggest-similar-item.stderr b/tests/ui/suggestions/ambiguous-assoc-type-path-suggest-similar-item.stderr index 76e3c21473d63..a6cc167d9d9c7 100644 --- a/tests/ui/suggestions/ambiguous-assoc-type-path-suggest-similar-item.stderr +++ b/tests/ui/suggestions/ambiguous-assoc-type-path-suggest-similar-item.stderr @@ -136,10 +136,10 @@ error[E0223]: ambiguous associated type LL | ::downcast::mut_unchecked; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | -help: if there were a trait named `Example` with associated type `downcast` implemented for `(dyn Any + 'static)`, you could use the fully-qualified path +help: if there were a trait named `Example` with associated type `downcast` implemented for `dyn Any + 'static`, you could use the fully-qualified path | LL - ::downcast::mut_unchecked; -LL + <(dyn Any + 'static) as Example>::downcast::mut_unchecked; +LL + ::downcast::mut_unchecked; | error: aborting due to 12 previous errors diff --git a/tests/ui/suggestions/box-future-wrong-output.stderr b/tests/ui/suggestions/box-future-wrong-output.stderr index bac26ae8fb5dd..2991b42bc4e7c 100644 --- a/tests/ui/suggestions/box-future-wrong-output.stderr +++ b/tests/ui/suggestions/box-future-wrong-output.stderr @@ -6,7 +6,7 @@ LL | let _: BoxFuture<'static, bool> = async {}.boxed(); | | | expected due to this | - = note: expected struct `Pin + Send + 'static)>>` + = note: expected struct `Pin + Send + 'static>>` found struct `Pin + Send>>` error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/dont-suggest-boxing-async-closure-body.stderr b/tests/ui/suggestions/dont-suggest-boxing-async-closure-body.stderr index abf8e2d824b5d..81918dbd10c41 100644 --- a/tests/ui/suggestions/dont-suggest-boxing-async-closure-body.stderr +++ b/tests/ui/suggestions/dont-suggest-boxing-async-closure-body.stderr @@ -22,7 +22,7 @@ LL | bar(async move || {}); | | | arguments to this function are incorrect | - = note: expected struct `Box<(dyn FnOnce() -> _ + 'static)>` + = note: expected struct `Box _ + 'static>` found closure `{async closure@$DIR/dont-suggest-boxing-async-closure-body.rs:11:9: 11:22}` = note: for more on the distinction between the stack and the heap, read https://doc.rust-lang.org/book/ch15-01-box.html, https://doc.rust-lang.org/rust-by-example/std/box.html, and https://doc.rust-lang.org/std/boxed/index.html note: function defined here diff --git a/tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr b/tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr index 61a1d30d31d4a..5e3178ff85f49 100644 --- a/tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr +++ b/tests/ui/suggestions/expected-boxed-future-isnt-pinned.stderr @@ -2,12 +2,12 @@ error[E0308]: mismatched types --> $DIR/expected-boxed-future-isnt-pinned.rs:11:5 | LL | fn foo + Send + 'static>(x: F) -> BoxFuture<'static, i32> { - | - found this type parameter ----------------------- expected `Pin + Send + 'static)>>` because of return type + | - found this type parameter ----------------------- expected `Pin + Send + 'static>>` because of return type LL | // We could instead use an `async` block, but this way we have no std spans. LL | x | ^ expected `Pin>`, found type parameter `F` | - = note: expected struct `Pin + Send + 'static)>>` + = note: expected struct `Pin + Send + 'static>>` found type parameter `F` help: you need to pin and box this expression | @@ -18,11 +18,11 @@ error[E0308]: mismatched types --> $DIR/expected-boxed-future-isnt-pinned.rs:15:5 | LL | fn bar + Send + 'static>(x: F) -> BoxFuture<'static, i32> { - | ----------------------- expected `Pin + Send + 'static)>>` because of return type + | ----------------------- expected `Pin + Send + 'static>>` because of return type LL | Box::new(x) | ^^^^^^^^^^^ expected `Pin>`, found `Box` | - = note: expected struct `Pin + Send + 'static)>>` + = note: expected struct `Pin + Send + 'static>>` found struct `Box` = help: use `Box::pin` @@ -72,13 +72,13 @@ error[E0308]: mismatched types --> $DIR/expected-boxed-future-isnt-pinned.rs:28:5 | LL | fn zap() -> BoxFuture<'static, i32> { - | ----------------------- expected `Pin + Send + 'static)>>` because of return type + | ----------------------- expected `Pin + Send + 'static>>` because of return type LL | / async { LL | | 42 LL | | } | |_____^ expected `Pin>`, found `async` block | - = note: expected struct `Pin + Send + 'static)>>` + = note: expected struct `Pin + Send + 'static>>` found `async` block `{async block@$DIR/expected-boxed-future-isnt-pinned.rs:28:5: 28:10}` help: you need to pin and box this expression | diff --git a/tests/ui/suggestions/issue-104327.stderr b/tests/ui/suggestions/issue-104327.stderr index 4515fe223c7d9..a61ce283452e6 100644 --- a/tests/ui/suggestions/issue-104327.stderr +++ b/tests/ui/suggestions/issue-104327.stderr @@ -9,8 +9,8 @@ LL | Foo::f(); | help: use the fully-qualified path to the only available implementation | -LL | <(dyn Bar + 'static) as Foo>::f(); - | +++++++++++++++++++++++ + +LL | ::f(); + | +++++++++++++++++++++ + error: aborting due to 1 previous error diff --git a/tests/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr b/tests/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr index c77ef79e7ed18..6e4d2d797bad1 100644 --- a/tests/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr +++ b/tests/ui/suggestions/lifetimes/trait-object-nested-in-impl-trait.stderr @@ -10,7 +10,7 @@ LL | | remaining: self.0.iter(), LL | | } | |_________^ returning this value requires that `'1` must outlive `'static` | -help: to declare that `impl Iterator>` captures data from argument `self`, you can add an explicit `'_` lifetime bound +help: to declare that `impl Iterator>` captures data from argument `self`, you can add an explicit `'_` lifetime bound | LL | fn iter(&self) -> impl Iterator> + '_ { | ++++ @@ -65,7 +65,7 @@ LL | | remaining: self.0.iter(), LL | | } | |_________^ returning this value requires that `'a` must outlive `'static` | -help: to declare that `impl Iterator>` captures data from argument `self`, you can add an explicit `'a` lifetime bound +help: to declare that `impl Iterator>` captures data from argument `self`, you can add an explicit `'a` lifetime bound | LL | fn iter<'a>(&'a self) -> impl Iterator> + 'a { | ++++ diff --git a/tests/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.stderr b/tests/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.stderr index 51ea5b35ae114..66c81c9deff93 100644 --- a/tests/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.stderr +++ b/tests/ui/suggestions/match-with-different-arm-types-as-stmt-instead-of-expr.stderr @@ -43,7 +43,7 @@ LL | fn wrong(c: &str) -> Box { | | | implicitly returns `()` as its body has no tail or `return` expression | - = note: expected struct `Box<(dyn Foo + 'static)>` + = note: expected struct `Box` found unit type `()` error: aborting due to 3 previous errors diff --git a/tests/ui/symbol-names/impl1.legacy.stderr b/tests/ui/symbol-names/impl1.legacy.stderr index 87a2837e01920..ff050c394d9e2 100644 --- a/tests/ui/symbol-names/impl1.legacy.stderr +++ b/tests/ui/symbol-names/impl1.legacy.stderr @@ -64,7 +64,7 @@ error: demangling-alt(<[&dyn impl1::Foo+Assoc = extern "C" fn(&u8, ::.)+impl1::A LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: def-path(<[&dyn Foo extern "C" fn(&'a u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method) +error: def-path(<[&(dyn Foo extern "C" fn(&'a u8, ...)> + AutoTrait); 3] as main::{closure#1}::Bar>::method) --> $DIR/impl1.rs:69:13 | LL | #[rustc_dump_def_path] diff --git a/tests/ui/symbol-names/impl1.rs b/tests/ui/symbol-names/impl1.rs index 5902df54b486f..e3e161af08563 100644 --- a/tests/ui/symbol-names/impl1.rs +++ b/tests/ui/symbol-names/impl1.rs @@ -67,8 +67,8 @@ fn main() { //[v0]~| ERROR demangling(<[&dyn //[v0]~| ERROR demangling-alt(<[&dyn impl1::Foo extern "C" fn(&'a u8, ...)> + impl1::AutoTrait; 3] as impl1::main::{closure#1}::Bar>::method) #[rustc_dump_def_path] - //[legacy]~^ ERROR def-path(<[&dyn Foo extern "C" fn(&'a u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method) - //[v0]~^^ ERROR def-path(<[&dyn Foo extern "C" fn(&'a u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method) + //[legacy]~^ ERROR def-path(<[&(dyn Foo extern "C" fn(&'a u8, ...)> + AutoTrait); 3] as main::{closure#1}::Bar>::method) + //[v0]~^^ ERROR def-path(<[&(dyn Foo extern "C" fn(&'a u8, ...)> + AutoTrait); 3] as main::{closure#1}::Bar>::method) fn method(&self) {} } }; diff --git a/tests/ui/symbol-names/impl1.v0.stderr b/tests/ui/symbol-names/impl1.v0.stderr index 77319825b1770..fb12927a046b4 100644 --- a/tests/ui/symbol-names/impl1.v0.stderr +++ b/tests/ui/symbol-names/impl1.v0.stderr @@ -64,7 +64,7 @@ error: demangling-alt(<[&dyn impl1::Foo extern "C" fn(&'a u8, .. LL | #[rustc_dump_symbol_name] | ^^^^^^^^^^^^^^^^^^^^^^^^^ -error: def-path(<[&dyn Foo extern "C" fn(&'a u8, ...)> + AutoTrait; 3] as main::{closure#1}::Bar>::method) +error: def-path(<[&(dyn Foo extern "C" fn(&'a u8, ...)> + AutoTrait); 3] as main::{closure#1}::Bar>::method) --> $DIR/impl1.rs:69:13 | LL | #[rustc_dump_def_path] diff --git a/tests/ui/trait-bounds/ice-unsized-tuple-const-issue-121443.rs b/tests/ui/trait-bounds/ice-unsized-tuple-const-issue-121443.rs index 5277de29464d7..abf5046f17704 100644 --- a/tests/ui/trait-bounds/ice-unsized-tuple-const-issue-121443.rs +++ b/tests/ui/trait-bounds/ice-unsized-tuple-const-issue-121443.rs @@ -7,9 +7,9 @@ type Fn = dyn FnOnce() -> u8; const TEST: Fn = some_fn; //~^ ERROR cannot find value `some_fn` in this scope -//~| ERROR the size for values of type `(dyn FnOnce() -> u8 + 'static)` cannot be known at compilation time +//~| ERROR the size for values of type `dyn FnOnce() -> u8 + 'static` cannot be known at compilation time const TEST2: (Fn, u8) = (TEST, 0); -//~^ ERROR the size for values of type `(dyn FnOnce() -> u8 + 'static)` cannot be known at compilation time -//~| ERROR the size for values of type `(dyn FnOnce() -> u8 + 'static)` cannot be known at compilation time +//~^ ERROR the size for values of type `dyn FnOnce() -> u8 + 'static` cannot be known at compilation time +//~| ERROR the size for values of type `dyn FnOnce() -> u8 + 'static` cannot be known at compilation time fn main() {} diff --git a/tests/ui/trait-bounds/ice-unsized-tuple-const-issue-121443.stderr b/tests/ui/trait-bounds/ice-unsized-tuple-const-issue-121443.stderr index 4609e02716fdc..695bd71bdd0b5 100644 --- a/tests/ui/trait-bounds/ice-unsized-tuple-const-issue-121443.stderr +++ b/tests/ui/trait-bounds/ice-unsized-tuple-const-issue-121443.stderr @@ -4,31 +4,31 @@ error[E0425]: cannot find value `some_fn` in this scope LL | const TEST: Fn = some_fn; | ^^^^^^^ not found in this scope -error[E0277]: the size for values of type `(dyn FnOnce() -> u8 + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn FnOnce() -> u8 + 'static` cannot be known at compilation time --> $DIR/ice-unsized-tuple-const-issue-121443.rs:8:13 | LL | const TEST: Fn = some_fn; | ^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn FnOnce() -> u8 + 'static)` + = help: the trait `Sized` is not implemented for `dyn FnOnce() -> u8 + 'static` = note: statics and constants must have a statically known size -error[E0277]: the size for values of type `(dyn FnOnce() -> u8 + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn FnOnce() -> u8 + 'static` cannot be known at compilation time --> $DIR/ice-unsized-tuple-const-issue-121443.rs:11:14 | LL | const TEST2: (Fn, u8) = (TEST, 0); | ^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn FnOnce() -> u8 + 'static)` + = help: the trait `Sized` is not implemented for `dyn FnOnce() -> u8 + 'static` = note: only the last element of a tuple may have a dynamically sized type -error[E0277]: the size for values of type `(dyn FnOnce() -> u8 + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn FnOnce() -> u8 + 'static` cannot be known at compilation time --> $DIR/ice-unsized-tuple-const-issue-121443.rs:11:25 | LL | const TEST2: (Fn, u8) = (TEST, 0); | ^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn FnOnce() -> u8 + 'static)` + = help: the trait `Sized` is not implemented for `dyn FnOnce() -> u8 + 'static` = note: only the last element of a tuple may have a dynamically sized type error: aborting due to 4 previous errors diff --git a/tests/ui/traits/alias/dont-elaborate-non-self.rs b/tests/ui/traits/alias/dont-elaborate-non-self.rs index 4f9eaacb8ed06..7cf3338e7aa6c 100644 --- a/tests/ui/traits/alias/dont-elaborate-non-self.rs +++ b/tests/ui/traits/alias/dont-elaborate-non-self.rs @@ -5,6 +5,6 @@ use std::future::Future; trait F> = Fn() -> Fut; fn f(a: dyn F) {} -//~^ ERROR the size for values of type `(dyn Fn() -> Fut + 'static)` cannot be known at compilation time +//~^ ERROR the size for values of type `dyn Fn() -> Fut + 'static` cannot be known at compilation time fn main() {} diff --git a/tests/ui/traits/alias/dont-elaborate-non-self.stderr b/tests/ui/traits/alias/dont-elaborate-non-self.stderr index 1d96a6a69940c..f30f5c23e7074 100644 --- a/tests/ui/traits/alias/dont-elaborate-non-self.stderr +++ b/tests/ui/traits/alias/dont-elaborate-non-self.stderr @@ -1,10 +1,10 @@ -error[E0277]: the size for values of type `(dyn Fn() -> Fut + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Fn() -> Fut + 'static` cannot be known at compilation time --> $DIR/dont-elaborate-non-self.rs:7:14 | LL | fn f(a: dyn F) {} | ^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Fn() -> Fut + 'static)` + = help: the trait `Sized` is not implemented for `dyn Fn() -> Fut + 'static` = help: unsized fn params are gated as an unstable feature help: you can use `impl Trait` as the argument type | diff --git a/tests/ui/traits/bound/not-on-bare-trait.stderr b/tests/ui/traits/bound/not-on-bare-trait.stderr index 72226391f583d..a2605a9dfa3b3 100644 --- a/tests/ui/traits/bound/not-on-bare-trait.stderr +++ b/tests/ui/traits/bound/not-on-bare-trait.stderr @@ -12,13 +12,13 @@ help: if this is a dyn-compatible trait, use `dyn` LL | fn foo(_x: dyn Foo + Send) { | +++ -error[E0277]: the size for values of type `(dyn Foo + Send + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Foo + Send + 'static` cannot be known at compilation time --> $DIR/not-on-bare-trait.rs:8:12 | LL | fn foo(_x: Foo + Send) { | ^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Foo + Send + 'static)` + = help: the trait `Sized` is not implemented for `dyn Foo + Send + 'static` = help: unsized fn params are gated as an unstable feature help: you can use `impl Trait` as the argument type | @@ -29,13 +29,13 @@ help: function arguments must have a statically known size, borrowed types alway LL | fn foo(_x: &(dyn Foo + Send)) { | +++++ + -error[E0277]: the size for values of type `(dyn Foo + Send + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Foo + Send + 'static` cannot be known at compilation time --> $DIR/not-on-bare-trait.rs:13:12 | LL | fn bar(_x: (dyn Foo + Send)) { | ^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Foo + Send + 'static)` + = help: the trait `Sized` is not implemented for `dyn Foo + Send + 'static` = help: unsized fn params are gated as an unstable feature help: you can use `impl Trait` as the argument type | diff --git a/tests/ui/traits/bound/sugar.stderr b/tests/ui/traits/bound/sugar.stderr index 3b3ab1e995c3b..2ceda16f3733b 100644 --- a/tests/ui/traits/bound/sugar.stderr +++ b/tests/ui/traits/bound/sugar.stderr @@ -6,8 +6,8 @@ LL | a(x); | | | arguments to this function are incorrect | - = note: expected struct `Box<(dyn Foo + Send + 'static)>` - found struct `Box<(dyn Foo + Sync + 'static)>` + = note: expected struct `Box` + found struct `Box` note: function defined here --> $DIR/sugar.rs:5:4 | diff --git a/tests/ui/traits/const-traits/span-bug-issue-121418.stderr b/tests/ui/traits/const-traits/span-bug-issue-121418.stderr index 88776f28ef6ef..0997802685739 100644 --- a/tests/ui/traits/const-traits/span-bug-issue-121418.stderr +++ b/tests/ui/traits/const-traits/span-bug-issue-121418.stderr @@ -6,14 +6,14 @@ LL | impl const dyn T { LL | pub const fn new() -> std::sync::Mutex {} | ^^^^^^ help: remove the `const` -error[E0277]: the size for values of type `(dyn T + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn T + 'static` cannot be known at compilation time --> $DIR/span-bug-issue-121418.rs:7:27 | LL | pub const fn new() -> std::sync::Mutex {} | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: within `std::sync::Mutex<(dyn T + 'static)>`, the trait `Sized` is not implemented for `(dyn T + 'static)` -note: required because it appears within the type `std::sync::Mutex<(dyn T + 'static)>` + = help: within `std::sync::Mutex`, the trait `Sized` is not implemented for `dyn T + 'static` +note: required because it appears within the type `std::sync::Mutex` --> $SRC_DIR/std/src/sync/poison/mutex.rs:LL:COL = note: the return type of a function must have a statically known size @@ -25,7 +25,7 @@ LL | pub const fn new() -> std::sync::Mutex {} | | | implicitly returns `()` as its body has no tail or `return` expression | - = note: expected struct `std::sync::Mutex<(dyn T + 'static)>` + = note: expected struct `std::sync::Mutex` found unit type `()` error: aborting due to 3 previous errors diff --git a/tests/ui/traits/default_auto_traits/maybe-bounds-in-dyn-traits.stderr b/tests/ui/traits/default_auto_traits/maybe-bounds-in-dyn-traits.stderr index f29950de63798..76d8878cede1f 100644 --- a/tests/ui/traits/default_auto_traits/maybe-bounds-in-dyn-traits.stderr +++ b/tests/ui/traits/default_auto_traits/maybe-bounds-in-dyn-traits.stderr @@ -14,7 +14,7 @@ help: the trait `bounds_check::LeakTr` is implemented for `LeakS` | LL | impl LeakTr for LeakS {} | ^^^^^^^^^^^^^^^^^^^^^ - = note: required for the cast from `&NonLeakS` to `&dyn bounds_check::LeakTr + Leak` + = note: required for the cast from `&NonLeakS` to `&(dyn bounds_check::LeakTr + Leak)` error[E0038]: the trait `DynCompatCheck2` is not dyn compatible --> $DIR/maybe-bounds-in-dyn-traits.rs:90:17 diff --git a/tests/ui/traits/dont-suggest-impl-as-closure-arg.rs b/tests/ui/traits/dont-suggest-impl-as-closure-arg.rs index 68e234b0f20d3..78eb42d3fd1e4 100644 --- a/tests/ui/traits/dont-suggest-impl-as-closure-arg.rs +++ b/tests/ui/traits/dont-suggest-impl-as-closure-arg.rs @@ -1,5 +1,5 @@ // Suggestion to use impl trait in closure parameter is invalid, see issue 138932 fn main() { let c = |f: dyn Fn()| f(); - //~^ ERROR: the size for values of type `(dyn Fn() + 'static)` cannot be known at compilation time + //~^ ERROR: the size for values of type `dyn Fn() + 'static` cannot be known at compilation time } diff --git a/tests/ui/traits/dont-suggest-impl-as-closure-arg.stderr b/tests/ui/traits/dont-suggest-impl-as-closure-arg.stderr index 8218990503c2f..83c22792f9cb8 100644 --- a/tests/ui/traits/dont-suggest-impl-as-closure-arg.stderr +++ b/tests/ui/traits/dont-suggest-impl-as-closure-arg.stderr @@ -1,10 +1,10 @@ -error[E0277]: the size for values of type `(dyn Fn() + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Fn() + 'static` cannot be known at compilation time --> $DIR/dont-suggest-impl-as-closure-arg.rs:3:17 | LL | let c = |f: dyn Fn()| f(); | ^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Fn() + 'static)` + = help: the trait `Sized` is not implemented for `dyn Fn() + 'static` = help: unsized fn params are gated as an unstable feature help: function arguments must have a statically known size, borrowed types always have a known size | diff --git a/tests/ui/traits/dyn-coerce-unsized-ice.rs b/tests/ui/traits/dyn-coerce-unsized-ice.rs index cfb6c57366bd2..0ca043fb89797 100644 --- a/tests/ui/traits/dyn-coerce-unsized-ice.rs +++ b/tests/ui/traits/dyn-coerce-unsized-ice.rs @@ -10,7 +10,7 @@ pub trait Trait {} pub fn foo(x: dyn CoerceUnsized<*const dyn Trait>) -> *const dyn Trait { //~^ ERROR: the trait `CoerceUnsized` is not dyn compatible [E0038] x -//~^ ERROR: the size for values of type `(dyn CoerceUnsized<*const (dyn Trait + 'static)> + 'static)` cannot be known at compilation time [E0277] +//~^ ERROR: the size for values of type `dyn CoerceUnsized<*const (dyn Trait + 'static)> + 'static` cannot be known at compilation time [E0277] } fn main() {} diff --git a/tests/ui/traits/dyn-coerce-unsized-ice.stderr b/tests/ui/traits/dyn-coerce-unsized-ice.stderr index 1bd3874f0e120..7b3e56fe87e1f 100644 --- a/tests/ui/traits/dyn-coerce-unsized-ice.stderr +++ b/tests/ui/traits/dyn-coerce-unsized-ice.stderr @@ -8,14 +8,14 @@ LL | pub fn foo(x: dyn CoerceUnsized<*const dyn Trait>) -> *const dyn Trait { = note: for a trait to be dyn compatible it needs to allow building a vtable for more information, visit -error[E0277]: the size for values of type `(dyn CoerceUnsized<*const (dyn Trait + 'static)> + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn CoerceUnsized<*const (dyn Trait + 'static)> + 'static` cannot be known at compilation time --> $DIR/dyn-coerce-unsized-ice.rs:12:5 | LL | x | ^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn CoerceUnsized<*const (dyn Trait + 'static)> + 'static)` - = note: required for the cast from `(dyn CoerceUnsized<*const (dyn Trait + 'static)> + 'static)` to `*const (dyn Trait + 'static)` + = help: the trait `Sized` is not implemented for `dyn CoerceUnsized<*const (dyn Trait + 'static)> + 'static` + = note: required for the cast from `dyn CoerceUnsized<*const (dyn Trait + 'static)> + 'static` to `*const (dyn Trait + 'static)` error: aborting due to 2 previous errors diff --git a/tests/ui/traits/dyn-trait-size-error-23281.stderr b/tests/ui/traits/dyn-trait-size-error-23281.stderr index d7b791a045274..45ee59122927f 100644 --- a/tests/ui/traits/dyn-trait-size-error-23281.stderr +++ b/tests/ui/traits/dyn-trait-size-error-23281.stderr @@ -1,10 +1,10 @@ -error[E0277]: the size for values of type `(dyn Fn() + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Fn() + 'static` cannot be known at compilation time --> $DIR/dyn-trait-size-error-23281.rs:4:27 | LL | pub fn function(funs: Vec ()>) {} | ^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Fn() + 'static)` + = help: the trait `Sized` is not implemented for `dyn Fn() + 'static` note: required by an implicit `Sized` bound in `Vec` --> $DIR/dyn-trait-size-error-23281.rs:8:12 | diff --git a/tests/ui/traits/ice-trait-with-default-method-but-no-impl-broken-mir-109869-1.stderr b/tests/ui/traits/ice-trait-with-default-method-but-no-impl-broken-mir-109869-1.stderr index d43c9c018211c..fd7ea46dfbb51 100644 --- a/tests/ui/traits/ice-trait-with-default-method-but-no-impl-broken-mir-109869-1.stderr +++ b/tests/ui/traits/ice-trait-with-default-method-but-no-impl-broken-mir-109869-1.stderr @@ -2,14 +2,14 @@ error[E0308]: mismatched types --> $DIR/ice-trait-with-default-method-but-no-impl-broken-mir-109869-1.rs:16:9 | LL | fn from((from, ()): Spanned) -> Self { - | ---- expected `(dyn Span + 'static)` because of return type + | ---- expected `dyn Span + 'static` because of return type LL | (T::from(from), ()) | ^^^^^^^^^^^^^^^^^^^ expected `dyn Span`, found `(T, ())` | - = note: expected trait object `(dyn Span + 'static)` + = note: expected trait object `dyn Span + 'static` found tuple `(T, ())` = help: `(T, ())` implements `Span` so you could box the found value and coerce it to the trait object `Box`, you will have to change the expected type as well -help: call `Into::into` on this expression to convert `(T, ())` into `(dyn Span + 'static)` +help: call `Into::into` on this expression to convert `(T, ())` into `dyn Span + 'static` | LL | (T::from(from), ()).into() | +++++++ diff --git a/tests/ui/traits/ice-trait-with-default-method-but-no-impl-broken-mir-109869-2.stderr b/tests/ui/traits/ice-trait-with-default-method-but-no-impl-broken-mir-109869-2.stderr index 5f00ced09b845..a4e68beea4e0b 100644 --- a/tests/ui/traits/ice-trait-with-default-method-but-no-impl-broken-mir-109869-2.stderr +++ b/tests/ui/traits/ice-trait-with-default-method-but-no-impl-broken-mir-109869-2.stderr @@ -2,11 +2,11 @@ error[E0308]: mismatched types --> $DIR/ice-trait-with-default-method-but-no-impl-broken-mir-109869-2.rs:12:9 | LL | fn default() -> Self { - | ---- expected `(dyn Empty + 'static)` because of return type + | ---- expected `dyn Empty + 'static` because of return type LL | () | ^^ expected `dyn Empty`, found `()` | - = note: expected trait object `(dyn Empty + 'static)` + = note: expected trait object `dyn Empty + 'static` found unit type `()` error: aborting due to 1 previous error diff --git a/tests/ui/traits/ice-trait-with-default-method-but-no-impl-broken-mir-109869-trivial-bounds.stderr b/tests/ui/traits/ice-trait-with-default-method-but-no-impl-broken-mir-109869-trivial-bounds.stderr index 872b7f5cee1d6..8f624b3beffe7 100644 --- a/tests/ui/traits/ice-trait-with-default-method-but-no-impl-broken-mir-109869-trivial-bounds.stderr +++ b/tests/ui/traits/ice-trait-with-default-method-but-no-impl-broken-mir-109869-trivial-bounds.stderr @@ -2,11 +2,11 @@ error[E0308]: mismatched types --> $DIR/ice-trait-with-default-method-but-no-impl-broken-mir-109869-trivial-bounds.rs:13:9 | LL | fn default() -> Self { - | ---- expected `(dyn Empty + 'static)` because of return type + | ---- expected `dyn Empty + 'static` because of return type LL | () | ^^ expected `dyn Empty`, found `()` | - = note: expected trait object `(dyn Empty + 'static)` + = note: expected trait object `dyn Empty + 'static` found unit type `()` error: aborting due to 1 previous error diff --git a/tests/ui/traits/issue-33140-hack-boundaries.stderr b/tests/ui/traits/issue-33140-hack-boundaries.stderr index ed3ae2b31675a..6323246dfb4aa 100644 --- a/tests/ui/traits/issue-33140-hack-boundaries.stderr +++ b/tests/ui/traits/issue-33140-hack-boundaries.stderr @@ -1,20 +1,20 @@ -error[E0119]: conflicting implementations of trait `Trait0` for type `(dyn Send + 'static)` +error[E0119]: conflicting implementations of trait `Trait0` for type `dyn Send + 'static` --> $DIR/issue-33140-hack-boundaries.rs:9:1 | LL | impl Trait0 for dyn Send {} | ------------------------ first implementation here LL | impl Trait0 for dyn Send {} - | ^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 'static)` + | ^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `dyn Send + 'static` -error[E0119]: conflicting implementations of trait `Trait1` for type `(dyn Send + 'static)` +error[E0119]: conflicting implementations of trait `Trait1` for type `dyn Send + 'static` --> $DIR/issue-33140-hack-boundaries.rs:18:1 | LL | impl Trait1 for dyn Send {} | ------------------------ first implementation here LL | impl Trait1 for dyn Send {} - | ^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 'static)` + | ^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `dyn Send + 'static` -error[E0751]: found both positive and negative implementation of trait `Trait2` for type `(dyn Send + 'static)`: +error[E0751]: found both positive and negative implementation of trait `Trait2` for type `dyn Send + 'static`: --> $DIR/issue-33140-hack-boundaries.rs:25:1 | LL | impl Trait2 for dyn Send {} @@ -22,21 +22,21 @@ LL | impl Trait2 for dyn Send {} LL | impl !Trait2 for dyn Send {} | ^^^^^^^^^^^^^^^^^^^^^^^^^ negative implementation here -error[E0119]: conflicting implementations of trait `Trait3<(dyn Sync + 'static)>` for type `(dyn Send + 'static)` +error[E0119]: conflicting implementations of trait `Trait3` for type `dyn Send + 'static` --> $DIR/issue-33140-hack-boundaries.rs:32:1 | LL | impl Trait3 for dyn Send {} | ---------------------------------- first implementation here LL | impl Trait3 for dyn Send {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 'static)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `dyn Send + 'static` -error[E0119]: conflicting implementations of trait `Trait4a` for type `(dyn Send + 'static)` +error[E0119]: conflicting implementations of trait `Trait4a` for type `dyn Send + 'static` --> $DIR/issue-33140-hack-boundaries.rs:39:1 | LL | impl Trait4a for T {} | ----------------------------- first implementation here LL | impl Trait4a for dyn Send {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 'static)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `dyn Send + 'static` error[E0119]: conflicting implementations of trait `Trait4b` for type `()` --> $DIR/issue-33140-hack-boundaries.rs:46:1 @@ -46,13 +46,13 @@ LL | impl Trait4b for () {} LL | impl Trait4b for () {} | ^^^^^^^^^^^^^^^^^^^ conflicting implementation for `()` -error[E0119]: conflicting implementations of trait `Trait4c` for type `(dyn Trait1 + Send + 'static)` +error[E0119]: conflicting implementations of trait `Trait4c` for type `dyn Trait1 + Send + 'static` --> $DIR/issue-33140-hack-boundaries.rs:53:1 | LL | impl Trait4c for dyn Trait1 + Send {} | ---------------------------------- first implementation here LL | impl Trait4c for dyn Trait1 + Send {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Trait1 + Send + 'static)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `dyn Trait1 + Send + 'static` error[E0119]: conflicting implementations of trait `Trait4d` for type `dyn Send` --> $DIR/issue-33140-hack-boundaries.rs:60:1 @@ -62,13 +62,13 @@ LL | impl<'a> Trait4d for dyn Send + 'a {} LL | impl<'a> Trait4d for dyn Send + 'a {} | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `dyn Send` -error[E0119]: conflicting implementations of trait `Trait5` for type `(dyn Send + 'static)` +error[E0119]: conflicting implementations of trait `Trait5` for type `dyn Send + 'static` --> $DIR/issue-33140-hack-boundaries.rs:67:1 | LL | impl Trait5 for dyn Send {} | ------------------------ first implementation here LL | impl Trait5 for dyn Send where u32: Copy {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + 'static)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `dyn Send + 'static` error: aborting due to 9 previous errors diff --git a/tests/ui/traits/issue-33140.stderr b/tests/ui/traits/issue-33140.stderr index 7d7ee96f209b4..fbba4af8b40ba 100644 --- a/tests/ui/traits/issue-33140.stderr +++ b/tests/ui/traits/issue-33140.stderr @@ -1,20 +1,20 @@ -error[E0119]: conflicting implementations of trait `Trait` for type `(dyn Send + Sync + 'static)` +error[E0119]: conflicting implementations of trait `Trait` for type `dyn Send + Sync + 'static` --> $DIR/issue-33140.rs:9:1 | LL | impl Trait for dyn Send + Sync { | ------------------------------ first implementation here ... LL | impl Trait for dyn Sync + Send { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + Sync + 'static)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `dyn Send + Sync + 'static` -error[E0119]: conflicting implementations of trait `Trait2` for type `(dyn Send + Sync + 'static)` +error[E0119]: conflicting implementations of trait `Trait2` for type `dyn Send + Sync + 'static` --> $DIR/issue-33140.rs:22:1 | LL | impl Trait2 for dyn Send + Sync { | ------------------------------- first implementation here ... LL | impl Trait2 for dyn Sync + Send + Sync { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + Sync + 'static)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `dyn Send + Sync + 'static` error[E0592]: duplicate definitions with name `abc` --> $DIR/issue-33140.rs:29:5 @@ -31,12 +31,12 @@ error[E0034]: multiple applicable items in scope LL | assert_eq!(>::abc(), false); | ^^^ multiple `abc` found | -note: candidate #1 is defined in an impl for the type `Foo<(dyn Send + Sync + 'static)>` +note: candidate #1 is defined in an impl for the type `Foo` --> $DIR/issue-33140.rs:29:5 | LL | fn abc() -> bool { | ^^^^^^^^^^^^^^^^ -note: candidate #2 is defined in an impl for the type `Foo<(dyn Send + Sync + 'static)>` +note: candidate #2 is defined in an impl for the type `Foo` --> $DIR/issue-33140.rs:35:5 | LL | fn abc() -> bool { @@ -48,12 +48,12 @@ error[E0034]: multiple applicable items in scope LL | assert_eq!(>::abc(), true); | ^^^ multiple `abc` found | -note: candidate #1 is defined in an impl for the type `Foo<(dyn Send + Sync + 'static)>` +note: candidate #1 is defined in an impl for the type `Foo` --> $DIR/issue-33140.rs:29:5 | LL | fn abc() -> bool { | ^^^^^^^^^^^^^^^^ -note: candidate #2 is defined in an impl for the type `Foo<(dyn Send + Sync + 'static)>` +note: candidate #2 is defined in an impl for the type `Foo` --> $DIR/issue-33140.rs:35:5 | LL | fn abc() -> bool { diff --git a/tests/ui/traits/next-solver/object-projection-with-unsatisfied-bound-1.current.stderr b/tests/ui/traits/next-solver/object-projection-with-unsatisfied-bound-1.current.stderr index a9a5bb42998aa..6d53f408410f5 100644 --- a/tests/ui/traits/next-solver/object-projection-with-unsatisfied-bound-1.current.stderr +++ b/tests/ui/traits/next-solver/object-projection-with-unsatisfied-bound-1.current.stderr @@ -1,13 +1,13 @@ -error[E0277]: the trait bound `(dyn Trait + 'static): Trait<::FooAssoc>` is not satisfied +error[E0277]: the trait bound `dyn Trait + 'static: Trait<::FooAssoc>` is not satisfied --> $DIR/object-projection-with-unsatisfied-bound-1.rs:18:25 | LL | pub struct Wrap( as Trait>::Assoc); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait<::FooAssoc>` is not implemented for `(dyn Trait + 'static)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait<::FooAssoc>` is not implemented for `dyn Trait + 'static` | help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement | -LL | pub struct Wrap( as Trait>::Assoc) where (dyn Trait + 'static): Trait<::FooAssoc>; - | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +LL | pub struct Wrap( as Trait>::Assoc) where dyn Trait + 'static: Trait<::FooAssoc>; + | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ error: aborting due to 1 previous error diff --git a/tests/ui/traits/next-solver/object-projection-with-unsatisfied-bound-1.next.stderr b/tests/ui/traits/next-solver/object-projection-with-unsatisfied-bound-1.next.stderr index a9a5bb42998aa..6d53f408410f5 100644 --- a/tests/ui/traits/next-solver/object-projection-with-unsatisfied-bound-1.next.stderr +++ b/tests/ui/traits/next-solver/object-projection-with-unsatisfied-bound-1.next.stderr @@ -1,13 +1,13 @@ -error[E0277]: the trait bound `(dyn Trait + 'static): Trait<::FooAssoc>` is not satisfied +error[E0277]: the trait bound `dyn Trait + 'static: Trait<::FooAssoc>` is not satisfied --> $DIR/object-projection-with-unsatisfied-bound-1.rs:18:25 | LL | pub struct Wrap( as Trait>::Assoc); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait<::FooAssoc>` is not implemented for `(dyn Trait + 'static)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Trait<::FooAssoc>` is not implemented for `dyn Trait + 'static` | help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement | -LL | pub struct Wrap( as Trait>::Assoc) where (dyn Trait + 'static): Trait<::FooAssoc>; - | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +LL | pub struct Wrap( as Trait>::Assoc) where dyn Trait + 'static: Trait<::FooAssoc>; + | ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ error: aborting due to 1 previous error diff --git a/tests/ui/traits/next-solver/object-projection-with-unsatisfied-bound-1.rs b/tests/ui/traits/next-solver/object-projection-with-unsatisfied-bound-1.rs index 95126bd20ce0d..23a21825d25e5 100644 --- a/tests/ui/traits/next-solver/object-projection-with-unsatisfied-bound-1.rs +++ b/tests/ui/traits/next-solver/object-projection-with-unsatisfied-bound-1.rs @@ -16,6 +16,6 @@ pub trait Foo { } pub struct Wrap( as Trait>::Assoc); -//~^ ERROR: the trait bound `(dyn Trait + 'static): Trait<::FooAssoc>` is not satisfied +//~^ ERROR: the trait bound `dyn Trait + 'static: Trait<::FooAssoc>` is not satisfied fn main() {} diff --git a/tests/ui/traits/next-solver/unsize-goal-mismatch-2.next.stderr b/tests/ui/traits/next-solver/unsize-goal-mismatch-2.next.stderr index b415db33addbf..b0fd30e23b877 100644 --- a/tests/ui/traits/next-solver/unsize-goal-mismatch-2.next.stderr +++ b/tests/ui/traits/next-solver/unsize-goal-mismatch-2.next.stderr @@ -6,7 +6,7 @@ LL | x | = note: cannot satisfy `dyn Trait<&()>: Unsize>` = note: required for `Box>` to implement `CoerceUnsized>>` - = note: required for the cast from `Box<(dyn Trait<&'a ()> + 'static)>` to `Box<(dyn Super<&'a ()> + 'static)>` + = note: required for the cast from `Box + 'static>` to `Box + 'static>` error: aborting due to 1 previous error diff --git a/tests/ui/traits/next-solver/unsize-goal-mismatch.next.stderr b/tests/ui/traits/next-solver/unsize-goal-mismatch.next.stderr index cfb978240cbc6..92dec28f12af8 100644 --- a/tests/ui/traits/next-solver/unsize-goal-mismatch.next.stderr +++ b/tests/ui/traits/next-solver/unsize-goal-mismatch.next.stderr @@ -6,7 +6,7 @@ LL | x | = note: cannot satisfy `dyn Trait<'_>: Unsize>` = note: required for `Box>` to implement `CoerceUnsized>>` - = note: required for the cast from `Box<(dyn Trait<'a> + 'static)>` to `Box<(dyn Super<'a> + 'static)>` + = note: required for the cast from `Box + 'static>` to `Box + 'static>` error: aborting due to 1 previous error diff --git a/tests/ui/traits/object/incomplete-multiple-super-projection.rs b/tests/ui/traits/object/incomplete-multiple-super-projection.rs index c7294eca4bdbe..3f6bc7e7d3c2d 100644 --- a/tests/ui/traits/object/incomplete-multiple-super-projection.rs +++ b/tests/ui/traits/object/incomplete-multiple-super-projection.rs @@ -18,7 +18,7 @@ impl Trait for dyn Dyn<(), ()> { type Assoc = &'static str; } impl Trait for dyn Dyn { -//~^ ERROR conflicting implementations of trait `Trait` for type `(dyn Dyn<(), ()> + 'static)` +//~^ ERROR conflicting implementations of trait `Trait` for type `dyn Dyn<(), ()> + 'static` type Assoc = usize; } diff --git a/tests/ui/traits/object/incomplete-multiple-super-projection.stderr b/tests/ui/traits/object/incomplete-multiple-super-projection.stderr index b4271f70ed055..f8575e660b6c5 100644 --- a/tests/ui/traits/object/incomplete-multiple-super-projection.stderr +++ b/tests/ui/traits/object/incomplete-multiple-super-projection.stderr @@ -1,11 +1,11 @@ -error[E0119]: conflicting implementations of trait `Trait` for type `(dyn Dyn<(), ()> + 'static)` +error[E0119]: conflicting implementations of trait `Trait` for type `dyn Dyn<(), ()> + 'static` --> $DIR/incomplete-multiple-super-projection.rs:20:1 | LL | impl Trait for dyn Dyn<(), ()> { | ------------------------------ first implementation here ... LL | impl Trait for dyn Dyn { - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Dyn<(), ()> + 'static)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `dyn Dyn<(), ()> + 'static` error: aborting due to 1 previous error diff --git a/tests/ui/traits/object/issue-33140-traitobject-crate.stderr b/tests/ui/traits/object/issue-33140-traitobject-crate.stderr index a01c7990db365..7fd2637f3bb61 100644 --- a/tests/ui/traits/object/issue-33140-traitobject-crate.stderr +++ b/tests/ui/traits/object/issue-33140-traitobject-crate.stderr @@ -1,28 +1,28 @@ -error[E0119]: conflicting implementations of trait `Trait` for type `(dyn Send + Sync + 'static)` +error[E0119]: conflicting implementations of trait `Trait` for type `dyn Send + Sync + 'static` --> $DIR/issue-33140-traitobject-crate.rs:83:1 | LL | unsafe impl Trait for dyn (::std::marker::Send) + Sync { } | ------------------------------------------------------ first implementation here LL | unsafe impl Trait for dyn (::std::marker::Send) + Send + Sync { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + Sync + 'static)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `dyn Send + Sync + 'static` -error[E0119]: conflicting implementations of trait `Trait` for type `(dyn Send + Sync + 'static)` +error[E0119]: conflicting implementations of trait `Trait` for type `dyn Send + Sync + 'static` --> $DIR/issue-33140-traitobject-crate.rs:85:1 | LL | unsafe impl Trait for dyn (::std::marker::Send) + Sync { } | ------------------------------------------------------ first implementation here ... LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + Sync + 'static)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `dyn Send + Sync + 'static` -error[E0119]: conflicting implementations of trait `Trait` for type `(dyn Send + Sync + 'static)` +error[E0119]: conflicting implementations of trait `Trait` for type `dyn Send + Sync + 'static` --> $DIR/issue-33140-traitobject-crate.rs:88:1 | LL | unsafe impl Trait for dyn (::std::marker::Send) + Sync { } | ------------------------------------------------------ first implementation here ... LL | unsafe impl Trait for dyn (::std::marker::Sync) + Send + Sync { } - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `(dyn Send + Sync + 'static)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `dyn Send + Sync + 'static` error: aborting due to 3 previous errors diff --git a/tests/ui/traits/opaque-trait-size-error-5883.stderr b/tests/ui/traits/opaque-trait-size-error-5883.stderr index 78de250b19a1e..df0ffc9e57da5 100644 --- a/tests/ui/traits/opaque-trait-size-error-5883.stderr +++ b/tests/ui/traits/opaque-trait-size-error-5883.stderr @@ -1,10 +1,10 @@ -error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn A + 'static` cannot be known at compilation time --> $DIR/opaque-trait-size-error-5883.rs:10:6 | LL | ) -> Struct { | ^^^^^^ doesn't have a size known at compile-time | - = help: within `Struct`, the trait `Sized` is not implemented for `(dyn A + 'static)` + = help: within `Struct`, the trait `Sized` is not implemented for `dyn A + 'static` note: required because it appears within the type `Struct` --> $DIR/opaque-trait-size-error-5883.rs:4:8 | @@ -12,13 +12,13 @@ LL | struct Struct { | ^^^^^^ = note: the return type of a function must have a statically known size -error[E0277]: the size for values of type `(dyn A + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn A + 'static` cannot be known at compilation time --> $DIR/opaque-trait-size-error-5883.rs:9:8 | LL | r: dyn A + 'static | ^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn A + 'static)` + = help: the trait `Sized` is not implemented for `dyn A + 'static` = help: unsized fn params are gated as an unstable feature help: you can use `impl Trait` as the argument type | diff --git a/tests/ui/traits/send-trait-objects-basic.rs b/tests/ui/traits/send-trait-objects-basic.rs index c999d4d0f6950..cbb51726803d5 100644 --- a/tests/ui/traits/send-trait-objects-basic.rs +++ b/tests/ui/traits/send-trait-objects-basic.rs @@ -17,7 +17,7 @@ fn test2<'a>() { fn test3<'a>() { assert_send_static::>(); - //~^ ERROR `(dyn Dummy + 'a)` cannot be sent between threads safely + //~^ ERROR `dyn Dummy + 'a` cannot be sent between threads safely } fn test4<'a>() { diff --git a/tests/ui/traits/send-trait-objects-basic.stderr b/tests/ui/traits/send-trait-objects-basic.stderr index 0393f7bc19df7..0674b4d9417c1 100644 --- a/tests/ui/traits/send-trait-objects-basic.stderr +++ b/tests/ui/traits/send-trait-objects-basic.stderr @@ -4,7 +4,7 @@ error[E0277]: `&'a (dyn Dummy + 'a)` cannot be sent between threads safely LL | assert_send_static::<&'a dyn Dummy>(); | ^^^^^^^^^^^^^ `&'a (dyn Dummy + 'a)` cannot be sent between threads safely | - = help: the trait `Sync` is not implemented for `(dyn Dummy + 'a)` + = help: the trait `Sync` is not implemented for `dyn Dummy + 'a` = note: required for `&'a (dyn Dummy + 'a)` to implement `Send` note: required by a bound in `assert_send_static` --> $DIR/send-trait-objects-basic.rs:3:26 @@ -12,15 +12,15 @@ note: required by a bound in `assert_send_static` LL | fn assert_send_static() {} | ^^^^ required by this bound in `assert_send_static` -error[E0277]: `(dyn Dummy + 'a)` cannot be sent between threads safely +error[E0277]: `dyn Dummy + 'a` cannot be sent between threads safely --> $DIR/send-trait-objects-basic.rs:19:26 | LL | assert_send_static::>(); - | ^^^^^^^^^^^^^^^^^^^ `(dyn Dummy + 'a)` cannot be sent between threads safely + | ^^^^^^^^^^^^^^^^^^^ `dyn Dummy + 'a` cannot be sent between threads safely | - = help: the trait `Send` is not implemented for `(dyn Dummy + 'a)` - = note: required for `std::ptr::Unique<(dyn Dummy + 'a)>` to implement `Send` -note: required because it appears within the type `Box<(dyn Dummy + 'a)>` + = help: the trait `Send` is not implemented for `dyn Dummy + 'a` + = note: required for `std::ptr::Unique` to implement `Send` +note: required because it appears within the type `Box` --> $SRC_DIR/alloc/src/boxed.rs:LL:COL note: required by a bound in `assert_send_static` --> $DIR/send-trait-objects-basic.rs:3:26 @@ -47,7 +47,7 @@ error[E0277]: `&'static (dyn Dummy + 'static)` cannot be sent between threads sa LL | assert_send::<&'static dyn Dummy>(); | ^^^^^^^^^^^^^^^^^^ `&'static (dyn Dummy + 'static)` cannot be sent between threads safely | - = help: the trait `Sync` is not implemented for `(dyn Dummy + 'static)` + = help: the trait `Sync` is not implemented for `dyn Dummy + 'static` = note: required for `&'static (dyn Dummy + 'static)` to implement `Send` note: required by a bound in `assert_send` --> $DIR/send-trait-objects-basic.rs:4:19 @@ -106,7 +106,7 @@ error[E0277]: `&'static (dyn Dummy + 'static)` cannot be sent between threads sa LL | assert_send::<&'static (dyn Dummy + 'static)>(); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `&'static (dyn Dummy + 'static)` cannot be sent between threads safely | - = help: the trait `Sync` is not implemented for `(dyn Dummy + 'static)` + = help: the trait `Sync` is not implemented for `dyn Dummy + 'static` = note: required for `&'static (dyn Dummy + 'static)` to implement `Send` note: required by a bound in `assert_send` --> $DIR/send-trait-objects-basic.rs:4:19 diff --git a/tests/ui/traits/trait-object-lifetime-default-note.rs b/tests/ui/traits/trait-object-lifetime-default-note.rs index 275411ff61c85..dbfb938e95a97 100644 --- a/tests/ui/traits/trait-object-lifetime-default-note.rs +++ b/tests/ui/traits/trait-object-lifetime-default-note.rs @@ -6,7 +6,7 @@ fn main() { let local = 0; //~ NOTE binding `local` declared here let r = &local; //~ ERROR `local` does not live long enough //~| NOTE borrowed value does not live long enough - //~| NOTE due to object lifetime defaults, `Box` actually means `Box<(dyn A + 'static)>` + //~| NOTE due to object lifetime defaults, `Box` actually means `Box` require_box(Box::new(r)); //~^ NOTE coercion requires that `local` is borrowed for `'static` diff --git a/tests/ui/traits/trait-object-lifetime-default-note.stderr b/tests/ui/traits/trait-object-lifetime-default-note.stderr index 8cb9bc0d80072..0901a6d6c13be 100644 --- a/tests/ui/traits/trait-object-lifetime-default-note.stderr +++ b/tests/ui/traits/trait-object-lifetime-default-note.stderr @@ -12,7 +12,7 @@ LL | require_box(Box::new(r)); LL | } | - `local` dropped here while still borrowed | - = note: due to object lifetime defaults, `Box` actually means `Box<(dyn A + 'static)>` + = note: due to object lifetime defaults, `Box` actually means `Box` error: aborting due to 1 previous error diff --git a/tests/ui/traits/trait-object-method-receiver-rules.stderr b/tests/ui/traits/trait-object-method-receiver-rules.stderr index 83b61a2e6b52e..7e37c31982c7e 100644 --- a/tests/ui/traits/trait-object-method-receiver-rules.stderr +++ b/tests/ui/traits/trait-object-method-receiver-rules.stderr @@ -21,11 +21,11 @@ LL | fn owned(self: Box); LL | x.owned(); | ^^^^^ method not found in `&mut dyn Foo` -error[E0599]: no method named `managed` found for struct `Box<(dyn Foo + 'static)>` in the current scope +error[E0599]: no method named `managed` found for struct `Box` in the current scope --> $DIR/trait-object-method-receiver-rules.rs:24:7 | LL | x.managed(); - | ^^^^^^^ method not found in `Box<(dyn Foo + 'static)>` + | ^^^^^^^ method not found in `Box` error: aborting due to 3 previous errors diff --git a/tests/ui/traits/unsize-goal-escaping-bounds.current.stderr b/tests/ui/traits/unsize-goal-escaping-bounds.current.stderr index d2d679243ee7c..b14f00cf66422 100644 --- a/tests/ui/traits/unsize-goal-escaping-bounds.current.stderr +++ b/tests/ui/traits/unsize-goal-escaping-bounds.current.stderr @@ -1,8 +1,8 @@ -error[E0277]: the trait bound `for<'a> (): Unsize<(dyn Trait + 'a)>` is not satisfied +error[E0277]: the trait bound `for<'a> (): Unsize` is not satisfied --> $DIR/unsize-goal-escaping-bounds.rs:20:5 | LL | foo(); - | ^^^^^ the nightly-only, unstable trait `for<'a> Unsize<(dyn Trait + 'a)>` is not implemented for `()` + | ^^^^^ the nightly-only, unstable trait `for<'a> Unsize` is not implemented for `()` | = note: all implementations of `Unsize` are provided automatically by the compiler, see for more information note: required by a bound in `foo` diff --git a/tests/ui/traits/unsize-goal-escaping-bounds.rs b/tests/ui/traits/unsize-goal-escaping-bounds.rs index fb25f7a423900..383ab29e81faa 100644 --- a/tests/ui/traits/unsize-goal-escaping-bounds.rs +++ b/tests/ui/traits/unsize-goal-escaping-bounds.rs @@ -18,5 +18,5 @@ where fn main() { foo(); - //[current]~^ ERROR the trait bound `for<'a> (): Unsize<(dyn Trait + 'a)>` is not satisfied + //[current]~^ ERROR the trait bound `for<'a> (): Unsize` is not satisfied } diff --git a/tests/ui/traits/well-formed-recursion-limit.stderr b/tests/ui/traits/well-formed-recursion-limit.stderr index a4c85c4fcbdf3..214d638dbe5fa 100644 --- a/tests/ui/traits/well-formed-recursion-limit.stderr +++ b/tests/ui/traits/well-formed-recursion-limit.stderr @@ -1,4 +1,4 @@ -error[E0609]: no field `ab` on type `(Box<(dyn Fn(Option) -> Option + 'static)>, Box<(dyn Fn(Option) -> Option + 'static)>)` +error[E0609]: no field `ab` on type `(Box) -> Option + 'static>, Box) -> Option + 'static>)` --> $DIR/well-formed-recursion-limit.rs:12:23 | LL | let (ab, ba) = (i.ab, i.ba); @@ -6,7 +6,7 @@ LL | let (ab, ba) = (i.ab, i.ba); | = note: available fields are: `0`, `1` -error[E0609]: no field `ba` on type `(Box<(dyn Fn(Option) -> Option + 'static)>, Box<(dyn Fn(Option) -> Option + 'static)>)` +error[E0609]: no field `ba` on type `(Box) -> Option + 'static>, Box) -> Option + 'static>)` --> $DIR/well-formed-recursion-limit.rs:12:29 | LL | let (ab, ba) = (i.ab, i.ba); diff --git a/tests/ui/trivial-bounds/trivial-bounds-inconsistent-sized.stderr b/tests/ui/trivial-bounds/trivial-bounds-inconsistent-sized.stderr index cf24d811c04e3..5272277f0253f 100644 --- a/tests/ui/trivial-bounds/trivial-bounds-inconsistent-sized.stderr +++ b/tests/ui/trivial-bounds/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<(dyn A + 'a)>: Sized does not depend on any type or lifetime parameters +warning: trait bound for<'a> T: Sized does not depend on any type or lifetime parameters --> $DIR/trivial-bounds-inconsistent-sized.rs:17:49 | LL | fn unsized_local() where for<'a> T: Sized { diff --git a/tests/ui/trivial-bounds/trivial-bounds-inconsistent.stderr b/tests/ui/trivial-bounds/trivial-bounds-inconsistent.stderr index e4107a4f4abea..02dccbf212d26 100644 --- a/tests/ui/trivial-bounds/trivial-bounds-inconsistent.stderr +++ b/tests/ui/trivial-bounds/trivial-bounds-inconsistent.stderr @@ -70,7 +70,7 @@ warning: trait bound str: Sized does not depend on any type or lifetime paramete LL | struct TwoStrs(str, str) where str: Sized; | ^^^^^ -warning: trait bound for<'a> Dst<(dyn A + 'a)>: Sized does not depend on any type or lifetime parameters +warning: trait bound for<'a> Dst: Sized does not depend on any type or lifetime parameters --> $DIR/trivial-bounds-inconsistent.rs:57:51 | LL | fn unsized_local() where for<'a> Dst: Sized { diff --git a/tests/ui/type-alias-impl-trait/issue-98604.stderr b/tests/ui/type-alias-impl-trait/issue-98604.stderr index 77c6ba3003f0d..dce9571edaf6c 100644 --- a/tests/ui/type-alias-impl-trait/issue-98604.stderr +++ b/tests/ui/type-alias-impl-trait/issue-98604.stderr @@ -4,7 +4,7 @@ error[E0271]: expected `test` to return `Pin>>`, but LL | Box::new(test) as AsyncFnPtr; | ^^^^^^^^^^^^^^ expected `Pin>>`, found future | - = note: required for the cast from `Box impl Future {test}>` to `Box<(dyn Fn() -> Pin + 'static)>> + 'static)>` + = note: required for the cast from `Box impl Future {test}>` to `Box Pin + 'static>> + 'static>` error: aborting due to 1 previous error diff --git a/tests/ui/type-alias/dyn-trait-type-alias-return-type.fixed b/tests/ui/type-alias/dyn-trait-type-alias-return-type.fixed index ba94e1967df39..6a857119cc60f 100644 --- a/tests/ui/type-alias/dyn-trait-type-alias-return-type.fixed +++ b/tests/ui/type-alias/dyn-trait-type-alias-return-type.fixed @@ -5,16 +5,16 @@ type T = dyn core::fmt::Debug; //~| NOTE this type alias is unsized fn f() -> Box { loop {} } -//~^ ERROR the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time -//~| HELP the trait `Sized` is not implemented for `(dyn Debug + 'static)` +//~^ ERROR the size for values of type `dyn Debug + 'static` cannot be known at compilation time +//~| HELP the trait `Sized` is not implemented for `dyn Debug + 'static` //~| NOTE doesn't have a size known at compile-time //~| NOTE the return type of a function must have a statically known size //~| HELP consider boxing the return type trait X { fn f(&self) -> Box { loop {} } - //~^ ERROR the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time - //~| HELP the trait `Sized` is not implemented for `(dyn Debug + 'static)` + //~^ ERROR the size for values of type `dyn Debug + 'static` cannot be known at compilation time + //~| HELP the trait `Sized` is not implemented for `dyn Debug + 'static` //~| NOTE doesn't have a size known at compile-time //~| NOTE the return type of a function must have a statically known size //~| HELP consider boxing the return type @@ -22,8 +22,8 @@ trait X { impl X for () { fn f(&self) -> Box { loop {} } - //~^ ERROR the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time - //~| HELP the trait `Sized` is not implemented for `(dyn Debug + 'static)` + //~^ ERROR the size for values of type `dyn Debug + 'static` cannot be known at compilation time + //~| HELP the trait `Sized` is not implemented for `dyn Debug + 'static` //~| NOTE doesn't have a size known at compile-time //~| NOTE the return type of a function must have a statically known size //~| HELP consider boxing the return type @@ -31,8 +31,8 @@ impl X for () { fn main() { f(); - //~^ ERROR the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time - //~| HELP the trait `Sized` is not implemented for `(dyn Debug + 'static)` + //~^ ERROR the size for values of type `dyn Debug + 'static` cannot be known at compilation time + //~| HELP the trait `Sized` is not implemented for `dyn Debug + 'static` //~| NOTE doesn't have a size known at compile-time //~| NOTE the return type of a function must have a statically known size ().f(); diff --git a/tests/ui/type-alias/dyn-trait-type-alias-return-type.rs b/tests/ui/type-alias/dyn-trait-type-alias-return-type.rs index 76f6e7c443424..918df9a46f1b1 100644 --- a/tests/ui/type-alias/dyn-trait-type-alias-return-type.rs +++ b/tests/ui/type-alias/dyn-trait-type-alias-return-type.rs @@ -5,16 +5,16 @@ type T = dyn core::fmt::Debug; //~| NOTE this type alias is unsized fn f() -> T { loop {} } -//~^ ERROR the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time -//~| HELP the trait `Sized` is not implemented for `(dyn Debug + 'static)` +//~^ ERROR the size for values of type `dyn Debug + 'static` cannot be known at compilation time +//~| HELP the trait `Sized` is not implemented for `dyn Debug + 'static` //~| NOTE doesn't have a size known at compile-time //~| NOTE the return type of a function must have a statically known size //~| HELP consider boxing the return type trait X { fn f(&self) -> T { loop {} } - //~^ ERROR the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time - //~| HELP the trait `Sized` is not implemented for `(dyn Debug + 'static)` + //~^ ERROR the size for values of type `dyn Debug + 'static` cannot be known at compilation time + //~| HELP the trait `Sized` is not implemented for `dyn Debug + 'static` //~| NOTE doesn't have a size known at compile-time //~| NOTE the return type of a function must have a statically known size //~| HELP consider boxing the return type @@ -22,8 +22,8 @@ trait X { impl X for () { fn f(&self) -> T { loop {} } - //~^ ERROR the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time - //~| HELP the trait `Sized` is not implemented for `(dyn Debug + 'static)` + //~^ ERROR the size for values of type `dyn Debug + 'static` cannot be known at compilation time + //~| HELP the trait `Sized` is not implemented for `dyn Debug + 'static` //~| NOTE doesn't have a size known at compile-time //~| NOTE the return type of a function must have a statically known size //~| HELP consider boxing the return type @@ -31,8 +31,8 @@ impl X for () { fn main() { f(); - //~^ ERROR the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time - //~| HELP the trait `Sized` is not implemented for `(dyn Debug + 'static)` + //~^ ERROR the size for values of type `dyn Debug + 'static` cannot be known at compilation time + //~| HELP the trait `Sized` is not implemented for `dyn Debug + 'static` //~| NOTE doesn't have a size known at compile-time //~| NOTE the return type of a function must have a statically known size ().f(); diff --git a/tests/ui/type-alias/dyn-trait-type-alias-return-type.stderr b/tests/ui/type-alias/dyn-trait-type-alias-return-type.stderr index bb6951687048f..2756818a71418 100644 --- a/tests/ui/type-alias/dyn-trait-type-alias-return-type.stderr +++ b/tests/ui/type-alias/dyn-trait-type-alias-return-type.stderr @@ -1,10 +1,10 @@ -error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Debug + 'static` cannot be known at compilation time --> $DIR/dyn-trait-type-alias-return-type.rs:7:11 | LL | fn f() -> T { loop {} } | ^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)` + = help: the trait `Sized` is not implemented for `dyn Debug + 'static` note: this type alias is unsized --> $DIR/dyn-trait-type-alias-return-type.rs:2:1 | @@ -16,13 +16,13 @@ help: consider boxing the return type, and wrapping all of the returned values i LL | fn f() -> Box { loop {} } | ++++ + -error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Debug + 'static` cannot be known at compilation time --> $DIR/dyn-trait-type-alias-return-type.rs:24:20 | LL | fn f(&self) -> T { loop {} } | ^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)` + = help: the trait `Sized` is not implemented for `dyn Debug + 'static` note: this type alias is unsized --> $DIR/dyn-trait-type-alias-return-type.rs:2:1 | @@ -34,13 +34,13 @@ help: consider boxing the return type, and wrapping all of the returned values i LL | fn f(&self) -> Box { loop {} } | ++++ + -error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Debug + 'static` cannot be known at compilation time --> $DIR/dyn-trait-type-alias-return-type.rs:15:20 | LL | fn f(&self) -> T { loop {} } | ^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)` + = help: the trait `Sized` is not implemented for `dyn Debug + 'static` note: this type alias is unsized --> $DIR/dyn-trait-type-alias-return-type.rs:2:1 | @@ -52,13 +52,13 @@ help: consider boxing the return type, and wrapping all of the returned values i LL | fn f(&self) -> Box { loop {} } | ++++ + -error[E0277]: the size for values of type `(dyn Debug + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Debug + 'static` cannot be known at compilation time --> $DIR/dyn-trait-type-alias-return-type.rs:33:5 | LL | f(); | ^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Debug + 'static)` + = help: the trait `Sized` is not implemented for `dyn Debug + 'static` = note: the return type of a function must have a statically known size error: aborting due to 4 previous errors diff --git a/tests/ui/typeck/issue-107775.stderr b/tests/ui/typeck/issue-107775.stderr index 1be2689746941..a743cf4554169 100644 --- a/tests/ui/typeck/issue-107775.stderr +++ b/tests/ui/typeck/issue-107775.stderr @@ -8,10 +8,10 @@ LL | map.insert(1, Struct::do_something); LL | Self { map } | ^^^ expected `HashMap Pin>>`, found `HashMap<{integer}, ...>` | - = note: expected struct `HashMap Pin + Send + 'static)>>>` + = note: expected struct `HashMap Pin + Send + 'static>>>` found struct `HashMap<{integer}, fn(_) -> Pin + Send>> {::do_something::<'_>}>` = note: fn items are distinct from fn pointers - = help: consider casting the fn item to a fn pointer: `::do_something::<'_> as fn(u8) -> Pin + Send + 'static)>>` + = help: consider casting the fn item to a fn pointer: `::do_something::<'_> as fn(u8) -> Pin + Send + 'static>>` error: aborting due to 1 previous error diff --git a/tests/ui/typeck/issue-13853-2.stderr b/tests/ui/typeck/issue-13853-2.stderr index af50e8da7f0c9..632719d9d4b27 100644 --- a/tests/ui/typeck/issue-13853-2.stderr +++ b/tests/ui/typeck/issue-13853-2.stderr @@ -1,4 +1,4 @@ -error[E0615]: attempted to take value of method `get` on type `Box<(dyn ResponseHook + 'static)>` +error[E0615]: attempted to take value of method `get` on type `Box` --> $DIR/issue-13853-2.rs:5:43 | LL | fn foo(res : Box) { res.get } diff --git a/tests/ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.stderr b/tests/ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.stderr index 3018388806294..6ee144a4da8a8 100644 --- a/tests/ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.stderr +++ b/tests/ui/typeck/issue-57673-ice-on-deref-of-boxed-trait.stderr @@ -2,12 +2,12 @@ error[E0308]: mismatched types --> $DIR/issue-57673-ice-on-deref-of-boxed-trait.rs:5:5 | LL | fn ice(x: Box>) { - | - help: try adding a return type: `-> (dyn Iterator + 'static)` + | - help: try adding a return type: `-> dyn Iterator + 'static` LL | *x | ^^ expected `()`, found `dyn Iterator` | = note: expected unit type `()` - found trait object `(dyn Iterator + 'static)` + found trait object `dyn Iterator + 'static` error: aborting due to 1 previous error diff --git a/tests/ui/typeck/return-dyn-type-mismatch-2.stderr b/tests/ui/typeck/return-dyn-type-mismatch-2.stderr index 77299621ab91e..a59028bce9a24 100644 --- a/tests/ui/typeck/return-dyn-type-mismatch-2.stderr +++ b/tests/ui/typeck/return-dyn-type-mismatch-2.stderr @@ -2,12 +2,12 @@ error[E0308]: mismatched types --> $DIR/return-dyn-type-mismatch-2.rs:7:5 | LL | fn foo() -> dyn Trait - | ------------ expected `(dyn Trait + 'static)` because of return type + | ------------ expected `dyn Trait + 'static` because of return type ... LL | 42 | ^^ expected `dyn Trait`, found integer | - = note: expected trait object `(dyn Trait + 'static)` + = note: expected trait object `dyn Trait + 'static` found type `{integer}` error: aborting due to 1 previous error diff --git a/tests/ui/typeck/return-dyn-type-mismatch.stderr b/tests/ui/typeck/return-dyn-type-mismatch.stderr index 064d0d64e0789..ef7e0256320b2 100644 --- a/tests/ui/typeck/return-dyn-type-mismatch.stderr +++ b/tests/ui/typeck/return-dyn-type-mismatch.stderr @@ -2,12 +2,12 @@ error[E0308]: mismatched types --> $DIR/return-dyn-type-mismatch.rs:15:21 | LL | fn other_func() -> dyn TestTrait { - | ------------------------- expected `(dyn TestTrait + 'static)` because of return type + | ------------------------- expected `dyn TestTrait + 'static` because of return type LL | match Self::func() { LL | None => None, | ^^^^ expected `dyn TestTrait`, found `Option<_>` | - = note: expected trait object `(dyn TestTrait + 'static)` + = note: expected trait object `dyn TestTrait + 'static` found enum `Option<_>` error: aborting due to 1 previous error diff --git a/tests/ui/typeck/unsized-rvalue-issue-41139.stderr b/tests/ui/typeck/unsized-rvalue-issue-41139.stderr index aba0423eeb3ec..df0d20d99b291 100644 --- a/tests/ui/typeck/unsized-rvalue-issue-41139.stderr +++ b/tests/ui/typeck/unsized-rvalue-issue-41139.stderr @@ -5,7 +5,7 @@ LL | fn get_function<'a>() -> &'a dyn Fn() -> dyn Trait { | -------------------------------------------------- `get_function` defined here returns `&dyn Fn() -> (dyn Trait + 'static)` ... LL | let t: &dyn Trait = &get_function()(); - | ^^^^^^^^^^^^^^ this trait object returns an unsized value `(dyn Trait + 'static)`, so it cannot be called + | ^^^^^^^^^^^^^^ this trait object returns an unsized value `dyn Trait + 'static`, so it cannot be called error: aborting due to 1 previous error diff --git a/tests/ui/unsafe-binders/discriminant-for-variant.rs b/tests/ui/unsafe-binders/discriminant-for-variant.rs index 6a2ef22e92628..d43991da1b0f7 100644 --- a/tests/ui/unsafe-binders/discriminant-for-variant.rs +++ b/tests/ui/unsafe-binders/discriminant-for-variant.rs @@ -1,8 +1,8 @@ #![feature(unsafe_binders)] const None: Option Option>> = None; -//~^ ERROR the trait bound `Box<(dyn Send + 'static)>: Copy` is not satisfied -//~| ERROR the trait bound `Box<(dyn Send + 'static)>: Copy` is not satisfied +//~^ ERROR the trait bound `Box: Copy` is not satisfied +//~| ERROR the trait bound `Box: Copy` is not satisfied fn main() { match None { diff --git a/tests/ui/unsafe-binders/discriminant-for-variant.stderr b/tests/ui/unsafe-binders/discriminant-for-variant.stderr index ed1a38ae14e40..3a2af3a650cab 100644 --- a/tests/ui/unsafe-binders/discriminant-for-variant.stderr +++ b/tests/ui/unsafe-binders/discriminant-for-variant.stderr @@ -1,18 +1,18 @@ -error[E0277]: the trait bound `Box<(dyn Send + 'static)>: Copy` is not satisfied +error[E0277]: the trait bound `Box: Copy` is not satisfied --> $DIR/discriminant-for-variant.rs:3:13 | LL | const None: Option Option>> = None; - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `Box<(dyn Send + 'static)>` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Copy` is not implemented for `Box` | - = note: required for `Option>` to implement `Copy` + = note: required for `Option>` to implement `Copy` -error[E0277]: the trait bound `Box<(dyn Send + 'static)>: Copy` is not satisfied +error[E0277]: the trait bound `Box: Copy` is not satisfied --> $DIR/discriminant-for-variant.rs:3:54 | LL | const None: Option Option>> = None; - | ^^^^ the trait `Copy` is not implemented for `Box<(dyn Send + 'static)>` + | ^^^^ the trait `Copy` is not implemented for `Box` | - = note: required for `Option>` to implement `Copy` + = note: required for `Option>` to implement `Copy` error: aborting due to 2 previous errors diff --git a/tests/ui/unsized/issue-91801.stderr b/tests/ui/unsized/issue-91801.stderr index 192cdc767dd90..b2b8a1468dd4e 100644 --- a/tests/ui/unsized/issue-91801.stderr +++ b/tests/ui/unsized/issue-91801.stderr @@ -1,10 +1,10 @@ -error[E0277]: the size for values of type `(dyn Fn(&'a Something) -> Result<(), ()> + Send + Sync + 'a)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Fn(&'a Something) -> Result<(), ()> + Send + Sync + 'a` cannot be known at compilation time --> $DIR/issue-91801.rs:8:77 | LL | fn or<'a>(first: &'static Validator<'a>, second: &'static Validator<'a>) -> Validator<'a> { | ^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Fn(&'a Something) -> Result<(), ()> + Send + Sync + 'a)` + = help: the trait `Sized` is not implemented for `dyn Fn(&'a Something) -> Result<(), ()> + Send + Sync + 'a` note: this type alias is unsized --> $DIR/issue-91801.rs:3:1 | diff --git a/tests/ui/unsized/unsized-enum2.stderr b/tests/ui/unsized/unsized-enum2.stderr index 71cf782120e57..3e49ab024d90a 100644 --- a/tests/ui/unsized/unsized-enum2.stderr +++ b/tests/ui/unsized/unsized-enum2.stderr @@ -170,13 +170,13 @@ help: the `Box` type always has a statically known size and allocates its conten LL | VH{u: isize, x: Box<[u32]>}, | ++++ + -error[E0277]: the size for values of type `(dyn Foo + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Foo + 'static` cannot be known at compilation time --> $DIR/unsized-enum2.rs:53:8 | LL | VM(dyn Foo), | ^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Foo + 'static)` + = help: the trait `Sized` is not implemented for `dyn Foo + 'static` = note: no field of an enum variant may have a dynamically sized type = help: change the field's type to have a statically known size help: borrowed types always have a statically known size @@ -188,13 +188,13 @@ help: the `Box` type always has a statically known size and allocates its conten LL | VM(Box), | ++++ + -error[E0277]: the size for values of type `(dyn Bar + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Bar + 'static` cannot be known at compilation time --> $DIR/unsized-enum2.rs:55:11 | LL | VN{x: dyn Bar}, | ^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Bar + 'static)` + = help: the trait `Sized` is not implemented for `dyn Bar + 'static` = note: no field of an enum variant may have a dynamically sized type = help: change the field's type to have a statically known size help: borrowed types always have a statically known size @@ -206,13 +206,13 @@ help: the `Box` type always has a statically known size and allocates its conten LL | VN{x: Box}, | ++++ + -error[E0277]: the size for values of type `(dyn FooBar + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn FooBar + 'static` cannot be known at compilation time --> $DIR/unsized-enum2.rs:57:15 | LL | VO(isize, dyn FooBar), | ^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn FooBar + 'static)` + = help: the trait `Sized` is not implemented for `dyn FooBar + 'static` = note: no field of an enum variant may have a dynamically sized type = help: change the field's type to have a statically known size help: borrowed types always have a statically known size @@ -224,13 +224,13 @@ help: the `Box` type always has a statically known size and allocates its conten LL | VO(isize, Box), | ++++ + -error[E0277]: the size for values of type `(dyn BarFoo + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn BarFoo + 'static` cannot be known at compilation time --> $DIR/unsized-enum2.rs:59:21 | LL | VP{u: isize, x: dyn BarFoo}, | ^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn BarFoo + 'static)` + = help: the trait `Sized` is not implemented for `dyn BarFoo + 'static` = note: no field of an enum variant may have a dynamically sized type = help: change the field's type to have a statically known size help: borrowed types always have a statically known size @@ -314,13 +314,13 @@ help: the `Box` type always has a statically known size and allocates its conten LL | VT{u: isize, x: Box<<&'static [i32] as Deref>::Target>}, | ++++ + -error[E0277]: the size for values of type `(dyn PathHelper1 + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn PathHelper1 + 'static` cannot be known at compilation time --> $DIR/unsized-enum2.rs:43:8 | LL | VI(Path1), | ^^^^^ doesn't have a size known at compile-time | - = help: within `Path1`, the trait `Sized` is not implemented for `(dyn PathHelper1 + 'static)` + = help: within `Path1`, the trait `Sized` is not implemented for `dyn PathHelper1 + 'static` note: required because it appears within the type `Path1` --> $DIR/unsized-enum2.rs:16:8 | @@ -337,13 +337,13 @@ help: the `Box` type always has a statically known size and allocates its conten LL | VI(Box), | ++++ + -error[E0277]: the size for values of type `(dyn PathHelper2 + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn PathHelper2 + 'static` cannot be known at compilation time --> $DIR/unsized-enum2.rs:45:11 | LL | VJ{x: Path2}, | ^^^^^ doesn't have a size known at compile-time | - = help: within `Path2`, the trait `Sized` is not implemented for `(dyn PathHelper2 + 'static)` + = help: within `Path2`, the trait `Sized` is not implemented for `dyn PathHelper2 + 'static` note: required because it appears within the type `Path2` --> $DIR/unsized-enum2.rs:17:8 | @@ -360,13 +360,13 @@ help: the `Box` type always has a statically known size and allocates its conten LL | VJ{x: Box}, | ++++ + -error[E0277]: the size for values of type `(dyn PathHelper3 + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn PathHelper3 + 'static` cannot be known at compilation time --> $DIR/unsized-enum2.rs:47:15 | LL | VK(isize, Path3), | ^^^^^ doesn't have a size known at compile-time | - = help: within `Path3`, the trait `Sized` is not implemented for `(dyn PathHelper3 + 'static)` + = help: within `Path3`, the trait `Sized` is not implemented for `dyn PathHelper3 + 'static` note: required because it appears within the type `Path3` --> $DIR/unsized-enum2.rs:18:8 | @@ -383,13 +383,13 @@ help: the `Box` type always has a statically known size and allocates its conten LL | VK(isize, Box), | ++++ + -error[E0277]: the size for values of type `(dyn PathHelper4 + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn PathHelper4 + 'static` cannot be known at compilation time --> $DIR/unsized-enum2.rs:49:21 | LL | VL{u: isize, x: Path4}, | ^^^^^ doesn't have a size known at compile-time | - = help: within `Path4`, the trait `Sized` is not implemented for `(dyn PathHelper4 + 'static)` + = help: within `Path4`, the trait `Sized` is not implemented for `dyn PathHelper4 + 'static` note: required because it appears within the type `Path4` --> $DIR/unsized-enum2.rs:19:8 | diff --git a/tests/ui/wf/hir-wf-canonicalized.rs b/tests/ui/wf/hir-wf-canonicalized.rs index abdcd1c04ab2a..b8fc8a0d03c1d 100644 --- a/tests/ui/wf/hir-wf-canonicalized.rs +++ b/tests/ui/wf/hir-wf-canonicalized.rs @@ -9,8 +9,8 @@ trait Callback: Fn(&Bar<'_, T>, &T::V) {} struct Bar<'a, T> { callback: Box>>>, //~^ ERROR the trait bound `Bar<'a, T>: Foo` is not satisfied - //~| ERROR the trait bound `(dyn Callback, Output = ()> + 'static): Foo` is not satisfied - //~| ERROR the size for values of type `(dyn Callback, Output = ()> + 'static)` cannot be known at compilation time + //~| ERROR the trait bound `dyn Callback, Output = ()> + 'static: Foo` is not satisfied + //~| ERROR the size for values of type `dyn Callback, Output = ()> + 'static` cannot be known at compilation time } impl Bar<'_, Bar<'_, T>> {} diff --git a/tests/ui/wf/hir-wf-canonicalized.stderr b/tests/ui/wf/hir-wf-canonicalized.stderr index 51db0e39de084..4646d3af08cbc 100644 --- a/tests/ui/wf/hir-wf-canonicalized.stderr +++ b/tests/ui/wf/hir-wf-canonicalized.stderr @@ -15,11 +15,11 @@ help: this trait has no implementations, consider adding one LL | trait Foo { | ^^^^^^^^^ -error[E0277]: the trait bound `(dyn Callback, Output = ()> + 'static): Foo` is not satisfied +error[E0277]: the trait bound `dyn Callback, Output = ()> + 'static: Foo` is not satisfied --> $DIR/hir-wf-canonicalized.rs:10:15 | LL | callback: Box>>>, - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `(dyn Callback, Output = ()> + 'static)` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Foo` is not implemented for `dyn Callback, Output = ()> + 'static` | help: this trait has no implementations, consider adding one --> $DIR/hir-wf-canonicalized.rs:3:1 @@ -27,13 +27,13 @@ help: this trait has no implementations, consider adding one LL | trait Foo { | ^^^^^^^^^ -error[E0277]: the size for values of type `(dyn Callback, Output = ()> + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Callback, Output = ()> + 'static` cannot be known at compilation time --> $DIR/hir-wf-canonicalized.rs:10:15 | LL | callback: Box>>>, | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Callback, Output = ()> + 'static)` + = help: the trait `Sized` is not implemented for `dyn Callback, Output = ()> + 'static` note: required by an implicit `Sized` bound in `Bar` --> $DIR/hir-wf-canonicalized.rs:9:16 | diff --git a/tests/ui/wf/wf-fn-where-clause.stderr b/tests/ui/wf/wf-fn-where-clause.stderr index b419bc8347fb2..c381bc7f178b5 100644 --- a/tests/ui/wf/wf-fn-where-clause.stderr +++ b/tests/ui/wf/wf-fn-where-clause.stderr @@ -24,13 +24,13 @@ LL | fn bar() where Vec:, {} = note: for a trait to be dyn compatible it needs to allow building a vtable for more information, visit -error[E0277]: the size for values of type `(dyn Copy + 'static)` cannot be known at compilation time +error[E0277]: the size for values of type `dyn Copy + 'static` cannot be known at compilation time --> $DIR/wf-fn-where-clause.rs:12:16 | LL | fn bar() where Vec:, {} | ^^^^^^^^^^^^^ doesn't have a size known at compile-time | - = help: the trait `Sized` is not implemented for `(dyn Copy + 'static)` + = help: the trait `Sized` is not implemented for `dyn Copy + 'static` note: required by an implicit `Sized` bound in `Vec` --> $DIR/wf-fn-where-clause.rs:16:12 |