@@ -290,11 +290,20 @@ fn param_env(tcx: TyCtxt<'_>, def_id: DefId) -> ty::ParamEnv<'_> {
290
290
Some ( hir_id) => match tcx. hir ( ) . get ( hir_id) {
291
291
hir:: Node :: Item ( hir:: Item { kind : hir:: ItemKind :: Const ( ..) , .. } )
292
292
| hir:: Node :: Item ( hir:: Item { kind : hir:: ItemKind :: Static ( ..) , .. } )
293
- | hir:: Node :: TraitItem ( hir:: TraitItem { kind : hir:: TraitItemKind :: Const ( ..) , .. } )
293
+ | hir:: Node :: TraitItem ( hir:: TraitItem {
294
+ kind : hir:: TraitItemKind :: Const ( ..) , ..
295
+ } )
294
296
| hir:: Node :: AnonConst ( _)
295
297
| hir:: Node :: ImplItem ( hir:: ImplItem { kind : hir:: ImplItemKind :: Const ( ..) , .. } )
296
298
| hir:: Node :: ImplItem ( hir:: ImplItem {
297
- kind : hir:: ImplItemKind :: Fn ( hir:: FnSig { header : hir:: FnHeader { constness : hir:: Constness :: Const , .. } , .. } , ..) ,
299
+ kind :
300
+ hir:: ImplItemKind :: Fn (
301
+ hir:: FnSig {
302
+ header : hir:: FnHeader { constness : hir:: Constness :: Const , .. } ,
303
+ ..
304
+ } ,
305
+ ..,
306
+ ) ,
298
307
..
299
308
} ) => hir:: Constness :: Const ,
300
309
@@ -304,7 +313,10 @@ fn param_env(tcx: TyCtxt<'_>, def_id: DefId) -> ty::ParamEnv<'_> {
304
313
} ) => {
305
314
let parent_hir_id = tcx. hir ( ) . get_parent_node ( hir_id) ;
306
315
match tcx. hir ( ) . get ( parent_hir_id) {
307
- hir:: Node :: Item ( hir:: Item { kind : hir:: ItemKind :: Impl ( hir:: Impl { constness, .. } ) , .. } ) => * constness,
316
+ hir:: Node :: Item ( hir:: Item {
317
+ kind : hir:: ItemKind :: Impl ( hir:: Impl { constness, .. } ) ,
318
+ ..
319
+ } ) => * constness,
308
320
_ => span_bug ! (
309
321
tcx. def_span( parent_hir_id. owner) ,
310
322
"impl item's parent node is not an impl" ,
@@ -313,14 +325,22 @@ fn param_env(tcx: TyCtxt<'_>, def_id: DefId) -> ty::ParamEnv<'_> {
313
325
}
314
326
315
327
hir:: Node :: Item ( hir:: Item {
316
- kind : hir:: ItemKind :: Fn ( hir:: FnSig { header : hir:: FnHeader { constness, .. } , .. } , ..) ,
328
+ kind :
329
+ hir:: ItemKind :: Fn ( hir:: FnSig { header : hir:: FnHeader { constness, .. } , .. } , ..) ,
317
330
..
318
331
} )
319
332
| hir:: Node :: TraitItem ( hir:: TraitItem {
320
- kind : hir:: TraitItemKind :: Fn ( hir:: FnSig { header : hir:: FnHeader { constness, .. } , .. } , ..) ,
333
+ kind :
334
+ hir:: TraitItemKind :: Fn (
335
+ hir:: FnSig { header : hir:: FnHeader { constness, .. } , .. } ,
336
+ ..,
337
+ ) ,
321
338
..
322
339
} )
323
- | hir:: Node :: Item ( hir:: Item { kind : hir:: ItemKind :: Impl ( hir:: Impl { constness, .. } ) , .. } ) => * constness,
340
+ | hir:: Node :: Item ( hir:: Item {
341
+ kind : hir:: ItemKind :: Impl ( hir:: Impl { constness, .. } ) ,
342
+ ..
343
+ } ) => * constness,
324
344
325
345
_ => hir:: Constness :: NotConst ,
326
346
} ,
0 commit comments