Skip to content

Commit c081974

Browse files
authored
Rollup merge of #61391 - wesleywiser:doc_comments_interpretcx, r=Centril
Doc comment fixes for `rustc::mir::interpret::InterpretCx` Fixes some stuff I noticed while working in const-prop.
2 parents 760a98f + 3b7223d commit c081974

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/librustc_mir/interpret/operand.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ pub(super) fn from_known_layout<'tcx>(
243243
}
244244

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

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

502502
/// Evaluate the operand, returning a place where you can then find the data.
503-
/// if you already know the layout, you can save two some table lookups
503+
/// If you already know the layout, you can save two table lookups
504504
/// by passing it in here.
505505
pub fn eval_operand(
506506
&self,

src/librustc_mir/interpret/place.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -346,8 +346,8 @@ where
346346
Ok(place)
347347
}
348348

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

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

806806
/// Copies the data from an operand to a place. This does not support transmuting!
807807
/// Use `copy_op_transmute` if the layouts could disagree.
808-
/// Also, if you use this you are responsible for validating that things git copied at the
808+
/// Also, if you use this you are responsible for validating that things get copied at the
809809
/// right type.
810810
fn copy_op_no_validate(
811811
&mut self,

src/librustc_mir/interpret/validity.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> InterpretCx<'a, 'mir, 'tcx, M>
613613
/// is an indirect operand.
614614
/// It will error if the bits at the destination do not match the ones described by the layout.
615615
///
616-
/// `ref_tracking` can be None to avoid recursive checking below references.
616+
/// `ref_tracking` can be `None` to avoid recursive checking below references.
617617
/// This also toggles between "run-time" (no recursion) and "compile-time" (with recursion)
618618
/// validation (e.g., pointer values are fine in integers at runtime).
619619
pub fn validate_operand(

0 commit comments

Comments
 (0)