about summary refs log tree commit diff
path: root/src/test/ui/parser/fn-defined-using-function.stderr
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2022-08-20 07:09:05 +0200
committerGitHub <noreply@github.com>2022-08-20 07:09:05 +0200
commitaf89769c82eeae85d5e7ecac94ac97ede0f0f147 (patch)
treed0854d61c9a2e3114a5960022b9fbb396d46a3c4 /src/test/ui/parser/fn-defined-using-function.stderr
parent1e47e8a9ee83f2b6e110f225f3738392088aa2a9 (diff)
parent1b54ad0585ca25b779be93d1149930664f722dc3 (diff)
downloadrust-af89769c82eeae85d5e7ecac94ac97ede0f0f147.tar.gz
rust-af89769c82eeae85d5e7ecac94ac97ede0f0f147.zip
Rollup merge of #100750 - akabinds:akabinds/improved-invalid-function-qual-error, r=davidtwco
improved diagnostic for function defined with `def`, `fun`, `func`, or `function` instead of `fn`

Closes #99751
Diffstat (limited to 'src/test/ui/parser/fn-defined-using-function.stderr')
-rw-r--r--src/test/ui/parser/fn-defined-using-function.stderr10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/ui/parser/fn-defined-using-function.stderr b/src/test/ui/parser/fn-defined-using-function.stderr
new file mode 100644
index 00000000000..43c33a2cdd7
--- /dev/null
+++ b/src/test/ui/parser/fn-defined-using-function.stderr
@@ -0,0 +1,10 @@
+error: expected one of `!` or `::`, found `foo`
+  --> $DIR/fn-defined-using-function.rs:6:10
+   |
+LL | function foo() {}
+   | -------- ^^^ expected one of `!` or `::`
+   | |
+   | help: write `fn` instead of `function` to declare a function
+
+error: aborting due to previous error
+