summaryrefslogtreecommitdiffstats
path: root/tests/ui/traits/bound
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--tests/ui/traits/bound/assoc-fn-bound-root-obligation.rs4
-rw-r--r--tests/ui/traits/bound/assoc-fn-bound-root-obligation.stderr4
-rw-r--r--tests/ui/traits/bound/on-structs-and-enums-static.rs2
-rw-r--r--tests/ui/traits/bound/on-structs-and-enums-static.stderr19
4 files changed, 23 insertions, 6 deletions
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<T:Trait> {
static X: Foo<usize> = 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<T:Trait> {
| ^^^^^ 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<T:Trait> {
+ | ^^^^^ required by this bound in `Foo`
+
+error: aborting due to 2 previous errors
For more information about this error, try `rustc --explain E0277`.