mirror of
https://github.com/rust-lang/rust
synced 2024-10-16 21:43:43 +00:00
address review comments
Move tests and limit the init mask's structures/fields visibility.
This commit is contained in:
parent
9f16a81bc8
commit
a857ba25f9
|
@ -2,8 +2,6 @@
|
|||
|
||||
mod init_mask;
|
||||
mod provenance_map;
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
use std::borrow::Cow;
|
||||
use std::fmt;
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
use std::hash;
|
||||
use std::iter;
|
||||
use std::ops::Range;
|
||||
|
@ -16,12 +19,12 @@
|
|||
/// value.
|
||||
#[derive(Clone, Debug, Eq, PartialEq, TyEncodable, TyDecodable, Hash, HashStable)]
|
||||
pub struct InitMask {
|
||||
pub(crate) blocks: InitMaskBlocks,
|
||||
blocks: InitMaskBlocks,
|
||||
len: Size,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq, TyEncodable, TyDecodable, Hash, HashStable)]
|
||||
pub(crate) enum InitMaskBlocks {
|
||||
enum InitMaskBlocks {
|
||||
Lazy {
|
||||
/// Whether the lazy init mask is fully initialized or uninitialized.
|
||||
state: bool,
|
||||
|
@ -180,8 +183,8 @@ pub fn get(&self, idx: Size) -> bool {
|
|||
// Note: for performance reasons when interning, some of the fields can be partially
|
||||
// hashed. (see the `Hash` impl below for more details), so the impl is not derived.
|
||||
#[derive(Clone, Debug, Eq, PartialEq, TyEncodable, TyDecodable, HashStable)]
|
||||
pub(crate) struct InitMaskMaterialized {
|
||||
pub(crate) blocks: Vec<Block>,
|
||||
struct InitMaskMaterialized {
|
||||
blocks: Vec<Block>,
|
||||
}
|
||||
|
||||
// Const allocations are only hashed for interning. However, they can be large, making the hashing
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
use super::*;
|
||||
use crate::mir::interpret::alloc_range;
|
||||
|
||||
#[test]
|
||||
fn uninit_mask() {
|
Loading…
Reference in a new issue