Skip to content

Commit f4a31d7

Browse files
committed
test: Add a test for trimming multiline suggestions
1 parent 53a741f commit f4a31d7

File tree

2 files changed

+39
-0
lines changed

2 files changed

+39
-0
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
//@ compile-flags: -Z ui-testing=no
2+
fn function_with_lots_of_arguments(a: i32, b: char, c: i32, d: i32, e: i32, f: i32) {}
3+
4+
fn main() {
5+
let variable_name = 42;
6+
function_with_lots_of_arguments(
7+
variable_name,
8+
variable_name,
9+
variable_name,
10+
variable_name,
11+
variable_name,
12+
);
13+
//~^^^^^^^ ERROR this function takes 6 arguments but 5 arguments were supplied [E0061]
14+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
error[E0061]: this function takes 6 arguments but 5 arguments were supplied
2+
--> $DIR/trimmed_multiline_suggestion.rs:6:5
3+
|
4+
6 | function_with_lots_of_arguments(
5+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6+
7 | variable_name,
7+
8 | variable_name,
8+
| ------------- argument #2 of type `char` is missing
9+
|
10+
note: function defined here
11+
--> $DIR/trimmed_multiline_suggestion.rs:2:4
12+
|
13+
2 | fn function_with_lots_of_arguments(a: i32, b: char, c: i32, d: i32, e: i32, f: i32) {}
14+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -------
15+
help: provide the argument
16+
|
17+
8 | function_with_lots_of_arguments(
18+
9 | variable_name,
19+
10~ /* char */,
20+
11~ variable_name,
21+
|
22+
23+
error: aborting due to 1 previous error
24+
25+
For more information about this error, try `rustc --explain E0061`.

0 commit comments

Comments
 (0)