This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Expand file tree Collapse file tree 3 files changed +27
-2
lines changed Original file line number Diff line number Diff line change @@ -478,8 +478,10 @@ impl EarlyLintPass for Diagnostics {
478
478
}
479
479
if !segments.iter().all(|(name, args)| {
480
480
let arg = match name.as_str() {
481
- "struct_span_err" | "span_note" | "span_label" | "span_help" => &args[1],
482
- "note" | "help" => &args[0],
481
+ "struct_span_err" | "span_note" | "span_label" | "span_help" if args.len() == 2 => {
482
+ &args[1]
483
+ }
484
+ "note" | "help" if args.len() == 1 => &args[0],
483
485
_ => {
484
486
return false;
485
487
}
Original file line number Diff line number Diff line change
1
+ // compile-flags: -Zunstable-options
2
+
3
+ pub fn issue_111280 ( ) {
4
+ struct_span_err ( msg) . emit ( ) ; //~ ERROR cannot find value `msg`
5
+ //~^ ERROR cannot find function `struct_span_err`
6
+ }
7
+
8
+ fn main ( ) { }
Original file line number Diff line number Diff line change
1
+ error[E0425]: cannot find value `msg` in this scope
2
+ --> $DIR/trivial-diagnostics.rs:4:21
3
+ |
4
+ LL | struct_span_err(msg).emit();
5
+ | ^^^ not found in this scope
6
+
7
+ error[E0425]: cannot find function `struct_span_err` in this scope
8
+ --> $DIR/trivial-diagnostics.rs:4:5
9
+ |
10
+ LL | struct_span_err(msg).emit();
11
+ | ^^^^^^^^^^^^^^^ not found in this scope
12
+
13
+ error: aborting due to 2 previous errors
14
+
15
+ For more information about this error, try `rustc --explain E0425`.
You can’t perform that action at this time.
0 commit comments