]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-69841.rs
Auto merge of #79113 - andjo403:raw_vec_ptr, r=m-ou-se
[rust.git] / src / test / ui / issues / issue-69841.rs
1 // This is a regression test for issue rust-lang/rust#69841, which exposed an
2 // LLVM bug which needed a fix to be backported.
3
4 // run-pass
5 // no-system-llvm
6
7 fn main() {
8     let buffer = [49u8, 10];
9     let mut a : u64 = 0;
10     'read: loop {
11         for c in &buffer {
12             match c {
13                 48..=57 => {
14                     a*= 10;
15                     a+= *c as u64 - 48;
16                 }
17                 10 => {
18                     break 'read;
19                 }
20                 _ => {
21                     unsafe { std::hint::unreachable_unchecked() };
22                 }
23             }
24         }
25     }
26     if a == 1 {
27         println!("What did you expect?");
28     } else {
29         panic!("this should be unreachable.");
30     }
31 }