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

Address unused tuple struct fields in the standard library #118383

Merged

Conversation

shepmaster
Copy link
Member

No description provided.

@rustbot
Copy link
Collaborator

rustbot commented Nov 27, 2023

r? @m-ou-se

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels Nov 27, 2023
@@ -171,7 +171,7 @@ struct WithHeader<H>(NonNull<u8>, PhantomData<H>);
/// An opaque representation of `WithHeader<H>` to avoid the
/// projection invariance of `<T as Pointee>::Metadata`.
#[repr(transparent)]
struct WithOpaqueHeader(NonNull<u8>);
struct WithOpaqueHeader(#[allow(unused_tuple_struct_fields)] NonNull<u8>);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future readers of this code, it's probably helpful to add a comment explaining why this field is 'unused'.

Suggested change
struct WithOpaqueHeader(#[allow(unused_tuple_struct_fields)] NonNull<u8>);
#[allow(unused_tuple_struct_fields)] // Field only used through `WithHeader` type above.
struct WithOpaqueHeader(NonNull<u8>);

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, tweaked!

@m-ou-se m-ou-se added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Nov 28, 2023
@shepmaster shepmaster force-pushed the unused-tuple-struct-field-cleanup-stdlib branch from 31abe0a to 115eac0 Compare November 28, 2023 17:01
@shepmaster
Copy link
Member Author

@bors r=@m-ou-se rollup

@bors
Copy link
Contributor

bors commented Nov 28, 2023

📌 Commit 115eac0 has been approved by m-ou-se

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Nov 28, 2023
bors added a commit to rust-lang-ci/rust that referenced this pull request Nov 29, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#118342 (Dont suggest `!` for path in function call if it has generic args)
 - rust-lang#118383 (Address unused tuple struct fields in the standard library)
 - rust-lang#118401 (`rustc_ast_lowering` cleanups)
 - rust-lang#118409 (format_foreign.rs: unwrap return Option value for `fn position`, as it always returns Some)
 - rust-lang#118413 (Fix the issue of suggesting unwrap/expect for shorthand field)
 - rust-lang#118425 (Update cargo)
 - rust-lang#118429 (Fix a typo in a `format_args!` note)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit f8628a1 into rust-lang:master Nov 29, 2023
11 checks passed
@rustbot rustbot added this to the 1.76.0 milestone Nov 29, 2023
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Nov 29, 2023
Rollup merge of rust-lang#118383 - shepmaster:unused-tuple-struct-field-cleanup-stdlib, r=m-ou-se

Address unused tuple struct fields in the standard library
@shepmaster shepmaster deleted the unused-tuple-struct-field-cleanup-stdlib branch November 29, 2023 12:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs Relevant to the library team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants