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:
Steve Klabnik 2015-09-03 20:10:07 -04:00
commit 055c23da7b
25 changed files with 69 additions and 69 deletions

View file

@ -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
}

View file

@ -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

View file

@ -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)