From 246f239d9f40f633160f0c18f87a20922d4e77bb Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:06:37 +0200 Subject: Merging debian version 1.65.0+dfsg1-2. Signed-off-by: Daniel Baumann --- src/test/ui/traits/alias/cross-crate.stderr | 4 +- src/test/ui/traits/alias/generic-default-in-dyn.rs | 10 ++ .../ui/traits/alias/generic-default-in-dyn.stderr | 39 ++++++++ src/test/ui/traits/alias/self-in-const-generics.rs | 12 +++ .../ui/traits/alias/self-in-const-generics.stderr | 11 +++ src/test/ui/traits/alias/self-in-generics.rs | 15 +++ src/test/ui/traits/alias/self-in-generics.stderr | 11 +++ src/test/ui/traits/assoc-type-in-superbad.rs | 8 +- src/test/ui/traits/assoc-type-in-superbad.stderr | 6 +- .../check-trait-object-bounds-1.stderr | 4 +- .../check-trait-object-bounds-2.stderr | 4 +- .../check-trait-object-bounds-4.stderr | 4 +- .../check-trait-object-bounds-5.stderr | 6 +- .../check-trait-object-bounds-6.stderr | 6 +- src/test/ui/traits/bad-method-typaram-kind.stderr | 4 +- .../traits/bound/assoc-fn-bound-root-obligation.rs | 3 +- .../bound/assoc-fn-bound-root-obligation.stderr | 8 +- src/test/ui/traits/bound/not-on-bare-trait.stderr | 5 +- .../ui/traits/bound/on-structs-and-enums-locals.rs | 2 +- .../bound/on-structs-and-enums-locals.stderr | 6 +- .../ui/traits/bound/on-structs-and-enums-xc1.rs | 2 +- .../traits/bound/on-structs-and-enums-xc1.stderr | 6 +- src/test/ui/traits/cycle-cache-err-60010.stderr | 4 +- src/test/ui/traits/inductive-overflow/lifetime.rs | 2 +- .../ui/traits/inductive-overflow/lifetime.stderr | 4 +- .../traits/inductive-overflow/simultaneous.stderr | 2 +- .../supertrait-auto-trait.stderr | 2 +- .../ui/traits/inductive-overflow/supertrait.stderr | 2 +- .../inheritance/repeated-supertrait-ambig.stderr | 30 ++++-- src/test/ui/traits/issue-18400.stderr | 4 +- src/test/ui/traits/issue-20692.stderr | 2 +- src/test/ui/traits/issue-38604.stderr | 2 +- src/test/ui/traits/issue-71036.rs | 2 +- src/test/ui/traits/issue-71036.stderr | 2 +- src/test/ui/traits/issue-71136.stderr | 2 +- src/test/ui/traits/issue-77982.stderr | 8 +- src/test/ui/traits/issue-82830.stderr | 2 +- src/test/ui/traits/issue-91594.stderr | 6 +- .../traits/issue-91949-hangs-on-recursion.stderr | 4 +- src/test/ui/traits/issue-97576.stderr | 8 +- src/test/ui/traits/multidispatch-bad.stderr | 2 +- .../traits/multidispatch-convert-ambig-dest.stderr | 10 +- .../explicitly-unimplemented-error-message.rs | 2 +- .../negated-auto-traits-error.stderr | 8 +- ...uggest-non-existing-fully-qualified-path.stderr | 2 +- .../object/enforce-supertrait-projection.stderr | 4 +- src/test/ui/traits/object/safety.stderr | 2 +- .../traits/pointee-tail-is-generic-errors.stderr | 8 +- .../ui/traits/resolution-in-overloaded-op.stderr | 4 +- .../traits/suggest-deferences/issue-39029.stderr | 12 ++- .../traits/suggest-deferences/issue-62530.stderr | 10 +- .../ui/traits/suggest-deferences/multiple-0.stderr | 10 +- .../suggest-deferences/root-obligation.stderr | 4 +- src/test/ui/traits/suggest-where-clause.stderr | 4 +- src/test/ui/traits/test-2.stderr | 2 +- .../traits/trait-upcasting/subtrait-method.stderr | 10 +- .../ui/traits/unspecified-self-in-trait-ref.rs | 30 ++++++ .../ui/traits/unspecified-self-in-trait-ref.stderr | 105 +++++++++++++++++++++ 58 files changed, 374 insertions(+), 119 deletions(-) create mode 100644 src/test/ui/traits/alias/generic-default-in-dyn.rs create mode 100644 src/test/ui/traits/alias/generic-default-in-dyn.stderr create mode 100644 src/test/ui/traits/alias/self-in-const-generics.rs create mode 100644 src/test/ui/traits/alias/self-in-const-generics.stderr create mode 100644 src/test/ui/traits/alias/self-in-generics.rs create mode 100644 src/test/ui/traits/alias/self-in-generics.stderr create mode 100644 src/test/ui/traits/unspecified-self-in-trait-ref.rs create mode 100644 src/test/ui/traits/unspecified-self-in-trait-ref.stderr (limited to 'src/test/ui/traits') diff --git a/src/test/ui/traits/alias/cross-crate.stderr b/src/test/ui/traits/alias/cross-crate.stderr index d0d00c97e..ae9d7d0a9 100644 --- a/src/test/ui/traits/alias/cross-crate.stderr +++ b/src/test/ui/traits/alias/cross-crate.stderr @@ -5,7 +5,7 @@ LL | use_alias::>(); | ^^^^^^^ `Rc` cannot be sent between threads safely | = help: the trait `Send` is not implemented for `Rc` - = note: required because of the requirements on the impl of `SendSync` for `Rc` + = note: required for `Rc` to implement `SendSync` note: required by a bound in `use_alias` --> $DIR/cross-crate.rs:10:17 | @@ -19,7 +19,7 @@ LL | use_alias::>(); | ^^^^^^^ `Rc` cannot be shared between threads safely | = help: the trait `Sync` is not implemented for `Rc` - = note: required because of the requirements on the impl of `SendSync` for `Rc` + = note: required for `Rc` to implement `SendSync` note: required by a bound in `use_alias` --> $DIR/cross-crate.rs:10:17 | diff --git a/src/test/ui/traits/alias/generic-default-in-dyn.rs b/src/test/ui/traits/alias/generic-default-in-dyn.rs new file mode 100644 index 000000000..d44e1c2a9 --- /dev/null +++ b/src/test/ui/traits/alias/generic-default-in-dyn.rs @@ -0,0 +1,10 @@ +trait SendEqAlias = PartialEq; +//~^ ERROR trait aliases are experimental + +struct Foo(dyn SendEqAlias); +//~^ ERROR the type parameter `Rhs` must be explicitly specified [E0393] + +struct Bar(dyn SendEqAlias, T); +//~^ ERROR the type parameter `Rhs` must be explicitly specified [E0393] + +fn main() {} diff --git a/src/test/ui/traits/alias/generic-default-in-dyn.stderr b/src/test/ui/traits/alias/generic-default-in-dyn.stderr new file mode 100644 index 000000000..76a068e86 --- /dev/null +++ b/src/test/ui/traits/alias/generic-default-in-dyn.stderr @@ -0,0 +1,39 @@ +error[E0658]: trait aliases are experimental + --> $DIR/generic-default-in-dyn.rs:1:1 + | +LL | trait SendEqAlias = PartialEq; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: see issue #41517 for more information + = help: add `#![feature(trait_alias)]` to the crate attributes to enable + +error[E0393]: the type parameter `Rhs` must be explicitly specified + --> $DIR/generic-default-in-dyn.rs:4:19 + | +LL | struct Foo(dyn SendEqAlias); + | ^^^^^^^^^^^^^^ missing reference to `Rhs` + | + ::: $SRC_DIR/core/src/cmp.rs:LL:COL + | +LL | pub trait PartialEq { + | --------------------------------------- type parameter `Rhs` must be specified for this + | + = note: because of the default `Self` reference, type parameters must be specified on object types + +error[E0393]: the type parameter `Rhs` must be explicitly specified + --> $DIR/generic-default-in-dyn.rs:7:19 + | +LL | struct Bar(dyn SendEqAlias, T); + | ^^^^^^^^^^^^^^ missing reference to `Rhs` + | + ::: $SRC_DIR/core/src/cmp.rs:LL:COL + | +LL | pub trait PartialEq { + | --------------------------------------- type parameter `Rhs` must be specified for this + | + = note: because of the default `Self` reference, type parameters must be specified on object types + +error: aborting due to 3 previous errors + +Some errors have detailed explanations: E0393, E0658. +For more information about an error, try `rustc --explain E0393`. diff --git a/src/test/ui/traits/alias/self-in-const-generics.rs b/src/test/ui/traits/alias/self-in-const-generics.rs new file mode 100644 index 000000000..b0de8ccd6 --- /dev/null +++ b/src/test/ui/traits/alias/self-in-const-generics.rs @@ -0,0 +1,12 @@ +#![allow(incomplete_features)] +#![feature(generic_const_exprs)] +#![feature(trait_alias)] + +trait Bar {} + +trait BB = Bar<{ 2 + 1 }>; + +fn foo(x: &dyn BB) {} +//~^ ERROR the trait alias `BB` cannot be made into an object [E0038] + +fn main() {} diff --git a/src/test/ui/traits/alias/self-in-const-generics.stderr b/src/test/ui/traits/alias/self-in-const-generics.stderr new file mode 100644 index 000000000..61cc217cf --- /dev/null +++ b/src/test/ui/traits/alias/self-in-const-generics.stderr @@ -0,0 +1,11 @@ +error[E0038]: the trait alias `BB` cannot be made into an object + --> $DIR/self-in-const-generics.rs:9:16 + | +LL | fn foo(x: &dyn BB) {} + | ^^ + | + = note: it cannot use `Self` as a type parameter in a supertrait or `where`-clause + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0038`. diff --git a/src/test/ui/traits/alias/self-in-generics.rs b/src/test/ui/traits/alias/self-in-generics.rs new file mode 100644 index 000000000..0bb6335f9 --- /dev/null +++ b/src/test/ui/traits/alias/self-in-generics.rs @@ -0,0 +1,15 @@ +// astconv uses `FreshTy(0)` as a dummy `Self` type when instanciating trait objects. +// This `FreshTy(0)` can leak into substs, causing ICEs in several places. +// Using `save-analysis` triggers type-checking `f` that would be normally skipped +// as `type_of` emitted an error. +// +// compile-flags: -Zsave-analysis + +#![feature(trait_alias)] + +pub trait SelfInput = Fn(&mut Self); + +pub fn f(_f: &dyn SelfInput) {} +//~^ ERROR the trait alias `SelfInput` cannot be made into an object [E0038] + +fn main() {} diff --git a/src/test/ui/traits/alias/self-in-generics.stderr b/src/test/ui/traits/alias/self-in-generics.stderr new file mode 100644 index 000000000..110d60e6e --- /dev/null +++ b/src/test/ui/traits/alias/self-in-generics.stderr @@ -0,0 +1,11 @@ +error[E0038]: the trait alias `SelfInput` cannot be made into an object + --> $DIR/self-in-generics.rs:12:19 + | +LL | pub fn f(_f: &dyn SelfInput) {} + | ^^^^^^^^^ + | + = note: it cannot use `Self` as a type parameter in a supertrait or `where`-clause + +error: aborting due to previous error + +For more information about this error, try `rustc --explain E0038`. diff --git a/src/test/ui/traits/assoc-type-in-superbad.rs b/src/test/ui/traits/assoc-type-in-superbad.rs index 579ce7cf7..d7d6241ef 100644 --- a/src/test/ui/traits/assoc-type-in-superbad.rs +++ b/src/test/ui/traits/assoc-type-in-superbad.rs @@ -4,13 +4,13 @@ use std::vec::IntoIter; -pub trait Foo: Iterator::Key> { +pub trait Foo: Iterator::Key> { type Key; } impl Foo for IntoIter { - type Key = u32; //~ ERROR type mismatch + type Key = u32; + //~^ ERROR expected `std::vec::IntoIter` to be an iterator that yields `u32`, but it yields `i32` } -fn main() { -} +fn main() {} diff --git a/src/test/ui/traits/assoc-type-in-superbad.stderr b/src/test/ui/traits/assoc-type-in-superbad.stderr index f36947914..3e2d9d903 100644 --- a/src/test/ui/traits/assoc-type-in-superbad.stderr +++ b/src/test/ui/traits/assoc-type-in-superbad.stderr @@ -1,4 +1,4 @@ -error[E0271]: type mismatch resolving ` as Iterator>::Item == u32` +error[E0271]: expected `std::vec::IntoIter` to be an iterator that yields `u32`, but it yields `i32` --> $DIR/assoc-type-in-superbad.rs:12:16 | LL | type Key = u32; @@ -7,8 +7,8 @@ LL | type Key = u32; note: required by a bound in `Foo` --> $DIR/assoc-type-in-superbad.rs:7:25 | -LL | pub trait Foo: Iterator::Key> { - | ^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Foo` +LL | pub trait Foo: Iterator::Key> { + | ^^^^^^^^^^^^^^^^^^^^^^^^^ required by this bound in `Foo` error: aborting due to previous error diff --git a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.stderr b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.stderr index bfbbe7fd2..fa7a8a2a0 100644 --- a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.stderr +++ b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-1.stderr @@ -1,8 +1,8 @@ error[E0277]: the trait bound `str: Clone` is not satisfied - --> $DIR/check-trait-object-bounds-1.rs:12:5 + --> $DIR/check-trait-object-bounds-1.rs:12:9 | LL | f::>(); - | ^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `str` + | ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `str` | = help: the trait `Clone` is implemented for `String` note: required by a bound in `f` diff --git a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr index 46e8ce788..4084f69a6 100644 --- a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr +++ b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-2.stderr @@ -1,8 +1,8 @@ error[E0277]: expected a `FnOnce<(&i32,)>` closure, found `i32` - --> $DIR/check-trait-object-bounds-2.rs:13:5 + --> $DIR/check-trait-object-bounds-2.rs:13:9 | LL | f:: X<'x, F = i32>>(); - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnOnce<(&i32,)>` closure, found `i32` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^ expected an `FnOnce<(&i32,)>` closure, found `i32` | = help: the trait `for<'r> FnOnce<(&'r i32,)>` is not implemented for `i32` note: required by a bound in `f` diff --git a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-4.stderr b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-4.stderr index 3ca36d5d2..4891ee9c2 100644 --- a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-4.stderr +++ b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-4.stderr @@ -1,8 +1,8 @@ error[E0277]: the trait bound `str: Clone` is not satisfied - --> $DIR/check-trait-object-bounds-4.rs:15:5 + --> $DIR/check-trait-object-bounds-4.rs:15:9 | LL | f::>(); - | ^^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `str` + | ^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `str` | = help: the trait `Clone` is implemented for `String` note: required by a bound in `f` diff --git a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-5.stderr b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-5.stderr index 4251c1a1e..00fdb3753 100644 --- a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-5.stderr +++ b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-5.stderr @@ -1,8 +1,10 @@ error[E0271]: type mismatch resolving `::T == i64` - --> $DIR/check-trait-object-bounds-5.rs:23:5 + --> $DIR/check-trait-object-bounds-5.rs:23:12 | LL | is_obj(x) - | ^^^^^^ type mismatch resolving `::T == i64` + | ------ ^ type mismatch resolving `::T == i64` + | | + | required by a bound introduced by this call | note: expected this to be `i64` --> $DIR/check-trait-object-bounds-5.rs:9:14 diff --git a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-6.stderr b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-6.stderr index 5b23a513e..9b0975e5e 100644 --- a/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-6.stderr +++ b/src/test/ui/traits/associated_type_bound/check-trait-object-bounds-6.stderr @@ -1,8 +1,10 @@ error[E0271]: type mismatch resolving `::T == i64` - --> $DIR/check-trait-object-bounds-6.rs:20:5 + --> $DIR/check-trait-object-bounds-6.rs:20:12 | LL | is_obj(x) - | ^^^^^^ type mismatch resolving `::T == i64` + | ------ ^ type mismatch resolving `::T == i64` + | | + | required by a bound introduced by this call | note: expected this to be `i64` --> $DIR/check-trait-object-bounds-6.rs:9:14 diff --git a/src/test/ui/traits/bad-method-typaram-kind.stderr b/src/test/ui/traits/bad-method-typaram-kind.stderr index 8befa4c5f..56acfbe80 100644 --- a/src/test/ui/traits/bad-method-typaram-kind.stderr +++ b/src/test/ui/traits/bad-method-typaram-kind.stderr @@ -1,8 +1,8 @@ error[E0277]: `T` cannot be sent between threads safely - --> $DIR/bad-method-typaram-kind.rs:2:7 + --> $DIR/bad-method-typaram-kind.rs:2:13 | LL | 1.bar::(); - | ^^^ `T` cannot be sent between threads safely + | ^ `T` cannot be sent between threads safely | note: required by a bound in `Bar::bar` --> $DIR/bad-method-typaram-kind.rs:6:14 diff --git a/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.rs b/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.rs index 1d2345180..f9a934764 100644 --- a/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.rs +++ b/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.rs @@ -2,10 +2,9 @@ fn strip_lf(s: &str) -> &str { s.strip_suffix(b'\n').unwrap_or(s) //~^ ERROR expected a `FnMut<(char,)>` closure, found `u8` //~| NOTE expected an `FnMut<(char,)>` closure, found `u8` - //~| NOTE required by a bound introduced by this call //~| HELP the trait `FnMut<(char,)>` is not implemented for `u8` //~| HELP the following other types implement trait `Pattern<'a>`: - //~| NOTE required because of the requirements on the impl of `Pattern<'_>` for `u8` + //~| NOTE required for `u8` to implement `Pattern<'_>` } diff --git a/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.stderr b/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.stderr index 6ce57b626..ce9ab2d81 100644 --- a/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.stderr +++ b/src/test/ui/traits/bound/assoc-fn-bound-root-obligation.stderr @@ -1,10 +1,8 @@ error[E0277]: expected a `FnMut<(char,)>` closure, found `u8` - --> $DIR/assoc-fn-bound-root-obligation.rs:2:20 + --> $DIR/assoc-fn-bound-root-obligation.rs:2:7 | LL | s.strip_suffix(b'\n').unwrap_or(s) - | ------------ ^^^^^ expected an `FnMut<(char,)>` closure, found `u8` - | | - | required by a bound introduced by this call + | ^^^^^^^^^^^^ expected an `FnMut<(char,)>` closure, found `u8` | = help: the trait `FnMut<(char,)>` is not implemented for `u8` = help: the following other types implement trait `Pattern<'a>`: @@ -15,7 +13,7 @@ LL | s.strip_suffix(b'\n').unwrap_or(s) &'c &'b str [char; N] char - = note: required because of the requirements on the impl of `Pattern<'_>` for `u8` + = note: required for `u8` to implement `Pattern<'_>` error: aborting due to previous error diff --git a/src/test/ui/traits/bound/not-on-bare-trait.stderr b/src/test/ui/traits/bound/not-on-bare-trait.stderr index 8a92dd118..1c52629da 100644 --- a/src/test/ui/traits/bound/not-on-bare-trait.stderr +++ b/src/test/ui/traits/bound/not-on-bare-trait.stderr @@ -9,9 +9,8 @@ LL | fn foo(_x: Foo + Send) { = note: for more information, see help: use `dyn` | -LL - fn foo(_x: Foo + Send) { -LL + fn foo(_x: dyn Foo + Send) { - | +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 --> $DIR/not-on-bare-trait.rs:7:8 diff --git a/src/test/ui/traits/bound/on-structs-and-enums-locals.rs b/src/test/ui/traits/bound/on-structs-and-enums-locals.rs index 21c0ce80f..60ba343bb 100644 --- a/src/test/ui/traits/bound/on-structs-and-enums-locals.rs +++ b/src/test/ui/traits/bound/on-structs-and-enums-locals.rs @@ -8,8 +8,8 @@ struct Foo { fn main() { let foo = Foo { - //~^ ERROR E0277 x: 3 + //~^ ERROR E0277 }; let baz: Foo = loop { }; diff --git a/src/test/ui/traits/bound/on-structs-and-enums-locals.stderr b/src/test/ui/traits/bound/on-structs-and-enums-locals.stderr index c9068a270..20bbe69c0 100644 --- a/src/test/ui/traits/bound/on-structs-and-enums-locals.stderr +++ b/src/test/ui/traits/bound/on-structs-and-enums-locals.stderr @@ -11,10 +11,10 @@ LL | struct Foo { | ^^^^^ required by this bound in `Foo` error[E0277]: the trait bound `{integer}: Trait` is not satisfied - --> $DIR/on-structs-and-enums-locals.rs:10:15 + --> $DIR/on-structs-and-enums-locals.rs:11:12 | -LL | let foo = Foo { - | ^^^ the trait `Trait` is not implemented for `{integer}` +LL | x: 3 + | ^ the trait `Trait` is not implemented for `{integer}` | note: required by a bound in `Foo` --> $DIR/on-structs-and-enums-locals.rs:5:14 diff --git a/src/test/ui/traits/bound/on-structs-and-enums-xc1.rs b/src/test/ui/traits/bound/on-structs-and-enums-xc1.rs index 8156868e0..5ef35b513 100644 --- a/src/test/ui/traits/bound/on-structs-and-enums-xc1.rs +++ b/src/test/ui/traits/bound/on-structs-and-enums-xc1.rs @@ -6,8 +6,8 @@ use on_structs_and_enums_xc::{Bar, Foo, Trait}; fn main() { let foo = Foo { - //~^ ERROR E0277 x: 3 + //~^ ERROR E0277 }; let bar: Bar = return; //~^ ERROR E0277 diff --git a/src/test/ui/traits/bound/on-structs-and-enums-xc1.stderr b/src/test/ui/traits/bound/on-structs-and-enums-xc1.stderr index f4cc64af9..3fb5decb7 100644 --- a/src/test/ui/traits/bound/on-structs-and-enums-xc1.stderr +++ b/src/test/ui/traits/bound/on-structs-and-enums-xc1.stderr @@ -11,10 +11,10 @@ LL | pub enum Bar { | ^^^^^ required by this bound in `Bar` error[E0277]: the trait bound `{integer}: Trait` is not satisfied - --> $DIR/on-structs-and-enums-xc1.rs:8:15 + --> $DIR/on-structs-and-enums-xc1.rs:9:12 | -LL | let foo = Foo { - | ^^^ the trait `Trait` is not implemented for `{integer}` +LL | x: 3 + | ^ the trait `Trait` is not implemented for `{integer}` | note: required by a bound in `Foo` --> $DIR/auxiliary/on_structs_and_enums_xc.rs:5:18 diff --git a/src/test/ui/traits/cycle-cache-err-60010.stderr b/src/test/ui/traits/cycle-cache-err-60010.stderr index 859403f20..2478eb354 100644 --- a/src/test/ui/traits/cycle-cache-err-60010.stderr +++ b/src/test/ui/traits/cycle-cache-err-60010.stderr @@ -17,12 +17,12 @@ note: required because it appears within the type `RootDatabase` | LL | struct RootDatabase { | ^^^^^^^^^^^^ -note: required because of the requirements on the impl of `SourceDatabase` for `RootDatabase` +note: required for `RootDatabase` to implement `SourceDatabase` --> $DIR/cycle-cache-err-60010.rs:44:9 | LL | impl SourceDatabase for T | ^^^^^^^^^^^^^^ ^ -note: required because of the requirements on the impl of `Query` for `ParseQuery` +note: required for `ParseQuery` to implement `Query` --> $DIR/cycle-cache-err-60010.rs:37:10 | LL | impl Query for ParseQuery diff --git a/src/test/ui/traits/inductive-overflow/lifetime.rs b/src/test/ui/traits/inductive-overflow/lifetime.rs index c36c17d3d..004e47737 100644 --- a/src/test/ui/traits/inductive-overflow/lifetime.rs +++ b/src/test/ui/traits/inductive-overflow/lifetime.rs @@ -28,5 +28,5 @@ fn main() { is_send::>>(); //~^ ERROR overflow evaluating //~| 3 redundant requirements hidden - //~| required because of + //~| required for } diff --git a/src/test/ui/traits/inductive-overflow/lifetime.stderr b/src/test/ui/traits/inductive-overflow/lifetime.stderr index 9ca615aac..b72d53bdd 100644 --- a/src/test/ui/traits/inductive-overflow/lifetime.stderr +++ b/src/test/ui/traits/inductive-overflow/lifetime.stderr @@ -4,13 +4,13 @@ error[E0275]: overflow evaluating the requirement `X>: NotAuto` LL | is_send::>>(); | ^^^^^^^^^^^^^^^^^^^^^^^^ | -note: required because of the requirements on the impl of `NotAuto` for `Box>>` +note: required for `Box>>` to implement `NotAuto` --> $DIR/lifetime.rs:18:18 | LL | impl NotAuto for Box {} | ^^^^^^^ ^^^^^^ = note: 3 redundant requirements hidden - = note: required because of the requirements on the impl of `NotAuto` for `X>` + = note: required for `X>` to implement `NotAuto` note: required by a bound in `is_send` --> $DIR/lifetime.rs:22:15 | diff --git a/src/test/ui/traits/inductive-overflow/simultaneous.stderr b/src/test/ui/traits/inductive-overflow/simultaneous.stderr index 230c2638c..09930e60e 100644 --- a/src/test/ui/traits/inductive-overflow/simultaneous.stderr +++ b/src/test/ui/traits/inductive-overflow/simultaneous.stderr @@ -4,7 +4,7 @@ error[E0275]: overflow evaluating the requirement `{integer}: Tweedledum` LL | is_ee(4); | ^^^^^ | -note: required because of the requirements on the impl of `Combo` for `{integer}` +note: required for `{integer}` to implement `Combo` --> $DIR/simultaneous.rs:11:34 | LL | impl Combo for T {} diff --git a/src/test/ui/traits/inductive-overflow/supertrait-auto-trait.stderr b/src/test/ui/traits/inductive-overflow/supertrait-auto-trait.stderr index d7697dcc6..3ec288d13 100644 --- a/src/test/ui/traits/inductive-overflow/supertrait-auto-trait.stderr +++ b/src/test/ui/traits/inductive-overflow/supertrait-auto-trait.stderr @@ -14,7 +14,7 @@ LL | let (a, b) = copy(NoClone); | | | required by a bound introduced by this call | -note: required because of the requirements on the impl of `Magic` for `NoClone` +note: required for `NoClone` to implement `Magic` --> $DIR/supertrait-auto-trait.rs:8:12 | LL | auto trait Magic: Copy {} diff --git a/src/test/ui/traits/inductive-overflow/supertrait.stderr b/src/test/ui/traits/inductive-overflow/supertrait.stderr index 95325a534..4b862cf79 100644 --- a/src/test/ui/traits/inductive-overflow/supertrait.stderr +++ b/src/test/ui/traits/inductive-overflow/supertrait.stderr @@ -4,7 +4,7 @@ error[E0275]: overflow evaluating the requirement `NoClone: Magic` LL | let (a, b) = copy(NoClone); | ^^^^ | -note: required because of the requirements on the impl of `Magic` for `NoClone` +note: required for `NoClone` to implement `Magic` --> $DIR/supertrait.rs:5:16 | LL | impl Magic for T {} diff --git a/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr b/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr index cab0ccdf7..656e0d0bf 100644 --- a/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr +++ b/src/test/ui/traits/inheritance/repeated-supertrait-ambig.stderr @@ -1,18 +1,22 @@ error[E0277]: the trait bound `dyn CompareToInts: CompareTo` is not satisfied - --> $DIR/repeated-supertrait-ambig.rs:26:7 + --> $DIR/repeated-supertrait-ambig.rs:26:15 | LL | c.same_as(22) - | ^^^^^^^ the trait `CompareTo` is not implemented for `dyn CompareToInts` + | ------- ^^ the trait `CompareTo` is not implemented for `dyn CompareToInts` + | | + | required by a bound introduced by this call | = help: the following other types implement trait `CompareTo`: > > error[E0277]: the trait bound `C: CompareTo` is not satisfied - --> $DIR/repeated-supertrait-ambig.rs:30:7 + --> $DIR/repeated-supertrait-ambig.rs:30:15 | LL | c.same_as(22) - | ^^^^^^^ the trait `CompareTo` is not implemented for `C` + | ------- ^^ the trait `CompareTo` is not implemented for `C` + | | + | required by a bound introduced by this call | help: consider further restricting this bound | @@ -20,20 +24,24 @@ LL | fn with_trait>(c: &C) -> bool { | ++++++++++++++++ error[E0277]: the trait bound `dyn CompareToInts: CompareTo` is not satisfied - --> $DIR/repeated-supertrait-ambig.rs:34:5 + --> $DIR/repeated-supertrait-ambig.rs:34:37 | LL | ::same_as(c, 22) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `CompareTo` is not implemented for `dyn CompareToInts` + | ---------------------------- ^^ the trait `CompareTo` is not implemented for `dyn CompareToInts` + | | + | required by a bound introduced by this call | = help: the following other types implement trait `CompareTo`: > > error[E0277]: the trait bound `C: CompareTo` is not satisfied - --> $DIR/repeated-supertrait-ambig.rs:38:5 + --> $DIR/repeated-supertrait-ambig.rs:38:27 | LL | CompareTo::same_as(c, 22) - | ^^^^^^^^^^^^^^^^^^ the trait `CompareTo` is not implemented for `C` + | ------------------ ^^ the trait `CompareTo` is not implemented for `C` + | | + | required by a bound introduced by this call | help: consider further restricting this bound | @@ -41,10 +49,12 @@ LL | fn with_ufcs2>(c: &C) -> bool { | ++++++++++++++++ error[E0277]: the trait bound `i64: CompareTo` is not satisfied - --> $DIR/repeated-supertrait-ambig.rs:42:23 + --> $DIR/repeated-supertrait-ambig.rs:42:31 | LL | assert_eq!(22_i64.same_as(22), true); - | ^^^^^^^ the trait `CompareTo` is not implemented for `i64` + | ------- ^^ the trait `CompareTo` is not implemented for `i64` + | | + | required by a bound introduced by this call | = help: the following other types implement trait `CompareTo`: > diff --git a/src/test/ui/traits/issue-18400.stderr b/src/test/ui/traits/issue-18400.stderr index 92e0f6007..4394e6f7e 100644 --- a/src/test/ui/traits/issue-18400.stderr +++ b/src/test/ui/traits/issue-18400.stderr @@ -5,13 +5,13 @@ LL | 0.contains(bits); | ^^^^^^^^ | = help: consider increasing the recursion limit by adding a `#![recursion_limit = "256"]` attribute to your crate (`issue_18400`) -note: required because of the requirements on the impl of `Set<&[_]>` for `{integer}` +note: required for `{integer}` to implement `Set<&[_]>` --> $DIR/issue-18400.rs:6:16 | LL | impl<'a, T, S> Set<&'a [T]> for S where | ^^^^^^^^^^^^ ^ = note: 128 redundant requirements hidden - = note: required because of the requirements on the impl of `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` for `{integer}` + = note: required for `{integer}` to implement `Set<&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[&[_]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]>` error: aborting due to previous error diff --git a/src/test/ui/traits/issue-20692.stderr b/src/test/ui/traits/issue-20692.stderr index 1d7f252e5..2028994cd 100644 --- a/src/test/ui/traits/issue-20692.stderr +++ b/src/test/ui/traits/issue-20692.stderr @@ -27,7 +27,7 @@ LL | trait Array: Sized + Copy {} | | | | | ...because it requires `Self: Sized` | this trait cannot be made into an object... - = note: required because of the requirements on the impl of `CoerceUnsized<&dyn Array>` for `&T` + = note: required for `&T` to implement `CoerceUnsized<&dyn Array>` = note: required by cast to type `&dyn Array` error: aborting due to 2 previous errors diff --git a/src/test/ui/traits/issue-38604.stderr b/src/test/ui/traits/issue-38604.stderr index d41488c15..50d6fb054 100644 --- a/src/test/ui/traits/issue-38604.stderr +++ b/src/test/ui/traits/issue-38604.stderr @@ -25,7 +25,7 @@ LL | trait Foo where u32: Q { | --- ^^^^^^^ ...because it uses `Self` as a type parameter | | | this trait cannot be made into an object... - = note: required because of the requirements on the impl of `CoerceUnsized>` for `Box<()>` + = note: required for `Box<()>` to implement `CoerceUnsized>` = note: required by cast to type `Box` error: aborting due to 2 previous errors diff --git a/src/test/ui/traits/issue-71036.rs b/src/test/ui/traits/issue-71036.rs index 3d2df6fe9..69eed0c04 100644 --- a/src/test/ui/traits/issue-71036.rs +++ b/src/test/ui/traits/issue-71036.rs @@ -12,6 +12,6 @@ impl<'a, T: ?Sized + Unsize, U: ?Sized> DispatchFromDyn> for Foo<' //~^ ERROR the trait bound `&'a T: Unsize<&'a U>` is not satisfied //~| NOTE the trait `Unsize<&'a U>` is not implemented for `&'a T` //~| NOTE all implementations of `Unsize` are provided automatically by the compiler -//~| NOTE required because of the requirements on the impl +//~| NOTE required for fn main() {} diff --git a/src/test/ui/traits/issue-71036.stderr b/src/test/ui/traits/issue-71036.stderr index 3ee6db40e..79eb7a2ae 100644 --- a/src/test/ui/traits/issue-71036.stderr +++ b/src/test/ui/traits/issue-71036.stderr @@ -5,7 +5,7 @@ LL | impl<'a, T: ?Sized + Unsize, U: ?Sized> DispatchFromDyn> for | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `Unsize<&'a U>` is not implemented for `&'a T` | = note: all implementations of `Unsize` are provided automatically by the compiler, see for more information - = note: required because of the requirements on the impl of `DispatchFromDyn<&'a &'a U>` for `&'a &'a T` + = note: required for `&'a &'a T` to implement `DispatchFromDyn<&'a &'a U>` error: aborting due to previous error diff --git a/src/test/ui/traits/issue-71136.stderr b/src/test/ui/traits/issue-71136.stderr index 62a2a64ed..f54173392 100644 --- a/src/test/ui/traits/issue-71136.stderr +++ b/src/test/ui/traits/issue-71136.stderr @@ -7,7 +7,7 @@ LL | struct FooHolster { LL | the_foos: Vec, | ^^^^^^^^^^^^^^^^^^ the trait `Clone` is not implemented for `Foo` | - = note: required because of the requirements on the impl of `Clone` for `Vec` + = note: required for `Vec` to implement `Clone` = note: this error originates in the derive macro `Clone` (in Nightly builds, run with -Z macro-backtrace for more info) help: consider annotating `Foo` with `#[derive(Clone)]` | diff --git a/src/test/ui/traits/issue-77982.stderr b/src/test/ui/traits/issue-77982.stderr index 2b832e27c..e210f11b3 100644 --- a/src/test/ui/traits/issue-77982.stderr +++ b/src/test/ui/traits/issue-77982.stderr @@ -2,7 +2,9 @@ error[E0283]: type annotations needed --> $DIR/issue-77982.rs:8:10 | LL | opts.get(opt.as_ref()); - | ^^^ cannot infer type of the type parameter `Q` declared on the associated function `get` + | ^^^ ------------ type must be known at this point + | | + | cannot infer type of the type parameter `Q` declared on the associated function `get` | = note: multiple `impl`s satisfying `String: Borrow<_>` found in the following crates: `alloc`, `core`: - impl Borrow for String; @@ -13,7 +15,7 @@ note: required by a bound in `HashMap::::get` | LL | K: Borrow, | ^^^^^^^^^ required by this bound in `HashMap::::get` -help: consider specifying the type argument in the function call +help: consider specifying the generic argument | LL | opts.get::(opt.as_ref()); | +++++ @@ -42,7 +44,7 @@ error[E0283]: type annotations needed LL | let ips: Vec<_> = (0..100_000).map(|_| u32::from(0u32.into())).collect(); | --------- ^^^^ | | - | type must be known at this point + | required by a bound introduced by this call | = note: multiple `impl`s satisfying `u32: From<_>` found in the following crates: `core`, `std`: - impl From for u32; diff --git a/src/test/ui/traits/issue-82830.stderr b/src/test/ui/traits/issue-82830.stderr index f863143c7..6a597a402 100644 --- a/src/test/ui/traits/issue-82830.stderr +++ b/src/test/ui/traits/issue-82830.stderr @@ -4,7 +4,7 @@ error[E0275]: overflow evaluating the requirement `P: Sized` LL | t: MaybeBox

, | ^^^^^^^^^^^ | -note: required because of the requirements on the impl of `A>` for `P` +note: required for `P` to implement `A>` --> $DIR/issue-82830.rs:10:12 | LL | impl A for P { diff --git a/src/test/ui/traits/issue-91594.stderr b/src/test/ui/traits/issue-91594.stderr index f2b3de13b..5fcd090a8 100644 --- a/src/test/ui/traits/issue-91594.stderr +++ b/src/test/ui/traits/issue-91594.stderr @@ -1,11 +1,11 @@ error[E0277]: the trait bound `Foo: HasComponent<()>` is not satisfied - --> $DIR/issue-91594.rs:10:6 + --> $DIR/issue-91594.rs:10:1 | LL | impl HasComponent<>::Interface> for Foo {} - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HasComponent<()>` is not implemented for `Foo` + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `HasComponent<()>` is not implemented for `Foo` | = help: the trait `HasComponent<>::Interface>` is implemented for `Foo` -note: required because of the requirements on the impl of `Component` for `Foo` +note: required for `Foo` to implement `Component` --> $DIR/issue-91594.rs:13:27 | LL | impl> Component for Foo { diff --git a/src/test/ui/traits/issue-91949-hangs-on-recursion.stderr b/src/test/ui/traits/issue-91949-hangs-on-recursion.stderr index f5d6d72af..6acf2fe65 100644 --- a/src/test/ui/traits/issue-91949-hangs-on-recursion.stderr +++ b/src/test/ui/traits/issue-91949-hangs-on-recursion.stderr @@ -15,9 +15,9 @@ LL | recurse(IteratorOfWrapped(elements).map(|t| t.0)) error[E0275]: overflow evaluating the requirement `(): Sized` | = help: consider increasing the recursion limit by adding a `#![recursion_limit = "512"]` attribute to your crate (`issue_91949_hangs_on_recursion`) - = note: required because of the requirements on the impl of `Iterator` for `std::iter::Empty<()>` + = note: required for `std::iter::Empty<()>` to implement `Iterator` = note: 171 redundant requirements hidden - = note: required because of the requirements on the impl of `Iterator` for `IteratorOfWrapped<(), Map>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>` + = note: required for `IteratorOfWrapped<(), Map>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>, [closure@$DIR/issue-91949-hangs-on-recursion.rs:26:45: 26:48]>>` to implement `Iterator` error: aborting due to previous error; 1 warning emitted diff --git a/src/test/ui/traits/issue-97576.stderr b/src/test/ui/traits/issue-97576.stderr index bdee073d6..146d38d07 100644 --- a/src/test/ui/traits/issue-97576.stderr +++ b/src/test/ui/traits/issue-97576.stderr @@ -1,10 +1,12 @@ error[E0277]: the trait bound `String: From` is not satisfied - --> $DIR/issue-97576.rs:8:22 + --> $DIR/issue-97576.rs:8:18 | LL | bar: bar.into(), - | ^^^^ the trait `From` is not implemented for `String` + | ^^^ ---- required by a bound introduced by this call + | | + | the trait `From` is not implemented for `String` | - = note: required because of the requirements on the impl of `Into` for `impl ToString` + = note: required for `impl ToString` to implement `Into` error: aborting due to previous error diff --git a/src/test/ui/traits/multidispatch-bad.stderr b/src/test/ui/traits/multidispatch-bad.stderr index 8b6e61006..d58f1e2d9 100644 --- a/src/test/ui/traits/multidispatch-bad.stderr +++ b/src/test/ui/traits/multidispatch-bad.stderr @@ -10,7 +10,7 @@ note: function defined here --> $DIR/multidispatch-bad.rs:13:4 | LL | fn test(_: T, _: U) - | ^^^^ ---- ---- + | ^^^^ ---- help: change the type of the numeric literal from `i32` to `u32` | LL | test(22i32, 44u32); diff --git a/src/test/ui/traits/multidispatch-convert-ambig-dest.stderr b/src/test/ui/traits/multidispatch-convert-ambig-dest.stderr index cbec35934..6e6172eea 100644 --- a/src/test/ui/traits/multidispatch-convert-ambig-dest.stderr +++ b/src/test/ui/traits/multidispatch-convert-ambig-dest.stderr @@ -13,7 +13,9 @@ error[E0283]: type annotations needed --> $DIR/multidispatch-convert-ambig-dest.rs:26:5 | LL | test(22, std::default::Default::default()); - | ^^^^ cannot infer type of the type parameter `U` declared on the function `test` + | ^^^^ -------------------------------- type must be known at this point + | | + | cannot infer type of the type parameter `U` declared on the function `test` | note: multiple `impl`s satisfying `i32: Convert<_>` found --> $DIR/multidispatch-convert-ambig-dest.rs:8:1 @@ -30,10 +32,10 @@ LL | fn test(_: T, _: U) | ---- required by a bound in this LL | where T : Convert | ^^^^^^^^^^ required by this bound in `test` -help: consider specifying the type arguments in the function call +help: consider specifying the generic arguments | -LL | test::(22, std::default::Default::default()); - | ++++++++ +LL | test::(22, std::default::Default::default()); + | ++++++++++ error: aborting due to 2 previous errors diff --git a/src/test/ui/traits/negative-impls/explicitly-unimplemented-error-message.rs b/src/test/ui/traits/negative-impls/explicitly-unimplemented-error-message.rs index 1314f9cb0..17ddaa312 100644 --- a/src/test/ui/traits/negative-impls/explicitly-unimplemented-error-message.rs +++ b/src/test/ui/traits/negative-impls/explicitly-unimplemented-error-message.rs @@ -1,5 +1,5 @@ // This tests issue #79683: note in the error message that the trait is -// explicitely unimplemented instead of suggesting to implement it. +// explicitly unimplemented instead of suggesting to implement it. #![feature(negative_impls)] diff --git a/src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr b/src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr index c5d4ccc2f..41fc3600f 100644 --- a/src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr +++ b/src/test/ui/traits/negative-impls/negated-auto-traits-error.stderr @@ -61,12 +61,12 @@ error[E0277]: `dummy2::TestType` cannot be sent between threads safely --> $DIR/negated-auto-traits-error.rs:48:13 | LL | is_send(Box::new(TestType)); - | ------- ^^^^^^^^^^^^^^^^^^ expected an implementor of trait `Send` + | ------- ^^^^^^^^^^^^^^^^^^ the trait `Send` is not implemented for `Unique` | | | required by a bound introduced by this call | = note: the trait bound `Unique: Send` is not satisfied - = note: required because of the requirements on the impl of `Send` for `Unique` + = note: required for `Unique` to implement `Send` = note: required because it appears within the type `Box` note: required by a bound in `is_send` --> $DIR/negated-auto-traits-error.rs:16:15 @@ -92,7 +92,7 @@ note: required because it appears within the type `Outer2` | LL | struct Outer2(T); | ^^^^^^ - = note: required because of the requirements on the impl of `Send` for `Unique>` + = note: required for `Unique>` to implement `Send` = note: required because it appears within the type `Box>` note: required by a bound in `is_send` --> $DIR/negated-auto-traits-error.rs:16:15 @@ -109,7 +109,7 @@ LL | is_sync(Outer2(TestType)); | required by a bound introduced by this call | = help: the trait `Send` is not implemented for `main::TestType` -note: required because of the requirements on the impl of `Sync` for `Outer2` +note: required for `Outer2` to implement `Sync` --> $DIR/negated-auto-traits-error.rs:14:22 | LL | unsafe impl Sync for Outer2 {} diff --git a/src/test/ui/traits/not-suggest-non-existing-fully-qualified-path.stderr b/src/test/ui/traits/not-suggest-non-existing-fully-qualified-path.stderr index 75d45d905..53178328c 100644 --- a/src/test/ui/traits/not-suggest-non-existing-fully-qualified-path.stderr +++ b/src/test/ui/traits/not-suggest-non-existing-fully-qualified-path.stderr @@ -22,7 +22,7 @@ LL | impl I for B {} | ^^^^^^^^^^^^^^^^^ LL | impl I for B {} | ^^^^^^^^^^^^^^^^^ -note: required because of the requirements on the impl of `V<_>` for `A` +note: required for `A` to implement `V<_>` --> $DIR/not-suggest-non-existing-fully-qualified-path.rs:12:12 | LL | impl V for A diff --git a/src/test/ui/traits/object/enforce-supertrait-projection.stderr b/src/test/ui/traits/object/enforce-supertrait-projection.stderr index eab42ca56..cbf093866 100644 --- a/src/test/ui/traits/object/enforce-supertrait-projection.stderr +++ b/src/test/ui/traits/object/enforce-supertrait-projection.stderr @@ -1,12 +1,12 @@ error[E0271]: type mismatch resolving ` as SuperTrait>::A == B` - --> $DIR/enforce-supertrait-projection.rs:9:5 + --> $DIR/enforce-supertrait-projection.rs:9:17 | LL | fn transmute(x: A) -> B { | - - expected type parameter | | | found type parameter LL | foo::>(x) - | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter `B`, found type parameter `A` + | ^^^^^^^^^^^^^^^^^^^^^^^ expected type parameter `B`, found type parameter `A` | = note: expected type parameter `B` found type parameter `A` diff --git a/src/test/ui/traits/object/safety.stderr b/src/test/ui/traits/object/safety.stderr index cf534d984..dc18adeaf 100644 --- a/src/test/ui/traits/object/safety.stderr +++ b/src/test/ui/traits/object/safety.stderr @@ -11,7 +11,7 @@ LL | trait Tr { | -- this trait cannot be made into an object... LL | fn foo(); | ^^^ ...because associated function `foo` has no `self` parameter - = note: required because of the requirements on the impl of `CoerceUnsized<&dyn Tr>` for `&St` + = note: required for `&St` to implement `CoerceUnsized<&dyn Tr>` = note: required by cast to type `&dyn Tr` help: consider turning `foo` into a method by giving it a `&self` argument | diff --git a/src/test/ui/traits/pointee-tail-is-generic-errors.stderr b/src/test/ui/traits/pointee-tail-is-generic-errors.stderr index 8456f8456..0c3d7060d 100644 --- a/src/test/ui/traits/pointee-tail-is-generic-errors.stderr +++ b/src/test/ui/traits/pointee-tail-is-generic-errors.stderr @@ -1,8 +1,8 @@ error[E0271]: type mismatch resolving `::Metadata == ()` - --> $DIR/pointee-tail-is-generic-errors.rs:13:5 + --> $DIR/pointee-tail-is-generic-errors.rs:13:15 | LL | is_thin::(); - | ^^^^^^^^^^^^ expected `()`, found associated type + | ^ expected `()`, found associated type | = note: expected unit type `()` found associated type `::Metadata` @@ -15,13 +15,13 @@ LL | fn is_thin + ?Sized>() {} | ^^^^^^^^^^^^^ required by this bound in `is_thin` error[E0271]: type mismatch resolving `::Metadata == ()` - --> $DIR/pointee-tail-is-generic-errors.rs:16:5 + --> $DIR/pointee-tail-is-generic-errors.rs:16:15 | LL | type Opaque = impl std::fmt::Debug + ?Sized; | ----------------------------- the found opaque type ... LL | is_thin::(); - | ^^^^^^^^^^^^^^^^^ expected `()`, found associated type + | ^^^^^^ expected `()`, found associated type | = note: expected unit type `()` found associated type `::Metadata` diff --git a/src/test/ui/traits/resolution-in-overloaded-op.stderr b/src/test/ui/traits/resolution-in-overloaded-op.stderr index 34fae64e4..fe5e1d6d2 100644 --- a/src/test/ui/traits/resolution-in-overloaded-op.stderr +++ b/src/test/ui/traits/resolution-in-overloaded-op.stderr @@ -8,8 +8,8 @@ LL | a * b | help: consider introducing a `where` clause, but there might be an alternative better way to express this requirement | -LL | fn foo>(a: &T, b: f64) -> f64 where &T: Mul { - | ++++++++++++++++++ +LL | fn foo>(a: &T, b: f64) -> f64 where &T: Mul { + | ++++++++++++++++++++++++++++++++ error: aborting due to previous error diff --git a/src/test/ui/traits/suggest-deferences/issue-39029.stderr b/src/test/ui/traits/suggest-deferences/issue-39029.stderr index 5c324cd38..eb2b88059 100644 --- a/src/test/ui/traits/suggest-deferences/issue-39029.stderr +++ b/src/test/ui/traits/suggest-deferences/issue-39029.stderr @@ -2,18 +2,20 @@ error[E0277]: the trait bound `NoToSocketAddrs: ToSocketAddrs` is not satisfied --> $DIR/issue-39029.rs:16:37 | LL | let _errors = TcpListener::bind(&bad); - | ----------------- ^^^^ - | | | - | | the trait `ToSocketAddrs` is not implemented for `NoToSocketAddrs` - | | help: consider dereferencing here: `&*bad` + | ----------------- ^^^^ the trait `ToSocketAddrs` is not implemented for `NoToSocketAddrs` + | | | required by a bound introduced by this call | - = note: required because of the requirements on the impl of `ToSocketAddrs` for `&NoToSocketAddrs` + = note: required for `&NoToSocketAddrs` to implement `ToSocketAddrs` note: required by a bound in `TcpListener::bind` --> $SRC_DIR/std/src/net/tcp.rs:LL:COL | LL | pub fn bind(addr: A) -> io::Result { | ^^^^^^^^^^^^^ required by this bound in `TcpListener::bind` +help: consider dereferencing here + | +LL | let _errors = TcpListener::bind(&*bad); + | + error: aborting due to previous error diff --git a/src/test/ui/traits/suggest-deferences/issue-62530.stderr b/src/test/ui/traits/suggest-deferences/issue-62530.stderr index d129328da..e47ae0b65 100644 --- a/src/test/ui/traits/suggest-deferences/issue-62530.stderr +++ b/src/test/ui/traits/suggest-deferences/issue-62530.stderr @@ -2,10 +2,8 @@ error[E0277]: the trait bound `&String: SomeTrait` is not satisfied --> $DIR/issue-62530.rs:13:26 | LL | takes_type_parameter(&string); // Error - | -------------------- ^^^^^^^ - | | | - | | the trait `SomeTrait` is not implemented for `&String` - | | help: consider dereferencing here: `&*string` + | -------------------- ^^^^^^^ the trait `SomeTrait` is not implemented for `&String` + | | | required by a bound introduced by this call | note: required by a bound in `takes_type_parameter` @@ -13,6 +11,10 @@ note: required by a bound in `takes_type_parameter` | LL | fn takes_type_parameter(_x: T) where T: SomeTrait {} | ^^^^^^^^^ required by this bound in `takes_type_parameter` +help: consider dereferencing here + | +LL | takes_type_parameter(&*string); // Error + | + error: aborting due to previous error diff --git a/src/test/ui/traits/suggest-deferences/multiple-0.stderr b/src/test/ui/traits/suggest-deferences/multiple-0.stderr index efb3c7d12..6a4d4b8d5 100644 --- a/src/test/ui/traits/suggest-deferences/multiple-0.stderr +++ b/src/test/ui/traits/suggest-deferences/multiple-0.stderr @@ -2,10 +2,8 @@ error[E0277]: the trait bound `&Baz: Happy` is not satisfied --> $DIR/multiple-0.rs:34:9 | LL | foo(&baz); - | --- ^^^^ - | | | - | | the trait `Happy` is not implemented for `&Baz` - | | help: consider dereferencing here: `&***baz` + | --- ^^^^ the trait `Happy` is not implemented for `&Baz` + | | | required by a bound introduced by this call | note: required by a bound in `foo` @@ -13,6 +11,10 @@ note: required by a bound in `foo` | LL | fn foo(_: T) where T: Happy {} | ^^^^^ required by this bound in `foo` +help: consider dereferencing here + | +LL | foo(&***baz); + | +++ error: aborting due to previous error diff --git a/src/test/ui/traits/suggest-deferences/root-obligation.stderr b/src/test/ui/traits/suggest-deferences/root-obligation.stderr index 16e03e79c..76663ace7 100644 --- a/src/test/ui/traits/suggest-deferences/root-obligation.stderr +++ b/src/test/ui/traits/suggest-deferences/root-obligation.stderr @@ -7,8 +7,8 @@ LL | .filter(|c| "aeiou".contains(c)) | required by a bound introduced by this call | = help: the trait `Fn<(char,)>` is not implemented for `char` - = note: required because of the requirements on the impl of `FnOnce<(char,)>` for `&char` - = note: required because of the requirements on the impl of `Pattern<'_>` for `&char` + = note: required for `&char` to implement `FnOnce<(char,)>` + = note: required for `&char` to implement `Pattern<'_>` note: required by a bound in `core::str::::contains` --> $SRC_DIR/core/src/str/mod.rs:LL:COL | diff --git a/src/test/ui/traits/suggest-where-clause.stderr b/src/test/ui/traits/suggest-where-clause.stderr index d4d9b4967..747e2477b 100644 --- a/src/test/ui/traits/suggest-where-clause.stderr +++ b/src/test/ui/traits/suggest-where-clause.stderr @@ -19,13 +19,13 @@ LL + fn check() { | error[E0277]: the size for values of type `U` cannot be known at compilation time - --> $DIR/suggest-where-clause.rs:10:5 + --> $DIR/suggest-where-clause.rs:10:20 | LL | fn check() { | - this type parameter needs to be `std::marker::Sized` ... LL | mem::size_of::>(); - | ^^^^^^^^^^^^^^^^^^^^^^^ doesn't have a size known at compile-time + | ^^^^^^^ doesn't have a size known at compile-time | note: required because it appears within the type `Misc` --> $DIR/suggest-where-clause.rs:3:8 diff --git a/src/test/ui/traits/test-2.stderr b/src/test/ui/traits/test-2.stderr index 77ea4e4e9..eaa20b0b4 100644 --- a/src/test/ui/traits/test-2.stderr +++ b/src/test/ui/traits/test-2.stderr @@ -76,7 +76,7 @@ LL | trait bar { fn dup(&self) -> Self; fn blah(&self); } | this trait cannot be made into an object... = help: consider moving `dup` to another trait = help: consider moving `blah` to another trait - = note: required because of the requirements on the impl of `CoerceUnsized>` for `Box<{integer}>` + = note: required for `Box<{integer}>` to implement `CoerceUnsized>` = note: required by cast to type `Box` error: aborting due to 5 previous errors diff --git a/src/test/ui/traits/trait-upcasting/subtrait-method.stderr b/src/test/ui/traits/trait-upcasting/subtrait-method.stderr index 8c6901180..af7a410f6 100644 --- a/src/test/ui/traits/trait-upcasting/subtrait-method.stderr +++ b/src/test/ui/traits/trait-upcasting/subtrait-method.stderr @@ -2,7 +2,7 @@ error[E0599]: no method named `c` found for reference `&dyn Bar` in the current --> $DIR/subtrait-method.rs:56:9 | LL | bar.c(); - | ^ help: there is an associated function with a similar name: `a` + | ^ help: there is a method with a similar name: `a` | = help: items from traits can only be used if the trait is implemented and in scope note: `Baz` defines an item `c`, perhaps you need to implement it @@ -15,7 +15,7 @@ error[E0599]: no method named `b` found for reference `&dyn Foo` in the current --> $DIR/subtrait-method.rs:60:9 | LL | foo.b(); - | ^ help: there is an associated function with a similar name: `a` + | ^ help: there is a method with a similar name: `a` | = help: items from traits can only be used if the trait is implemented and in scope note: `Bar` defines an item `b`, perhaps you need to implement it @@ -28,7 +28,7 @@ error[E0599]: no method named `c` found for reference `&dyn Foo` in the current --> $DIR/subtrait-method.rs:62:9 | LL | foo.c(); - | ^ help: there is an associated function with a similar name: `a` + | ^ help: there is a method with a similar name: `a` | = help: items from traits can only be used if the trait is implemented and in scope note: `Baz` defines an item `c`, perhaps you need to implement it @@ -41,7 +41,7 @@ error[E0599]: no method named `b` found for reference `&dyn Foo` in the current --> $DIR/subtrait-method.rs:66:9 | LL | foo.b(); - | ^ help: there is an associated function with a similar name: `a` + | ^ help: there is a method with a similar name: `a` | = help: items from traits can only be used if the trait is implemented and in scope note: `Bar` defines an item `b`, perhaps you need to implement it @@ -54,7 +54,7 @@ error[E0599]: no method named `c` found for reference `&dyn Foo` in the current --> $DIR/subtrait-method.rs:68:9 | LL | foo.c(); - | ^ help: there is an associated function with a similar name: `a` + | ^ help: there is a method with a similar name: `a` | = help: items from traits can only be used if the trait is implemented and in scope note: `Baz` defines an item `c`, perhaps you need to implement it diff --git a/src/test/ui/traits/unspecified-self-in-trait-ref.rs b/src/test/ui/traits/unspecified-self-in-trait-ref.rs new file mode 100644 index 000000000..158b5a985 --- /dev/null +++ b/src/test/ui/traits/unspecified-self-in-trait-ref.rs @@ -0,0 +1,30 @@ +pub trait Foo { + fn foo(&self); +} + +pub trait Bar { + fn foo(&self); +} + +fn main() { + let a = Foo::lol(); + //~^ ERROR no function or associated item named + //~| WARN trait objects without an explicit `dyn` are deprecated + //~| WARN this is accepted in the current edition + let b = Foo::<_>::lol(); + //~^ ERROR no function or associated item named + //~| WARN trait objects without an explicit `dyn` are deprecated + //~| WARN this is accepted in the current edition + let c = Bar::lol(); + //~^ ERROR no function or associated item named + //~| WARN trait objects without an explicit `dyn` are deprecated + //~| WARN this is accepted in the current edition + let d = Bar::::lol(); + //~^ ERROR no function or associated item named + //~| WARN trait objects without an explicit `dyn` are deprecated + //~| WARN this is accepted in the current edition + let e = Bar::::lol(); + //~^ ERROR must be explicitly specified + //~| WARN trait objects without an explicit `dyn` are deprecated + //~| WARN this is accepted in the current edition +} diff --git a/src/test/ui/traits/unspecified-self-in-trait-ref.stderr b/src/test/ui/traits/unspecified-self-in-trait-ref.stderr new file mode 100644 index 000000000..7869176bb --- /dev/null +++ b/src/test/ui/traits/unspecified-self-in-trait-ref.stderr @@ -0,0 +1,105 @@ +warning: trait objects without an explicit `dyn` are deprecated + --> $DIR/unspecified-self-in-trait-ref.rs:10:13 + | +LL | let a = Foo::lol(); + | ^^^ + | + = note: `#[warn(bare_trait_objects)]` on by default + = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! + = note: for more information, see +help: use `dyn` + | +LL | let a = ::lol(); + | ++++ + + +error[E0599]: no function or associated item named `lol` found for trait object `dyn Foo<_>` in the current scope + --> $DIR/unspecified-self-in-trait-ref.rs:10:18 + | +LL | let a = Foo::lol(); + | ^^^ function or associated item not found in `dyn Foo<_>` + +warning: trait objects without an explicit `dyn` are deprecated + --> $DIR/unspecified-self-in-trait-ref.rs:14:13 + | +LL | let b = Foo::<_>::lol(); + | ^^^^^^^^ + | + = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! + = note: for more information, see +help: use `dyn` + | +LL | let b = >::lol(); + | ++++ + + +error[E0599]: no function or associated item named `lol` found for trait object `dyn Foo<_>` in the current scope + --> $DIR/unspecified-self-in-trait-ref.rs:14:23 + | +LL | let b = Foo::<_>::lol(); + | ^^^ function or associated item not found in `dyn Foo<_>` + +warning: trait objects without an explicit `dyn` are deprecated + --> $DIR/unspecified-self-in-trait-ref.rs:18:13 + | +LL | let c = Bar::lol(); + | ^^^ + | + = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! + = note: for more information, see +help: use `dyn` + | +LL | let c = ::lol(); + | ++++ + + +error[E0599]: no function or associated item named `lol` found for trait object `dyn Bar<_, _>` in the current scope + --> $DIR/unspecified-self-in-trait-ref.rs:18:18 + | +LL | let c = Bar::lol(); + | ^^^ function or associated item not found in `dyn Bar<_, _>` + +warning: trait objects without an explicit `dyn` are deprecated + --> $DIR/unspecified-self-in-trait-ref.rs:22:13 + | +LL | let d = Bar::::lol(); + | ^^^^^^^^^^^^^^^ + | + = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! + = note: for more information, see +help: use `dyn` + | +LL | let d = >::lol(); + | ++++ + + +error[E0599]: no function or associated item named `lol` found for trait object `dyn Bar` in the current scope + --> $DIR/unspecified-self-in-trait-ref.rs:22:30 + | +LL | let d = Bar::::lol(); + | ^^^ function or associated item not found in `dyn Bar` + +warning: trait objects without an explicit `dyn` are deprecated + --> $DIR/unspecified-self-in-trait-ref.rs:26:13 + | +LL | let e = Bar::::lol(); + | ^^^^^^^^^^^^ + | + = warning: this is accepted in the current edition (Rust 2015) but is a hard error in Rust 2021! + = note: for more information, see +help: use `dyn` + | +LL | let e = >::lol(); + | ++++ + + +error[E0393]: the type parameter `A` must be explicitly specified + --> $DIR/unspecified-self-in-trait-ref.rs:26:13 + | +LL | pub trait Bar { + | ------------------------------ type parameter `A` must be specified for this +... +LL | let e = Bar::::lol(); + | ^^^^^^^^^^^^ missing reference to `A` + | + = note: because of the default `Self` reference, type parameters must be specified on object types + +error: aborting due to 5 previous errors; 5 warnings emitted + +Some errors have detailed explanations: E0393, E0599. +For more information about an error, try `rustc --explain E0393`. -- cgit v1.2.3