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

non_exhaustive structures #140

Merged
merged 5 commits into from
Mar 28, 2021
Merged

non_exhaustive structures #140

merged 5 commits into from
Mar 28, 2021

Conversation

burrbull
Copy link
Member

Up MSRV to 1.40

@burrbull burrbull requested a review from a team as a code owner March 28, 2021 07:22
@burrbull
Copy link
Member Author

cc @therealprof
@adamgreig

@adamgreig
Copy link
Member

Swapping to non_exhaustive LGTM, should this PR wait until #139 so it doesn't also merge the strict stuff?

@burrbull
Copy link
Member Author

Swapping to non_exhaustive LGTM, should this PR wait until #139 so it doesn't also merge the strict stuff?

At your discretion.

@therealprof
Copy link
Contributor

I'm also fine in principle, though I'm not quite clear on the motivation to bump the MSRV just to replace manual non-exhaustive implementation.

@adamgreig
Copy link
Member

At this point I think 1.40 is old enough that it's nice to be able to clean up the code to use non_exhaustive. Especially since this crate tends to be more "tooling" than "end-user" I'm really not too worried about the MSRV going to 1.40.

@therealprof
Copy link
Contributor

I'm not worried about the MSRV bump. I'm simply not a big fan of bumping versions just for cleanup...

adamgreig
adamgreig previously approved these changes Mar 28, 2021
Copy link
Member

@adamgreig adamgreig left a comment

Choose a reason for hiding this comment

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

We need to bump the version we run clippy under too to support anyhow's clippy config, and this helps tidy up the codebase, so on balance I think let's go for it (and merge #139 as part of this PR).

bors merge

bors bot added a commit that referenced this pull request Mar 28, 2021
140: non_exhaustive structures r=adamgreig a=burrbull

Up MSRV to 1.40

Co-authored-by: Andrey Zgarbul <zgarbul.andrey@gmail.com>
@adamgreig
Copy link
Member

Ah, this line will need updating before bors sees the tests as passing:

https://github.com/rust-embedded/svd/blob/master/.github/bors.toml#L6

@adamgreig
Copy link
Member

bors cancel

@bors
Copy link
Contributor

bors bot commented Mar 28, 2021

Canceled.

adamgreig
adamgreig previously approved these changes Mar 28, 2021
Copy link
Member

@adamgreig adamgreig left a comment

Choose a reason for hiding this comment

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

bors merge

bors bot added a commit that referenced this pull request Mar 28, 2021
140: non_exhaustive structures r=adamgreig a=burrbull

Up MSRV to 1.40

Co-authored-by: Andrey Zgarbul <zgarbul.andrey@gmail.com>
@adamgreig
Copy link
Member

Ah, this failure wasn't being reported but explains why we're not seeing any build results against the bors commits:

https://github.com/rust-embedded/svd/actions/runs/695451779

In particular test strict should be test-strict or similar:

https://github.com/rust-embedded/svd/pull/140/files#diff-b803fcb7f17ed9235f1e5cb1fcd2f5d3b2838429d4368ae4c57ce4436577f03fR48

bors cancel

@bors
Copy link
Contributor

bors bot commented Mar 28, 2021

Canceled.

@burrbull
Copy link
Member Author

Rebased

@burrbull
Copy link
Member Author

What is wrong with clippy?

@adamgreig
Copy link
Member

adamgreig commented Mar 28, 2021

It's still complaining about this line in anyhow:

{"reason":"compiler-message","package_id":"anyhow 1.0.40 (registry+https://github.com/rust-lang/crates.io-index)","target":{"kind":["lib"],"crate_types":["lib"],"name":"anyhow","src_path":"/home/runner/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/anyhow-1.0.40/src/lib.rs","edition":"2018","doctest":true},"message":{"rendered":"error: error reading Clippy's configuration file /home/runner/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/anyhow-1.0.40/.clippy.toml: unknown field msrv, expected one of blacklisted-names, cognitive-complexity-threshold, cyclomatic-complexity-threshold, doc-valid-idents, too-many-arguments-threshold, type-complexity-threshold, single-char-binding-names-threshold, too-large-for-stack, enum-variant-name-threshold, enum-variant-size-threshold, verbose-bit-mask-threshold, literal-representation-threshold, trivial-copy-size-limit, too-many-lines-threshold, third-party at line 1 column 1\n\n","children":[],"code":null,"level":"error","message":"error reading Clippy's configuration file /home/runner/.cargo/registry/src/git.luolix.top-1ecc6299db9ec823/anyhow-1.0.40/.clippy.toml: unknown field msrv, expected one of blacklisted-names, cognitive-complexity-threshold, cyclomatic-complexity-threshold, doc-valid-idents, too-many-arguments-threshold, type-complexity-threshold, single-char-binding-names-threshold, too-large-for-stack, enum-variant-name-threshold, enum-variant-size-threshold, verbose-bit-mask-threshold, literal-representation-threshold, trivial-copy-size-limit, too-many-lines-threshold, third-party at line 1 column 1","spans":[]}}

but I don't know why, or why it has worked occasionally...

The line seems to be valid Clippy: https://github.com/rust-lang/rust-clippy#specifying-the-minimum-supported-rust-version

I think it's a relatively new Clippy feature: rust-lang/rust-clippy#6097

so my guess was that for some reason the clippy check is being run with an older version of Rust?

@burrbull
Copy link
Member Author

Switched to use last stable clippy

Copy link
Member

@adamgreig adamgreig left a comment

Choose a reason for hiding this comment

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

One last thing, we should probably add test-strict and clippy_check to the bors config so it requires that they pass.

.github/bors.toml Outdated Show resolved Hide resolved
Co-authored-by: Adam Greig <adam@adamgreig.com>
Copy link
Member

@adamgreig adamgreig left a comment

Choose a reason for hiding this comment

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

bors merge

@bors
Copy link
Contributor

bors bot commented Mar 28, 2021

Build succeeded:

@bors bors bot merged commit 6ce3f2b into master Mar 28, 2021
@bors bors bot deleted the non_exhaustive branch March 28, 2021 19:07
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