Skip to content

Commit 2ade18a

Browse files
pnkfelixcuviper
authored andcommitted
Added an "Explanation" header and expanded that section for the newly added lint.
(cherry picked from commit 6ca46da)
1 parent 9cf28f2 commit 2ade18a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

compiler/rustc_lint_defs/src/builtin.rs

+8
Original file line numberDiff line numberDiff line change
@@ -2928,10 +2928,18 @@ declare_lint! {
29282928
/// }
29292929
/// ```
29302930
///
2931+
/// ### Explanation
2932+
///
2933+
/// In the 1.77 release, the const evaluation machinery adopted some
2934+
/// stricter rules to reject expressions with values that could
2935+
/// end up holding mutable references to state stored in static memory
2936+
/// (which is inherently immutable).
2937+
///
29312938
/// This is a [future-incompatible] lint to ease the transition to an error.
29322939
/// See [issue #122153] for more details.
29332940
///
29342941
/// [issue #122153]: https://github.com/rust-lang/rust/issues/122153
2942+
/// [future-incompatible]: ../index.md#future-incompatible-lints
29352943
pub CONST_EVAL_MUTABLE_PTR_IN_FINAL_VALUE,
29362944
Warn,
29372945
"detects a mutable pointer that has leaked into final value of a const expression",

0 commit comments

Comments
 (0)