Skip to content

Commit b196528

Browse files
committed
Auto merge of #6530 - m-ou-se:2021, r=phansch
Initial support for Rust 2021. Clippy treated Rust 2021 as Rust 2015, because 2018 was checked with `==` instead of `>=`. This fixes that, such that 2018-specific things are also enabled for 2021. changelog: Added support for Rust 2021.
2 parents 60919e4 + e5a1f22 commit b196528

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

clippy_lints/src/macro_use.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ impl MacroUseImports {
105105
impl<'tcx> LateLintPass<'tcx> for MacroUseImports {
106106
fn check_item(&mut self, cx: &LateContext<'_>, item: &hir::Item<'_>) {
107107
if_chain! {
108-
if cx.sess().opts.edition == Edition::Edition2018;
108+
if cx.sess().opts.edition >= Edition::Edition2018;
109109
if let hir::ItemKind::Use(path, _kind) = &item.kind;
110110
if let Some(mac_attr) = item
111111
.attrs

clippy_lints/src/single_component_path_imports.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ impl EarlyLintPass for SingleComponentPathImports {
4040
fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) {
4141
if_chain! {
4242
if !in_macro(item.span);
43-
if cx.sess.opts.edition == Edition::Edition2018;
43+
if cx.sess.opts.edition >= Edition::Edition2018;
4444
if !item.vis.kind.is_pub();
4545
if let ItemKind::Use(use_tree) = &item.kind;
4646
if let segments = &use_tree.prefix.segments;

0 commit comments

Comments
 (0)