commit | ff3f07ae99a30006dd85b9d73084edd9355c9db6 | [log] [tgz] |
---|---|---|
author | Inna Palant <[email protected]> | Thu Jul 11 16:15:26 2019 -0700 |
committer | Inna Palant <[email protected]> | Thu Jul 11 16:15:26 2019 -0700 |
tree | 9b2deb7c36a21e826cc70d2650e4664c8961664c | |
parent | 84ed444a53203c4150a519c427f39e18a0711363 [diff] [blame] |
Initial check in Bug: 137197907
diff --git a/src/test/ui/span/borrowck-ref-into-rvalue.rs b/src/test/ui/span/borrowck-ref-into-rvalue.rs new file mode 100644 index 0000000..aeaebf0 --- /dev/null +++ b/src/test/ui/span/borrowck-ref-into-rvalue.rs
@@ -0,0 +1,11 @@ +fn main() { + let msg; + match Some("Hello".to_string()) { + Some(ref m) => { + //~^ ERROR borrowed value does not live long enough + msg = m; + }, + None => { panic!() } + } + println!("{}", *msg); +}