diff options
| author | Brian Koropoff <bkoropoff@gmail.com> | 2014-11-01 14:59:22 -0700 |
|---|---|---|
| committer | Brian Koropoff <bkoropoff@gmail.com> | 2014-11-01 15:24:34 -0700 |
| commit | 7ea7606874ea38acfa0bc332f1c3e135bb57859c (patch) | |
| tree | c18e2f549829d3a1b61c1a34dc6719dbc0216dbc | |
| parent | 0547a407aa03b9f1c03843aead617a2e8c5d1147 (diff) | |
| download | rust-7ea7606874ea38acfa0bc332f1c3e135bb57859c.tar.gz rust-7ea7606874ea38acfa0bc332f1c3e135bb57859c.zip | |
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
| -rw-r--r-- | src/librustc/middle/trans/common.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/librustc/middle/trans/common.rs b/src/librustc/middle/trans/common.rs index 60b107c049f..8b5e82ecf90 100644 --- a/src/librustc/middle/trans/common.rs +++ b/src/librustc/middle/trans/common.rs @@ -502,7 +502,11 @@ impl<'blk, 'tcx> mc::Typer<'tcx> for BlockS<'blk, 'tcx> { } fn node_method_ty(&self, method_call: typeck::MethodCall) -> Option<ty::t> { - self.tcx().method_map.borrow().find(&method_call).map(|method| method.ty) + self.tcx() + .method_map + .borrow() + .find(&method_call) + .map(|method| monomorphize_type(self, method.ty)) } fn adjustments<'a>(&'a self) -> &'a RefCell<NodeMap<ty::AutoAdjustment>> { |
