Support `cfg` and `cfg_attr` on generic parameters
`cfg` attributes are supported in all other positions where attributes are accepted at all.
They were previously prohibited in https://github.com/rust-lang/rust/pull/51283 because they weren't implemented correctly before that and were simply ignored.
`ByRef` const values have no identity beyond their value, we should not treat them as having identity. The `AllocId` often differed between equal constants, because of the way that the miri-engine evaluates constants.
Improve the explicit_outlives_requirements lint
* Don't use Strings to compare parameters
* Extend the lint to lifetime bounds
* Extend the lint to enums and unions
* Use the correct span for where clauses in tuple structs
* Try to early-out where possible
* Remove unnecessary bounds in rustc crates
Refactor interning to properly mark memory as mutable or immutable
r? @RalfJung
This implementation is incomplete out of multiple reasons
* [ ] add `-Zunleash_the_miri_inside_of_you` tests
* [ ] report an error if there's an `UnsafeCell` behind a reference in a constant
* [ ] make validity checks actually test whether the mutability of their allocations match what they see in the type
Rollup of 11 pull requests
Successful merges:
- #61505 (Only show methods that appear in `impl` blocks in the Implementors sections of trait doc pages)
- #61701 (move stray run-pass const tests into const/ folder)
- #61748 (Tweak transparent enums and unions diagnostic spans)
- #61802 (Make MaybeUninit #[repr(transparent)])
- #61839 (ci: Add a script for generating CPU usage graphs)
- #61842 (Remove unnecessary lift calls)
- #61843 (Turn down the myriad-closures test)
- #61896 (rustc_typeck: correctly compute `Substs` for `Res::SelfCtor`.)
- #61898 (syntax: Factor out common fields from `SyntaxExtension` variants)
- #61938 (create an issue for miri even in status test-fail)
- #61941 (Preserve generator and yield source for error messages)
Failed merges:
r? @ghost
Preserve generator and yield source for error messages
Previously, error messages after HIR lowering all referred
to generators and yield, regardless of whether the original
source was a generator or an async/await body. This change
tracks the kind of each generator and yield source in order
to provide appropriately tailored error messages.
Fixes#60615.