forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of rust-lang#124605 - pitaj:lex-guarded-strings, r=<try>
Experiment: Reserve guarded string literal syntax (RFC 3593) on all editions Purpose: crater run to see if we even need to make this change on an edition boundary. This syntax change applies to all editions, because the particular syntax `#"foo"#` is unlikely to exist in the wild. Subset of rust-lang#123951 Tracking issue: rust-lang#123735 RFC: rust-lang/rfcs#3593
- Loading branch information
Showing
11 changed files
with
345 additions
and
9 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
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
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
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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
//@ compile-flags: -Zunstable-options | ||
//@ edition:2024 | ||
|
||
macro_rules! demo1 { | ||
( $a:tt ) => { println!("one tokens") }; | ||
} | ||
|
||
macro_rules! demo2 { | ||
( $a:tt $b:tt ) => { println!("two tokens") }; | ||
} | ||
|
||
macro_rules! demo3 { | ||
( $a:tt $b:tt $c:tt ) => { println!("three tokens") }; | ||
} | ||
|
||
macro_rules! demo4 { | ||
( $a:tt $b:tt $c:tt $d:tt ) => { println!("four tokens") }; | ||
} | ||
|
||
macro_rules! demo5 { | ||
( $a:tt $b:tt $c:tt $d:tt $e:tt ) => { println!("five tokens") }; | ||
} | ||
|
||
macro_rules! demo6 { | ||
( $a:tt $b:tt $c:tt $d:tt $e:tt $f:tt ) => { println!("six tokens") }; | ||
} | ||
|
||
macro_rules! demo7 { | ||
( $a:tt $b:tt $c:tt $d:tt $e:tt $f:tt $g:tt ) => { println!("seven tokens") }; | ||
} | ||
|
||
fn main() { | ||
demo1!(""); | ||
demo2!(# ""); | ||
demo3!(# ""#); | ||
demo2!(# "foo"); | ||
demo3!(## "foo"); | ||
demo3!(# "foo"#); | ||
demo4!(### "foo"); | ||
demo4!(## "foo"#); | ||
demo7!(### "foo"###); | ||
|
||
demo2!("foo"#); | ||
demo4!("foo"###); | ||
|
||
demo2!(blah"xx"); //~ ERROR prefix `blah` is unknown | ||
demo2!(blah#"xx"#); | ||
//~^ ERROR prefix `blah` is unknown | ||
//~| ERROR invalid string literal | ||
|
||
demo1!(#""); //~ ERROR invalid string literal | ||
demo1!(#""#); //~ ERROR invalid string literal | ||
demo1!(####""); //~ ERROR invalid string literal | ||
demo1!(#"foo"); //~ ERROR invalid string literal | ||
demo1!(###"foo"); //~ ERROR invalid string literal | ||
demo1!(#"foo"#); //~ ERROR invalid string literal | ||
demo1!(###"foo"#); //~ ERROR invalid string literal | ||
demo1!(###"foo"##); //~ ERROR invalid string literal | ||
demo1!(###"foo"###); //~ ERROR invalid string literal | ||
} |
Oops, something went wrong.