diff options
Diffstat (limited to 'src/test/ui/borrowck/borrowck-borrow-from-temporary.rs')
-rw-r--r-- | src/test/ui/borrowck/borrowck-borrow-from-temporary.rs | 14 |
1 files changed, 0 insertions, 14 deletions
diff --git a/src/test/ui/borrowck/borrowck-borrow-from-temporary.rs b/src/test/ui/borrowck/borrowck-borrow-from-temporary.rs deleted file mode 100644 index 92f3ffd57..000000000 --- a/src/test/ui/borrowck/borrowck-borrow-from-temporary.rs +++ /dev/null @@ -1,14 +0,0 @@ -// Test lifetimes are linked properly when we take reference -// to interior. - -fn id<T>(x: T) -> T { x } - -struct Foo(isize); - -fn foo<'a>() -> &'a isize { - let &Foo(ref x) = &id(Foo(3)); - x //~ ERROR cannot return value referencing temporary value -} - -pub fn main() { -} |