]> git.proxmox.com Git - rustc.git/blob - src/test/ui/nll/user-annotations/constant-in-expr-trait-item-3.stderr
New upstream version 1.41.1+dfsg1
[rustc.git] / src / test / ui / nll / user-annotations / constant-in-expr-trait-item-3.stderr
1 error[E0495]: cannot infer an appropriate lifetime for lifetime parameter `'a` due to conflicting requirements
2 --> $DIR/constant-in-expr-trait-item-3.rs:10:5
3 |
4 LL | T::C
5 | ^^^^
6 |
7 note: first, the lifetime cannot outlive the lifetime `'a` as defined on the function body at 9:8...
8 --> $DIR/constant-in-expr-trait-item-3.rs:9:8
9 |
10 LL | fn foo<'a, T: Foo<'a>>() -> &'static u32 {
11 | ^^
12 note: ...so that the types are compatible
13 --> $DIR/constant-in-expr-trait-item-3.rs:10:5
14 |
15 LL | T::C
16 | ^^^^
17 = note: expected `Foo<'_>`
18 found `Foo<'a>`
19 = note: but, the lifetime must be valid for the static lifetime...
20 note: ...so that reference does not outlive borrowed content
21 --> $DIR/constant-in-expr-trait-item-3.rs:10:5
22 |
23 LL | T::C
24 | ^^^^
25
26 error: aborting due to previous error
27
28 For more information about this error, try `rustc --explain E0495`.