Skip to content

🐤 Canary: clippy empty_enums false positive on zerocopy FromBytes derive expansions (nightly ≥ 2026-08-25) #617

Closed

Description

@githubrobbi

Successor to #613's canary redness — a distinct regression, split out so each tracker names one root cause.

What: canary run 32811844428 on nightly-2026-08-25 fails all three platforms with error: enum with no variants (clippy::empty_enums, the renamed pedantic empty_enum, denied via our pedantic = deny). Every failing span points at OUR #[derive(… FromBytes …)] sites (e.g. crates/uffs-mft/src/ntfs/boot_sector.rs:15) — the lint fires on the uninhabited enum zerocopy's derive generates, and derive output carries call-site spans, so external-macro suppression doesn't apply.

Upstream: tracked at google/zerocopy#3414 (open; no fixed release — latest is 0.8.56, which we already pin). Expected fix shapes: zerocopy gating its generated enum with an allow, or clippy adding an is-from-proc-macro guard to the new lint. When a fixed zerocopy ships, the resolution here is a dependency bump (the ethnum pattern).

Not a broken pin: the pinned gate (nightly-2026-08-21) predates the lint; main is unaffected. This blocks the NEXT pin bump only.

Posture (standing rule): empty_enums stays denied — no local #[allow] around the derive sites, no lint-set trimming; this is an upstream false positive, waited out with the lint enabled, exactly like the large_futures ICE before it.

Verification: dispatch nightly-canary.yml after a zerocopy release referencing #3414 (or a clippy-side guard lands in a nightly); close on green.

Activity

  1. added
    ci-failure
    on Aug 25, 2026
  2. githubrobbi commented on Aug 25, 2026

    @githubrobbi
    CollaboratorAuthor

    Decision (2026-08-25, operator-confirmed): wait for the upstream fix — no local #[allow], no lint-set change, the canary stays red by design as the pin-bump guard. Re-verification trigger: a zerocopy release referencing google/zerocopy#3414 (then bump the dependency and dispatch nightly-canary.yml), or a clippy-side proc-macro guard reaching a nightly. Close on the first green canary after either.

  3. githubrobbi commented on Aug 29, 2026

    @githubrobbi
    CollaboratorAuthor

    Root cause refined (2026-08-29) — this is not a clippy regression and not a change to the lint group we can wait out; it is a stabilization side effect.

    • clippy::empty_enums has always been guarded on cx.tcx.features().never_type() (its suggestion is "use !"). stabilize never type rust-lang/rust#155499 stabilized never_type on 2026-08-24, so from nightly-2026-08-25 on that guard is true in every crate and the lint fires on every uninhabited enum, #![feature(never_type)] or not.
    • The uninhabited enums are zerocopy-derive's own: derive_has_field_struct_union emits one enum ẕ<field> {} per struct field as a type-level field token (zerocopy-derive/src/derive/try_from_bytes.rs), wrapped in the const _: () = { … } block whose #[allow(…)] list (zerocopy-derive/src/util.rs, impl_block wrapper) suppresses non_camel_case_types, non_local_definitions, clippy::missing_inline_in_public_items, … but not clippy::empty_enums. Derive output carries call-site spans, so -D clippy::nursery (the lint now lives in nursery on nightly-2026-08-29; still denied by our posture) lands on our 14 #[derive(FromBytes)] sites.
    • Verified on nightly-2026-08-29: -A clippy::nursery silences all 14, -A clippy::pedantic silences none. zerocopy main (checked today) still lacks the allow, so no release will carry a fix until someone lands one.

    The upstream fix is one line in zerocopy-derive/src/util.rs: add clippy::empty_enums to that generated #[allow(…)] list (alongside clippy::missing_inline_in_public_items). That keeps the lint enabled for user code while exempting the macro's own field-token enums — the same shape as the existing non_local_definitions entry. Referenced from google/zerocopy#3414.

    Posture unchanged: no local #[allow], nursery stays denied. just toolchain-sync steps back to the newest nightly that predates the stabilization (2026-08-24) until a zerocopy release ships the allow; the canary stays red as the pin-bump guard. Closing criterion as before: dependabot bump to the fixed zerocopy → green Monday canary.

  4. githubrobbi commented on Aug 29, 2026

    @githubrobbi
    CollaboratorAuthor

    Decision 2026-08-29 (operator): document and wait — no local allow, no source patch or fork consumed by this workspace. The toolchain pin stays at nightly-2026-08-21 with the reason recorded in rust-toolchain.toml's resolved-history notes; just toolchain-sync will keep rejecting 08-25+ until a zerocopy release carries the fix for #3414 (a one-line fix is proposed upstream in google/zerocopy#3600). Resolution remains a plain dependency bump (zerocopy → the fixed release), then green canary → close.

  5. github-actions commented on Aug 31, 2026

    @github-actions
    Contributor

    🐤 Nightly Canary failed on main

    Field Value
    Workflow 🐤 Nightly Canary
    Run #19
    Attempt 1
    Branch main
    Commit e45f13f
    Triggered by @githubrobbi

    Filed by ci-failure-notify.yml after the 60-second auto-rerun-transient window: auto-rerun-transient saw no transient signature in the failed-job logs → genuine failure on first attempt.

    ⚠️ This is an early-warning signal from the floating-nightly canary, not a broken pin. main still builds on the pinned toolchain. Investigate before the next pin bump; if it is an upstream/dep regression, the fix is usually a dependency bump (cf. the ethnum 1.5.2→1.5.3 episode), not a toolchain downgrade.

    📧 Notification sent to: [email protected]

  6. github-actions commented on Sep 7, 2026

    @github-actions
    Contributor

    🐤 Nightly Canary failed on main

    Field Value
    Workflow 🐤 Nightly Canary
    Run #20
    Attempt 1
    Branch main
    Commit a14d399
    Triggered by @githubrobbi

    Filed by ci-failure-notify.yml after the 60-second auto-rerun-transient window: auto-rerun-transient saw no transient signature in the failed-job logs → genuine failure on first attempt.

    ⚠️ This is an early-warning signal from the floating-nightly canary, not a broken pin. main still builds on the pinned toolchain. Investigate before the next pin bump; if it is an upstream/dep regression, the fix is usually a dependency bump (cf. the ethnum 1.5.2→1.5.3 episode), not a toolchain downgrade.

    📧 Notification sent to: [email protected]

  7. github-actions commented on Sep 14, 2026

    @github-actions
    Contributor

    🐤 Nightly Canary failed on main

    Field Value
    Workflow 🐤 Nightly Canary
    Run #21
    Attempt 1
    Branch main
    Commit a14d399
    Triggered by @githubrobbi

    Filed by ci-failure-notify.yml after the 60-second auto-rerun-transient window: auto-rerun-transient saw no transient signature in the failed-job logs → genuine failure on first attempt.

    ⚠️ This is an early-warning signal from the floating-nightly canary, not a broken pin. main still builds on the pinned toolchain. Investigate before the next pin bump; if it is an upstream/dep regression, the fix is usually a dependency bump (cf. the ethnum 1.5.2→1.5.3 episode), not a toolchain downgrade.

    📧 Notification sent to: [email protected]

  8. githubrobbi commented on Sep 19, 2026

    @githubrobbi
    CollaboratorAuthor

    Re-checked 2026-09-19: still blocked, but the lint has moved groups

    Verified against the current upstream state and a minimal reproduction, so the next person does not have to re-derive any of it.

    zerocopy 0.8.57 (released 2026-09-08) does NOT carry the fix. Inspected the published source directly: zerocopy-derive-0.8.57/src/util.rs, const_block() — the #[allow(...)] list it wraps generated items in is still

    deprecated, private_bounds, non_local_definitions, non_camel_case_types,
    non_upper_case_globals, non_snake_case, non_ascii_idents,
    clippy::missing_inline_in_public_items
    

    with no clippy::empty_enums. Upstream google/zerocopy#3414 is open; the proposed fix google/zerocopy#3600 is open and unmerged. So the dependency-bump resolution this issue describes is not yet available, and the pin stays at nightly-2026-08-21.

    New finding — the lint is now a nursery lint, not pedantic. Reproduced on nightly-2026-09-17 with a four-line crate (#[derive(FromBytes)] #[repr(C)] struct BootSector { … } against zerocopy 0.8.57):

    lint group enabled empty_enums hits
    clippy::pedantic 0
    clippy::nursery 3
    clippy::restriction / style / complexity 0

    and the diagnostic still lands on our derive site:

    error: enum with no variants
      = help: consider using the uninhabited type `!` (never type) …
      = note: this error originates in the derive macro `FromBytes`
    

    This matters for two reasons. First, the issue title and body describe it as "the renamed pedantic empty_enum", which is no longer where it lives. Second, it changes nothing for us: the workspace denies nursery and pedantic alike (Cargo.toml [workspace.lints.clippy]), so the gate still fails. Anyone testing a bump with only pedantic enabled will get a false all-clear.

    Posture unchanged and deliberately so: no local #[allow], no lint-set trimming, no patching a crate we do not own. Document and wait. The verification step is the same as before — dispatch nightly-canary.yml once a zerocopy release referencing #3414 ships (or clippy adds an is-from-proc-macro guard), then close on green.

    Cheaper than a canary run, for the next check: build the four-line repro above and run cargo +nightly-<date> clippy -- -D clippy::empty_enums. It answers the same question in seconds instead of stepping just toolchain-sync back a day at a time through three cross-target builds per candidate.

  9. github-actions commented on Sep 21, 2026

    @github-actions
    Contributor

    🐤 Nightly Canary failed on main

    Field Value
    Workflow 🐤 Nightly Canary
    Run #22
    Attempt 1
    Branch main
    Commit 5892fc8
    Triggered by @githubrobbi

    Filed by ci-failure-notify.yml after the 60-second auto-rerun-transient window: auto-rerun-transient saw no transient signature in the failed-job logs → genuine failure on first attempt.

    ⚠️ This is an early-warning signal from the floating-nightly canary, not a broken pin. main still builds on the pinned toolchain. Investigate before the next pin bump; if it is an upstream/dep regression, the fix is usually a dependency bump (cf. the ethnum 1.5.2→1.5.3 episode), not a toolchain downgrade.

    📧 Notification sent to: [email protected]

  10. github-actions commented on Sep 28, 2026

    @github-actions
    Contributor

    🐤 Nightly Canary failed on main

    Field Value
    Workflow 🐤 Nightly Canary
    Run #23
    Attempt 1
    Branch main
    Commit 5892fc8
    Triggered by @githubrobbi

    Filed by ci-failure-notify.yml after the 60-second auto-rerun-transient window: auto-rerun-transient saw no transient signature in the failed-job logs → genuine failure on first attempt.

    ⚠️ This is an early-warning signal from the floating-nightly canary, not a broken pin. main still builds on the pinned toolchain. Investigate before the next pin bump; if it is an upstream/dep regression, the fix is usually a dependency bump (cf. the ethnum 1.5.2→1.5.3 episode), not a toolchain downgrade.

    📧 Notification sent to: [email protected]

  11. githubrobbi commented on Oct 2, 2026

    @githubrobbi
    CollaboratorAuthor

    Re-checked 2026-10-03: still blocked

    Same four-line repro as the 09-19 comment, against the newest nightly and the newest zerocopy, so the record stays current without a canary run.

    result
    nightly nightly-2026-10-02 (rustc 1.101.0-nightly c36f14571)
    zerocopy / zerocopy-derive 0.8.59 (released 2026-09-25)
    -D clippy::nursery 2 × enum with no variants, originating in the FromBytes derive
    -D clippy::pedantic 0 (confirms it has stayed in nursery)
    -D clippy::empty_enums explicit 2

    zerocopy 0.8.57, 0.8.58 and 0.8.59 all lack the fix. In 0.8.59 the generated allow-list moved into allow_generated_code() in zerocopy-derive/src/util.rs, and it is still deprecated, private_bounds, non_local_definitions, non_camel_case_types, non_upper_case_globals, non_snake_case, non_ascii_idents, clippy::missing_inline_in_public_items — no clippy::empty_enums. google/zerocopy#3414 is open; the proposed fix google/zerocopy#3600 is open and unmerged.

    On the clippy side, rust-lang/rust-clippy#17297 (opened 2026-09-18, open) — "empty_enums doesn't account for how the type is used" — is the upstream acknowledgement that the lint fires on legitimate uninhabited types; it remains a nursery lint, which this workspace denies.

    Pin holds at nightly-2026-08-21. Posture unchanged: no #[allow], no lint-set trimming, no patching a crate we do not own. The v0.6.42 release went out on the pinned toolchain with every dependency except zerocopy at its latest stable; zerocopy stays at 0.8.56 on purpose and the hold is recorded in the vet/deps commit message.

    Two upstream events would unblock this, either of which is enough: a zerocopy release that merges #3600 (then cargo update -p zerocopy and bump the pin), or clippy guarding empty_enums with is_from_proc_macro / resolving #17297 (then bump the pin alone). The repro takes seconds and should be re-run before the next bump attempt rather than letting toolchain-sync step back day by day through three cross-target builds per candidate.

  12. github-actions commented on Oct 5, 2026

    @github-actions
    Contributor

    🐤 Nightly Canary failed on main

    Field Value
    Workflow 🐤 Nightly Canary
    Run #24
    Attempt 1
    Branch main
    Commit c8c74a8
    Triggered by @githubrobbi

    Filed by ci-failure-notify.yml after the 60-second auto-rerun-transient window: auto-rerun-transient saw no transient signature in the failed-job logs → genuine failure on first attempt.

    ⚠️ This is an early-warning signal from the floating-nightly canary, not a broken pin. main still builds on the pinned toolchain. Investigate before the next pin bump; if it is an upstream/dep regression, the fix is usually a dependency bump (cf. the ethnum 1.5.2→1.5.3 episode), not a toolchain downgrade.

    📧 Notification sent to: [email protected]

  13. github-actions commented on Oct 12, 2026

    @github-actions
    Contributor

    🐤 Nightly Canary failed on main

    Field Value
    Workflow 🐤 Nightly Canary
    Run #25
    Attempt 1
    Branch main
    Commit c8c74a8
    Triggered by @githubrobbi

    Filed by ci-failure-notify.yml after the 60-second auto-rerun-transient window: auto-rerun-transient saw no transient signature in the failed-job logs → genuine failure on first attempt.

    ⚠️ This is an early-warning signal from the floating-nightly canary, not a broken pin. main still builds on the pinned toolchain. Investigate before the next pin bump; if it is an upstream/dep regression, the fix is usually a dependency bump (cf. the ethnum 1.5.2→1.5.3 episode), not a toolchain downgrade.

    📧 Notification sent to: [email protected]

  14. githubrobbi commented on Oct 14, 2026

    @githubrobbi
    CollaboratorAuthor

    Resolved on branch fix/vss-retryable-hresults (227aea9), lands with the batch PR

    Owner ruling 2026-10-13: bump the toolchain rather than keep holding the pin.

    • Pin nightly-2026-08-21 → nightly-2026-10-14, validated by toolchain-sync on host, Windows (xwin) and Linux (zigbuild).
    • The zerocopy-derive false positive is still unfixed upstream (0.8.63; #![feature(never_type)] triggers clippy::empty_enums google/zerocopy#3414 / #3600 open). The four uffs-mft modules that derive FromBytes carry a module-level #![expect(clippy::empty_enums)]. A per-struct attribute cannot reach the derive's sibling output (verified), so the module is the narrowest scope that works. expect self-expires: when zerocopy ships the fix, the build fails until the four attributes are deleted. Close criterion for that cleanup: the first zerocopy release whose derive allows clippy::empty_enums.
    • Everything else the floating nightly reported was a real finding and is fixed at the root (b14dcbd, 227aea9): map_or_default sites, redundant clones and doc links, cargo manifest lints, 16 toolchain-sensitive unused_crate_dependencies expectations, and an enum Session {} FFI handle in uffs-vss-requestor that is now a proper opaque #[repr(C)] struct.

    The canary's exact clippy command is clean locally on nightly-2026-10-14. This issue can close when the batch PR merges and the next canary run is green.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    ci-failureci-failure-nightly-canary

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions