Skip to content

Commit 0621446

Browse files
authored
Rustup (#14667)
Out of cycle sync, as the sync to Rust failed again and resolving conflicts there is awkward. r? @ghost changelog: none
2 parents c3fb102 + bdc4327 commit 0621446

File tree

7 files changed

+18
-18
lines changed

7 files changed

+18
-18
lines changed

clippy_lints/src/lifetimes.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use rustc_hir::intravisit::{
1414
};
1515
use rustc_hir::{
1616
AmbigArg, BareFnTy, BodyId, FnDecl, FnSig, GenericArg, GenericArgs, GenericBound, GenericParam, GenericParamKind,
17-
Generics, HirId, Impl, ImplItem, ImplItemKind, Item, ItemKind, Lifetime, LifetimeName, LifetimeParamKind, Node,
17+
Generics, HirId, Impl, ImplItem, ImplItemKind, Item, ItemKind, Lifetime, LifetimeKind, LifetimeParamKind, Node,
1818
PolyTraitRef, PredicateOrigin, TraitFn, TraitItem, TraitItemKind, Ty, TyKind, WhereBoundPredicate, WherePredicate,
1919
WherePredicateKind, lang_items,
2020
};
@@ -218,7 +218,7 @@ fn check_fn_inner<'tcx>(
218218
for bound in pred.bounds {
219219
let mut visitor = RefVisitor::new(cx);
220220
walk_param_bound(&mut visitor, bound);
221-
if visitor.lts.iter().any(|lt| matches!(lt.res, LifetimeName::Param(_))) {
221+
if visitor.lts.iter().any(|lt| matches!(lt.kind, LifetimeKind::Param(_))) {
222222
return;
223223
}
224224
if let GenericBound::Trait(ref trait_ref) = *bound {
@@ -235,7 +235,7 @@ fn check_fn_inner<'tcx>(
235235
_ => None,
236236
});
237237
for bound in lifetimes {
238-
if bound.res != LifetimeName::Static && !bound.is_elided() {
238+
if bound.kind != LifetimeKind::Static && !bound.is_elided() {
239239
return;
240240
}
241241
}
@@ -421,8 +421,8 @@ fn named_lifetime_occurrences(lts: &[Lifetime]) -> Vec<(LocalDefId, usize)> {
421421
}
422422

423423
fn named_lifetime(lt: &Lifetime) -> Option<LocalDefId> {
424-
match lt.res {
425-
LifetimeName::Param(id) if !lt.is_anonymous() => Some(id),
424+
match lt.kind {
425+
LifetimeKind::Param(id) if !lt.is_anonymous() => Some(id),
426426
_ => None,
427427
}
428428
}
@@ -614,7 +614,7 @@ where
614614

615615
// for lifetimes as parameters of generics
616616
fn visit_lifetime(&mut self, lifetime: &'tcx Lifetime) {
617-
if let LifetimeName::Param(def_id) = lifetime.res
617+
if let LifetimeKind::Param(def_id) = lifetime.kind
618618
&& let Some(usages) = self.map.get_mut(&def_id)
619619
{
620620
usages.push(Usage {
@@ -826,7 +826,7 @@ fn report_elidable_lifetimes(
826826
.iter()
827827
.map(|&lt| cx.tcx.def_span(lt))
828828
.chain(usages.iter().filter_map(|usage| {
829-
if let LifetimeName::Param(def_id) = usage.res
829+
if let LifetimeKind::Param(def_id) = usage.kind
830830
&& elidable_lts.contains(&def_id)
831831
{
832832
return Some(usage.ident.span);

clippy_lints/src/pattern_type_mismatch.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ fn find_first_mismatch(cx: &LateContext<'_>, pat: &Pat<'_>) -> Option<(Span, Mut
179179
};
180180
if let Some(adjustments) = cx.typeck_results().pat_adjustments().get(adjust_pat.hir_id)
181181
&& let [first, ..] = **adjustments
182-
&& let ty::Ref(.., mutability) = *first.kind()
182+
&& let ty::Ref(.., mutability) = *first.source.kind()
183183
{
184184
let level = if p.hir_id == pat.hir_id {
185185
Level::Top

clippy_lints/src/ptr.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use clippy_utils::source::SpanRangeExt;
33
use clippy_utils::sugg::Sugg;
44
use clippy_utils::visitors::contains_unsafe_block;
55
use clippy_utils::{get_expr_use_or_unification_node, is_lint_allowed, path_def_id, path_to_local, std_or_core};
6-
use hir::LifetimeName;
6+
use hir::LifetimeKind;
77
use rustc_abi::ExternAbi;
88
use rustc_errors::{Applicability, MultiSpan};
99
use rustc_hir::hir_id::{HirId, HirIdMap};
@@ -432,7 +432,7 @@ fn check_fn_args<'cx, 'tcx: 'cx>(
432432
}
433433
None
434434
}) {
435-
if let LifetimeName::Param(param_def_id) = lifetime.res
435+
if let LifetimeKind::Param(param_def_id) = lifetime.kind
436436
&& !lifetime.is_anonymous()
437437
&& fn_sig
438438
.output()

clippy_utils/README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ This crate is only guaranteed to build with this `nightly` toolchain:
88

99
<!-- begin autogenerated nightly -->
1010
```
11-
nightly-2025-04-17
11+
nightly-2025-04-22
1212
```
1313
<!-- end autogenerated nightly -->
1414

clippy_utils/src/hir_utils.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use rustc_hir::MatchSource::TryDesugar;
88
use rustc_hir::def::{DefKind, Res};
99
use rustc_hir::{
1010
AssocItemConstraint, BinOpKind, BindingMode, Block, BodyId, Closure, ConstArg, ConstArgKind, Expr, ExprField,
11-
ExprKind, FnRetTy, GenericArg, GenericArgs, HirId, HirIdMap, InlineAsmOperand, LetExpr, Lifetime, LifetimeName,
11+
ExprKind, FnRetTy, GenericArg, GenericArgs, HirId, HirIdMap, InlineAsmOperand, LetExpr, Lifetime, LifetimeKind,
1212
Pat, PatExpr, PatExprKind, PatField, PatKind, Path, PathSegment, PrimTy, QPath, Stmt, StmtKind, StructTailExpr,
1313
TraitBoundModifiers, Ty, TyKind, TyPat, TyPatKind,
1414
};
@@ -483,7 +483,7 @@ impl HirEqInterExpr<'_, '_, '_> {
483483
}
484484

485485
fn eq_lifetime(left: &Lifetime, right: &Lifetime) -> bool {
486-
left.res == right.res
486+
left.kind == right.kind
487487
}
488488

489489
fn eq_pat_field(&mut self, left: &PatField<'_>, right: &PatField<'_>) -> bool {
@@ -1245,8 +1245,8 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
12451245

12461246
pub fn hash_lifetime(&mut self, lifetime: &Lifetime) {
12471247
lifetime.ident.name.hash(&mut self.s);
1248-
std::mem::discriminant(&lifetime.res).hash(&mut self.s);
1249-
if let LifetimeName::Param(param_id) = lifetime.res {
1248+
std::mem::discriminant(&lifetime.kind).hash(&mut self.s);
1249+
if let LifetimeKind::Param(param_id) = lifetime.kind {
12501250
param_id.hash(&mut self.s);
12511251
}
12521252
}

clippy_utils/src/lib.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2364,14 +2364,14 @@ pub fn is_no_std_crate(cx: &LateContext<'_>) -> bool {
23642364
cx.tcx
23652365
.hir_attrs(hir::CRATE_HIR_ID)
23662366
.iter()
2367-
.any(|attr| attr.name_or_empty() == sym::no_std)
2367+
.any(|attr| attr.has_name(sym::no_std))
23682368
}
23692369

23702370
pub fn is_no_core_crate(cx: &LateContext<'_>) -> bool {
23712371
cx.tcx
23722372
.hir_attrs(hir::CRATE_HIR_ID)
23732373
.iter()
2374-
.any(|attr| attr.name_or_empty() == sym::no_core)
2374+
.any(|attr| attr.has_name(sym::no_core))
23752375
}
23762376

23772377
/// Check if parent of a hir node is a trait implementation block.

rust-toolchain.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[toolchain]
22
# begin autogenerated nightly
3-
channel = "nightly-2025-04-17"
3+
channel = "nightly-2025-04-22"
44
# end autogenerated nightly
55
components = ["cargo", "llvm-tools", "rust-src", "rust-std", "rustc", "rustc-dev", "rustfmt"]
66
profile = "minimal"

0 commit comments

Comments
 (0)