-
Notifications
You must be signed in to change notification settings - Fork 154
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve error message for non-string literals (#265)
Closes #208
- Loading branch information
1 parent
ce6458a
commit 8990049
Showing
5 changed files
with
124 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,53 @@ | ||
error: expected string | ||
error: literal must be double-quoted: `"42"` | ||
--> $DIR/non-string-literal.rs:5:9 | ||
| | ||
5 | 42 | ||
| ^^ | ||
|
||
error: literal must be double-quoted: `"42usize"` | ||
--> $DIR/non-string-literal.rs:6:9 | ||
| | ||
6 | 42usize | ||
| ^^^^^^^ | ||
|
||
error: literal must be double-quoted: `"42.0"` | ||
--> $DIR/non-string-literal.rs:7:9 | ||
| | ||
7 | 42.0 | ||
| ^^^^ | ||
|
||
error: literal must be double-quoted: `"a"` | ||
--> $DIR/non-string-literal.rs:8:9 | ||
| | ||
8 | 'a' | ||
| ^^^ | ||
|
||
error: expected string | ||
--> $DIR/non-string-literal.rs:9:9 | ||
| | ||
9 | b"a" | ||
| ^^^^ | ||
|
||
error: expected string | ||
--> $DIR/non-string-literal.rs:10:9 | ||
| | ||
10 | b'a' | ||
| ^^^^ | ||
|
||
error: attribute value must be a string | ||
--> $DIR/non-string-literal.rs:13:24 | ||
| | ||
13 | input disabled=true; | ||
| ^^^^ | ||
| | ||
= help: to declare an empty attribute, omit the equals sign: `disabled` | ||
= help: to toggle the attribute, use square brackets: `disabled[some_boolean_flag]` | ||
|
||
error: attribute value must be a string | ||
--> $DIR/non-string-literal.rs:14:24 | ||
| | ||
14 | input disabled=false; | ||
| ^^^^^ | ||
| | ||
= help: to declare an empty attribute, omit the equals sign: `disabled` | ||
= help: to toggle the attribute, use square brackets: `disabled[some_boolean_flag]` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters