diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:39 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:20:39 +0000 |
commit | 1376c5a617be5c25655d0d7cb63e3beaa5a6e026 (patch) | |
tree | 3bb8d61aee02bc7a15eab3f36e3b921afc2075d0 /tests/ui/parser/issues | |
parent | Releasing progress-linux version 1.69.0+dfsg1-1~progress7.99u1. (diff) | |
download | rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.tar.xz rustc-1376c5a617be5c25655d0d7cb63e3beaa5a6e026.zip |
Merging upstream version 1.70.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'tests/ui/parser/issues')
-rw-r--r-- | tests/ui/parser/issues/issue-104088.rs | 25 | ||||
-rw-r--r-- | tests/ui/parser/issues/issue-104088.stderr | 56 | ||||
-rw-r--r-- | tests/ui/parser/issues/issue-108242-semicolon-recovery.rs | 5 | ||||
-rw-r--r-- | tests/ui/parser/issues/issue-108242-semicolon-recovery.stderr | 13 | ||||
-rw-r--r-- | tests/ui/parser/issues/issue-110014.rs | 3 | ||||
-rw-r--r-- | tests/ui/parser/issues/issue-110014.stderr | 19 | ||||
-rw-r--r-- | tests/ui/parser/issues/issue-48508.rs | 1 | ||||
-rw-r--r-- | tests/ui/parser/issues/issue-65846-rollback-gating-failing-matcher.rs | 14 |
8 files changed, 102 insertions, 34 deletions
diff --git a/tests/ui/parser/issues/issue-104088.rs b/tests/ui/parser/issues/issue-104088.rs index 5f794fe2d..3dc636b6a 100644 --- a/tests/ui/parser/issues/issue-104088.rs +++ b/tests/ui/parser/issues/issue-104088.rs @@ -1,26 +1,19 @@ -fn test() { +fn 1234test() { +//~^ ERROR expected identifier, found `1234test` if let 123 = 123 { println!("yes"); } -} - -fn test_2() { - let 1x = 123; - //~^ ERROR expected identifier, found number literal -} - -fn test_3() { - let 2x: i32 = 123; - //~^ ERROR expected identifier, found number literal -} -fn test_4() { if let 2e1 = 123 { //~^ ERROR mismatched types } -} -fn test_5() { let 23name = 123; - //~^ ERROR expected identifier, found number literal + //~^ ERROR expected identifier, found `23name` + + let 2x: i32 = 123; + //~^ ERROR expected identifier, found `2x` + + let 1x = 123; + //~^ ERROR expected identifier, found `1x` } fn main() {} diff --git a/tests/ui/parser/issues/issue-104088.stderr b/tests/ui/parser/issues/issue-104088.stderr index ff4b4bdb6..8b751759d 100644 --- a/tests/ui/parser/issues/issue-104088.stderr +++ b/tests/ui/parser/issues/issue-104088.stderr @@ -1,29 +1,59 @@ -error: expected identifier, found number literal - --> $DIR/issue-104088.rs:6:9 +error: expected identifier, found `1234test` + --> $DIR/issue-104088.rs:1:4 | -LL | let 1x = 123; - | ^^ identifiers cannot start with a number +LL | fn 1234test() { + | ^^^^^^^^ expected identifier + | +help: identifiers cannot start with a number + --> $DIR/issue-104088.rs:1:4 + | +LL | fn 1234test() { + | ^^^^ + +error: expected identifier, found `23name` + --> $DIR/issue-104088.rs:9:9 + | +LL | let 23name = 123; + | ^^^^^^ expected identifier + | +help: identifiers cannot start with a number + --> $DIR/issue-104088.rs:9:9 + | +LL | let 23name = 123; + | ^^ -error: expected identifier, found number literal - --> $DIR/issue-104088.rs:11:9 +error: expected identifier, found `2x` + --> $DIR/issue-104088.rs:12:9 | LL | let 2x: i32 = 123; - | ^^ identifiers cannot start with a number + | ^^ expected identifier + | +help: identifiers cannot start with a number + --> $DIR/issue-104088.rs:12:9 + | +LL | let 2x: i32 = 123; + | ^ -error: expected identifier, found number literal - --> $DIR/issue-104088.rs:22:9 +error: expected identifier, found `1x` + --> $DIR/issue-104088.rs:15:9 | -LL | let 23name = 123; - | ^^^^^^ identifiers cannot start with a number +LL | let 1x = 123; + | ^^ expected identifier + | +help: identifiers cannot start with a number + --> $DIR/issue-104088.rs:15:9 + | +LL | let 1x = 123; + | ^ error[E0308]: mismatched types - --> $DIR/issue-104088.rs:16:12 + --> $DIR/issue-104088.rs:5:12 | LL | if let 2e1 = 123 { | ^^^ --- this expression has type `{integer}` | | | expected integer, found floating-point number -error: aborting due to 4 previous errors +error: aborting due to 5 previous errors For more information about this error, try `rustc --explain E0308`. diff --git a/tests/ui/parser/issues/issue-108242-semicolon-recovery.rs b/tests/ui/parser/issues/issue-108242-semicolon-recovery.rs new file mode 100644 index 000000000..2fc0b2947 --- /dev/null +++ b/tests/ui/parser/issues/issue-108242-semicolon-recovery.rs @@ -0,0 +1,5 @@ +fn foo() {} +fn main() { + foo(; + foo(; +} //~ ERROR mismatched closing delimiter diff --git a/tests/ui/parser/issues/issue-108242-semicolon-recovery.stderr b/tests/ui/parser/issues/issue-108242-semicolon-recovery.stderr new file mode 100644 index 000000000..f68d6d501 --- /dev/null +++ b/tests/ui/parser/issues/issue-108242-semicolon-recovery.stderr @@ -0,0 +1,13 @@ +error: mismatched closing delimiter: `}` + --> $DIR/issue-108242-semicolon-recovery.rs:4:8 + | +LL | fn main() { + | - closing delimiter possibly meant for this +LL | foo(; +LL | foo(; + | ^ unclosed delimiter +LL | } + | ^ mismatched closing delimiter + +error: aborting due to previous error + diff --git a/tests/ui/parser/issues/issue-110014.rs b/tests/ui/parser/issues/issue-110014.rs new file mode 100644 index 000000000..69d8f402b --- /dev/null +++ b/tests/ui/parser/issues/issue-110014.rs @@ -0,0 +1,3 @@ +fn`2222222222222222222222222222222222222222() {} +//~^ ERROR unknown start of token: ` +//~^^ ERROR expected identifier, found `2222222222222222222222222222222222222222` diff --git a/tests/ui/parser/issues/issue-110014.stderr b/tests/ui/parser/issues/issue-110014.stderr new file mode 100644 index 000000000..7f1dd592e --- /dev/null +++ b/tests/ui/parser/issues/issue-110014.stderr @@ -0,0 +1,19 @@ +error: unknown start of token: ` + --> $DIR/issue-110014.rs:1:3 + | +LL | fn`2222222222222222222222222222222222222222() {} + | ^ + | +help: Unicode character '`' (Grave Accent) looks like ''' (Single Quote), but it is not + | +LL | fn'2222222222222222222222222222222222222222() {} + | ~ + +error: expected identifier, found `2222222222222222222222222222222222222222` + --> $DIR/issue-110014.rs:1:4 + | +LL | fn`2222222222222222222222222222222222222222() {} + | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected identifier + +error: aborting due to 2 previous errors + diff --git a/tests/ui/parser/issues/issue-48508.rs b/tests/ui/parser/issues/issue-48508.rs index 37d04c5d6..1e7db9df8 100644 --- a/tests/ui/parser/issues/issue-48508.rs +++ b/tests/ui/parser/issues/issue-48508.rs @@ -7,7 +7,6 @@ // issue-48508-aux.rs // compile-flags:-g -// ignore-pretty issue #37195 // ignore-asmjs wasm2js does not support source maps yet #![allow(uncommon_codepoints)] diff --git a/tests/ui/parser/issues/issue-65846-rollback-gating-failing-matcher.rs b/tests/ui/parser/issues/issue-65846-rollback-gating-failing-matcher.rs index 76c07bbfd..b0e8f4d99 100644 --- a/tests/ui/parser/issues/issue-65846-rollback-gating-failing-matcher.rs +++ b/tests/ui/parser/issues/issue-65846-rollback-gating-failing-matcher.rs @@ -5,11 +5,17 @@ #[allow(unused_macro_rules)] macro_rules! m { - ($e:expr) => { 0 }; // This fails on the input below due to `, foo`. - ($e:expr,) => { 1 }; // This also fails to match due to `foo`. - (box $e:expr, foo) => { 2 }; // Successful matcher, we should get `2`. + ($e:expr) => { + 0 + }; // This fails on the input below due to `, foo`. + ($e:expr,) => { + 1 + }; // This also fails to match due to `foo`. + (do yeet $e:expr, foo) => { + 2 + }; // Successful matcher, we should get `2`. } fn main() { - assert_eq!(2, m!(box 42, foo)); + assert_eq!(2, m!(do yeet 42, foo)); } |