mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 05:51:58 +00:00
typos and spaces
This commit is contained in:
parent
03545109f4
commit
75ea7c7fc2
@ -84,7 +84,7 @@ impl<'tcx> ConstValue<'tcx> {
|
||||
/// size. Like a range of bytes in an `Allocation`, a `Scalar` can either represent the raw bytes
|
||||
/// of a simple value or a pointer into another `Allocation`
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, RustcEncodable, RustcDecodable, Hash)]
|
||||
pub enum Scalar<Tag=(),Id=AllocId> {
|
||||
pub enum Scalar<Tag=(), Id=AllocId> {
|
||||
/// The raw bytes of a simple value.
|
||||
Bits {
|
||||
/// The first `size` bytes are the value.
|
||||
@ -96,7 +96,7 @@ pub enum Scalar<Tag=(),Id=AllocId> {
|
||||
/// A pointer into an `Allocation`. An `Allocation` in the `memory` module has a list of
|
||||
/// relocations, but a `Scalar` is only large enough to contain one, so we just represent the
|
||||
/// relocation and its associated offset together as a `Pointer` here.
|
||||
Ptr(Pointer<Tag,Id>),
|
||||
Ptr(Pointer<Tag, Id>),
|
||||
}
|
||||
|
||||
impl<'tcx> Scalar<()> {
|
||||
|
@ -765,7 +765,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> Memory<'a, 'mir, 'tcx, M> {
|
||||
// SAFE: The above indexing would have panicked if there weren't at least `size` bytes
|
||||
// behind `src` and `dest`. Also, we use the overlapping-safe `ptr::copy` if `src` and
|
||||
// `dest` could possibly overlap.
|
||||
// The pointers above remain valid even if the `HashMap` table moved around because they
|
||||
// The pointers above remain valid even if the `HashMap` table is moved around because they
|
||||
// point into the `Vec` storing the bytes.
|
||||
unsafe {
|
||||
assert_eq!(size.bytes() as usize as u64, size.bytes());
|
||||
|
@ -25,8 +25,8 @@ use rustc::mir::interpret::{
|
||||
use super::{EvalContext, Machine, MemPlace, MPlaceTy, MemoryKind};
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Ord, PartialOrd, RustcEncodable, RustcDecodable, Hash)]
|
||||
pub enum ScalarMaybeUndef<Tag=(),Id=AllocId> {
|
||||
Scalar(Scalar<Tag,Id>),
|
||||
pub enum ScalarMaybeUndef<Tag=(), Id=AllocId> {
|
||||
Scalar(Scalar<Tag, Id>),
|
||||
Undef,
|
||||
}
|
||||
|
||||
@ -147,9 +147,9 @@ impl<'tcx, Tag> ScalarMaybeUndef<Tag> {
|
||||
/// In particular, thanks to `ScalarPair`, arithmetic operations and casts can be entirely
|
||||
/// defined on `Value`, and do not have to work with a `Place`.
|
||||
#[derive(Copy, Clone, Debug, Hash, PartialEq, Eq)]
|
||||
pub enum Value<Tag=(),Id=AllocId> {
|
||||
Scalar(ScalarMaybeUndef<Tag,Id>),
|
||||
ScalarPair(ScalarMaybeUndef<Tag,Id>, ScalarMaybeUndef<Tag,Id>),
|
||||
pub enum Value<Tag=(), Id=AllocId> {
|
||||
Scalar(ScalarMaybeUndef<Tag, Id>),
|
||||
ScalarPair(ScalarMaybeUndef<Tag, Id>, ScalarMaybeUndef<Tag, Id>),
|
||||
}
|
||||
|
||||
impl Value {
|
||||
|
@ -110,7 +110,7 @@ macro_rules! impl_snapshot_for {
|
||||
impl<'a, Ctx> self::Snapshot<'a, Ctx> for $enum_name
|
||||
where Ctx: self::SnapshotContext<'a>,
|
||||
{
|
||||
type Item = $enum_name<(),AllocIdSnapshot<'a>>;
|
||||
type Item = $enum_name<(), AllocIdSnapshot<'a>>;
|
||||
|
||||
#[inline]
|
||||
fn snapshot(&self, __ctx: &'a Ctx) -> Self::Item {
|
||||
@ -131,7 +131,7 @@ macro_rules! impl_snapshot_for {
|
||||
impl<'a, Ctx> self::Snapshot<'a, Ctx> for $struct_name
|
||||
where Ctx: self::SnapshotContext<'a>,
|
||||
{
|
||||
type Item = $struct_name<(),AllocIdSnapshot<'a>>;
|
||||
type Item = $struct_name<(), AllocIdSnapshot<'a>>;
|
||||
|
||||
#[inline]
|
||||
fn snapshot(&self, __ctx: &'a Ctx) -> Self::Item {
|
||||
@ -183,7 +183,7 @@ impl_snapshot_for!(struct Pointer {
|
||||
impl<'a, Ctx> Snapshot<'a, Ctx> for Scalar
|
||||
where Ctx: SnapshotContext<'a>,
|
||||
{
|
||||
type Item = Scalar<(),AllocIdSnapshot<'a>>;
|
||||
type Item = Scalar<(), AllocIdSnapshot<'a>>;
|
||||
|
||||
fn snapshot(&self, ctx: &'a Ctx) -> Self::Item {
|
||||
match self {
|
||||
@ -237,7 +237,7 @@ impl<'a> HashStable<StableHashingContext<'a>> for Place {
|
||||
impl<'a, Ctx> Snapshot<'a, Ctx> for Place
|
||||
where Ctx: SnapshotContext<'a>,
|
||||
{
|
||||
type Item = Place<(),AllocIdSnapshot<'a>>;
|
||||
type Item = Place<(), AllocIdSnapshot<'a>>;
|
||||
|
||||
fn snapshot(&self, ctx: &'a Ctx) -> Self::Item {
|
||||
match self {
|
||||
@ -281,7 +281,7 @@ impl_snapshot_for!(enum LocalValue {
|
||||
impl<'a, Ctx> Snapshot<'a, Ctx> for Relocations
|
||||
where Ctx: SnapshotContext<'a>,
|
||||
{
|
||||
type Item = Relocations<(),AllocIdSnapshot<'a>>;
|
||||
type Item = Relocations<(), AllocIdSnapshot<'a>>;
|
||||
|
||||
fn snapshot(&self, ctx: &'a Ctx) -> Self::Item {
|
||||
Relocations::from_presorted(self.iter()
|
||||
@ -293,7 +293,7 @@ impl<'a, Ctx> Snapshot<'a, Ctx> for Relocations
|
||||
#[derive(Eq, PartialEq)]
|
||||
struct AllocationSnapshot<'a> {
|
||||
bytes: &'a [u8],
|
||||
relocations: Relocations<(),AllocIdSnapshot<'a>>,
|
||||
relocations: Relocations<(), AllocIdSnapshot<'a>>,
|
||||
undef_mask: &'a UndefMask,
|
||||
align: &'a Align,
|
||||
mutability: &'a Mutability,
|
||||
@ -337,8 +337,8 @@ struct FrameSnapshot<'a, 'tcx: 'a> {
|
||||
instance: &'a ty::Instance<'tcx>,
|
||||
span: &'a Span,
|
||||
return_to_block: &'a StackPopCleanup,
|
||||
return_place: Place<(),AllocIdSnapshot<'a>>,
|
||||
locals: IndexVec<mir::Local, LocalValue<(),AllocIdSnapshot<'a>>>,
|
||||
return_place: Place<(), AllocIdSnapshot<'a>>,
|
||||
locals: IndexVec<mir::Local, LocalValue<(), AllocIdSnapshot<'a>>>,
|
||||
block: &'a mir::BasicBlock,
|
||||
stmt: usize,
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user