diff options
Diffstat (limited to '')
-rw-r--r-- | tests/ui/lexer/error-stage.rs (renamed from src/test/ui/lexer/error-stage.rs) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/error-stage.stderr (renamed from src/test/ui/lexer/error-stage.stderr) | 2 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bad-binary-literal.rs (renamed from src/test/ui/lexer/lex-bad-binary-literal.rs) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bad-binary-literal.stderr (renamed from src/test/ui/lexer/lex-bad-binary-literal.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bad-char-literals-1.rs (renamed from src/test/ui/lexer/lex-bad-char-literals-1.rs) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bad-char-literals-1.stderr (renamed from src/test/ui/lexer/lex-bad-char-literals-1.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bad-char-literals-2.rs (renamed from src/test/ui/lexer/lex-bad-char-literals-2.rs) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bad-char-literals-2.stderr (renamed from src/test/ui/lexer/lex-bad-char-literals-2.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bad-char-literals-3.rs (renamed from src/test/ui/lexer/lex-bad-char-literals-3.rs) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bad-char-literals-3.stderr (renamed from src/test/ui/lexer/lex-bad-char-literals-3.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bad-char-literals-4.rs (renamed from src/test/ui/lexer/lex-bad-char-literals-4.rs) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bad-char-literals-4.stderr (renamed from src/test/ui/lexer/lex-bad-char-literals-4.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bad-char-literals-5.rs (renamed from src/test/ui/lexer/lex-bad-char-literals-5.rs) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bad-char-literals-5.stderr (renamed from src/test/ui/lexer/lex-bad-char-literals-5.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bad-char-literals-6.rs (renamed from src/test/ui/lexer/lex-bad-char-literals-6.rs) | 2 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bad-char-literals-6.stderr | 44 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bad-char-literals-7.rs (renamed from src/test/ui/lexer/lex-bad-char-literals-7.rs) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bad-char-literals-7.stderr (renamed from src/test/ui/lexer/lex-bad-char-literals-7.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bad-numeric-literals.rs (renamed from src/test/ui/lexer/lex-bad-numeric-literals.rs) | 8 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bad-numeric-literals.stderr | 169 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bad-octal-literal.rs (renamed from src/test/ui/lexer/lex-bad-octal-literal.rs) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bad-octal-literal.stderr (renamed from src/test/ui/lexer/lex-bad-octal-literal.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bad-token.rs (renamed from src/test/ui/lexer/lex-bad-token.rs) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bad-token.stderr (renamed from src/test/ui/lexer/lex-bad-token.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bare-cr-nondoc-comment.rs (renamed from src/test/ui/lexer/lex-bare-cr-nondoc-comment.rs) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bare-cr-string-literal-doc-comment.rs (renamed from src/test/ui/lexer/lex-bare-cr-string-literal-doc-comment.rs) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lex-bare-cr-string-literal-doc-comment.stderr (renamed from src/test/ui/lexer/lex-bare-cr-string-literal-doc-comment.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lex-emoji-identifiers.rs (renamed from src/test/ui/lexer/lex-emoji-identifiers.rs) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lex-emoji-identifiers.stderr (renamed from src/test/ui/lexer/lex-emoji-identifiers.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lex-stray-backslash.rs (renamed from src/test/ui/lexer/lex-stray-backslash.rs) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lex-stray-backslash.stderr (renamed from src/test/ui/lexer/lex-stray-backslash.stderr) | 0 | ||||
-rw-r--r-- | tests/ui/lexer/lexer-crlf-line-endings-string-literal-doc-comment.rs (renamed from src/test/ui/lexer/lexer-crlf-line-endings-string-literal-doc-comment.rs) | 0 |
32 files changed, 223 insertions, 2 deletions
diff --git a/src/test/ui/lexer/error-stage.rs b/tests/ui/lexer/error-stage.rs index c8d88f745..c8d88f745 100644 --- a/src/test/ui/lexer/error-stage.rs +++ b/tests/ui/lexer/error-stage.rs diff --git a/src/test/ui/lexer/error-stage.stderr b/tests/ui/lexer/error-stage.stderr index 697a7c28d..ecbdb14dc 100644 --- a/src/test/ui/lexer/error-stage.stderr +++ b/tests/ui/lexer/error-stage.stderr @@ -49,6 +49,8 @@ error: integer literal is too large | LL | 999340282366920938463463374607431768211455999; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: value exceeds limit of `340282366920938463463374607431768211455` error: aborting due to 8 previous errors diff --git a/src/test/ui/lexer/lex-bad-binary-literal.rs b/tests/ui/lexer/lex-bad-binary-literal.rs index 7df98073e..7df98073e 100644 --- a/src/test/ui/lexer/lex-bad-binary-literal.rs +++ b/tests/ui/lexer/lex-bad-binary-literal.rs diff --git a/src/test/ui/lexer/lex-bad-binary-literal.stderr b/tests/ui/lexer/lex-bad-binary-literal.stderr index 992b3d248..992b3d248 100644 --- a/src/test/ui/lexer/lex-bad-binary-literal.stderr +++ b/tests/ui/lexer/lex-bad-binary-literal.stderr diff --git a/src/test/ui/lexer/lex-bad-char-literals-1.rs b/tests/ui/lexer/lex-bad-char-literals-1.rs index e7951cfd2..e7951cfd2 100644 --- a/src/test/ui/lexer/lex-bad-char-literals-1.rs +++ b/tests/ui/lexer/lex-bad-char-literals-1.rs diff --git a/src/test/ui/lexer/lex-bad-char-literals-1.stderr b/tests/ui/lexer/lex-bad-char-literals-1.stderr index e6ff1f662..e6ff1f662 100644 --- a/src/test/ui/lexer/lex-bad-char-literals-1.stderr +++ b/tests/ui/lexer/lex-bad-char-literals-1.stderr diff --git a/src/test/ui/lexer/lex-bad-char-literals-2.rs b/tests/ui/lexer/lex-bad-char-literals-2.rs index d35dafd9a..d35dafd9a 100644 --- a/src/test/ui/lexer/lex-bad-char-literals-2.rs +++ b/tests/ui/lexer/lex-bad-char-literals-2.rs diff --git a/src/test/ui/lexer/lex-bad-char-literals-2.stderr b/tests/ui/lexer/lex-bad-char-literals-2.stderr index c2b19a7ad..c2b19a7ad 100644 --- a/src/test/ui/lexer/lex-bad-char-literals-2.stderr +++ b/tests/ui/lexer/lex-bad-char-literals-2.stderr diff --git a/src/test/ui/lexer/lex-bad-char-literals-3.rs b/tests/ui/lexer/lex-bad-char-literals-3.rs index 5194ff4d9..5194ff4d9 100644 --- a/src/test/ui/lexer/lex-bad-char-literals-3.rs +++ b/tests/ui/lexer/lex-bad-char-literals-3.rs diff --git a/src/test/ui/lexer/lex-bad-char-literals-3.stderr b/tests/ui/lexer/lex-bad-char-literals-3.stderr index 62a5e424c..62a5e424c 100644 --- a/src/test/ui/lexer/lex-bad-char-literals-3.stderr +++ b/tests/ui/lexer/lex-bad-char-literals-3.stderr diff --git a/src/test/ui/lexer/lex-bad-char-literals-4.rs b/tests/ui/lexer/lex-bad-char-literals-4.rs index de0a19df9..de0a19df9 100644 --- a/src/test/ui/lexer/lex-bad-char-literals-4.rs +++ b/tests/ui/lexer/lex-bad-char-literals-4.rs diff --git a/src/test/ui/lexer/lex-bad-char-literals-4.stderr b/tests/ui/lexer/lex-bad-char-literals-4.stderr index fec4421c4..fec4421c4 100644 --- a/src/test/ui/lexer/lex-bad-char-literals-4.stderr +++ b/tests/ui/lexer/lex-bad-char-literals-4.stderr diff --git a/src/test/ui/lexer/lex-bad-char-literals-5.rs b/tests/ui/lexer/lex-bad-char-literals-5.rs index 0c4339edc..0c4339edc 100644 --- a/src/test/ui/lexer/lex-bad-char-literals-5.rs +++ b/tests/ui/lexer/lex-bad-char-literals-5.rs diff --git a/src/test/ui/lexer/lex-bad-char-literals-5.stderr b/tests/ui/lexer/lex-bad-char-literals-5.stderr index 184817a65..184817a65 100644 --- a/src/test/ui/lexer/lex-bad-char-literals-5.stderr +++ b/tests/ui/lexer/lex-bad-char-literals-5.stderr diff --git a/src/test/ui/lexer/lex-bad-char-literals-6.rs b/tests/ui/lexer/lex-bad-char-literals-6.rs index 4379b4fa6..1b498c0fb 100644 --- a/src/test/ui/lexer/lex-bad-char-literals-6.rs +++ b/tests/ui/lexer/lex-bad-char-literals-6.rs @@ -7,10 +7,8 @@ fn main() { //~^ ERROR: character literal may only contain one codepoint if x == y {} - //~^ ERROR: can't compare `&str` with `char` if y == z {} // no error here if x == z {} - //~^ ERROR: can't compare `&str` with `char` let a: usize = ""; //~^ ERROR: mismatched types diff --git a/tests/ui/lexer/lex-bad-char-literals-6.stderr b/tests/ui/lexer/lex-bad-char-literals-6.stderr new file mode 100644 index 000000000..2fe30304a --- /dev/null +++ b/tests/ui/lexer/lex-bad-char-literals-6.stderr @@ -0,0 +1,44 @@ +error: character literal may only contain one codepoint + --> $DIR/lex-bad-char-literals-6.rs:2:19 + | +LL | let x: &str = 'ab'; + | ^^^^ + | +help: if you meant to write a `str` literal, use double quotes + | +LL | let x: &str = "ab"; + | ~~~~ + +error: character literal may only contain one codepoint + --> $DIR/lex-bad-char-literals-6.rs:4:19 + | +LL | let y: char = 'cd'; + | ^^^^ + | +help: if you meant to write a `str` literal, use double quotes + | +LL | let y: char = "cd"; + | ~~~~ + +error: character literal may only contain one codepoint + --> $DIR/lex-bad-char-literals-6.rs:6:13 + | +LL | let z = 'ef'; + | ^^^^ + | +help: if you meant to write a `str` literal, use double quotes + | +LL | let z = "ef"; + | ~~~~ + +error[E0308]: mismatched types + --> $DIR/lex-bad-char-literals-6.rs:13:20 + | +LL | let a: usize = ""; + | ----- ^^ expected `usize`, found `&str` + | | + | expected due to this + +error: aborting due to 4 previous errors + +For more information about this error, try `rustc --explain E0308`. diff --git a/src/test/ui/lexer/lex-bad-char-literals-7.rs b/tests/ui/lexer/lex-bad-char-literals-7.rs index c675df2f3..c675df2f3 100644 --- a/src/test/ui/lexer/lex-bad-char-literals-7.rs +++ b/tests/ui/lexer/lex-bad-char-literals-7.rs diff --git a/src/test/ui/lexer/lex-bad-char-literals-7.stderr b/tests/ui/lexer/lex-bad-char-literals-7.stderr index 255b9c689..255b9c689 100644 --- a/src/test/ui/lexer/lex-bad-char-literals-7.stderr +++ b/tests/ui/lexer/lex-bad-char-literals-7.stderr diff --git a/src/test/ui/lexer/lex-bad-numeric-literals.rs b/tests/ui/lexer/lex-bad-numeric-literals.rs index cf8440ca4..56bdc50e4 100644 --- a/src/test/ui/lexer/lex-bad-numeric-literals.rs +++ b/tests/ui/lexer/lex-bad-numeric-literals.rs @@ -1,3 +1,5 @@ +// ignore-tidy-linelength + fn main() { 0o1.0; //~ ERROR: octal float literal is not supported 0o2f32; //~ ERROR: octal float literal is not supported @@ -15,6 +17,12 @@ fn main() { //~^ ERROR: integer literal is too large 9900000000000000000000000000999999999999999999999999999999; //~^ ERROR: integer literal is too large + 0b111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110; + //~^ ERROR: integer literal is too large + 0o37777777777777777777777777777777777777777770; + //~^ ERROR: integer literal is too large + 0xffffffffffffffffffffffffffffffff0; + //~^ ERROR: integer literal is too large 0x; //~ ERROR: no valid digits 0xu32; //~ ERROR: no valid digits 0ou32; //~ ERROR: no valid digits diff --git a/tests/ui/lexer/lex-bad-numeric-literals.stderr b/tests/ui/lexer/lex-bad-numeric-literals.stderr new file mode 100644 index 000000000..145754197 --- /dev/null +++ b/tests/ui/lexer/lex-bad-numeric-literals.stderr @@ -0,0 +1,169 @@ +error: octal float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:4:5 + | +LL | 0o1.0; + | ^^^^^ + +error: octal float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:6:5 + | +LL | 0o3.0f32; + | ^^^^^ + +error: octal float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:7:5 + | +LL | 0o4e4; + | ^^^^^ + +error: octal float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:8:5 + | +LL | 0o5.0e5; + | ^^^^^^^ + +error: octal float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:9:5 + | +LL | 0o6e6f32; + | ^^^^^ + +error: octal float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:10:5 + | +LL | 0o7.0e7f64; + | ^^^^^^^ + +error: hexadecimal float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:11:5 + | +LL | 0x8.0e+9; + | ^^^^^^^^ + +error: hexadecimal float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:12:5 + | +LL | 0x9.0e-9; + | ^^^^^^^^ + +error[E0768]: no valid digits found for number + --> $DIR/lex-bad-numeric-literals.rs:13:5 + | +LL | 0o; + | ^^ + +error: expected at least one digit in exponent + --> $DIR/lex-bad-numeric-literals.rs:14:5 + | +LL | 1e+; + | ^^^ + +error: hexadecimal float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:15:5 + | +LL | 0x539.0; + | ^^^^^^^ + +error[E0768]: no valid digits found for number + --> $DIR/lex-bad-numeric-literals.rs:26:5 + | +LL | 0x; + | ^^ + +error[E0768]: no valid digits found for number + --> $DIR/lex-bad-numeric-literals.rs:27:5 + | +LL | 0xu32; + | ^^ + +error[E0768]: no valid digits found for number + --> $DIR/lex-bad-numeric-literals.rs:28:5 + | +LL | 0ou32; + | ^^ + +error[E0768]: no valid digits found for number + --> $DIR/lex-bad-numeric-literals.rs:29:5 + | +LL | 0bu32; + | ^^ + +error[E0768]: no valid digits found for number + --> $DIR/lex-bad-numeric-literals.rs:30:5 + | +LL | 0b; + | ^^ + +error: octal float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:32:5 + | +LL | 0o123.456; + | ^^^^^^^^^ + +error: binary float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:34:5 + | +LL | 0b111.101; + | ^^^^^^^^^ + +error: octal float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:5:5 + | +LL | 0o2f32; + | ^^^^^^ not supported + +error: integer literal is too large + --> $DIR/lex-bad-numeric-literals.rs:16:5 + | +LL | 9900000000000000000000000000999999999999999999999999999999; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: value exceeds limit of `340282366920938463463374607431768211455` + +error: integer literal is too large + --> $DIR/lex-bad-numeric-literals.rs:18:5 + | +LL | 9900000000000000000000000000999999999999999999999999999999; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: value exceeds limit of `340282366920938463463374607431768211455` + +error: integer literal is too large + --> $DIR/lex-bad-numeric-literals.rs:20:5 + | +LL | 0b111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111110; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: value exceeds limit of `0b11111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111` + +error: integer literal is too large + --> $DIR/lex-bad-numeric-literals.rs:22:5 + | +LL | 0o37777777777777777777777777777777777777777770; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: value exceeds limit of `0o3777777777777777777777777777777777777777777` + +error: integer literal is too large + --> $DIR/lex-bad-numeric-literals.rs:24:5 + | +LL | 0xffffffffffffffffffffffffffffffff0; + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + | + = note: value exceeds limit of `0xffffffffffffffffffffffffffffffff` + +error: octal float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:31:5 + | +LL | 0o123f64; + | ^^^^^^^^ not supported + +error: binary float literal is not supported + --> $DIR/lex-bad-numeric-literals.rs:33:5 + | +LL | 0b101f64; + | ^^^^^^^^ not supported + +error: aborting due to 26 previous errors + +For more information about this error, try `rustc --explain E0768`. diff --git a/src/test/ui/lexer/lex-bad-octal-literal.rs b/tests/ui/lexer/lex-bad-octal-literal.rs index 49631f16b..49631f16b 100644 --- a/src/test/ui/lexer/lex-bad-octal-literal.rs +++ b/tests/ui/lexer/lex-bad-octal-literal.rs diff --git a/src/test/ui/lexer/lex-bad-octal-literal.stderr b/tests/ui/lexer/lex-bad-octal-literal.stderr index 2cb8ca5de..2cb8ca5de 100644 --- a/src/test/ui/lexer/lex-bad-octal-literal.stderr +++ b/tests/ui/lexer/lex-bad-octal-literal.stderr diff --git a/src/test/ui/lexer/lex-bad-token.rs b/tests/ui/lexer/lex-bad-token.rs index 9e4824611..9e4824611 100644 --- a/src/test/ui/lexer/lex-bad-token.rs +++ b/tests/ui/lexer/lex-bad-token.rs diff --git a/src/test/ui/lexer/lex-bad-token.stderr b/tests/ui/lexer/lex-bad-token.stderr index 43c43721b..43c43721b 100644 --- a/src/test/ui/lexer/lex-bad-token.stderr +++ b/tests/ui/lexer/lex-bad-token.stderr diff --git a/src/test/ui/lexer/lex-bare-cr-nondoc-comment.rs b/tests/ui/lexer/lex-bare-cr-nondoc-comment.rs index 5b528d6e1..5b528d6e1 100644 --- a/src/test/ui/lexer/lex-bare-cr-nondoc-comment.rs +++ b/tests/ui/lexer/lex-bare-cr-nondoc-comment.rs diff --git a/src/test/ui/lexer/lex-bare-cr-string-literal-doc-comment.rs b/tests/ui/lexer/lex-bare-cr-string-literal-doc-comment.rs index b7752e1f0..b7752e1f0 100644 --- a/src/test/ui/lexer/lex-bare-cr-string-literal-doc-comment.rs +++ b/tests/ui/lexer/lex-bare-cr-string-literal-doc-comment.rs diff --git a/src/test/ui/lexer/lex-bare-cr-string-literal-doc-comment.stderr b/tests/ui/lexer/lex-bare-cr-string-literal-doc-comment.stderr index 1a21fed63..1a21fed63 100644 --- a/src/test/ui/lexer/lex-bare-cr-string-literal-doc-comment.stderr +++ b/tests/ui/lexer/lex-bare-cr-string-literal-doc-comment.stderr diff --git a/src/test/ui/lexer/lex-emoji-identifiers.rs b/tests/ui/lexer/lex-emoji-identifiers.rs index 91b5929c0..91b5929c0 100644 --- a/src/test/ui/lexer/lex-emoji-identifiers.rs +++ b/tests/ui/lexer/lex-emoji-identifiers.rs diff --git a/src/test/ui/lexer/lex-emoji-identifiers.stderr b/tests/ui/lexer/lex-emoji-identifiers.stderr index 6237c5d02..6237c5d02 100644 --- a/src/test/ui/lexer/lex-emoji-identifiers.stderr +++ b/tests/ui/lexer/lex-emoji-identifiers.stderr diff --git a/src/test/ui/lexer/lex-stray-backslash.rs b/tests/ui/lexer/lex-stray-backslash.rs index bb27f44c2..bb27f44c2 100644 --- a/src/test/ui/lexer/lex-stray-backslash.rs +++ b/tests/ui/lexer/lex-stray-backslash.rs diff --git a/src/test/ui/lexer/lex-stray-backslash.stderr b/tests/ui/lexer/lex-stray-backslash.stderr index 06dc0f2b5..06dc0f2b5 100644 --- a/src/test/ui/lexer/lex-stray-backslash.stderr +++ b/tests/ui/lexer/lex-stray-backslash.stderr diff --git a/src/test/ui/lexer/lexer-crlf-line-endings-string-literal-doc-comment.rs b/tests/ui/lexer/lexer-crlf-line-endings-string-literal-doc-comment.rs index 802be7f5a..802be7f5a 100644 --- a/src/test/ui/lexer/lexer-crlf-line-endings-string-literal-doc-comment.rs +++ b/tests/ui/lexer/lexer-crlf-line-endings-string-literal-doc-comment.rs |