about summary refs log tree commit diff
path: root/src/test
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2020-02-28 07:58:37 +0100
committerMazdak Farrokhzad <twingoow@gmail.com>2020-02-28 07:58:37 +0100
commit85b585daaf735deda96c6e087e2a3f203c64d52d (patch)
treee552593f9f20c236b03f0c21b526445b443146d4 /src/test
parenta8437cf213ac1e950b6f5c691c4d2a29bf949bcd (diff)
downloadrust-85b585daaf735deda96c6e087e2a3f203c64d52d.tar.gz
rust-85b585daaf735deda96c6e087e2a3f203c64d52d.zip
late resolve, visit_fn: bail early if there's no body.
Diffstat (limited to 'src/test')
-rw-r--r--src/test/ui/resolve/issue-69401-trait-fn-no-body-ty-local.rs6
-rw-r--r--src/test/ui/resolve/issue-69401-trait-fn-no-body-ty-local.stderr9
2 files changed, 15 insertions, 0 deletions
diff --git a/src/test/ui/resolve/issue-69401-trait-fn-no-body-ty-local.rs b/src/test/ui/resolve/issue-69401-trait-fn-no-body-ty-local.rs
new file mode 100644
index 00000000000..4397baea4a9
--- /dev/null
+++ b/src/test/ui/resolve/issue-69401-trait-fn-no-body-ty-local.rs
@@ -0,0 +1,6 @@
+fn main() {}
+
+trait Foo {
+    fn fn_with_type_named_same_as_local_in_param(b: b);
+    //~^ ERROR cannot find type `b` in this scope
+}
diff --git a/src/test/ui/resolve/issue-69401-trait-fn-no-body-ty-local.stderr b/src/test/ui/resolve/issue-69401-trait-fn-no-body-ty-local.stderr
new file mode 100644
index 00000000000..109409d2731
--- /dev/null
+++ b/src/test/ui/resolve/issue-69401-trait-fn-no-body-ty-local.stderr
@@ -0,0 +1,9 @@
+error[E0412]: cannot find type `b` in this scope
+  --> $DIR/issue-69401-trait-fn-no-body-ty-local.rs:4:53
+   |
+LL |     fn fn_with_type_named_same_as_local_in_param(b: b);
+   |                                                     ^ not found in this scope
+
+error: aborting due to previous error
+
+For more information about this error, try `rustc --explain E0412`.