Skip to content

Commit

Permalink
Resolve infered types when complaining about unexpected call type
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Sep 23, 2021
1 parent b8deb93 commit 072d107
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions compiler/rustc_typeck/src/check/callee.rs
Expand Up @@ -350,6 +350,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
}
}

let callee_ty = self.resolve_vars_if_possible(callee_ty);
let mut err = type_error_struct!(
self.tcx.sess,
callee_expr.span,
Expand Down
2 changes: 1 addition & 1 deletion src/test/ui/typeck/call-block.rs
@@ -1,3 +1,3 @@
fn main() {
let _ = {42}(); //~ ERROR expected function, found `_`
let _ = {42}(); //~ ERROR expected function, found `{integer}`
}
2 changes: 1 addition & 1 deletion src/test/ui/typeck/call-block.stderr
@@ -1,4 +1,4 @@
error[E0618]: expected function, found `_`
error[E0618]: expected function, found `{integer}`
--> $DIR/call-block.rs:2:13
|
LL | let _ = {42}();
Expand Down

0 comments on commit 072d107

Please sign in to comment.