Skip to content

Commit 014dd54

Browse files
committed
rustc: Use the inferred region as the self region in ast_ty_to_ty as well
1 parent ec340c8 commit 014dd54

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/rustc/middle/typeck.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -321,10 +321,12 @@ fn ast_ty_to_ty(tcx: ty::ctxt, mode: mode, &&ast_ty: @ast::ty) -> ty::t {
321321
}
322322
ast::ty_rptr(region, mt) {
323323
let region = alt region.node {
324-
ast::re_inferred {
324+
ast::re_inferred | ast::re_self {
325325
tcx.region_map.ast_type_to_inferred_region.get(ast_ty.id)
326326
}
327-
_ { tcx.region_map.ast_type_to_region.get(region.id) }
327+
ast::re_named(_) {
328+
tcx.region_map.ast_type_to_region.get(region.id)
329+
}
328330
};
329331
ty::mk_rptr(tcx, region, ast_mt_to_mt(tcx, mode, mt))
330332
}

0 commit comments

Comments
 (0)