fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #66089 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum4560ea788cb

1.39.0
1.3 KiB25 linesraw
1error[E0277]: the trait bound `std::option::Option<std::vec::Vec<u8>>: MyFromIterator<&u8>` is not satisfied
2  --> $DIR/on-trait.rs:28:30
3   |
4LL | fn collect<A, I: Iterator<Item=A>, B: MyFromIterator<A>>(it: I) -> B {
5   |    -------                            ----------------- required by this bound in `collect`
6...
7LL |     let y: Option<Vec<u8>> = collect(x.iter()); // this should give approximately the same error for x.iter().collect()
8   |                              ^^^^^^^ a collection of type `std::option::Option<std::vec::Vec<u8>>` cannot be built from an iterator over elements of type `&u8`
9   |
10   = help: the trait `MyFromIterator<&u8>` is not implemented for `std::option::Option<std::vec::Vec<u8>>`
11
12error[E0277]: the trait bound `std::string::String: Bar::Foo<u8, _, u32>` is not satisfied
13  --> $DIR/on-trait.rs:31:21
14   |
15LL | fn foobar<U: Clone, T: Foo<u8, U, u32>>() -> T {
16   |    ------              --------------- required by this bound in `foobar`
17...
18LL |     let x: String = foobar();
19   |                     ^^^^^^ test error `std::string::String` with `u8` `_` `u32` in `Bar::Foo`
20   |
21   = help: the trait `Bar::Foo<u8, _, u32>` is not implemented for `std::string::String`
22
23error: aborting due to 2 previous errors
24
25For more information about this error, try `rustc --explain E0277`.