Skip to content

Commit 12ae282

Browse files
Fix diagnostic and add a test for it
1 parent df72e47 commit 12ae282

File tree

3 files changed

+15
-1
lines changed

3 files changed

+15
-1
lines changed

compiler/rustc_resolve/src/errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1089,8 +1089,8 @@ pub(crate) struct ToolWasAlreadyRegistered {
10891089
#[derive(Diagnostic)]
10901090
#[diag(resolve_tool_only_accepts_identifiers)]
10911091
pub(crate) struct ToolOnlyAcceptsIdentifiers {
1092-
#[label]
10931092
#[primary_span]
1093+
#[label]
10941094
pub(crate) span: Span,
10951095
pub(crate) tool: Symbol,
10961096
}
+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#![feature(register_tool)]
2+
3+
#![register_tool(1)]
4+
//~^ ERROR `register_tool` only accepts identifiers
5+
6+
fn main() {}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
error: `register_tool` only accepts identifiers
2+
--> $DIR/invalid-tool.rs:3:18
3+
|
4+
LL | #![register_tool(1)]
5+
| ^ not an identifier
6+
7+
error: aborting due to 1 previous error
8+

0 commit comments

Comments
 (0)