@@ -3,7 +3,6 @@ use super::{GenericArgsCtor, ParenthesizedGenericArgs};
33
44use rustc:: lint:: builtin:: { self , ELIDED_LIFETIMES_IN_PATHS } ;
55use rustc:: span_bug;
6- use rustc:: util:: common:: FN_OUTPUT_NAME ;
76use rustc_error_codes:: * ;
87use rustc_errors:: { struct_span_err, Applicability } ;
98use rustc_hir as hir;
@@ -406,16 +405,22 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
406405 FunctionRetTy :: Default ( _) => this. arena . alloc ( this. ty_tup ( span, & [ ] ) ) ,
407406 } ;
408407 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) ;
415409 (
416410 GenericArgsCtor { args, bindings : arena_vec ! [ this; binding] , parenthesized : true } ,
417411 false ,
418412 )
419413 } )
420414 }
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+ }
421426}
0 commit comments