@@ -7,7 +7,7 @@ use rustc::mir::{
77use rustc:: mir:: { Terminator , TerminatorKind } ;
88use rustc:: ty:: { self , Const , DefIdTree , Ty , TyS , TyCtxt } ;
99use rustc_data_structures:: indexed_vec:: Idx ;
10- use syntax_pos:: Span ;
10+ use syntax_pos:: { Span , CompilerDesugaringKind } ;
1111use syntax_pos:: symbol:: kw;
1212
1313use crate :: dataflow:: move_paths:: InitLocation ;
@@ -41,14 +41,16 @@ impl<'a, 'gcx, 'tcx> MirBorrowckCtxt<'a, 'gcx, 'tcx> {
4141 ) ;
4242
4343 let mut err;
44- let mut item_msg;
4544 let reason;
4645 let access_place_desc = self . describe_place ( access_place) ;
4746 debug ! ( "report_mutability_error: access_place_desc={:?}" , access_place_desc) ;
4847
49- item_msg = match & access_place_desc {
50- Some ( desc) => format ! ( "`{}`" , desc) ,
51- None => "temporary place" . to_string ( ) ,
48+ let mut item_msg = match ( & access_place_desc, & the_place_err) {
49+ ( Some ( desc) , _) => format ! ( "`{}`" , desc) ,
50+ ( None , Place :: Base ( PlaceBase :: Local ( local) ) ) if self . mir . local_decls [ * local]
51+ . source_info . span . is_compiler_desugaring ( CompilerDesugaringKind :: Async )
52+ => "async `fn` parameter" . to_string ( ) ,
53+ ( None , _) => "temporary place" . to_string ( ) ,
5254 } ;
5355 match the_place_err {
5456 Place :: Base ( PlaceBase :: Local ( local) ) => {
0 commit comments