diff options
Diffstat (limited to 'src/test')
| -rw-r--r-- | src/test/compile-fail/lifetime-elision-return-type-requires-explicit-lifetime.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/test/compile-fail/lifetime-elision-return-type-requires-explicit-lifetime.rs b/src/test/compile-fail/lifetime-elision-return-type-requires-explicit-lifetime.rs index aef3f7a40b5..5fa8c5db5b0 100644 --- a/src/test/compile-fail/lifetime-elision-return-type-requires-explicit-lifetime.rs +++ b/src/test/compile-fail/lifetime-elision-return-type-requires-explicit-lifetime.rs @@ -10,11 +10,13 @@ // Lifetime annotation needed because we have no arguments. fn f() -> &int { //~ ERROR missing lifetime specifier +//~^ NOTE there is no value for it to be borrowed from fail!() } // Lifetime annotation needed because we have two by-reference parameters. -fn g(_: &int, _: &int) -> &int { //~ ERROR missing lifetime specifier +fn g(_x: &int, _y: &int) -> &int { //~ ERROR missing lifetime specifier +//~^ NOTE the signature does not say whether it is borrowed from `_x` or `_y` fail!() } @@ -24,7 +26,8 @@ struct Foo<'a> { // Lifetime annotation needed because we have two lifetimes: one as a parameter // and one on the reference. -fn h(_: &Foo) -> &int { //~ ERROR missing lifetime specifier +fn h(_x: &Foo) -> &int { //~ ERROR missing lifetime specifier +//~^ NOTE the signature does not say which one of `_x`'s 2 elided lifetimes it is borrowed from fail!() } |
