about summary refs log tree commit diff
path: root/compiler/rustc_error_codes/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-09-17 15:20:44 +0000
committerbors <bors@rust-lang.org>2023-09-17 15:20:44 +0000
commit203c57dbe20aee67eaa8f7be45d1e4ef0b274109 (patch)
treedff297ec14f9b108ee8c775862f19bb8ff9a51fa /compiler/rustc_error_codes/src
parentdb9c21fd944b942a3a83e1fbce0d7c1c9164bc2a (diff)
parenta6ccd265e6b0cad3107187fccbfee24d08158385 (diff)
downloadrust-203c57dbe20aee67eaa8f7be45d1e4ef0b274109.tar.gz
rust-203c57dbe20aee67eaa8f7be45d1e4ef0b274109.zip
Auto merge of #115334 - RalfJung:transparent-aligned-zst, r=compiler-errors
repr(transparent): it's fine if the one non-1-ZST field is a ZST

This code currently gets rejected:
```rust
#[repr(transparent)]
struct MyType([u16; 0])
```
That clearly seems like a bug to me: `repr(transparent)` [got defined ](https://github.com/rust-lang/rust/issues/77841#issuecomment-716575747) as having any number of 1-ZST fields plus optionally one more field; `MyType` clearly satisfies that definition.

This PR changes the `repr(transparent)` logic to actually match that definition.
Diffstat (limited to 'compiler/rustc_error_codes/src')
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0691.md4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0691.md b/compiler/rustc_error_codes/src/error_codes/E0691.md
index 483c74c0ff5..a5bedd61e92 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0691.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0691.md
@@ -1,9 +1,11 @@
+#### Note: this error code is no longer emitted by the compiler.
+
 A struct, enum, or union with the `repr(transparent)` representation hint
 contains a zero-sized field that requires non-trivial alignment.
 
 Erroneous code example:
 
-```compile_fail,E0691
+```ignore (error is no longer emitted)
 #![feature(repr_align)]
 
 #[repr(align(32))]