Skip to content

Commit a3a44eb

Browse files
committed
clarify current MIR semantics re: overlapping assignment
1 parent a0d817c commit a3a44eb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

compiler/rustc_middle/src/mir/syntax.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -327,9 +327,11 @@ pub enum StatementKind<'tcx> {
327327
/// interesting for optimizations? Do we want to allow such optimizations?
328328
///
329329
/// **Needs clarification**: We currently require that the LHS place not overlap with any place
330-
/// read as part of computation of the RHS for some rvalues (generally those not producing
331-
/// primitives). This requirement is under discussion in [#68364]. As a part of this discussion,
332-
/// it is also unclear in what order the components are evaluated.
330+
/// read as part of computation of the RHS for some rvalues. This requirement is under
331+
/// discussion in [#68364]. Specifically, overlap is permitted only for assignments of a type
332+
/// with `BackendRepr::Scalar | BackendRepr::ScalarPair` where all the scalar fields are
333+
/// [`Scalar::Initialized`][rustc_abi::Scalar::Initialized]. As a part of this discussion, it is
334+
/// also unclear in what order the components are evaluated.
333335
///
334336
/// [#68364]: https://github.com/rust-lang/rust/issues/68364
335337
///

0 commit comments

Comments
 (0)