about summary refs log tree commit diff
path: root/compiler/rustc_middle/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-12-22 05:29:45 +0000
committerbors <bors@rust-lang.org>2024-12-22 05:29:45 +0000
commita2bcfae5c5d05dd7806a79194cda39108ed6cd7d (patch)
tree6d0a6fd8975fc2c731d6ae666db72e63e94f1913 /compiler/rustc_middle/src
parentc1132470a6986b12503e8000e322e9164c1f03ac (diff)
parent66dbfd4af3069cc2454a982e441aecd1a21616ae (diff)
downloadrust-a2bcfae5c5d05dd7806a79194cda39108ed6cd7d.tar.gz
rust-a2bcfae5c5d05dd7806a79194cda39108ed6cd7d.zip
Auto merge of #134640 - matthiaskrgr:rollup-xlstm3o, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - #134364 (Use E0665 for missing `#[default]` on enum and update doc)
 - #134601 (Support pretty-printing `dyn*` trait objects)
 - #134603 (Explain why a type is not eligible for `impl PointerLike`.)
 - #134618 (coroutine_clone: add comments)
 - #134630 (Use `&raw` for `ptr` primitive docs)
 - #134637 (Flatten effects directory now that it doesn't really test anything specific)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_middle/src')
-rw-r--r--compiler/rustc_middle/src/mir/syntax.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/rustc_middle/src/mir/syntax.rs b/compiler/rustc_middle/src/mir/syntax.rs
index b7ece5ffa62..0c17a2e0fe5 100644
--- a/compiler/rustc_middle/src/mir/syntax.rs
+++ b/compiler/rustc_middle/src/mir/syntax.rs
@@ -821,6 +821,11 @@ pub enum TerminatorKind<'tcx> {
     /// continues at the `resume` basic block, with the second argument written to the `resume_arg`
     /// place. If the coroutine is dropped before then, the `drop` basic block is invoked.
     ///
+    /// Note that coroutines can be (unstably) cloned under certain conditions, which means that
+    /// this terminator can **return multiple times**! MIR optimizations that reorder code into
+    /// different basic blocks needs to be aware of that.
+    /// See <https://github.com/rust-lang/rust/issues/95360>.
+    ///
     /// Not permitted in bodies that are not coroutine bodies, or after coroutine lowering.
     ///
     /// **Needs clarification**: What about the evaluation order of the `resume_arg` and `value`?