From 07472888fc3d5b98122549e1a13cc57aaf17890a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20D=C3=B6nszelmann?= Date: Fri, 6 Dec 2024 11:14:01 +0100 Subject: [PATCH] fixup rebase --- compiler/rustc_hir/src/attribute.rs | 2 +- compiler/rustc_hir/src/hir.rs | 2 +- compiler/rustc_hir/src/stable_hash_impls.rs | 6 +++--- src/librustdoc/html/render/mod.rs | 2 +- .../clippy/clippy_lints/src/attrs/unnecessary_clippy_cfg.rs | 2 +- src/tools/clippy/clippy_lints/src/attrs/utils.rs | 2 +- src/tools/clippy/clippy_lints/src/incompatible_msrv.rs | 2 +- src/tools/clippy/clippy_lints/src/std_instead_of_core.rs | 2 +- src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs | 2 +- 9 files changed, 11 insertions(+), 11 deletions(-) diff --git a/compiler/rustc_hir/src/attribute.rs b/compiler/rustc_hir/src/attribute.rs index 449c3398fd10..258fa02c4379 100644 --- a/compiler/rustc_hir/src/attribute.rs +++ b/compiler/rustc_hir/src/attribute.rs @@ -11,7 +11,7 @@ use rustc_target::abi::Align; use smallvec::SmallVec; use thin_vec::ThinVec; -use crate::{DefaultBodyStability, ItemLocalId, PartialConstStability, RustcVersion, Stability}; +use crate::{DefaultBodyStability, PartialConstStability, RustcVersion, Stability}; /// The derived implementation of [`HashStable_Generic`] on [`Attribute`]s shouldn't hash /// [`AttrId`]s. By wrapping them in this, we make sure we never do. diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs index 1f4312d38bac..bcb2bb2c2127 100644 --- a/compiler/rustc_hir/src/hir.rs +++ b/compiler/rustc_hir/src/hir.rs @@ -23,11 +23,11 @@ use rustc_target::asm::InlineAsmRegOrRegClass; use smallvec::SmallVec; use tracing::debug; -use crate::{Attribute, LangItem}; use crate::def::{CtorKind, DefKind, Res}; use crate::def_id::{DefId, LocalDefIdMap}; pub(crate) use crate::hir_id::{HirId, ItemLocalId, ItemLocalMap, OwnerId}; use crate::intravisit::FnKind; +use crate::{Attribute, LangItem}; #[derive(Debug, Copy, Clone, HashStable_Generic)] pub struct Lifetime { diff --git a/compiler/rustc_hir/src/stable_hash_impls.rs b/compiler/rustc_hir/src/stable_hash_impls.rs index 24fc24e7d86c..8098aa219cc4 100644 --- a/compiler/rustc_hir/src/stable_hash_impls.rs +++ b/compiler/rustc_hir/src/stable_hash_impls.rs @@ -2,10 +2,10 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher, ToStableHas use rustc_span::def_id::DefPathHash; use crate::HashIgnoredAttrId; -use crate::attribute::AttributeMap; -use crate::hir::{BodyId, Crate, ForeignItemId, ImplItemId, ItemId, OwnerNodes, TraitItemId}; +use crate::hir::{ + AttributeMap, BodyId, Crate, ForeignItemId, ImplItemId, ItemId, OwnerNodes, TraitItemId, +}; use crate::hir_id::{HirId, ItemLocalId}; -use crate::Attribute; /// Requirements for a `StableHashingContext` to be used in this crate. /// This is a hack to allow using the `HashStable_Generic` derive macro diff --git a/src/librustdoc/html/render/mod.rs b/src/librustdoc/html/render/mod.rs index 2a3e4db7e529..91cb18b7fbab 100644 --- a/src/librustdoc/html/render/mod.rs +++ b/src/librustdoc/html/render/mod.rs @@ -1051,7 +1051,7 @@ fn render_stability_since_raw_with_extra( fn since_to_string(since: &StableSince) -> Option { match since { - StableSince::Version(since) => Some(since.to_string()), + StableSince::Version(since, _) => Some(since.to_string()), StableSince::Current => Some(RustcVersion::CURRENT.to_string()), StableSince::Err => None, } diff --git a/src/tools/clippy/clippy_lints/src/attrs/unnecessary_clippy_cfg.rs b/src/tools/clippy/clippy_lints/src/attrs/unnecessary_clippy_cfg.rs index 478ba7a187be..6ee3290fa761 100644 --- a/src/tools/clippy/clippy_lints/src/attrs/unnecessary_clippy_cfg.rs +++ b/src/tools/clippy/clippy_lints/src/attrs/unnecessary_clippy_cfg.rs @@ -15,7 +15,7 @@ pub(super) fn check( ) { if cfg_attr.has_name(sym::clippy) && let Some(ident) = behind_cfg_attr.ident() - && Level::from_symbol(ident.name, Some(attr.id)).is_some() + && Level::from_symbol(ident.name, || Some(attr.id)).is_some() && let Some(items) = behind_cfg_attr.meta_item_list() { let nb_items = items.len(); diff --git a/src/tools/clippy/clippy_lints/src/attrs/utils.rs b/src/tools/clippy/clippy_lints/src/attrs/utils.rs index 3bb02688bf22..7ad5a36676eb 100644 --- a/src/tools/clippy/clippy_lints/src/attrs/utils.rs +++ b/src/tools/clippy/clippy_lints/src/attrs/utils.rs @@ -17,7 +17,7 @@ pub(super) fn is_word(nmi: &MetaItemInner, expected: Symbol) -> bool { } pub(super) fn is_lint_level(symbol: Symbol, attr_id: AttrId) -> bool { - Level::from_symbol(symbol, Some(attr_id)).is_some() + Level::from_symbol(symbol, || Some(attr_id)).is_some() } pub(super) fn is_relevant_item(cx: &LateContext<'_>, item: &Item<'_>) -> bool { diff --git a/src/tools/clippy/clippy_lints/src/incompatible_msrv.rs b/src/tools/clippy/clippy_lints/src/incompatible_msrv.rs index e77f7c94ba0f..b41089cf3269 100644 --- a/src/tools/clippy/clippy_lints/src/incompatible_msrv.rs +++ b/src/tools/clippy/clippy_lints/src/incompatible_msrv.rs @@ -62,7 +62,7 @@ impl IncompatibleMsrv { .lookup_stability(def_id) .and_then(|stability| match stability.level { StabilityLevel::Stable { - since: StableSince::Version(version), + since: StableSince::Version(version, _), .. } => Some(version), _ => None, diff --git a/src/tools/clippy/clippy_lints/src/std_instead_of_core.rs b/src/tools/clippy/clippy_lints/src/std_instead_of_core.rs index 64483f7df038..51c1cc159b2f 100644 --- a/src/tools/clippy/clippy_lints/src/std_instead_of_core.rs +++ b/src/tools/clippy/clippy_lints/src/std_instead_of_core.rs @@ -184,7 +184,7 @@ fn is_stable(cx: &LateContext<'_>, mut def_id: DefId, msrv: &Msrv) -> bool { } = stability.level { let stable = match since { - StableSince::Version(v) => msrv.meets(v), + StableSince::Version(v, _) => msrv.meets(v), StableSince::Current => msrv.current().is_none(), StableSince::Err => false, }; diff --git a/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs b/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs index 2e436ceefbc2..83cdc5e050d8 100644 --- a/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs +++ b/src/tools/clippy/clippy_utils/src/qualify_min_const_fn.rs @@ -387,7 +387,7 @@ fn is_stable_const_fn(tcx: TyCtxt<'_>, def_id: DefId, msrv: &Msrv) -> bool { // as a part of an unimplemented MSRV check https://github.com/rust-lang/rust/issues/65262. let const_stab_rust_version = match since { - StableSince::Version(version) => version, + StableSince::Version(version, _) => version, StableSince::Current => rustc_hir::RustcVersion::CURRENT, StableSince::Err => return false, };