about summary refs log tree commit diff
diff options
context:
space:
mode:
authorMaybe Waffle <waffle.lapkin@gmail.com>2024-06-17 17:04:28 +0000
committerMaybe Lapkin <waffle.lapkin@gmail.com>2024-07-07 18:16:38 +0200
commitcda6f0c25d6421fd6814bd55a25701205da23585 (patch)
tree941f24eb104cb69141b1f4f12c2ae4e99861b93c
parent6d4995f4e6d3f4fe6ac54943a5b01c3cf752dd5d (diff)
downloadrust-cda6f0c25d6421fd6814bd55a25701205da23585.tar.gz
rust-cda6f0c25d6421fd6814bd55a25701205da23585.zip
doc fixups from review
-rw-r--r--compiler/rustc_const_eval/src/interpret/eval_context.rs6
-rw-r--r--compiler/rustc_const_eval/src/interpret/terminator.rs8
-rw-r--r--tests/ui/explicit-tail-calls/ctfe-collatz-multi-rec.rs2
3 files changed, 7 insertions, 9 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/eval_context.rs b/compiler/rustc_const_eval/src/interpret/eval_context.rs
index fd063575e5d..9517e3d3597 100644
--- a/compiler/rustc_const_eval/src/interpret/eval_context.rs
+++ b/compiler/rustc_const_eval/src/interpret/eval_context.rs
@@ -819,7 +819,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
         Ok(())
     }
 
-    /// Creates a new stack frame, initializes it and pushes it unto the stack.
+    /// Creates a new stack frame, initializes it and pushes it onto the stack.
     /// A private helper for [`push_stack_frame`](InterpCx::push_stack_frame).
     fn push_new_stack_frame(
         &mut self,
@@ -902,8 +902,8 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
         Ok(StackPop { jump, target, destination })
     }
 
-    /// A private helper for [`push_stack_frame`](InterpCx::push_stack_frame).
-    /// Returns whatever the cleanup was done.
+    /// A private helper for [`pop_stack_frame`](InterpCx::pop_stack_frame).
+    /// Returns `true` if cleanup has been done, `false` otherwise.
     fn cleanup_current_frame_locals(&mut self) -> InterpResult<'tcx, bool> {
         // Cleanup: deallocate locals.
         // Usually we want to clean up (deallocate locals), but in a few rare cases we don't.
diff --git a/compiler/rustc_const_eval/src/interpret/terminator.rs b/compiler/rustc_const_eval/src/interpret/terminator.rs
index 9f4ca93a3e8..589ab6029f9 100644
--- a/compiler/rustc_const_eval/src/interpret/terminator.rs
+++ b/compiler/rustc_const_eval/src/interpret/terminator.rs
@@ -977,11 +977,9 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
         // which pushes a new stack frame, with the return address from
         // the popped stack frame.
         //
-        // Note that we can't use `pop_stack_frame` as it "executes"
-        // the goto to the return block, but we don't want to,
-        // only the tail called function should return to the current
-        // return block.
-
+        // Note that we are using `pop_stack_frame` and not `return_from_current_stack_frame`,
+        // as the latter "executes" the goto to the return block, but we don't want to,
+        // only the tail called function should return to the current return block.
         M::before_stack_pop(self, self.frame())?;
 
         let StackPop { jump, target, destination } = self.pop_stack_frame(false)?;
diff --git a/tests/ui/explicit-tail-calls/ctfe-collatz-multi-rec.rs b/tests/ui/explicit-tail-calls/ctfe-collatz-multi-rec.rs
index 2e6bb0e1ac5..86041b66960 100644
--- a/tests/ui/explicit-tail-calls/ctfe-collatz-multi-rec.rs
+++ b/tests/ui/explicit-tail-calls/ctfe-collatz-multi-rec.rs
@@ -2,7 +2,7 @@
 #![allow(incomplete_features)]
 #![feature(explicit_tail_calls)]
 
-/// A very unnecessarily complicated "implementation" of the callatz conjecture.
+/// A very unnecessarily complicated "implementation" of the Collatz conjecture.
 /// Returns the number of steps to reach `1`.
 ///
 /// This is just a test for tail calls, which involves multiple functions calling each other.