Auto merge of #67603 - oli-obk:no_mut_static_ref_from_const, r=RalfJung
Promoteds can contain raw pointers, but these must still only point to immutable allocations fixes #67601 r? @RalfJung cc @wesleywiser in order to not change behaviour in this PR, const prop uses the constant rules for interning, but at least there's an explicit mode for it now that we can think about this in the future
This commit is contained in:
commit
faf45c5dad
6 changed files with 55 additions and 21 deletions
5
src/test/ui/consts/raw_pointer_promoted.rs
Normal file
5
src/test/ui/consts/raw_pointer_promoted.rs
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
// check-pass
|
||||
|
||||
pub const FOO: &'static *const i32 = &(&0 as _);
|
||||
|
||||
fn main() {}
|
||||
Loading…
Add table
Add a link
Reference in a new issue