Go to file
Guillaume Boisseau f70f13a1d3
Rollup merge of #120932 - RalfJung:mut-ptr-to-static, r=oli-obk
const_mut_refs: allow mutable pointers to statics

Fixes https://github.com/rust-lang/rust/issues/118447

Writing this PR became a bit messy, see [Zulip](https://rust-lang.zulipchat.com/#narrow/stream/146212-t-compiler.2Fconst-eval/topic/Statics.20pointing.20to.20interior.20mutable.20statics) for some of my journey.^^ Turns out there was a long-standing bug in our qualif logic that led to us incorrectly classifying certain places as "no interior mut" when they actually had interior mut. Due to that the `const_refs_to_cell` feature gate was required far less often than it otherwise would, e.g. in [this code](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=9e0c042c451b3d11d64dd6263679a164). Fixing this however would be a massive breaking change all over libcore and likely the wider ecosystem. So I also changed the const-checking logic to just not require the feature gate for the affected cases. While doing so I discovered a bunch of logic that is not explained and that I could not explain. However I think stabilizing some const-eval feature will make most of that logic inconsequential so I just added some FIXMEs and left it at that.

r? `@oli-obk`
2024-02-17 11:23:03 +01:00
.github Downgrade Xcode from the default (15.0) to 14.3.1. 2024-02-10 20:59:20 -08:00
.reuse
compiler Rollup merge of #120932 - RalfJung:mut-ptr-to-static, r=oli-obk 2024-02-17 11:23:03 +01:00
library Rollup merge of #119032 - smmalis37:patch-1, r=ChrisDenton 2024-02-17 11:23:03 +01:00
LICENSES
src Enable ConstPropLint for promoteds 2024-02-17 10:44:46 +05:30
tests Rollup merge of #120932 - RalfJung:mut-ptr-to-static, r=oli-obk 2024-02-17 11:23:03 +01:00
.editorconfig
.git-blame-ignore-revs
.gitattributes
.gitignore
.gitmodules Update to LLVM 18 2024-02-13 10:33:40 +01:00
.mailmap
Cargo.lock Rollup merge of #120982 - momvart:smir-61-foreign_kind, r=oli-obk 2024-02-15 09:20:18 +01:00
Cargo.toml clippy: Enable str_to_string rule 2024-02-10 01:00:41 +09:00
CODE_OF_CONDUCT.md
config.example.toml
configure
CONTRIBUTING.md
COPYRIGHT
INSTALL.md
LICENSE-APACHE
LICENSE-MIT
README.md
RELEASES.md Remove duplicate release note 2024-02-09 12:31:32 -05:00
rust-bors.toml
rustfmt.toml
triagebot.toml Rollup merge of #121043 - lcnr:lcnr-compiler-assign, r=fmease 2024-02-13 22:51:56 +01:00
x
x.ps1
x.py

The Rust Programming Language

Rust Community

This is the main source code repository for Rust. It contains the compiler, standard library, and documentation.

Note: this README is for users rather than contributors. If you wish to contribute to the compiler, you should read CONTRIBUTING.md instead.

Table of Contents

Quick Start

Read "Installation" from The Book.

Installing from Source

If you really want to install from source (though this is not recommended), see INSTALL.md.

Getting Help

See https://www.rust-lang.org/community for a list of chat platforms and forums.

Contributing

See CONTRIBUTING.md.

License

Rust is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0), with portions covered by various BSD-like licenses.

See LICENSE-APACHE, LICENSE-MIT, and COPYRIGHT for details.

Trademark

The Rust Foundation owns and protects the Rust and Cargo trademarks and logos (the "Rust Trademarks").

If you want to use these names or brands, please read the media guide.

Third-party logos may be subject to third-party copyrights and trademarks. See Licenses for details.