Skip to content

Commit

Permalink
update intern classification comment
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Sep 15, 2019
1 parent 224e2e5 commit 5462ecb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/librustc_mir/interpret/intern.rs
Expand Up @@ -278,9 +278,10 @@ pub fn intern_const_alloc_recursive(
// this `mutability` is the mutability of the place, ignoring the type
let (base_mutability, base_intern_mode) = match tcx.static_mutability(def_id) {
Some(hir::Mutability::MutImmutable) => (Mutability::Immutable, InternMode::Static),
None => (Mutability::Immutable, InternMode::ConstBase),
// `static mut` doesn't care about interior mutability, it's mutable anyway
Some(hir::Mutability::MutMutable) => (Mutability::Mutable, InternMode::Static),
// consts, promoteds. FIXME: what about array lengths, array initializers?
None => (Mutability::Immutable, InternMode::ConstBase),
};

// Type based interning.
Expand Down

0 comments on commit 5462ecb

Please sign in to comment.