about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFelix S. Klock II <pnkfelix@pnkfx.org>2024-03-11 11:16:23 -0400
committerFelix S. Klock II <pnkfelix@pnkfx.org>2024-03-13 10:32:41 -0400
commit6ca46daded8320dffe437b9008c2b353563af0a5 (patch)
treeadb5038a290270859d801d92d89fd28c1ab240a8
parent1c3424bfc1354db47fd3901cb1b76c22fbe33392 (diff)
downloadrust-6ca46daded8320dffe437b9008c2b353563af0a5.tar.gz
rust-6ca46daded8320dffe437b9008c2b353563af0a5.zip
Added an "Explanation" header and expanded that section for the newly added lint.
-rw-r--r--compiler/rustc_lint_defs/src/builtin.rs8
1 files changed, 8 insertions, 0 deletions
diff --git a/compiler/rustc_lint_defs/src/builtin.rs b/compiler/rustc_lint_defs/src/builtin.rs
index 3dfc2d026bd..7ab610ab970 100644
--- a/compiler/rustc_lint_defs/src/builtin.rs
+++ b/compiler/rustc_lint_defs/src/builtin.rs
@@ -2819,10 +2819,18 @@ declare_lint! {
     /// }
     /// ```
     ///
+    /// ### Explanation
+    ///
+    /// In the 1.77 release, the const evaluation machinery adopted some
+    /// stricter rules to reject expressions with values that could
+    /// end up holding mutable references to state stored in static memory
+    /// (which is inherently immutable).
+    ///
     /// This is a [future-incompatible] lint to ease the transition to an error.
     /// See [issue #122153] for more details.
     ///
     /// [issue #122153]: https://github.com/rust-lang/rust/issues/122153
+    /// [future-incompatible]: ../index.md#future-incompatible-lints
     pub CONST_EVAL_MUTABLE_PTR_IN_FINAL_VALUE,
     Warn,
     "detects a mutable pointer that has leaked into final value of a const expression",