Skip to content

Commit

Permalink
Rollup merge of #75459 - RalfJung:local-info, r=oli-obk
Browse files Browse the repository at this point in the history
fix LocalInfo doc comment

The doc comment makes it sound like this is diagnostics-only, but that is not true -- even [unsafety checking uses this information](https://github.com/rust-lang/rust/blob/ded20c98be8585b2a9fe4eeadd1be5524f6ffb17/src/librustc_mir/transform/check_unsafety.rs#L206), so it is crucial for soundness, not just "nice to have".

Cc @oli-obk
  • Loading branch information
tmandry authored Aug 14, 2020
2 parents 6f964f0 + 0e26f9b commit c76259a
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/librustc_middle/mir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -857,9 +857,12 @@ pub struct LocalDecl<'tcx> {
#[cfg(target_arch = "x86_64")]
static_assert_size!(LocalDecl<'_>, 56);

/// Extra information about a some locals that's used for diagnostics. (Not
/// used for non-StaticRef temporaries, the return place, or anonymous function
/// parameters.)
/// Extra information about a some locals that's used for diagnostics and for
/// classifying variables into local variables, statics, etc, which is needed e.g.
/// for unsafety checking.
///
/// Not used for non-StaticRef temporaries, the return place, or anonymous
/// function parameters.
#[derive(Clone, Debug, RustcEncodable, RustcDecodable, HashStable, TypeFoldable)]
pub enum LocalInfo<'tcx> {
/// A user-defined local variable or function parameter
Expand Down

0 comments on commit c76259a

Please sign in to comment.