From 014dd547a03df624539c968ab99816d5e7c23363 Mon Sep 17 00:00:00 2001 From: Patrick Walton Date: Tue, 13 Mar 2012 11:34:48 -0700 Subject: [PATCH] rustc: Use the inferred region as the self region in ast_ty_to_ty as well --- src/rustc/middle/typeck.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/rustc/middle/typeck.rs b/src/rustc/middle/typeck.rs index 8ff7706f68c..ba27c84a017 100644 --- a/src/rustc/middle/typeck.rs +++ b/src/rustc/middle/typeck.rs @@ -321,10 +321,12 @@ fn ast_ty_to_ty(tcx: ty::ctxt, mode: mode, &&ast_ty: @ast::ty) -> ty::t { } ast::ty_rptr(region, mt) { let region = alt region.node { - ast::re_inferred { + ast::re_inferred | ast::re_self { tcx.region_map.ast_type_to_inferred_region.get(ast_ty.id) } - _ { tcx.region_map.ast_type_to_region.get(region.id) } + ast::re_named(_) { + tcx.region_map.ast_type_to_region.get(region.id) + } }; ty::mk_rptr(tcx, region, ast_mt_to_mt(tcx, mode, mt)) }