Skip to content

Commit 9d5ffe8

Browse files
committed
Auto merge of #5300 - JohnTitor:edition-flag, r=flip1995
Use `edition:2018` flag more widely Now we recommend using `// edition:2018`, so let's use it more widely. Also replace a too old example with new one in the docs. changelog: none
2 parents 23bd427 + d4eb496 commit 9d5ffe8

9 files changed

+13
-10
lines changed

CONTRIBUTING.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ and resolved paths.
5454
[`T-AST`] issues will generally need you to match against a predefined syntax structure.
5555
To figure out how this syntax structure is encoded in the AST, it is recommended to run
5656
`rustc -Z ast-json` on an example of the structure and compare with the [nodes in the AST docs].
57-
Usually the lint will end up to be a nested series of matches and ifs, [like so].
57+
Usually the lint will end up to be a nested series of matches and ifs, [like so][deep-nesting].
58+
But we can make it nest-less by using [if_chain] macro, [like this][nest-less].
5859

5960
[`E-medium`] issues are generally pretty easy too, though it's recommended you work on an E-easy issue first.
6061
They are mostly classified as [`E-medium`], since they might be somewhat involved code wise,
@@ -71,7 +72,9 @@ an AST expression). `match_def_path()` in Clippy's `utils` module can also be us
7172
[`E-medium`]: https://github.com/rust-lang/rust-clippy/labels/E-medium
7273
[`ty`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/ty
7374
[nodes in the AST docs]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/ast/
74-
[like so]: https://github.com/rust-lang/rust-clippy/blob/de5ccdfab68a5e37689f3c950ed1532ba9d652a0/src/misc.rs#L34
75+
[deep-nesting]: https://github.com/rust-lang/rust-clippy/blob/557f6848bd5b7183f55c1e1522a326e9e1df6030/clippy_lints/src/mem_forget.rs#L29-L43
76+
[if_chain]: https://docs.rs/if_chain/*/if_chain
77+
[nest-less]: https://github.com/rust-lang/rust-clippy/blob/557f6848bd5b7183f55c1e1522a326e9e1df6030/clippy_lints/src/bit_mask.rs#L124-L150
7578

7679
## Writing code
7780

tests/ui/doc_errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --edition 2018
1+
// edition:2018
22
#![warn(clippy::missing_errors_doc)]
33

44
use std::io;

tests/ui/issue_4266.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --edition 2018
1+
// edition:2018
22
#![allow(dead_code)]
33

44
async fn sink1<'a>(_: &'a str) {} // lint

tests/ui/macro_use_imports.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// compile-flags: --edition 2018
1+
// edition:2018
22
#![warn(clippy::macro_use_imports)]
33

44
use std::collections::HashMap;

tests/ui/methods.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// aux-build:option_helpers.rs
2-
// compile-flags: --edition 2018
2+
// edition:2018
33

44
#![warn(clippy::all, clippy::pedantic)]
55
#![allow(

tests/ui/single_component_path_imports.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-rustfix
2-
// compile-flags: --edition 2018
2+
// edition:2018
33
#![warn(clippy::single_component_path_imports)]
44
#![allow(unused_imports)]
55

tests/ui/single_component_path_imports.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-rustfix
2-
// compile-flags: --edition 2018
2+
// edition:2018
33
#![warn(clippy::single_component_path_imports)]
44
#![allow(unused_imports)]
55

tests/ui/use_self.fixed

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-rustfix
2-
// compile-flags: --edition 2018
2+
// edition:2018
33

44
#![warn(clippy::use_self)]
55
#![allow(dead_code)]

tests/ui/use_self.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// run-rustfix
2-
// compile-flags: --edition 2018
2+
// edition:2018
33

44
#![warn(clippy::use_self)]
55
#![allow(dead_code)]

0 commit comments

Comments
 (0)