@@ -14,7 +14,7 @@ use rustc::hir::def_id::{DefId};
1414use  rustc:: infer:: { InferCtxt } ; 
1515use  rustc:: ty:: { self ,  TyCtxt ,  ParamEnv } ; 
1616use  rustc:: ty:: maps:: Providers ; 
17- use  rustc:: mir:: { AssertMessage ,  BasicBlock ,  BorrowKind ,  Location ,  Lvalue } ; 
17+ use  rustc:: mir:: { AssertMessage ,  BasicBlock ,  BorrowKind ,  Location ,  Lvalue ,   Local } ; 
1818use  rustc:: mir:: { Mir ,  Mutability ,  Operand ,  Projection ,  ProjectionElem ,  Rvalue } ; 
1919use  rustc:: mir:: { Statement ,  StatementKind ,  Terminator ,  TerminatorKind } ; 
2020use  rustc:: mir:: transform:: { MirSource } ; 
@@ -1061,11 +1061,7 @@ impl<'c, 'b, 'a: 'b+'c, 'gcx, 'tcx: 'a> MirBorrowckCtxt<'c, 'b, 'a, 'gcx, 'tcx>
10611061    fn  append_lvalue_to_string ( & self ,  lvalue :  & Lvalue ,  buf :  & mut  String ,  autoderef :  Option < bool > )  { 
10621062        match  * lvalue { 
10631063            Lvalue :: Local ( local)  => { 
1064-                 let  local = & self . mir . local_decls [ local] ; 
1065-                 match  local. name  { 
1066-                     Some ( name)  => buf. push_str ( & format ! ( "{}" ,  name) ) , 
1067-                     None  => buf. push_str ( "_" ) , 
1068-                 } 
1064+                 self . append_local_to_string ( local,  buf,  "_" ) ; 
10691065            } 
10701066            Lvalue :: Static ( ref  static_)  => { 
10711067                buf. push_str ( & format ! ( "{}" ,  & self . tcx. item_name( static_. def_id) ) ) ; 
@@ -1102,7 +1098,7 @@ impl<'c, 'b, 'a: 'b+'c, 'gcx, 'tcx: 'a> MirBorrowckCtxt<'c, 'b, 'a, 'gcx, 'tcx>
11021098                self . append_lvalue_to_string ( & proj. base ,  buf,  Some ( autoderef) ) ; 
11031099                if  let  Some ( index)  = index_operand { 
11041100                    buf. push_str ( "[" ) ; 
1105-                     self . append_lvalue_to_string ( & Lvalue :: Local ( index) ,  buf,  None ) ; 
1101+                     self . append_local_to_string ( index,  buf,  ".." ) ; 
11061102                    buf. push_str ( "]" ) ; 
11071103                }  else  { 
11081104                    buf. push_str ( & suffix) ; 
@@ -1111,6 +1107,16 @@ impl<'c, 'b, 'a: 'b+'c, 'gcx, 'tcx: 'a> MirBorrowckCtxt<'c, 'b, 'a, 'gcx, 'tcx>
11111107        } 
11121108    } 
11131109
1110+     // Appends end-user visible description of the `local` lvalue to `buf`. If `local` doesn't have 
1111+     // a name, then `none_string` is appended instead 
1112+     fn  append_local_to_string ( & self ,  local_index :  Local ,  buf :  & mut  String ,  none_string :  & str )  { 
1113+         let  local = & self . mir . local_decls [ local_index] ; 
1114+         match  local. name  { 
1115+             Some ( name)  => buf. push_str ( & format ! ( "{}" ,  name) ) , 
1116+             None  => buf. push_str ( none_string) 
1117+         } 
1118+     } 
1119+ 
11141120    // End-user visible description of the `field_index`nth field of `base` 
11151121    fn  describe_field ( & self ,  base :  & Lvalue ,  field_index :  usize )  -> String  { 
11161122        match  * base { 
0 commit comments