diff --git a/compiler/rustc_typeck/src/check/callee.rs b/compiler/rustc_typeck/src/check/callee.rs index 1cc06b8c2e5..6cdd38664c8 100644 --- a/compiler/rustc_typeck/src/check/callee.rs +++ b/compiler/rustc_typeck/src/check/callee.rs @@ -350,6 +350,7 @@ fn confirm_builtin_call( } } + let callee_ty = self.resolve_vars_if_possible(callee_ty); let mut err = type_error_struct!( self.tcx.sess, callee_expr.span, diff --git a/src/test/ui/typeck/call-block.rs b/src/test/ui/typeck/call-block.rs index 1d5244411a2..0390d7db040 100644 --- a/src/test/ui/typeck/call-block.rs +++ b/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}` } diff --git a/src/test/ui/typeck/call-block.stderr b/src/test/ui/typeck/call-block.stderr index 20f61dd23ac..68984bc1c45 100644 --- a/src/test/ui/typeck/call-block.stderr +++ b/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}();