1
Fork 0

Rollup merge of #121782 - RalfJung:mutable-ref-in-static, r=oli-obk

allow statics pointing to mutable statics

Fixes https://github.com/rust-lang/rust/issues/120450 for good. We can even simplify our checks: no need to specifically go looking for mutable references in const, we can just reject any reference that points to something mutable.

r? `@oli-obk`
This commit is contained in:
Matthias Krüger 2024-02-29 20:50:04 +01:00 committed by GitHub
commit 255fdcc858
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 64 additions and 307 deletions

View file

@ -420,7 +420,6 @@ pub enum ValidationErrorKind<'tcx> {
PartialPointer,
PtrToUninhabited { ptr_kind: PointerKind, ty: Ty<'tcx> },
PtrToStatic { ptr_kind: PointerKind },
MutableRefInConstOrStatic,
ConstRefToMutable,
ConstRefToExtern,
MutableRefToImmutable,