You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: clippy_lints/src/trailing_zero_sized_array_without_repr.rs
+11-11Lines changed: 11 additions & 11 deletions
Original file line number
Diff line number
Diff line change
@@ -8,10 +8,10 @@ use rustc_session::{declare_lint_pass, declare_tool_lint};
8
8
9
9
declare_clippy_lint!{
10
10
/// ### What it does
11
-
/// Displays a warning when a struct with a trailing zero-sized array is declared without the `repr(C)` attribute.
11
+
/// Displays a warning when a struct with a trailing zero-sized array is declared without a `repr` attribute.
12
12
///
13
13
/// ### Why is this bad?
14
-
/// Zero-sized arrays aren't very useful in Rust itself, so such a struct is likely being created to pass to C code (or in conjuction with manual allocation to make it easy to compute the offset of the array). Either way, `#[repr(C)]` is needed.
14
+
/// Zero-sized arrays aren't very useful in Rust itself, so such a struct is likely being created to pass to C code or in some other situation where control over memory layout matters (for example, in conjuction with manual allocation to make it easy to compute the offset of the array). Either way, `#[repr(C)]` (or another `repr` attribute) is needed.
15
15
///
16
16
/// ### Example
17
17
/// ```rust
@@ -29,13 +29,13 @@ declare_clippy_lint! {
29
29
/// last: [SomeType; 0],
30
30
/// }
31
31
/// ```
32
-
pubTRAILING_ZERO_SIZED_ARRAY_WITHOUT_REPR_C,
32
+
pubTRAILING_ZERO_SIZED_ARRAY_WITHOUT_REPR,
33
33
nursery,
34
34
"struct with a trailing zero-sized array but without `repr(C)` or another `repr` attribute"
0 commit comments