typeck: always expose explicit enum discriminant `AnonConst`s' parent in `generics_of`.
This is similar to #70452 but for explicit `enum` discriminant constant expressions.
However, unlike #70452, this PR should have no effect on stable code, as while it alleviates #43408 errors, there is no way to actually compile an `enum` with generic parameters *and* explicit discriminants, without `#![feature(arbitrary_enum_discriminant)]`, as explicit discriminant expression don't count as uses of parameters (if they did, they would count as invariant uses).
<hr/>
There's also 2 other commits here, both related to #70453:
* "ty: use `delay_span_bug` in `ty::AdtDef::eval_explicit_discr`." - hides the ICEs demonstrated on #70453, when there are other errors (which the next commit adds)
* "typeck/wfcheck: require that explicit enum discriminants const-evaluate succesfully." - closes#70453 by picking alternative "2", i.e. erroring when a discriminant doesn't fully const-evaluate from the perspective of the `enum` definition
In the future, it might be possible to allow `enum` discriminants to actually depend on parameters, but that will likely require #68436 + some way to restrict the values so no two variants can end up with overlapping discriminants.
As this PR would close#70453, it shouldn't be merged until a decision is reached there.
r? @nikomatsakis
Decode qualifs for associated const defaults
Fixes#71734.
We encode qualifs for associated constants, but never expected to decode the qualifs for defaulted associated consts. Fix this, and test that associated const defaults have the correct qualifs cross-crate.
r? @tmandry
Implement `confusable_idents` lint.
This collects all identifier symbols into `ParseSession` and examines them within the non-ascii-idents lint.
The skeleton generation part needs to be added to `unicode-security` crate. Will update this PR when the crate is updated.
r? @petrochenkov
EDIT: also included the `concat_idents` part.
Implement RFC 2523, `#[cfg(version(..))]`
Hi! This is my first contribution to rust, I hope I didn't miss anything. I tried to implement this feature so that `#[cfg(version(1.44.0))]` works but the parser was printing an error that I wasn't sure how to fix so I just opted for implementing `#[cfg(version("1.44.0"))]` (note the quotes).
Tracking issue: #64796
The extracted function can be used by the rest of bootstrap to detect if we've
already built an up-to-date LLVM (and so it's safe for us to either request it
or pretend it exists).
Rollup of 6 pull requests
Successful merges:
- #71712 (Miri: port error backtraces to std::backtrace)
- #71736 (bootstrap: also apply unused-attributes hack without deny_warnings)
- #71738 (remove AllocId generalization of Pointer)
- #71739 (remove obsolete comment)
- #71781 (Uncomment test code for failure to use `Box::pin`)
- #71782 (Use a non-existent test path instead of clobbering /dev/null)
Failed merges:
r? @ghost
bootstrap: also apply unused-attributes hack without deny_warnings
This is a follow-up to https://github.com/rust-lang/rust/pull/70881 that also silences these warnings when deny_warnings is off. They otherwise spam my screen during development and make it hard to see actual warnings.
Cc @eddyb r? @Mark-Simulacrum
Miri: port error backtraces to std::backtrace
No need to pull in an external dependency if libstd already includes this feature (using the same dependency internally, but... still).
r? @oli-obk