@@ -148,7 +148,10 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
148
148
return_type_has_opaque : false ,
149
149
constness : {
150
150
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
+ {
152
155
trace ! ( "const" ) ;
153
156
ty:: ConstnessArg :: Const
154
157
} else {
@@ -159,7 +162,9 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
159
162
if body_id. is_owner ( ) {
160
163
let did = body_id. expect_owner ( ) ;
161
164
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
+ {
163
168
if let hir:: ExprKind :: Closure { .. } = kind {
164
169
ty:: ConstnessArg :: Not
165
170
} else {
@@ -253,7 +258,7 @@ impl<'a, 'tcx> AstConv<'tcx> for FnCtxt<'a, 'tcx> {
253
258
254
259
fn ty_infer ( & self , param : Option < & ty:: GenericParamDef > , span : Span ) -> Ty < ' tcx > {
255
260
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 ( ) {
257
262
return ty;
258
263
}
259
264
unreachable ! ( )
@@ -272,7 +277,7 @@ impl<'a, 'tcx> AstConv<'tcx> for FnCtxt<'a, 'tcx> {
272
277
span : Span ,
273
278
) -> Const < ' tcx > {
274
279
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 ( ) {
276
281
return ct;
277
282
}
278
283
unreachable ! ( )
0 commit comments