@@ -877,7 +877,7 @@ impl<'a> LoweringContext<'a> {
877877
878878 let unstable_span = self . allow_internal_unstable ( CompilerDesugaringKind :: Async , span) ;
879879 let gen_future = self . expr_std_path (
880- unstable_span, & [ "future" , "future_from_generator " ] , None , ThinVec :: new ( ) ) ;
880+ unstable_span, & [ "future" , "from_generator " ] , None , ThinVec :: new ( ) ) ;
881881 hir:: ExprCall ( P ( gen_future) , hir_vec ! [ generator] )
882882 }
883883
@@ -1173,11 +1173,8 @@ impl<'a> LoweringContext<'a> {
11731173 let span = t. span ;
11741174 match itctx {
11751175 ImplTraitContext :: Existential ( fn_def_id) => {
1176- // Set the name to `impl Bound1 + Bound2`
1177- let exist_ty_name = Symbol :: intern ( & pprust:: ty_to_string ( t) ) ;
11781176 self . lower_existential_impl_trait (
1179- span, fn_def_id, exist_ty_name,
1180- |this| this. lower_param_bounds ( bounds, itctx) )
1177+ span, fn_def_id, |this| this. lower_param_bounds ( bounds, itctx) )
11811178 }
11821179 ImplTraitContext :: Universal ( def_id) => {
11831180 let def_node_id = self . next_id ( ) . node_id ;
@@ -1245,7 +1242,6 @@ impl<'a> LoweringContext<'a> {
12451242 & mut self ,
12461243 span : Span ,
12471244 fn_def_id : DefId ,
1248- exist_ty_name : Name ,
12491245 lower_bounds : impl FnOnce ( & mut LoweringContext ) -> hir:: GenericBounds ,
12501246 ) -> hir:: Ty_ {
12511247 // We need to manually repeat the code of `next_id` because the lowering
@@ -1307,7 +1303,7 @@ impl<'a> LoweringContext<'a> {
13071303 let exist_ty_item = hir:: Item {
13081304 id : exist_ty_id. node_id ,
13091305 hir_id : exist_ty_id. hir_id ,
1310- name : exist_ty_name ,
1306+ name : keywords :: Invalid . name ( ) ,
13111307 attrs : Default :: default ( ) ,
13121308 node : exist_ty_item_kind,
13131309 vis : hir:: Visibility :: Inherited ,
@@ -2090,19 +2086,13 @@ impl<'a> LoweringContext<'a> {
20902086 lifetime_collector. output_lifetime
20912087 } ;
20922088
2093- let output_ty_name_owned;
2094- let ( output_ty_name, span) = match output {
2095- FunctionRetTy :: Ty ( ty) => {
2096- output_ty_name_owned = pprust:: ty_to_string ( ty) ;
2097- ( & * output_ty_name_owned, ty. span )
2098- } ,
2099- FunctionRetTy :: Default ( span) => ( "()" , * span) ,
2089+ let span = match output {
2090+ FunctionRetTy :: Ty ( ty) => ty. span ,
2091+ FunctionRetTy :: Default ( span) => * span,
21002092 } ;
21012093
2102- // FIXME(cramertj) add lifetimes (see FIXME below) to the name
2103- let exist_ty_name = Symbol :: intern ( & format ! ( "impl Future<Output = {}>" , output_ty_name) ) ;
21042094 let impl_trait_ty = self . lower_existential_impl_trait (
2105- span, fn_def_id, exist_ty_name , |this| {
2095+ span, fn_def_id, |this| {
21062096 let output_ty = match output {
21072097 FunctionRetTy :: Ty ( ty) =>
21082098 this. lower_ty ( ty, ImplTraitContext :: Existential ( fn_def_id) ) ,
0 commit comments