Closed
Description
struct Thing<'a>(&'a ());
fn func1<'a>(_arg: &'a Thing) -> &() { unimplemented!() }
fn func2<'a>(_arg: &Thing<'a>) -> &() { unimplemented!() }
gives
test.rs:3:34: 3:37 error: missing lifetime specifier [E0106]
test.rs:3 fn func1<'a>(_arg: &'a Thing) -> &() { unimplemented!() }
^~~
test.rs:3:34: 3:37 help: run `rustc --explain E0106` to see a detailed explanation
test.rs:3:34: 3:37 help: this function's return type contains a borrowed value, but the signature does not say which one of `_arg`'s 2 elided lifetimes it is borrowed from
test.rs:4:35: 4:38 error: missing lifetime specifier [E0106]
test.rs:4 fn func2<'a>(_arg: &Thing<'a>) -> &() { unimplemented!() }
^~~
test.rs:4:35: 4:38 help: run `rustc --explain E0106` to see a detailed explanation
test.rs:4:35: 4:38 help: this function's return type contains a borrowed value, but the signature does not say which one of `_arg`'s 2 elided lifetimes it is borrowed from
error: aborting due to 2 previous errors
Each time it refers to "_arg
's 2 elided lifetimes", but in both cases only one of _arg
's lifetimes is elided.