@@ -31,7 +31,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
3131 "...so that reference does not outlive borrowed content" ) ;
3232 }
3333 infer:: ReborrowUpvar ( span, ref upvar_id) => {
34- let var_name = self . tcx . hir ( ) . name_by_hir_id ( upvar_id. var_path . hir_id ) ;
34+ let var_name = self . tcx . hir ( ) . name ( upvar_id. var_path . hir_id ) ;
3535 err. span_note ( span,
3636 & format ! ( "...so that closure can access `{}`" , var_name) ) ;
3737 }
@@ -50,7 +50,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
5050 err. span_note ( span,
5151 & format ! ( "...so that captured variable `{}` does not outlive the \
5252 enclosing closure",
53- self . tcx. hir( ) . name_by_hir_id ( id) ) ) ;
53+ self . tcx. hir( ) . name ( id) ) ) ;
5454 }
5555 infer:: IndexSlice ( span) => {
5656 err. span_note ( span, "...so that slice is not indexed outside the lifetime" ) ;
@@ -163,7 +163,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
163163 err
164164 }
165165 infer:: ReborrowUpvar ( span, ref upvar_id) => {
166- let var_name = self . tcx . hir ( ) . name_by_hir_id ( upvar_id. var_path . hir_id ) ;
166+ let var_name = self . tcx . hir ( ) . name ( upvar_id. var_path . hir_id ) ;
167167 let mut err = struct_span_err ! ( self . tcx. sess,
168168 span,
169169 E0313 ,
@@ -220,7 +220,7 @@ impl<'a, 'tcx> InferCtxt<'a, 'tcx> {
220220 E0474 ,
221221 "captured variable `{}` does not outlive the \
222222 enclosing closure",
223- self . tcx. hir( ) . name_by_hir_id ( id) ) ;
223+ self . tcx. hir( ) . name ( id) ) ;
224224 self . tcx . note_and_explain_region ( region_scope_tree, & mut err,
225225 "captured variable is valid for " , sup, "" ) ;
226226 self . tcx . note_and_explain_region ( region_scope_tree, & mut err,
0 commit comments