summary refs log tree commit diff
path: root/src/test/ui/lifetimes/consider-using-explicit-lifetime.stderr
blob: 153aaa07833a8a08ee73586deec3859420bff3d3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
error: main function not found

error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
  --> $DIR/consider-using-explicit-lifetime.rs:19:12
   |
19 |         Ok(Foo { field: path })
   |            ^^^

error[E0495]: cannot infer an appropriate lifetime due to conflicting requirements
  --> $DIR/consider-using-explicit-lifetime.rs:26:12
   |
26 |         Ok(Foo { field: path })
   |            ^^^
   |
help: consider using an explicit lifetime parameter as shown: fn from_str(path: &'a str) -> Result<Self, ()>
  --> $DIR/consider-using-explicit-lifetime.rs:25:5
   |
25 |       fn from_str(path: &str) -> Result<Self, ()> {
   |  _____^ starting here...
26 | |         Ok(Foo { field: path })
27 | |     }
   | |_____^ ...ending here

error: aborting due to 2 previous errors