Skip to content

Commit 92b4b68

Browse files
authored
Rustup (#16153)
r? @ghost changelog: none
2 parents 397aa53 + aa988c8 commit 92b4b68

23 files changed

+76
-73
lines changed

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ tempfile = { version = "3.20", optional = true }
3131
termize = "0.2"
3232
color-print = "0.3.4"
3333
anstream = "0.6.18"
34-
tikv-jemalloc-sys = { version = "0.6.1", optional = true, features = ['override_allocator_on_supported_platforms'] }
3534

3635
[dev-dependencies]
3736
cargo_metadata = "0.18.1"
@@ -57,7 +56,7 @@ rustc_tools_util = { path = "rustc_tools_util", version = "0.4.2" }
5756
[features]
5857
integration = ["dep:tempfile"]
5958
internal = ["dep:clippy_lints_internal", "dep:tempfile"]
60-
jemalloc = ["dep:tikv-jemalloc-sys"]
59+
jemalloc = []
6160

6261
[package.metadata.rust-analyzer]
6362
# This package uses #[feature(rustc_private)]

clippy_config/src/conf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ struct ConfError {
108108

109109
impl ConfError {
110110
fn from_toml(file: &SourceFile, error: &toml::de::Error) -> Self {
111-
let span = error.span().unwrap_or(0..file.source_len.0 as usize);
111+
let span = error.span().unwrap_or(0..file.normalized_source_len.0 as usize);
112112
Self::spanned(file, error.message(), None, span)
113113
}
114114

clippy_lints/src/dereference.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -861,7 +861,6 @@ impl TyCoercionStability {
861861
TyKind::OpaqueDef(..)
862862
| TyKind::TraitAscription(..)
863863
| TyKind::Infer(())
864-
| TyKind::Typeof(..)
865864
| TyKind::TraitObject(..)
866865
| TyKind::InferDelegation(..)
867866
| TyKind::Err(_) => Self::Reborrow,
@@ -942,7 +941,7 @@ fn ty_contains_infer(ty: &hir::Ty<'_>) -> bool {
942941
}
943942

944943
fn visit_ty(&mut self, ty: &hir::Ty<'_, AmbigArg>) {
945-
if self.0 || matches!(ty.kind, TyKind::OpaqueDef(..) | TyKind::Typeof(_) | TyKind::Err(_)) {
944+
if self.0 || matches!(ty.kind, TyKind::OpaqueDef(..) | TyKind::Err(_)) {
946945
self.0 = true;
947946
} else {
948947
walk_ty(self, ty);

clippy_lints/src/derivable_impls.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,7 @@ impl<'tcx> LateLintPass<'tcx> for DerivableImpls {
232232
of_trait: Some(of_trait),
233233
items: [child],
234234
self_ty,
235+
constness,
235236
..
236237
}) = item.kind
237238
&& !cx.tcx.is_automatically_derived(item.owner_id.to_def_id())
@@ -247,7 +248,7 @@ impl<'tcx> LateLintPass<'tcx> for DerivableImpls {
247248
&& !attrs.iter().any(|attr| attr.doc_str().is_some())
248249
&& cx.tcx.hir_attrs(impl_item_hir).is_empty()
249250
{
250-
let is_const = of_trait.constness == hir::Constness::Const;
251+
let is_const = constness == hir::Constness::Const;
251252
if adt_def.is_struct() {
252253
check_struct(
253254
cx,

clippy_lints/src/manual_non_exhaustive.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,8 @@ impl<'tcx> LateLintPass<'tcx> for ManualNonExhaustive {
9292
(matches!(v.data, VariantData::Unit(_, _)) && is_doc_hidden(cx.tcx.hir_attrs(v.hir_id)))
9393
.then_some((v.def_id, v.span))
9494
});
95-
if let Ok((id, span)) = iter.exactly_one()
95+
// FIXME: rewrite in terms of `#![feature(exact_length_collection)]`. See: #149266
96+
if let Ok((id, span)) = Itertools::exactly_one(iter)
9697
&& !find_attr!(cx.tcx.hir_attrs(item.hir_id()), AttributeKind::NonExhaustive(..))
9798
{
9899
self.potential_enums.push((item.owner_id.def_id, id, item.span, span));
@@ -104,7 +105,8 @@ impl<'tcx> LateLintPass<'tcx> for ManualNonExhaustive {
104105
.iter()
105106
.filter(|field| !cx.effective_visibilities.is_exported(field.def_id));
106107
if fields.len() > 1
107-
&& let Ok(field) = private_fields.exactly_one()
108+
// FIXME: rewrite in terms of `#![feature(exact_length_collection)]`. See: #149266
109+
&& let Ok(field) = Itertools::exactly_one(private_fields)
108110
&& let TyKind::Tup([]) = field.ty.kind
109111
{
110112
span_lint_and_then(

clippy_utils/README.md

Lines changed: 1 addition & 1 deletion
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-11-14
11+
nightly-2025-11-28
1212
```
1313
<!-- end autogenerated nightly -->
1414

clippy_utils/src/ast_utils/mod.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ pub fn eq_pat(l: &Pat, r: &Pat) -> bool {
4343
(Range(lf, lt, le), Range(rf, rt, re)) => {
4444
eq_expr_opt(lf.as_deref(), rf.as_deref())
4545
&& eq_expr_opt(lt.as_deref(), rt.as_deref())
46-
&& eq_range_end(&le.node, &re.node)
46+
&& eq_range_end(le.node, re.node)
4747
},
4848
(Box(l), Box(r)) => eq_pat(l, r),
4949
(Ref(l, l_pin, l_mut), Ref(r, r_pin, r_mut)) => l_pin == r_pin && l_mut == r_mut && eq_pat(l, r),
@@ -64,7 +64,7 @@ pub fn eq_pat(l: &Pat, r: &Pat) -> bool {
6464
}
6565
}
6666

67-
pub fn eq_range_end(l: &RangeEnd, r: &RangeEnd) -> bool {
67+
pub fn eq_range_end(l: RangeEnd, r: RangeEnd) -> bool {
6868
match (l, r) {
6969
(RangeEnd::Excluded, RangeEnd::Excluded) => true,
7070
(RangeEnd::Included(l), RangeEnd::Included(r)) => {
@@ -495,20 +495,22 @@ pub fn eq_item_kind(l: &ItemKind, r: &ItemKind) -> bool {
495495
of_trait: lot,
496496
self_ty: lst,
497497
items: li,
498+
constness: lc,
498499
}),
499500
Impl(ast::Impl {
500501
generics: rg,
501502
of_trait: rot,
502503
self_ty: rst,
503504
items: ri,
505+
constness: rc,
504506
}),
505507
) => {
506508
eq_generics(lg, rg)
507509
&& both(lot.as_deref(), rot.as_deref(), |l, r| {
508510
matches!(l.safety, Safety::Default) == matches!(r.safety, Safety::Default)
509511
&& matches!(l.polarity, ImplPolarity::Positive) == matches!(r.polarity, ImplPolarity::Positive)
510512
&& eq_defaultness(l.defaultness, r.defaultness)
511-
&& matches!(l.constness, ast::Const::No) == matches!(r.constness, ast::Const::No)
513+
&& matches!(lc, ast::Const::No) == matches!(rc, ast::Const::No)
512514
&& eq_path(&l.trait_ref.path, &r.trait_ref.path)
513515
})
514516
&& eq_ty(lst, rst)
@@ -873,7 +875,6 @@ pub fn eq_ty(l: &Ty, r: &Ty) -> bool {
873875
(Path(lq, lp), Path(rq, rp)) => both(lq.as_deref(), rq.as_deref(), eq_qself) && eq_path(lp, rp),
874876
(TraitObject(lg, ls), TraitObject(rg, rs)) => ls == rs && over(lg, rg, eq_generic_bound),
875877
(ImplTrait(_, lg), ImplTrait(_, rg)) => over(lg, rg, eq_generic_bound),
876-
(Typeof(l), Typeof(r)) => eq_expr(&l.value, &r.value),
877878
(MacCall(l), MacCall(r)) => eq_mac_call(l, r),
878879
_ => false,
879880
}

clippy_utils/src/check_proc_macro.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -531,11 +531,10 @@ fn ast_ty_search_pat(ty: &ast::Ty) -> (Pat, Pat) {
531531
TyKind::ImplicitSelf
532532

533533
// experimental
534-
|TyKind::Pat(..)
534+
| TyKind::Pat(..)
535535

536536
// unused
537537
| TyKind::CVarArgs
538-
| TyKind::Typeof(_)
539538

540539
// placeholder
541540
| TyKind::Dummy

clippy_utils/src/hir_utils.rs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1309,9 +1309,6 @@ impl<'a, 'tcx> SpanlessHash<'a, 'tcx> {
13091309
TyKind::TraitObject(_, lifetime) => {
13101310
self.hash_lifetime(lifetime);
13111311
},
1312-
TyKind::Typeof(anon_const) => {
1313-
self.hash_body(anon_const.body);
1314-
},
13151312
TyKind::UnsafeBinder(binder) => {
13161313
self.hash_ty(binder.inner_ty);
13171314
},

clippy_utils/src/qualify_min_const_fn.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ fn check_rvalue<'tcx>(
194194
))
195195
}
196196
},
197-
Rvalue::NullaryOp(NullOp::OffsetOf(_) | NullOp::RuntimeChecks(_), _) | Rvalue::ShallowInitBox(_, _) => Ok(()),
197+
Rvalue::NullaryOp(NullOp::RuntimeChecks(_)) | Rvalue::ShallowInitBox(_, _) => Ok(()),
198198
Rvalue::UnaryOp(_, operand) => {
199199
let ty = operand.ty(body, cx.tcx);
200200
if ty.is_integral() || ty.is_bool() {

0 commit comments

Comments
 (0)