This repository has been archived by the owner on Oct 6, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reject byte literal and byte string literal inside paste
- Loading branch information
Showing
3 changed files
with
41 additions
and
5 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,7 +1,21 @@ | ||
use paste::paste; | ||
|
||
paste! { | ||
fn [<1e+100>]() {} | ||
fn [<x 1e+100 z>]() {} | ||
} | ||
|
||
paste! { | ||
// `xyz` is not correct. `xbyz` is certainly not correct. Maybe `x121z` | ||
// would be justifiable but for now don't accept this. | ||
fn [<x b'y' z>]() {} | ||
} | ||
|
||
paste! { | ||
fn [<x b"y" z>]() {} | ||
} | ||
|
||
paste! { | ||
fn [<x br"y" z>]() {} | ||
} | ||
|
||
fn main() {} |
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,23 @@ | ||
error: unsupported literal | ||
--> tests/ui/unsupported-literal.rs:4:10 | ||
--> tests/ui/unsupported-literal.rs:4:12 | ||
| | ||
4 | fn [<1e+100>]() {} | ||
| ^^^^^^ | ||
4 | fn [<x 1e+100 z>]() {} | ||
| ^^^^^^ | ||
|
||
error: unsupported literal | ||
--> tests/ui/unsupported-literal.rs:10:12 | ||
| | ||
10 | fn [<x b'y' z>]() {} | ||
| ^^^^ | ||
|
||
error: unsupported literal | ||
--> tests/ui/unsupported-literal.rs:14:12 | ||
| | ||
14 | fn [<x b"y" z>]() {} | ||
| ^^^^ | ||
|
||
error: unsupported literal | ||
--> tests/ui/unsupported-literal.rs:18:12 | ||
| | ||
18 | fn [<x br"y" z>]() {} | ||
| ^^^^^ |