Skip to content
Merged

Rustup #15044

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
a9225f8
Updated feature flag and output of `clippy/tests/ui/map_flatten*`
May 16, 2025
f6e5fa2
remove eq_unspanned from TokenStream
chenyukang May 26, 2025
e177dd0
Reduce `P<T>` to a typedef of `Box<T>`.
nnethercote May 26, 2025
459280c
Reorder fields in `hir::ItemKind` variants.
nnethercote May 28, 2025
9f86a57
Merge commit '57cbadd68ac473bc50453f6b1320a02b68115f12'
flip1995 May 31, 2025
61465ed
Rollup merge of #141072 - Rynibami:stabilize-const-result-flatten, r=…
jhpratt May 31, 2025
abf5d4c
Invert the sense of `is_not_macro_export`.
nnethercote May 29, 2025
8708e3f
Auto merge of #141814 - flip1995:clippy-subtree-update, r=Manishearth
bors Jun 2, 2025
166f664
Use the informative error as the main const eval error message
oli-obk May 28, 2025
d1f9d02
Clarify why we are talking about a failed const eval at a random place
oli-obk May 30, 2025
1b2b7e6
Overhaul `UsePath`.
nnethercote May 29, 2025
4effc58
Rollup merge of #141741 - nnethercote:overhaul-UsePath, r=petrochenkov
matthiaskrgr Jun 3, 2025
a0b0f91
Rollup merge of #141698 - oli-obk:ctfe-err-flip, r=RalfJung
matthiaskrgr Jun 3, 2025
9b8bf53
Rollup merge of #141570 - chenyukang:yukang-fix-eq_unspanned, r=worki…
matthiaskrgr Jun 4, 2025
8b59e34
Replace `elided_named_lifetimes` with `mismatched_lifetime_syntaxes`
shepmaster Mar 17, 2025
9f9f993
Replace some `Option<Span>` with `Span` and use DUMMY_SP instead of None
oli-obk Jun 4, 2025
2f80ead
Auto merge of #138677 - shepmaster:consistent-elided-lifetime-syntax,…
bors Jun 5, 2025
2c95105
Rollup merge of #142012 - oli-obk:no-optional-spans, r=fee1-dead
matthiaskrgr Jun 5, 2025
507183d
Rollup merge of #141603 - nnethercote:reduce-P, r=fee1-dead
GuillaumeGomez Jun 6, 2025
85655d4
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Jun 13, 2025
19c2f03
Bump nightly version -> 2025-06-13
flip1995 Jun 13, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions clippy_lints/src/arbitrary_source_item_ordering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ impl<'tcx> LateLintPass<'tcx> for ArbitrarySourceItemOrdering {
return;
}
match &item.kind {
ItemKind::Enum(_, enum_def, _generics) if self.enable_ordering_for_enum => {
ItemKind::Enum(_, _generics, enum_def) if self.enable_ordering_for_enum => {
let mut cur_v: Option<&Variant<'_>> = None;
for variant in enum_def.variants {
if variant.span.in_external_macro(cx.sess().source_map()) {
Expand All @@ -288,7 +288,7 @@ impl<'tcx> LateLintPass<'tcx> for ArbitrarySourceItemOrdering {
cur_v = Some(variant);
}
},
ItemKind::Struct(_, VariantData::Struct { fields, .. }, _generics) if self.enable_ordering_for_struct => {
ItemKind::Struct(_, _generics, VariantData::Struct { fields, .. }) if self.enable_ordering_for_struct => {
let mut cur_f: Option<&FieldDef<'_>> = None;
for field in *fields {
if field.span.in_external_macro(cx.sess().source_map()) {
Expand Down
8 changes: 4 additions & 4 deletions clippy_lints/src/disallowed_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ impl_lint_pass!(DisallowedTypes => [DISALLOWED_TYPES]);

impl<'tcx> LateLintPass<'tcx> for DisallowedTypes {
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'tcx>) {
if let ItemKind::Use(path, UseKind::Single(_)) = &item.kind {
for res in &path.res {
self.check_res_emit(cx, res, item.span);
}
if let ItemKind::Use(path, UseKind::Single(_)) = &item.kind
&& let Some(res) = path.res.type_ns
{
self.check_res_emit(cx, &res, item.span);
}
}

Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/empty_with_brackets.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ impl_lint_pass!(EmptyWithBrackets => [EMPTY_STRUCTS_WITH_BRACKETS, EMPTY_ENUM_VA

impl LateLintPass<'_> for EmptyWithBrackets {
fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) {
if let ItemKind::Struct(ident, var_data, _) = &item.kind
if let ItemKind::Struct(ident, _, var_data) = &item.kind
&& !item.span.from_expansion()
&& has_brackets(var_data)
&& let span_after_ident = item.span.with_lo(ident.span.hi())
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/enum_clike.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ impl<'tcx> LateLintPass<'tcx> for UnportableVariant {
if cx.tcx.data_layout.pointer_size.bits() != 64 {
return;
}
if let ItemKind::Enum(_, def, _) = &item.kind {
if let ItemKind::Enum(_, _, def) = &item.kind {
for var in def.variants {
if let Some(anon_const) = &var.disr_expr {
let def_id = cx.tcx.hir_body_owner_def_id(anon_const.body);
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/excessive_bools.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ fn check_fn_decl(cx: &LateContext<'_>, decl: &FnDecl<'_>, sp: Span, max: u64) {

impl<'tcx> LateLintPass<'tcx> for ExcessiveBools {
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'tcx>) {
if let ItemKind::Struct(_, variant_data, _) = &item.kind
if let ItemKind::Struct(_, _, variant_data) = &item.kind
&& variant_data.fields().len() as u64 > self.max_struct_bools
&& has_n_bools(
variant_data.fields().iter().map(|field| field.ty),
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/exhaustive_items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ impl LateLintPass<'_> for ExhaustiveItems {
"exported enums should not be exhaustive",
[].as_slice(),
),
ItemKind::Struct(_, v, ..) => (
ItemKind::Struct(_, _, v) => (
EXHAUSTIVE_STRUCTS,
"exported structs should not be exhaustive",
v.fields(),
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/functions/result.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ fn check_result_large_err<'tcx>(cx: &LateContext<'tcx>, err_ty: Ty<'tcx>, hir_ty
.did()
.as_local()
&& let hir::Node::Item(item) = cx.tcx.hir_node_by_def_id(local_def_id)
&& let hir::ItemKind::Enum(_, ref def, _) = item.kind
&& let hir::ItemKind::Enum(_, _, ref def) = item.kind
{
let variants_size = AdtVariantInfo::new(cx, *adt, subst);
if let Some((first_variant, variants)) = variants_size.split_first()
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/item_name_repetitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,10 +535,10 @@ impl LateLintPass<'_> for ItemNameRepetitions {

if span_is_local(item.span) {
match item.kind {
ItemKind::Enum(_, def, _) => {
ItemKind::Enum(_, _, def) => {
self.check_variants(cx, item, &def);
},
ItemKind::Struct(_, VariantData::Struct { fields, .. }, _) => {
ItemKind::Struct(_, _, VariantData::Struct { fields, .. }) => {
self.check_fields(cx, item, fields);
},
_ => (),
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/large_const_arrays.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ impl_lint_pass!(LargeConstArrays => [LARGE_CONST_ARRAYS]);

impl<'tcx> LateLintPass<'tcx> for LargeConstArrays {
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
if let ItemKind::Const(ident, _, generics, _) = &item.kind
if let ItemKind::Const(ident, generics, _, _) = &item.kind
// Since static items may not have generics, skip generic const items.
// FIXME(generic_const_items): I don't think checking `generics.hwcp` suffices as it
// doesn't account for empty where-clauses that only consist of keyword `where` IINM.
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/large_enum_variant.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ impl_lint_pass!(LargeEnumVariant => [LARGE_ENUM_VARIANT]);

impl<'tcx> LateLintPass<'tcx> for LargeEnumVariant {
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &Item<'tcx>) {
if let ItemKind::Enum(ident, ref def, _) = item.kind
if let ItemKind::Enum(ident, _, ref def) = item.kind
&& let ty = cx.tcx.type_of(item.owner_id).instantiate_identity()
&& let ty::Adt(adt, subst) = ty.kind()
&& adt.variants().len() > 1
Expand Down
4 changes: 3 additions & 1 deletion clippy_lints/src/legacy_numeric_constants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ impl<'tcx> LateLintPass<'tcx> for LegacyNumericConstants {
// so lint on the `use` statement directly.
if let ItemKind::Use(path, kind @ (UseKind::Single(_) | UseKind::Glob)) = item.kind
&& !item.span.in_external_macro(cx.sess().source_map())
&& let Some(def_id) = path.res[0].opt_def_id()
// use `present_items` because it could be in either type_ns or value_ns
&& let Some(res) = path.res.present_items().next()
&& let Some(def_id) = res.opt_def_id()
&& self.msrv.meets(cx, msrvs::NUMERIC_ASSOCIATED_CONSTANTS)
{
let module = if is_integer_module(cx, def_id) {
Expand Down
5 changes: 1 addition & 4 deletions clippy_lints/src/macro_use.rs
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,7 @@ impl LateLintPass<'_> for MacroUseImports {
&& let hir_id = item.hir_id()
&& let attrs = cx.tcx.hir_attrs(hir_id)
&& let Some(mac_attr) = attrs.iter().find(|attr| attr.has_name(sym::macro_use))
&& let Some(id) = path.res.iter().find_map(|res| match res {
Res::Def(DefKind::Mod, id) => Some(id),
_ => None,
})
&& let Some(Res::Def(DefKind::Mod, id)) = path.res.type_ns
&& !id.is_local()
{
for kid in cx.tcx.module_children(id) {
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/manual_non_exhaustive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ impl<'tcx> LateLintPass<'tcx> for ManualNonExhaustive {
}

match item.kind {
ItemKind::Enum(_, def, _) if def.variants.len() > 1 => {
ItemKind::Enum(_, _, def) if def.variants.len() > 1 => {
let iter = def.variants.iter().filter_map(|v| {
(matches!(v.data, VariantData::Unit(_, _)) && is_doc_hidden(cx.tcx.hir_attrs(v.hir_id)))
.then_some((v.def_id, v.span))
Expand All @@ -98,7 +98,7 @@ impl<'tcx> LateLintPass<'tcx> for ManualNonExhaustive {
self.potential_enums.push((item.owner_id.def_id, id, item.span, span));
}
},
ItemKind::Struct(_, variant_data, _) => {
ItemKind::Struct(_, _, variant_data) => {
let fields = variant_data.fields();
let private_fields = fields
.iter()
Expand Down
5 changes: 3 additions & 2 deletions clippy_lints/src/min_ident_chars.rs
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,9 @@ impl Visitor<'_> for IdentVisitor<'_, '_> {
// If however the identifier is different, this means it is an alias (`use foo::bar as baz`). In
// this case, we need to emit the warning for `baz`.
if let Some(imported_item_path) = usenode
&& let Some(Res::Def(_, imported_item_defid)) = imported_item_path.res.first()
&& cx.tcx.item_name(*imported_item_defid).as_str() == str
// use `present_items` because it could be in any of type_ns, value_ns, macro_ns
&& let Some(Res::Def(_, imported_item_defid)) = imported_item_path.res.value_ns
&& cx.tcx.item_name(imported_item_defid).as_str() == str
{
return;
}
Expand Down
3 changes: 2 additions & 1 deletion clippy_lints/src/missing_enforced_import_rename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ impl_lint_pass!(ImportRename => [MISSING_ENFORCED_IMPORT_RENAMES]);
impl LateLintPass<'_> for ImportRename {
fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) {
if let ItemKind::Use(path, UseKind::Single(_)) = &item.kind {
for &res in &path.res {
// use `present_items` because it could be in any of type_ns, value_ns, macro_ns
for res in path.res.present_items() {
if let Res::Def(_, id) = res
&& let Some(name) = self.renames.get(&id)
// Remove semicolon since it is not present for nested imports
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/missing_fields_in_debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingFieldsInDebug {
&& let typeck_results = cx.tcx.typeck_body(*body_id)
&& should_lint(cx, typeck_results, block)
// we intentionally only lint structs, see lint description
&& let ItemKind::Struct(_, data, _) = &self_item.kind
&& let ItemKind::Struct(_, _, data) = &self_item.kind
{
check_struct(cx, typeck_results, block, self_ty, item, data);
}
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/non_std_lazy_statics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ struct LazyInfo {
impl LazyInfo {
fn from_item(cx: &LateContext<'_>, item: &Item<'_>) -> Option<Self> {
// Check if item is a `once_cell:sync::Lazy` static.
if let ItemKind::Static(_, ty, _, body_id) = item.kind
if let ItemKind::Static(_, _, ty, body_id) = item.kind
&& let Some(path_def_id) = path_def_id(cx, ty)
&& let hir::TyKind::Path(hir::QPath::Resolved(_, path)) = ty.kind
&& paths::ONCE_CELL_SYNC_LAZY.matches(cx, path_def_id)
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/pub_underscore_fields.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl PubUnderscoreFields {
impl<'tcx> LateLintPass<'tcx> for PubUnderscoreFields {
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
// This lint only pertains to structs.
let ItemKind::Struct(_, variant_data, _) = &item.kind else {
let ItemKind::Struct(_, _, variant_data) = &item.kind else {
return;
};

Expand Down
23 changes: 11 additions & 12 deletions clippy_lints/src/redundant_pub_crate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use clippy_utils::diagnostics::span_lint_and_then;
use clippy_utils::source::HasSession;
use rustc_errors::Applicability;
use rustc_hir::def::{DefKind, Res};
use rustc_hir::{Item, ItemKind};
use rustc_hir::{Item, ItemKind, UseKind};
use rustc_lint::{LateContext, LateLintPass};
use rustc_middle::ty;
use rustc_session::impl_lint_pass;
Expand Down Expand Up @@ -49,7 +49,7 @@ impl<'tcx> LateLintPass<'tcx> for RedundantPubCrate {
if cx.tcx.visibility(item.owner_id.def_id) == ty::Visibility::Restricted(CRATE_DEF_ID.to_def_id())
&& !cx.effective_visibilities.is_exported(item.owner_id.def_id)
&& self.is_exported.last() == Some(&false)
&& is_not_macro_export(item)
&& !is_ignorable_export(item)
&& !item.span.in_external_macro(cx.sess().source_map())
{
let span = item
Expand Down Expand Up @@ -86,18 +86,17 @@ impl<'tcx> LateLintPass<'tcx> for RedundantPubCrate {
}
}

fn is_not_macro_export<'tcx>(item: &'tcx Item<'tcx>) -> bool {
if let ItemKind::Use(path, _) = item.kind {
if path
.res
.iter()
.all(|res| matches!(res, Res::Def(DefKind::Macro(MacroKind::Bang), _)))
{
return false;
// We ignore macro exports. And `ListStem` uses, which aren't interesting.
fn is_ignorable_export<'tcx>(item: &'tcx Item<'tcx>) -> bool {
if let ItemKind::Use(path, kind) = item.kind {
let ignore = matches!(path.res.macro_ns, Some(Res::Def(DefKind::Macro(MacroKind::Bang), _)))
|| kind == UseKind::ListStem;
if ignore {
return true;
}
} else if let ItemKind::Macro(..) = item.kind {
return false;
return true;
}

true
false
}
2 changes: 1 addition & 1 deletion clippy_lints/src/trailing_empty_array.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ impl<'tcx> LateLintPass<'tcx> for TrailingEmptyArray {
}

fn is_struct_with_trailing_zero_sized_array<'tcx>(cx: &LateContext<'tcx>, item: &Item<'tcx>) -> bool {
if let ItemKind::Struct(_, data, _) = &item.kind
if let ItemKind::Struct(_, _, data) = &item.kind
&& let Some(last_field) = data.fields().last()
&& let field_ty = cx.tcx.normalize_erasing_regions(
cx.typing_env(),
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/types/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ impl<'tcx> LateLintPass<'tcx> for Types {
let is_exported = cx.effective_visibilities.is_exported(item.owner_id.def_id);

match item.kind {
ItemKind::Static(_, ty, _, _) | ItemKind::Const(_, ty, _, _) => self.check_ty(
ItemKind::Static(_, _, ty, _) | ItemKind::Const(_, _, ty, _) => self.check_ty(
cx,
ty,
CheckTyContext {
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/unnested_or_patterns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ fn drain_matching(
// Check if we should extract, but only if `idx >= start`.
if idx > start && predicate(&alternatives[i].kind) {
let pat = alternatives.remove(i);
tail_or.push(extract(pat.into_inner().kind));
tail_or.push(extract(pat.kind));
} else {
i += 1;
}
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/unused_trait_names.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl<'tcx> LateLintPass<'tcx> for UnusedTraitNames {
// Ignore imports that already use Underscore
&& ident.name != kw::Underscore
// Only check traits
&& let Some(Res::Def(DefKind::Trait, _)) = path.res.first()
&& let Some(Res::Def(DefKind::Trait, _)) = path.res.type_ns
&& cx.tcx.maybe_unused_trait_imports(()).contains(&item.owner_id.def_id)
// Only check this import if it is visible to its module only (no pub, pub(crate), ...)
&& let module = cx.tcx.parent_module_from_def_id(item.owner_id.def_id)
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints/src/upper_case_acronyms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ impl LateLintPass<'_> for UpperCaseAcronyms {
ItemKind::TyAlias(ident, ..) | ItemKind::Struct(ident, ..) | ItemKind::Trait(_, _, ident, ..) => {
check_ident(cx, &ident, it.hir_id(), self.upper_case_acronyms_aggressive);
},
ItemKind::Enum(ident, ref enumdef, _) => {
ItemKind::Enum(ident, _, ref enumdef) => {
check_ident(cx, &ident, it.hir_id(), self.upper_case_acronyms_aggressive);
// check enum variants separately because again we only want to lint on private enums and
// the fn check_variant does not know about the vis of the enum of its variants
Expand Down
4 changes: 2 additions & 2 deletions clippy_lints/src/wildcard_imports.rs
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ impl LateLintPass<'_> for WildcardImports {
format!("{import_source_snippet}::{imports_string}")
};

// Glob imports always have a single resolution.
let (lint, message) = if let Res::Def(DefKind::Enum, _) = use_path.res[0] {
// Glob imports always have a single resolution. Enums are in the value namespace.
let (lint, message) = if let Some(Res::Def(DefKind::Enum, _)) = use_path.res.value_ns {
(ENUM_GLOB_USE, "usage of wildcard import for enum variants")
} else {
(WILDCARD_IMPORTS, "usage of wildcard import")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ impl AlmostStandardFormulation {
impl<'tcx> LateLintPass<'tcx> for AlmostStandardFormulation {
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
let mut check_next = false;
if let ItemKind::Static(_, ty, Mutability::Not, _) = item.kind {
if let ItemKind::Static(Mutability::Not, _, ty, _) = item.kind {
let lines = cx
.tcx
.hir_attrs(item.hir_id())
Expand Down
2 changes: 1 addition & 1 deletion clippy_lints_internal/src/lint_without_lint_pass.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ impl_lint_pass!(LintWithoutLintPass => [

impl<'tcx> LateLintPass<'tcx> for LintWithoutLintPass {
fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) {
if let hir::ItemKind::Static(ident, ty, Mutability::Not, body_id) = item.kind {
if let hir::ItemKind::Static(Mutability::Not, ident, ty, body_id) = item.kind {
if is_lint_ref_type(cx, ty) {
check_invalid_clippy_version_attribute(cx, item);

Expand Down
2 changes: 1 addition & 1 deletion clippy_utils/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ This crate is only guaranteed to build with this `nightly` toolchain:

<!-- begin autogenerated nightly -->
```
nightly-2025-05-31
nightly-2025-06-12
```
<!-- end autogenerated nightly -->

Expand Down
4 changes: 3 additions & 1 deletion clippy_utils/src/ast_utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -960,5 +960,7 @@ pub fn eq_attr_args(l: &AttrArgs, r: &AttrArgs) -> bool {
}

pub fn eq_delim_args(l: &DelimArgs, r: &DelimArgs) -> bool {
l.delim == r.delim && l.tokens.eq_unspanned(&r.tokens)
l.delim == r.delim
&& l.tokens.len() == r.tokens.len()
&& l.tokens.iter().zip(r.tokens.iter()).all(|(a, b)| a.eq_unspanned(b))
}
2 changes: 1 addition & 1 deletion clippy_utils/src/check_proc_macro.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ fn item_search_pat(item: &Item<'_>) -> (Pat, Pat) {
ItemKind::ForeignMod { .. } => (Pat::Str("extern"), Pat::Str("}")),
ItemKind::TyAlias(..) => (Pat::Str("type"), Pat::Str(";")),
ItemKind::Enum(..) => (Pat::Str("enum"), Pat::Str("}")),
ItemKind::Struct(_, VariantData::Struct { .. }, _) => (Pat::Str("struct"), Pat::Str("}")),
ItemKind::Struct(_, _, VariantData::Struct { .. }) => (Pat::Str("struct"), Pat::Str("}")),
ItemKind::Struct(..) => (Pat::Str("struct"), Pat::Str(";")),
ItemKind::Union(..) => (Pat::Str("union"), Pat::Str("}")),
ItemKind::Trait(_, Safety::Unsafe, ..)
Expand Down
2 changes: 1 addition & 1 deletion clippy_utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2364,7 +2364,7 @@ fn with_test_item_names(tcx: TyCtxt<'_>, module: LocalModDefId, f: impl FnOnce(&
for id in tcx.hir_module_free_items(module) {
if matches!(tcx.def_kind(id.owner_id), DefKind::Const)
&& let item = tcx.hir_item(id)
&& let ItemKind::Const(ident, ty, _generics, _body) = item.kind
&& let ItemKind::Const(ident, _generics, ty, _body) = item.kind
&& let TyKind::Path(QPath::Resolved(_, path)) = ty.kind
// We could also check for the type name `test::TestDescAndFn`
&& let Res::Def(DefKind::Struct, _) = path.res
Expand Down
11 changes: 7 additions & 4 deletions clippy_utils/src/paths.rs
Original file line number Diff line number Diff line change
Expand Up @@ -306,10 +306,13 @@ fn local_item_child_by_name(tcx: TyCtxt<'_>, local_id: LocalDefId, ns: PathNS, n
let item = tcx.hir_item(item_id);
if let ItemKind::Use(path, UseKind::Single(ident)) = item.kind {
if ident.name == name {
path.res
.iter()
.find(|res| ns.matches(res.ns()))
.and_then(Res::opt_def_id)
let opt_def_id = |ns: Option<Res>| ns.and_then(|res| res.opt_def_id());
match ns {
PathNS::Type => opt_def_id(path.res.type_ns),
PathNS::Value => opt_def_id(path.res.value_ns),
PathNS::Macro => opt_def_id(path.res.macro_ns),
PathNS::Arbitrary => unreachable!(),
}
} else {
None
}
Expand Down
2 changes: 1 addition & 1 deletion clippy_utils/src/qualify_min_const_fn.rs
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ fn is_ty_const_destruct<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, body: &Body<'tcx>
tcx,
ObligationCause::dummy_with_span(body.span),
param_env,
TraitRef::new(tcx, tcx.require_lang_item(LangItem::Destruct, Some(body.span)), [ty]),
TraitRef::new(tcx, tcx.require_lang_item(LangItem::Destruct, body.span), [ty]),
);

let mut selcx = SelectionContext::new(&infcx);
Expand Down
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[toolchain]
# begin autogenerated nightly
channel = "nightly-2025-05-31"
channel = "nightly-2025-06-12"
# end autogenerated nightly
components = ["cargo", "llvm-tools", "rust-src", "rust-std", "rustc", "rustc-dev", "rustfmt"]
profile = "minimal"
Loading