Skip to content

Commit d812850

Browse files
committed
fix documentation
1 parent e652147 commit d812850

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

compiler/rustc_lint_defs/src/builtin.rs

+9-6
Original file line numberDiff line numberDiff line change
@@ -3134,8 +3134,8 @@ declare_lint! {
31343134

31353135
declare_lint! {
31363136
/// The `repr_transparent_external_private_fields` lint
3137-
/// detects types marked #[repr(trasparent)] that (transitively)
3138-
/// contain an external ZST type marked #[non_exhaustive]
3137+
/// detects types marked `#[repr(trasparent)]` that (transitively)
3138+
/// contain an external ZST type marked `#[non_exhaustive]`
31393139
///
31403140
/// ### Example
31413141
///
@@ -3150,17 +3150,20 @@ declare_lint! {
31503150
/// This will produce:
31513151
///
31523152
/// ```text
3153-
/// error: deprecated `#[macro_use]` attribute used to import macros should be replaced at use sites with a `use` item to import the macro instead
3154-
/// --> src/main.rs:3:1
3153+
/// error: zero-sized fields in repr(transparent) cannot contain external non-exhaustive types
3154+
/// --> src/main.rs:5:28
31553155
/// |
3156-
/// 3 | #[macro_use]
3157-
/// | ^^^^^^^^^^^^
3156+
/// 5 | struct Bar(u32, ([u32; 0], NonExhaustiveZst));
3157+
/// | ^^^^^^^^^^^^^^^^
31583158
/// |
31593159
/// note: the lint level is defined here
31603160
/// --> src/main.rs:1:9
31613161
/// |
31623162
/// 1 | #![deny(repr_transparent_external_private_fields)]
31633163
/// | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
3164+
/// = warning: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
3165+
/// = note: for more information, see issue #78586 <https://github.com/rust-lang/rust/issues/78586>
3166+
/// = note: this struct contains `NonExhaustiveZst`, which is marked with `#[non_exhaustive]`, and makes it not a breaking change to become non-zero-sized in the future.
31643167
/// ```
31653168
///
31663169
/// ### Explanation

0 commit comments

Comments
 (0)