summaryrefslogtreecommitdiffstats
path: root/src/test/ui/on-unimplemented/on-trait.stderr
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-17 12:02:58 +0000
commit698f8c2f01ea549d77d7dc3338a12e04c11057b9 (patch)
tree173a775858bd501c378080a10dca74132f05bc50 /src/test/ui/on-unimplemented/on-trait.stderr
parentInitial commit. (diff)
downloadrustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.tar.xz
rustc-698f8c2f01ea549d77d7dc3338a12e04c11057b9.zip
Adding upstream version 1.64.0+dfsg1.upstream/1.64.0+dfsg1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/test/ui/on-unimplemented/on-trait.stderr')
-rw-r--r--src/test/ui/on-unimplemented/on-trait.stderr29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/test/ui/on-unimplemented/on-trait.stderr b/src/test/ui/on-unimplemented/on-trait.stderr
new file mode 100644
index 000000000..4b040f1ac
--- /dev/null
+++ b/src/test/ui/on-unimplemented/on-trait.stderr
@@ -0,0 +1,29 @@
+error[E0277]: the trait bound `Option<Vec<u8>>: MyFromIterator<&u8>` is not satisfied
+ --> $DIR/on-trait.rs:28:30
+ |
+LL | let y: Option<Vec<u8>> = collect(x.iter()); // this should give approximately the same error for x.iter().collect()
+ | ^^^^^^^ a collection of type `Option<Vec<u8>>` cannot be built from an iterator over elements of type `&u8`
+ |
+ = help: the trait `MyFromIterator<&u8>` is not implemented for `Option<Vec<u8>>`
+note: required by a bound in `collect`
+ --> $DIR/on-trait.rs:22:39
+ |
+LL | fn collect<A, I: Iterator<Item=A>, B: MyFromIterator<A>>(it: I) -> B {
+ | ^^^^^^^^^^^^^^^^^ required by this bound in `collect`
+
+error[E0277]: the trait bound `String: Foo<u8, _, u32>` is not satisfied
+ --> $DIR/on-trait.rs:31:21
+ |
+LL | let x: String = foobar();
+ | ^^^^^^ test error `String` with `u8` `_` `u32` in `Foo`
+ |
+ = help: the trait `Foo<u8, _, u32>` is not implemented for `String`
+note: required by a bound in `foobar`
+ --> $DIR/on-trait.rs:12:24
+ |
+LL | fn foobar<U: Clone, T: Foo<u8, U, u32>>() -> T {
+ | ^^^^^^^^^^^^^^^ required by this bound in `foobar`
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0277`.