]> git.lizzy.rs Git - rust.git/blob - src/test/ui/type-alias-impl-trait/bounds-are-checked.stderr
Check opaque types satisfy their bounds
[rust.git] / src / test / ui / type-alias-impl-trait / bounds-are-checked.stderr
1 warning: unnecessary lifetime parameter `'a`
2   --> $DIR/bounds-are-checked.rs:9:6
3    |
4 LL | fn f<'a: 'static>(t: &'a str) -> X<'a> {
5    |      ^^^^^^^^^^^
6    |
7    = help: you can use the `'static` lifetime directly, in place of `'a`
8
9 error[E0308]: mismatched types
10   --> $DIR/bounds-are-checked.rs:6:14
11    |
12 LL | type X<'a> = impl Into<&'static str> + From<&'a str>;
13    |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ lifetime mismatch
14    |
15    = note: expected type `std::convert::From<&'a str>`
16               found type `std::convert::From<&'static str>`
17 note: the lifetime `'a` as defined on the item at 6:8...
18   --> $DIR/bounds-are-checked.rs:6:8
19    |
20 LL | type X<'a> = impl Into<&'static str> + From<&'a str>;
21    |        ^^
22    = note: ...does not necessarily outlive the static lifetime
23
24 error: aborting due to previous error; 1 warning emitted
25
26 For more information about this error, try `rustc --explain E0308`.