about summary refs log tree commit diff
path: root/src/test/ui/structs
diff options
context:
space:
mode:
authorHenry Boisdequin <65845077+henryboisdequin@users.noreply.github.com>2021-02-17 20:20:59 +0530
committerHenry Boisdequin <65845077+henryboisdequin@users.noreply.github.com>2021-02-25 16:11:18 +0530
commitd7cb66d389c3ef542891a26ee3c12308b407fcd6 (patch)
tree5bf2af8f6bbeafcf40135b662f65d420bd83a955 /src/test/ui/structs
parent1279b3b9232e4c44112d98f19cfa8846776d1fe8 (diff)
downloadrust-d7cb66d389c3ef542891a26ee3c12308b407fcd6.tar.gz
rust-d7cb66d389c3ef542891a26ee3c12308b407fcd6.zip
add helpful error notes and fix the false 'defined here' messages
Diffstat (limited to 'src/test/ui/structs')
-rw-r--r--src/test/ui/structs/80853.rs7
-rw-r--r--src/test/ui/structs/80853.stderr13
2 files changed, 20 insertions, 0 deletions
diff --git a/src/test/ui/structs/80853.rs b/src/test/ui/structs/80853.rs
new file mode 100644
index 00000000000..242d0af959d
--- /dev/null
+++ b/src/test/ui/structs/80853.rs
@@ -0,0 +1,7 @@
+struct S;
+
+fn repro_ref(thing: S) {
+    thing(); //~ ERROR expected function, found `S`
+}
+
+fn main() {}
diff --git a/src/test/ui/structs/80853.stderr b/src/test/ui/structs/80853.stderr
new file mode 100644
index 00000000000..8a38e32c1d0
--- /dev/null
+++ b/src/test/ui/structs/80853.stderr
@@ -0,0 +1,13 @@
+error[E0618]: expected function, found `S`
+  --> $DIR/80853.rs:4:5
+   |
+LL | fn repro_ref(thing: S) {
+   |              ----- `thing` has type `S`
+LL |     thing();
+   |     ^^^^^--
+   |     |
+   |     call expression requires function
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0618`.