-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add #![deny(rust_2018_idioms)] to all crates #451
Conversation
Conformance comparison report
Number passing in both: 5731 Number failing in both: 612 Number passing in Base (af599b6) but now fail: 0 Number failing in Base (af599b6) but now pass: 0 |
f9c7bba
to
ce45715
Compare
find . -iname lib.rs ! -path "*target/*" -exec sed -i '' -e '1s;^;#![deny(rust_2018_idioms)]\n\n;' {} +
ce45715
to
3db585c
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #451 +/- ##
=======================================
Coverage 79.26% 79.26%
=======================================
Files 66 66
Lines 17749 17752 +3
Branches 17749 17752 +3
=======================================
+ Hits 14069 14072 +3
Misses 3110 3110
Partials 570 570 ☔ View full report in Codecov by Sentry. |
@@ -27,6 +27,7 @@ use partiql_source_map::metadata::LocationMap; | |||
#[allow(clippy::unused_unit)] | |||
#[allow(unused_variables)] | |||
#[allow(dead_code)] | |||
#[allow(rust_2018_idioms)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason we're choosing to allow
rust_2018_idioms
here while in partiql-parser/src/lib.rs
, we deny it?
Clippy's also giving the following warning:
allow(rust_2018_idioms) is ignored unless specified at crate level
warning: allow(rust_2018_idioms) is ignored unless specified at crate level
--> partiql-parser/src/parse/mod.rs:30:9
|
30 | #[allow(rust_2018_idioms)]
| ^^^^^^^^^^^^^^^^
|
= note: `#[warn(unused_attributes)]` on by default
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The allow
here is for the inclusion of the LALRPOP
generated code.
Without it cargo build
yields:
error: `extern crate` is not idiomatic in the new edition
--> .../partiql-lang-rust/target/debug/build/partiql-parser-12b4184392ff8cc1/out/partiql.rs:15:1
|
15 | extern crate core;
| ^^^^^^^^^^^^^^^^^^
|
note: the lint level is defined here
--> partiql-parser/src/lib.rs:1:9
|
1 | #![deny(rust_2018_idioms)]
| ^^^^^^^^^^^^^^^^
= note: `#[deny(unused_extern_crates)]` implied by `#[deny(rust_2018_idioms)]`
help: convert it to a `use`
|
15 | use core;
| ~~~
error: `extern crate` is not idiomatic in the new edition
--> .../partiql-lang-rust/target/debug/build/partiql-parser-12b4184392ff8cc1/out/partiql.rs:34:5
|
34 | extern crate core;
| ^^^^^^^^^^^^^^^^^^
|
help: convert it to a `use`
|
34 | use core;
| ~~~
error: outlives requirements can be inferred
--> ...partiql-lang-rust/target/debug/build/partiql-parser-12b4184392ff8cc1/out/partiql.rs:6301:28
|
6301 | where Id: IdGenerator, 'input: 'state, Id: 'state
| ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= note: `#[deny(explicit_outlives_requirements)]` implied by `#[deny(rust_2018_idioms)]`
help: remove these bounds
|
6301 - where Id: IdGenerator, 'input: 'state, Id: 'state
6301 + where Id: IdGenerator,
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, I see. Guess we'll need the allow
for now then
Add
#![deny(rust_2018_idioms)]
to all cratesThe wording is a bit confusing for this, but this will result in an error for any code that uses pre-rust 2018 idioms (for this codebase, most notably the
elided_lifetimes_in_paths
lint).-- from: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_lint/builtin/static.ELIDED_LIFETIMES_IN_PATHS.html
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.