diff options
| author | Scott McMurray <scottmcm@users.noreply.github.com> | 2025-03-06 19:13:46 -0800 |
|---|---|---|
| committer | Scott McMurray <scottmcm@users.noreply.github.com> | 2025-07-20 10:22:09 -0700 |
| commit | 41ce1ed252f194756fb2f3e3e92bbdfb3940088d (patch) | |
| tree | 6d723fea3a43e0424cb4575ce2c2b80bd5a77120 /compiler/rustc_mir_transform/src/validate.rs | |
| parent | f790042c6ab3cf05622e63928b13cb802d68fadf (diff) | |
| download | rust-41ce1ed252f194756fb2f3e3e92bbdfb3940088d.tar.gz rust-41ce1ed252f194756fb2f3e3e92bbdfb3940088d.zip | |
Ban projecting into SIMD types [MCP838]
Diffstat (limited to 'compiler/rustc_mir_transform/src/validate.rs')
| -rw-r--r-- | compiler/rustc_mir_transform/src/validate.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/compiler/rustc_mir_transform/src/validate.rs b/compiler/rustc_mir_transform/src/validate.rs index 659ca4df159..5860072d541 100644 --- a/compiler/rustc_mir_transform/src/validate.rs +++ b/compiler/rustc_mir_transform/src/validate.rs @@ -721,6 +721,15 @@ impl<'a, 'tcx> Visitor<'tcx> for TypeChecker<'a, 'tcx> { ); } + if adt_def.repr().simd() { + self.fail( + location, + format!( + "Projecting into SIMD type {adt_def:?} is banned by MCP#838" + ), + ); + } + let var = parent_ty.variant_index.unwrap_or(FIRST_VARIANT); let Some(field) = adt_def.variant(var).fields.get(f) else { fail_out_of_bounds(self, location); |
