Skip to content

Commit 7ea7606

Browse files
committed
Monomorphize method types in Typer impl for BlockS
In some obscure circumstances, failure to do this can cause unsubstituted type parameters to show up where they aren't expected and cause an ICE. Closes #18514
1 parent 0547a40 commit 7ea7606

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/librustc/middle/trans/common.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,11 @@ impl<'blk, 'tcx> mc::Typer<'tcx> for BlockS<'blk, 'tcx> {
502502
}
503503

504504
fn node_method_ty(&self, method_call: typeck::MethodCall) -> Option<ty::t> {
505-
self.tcx().method_map.borrow().find(&method_call).map(|method| method.ty)
505+
self.tcx()
506+
.method_map
507+
.borrow()
508+
.find(&method_call)
509+
.map(|method| monomorphize_type(self, method.ty))
506510
}
507511

508512
fn adjustments<'a>(&'a self) -> &'a RefCell<NodeMap<ty::AutoAdjustment>> {

0 commit comments

Comments
 (0)