File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -909,14 +909,12 @@ fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> &ty::Generics {
909909 let parent_id = tcx. hir ( ) . get_parent_item ( hir_id) ;
910910 Some ( tcx. hir ( ) . local_def_id ( parent_id) )
911911 }
912- // FIXME(#43408) enable this in all cases when we get lazy normalization.
913- Node :: AnonConst ( & anon_const) => {
914- // HACK(eddyb) this provides the correct generics when the workaround
915- // for a const parameter `AnonConst` is being used elsewhere, as then
916- // there won't be the kind of cyclic dependency blocking #43408.
917- let expr = & tcx. hir ( ) . body ( anon_const. body ) . value ;
918- let icx = ItemCtxt :: new ( tcx, def_id) ;
919- if AstConv :: const_param_def_id ( & icx, expr) . is_some ( ) {
912+ // FIXME(#43408) enable this always when we get lazy normalization.
913+ Node :: AnonConst ( _) => {
914+ // HACK(eddyb) this provides the correct generics when
915+ // `feature(const_generics)` is enabled, so that const expressions
916+ // used with const generics, e.g. `Foo<{N+1}>`, can work at all.
917+ if tcx. features ( ) . const_generics {
920918 let parent_id = tcx. hir ( ) . get_parent_item ( hir_id) ;
921919 Some ( tcx. hir ( ) . local_def_id ( parent_id) )
922920 } else {
You can’t perform that action at this time.
0 commit comments