Rollup merge of #129246 - BoxyUwU:feature_gate_const_arg_path, r=cjgillot
Retroactively feature gate `ConstArgKind::Path` This puts the lowering introduced by #125915 under a feature gate until we fix the regressions introduced by it. Alternative to whole sale reverting the PR since it didn't seem like a very clean revert and I think this is generally a step in the right direction and don't want to get stuck landing and reverting the PR over and over :) cc #129137 ``@camelid,`` tests taken from there. beta is branching soon so I think it makes sense to not try and rush that fix through since it wont have much time to bake and if it has issues we can't simply revert it on beta. Fixes #128016
This commit is contained in:
commit
c0bedb9e5e
41 changed files with 425 additions and 206 deletions
|
@ -314,13 +314,15 @@ impl<'a, 'b, 'tcx> visit::Visitor<'a> for DefCollector<'a, 'b, 'tcx> {
|
|||
}
|
||||
|
||||
fn visit_anon_const(&mut self, constant: &'a AnonConst) {
|
||||
// HACK(min_generic_const_args): don't create defs for anon consts if we think they will
|
||||
// later be turned into ConstArgKind::Path's. because this is before resolve is done, we
|
||||
// may accidentally identify a construction of a unit struct as a param and not create a
|
||||
// def. we'll then create a def later in ast lowering in this case. the parent of nested
|
||||
// items will be messed up, but that's ok because there can't be any if we're just looking
|
||||
// for bare idents.
|
||||
if constant.value.is_potential_trivial_const_arg() {
|
||||
if self.resolver.tcx.features().const_arg_path
|
||||
&& constant.value.is_potential_trivial_const_arg()
|
||||
{
|
||||
// HACK(min_generic_const_args): don't create defs for anon consts if we think they will
|
||||
// later be turned into ConstArgKind::Path's. because this is before resolve is done, we
|
||||
// may accidentally identify a construction of a unit struct as a param and not create a
|
||||
// def. we'll then create a def later in ast lowering in this case. the parent of nested
|
||||
// items will be messed up, but that's ok because there can't be any if we're just looking
|
||||
// for bare idents.
|
||||
visit::walk_anon_const(self, constant)
|
||||
} else {
|
||||
let def =
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue