Skip to content

Commit 072d107

Browse files
committed
Resolve infered types when complaining about unexpected call type
1 parent b8deb93 commit 072d107

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

compiler/rustc_typeck/src/check/callee.rs

+1
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
350350
}
351351
}
352352

353+
let callee_ty = self.resolve_vars_if_possible(callee_ty);
353354
let mut err = type_error_struct!(
354355
self.tcx.sess,
355356
callee_expr.span,

src/test/ui/typeck/call-block.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
fn main() {
2-
let _ = {42}(); //~ ERROR expected function, found `_`
2+
let _ = {42}(); //~ ERROR expected function, found `{integer}`
33
}

src/test/ui/typeck/call-block.stderr

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
error[E0618]: expected function, found `_`
1+
error[E0618]: expected function, found `{integer}`
22
--> $DIR/call-block.rs:2:13
33
|
44
LL | let _ = {42}();

0 commit comments

Comments
 (0)