@@ -3,7 +3,6 @@ use super::{GenericArgsCtor, ParenthesizedGenericArgs};
3
3
4
4
use rustc:: lint:: builtin:: { self , ELIDED_LIFETIMES_IN_PATHS } ;
5
5
use rustc:: span_bug;
6
- use rustc:: util:: common:: FN_OUTPUT_NAME ;
7
6
use rustc_error_codes:: * ;
8
7
use rustc_errors:: { struct_span_err, Applicability } ;
9
8
use rustc_hir as hir;
@@ -406,16 +405,22 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
406
405
FunctionRetTy :: Default ( _) => this. arena . alloc ( this. ty_tup ( span, & [ ] ) ) ,
407
406
} ;
408
407
let args = smallvec ! [ GenericArg :: Type ( this. ty_tup( span, inputs) ) ] ;
409
- let binding = hir:: TypeBinding {
410
- hir_id : this. next_id ( ) ,
411
- ident : Ident :: with_dummy_span ( FN_OUTPUT_NAME ) ,
412
- span : output_ty. span ,
413
- kind : hir:: TypeBindingKind :: Equality { ty : output_ty } ,
414
- } ;
408
+ let binding = this. output_ty_binding ( output_ty. span , output_ty) ;
415
409
(
416
410
GenericArgsCtor { args, bindings : arena_vec ! [ this; binding] , parenthesized : true } ,
417
411
false ,
418
412
)
419
413
} )
420
414
}
415
+
416
+ /// An associated type binding `Output = $ty`.
417
+ crate fn output_ty_binding (
418
+ & mut self ,
419
+ span : Span ,
420
+ ty : & ' hir hir:: Ty < ' hir > ,
421
+ ) -> hir:: TypeBinding < ' hir > {
422
+ let ident = Ident :: with_dummy_span ( hir:: FN_OUTPUT_NAME ) ;
423
+ let kind = hir:: TypeBindingKind :: Equality { ty } ;
424
+ hir:: TypeBinding { hir_id : self . next_id ( ) , span, ident, kind }
425
+ }
421
426
}
0 commit comments