late resolve, visit_fn: bail early if there's no body.

This commit is contained in:
Mazdak Farrokhzad 2020-02-28 07:58:37 +01:00
parent a8437cf213
commit 85b585daaf
3 changed files with 18 additions and 2 deletions

View file

@ -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
}

View file

@ -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`.