Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
richchurcher opened this issue Sep 19, 2024 · 4 comments
Labels
A-Build-System Related to build systems or continuous integration C-Bug An unexpected or incorrect behavior C-Docs An addition or correction to our documentation S-Needs-Investigation This issue requires detective work to figure out what's going wrong

Comments

@richchurcher
Copy link
Contributor

richchurcher commented Sep 19, 2024

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.

@richchurcher richchurcher added C-Docs An addition or correction to our documentation S-Needs-Triage This issue needs to be labelled labels Sep 19, 2024
@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior A-Build-System Related to build systems or continuous integration S-Needs-Investigation This issue requires detective work to figure out what's going wrong and removed S-Needs-Triage This issue needs to be labelled labels Sep 19, 2024
@alice-i-cecile
Copy link
Member

I've asked about this on Zulipe here. I think this may be a Rust bug TBH.

@richchurcher
Copy link
Contributor Author

It's not all crate-level uses of expect either. unsafe_code seems to work 🤔

@workingjubilee
Copy link

yes there's a "bug" (debatable, but it wasn't considered, for sure) specifically with missing_docs: rust-lang/rust#130025

@BenjaminBrienen
Copy link
Contributor

BenjaminBrienen commented Sep 20, 2024

Looks like this is simply awaiting stable rust 1.83

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Build-System Related to build systems or continuous integration C-Bug An unexpected or incorrect behavior C-Docs An addition or correction to our documentation S-Needs-Investigation This issue requires detective work to figure out what's going wrong
Projects
None yet
Development

No branches or pull requests

4 participants