Add test for trimming with tabs (#78438)
This commit is contained in:
parent
4cbda829c0
commit
8ca8b7724f
2 changed files with 25 additions and 0 deletions
13
src/test/ui/terminal-width/tabs-trimming.rs
Normal file
13
src/test/ui/terminal-width/tabs-trimming.rs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
// Test for #78438: ensure underline alignment with many tabs on the left, long line on the right
|
||||
|
||||
// ignore-tidy-linelength
|
||||
// ignore-tidy-tab
|
||||
|
||||
fn main() {
|
||||
let money = 42i32;
|
||||
match money {
|
||||
v @ 1 | 2 | 3 => panic!("You gave me too little money {}", v), // Long text here: TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT
|
||||
//~^ ERROR variable `v` is not bound in all patterns
|
||||
v => println!("Enough money {}", v),
|
||||
}
|
||||
}
|
||||
12
src/test/ui/terminal-width/tabs-trimming.stderr
Normal file
12
src/test/ui/terminal-width/tabs-trimming.stderr
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
error[E0408]: variable `v` is not bound in all patterns
|
||||
--> $DIR/tabs-trimming.rs:9:16
|
||||
|
|
||||
LL | ... v @ 1 | 2 | 3 => panic!("You gave me too little money {}", v), // Long text here: TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTT...
|
||||
| - ^ ^ pattern doesn't bind `v`
|
||||
| | |
|
||||
| | pattern doesn't bind `v`
|
||||
| variable not in all patterns
|
||||
|
||||
error: aborting due to previous error
|
||||
|
||||
For more information about this error, try `rustc --explain E0408`.
|
||||
Loading…
Add table
Add a link
Reference in a new issue