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

Avoid associating #[from] with lint allow #397

Merged
merged 1 commit into from
Dec 13, 2024

Conversation

zertosh
Copy link
Contributor

@zertosh zertosh commented Dec 13, 2024

Fixes:

error: #[allow] attribute found
  --> src/lib.rs:13:26
   |
13 | pub struct DownloadError(#[from] std::io::Error);
   |                          ^^^^^^^ help: replace it with: `expect`
   |
   = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#allow_attributes
note: the lint level is defined here
  --> src/lib.rs:1:9
   |
1  | #![deny(clippy::allow_attributes)]
   |         ^^^^^^^^^^^^^^^^^^^^^^^^

I could only repro with RUSTC_BOOTSTRAP=1 on 1.83.0. Couldn't repro
with beta or nightly. So maybe this fix isn't worth it.

Issue is discussed at
rust-lang/rust-clippy#13349

@@ -4,6 +4,17 @@ use thiserror::Error;

pub use std::error::Error;

#[test]
fn test_allow_attributes() {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test doesn't actually do anything. For some reason #![deny(clippy::allow_attributes)] never works here with any lint - it's as if it's not set. Nor does passing -Dclippy::allow_attributes. Maybe something about being a test target for the crate itself? I don't know

Copy link
Owner

@dtolnay dtolnay left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@dtolnay dtolnay merged commit 2deec96 into dtolnay:master Dec 13, 2024
12 checks passed
@dtolnay
Copy link
Owner

dtolnay commented Dec 13, 2024

Published in 2.0.7.

@zertosh zertosh deleted the from_allow_expect branch December 13, 2024 23:26
facebook-github-bot pushed a commit to facebook/dotslash that referenced this pull request Dec 14, 2024
Summary:
Includes [dtolnay/thiserror#397][1], which fixes an issue with Rust
1.83.0.

[1]: dtolnay/thiserror#397

Reviewed By: dtolnay

Differential Revision: D67225013

fbshipit-source-id: badbb44c309c6232f8698649ceff8ee694b8f7a1
facebook-github-bot pushed a commit to facebook/hhvm that referenced this pull request Dec 14, 2024
Summary:
Includes [dtolnay/thiserror#397][1], which fixes an issue with Rust
1.83.0.

[1]: dtolnay/thiserror#397

Reviewed By: dtolnay

Differential Revision: D67225013

fbshipit-source-id: badbb44c309c6232f8698649ceff8ee694b8f7a1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants