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.
This commit is contained in:
bors 2021-01-02 13:12:15 +00:00
commit b1965283fd
2 changed files with 2 additions and 2 deletions

View File

@ -105,7 +105,7 @@ fn push_unique_macro_pat_ty(&mut self, cx: &LateContext<'_>, span: Span) {
impl<'tcx> LateLintPass<'tcx> for MacroUseImports {
fn check_item(&mut self, cx: &LateContext<'_>, item: &hir::Item<'_>) {
if_chain! {
if cx.sess().opts.edition == Edition::Edition2018;
if cx.sess().opts.edition >= Edition::Edition2018;
if let hir::ItemKind::Use(path, _kind) = &item.kind;
if let Some(mac_attr) = item
.attrs

View File

@ -40,7 +40,7 @@ impl EarlyLintPass for SingleComponentPathImports {
fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) {
if_chain! {
if !in_macro(item.span);
if cx.sess.opts.edition == Edition::Edition2018;
if cx.sess.opts.edition >= Edition::Edition2018;
if !item.vis.kind.is_pub();
if let ItemKind::Use(use_tree) = &item.kind;
if let segments = &use_tree.prefix.segments;