Skip to content

Commit 62b52ee

Browse files
committed
Clarify error message about arguments
1 parent a139e0a commit 62b52ee

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

impl/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ where
5555
let len = source.clone().into_iter().count();
5656
if len != 1 {
5757
panic!(
58-
"argument must be a single string literal, but got {} arguments",
58+
"argument must be a single string literal, but got {} tokens",
5959
len
6060
);
6161
}

tests/tests/ui-stable/no-arguments.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: proc-macro derive panicked
44
13 | indoc!();
55
| ^^^^^^^^^
66
|
7-
= help: message: argument must be a single string literal, but got 0 arguments
7+
= help: message: argument must be a single string literal, but got 0 tokens
88
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
99

1010
error: aborting due to previous error

tests/tests/ui-stable/two-arguments.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ error: proc-macro derive panicked
88
17 | | " 64);
99
| |______________^
1010
|
11-
= help: message: argument must be a single string literal, but got 2 arguments
11+
= help: message: argument must be a single string literal, but got 2 tokens
1212
= note: this error originates in a macro outside of the current crate (in Nightly builds, run with -Z external-macro-backtrace for more info)
1313

1414
error: aborting due to previous error

tests/tests/ui-unstable/no-arguments.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ error: proc macro panicked
44
15 | indoc!();
55
| ^^^^^^^^^
66
|
7-
= help: message: argument must be a single string literal, but got 0 arguments
7+
= help: message: argument must be a single string literal, but got 0 tokens
88

99
error: aborting due to previous error
1010

tests/tests/ui-unstable/two-arguments.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ error: proc macro panicked
88
19 | | " 64);
99
| |______________^
1010
|
11-
= help: message: argument must be a single string literal, but got 2 arguments
11+
= help: message: argument must be a single string literal, but got 2 tokens
1212

1313
error: aborting due to previous error
1414

0 commit comments

Comments
 (0)