Skip to content

Commit 3ab98fb

Browse files
committed
Add a test
1 parent 835c6f7 commit 3ab98fb

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
fn main() {
2+
println!("{:?} {a} {a:?}", [], a = 1 + 1);
3+
//~^ ERROR type annotations needed
4+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
error[E0282]: type annotations needed
2+
--> $DIR/issue-140578-span-format_args.rs:2:30
3+
|
4+
LL | println!("{:?} {a} {a:?}", [], a = 1 + 1);
5+
| ^^ cannot infer type
6+
|
7+
= note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
8+
9+
error: aborting due to 1 previous error
10+
11+
For more information about this error, try `rustc --explain E0282`.

0 commit comments

Comments
 (0)