From ef24de24a82fe681581cc130f342363c47c0969a Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 7 Jun 2024 07:48:48 +0200 Subject: Merging upstream version 1.75.0+dfsg1. Signed-off-by: Daniel Baumann --- .../ui/traits/bound/assoc-fn-bound-root-obligation.rs | 4 ++-- .../bound/assoc-fn-bound-root-obligation.stderr | 4 ++-- tests/ui/traits/bound/on-structs-and-enums-static.rs | 2 +- .../traits/bound/on-structs-and-enums-static.stderr | 19 ++++++++++++++++++- 4 files changed, 23 insertions(+), 6 deletions(-) (limited to 'tests/ui/traits/bound') diff --git a/tests/ui/traits/bound/assoc-fn-bound-root-obligation.rs b/tests/ui/traits/bound/assoc-fn-bound-root-obligation.rs index f9a934764..f8e3f8e96 100644 --- a/tests/ui/traits/bound/assoc-fn-bound-root-obligation.rs +++ b/tests/ui/traits/bound/assoc-fn-bound-root-obligation.rs @@ -1,7 +1,7 @@ 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` + //~^ ERROR expected a `FnMut(char)` closure, found `u8` + //~| NOTE 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>`: //~| NOTE required for `u8` to implement `Pattern<'_>` diff --git a/tests/ui/traits/bound/assoc-fn-bound-root-obligation.stderr b/tests/ui/traits/bound/assoc-fn-bound-root-obligation.stderr index b1c683e47..f30fe12b2 100644 --- a/tests/ui/traits/bound/assoc-fn-bound-root-obligation.stderr +++ b/tests/ui/traits/bound/assoc-fn-bound-root-obligation.stderr @@ -1,8 +1,8 @@ -error[E0277]: expected a `FnMut<(char,)>` closure, found `u8` +error[E0277]: expected a `FnMut(char)` closure, found `u8` --> $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` + | ^^^^^^^^^^^^ 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>`: diff --git a/tests/ui/traits/bound/on-structs-and-enums-static.rs b/tests/ui/traits/bound/on-structs-and-enums-static.rs index df3f8b8a5..066416cb3 100644 --- a/tests/ui/traits/bound/on-structs-and-enums-static.rs +++ b/tests/ui/traits/bound/on-structs-and-enums-static.rs @@ -8,7 +8,7 @@ struct Foo { static X: Foo = Foo { //~^ ERROR E0277 - x: 1, + x: 1, //~ ERROR: E0277 }; fn main() { diff --git a/tests/ui/traits/bound/on-structs-and-enums-static.stderr b/tests/ui/traits/bound/on-structs-and-enums-static.stderr index fa14aff68..28bbe00c5 100644 --- a/tests/ui/traits/bound/on-structs-and-enums-static.stderr +++ b/tests/ui/traits/bound/on-structs-and-enums-static.stderr @@ -15,6 +15,23 @@ note: required by a bound in `Foo` LL | struct Foo { | ^^^^^ required by this bound in `Foo` -error: aborting due to previous error +error[E0277]: the trait bound `usize: Trait` is not satisfied + --> $DIR/on-structs-and-enums-static.rs:11:8 + | +LL | x: 1, + | ^ the trait `Trait` is not implemented for `usize` + | +help: this trait has no implementations, consider adding one + --> $DIR/on-structs-and-enums-static.rs:1:1 + | +LL | trait Trait { + | ^^^^^^^^^^^ +note: required by a bound in `Foo` + --> $DIR/on-structs-and-enums-static.rs:5:14 + | +LL | struct Foo { + | ^^^^^ required by this bound in `Foo` + +error: aborting due to 2 previous errors For more information about this error, try `rustc --explain E0277`. -- cgit v1.2.3