about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorYuki Okushi <huyuumi.dev+love@gmail.com>2022-10-25 08:01:27 +0900
committerGitHub <noreply@github.com>2022-10-25 08:01:27 +0900
commit11d11e3415a31b587b3cb8a3349e728cb30ada2a (patch)
treef6abe3cabd5e1edda09b14e74293a9d4c2ea3af6 /src
parent758f19645b8ebce61ea52d1f6672fd057bc8dbee (diff)
parent241435737451c521a78faab31c54457b1cb97413 (diff)
downloadrust-11d11e3415a31b587b3cb8a3349e728cb30ada2a.tar.gz
rust-11d11e3415a31b587b3cb8a3349e728cb30ada2a.zip
Rollup merge of #103333 - chenyukang:yukang/fix-103143, r=wesleywiser
Fix assertion failed for break_last_token and trailing token

Fixes #103143
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/parser/issue-103143.rs5
-rw-r--r--src/test/ui/parser/issue-103143.stderr20
2 files changed, 25 insertions, 0 deletions
diff --git a/src/test/ui/parser/issue-103143.rs b/src/test/ui/parser/issue-103143.rs
new file mode 100644
index 00000000000..a584274c405
--- /dev/null
+++ b/src/test/ui/parser/issue-103143.rs
@@ -0,0 +1,5 @@
+fn main() {
+    x::<#[a]y::<z>>
+    //~^ ERROR invalid const generic expression
+    //~| ERROR cannot find value `x` in this scope
+}
diff --git a/src/test/ui/parser/issue-103143.stderr b/src/test/ui/parser/issue-103143.stderr
new file mode 100644
index 00000000000..4035c69afa7
--- /dev/null
+++ b/src/test/ui/parser/issue-103143.stderr
@@ -0,0 +1,20 @@
+error: invalid const generic expression
+  --> $DIR/issue-103143.rs:2:13
+   |
+LL |     x::<#[a]y::<z>>
+   |             ^^^^^^
+   |
+help: expressions must be enclosed in braces to be used as const generic arguments
+   |
+LL |     x::<#[a]{ y::<z> }>
+   |             +        +
+
+error[E0425]: cannot find value `x` in this scope
+  --> $DIR/issue-103143.rs:2:5
+   |
+LL |     x::<#[a]y::<z>>
+   |     ^ not found in this scope
+
+error: aborting due to 2 previous errors
+
+For more information about this error, try `rustc --explain E0425`.