@@ -148,7 +148,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
148148 return_type_has_opaque : false ,
149149 constness : {
150150 fn get_constness ( tcx : TyCtxt < ' _ > , did : DefId ) -> ty:: ConstnessArg {
151- if tcx. is_const_fn_raw ( did) || tcx. is_const_default_method ( did) || tcx. def_kind ( did) == hir:: def:: DefKind :: Const {
151+ if tcx. is_const_fn_raw ( did)
152+ || tcx. is_const_default_method ( did)
153+ || tcx. def_kind ( did) == hir:: def:: DefKind :: Const
154+ {
152155 trace ! ( "const" ) ;
153156 ty:: ConstnessArg :: Const
154157 } else {
@@ -159,7 +162,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
159162 if body_id. is_owner ( ) {
160163 let did = body_id. expect_owner ( ) ;
161164 get_constness ( inh. tcx , did. to_def_id ( ) )
162- } else if let Some ( hir:: Node :: Expr ( hir:: Expr { kind, .. } ) ) = inh. tcx . hir ( ) . find ( body_id) {
165+ } else if let Some ( hir:: Node :: Expr ( hir:: Expr { kind, .. } ) ) =
166+ inh. tcx . hir ( ) . find ( body_id)
167+ {
163168 if let hir:: ExprKind :: Closure { .. } = kind {
164169 ty:: ConstnessArg :: Not
165170 } else {
@@ -253,7 +258,7 @@ impl<'a, 'tcx> AstConv<'tcx> for FnCtxt<'a, 'tcx> {
253258
254259 fn ty_infer ( & self , param : Option < & ty:: GenericParamDef > , span : Span ) -> Ty < ' tcx > {
255260 if let Some ( param) = param {
256- if let GenericArgKind :: Type ( ty) = self . var_for_def ( span, param) . unpack ( ) {
261+ if let GenericArgKind :: Type ( ty) = self . var_for_def ( span, param, None ) . unpack ( ) {
257262 return ty;
258263 }
259264 unreachable ! ( )
@@ -272,7 +277,7 @@ impl<'a, 'tcx> AstConv<'tcx> for FnCtxt<'a, 'tcx> {
272277 span : Span ,
273278 ) -> Const < ' tcx > {
274279 if let Some ( param) = param {
275- if let GenericArgKind :: Const ( ct) = self . var_for_def ( span, param) . unpack ( ) {
280+ if let GenericArgKind :: Const ( ct) = self . var_for_def ( span, param, None ) . unpack ( ) {
276281 return ct;
277282 }
278283 unreachable ! ( )
0 commit comments