]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/borrowck-storage-dead.rs
Rollup merge of #106726 - cmorin6:fix-comment-typos, r=Nilstrieb
[rust.git] / tests / ui / borrowck / borrowck-storage-dead.rs
1 fn ok() {
2     loop {
3         let _x = 1;
4     }
5 }
6
7 fn also_ok() {
8     loop {
9         let _x = String::new();
10     }
11 }
12
13 fn fail() {
14     loop {
15         let x: i32;
16         let _ = x + 1; //~ERROR [E0381]
17     }
18 }
19
20 fn main() {
21     ok();
22     also_ok();
23     fail();
24 }