diff options
Diffstat (limited to 'src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.rs')
-rw-r--r-- | src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.rs | 22 |
1 files changed, 0 insertions, 22 deletions
diff --git a/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.rs b/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.rs deleted file mode 100644 index e384aacb7..000000000 --- a/src/test/ui/borrowck/borrowck-borrowed-uniq-rvalue-2.rs +++ /dev/null @@ -1,22 +0,0 @@ -struct Defer<'a> { - x: &'a [&'a str], -} - -impl<'a> Drop for Defer<'a> { - fn drop(&mut self) { - unsafe { - println!("{:?}", self.x); - } - } -} - -fn defer<'r>(x: &'r [&'r str]) -> Defer<'r> { - Defer { - x: x - } -} - -fn main() { - let x = defer(&vec!["Goodbye", "world!"]); //~ ERROR temporary value dropped while borrowed - x.x[0]; -} |