Skip to content

Diagnose failure of crate-level #![expect()] in the project, then replace #![allow()] with #![expect()] #15321

Closed
@bas-ie

Description

@bas-ie

Relevant PR:

Relevant issue:

The problem

We've been trying to replace allow with expect, which is often (but not always) used in the context of the lint missing_docs. CI failures occur when --all-targets is specified. Our current CI does this:

cargo clippy --workspace --all-targets --all-features -- -Dwarnings

This results in linter failures such as:

linter

It further seems that:

  • omitting --all-targets allows CI to pass, and
  • #[expect()] (non-crate-level) directives pass

For now, #![expect()] has been avoided in favour of #![allow()], but it'd be great to use #![expect()] at crate level if we can make it work smoothly using --all-targets.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-Build-SystemRelated to build systems or continuous integrationC-BugAn unexpected or incorrect behaviorC-DocsAn addition or correction to our documentationS-Needs-InvestigationThis issue requires detective work to figure out what's going wrong

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions