Skip to content

Commit c76259a

Browse files
authored
Rollup merge of #75459 - RalfJung:local-info, r=oli-obk
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
2 parents 6f964f0 + 0e26f9b commit c76259a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

src/librustc_middle/mir/mod.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -857,9 +857,12 @@ pub struct LocalDecl<'tcx> {
857857
#[cfg(target_arch = "x86_64")]
858858
static_assert_size!(LocalDecl<'_>, 56);
859859

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

0 commit comments

Comments
 (0)