diff options
| author | yukang <moorekang@gmail.com> | 2023-05-13 18:06:16 +0800 |
|---|---|---|
| committer | yukang <moorekang@gmail.com> | 2023-05-13 18:06:16 +0800 |
| commit | ce6cfc37d033eb1fb1f2e3af1c17c218917b54ec (patch) | |
| tree | bed6cfba9c4f2695202b44891c78d26d6dc98256 /tests | |
| parent | 69fef92ab2f287f072b66fb7b4f62c8bb4acba43 (diff) | |
| download | rust-ce6cfc37d033eb1fb1f2e3af1c17c218917b54ec.tar.gz rust-ce6cfc37d033eb1fb1f2e3af1c17c218917b54ec.zip | |
Fix ice caused by shorthand fields in NoFieldsForFnCall
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/ui/parser/issues/issue-111416.rs | 4 | ||||
| -rw-r--r-- | tests/ui/parser/issues/issue-111416.stderr | 18 |
2 files changed, 22 insertions, 0 deletions
diff --git a/tests/ui/parser/issues/issue-111416.rs b/tests/ui/parser/issues/issue-111416.rs new file mode 100644 index 00000000000..deba8679b1a --- /dev/null +++ b/tests/ui/parser/issues/issue-111416.rs @@ -0,0 +1,4 @@ + +fn main() { + let my = monad_bind(mx, T: Try); //~ ERROR invalid `struct` delimiters or `fn` call arguments +} diff --git a/tests/ui/parser/issues/issue-111416.stderr b/tests/ui/parser/issues/issue-111416.stderr new file mode 100644 index 00000000000..b9e61d70e81 --- /dev/null +++ b/tests/ui/parser/issues/issue-111416.stderr @@ -0,0 +1,18 @@ +error: invalid `struct` delimiters or `fn` call arguments + --> $DIR/issue-111416.rs:3:14 + | +LL | let my = monad_bind(mx, T: Try); + | ^^^^^^^^^^^^^^^^^^^^^^ + | +help: if `monad_bind` is a struct, use braces as delimiters + | +LL | let my = monad_bind { mx, T: Try }; + | ~ ~ +help: if `monad_bind` is a function, use the arguments directly + | +LL - let my = monad_bind(mx, T: Try); +LL + let my = monad_bind(mx, Try); + | + +error: aborting due to previous error + |
