Skip to content

Commit

Permalink
Added an "Explanation" header and expanded that section for the newly…
Browse files Browse the repository at this point in the history
… added lint.
  • Loading branch information
pnkfelix committed Mar 13, 2024
1 parent 1c3424b commit 6ca46da
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions compiler/rustc_lint_defs/src/builtin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 6ca46da

Please sign in to comment.