Skip to content

Commit

Permalink
Doc comment fixes for rustc::mir::interpret::InterpretCx
Browse files Browse the repository at this point in the history
  • Loading branch information
wesleywiser committed May 31, 2019
1 parent 3ade426 commit 3b7223d
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions src/librustc_mir/interpret/operand.rs
Expand Up @@ -243,7 +243,7 @@ pub(super) fn from_known_layout<'tcx>(
}

impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> InterpretCx<'a, 'mir, 'tcx, M> {
/// Try reading an immediate in memory; this is interesting particularly for ScalarPair.
/// Try reading an immediate in memory; this is interesting particularly for `ScalarPair`.
/// Returns `None` if the layout does not permit loading this as a value.
fn try_read_immediate_from_mplace(
&self,
Expand Down Expand Up @@ -444,7 +444,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> InterpretCx<'a, 'mir, 'tcx, M>
Ok(OpTy { op, layout })
}

/// Every place can be read from, so we can turm them into an operand
/// Every place can be read from, so we can turn them into an operand
#[inline(always)]
pub fn place_to_op(
&self,
Expand Down Expand Up @@ -500,7 +500,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> InterpretCx<'a, 'mir, 'tcx, M>
}

/// Evaluate the operand, returning a place where you can then find the data.
/// if you already know the layout, you can save two some table lookups
/// If you already know the layout, you can save two table lookups
/// by passing it in here.
pub fn eval_operand(
&self,
Expand Down
8 changes: 4 additions & 4 deletions src/librustc_mir/interpret/place.rs
Expand Up @@ -346,8 +346,8 @@ where
Ok(place)
}

/// Offset a pointer to project to a field. Unlike place_field, this is always
/// possible without allocating, so it can take &self. Also return the field's layout.
/// Offset a pointer to project to a field. Unlike `place_field`, this is always
/// possible without allocating, so it can take `&self`. Also return the field's layout.
/// This supports both struct and array fields.
#[inline(always)]
pub fn mplace_field(
Expand Down Expand Up @@ -722,7 +722,7 @@ where
}

/// Write an immediate to memory.
/// If you use this you are responsible for validating that things git copied at the
/// If you use this you are responsible for validating that things got copied at the
/// right type.
fn write_immediate_to_mplace_no_validate(
&mut self,
Expand Down Expand Up @@ -805,7 +805,7 @@ where

/// Copies the data from an operand to a place. This does not support transmuting!
/// Use `copy_op_transmute` if the layouts could disagree.
/// Also, if you use this you are responsible for validating that things git copied at the
/// Also, if you use this you are responsible for validating that things get copied at the
/// right type.
fn copy_op_no_validate(
&mut self,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc_mir/interpret/validity.rs
Expand Up @@ -613,7 +613,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> InterpretCx<'a, 'mir, 'tcx, M>
/// is an indirect operand.
/// It will error if the bits at the destination do not match the ones described by the layout.
///
/// `ref_tracking` can be None to avoid recursive checking below references.
/// `ref_tracking` can be `None` to avoid recursive checking below references.
/// This also toggles between "run-time" (no recursion) and "compile-time" (with recursion)
/// validation (e.g., pointer values are fine in integers at runtime).
pub fn validate_operand(
Expand Down

0 comments on commit 3b7223d

Please sign in to comment.