Skip to content

large_enum_variant propose a wrong solution for no_std #15192

Open
@HaoboGu

Description

@HaoboGu

Summary

For clippy::large_enum_variant, it proposes a solution that uses Box:

...
...
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#large_enum_variant
   = note: `#[warn(clippy::large_enum_variant)]` on by default
help: consider boxing the large fields to reduce the total size of the enum
   |
62 -     WriteMacro([u8; MACRO_SPACE_SIZE]),
62 +     WriteMacro(Box<[u8; MACRO_SPACE_SIZE]>),

But my current project is no_std, which means no allocator is available by default, so the proposed solution is wrong.

Metadata

Metadata

Assignees

Labels

C-bugCategory: Clippy is not doing the correct thingI-suggestion-causes-errorIssue: The suggestions provided by this Lint cause an ICE/error when appliedgood first issueThese issues are a good way to get started with Clippy

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions