-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
FP for allow_attributes_without_reason with ? operator #10377
Comments
I'm hitting the same issue with simple functions like pub fn check_warning(text: Option<&str>) -> Option<i32> {
text?.parse().ok()
} Versions: |
I'm getting the same thing with the simplest example I could think of: fn test() -> Result<(), ()> {
Err(())?
} Versions: |
It seems the HIR output of any |
Can anybody confirm this was fixed by #10869? I added a test for this and it seems fixed but want to make sure |
This doesn't seem to be fixed. But the lint is still triggering on all |
I don't believe the sync has happened yet, it's blocked by #112708 |
Summary
Use of
?
on results and options triggersallow_attributes_without_reason
.The specific type of the options and results in the reproduction aren't important. I first observed the FP using
?
onfmt::Result
s.I suspect, similar to #9630 we need to filter out findings that originate in builtins or std. That said, I don't see a specific macro or
allow
that is triggering this.Lint Name
allow_attributes_without_reason
Reproducer
I tried this code:
(each line that triggers the lint will also individually trigger the lint)
I saw this happen:
I expected to see this happen:
No lints trigger
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: