fork/rust

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

borsAuto merge of #69854 - pietroalbini:stable-next, r=Centrilb8cedc00407

1.42.0
1.1 KiB31 linesraw
1error[E0309]: the parameter type `T` may not live long enough
2  --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:9:5
3   |
4LL | impl<'a, T> Trait<'a, T> for usize {
5   |          - help: consider adding an explicit lifetime bound `T: 'a`...
6LL |     type Out = &'a fn(T);
7   |     ^^^^^^^^^^^^^^^^^^^^^
8   |
9note: ...so that the reference type `&'a fn(T)` does not outlive the data it points at
10  --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:9:5
11   |
12LL |     type Out = &'a fn(T);
13   |     ^^^^^^^^^^^^^^^^^^^^^
14
15error[E0309]: the parameter type `T` may not live long enough
16  --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:19:5
17   |
18LL | impl<'a, T> Trait<'a, T> for u32 {
19   |          - help: consider adding an explicit lifetime bound `T: 'a`...
20LL |     type Out = &'a dyn Baz<T>;
21   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
22   |
23note: ...so that the reference type `&'a (dyn Baz<T> + 'a)` does not outlive the data it points at
24  --> $DIR/wf-outlives-ty-in-fn-or-trait.rs:19:5
25   |
26LL |     type Out = &'a dyn Baz<T>;
27   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^
28
29error: aborting due to 2 previous errors
30
31For more information about this error, try `rustc --explain E0309`.