Skip to content

Commit 8ca8b77

Browse files
committed
Add test for trimming with tabs (rust-lang#78438)
1 parent 4cbda82 commit 8ca8b77

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// Test for #78438: ensure underline alignment with many tabs on the left, long line on the right
2+
3+
// ignore-tidy-linelength
4+
// ignore-tidy-tab
5+
6+
fn main() {
7+
let money = 42i32;
8+
match money {
9+
v @ 1 | 2 | 3 => panic!("You gave me too little money {}", v), // Long text here: TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
10+
//~^ ERROR variable `v` is not bound in all patterns
11+
v => println!("Enough money {}", v),
12+
}
13+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
error[E0408]: variable `v` is not bound in all patterns
2+
--> $DIR/tabs-trimming.rs:9:16
3+
|
4+
LL | ... v @ 1 | 2 | 3 => panic!("You gave me too little money {}", v), // Long text here: TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT...
5+
| - ^ ^ pattern doesn't bind `v`
6+
| | |
7+
| | pattern doesn't bind `v`
8+
| variable not in all patterns
9+
10+
error: aborting due to previous error
11+
12+
For more information about this error, try `rustc --explain E0408`.

0 commit comments

Comments
 (0)