Skip to content

Commit 6ca46da

Browse files
committed
Added an "Explanation" header and expanded that section for the newly added lint.
1 parent 1c3424b commit 6ca46da

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
@@ -2819,10 +2819,18 @@ declare_lint! {
28192819
/// }
28202820
/// ```
28212821
///
2822+
/// ### Explanation
2823+
///
2824+
/// In the 1.77 release, the const evaluation machinery adopted some
2825+
/// stricter rules to reject expressions with values that could
2826+
/// end up holding mutable references to state stored in static memory
2827+
/// (which is inherently immutable).
2828+
///
28222829
/// This is a [future-incompatible] lint to ease the transition to an error.
28232830
/// See [issue #122153] for more details.
28242831
///
28252832
/// [issue #122153]: https://github.com/rust-lang/rust/issues/122153
2833+
/// [future-incompatible]: ../index.md#future-incompatible-lints
28262834
pub CONST_EVAL_MUTABLE_PTR_IN_FINAL_VALUE,
28272835
Warn,
28282836
"detects a mutable pointer that has leaked into final value of a const expression",

0 commit comments

Comments
 (0)