From 218caa410aa38c29984be31a5229b9fa717560ee Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Wed, 17 Apr 2024 14:19:13 +0200 Subject: Merging upstream version 1.68.2+dfsg1. Signed-off-by: Daniel Baumann --- tests/ui/on-unimplemented/on-trait.stderr | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 tests/ui/on-unimplemented/on-trait.stderr (limited to 'tests/ui/on-unimplemented/on-trait.stderr') diff --git a/tests/ui/on-unimplemented/on-trait.stderr b/tests/ui/on-unimplemented/on-trait.stderr new file mode 100644 index 000000000..4b040f1ac --- /dev/null +++ b/tests/ui/on-unimplemented/on-trait.stderr @@ -0,0 +1,29 @@ +error[E0277]: the trait bound `Option>: MyFromIterator<&u8>` is not satisfied + --> $DIR/on-trait.rs:28:30 + | +LL | let y: Option> = collect(x.iter()); // this should give approximately the same error for x.iter().collect() + | ^^^^^^^ a collection of type `Option>` cannot be built from an iterator over elements of type `&u8` + | + = help: the trait `MyFromIterator<&u8>` is not implemented for `Option>` +note: required by a bound in `collect` + --> $DIR/on-trait.rs:22:39 + | +LL | fn collect, B: MyFromIterator>(it: I) -> B { + | ^^^^^^^^^^^^^^^^^ required by this bound in `collect` + +error[E0277]: the trait bound `String: Foo` 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` is not implemented for `String` +note: required by a bound in `foobar` + --> $DIR/on-trait.rs:12:24 + | +LL | fn foobar>() -> T { + | ^^^^^^^^^^^^^^^ required by this bound in `foobar` + +error: aborting due to 2 previous errors + +For more information about this error, try `rustc --explain E0277`. -- cgit v1.2.3