about summary refs log tree commit diff
path: root/tests/ui/parser
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2024-05-09 10:47:07 -0400
committerMichael Goulet <michael@errs.io>2024-05-09 10:47:14 -0400
commitdbdef68ddf0b8200954c81264400ef271a5f0194 (patch)
tree2702c14ef694397c3873af037e3b4ef1b3f53ce8 /tests/ui/parser
parent6f7e00a3e6eade8350ce6280f05596236d73c4cb (diff)
downloadrust-dbdef68ddf0b8200954c81264400ef271a5f0194.tar.gz
rust-dbdef68ddf0b8200954c81264400ef271a5f0194.zip
Make sure we consume a generic arg when checking mistyped turbofish
Diffstat (limited to 'tests/ui/parser')
-rw-r--r--tests/ui/parser/recover/turbofish-arg-with-stray-colon.rs6
-rw-r--r--tests/ui/parser/recover/turbofish-arg-with-stray-colon.stderr14
2 files changed, 20 insertions, 0 deletions
diff --git a/tests/ui/parser/recover/turbofish-arg-with-stray-colon.rs b/tests/ui/parser/recover/turbofish-arg-with-stray-colon.rs
new file mode 100644
index 00000000000..32125211a91
--- /dev/null
+++ b/tests/ui/parser/recover/turbofish-arg-with-stray-colon.rs
@@ -0,0 +1,6 @@
+fn foo() {
+    let x = Tr<A, A:>;
+    //~^ ERROR expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `,`
+}
+
+fn main() {}
diff --git a/tests/ui/parser/recover/turbofish-arg-with-stray-colon.stderr b/tests/ui/parser/recover/turbofish-arg-with-stray-colon.stderr
new file mode 100644
index 00000000000..551b2e3ff09
--- /dev/null
+++ b/tests/ui/parser/recover/turbofish-arg-with-stray-colon.stderr
@@ -0,0 +1,14 @@
+error: expected one of `!`, `.`, `::`, `;`, `?`, `else`, `{`, or an operator, found `,`
+  --> $DIR/turbofish-arg-with-stray-colon.rs:2:17
+   |
+LL |     let x = Tr<A, A:>;
+   |                 ^ expected one of 8 possible tokens
+   |
+   = note: type ascription syntax has been removed, see issue #101728 <https://github.com/rust-lang/rust/issues/101728>
+help: maybe write a path separator here
+   |
+LL |     let x = Tr<A, A::>;
+   |                    ~~
+
+error: aborting due to 1 previous error
+