Out of cycle sync, as the sync to Rust failed again and resolving
conflicts there is awkward.

r? @ghost

changelog: none
This commit is contained in:
Philipp Krones 2025-04-22 14:01:53 +00:00 committed by GitHub
commit 0621446356
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 18 additions and 18 deletions

View file

@ -14,7 +14,7 @@ use rustc_hir::intravisit::{
};
use rustc_hir::{
AmbigArg, BareFnTy, BodyId, FnDecl, FnSig, GenericArg, GenericArgs, GenericBound, GenericParam, GenericParamKind,
Generics, HirId, Impl, ImplItem, ImplItemKind, Item, ItemKind, Lifetime, LifetimeName, LifetimeParamKind, Node,
Generics, HirId, Impl, ImplItem, ImplItemKind, Item, ItemKind, Lifetime, LifetimeKind, LifetimeParamKind, Node,
PolyTraitRef, PredicateOrigin, TraitFn, TraitItem, TraitItemKind, Ty, TyKind, WhereBoundPredicate, WherePredicate,
WherePredicateKind, lang_items,
};
@ -218,7 +218,7 @@ fn check_fn_inner<'tcx>(
for bound in pred.bounds {
let mut visitor = RefVisitor::new(cx);
walk_param_bound(&mut visitor, bound);
if visitor.lts.iter().any(|lt| matches!(lt.res, LifetimeName::Param(_))) {
if visitor.lts.iter().any(|lt| matches!(lt.kind, LifetimeKind::Param(_))) {
return;
}
if let GenericBound::Trait(ref trait_ref) = *bound {
@ -235,7 +235,7 @@ fn check_fn_inner<'tcx>(
_ => None,
});
for bound in lifetimes {
if bound.res != LifetimeName::Static && !bound.is_elided() {
if bound.kind != LifetimeKind::Static && !bound.is_elided() {
return;
}
}
@ -421,8 +421,8 @@ fn named_lifetime_occurrences(lts: &[Lifetime]) -> Vec<(LocalDefId, usize)> {
}
fn named_lifetime(lt: &Lifetime) -> Option<LocalDefId> {
match lt.res {
LifetimeName::Param(id) if !lt.is_anonymous() => Some(id),
match lt.kind {
LifetimeKind::Param(id) if !lt.is_anonymous() => Some(id),
_ => None,
}
}
@ -614,7 +614,7 @@ where
// for lifetimes as parameters of generics
fn visit_lifetime(&mut self, lifetime: &'tcx Lifetime) {
if let LifetimeName::Param(def_id) = lifetime.res
if let LifetimeKind::Param(def_id) = lifetime.kind
&& let Some(usages) = self.map.get_mut(&def_id)
{
usages.push(Usage {
@ -826,7 +826,7 @@ fn report_elidable_lifetimes(
.iter()
.map(|&lt| cx.tcx.def_span(lt))
.chain(usages.iter().filter_map(|usage| {
if let LifetimeName::Param(def_id) = usage.res
if let LifetimeKind::Param(def_id) = usage.kind
&& elidable_lts.contains(&def_id)
{
return Some(usage.ident.span);

View file

@ -179,7 +179,7 @@ fn find_first_mismatch(cx: &LateContext<'_>, pat: &Pat<'_>) -> Option<(Span, Mut
};
if let Some(adjustments) = cx.typeck_results().pat_adjustments().get(adjust_pat.hir_id)
&& let [first, ..] = **adjustments
&& let ty::Ref(.., mutability) = *first.kind()
&& let ty::Ref(.., mutability) = *first.source.kind()
{
let level = if p.hir_id == pat.hir_id {
Level::Top

View file

@ -3,7 +3,7 @@ use clippy_utils::source::SpanRangeExt;
use clippy_utils::sugg::Sugg;
use clippy_utils::visitors::contains_unsafe_block;
use clippy_utils::{get_expr_use_or_unification_node, is_lint_allowed, path_def_id, path_to_local, std_or_core};
use hir::LifetimeName;
use hir::LifetimeKind;
use rustc_abi::ExternAbi;
use rustc_errors::{Applicability, MultiSpan};
use rustc_hir::hir_id::{HirId, HirIdMap};
@ -432,7 +432,7 @@ fn check_fn_args<'cx, 'tcx: 'cx>(
}
None
}) {
if let LifetimeName::Param(param_def_id) = lifetime.res
if let LifetimeKind::Param(param_def_id) = lifetime.kind
&& !lifetime.is_anonymous()
&& fn_sig
.output()

View file

@ -8,7 +8,7 @@ This crate is only guaranteed to build with this `nightly` toolchain:
<!-- begin autogenerated nightly -->
```
nightly-2025-04-17
nightly-2025-04-22
```
<!-- end autogenerated nightly -->

View file

@ -8,7 +8,7 @@ use rustc_hir::MatchSource::TryDesugar;
use rustc_hir::def::{DefKind, Res};
use rustc_hir::{
AssocItemConstraint, BinOpKind, BindingMode, Block, BodyId, Closure, ConstArg, ConstArgKind, Expr, ExprField,
ExprKind, FnRetTy, GenericArg, GenericArgs, HirId, HirIdMap, InlineAsmOperand, LetExpr, Lifetime, LifetimeName,
ExprKind, FnRetTy, GenericArg, GenericArgs, HirId, HirIdMap, InlineAsmOperand, LetExpr, Lifetime, LifetimeKind,
Pat, PatExpr, PatExprKind, PatField, PatKind, Path, PathSegment, PrimTy, QPath, Stmt, StmtKind, StructTailExpr,
TraitBoundModifiers, Ty, TyKind, TyPat, TyPatKind,
};
@ -483,7 +483,7 @@ impl HirEqInterExpr<'_, '_, '_> {
}
fn eq_lifetime(left: &Lifetime, right: &Lifetime) -> bool {
left.res == right.res
left.kind == right.kind
}
fn eq_pat_field(&mut self, left: &PatField<'_>, right: &PatField<'_>) -> bool {
@ -1245,8 +1245,8 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
pub fn hash_lifetime(&mut self, lifetime: &Lifetime) {
lifetime.ident.name.hash(&mut self.s);
std::mem::discriminant(&lifetime.res).hash(&mut self.s);
if let LifetimeName::Param(param_id) = lifetime.res {
std::mem::discriminant(&lifetime.kind).hash(&mut self.s);
if let LifetimeKind::Param(param_id) = lifetime.kind {
param_id.hash(&mut self.s);
}
}

View file

@ -2364,14 +2364,14 @@ pub fn is_no_std_crate(cx: &LateContext<'_>) -> bool {
cx.tcx
.hir_attrs(hir::CRATE_HIR_ID)
.iter()
.any(|attr| attr.name_or_empty() == sym::no_std)
.any(|attr| attr.has_name(sym::no_std))
}
pub fn is_no_core_crate(cx: &LateContext<'_>) -> bool {
cx.tcx
.hir_attrs(hir::CRATE_HIR_ID)
.iter()
.any(|attr| attr.name_or_empty() == sym::no_core)
.any(|attr| attr.has_name(sym::no_core))
}
/// Check if parent of a hir node is a trait implementation block.

View file

@ -1,6 +1,6 @@
[toolchain]
# begin autogenerated nightly
channel = "nightly-2025-04-17"
channel = "nightly-2025-04-22"
# end autogenerated nightly
components = ["cargo", "llvm-tools", "rust-src", "rust-std", "rustc", "rustc-dev", "rustfmt"]
profile = "minimal"