From dbdef68ddf0b8200954c81264400ef271a5f0194 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Thu, 9 May 2024 10:47:07 -0400 Subject: Make sure we consume a generic arg when checking mistyped turbofish --- tests/ui/parser/recover/turbofish-arg-with-stray-colon.rs | 6 ++++++ .../parser/recover/turbofish-arg-with-stray-colon.stderr | 14 ++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 tests/ui/parser/recover/turbofish-arg-with-stray-colon.rs create mode 100644 tests/ui/parser/recover/turbofish-arg-with-stray-colon.stderr (limited to 'tests/ui/parser') 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; + //~^ 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; + | ^ expected one of 8 possible tokens + | + = note: type ascription syntax has been removed, see issue #101728 +help: maybe write a path separator here + | +LL | let x = Tr; + | ~~ + +error: aborting due to 1 previous error + -- cgit 1.4.1-3-g733a5