Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tracking Issue for BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE lint #107457

Closed
nnethercote opened this issue Jan 30, 2023 · 2 comments · Fixed by #127907
Closed

Tracking Issue for BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE lint #107457

nnethercote opened this issue Jan 30, 2023 · 2 comments · Fixed by #127907
Labels
C-future-incompatibility Category: Future-incompatibility lints C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC

Comments

@nnethercote
Copy link
Contributor

This is a tracking issue for the BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE lint, which is being added in #104429. The lint detects cases where derive is used with a packed struct that contains a [u8] field.

Example

This lint will trigger for code like this:

#[repr(packed)]
#[derive(Eq, PartialEq)]
pub struct FlexZeroSlice {
    width: u8,
    data: [u8], // triggered
}

At some point in the future this case will be disallowed.

See #104429 for more details, especially the t-lang nomination.

@nnethercote nnethercote added the C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC label Jan 30, 2023
@est31
Copy link
Member

est31 commented Jan 30, 2023

@rustbot label C-future-compatibility

@rustbot rustbot added the C-future-incompatibility Category: Future-incompatibility lints label Jan 30, 2023
nicholasbishop added a commit to nicholasbishop/uefi-rs that referenced this issue Jan 31, 2023
Deriving `Debug` and `PartialEq` on a packed struct containing `[u8]` fields is
being phased out. See rust-lang/rust#107457 for more
info.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Feb 14, 2023
update ICU4X to 1.1.0

This patch updates the ICU4X crates to version 1.1.0 and regenerates the static data for `rustc_baked_icu_data`.

This is mostly an internal and bugfix update. It notably includes unicode-org/icu4x#2834 to fix the future compatibility warning for [`BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE`](rust-lang#107457).

[full changelog](https://github.com/unicode-org/icu4x/blob/icu%401.1.0/CHANGELOG.md)
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Feb 14, 2023
update ICU4X to 1.1.0

This patch updates the ICU4X crates to version 1.1.0 and regenerates the static data for `rustc_baked_icu_data`.

This is mostly an internal and bugfix update. It notably includes unicode-org/icu4x#2834 to fix the future compatibility warning for [`BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE`](rust-lang#107457).

[full changelog](https://github.com/unicode-org/icu4x/blob/icu%401.1.0/CHANGELOG.md)
RalfJung pushed a commit to RalfJung/miri that referenced this issue Feb 15, 2023
update ICU4X to 1.1.0

This patch updates the ICU4X crates to version 1.1.0 and regenerates the static data for `rustc_baked_icu_data`.

This is mostly an internal and bugfix update. It notably includes unicode-org/icu4x#2834 to fix the future compatibility warning for [`BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE`](rust-lang/rust#107457).

[full changelog](https://github.com/unicode-org/icu4x/blob/icu%401.1.0/CHANGELOG.md)
kennystrawnmusic added a commit to kennystrawnmusic/bootloader that referenced this issue Mar 27, 2023
@traviscross
Copy link
Contributor

@rustbot labels +I-lang-nominated

Let's discuss whether we want to disallow this in Rust 2024.

@rustbot rustbot added the I-lang-nominated Nominated for discussion during a lang team meeting. label Nov 15, 2023
@traviscross traviscross removed the I-lang-nominated Nominated for discussion during a lang team meeting. label Nov 15, 2023
bors added a commit to rust-lang-ci/rust that referenced this issue Jul 18, 2024
…_with_derive, r=<try>

built-in derive: remove BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE hack and lint

Fixes rust-lang#107457 by turning the lint into a hard error. The lint has been shown in future breakage reports since Rust 1.69 (released in April 2023).

Let's see (via crater) if enough time has passed since rust-lang#104429, and unicode-org/icu4x#2834 has propagated far enough to let us make this a hard error.

TODO: actually remove the lint.

Cc `@nnethercote` `@Manishearth`
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Aug 5, 2024
…ct_with_derive, r=nnethercote

built-in derive: remove BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE hack and lint

Fixes rust-lang#107457 by turning the lint into a hard error. The lint has been shown in future breakage reports since Rust 1.69 (released in April 2023).

Let's see (via crater) if enough time has passed since rust-lang#104429, and unicode-org/icu4x#2834 has propagated far enough to let us make this a hard error.

Cc `@nnethercote` `@Manishearth`
@bors bors closed this as completed in d10f2b3 Aug 5, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this issue Aug 5, 2024
Rollup merge of rust-lang#127907 - RalfJung:byte_slice_in_packed_struct_with_derive, r=nnethercote

built-in derive: remove BYTE_SLICE_IN_PACKED_STRUCT_WITH_DERIVE hack and lint

Fixes rust-lang#107457 by turning the lint into a hard error. The lint has been shown in future breakage reports since Rust 1.69 (released in April 2023).

Let's see (via crater) if enough time has passed since rust-lang#104429, and unicode-org/icu4x#2834 has propagated far enough to let us make this a hard error.

Cc ``@nnethercote`` ``@Manishearth``
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-future-incompatibility Category: Future-incompatibility lints C-tracking-issue Category: An issue tracking the progress of sth. like the implementation of an RFC
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants