fork/rust

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

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
776 B24 linesraw
1error[E0311]: the parameter type `T` may not live long enough
2  --> $DIR/E0311.rs:6:5
3   |
4LL |     with_restriction::<T>(x)
5   |     ^^^^^^^^^^^^^^^^^^^^^
6   |
7note: the parameter type `T` must be valid for the anonymous lifetime defined here...
8  --> $DIR/E0311.rs:5:25
9   |
10LL | fn no_restriction<T>(x: &()) -> &() {
11   |                         ^^^
12note: ...so that the type `T` will meet its required lifetime bounds
13  --> $DIR/E0311.rs:6:5
14   |
15LL |     with_restriction::<T>(x)
16   |     ^^^^^^^^^^^^^^^^^^^^^
17help: consider adding an explicit lifetime bound...
18   |
19LL | fn no_restriction<'a, T: 'a>(x: &'a ()) -> &() {
20   |                   +++  ++++      ++
21
22error: aborting due to previous error
23
24For more information about this error, try `rustc --explain E0311`.