diff options
Diffstat (limited to 'tests/ui/borrowck/borrowck-break-uninit.rs')
-rw-r--r-- | tests/ui/borrowck/borrowck-break-uninit.rs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/ui/borrowck/borrowck-break-uninit.rs b/tests/ui/borrowck/borrowck-break-uninit.rs new file mode 100644 index 000000000..824f91dbc --- /dev/null +++ b/tests/ui/borrowck/borrowck-break-uninit.rs @@ -0,0 +1,14 @@ +fn foo() -> isize { + let x: isize; + + loop { + break; + x = 0; + } + + println!("{}", x); //~ ERROR E0381 + + return 17; +} + +fn main() { println!("{}", foo()); } |