Skip to content

Conversation

whirm
Copy link

@whirm whirm commented May 30, 2025

fixes #2394

changelog: [redundant_box]: Lint on unnecessarily boxed types (sized types no bigger than a thin pointer).

@whirm whirm force-pushed the feat/redundant_box_lint branch from a09bb45 to eebfaff Compare May 30, 2025 07:28
@rustbot

This comment has been minimized.

Co-Authored-by: Félix Fischer <[email protected]>
Co-Authored-by: Hugo McNally <[email protected]>
@whirm whirm force-pushed the feat/redundant_box_lint branch from 0b59468 to 15e8321 Compare October 13, 2025 11:57
@blyxyas
Copy link
Member

blyxyas commented Oct 13, 2025

Hi @whirm
In this repository we use a bot to automatically assign reviews at semi-random, so pull requests marked as "draft" usually fly under the radar as they aren't asigned to anyone. Could you fix CI and verify if this is still in draft period?

@whirm
Copy link
Author

whirm commented Oct 13, 2025

@blyxyas It's still not ready to be merged as there's a case I want to cover but I'm still investigating how to approach it.

I could use some help figuring out how to allow for this case:

fn smaller_than_usize_is_ok_to_box_if_using_into_raw() {
    let boxed = Box::new(1u8);
    let ptr = Box::into_raw(boxed);
}

Where boxed would usually be linted but not in this case, as it's converted into a wrapped raw pointer later on.

There's also the missing description that I'll do last in case there's changes on the lint itself before it's ready.

Shall I go ahead mark it as ready anyway?

Thanks!

@whirm whirm marked this pull request as ready for review October 14, 2025 07:45
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Oct 14, 2025
@rustbot
Copy link
Collaborator

rustbot commented Oct 14, 2025

r? @y21

rustbot has assigned @y21.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-fcp S-waiting-on-review Status: Awaiting review from the assignee but also interested parties

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Politely mention that Box<&T> is almost the most useless type you can have

4 participants