Skip to content

Commit ec340c8

Browse files
committed
rustc: Look up inferred regions in ast_ty_to_ty
1 parent cd72b1f commit ec340c8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/rustc/middle/typeck.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -320,7 +320,12 @@ fn ast_ty_to_ty(tcx: ty::ctxt, mode: mode, &&ast_ty: @ast::ty) -> ty::t {
320320
ty::mk_ptr(tcx, ast_mt_to_mt(tcx, mode, mt))
321321
}
322322
ast::ty_rptr(region, mt) {
323-
let region = tcx.region_map.ast_type_to_region.get(region.id);
323+
let region = alt region.node {
324+
ast::re_inferred {
325+
tcx.region_map.ast_type_to_inferred_region.get(ast_ty.id)
326+
}
327+
_ { tcx.region_map.ast_type_to_region.get(region.id) }
328+
};
324329
ty::mk_rptr(tcx, region, ast_mt_to_mt(tcx, mode, mt))
325330
}
326331
ast::ty_tup(fields) {

0 commit comments

Comments
 (0)