@@ -347,22 +347,20 @@ impl<'a, 'b, 'tcx> visit::Visitor<'a> for DefCollector<'a, 'b, 'tcx> {
347347 }
348348
349349 fn visit_anon_const ( & mut self , constant : & ' a AnonConst ) {
350- if self . resolver . tcx . features ( ) . const_arg_path {
351- // HACK(min_generic_const_args): don't create defs for anon consts if we think they will
352- // later be turned into ConstArgKind::Path's. because this is before resolve is done, we
353- // may accidentally identify a construction of a unit struct as a param and not create a
354- // def. we'll then create a def later in ast lowering in this case. the parent of nested
355- // items will be messed up, but that's ok because there can't be any if we're just looking
356- // for bare idents.
357-
358- if matches ! ( constant. value. maybe_unwrap_block( ) . kind, ExprKind :: MacCall ( ..) ) {
359- // See self.pending_anon_const_info for explanation
360- self . pending_anon_const_info =
361- Some ( PendingAnonConstInfo { id : constant. id , span : constant. value . span } ) ;
362- return visit:: walk_anon_const ( self , constant) ;
363- } else if constant. value . is_potential_trivial_const_arg ( ) {
364- return visit:: walk_anon_const ( self , constant) ;
365- }
350+ // HACK(min_generic_const_args): don't create defs for anon consts if we think they will
351+ // later be turned into ConstArgKind::Path's. because this is before resolve is done, we
352+ // may accidentally identify a construction of a unit struct as a param and not create a
353+ // def. we'll then create a def later in ast lowering in this case. the parent of nested
354+ // items will be messed up, but that's ok because there can't be any if we're just looking
355+ // for bare idents.
356+
357+ if matches ! ( constant. value. maybe_unwrap_block( ) . kind, ExprKind :: MacCall ( ..) ) {
358+ // See self.pending_anon_const_info for explanation
359+ self . pending_anon_const_info =
360+ Some ( PendingAnonConstInfo { id : constant. id , span : constant. value . span } ) ;
361+ return visit:: walk_anon_const ( self , constant) ;
362+ } else if constant. value . is_potential_trivial_const_arg ( ) {
363+ return visit:: walk_anon_const ( self , constant) ;
366364 }
367365
368366 let def = self . create_def ( constant. id , kw:: Empty , DefKind :: AnonConst , constant. value . span ) ;
0 commit comments