Rollup merge of #28167 - petrochenkov:bytelit, r=nikomatsakis
Avoid confusion with binary integer literals and binary operator expressions in libsyntax
This commit is contained in:
commit
055c23da7b
25 changed files with 69 additions and 69 deletions
|
|
@ -9,8 +9,8 @@
|
|||
// except according to those terms.
|
||||
|
||||
fn main() {
|
||||
concat!(b'f'); //~ ERROR: cannot concatenate a binary literal
|
||||
concat!(b"foo"); //~ ERROR: cannot concatenate a binary literal
|
||||
concat!(b'f'); //~ ERROR: cannot concatenate a byte string literal
|
||||
concat!(b"foo"); //~ ERROR: cannot concatenate a byte string literal
|
||||
concat!(foo); //~ ERROR: expected a literal
|
||||
concat!(foo()); //~ ERROR: expected a literal
|
||||
}
|
||||
|
|
|
|||
|
|
@ -20,10 +20,10 @@ extern
|
|||
{}
|
||||
|
||||
fn main() {
|
||||
""suffix; //~ ERROR str literal with a suffix is invalid
|
||||
b""suffix; //~ ERROR binary str literal with a suffix is invalid
|
||||
r#""#suffix; //~ ERROR str literal with a suffix is invalid
|
||||
br#""#suffix; //~ ERROR binary str literal with a suffix is invalid
|
||||
""suffix; //~ ERROR string literal with a suffix is invalid
|
||||
b""suffix; //~ ERROR byte string literal with a suffix is invalid
|
||||
r#""#suffix; //~ ERROR string literal with a suffix is invalid
|
||||
br#""#suffix; //~ ERROR byte string literal with a suffix is invalid
|
||||
'a'suffix; //~ ERROR char literal with a suffix is invalid
|
||||
b'a'suffix; //~ ERROR byte literal with a suffix is invalid
|
||||
|
||||
|
|
|
|||
|
|
@ -11,5 +11,5 @@ all:
|
|||
$(RUSTC) lib.rs --emit=asm --crate-type=staticlib
|
||||
# just check for symbol declarations with the names we're expecting.
|
||||
grep 'str[0-9][0-9]*:' $(OUT)
|
||||
grep 'binary[0-9][0-9]*:' $(OUT)
|
||||
grep 'byte_str[0-9][0-9]*:' $(OUT)
|
||||
grep 'vtable[0-9][0-9]*' $(OUT)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue