[Bug]: clippy fails for FreeBSD with large_enum_variant in fsmon
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 85/100
Research direction
Read crates/fsmon/src/source.rs at the Opened enum around line 359. Reproduce the warning with cargo clippy --target x86_64-unknown-freebsd -p fsmon -- -D warnings using the FreeBSD target; Clippy identifies Unsupported(Metadata) as the oversized variant and suggests boxing the metadata. Done when that command passes and the other listed targets remain unaffected.
Written by the indexing model from the issue text.
Description
Observed
cargo clippy --target x86_64-unknown-freebsd -p fsmon warns with clippy::large_enum_variant, and fails under -D warnings:
warning: large size difference between variants
--> crates/fsmon/src/source.rs:359:1
|
359 | / enum Opened {
360 | | File(File),
362 | | Special(Special),
| | ---------------- the second-largest variant contains at least 8 bytes
364 | | Unsupported(Metadata),
| | --------------------- the largest variant contains at least 224 bytes
365 | | }
| |_^ the entire enum is at least 232 bytes
On FreeBSD, std::fs::Metadata is much larger than on the other targets, so only this target trips the lint. macOS, Linux and Windows pass.
Reproduce
On develop, with the FreeBSD target installed (rustup target add x86_64-unknown-freebsd):
cargo clippy --target x86_64-unknown-freebsd -p fsmon -- -D warnings
Where
enum Opened at crates/fsmon/src/source.rs:359. Clippy suggests Unsupported(Box<Metadata>). CI doesn't run clippy for FreeBSD, so it doesn't catch this.
Found while working on #1890.
- Dominant language
- Rust
- Stars
- 3.3k
- Forks
- 67
- Avg merge
- 3h 4m
- Merged PRs (30d)
- 107
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pamburus/hl
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 87/100
Maintainers usually reply within 1 day
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
bug resolved
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
pamburus/hl#1877 · 1 comment ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
Similar issues
-
area:ui effort:medium enhancement P7 source:agent
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
marketing
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
documentation priority: low tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
nledford/Ladderback#1823 ·
Maintainers usually reply within 1 day
-
psmux-resurrect: restoring a session with a numeric name puts its windows into the wrong session (`new-window -t 4` is read as window 4)Possibly taken @ealwanlee claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
psmux/psmux-plugins#47 ·
-
Link Checker ReportOpenautomated issue report
Difficulty 1/5 Under an hour Newbie friendliness 76/100
ratatui/awesome-ratatui#598 ·
Maintainers usually reply within 1 day