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

fix: fix Rust v1.78.0 clippy warnings #382

Merged
merged 4 commits into from
Jun 26, 2024
Merged

fix: fix Rust v1.78.0 clippy warnings #382

merged 4 commits into from
Jun 26, 2024

Conversation

Boshen
Copy link
Contributor

@Boshen Boshen commented Jun 12, 2024

No description provided.

@@ -410,7 +410,7 @@ impl Report {
}

/// Provide source code for this error
pub fn with_source_code(self, source_code: impl SourceCode + Send + Sync + 'static) -> Report {
pub fn with_source_code(self, source_code: impl SourceCode + 'static) -> Report {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

warning: this bound is already specified as the supertrait of SourceCode

@Boshen
Copy link
Contributor Author

Boshen commented Jun 12, 2024

🤔 Rust v1.78.0 also surfaced 2 unspecified features

error: unexpected `cfg` condition name: `doc_cfg`
 --> src/eyreish/mod.rs:1:13
  |
1 | #![cfg_attr(doc_cfg, feature(doc_cfg))]
  |             ^^^^^^^
  |
error: unexpected `cfg` condition name: `track_caller`
  --> src/eyreish/mod.rs:87:12
   |
87 | #[cfg_attr(track_caller, track_caller)]
   |            ^^^^^^^^^^^^
   |

@Benjamin-L
Copy link
Contributor

I think the #[cfg_attr(track_caller, ...)] usage was inherited from eyre. They attempt to probe stable track_caller support in the build script, and then set cfg=track_caller if it's available. We aren't doing this, but are using track_caller unconditionally already, and track_caller is available in our MSRV. I looked through all the uses of #[cfg(track_caller)] in miette, and believe we can just enable them all by default without a breaking change. I'd be in favor of doing that, although we should test it carefully.

doc_cfg is in a similar situation, where the code was inherited from eyre, and they set the cfg in the cargo manifest. We don't seem to be using #[cfg(doc)] anywhere, and this feature is also stable in our MSRV. We should just remove the :#![cfg_attr(doc_cfg, feature(doc_cfg))] line.

@Boshen
Copy link
Contributor Author

Boshen commented Jun 21, 2024

I've added #![allow(unexpected_cfgs)] so we can unblock other PRs.

I'll create an issue for removing these unexpected cfgs.

@zkat zkat merged commit e1026f7 into zkat:main Jun 26, 2024
14 of 15 checks passed
@Boshen
Copy link
Contributor Author

Boshen commented Jun 26, 2024

Ahh sorry I totally forgot about this PR, MIRI is failing due to

error: unexpected `cfg` condition name: `track_caller`
  --> tests/test_fmt.rs:83:12
   |
83 | #[cfg_attr(track_caller, ignore)]
   |            ^^^^^^^^^^^^

You may #[allow()] it as well.

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.

3 participants