Skip to content

Commit 0450db3

Browse files
authored
Rustup (#14815)
r? @ghost changelog: none
2 parents 40bead0 + 3670731 commit 0450db3

23 files changed

+91
-52
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "clippy"
33
# begin autogenerated version
4-
version = "0.1.88"
4+
version = "0.1.89"
55
# end autogenerated version
66
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
77
repository = "https://github.com/rust-lang/rust-clippy"

clippy_config/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "clippy_config"
33
# begin autogenerated version
4-
version = "0.1.88"
4+
version = "0.1.89"
55
# end autogenerated version
66
edition = "2024"
77
publish = false

clippy_dev/src/utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use aho_corasick::{AhoCorasick, AhoCorasickBuilder};
22
use core::fmt::{self, Display};
33
use core::slice;
44
use core::str::FromStr;
5-
use rustc_lexer as lexer;
5+
use rustc_lexer::{self as lexer, FrontmatterAllowed};
66
use std::env;
77
use std::fs::{self, OpenOptions};
88
use std::io::{self, Read as _, Seek as _, SeekFrom, Write};
@@ -446,7 +446,7 @@ impl<'txt> RustSearcher<'txt> {
446446
pub fn new(text: &'txt str) -> Self {
447447
Self {
448448
text,
449-
cursor: lexer::Cursor::new(text),
449+
cursor: lexer::Cursor::new(text, FrontmatterAllowed::Yes),
450450
pos: 0,
451451

452452
// Sentinel value indicating there is no read token.

clippy_lints/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "clippy_lints"
33
# begin autogenerated version
4-
version = "0.1.88"
4+
version = "0.1.89"
55
# end autogenerated version
66
description = "A bunch of helpful lints to avoid common pitfalls in Rust"
77
repository = "https://github.com/rust-lang/rust-clippy"

clippy_lints/src/non_copy_const.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ impl<'tcx> NonCopyConst<'tcx> {
263263
fn is_value_unfrozen_poly(cx: &LateContext<'tcx>, body_id: BodyId, ty: Ty<'tcx>) -> bool {
264264
let def_id = body_id.hir_id.owner.to_def_id();
265265
let args = ty::GenericArgs::identity_for_item(cx.tcx, def_id);
266-
let instance = ty::Instance::new(def_id, args);
266+
let instance = ty::Instance::new_raw(def_id, args);
267267
let cid = GlobalId {
268268
instance,
269269
promoted: None,

clippy_lints/src/wildcard_imports.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ impl LateLintPass<'_> for WildcardImports {
154154
(span, false)
155155
};
156156

157-
let mut imports = used_imports.items().map(ToString::to_string).into_sorted_stable_ord();
157+
let mut imports: Vec<_> = used_imports.iter().map(ToString::to_string).collect();
158158
let imports_string = if imports.len() == 1 {
159159
imports.pop().unwrap()
160160
} else if braced_glob {

clippy_utils/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "clippy_utils"
33
# begin autogenerated version
4-
version = "0.1.88"
4+
version = "0.1.89"
55
# end autogenerated version
66
edition = "2024"
77
description = "Helpful tools for writing lints, provided as they are used in Clippy"

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-05-01
11+
nightly-2025-05-14
1212
```
1313
<!-- end autogenerated nightly -->
1414

clippy_utils/src/ty/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ use rustc_middle::traits::EvaluationResult;
2020
use rustc_middle::ty::layout::ValidityRequirement;
2121
use rustc_middle::ty::{
2222
self, AdtDef, AliasTy, AssocItem, AssocTag, Binder, BoundRegion, FnSig, GenericArg, GenericArgKind, GenericArgsRef,
23-
GenericParamDefKind, IntTy, Region, RegionKind, TraitRef, Ty, TyCtxt, TypeSuperVisitable, TypeVisitable,
24-
TypeVisitableExt, TypeVisitor, UintTy, Upcast, VariantDef, VariantDiscr,
23+
GenericParamDefKind, IntTy, Region, RegionKind, TraitRef, Ty, TyCtxt, TypeFoldable, TypeSuperVisitable,
24+
TypeVisitable, TypeVisitableExt, TypeVisitor, UintTy, Upcast, VariantDef, VariantDiscr,
2525
};
2626
use rustc_span::symbol::Ident;
2727
use rustc_span::{DUMMY_SP, Span, Symbol, sym};
@@ -853,7 +853,7 @@ pub fn for_each_top_level_late_bound_region<B>(
853853
ControlFlow::Continue(())
854854
}
855855
}
856-
fn visit_binder<T: TypeVisitable<TyCtxt<'tcx>>>(&mut self, t: &Binder<'tcx, T>) -> Self::Result {
856+
fn visit_binder<T: TypeFoldable<TyCtxt<'tcx>>>(&mut self, t: &Binder<'tcx, T>) -> Self::Result {
857857
self.index += 1;
858858
let res = t.super_visit_with(self);
859859
self.index -= 1;

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[toolchain]
22
# begin autogenerated nightly
3-
channel = "nightly-2025-05-01"
3+
channel = "nightly-2025-05-14"
44
# end autogenerated nightly
55
components = ["cargo", "llvm-tools", "rust-src", "rust-std", "rustc", "rustc-dev", "rustfmt"]
66
profile = "minimal"

tests/ui/author/macro_in_closure.stdout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ if let StmtKind::Let(local) = stmt.kind
1010
&& paths::STD_IO_STDIO__PRINT.matches_path(cx, func) // Add the path to `clippy_utils::paths` if needed
1111
&& args.len() == 1
1212
&& let ExprKind::Call(func1, args1) = args[0].kind
13-
&& paths::CORE_FMT_ARGUMENTS_NEW_V1.matches_path(cx, func1) // Add the path to `clippy_utils::paths` if needed
13+
&& paths::CORE_FMT_RT_NEW_V1.matches_path(cx, func1) // Add the path to `clippy_utils::paths` if needed
1414
&& args1.len() == 2
1515
&& let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner) = args1[0].kind
1616
&& let ExprKind::Array(elements) = inner.kind

tests/ui/author/macro_in_loop.stdout

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if let Some(higher::ForLoop { pat: pat, arg: arg, body: body, .. }) = higher::Fo
2020
&& paths::STD_IO_STDIO__PRINT.matches_path(cx, func) // Add the path to `clippy_utils::paths` if needed
2121
&& args.len() == 1
2222
&& let ExprKind::Call(func1, args1) = args[0].kind
23-
&& paths::CORE_FMT_ARGUMENTS_NEW_V1.matches_path(cx, func1) // Add the path to `clippy_utils::paths` if needed
23+
&& paths::CORE_FMT_RT_NEW_V1.matches_path(cx, func1) // Add the path to `clippy_utils::paths` if needed
2424
&& args1.len() == 2
2525
&& let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner) = args1[0].kind
2626
&& let ExprKind::Array(elements) = inner.kind

tests/ui/double_ended_iterator_last.fixed

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ fn issue_14139() {
8484
}
8585

8686
fn drop_order() {
87+
struct DropDeIterator(std::vec::IntoIter<S>);
88+
impl Iterator for DropDeIterator {
89+
type Item = S;
90+
fn next(&mut self) -> Option<Self::Item> {
91+
self.0.next()
92+
}
93+
}
94+
impl DoubleEndedIterator for DropDeIterator {
95+
fn next_back(&mut self) -> Option<Self::Item> {
96+
self.0.next_back()
97+
}
98+
}
99+
87100
struct S(&'static str);
88101
impl std::ops::Drop for S {
89102
fn drop(&mut self) {
@@ -92,7 +105,7 @@ fn drop_order() {
92105
}
93106

94107
let v = vec![S("one"), S("two"), S("three")];
95-
let mut v = v.into_iter();
108+
let mut v = DropDeIterator(v.into_iter());
96109
println!("Last element is {}", v.next_back().unwrap().0);
97110
//~^ ERROR: called `Iterator::last` on a `DoubleEndedIterator`
98111
println!("Done");

tests/ui/double_ended_iterator_last.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,19 @@ fn issue_14139() {
8484
}
8585

8686
fn drop_order() {
87+
struct DropDeIterator(std::vec::IntoIter<S>);
88+
impl Iterator for DropDeIterator {
89+
type Item = S;
90+
fn next(&mut self) -> Option<Self::Item> {
91+
self.0.next()
92+
}
93+
}
94+
impl DoubleEndedIterator for DropDeIterator {
95+
fn next_back(&mut self) -> Option<Self::Item> {
96+
self.0.next_back()
97+
}
98+
}
99+
87100
struct S(&'static str);
88101
impl std::ops::Drop for S {
89102
fn drop(&mut self) {
@@ -92,7 +105,7 @@ fn drop_order() {
92105
}
93106

94107
let v = vec![S("one"), S("two"), S("three")];
95-
let v = v.into_iter();
108+
let v = DropDeIterator(v.into_iter());
96109
println!("Last element is {}", v.last().unwrap().0);
97110
//~^ ERROR: called `Iterator::last` on a `DoubleEndedIterator`
98111
println!("Done");

tests/ui/double_ended_iterator_last.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,15 +18,15 @@ LL | let _ = DeIterator.last();
1818
| help: try: `next_back()`
1919

2020
error: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator
21-
--> tests/ui/double_ended_iterator_last.rs:96:36
21+
--> tests/ui/double_ended_iterator_last.rs:109:36
2222
|
2323
LL | println!("Last element is {}", v.last().unwrap().0);
2424
| ^^^^^^^^
2525
|
2626
= note: this change will alter drop order which may be undesirable
2727
help: try
2828
|
29-
LL ~ let mut v = v.into_iter();
29+
LL ~ let mut v = DropDeIterator(v.into_iter());
3030
LL ~ println!("Last element is {}", v.next_back().unwrap().0);
3131
|
3232

tests/ui/double_ended_iterator_last_unfixable.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ fn main() {
1111
}
1212

1313
fn drop_order() {
14+
struct DropDeIterator(std::vec::IntoIter<S>);
15+
impl Iterator for DropDeIterator {
16+
type Item = S;
17+
fn next(&mut self) -> Option<Self::Item> {
18+
self.0.next()
19+
}
20+
}
21+
impl DoubleEndedIterator for DropDeIterator {
22+
fn next_back(&mut self) -> Option<Self::Item> {
23+
self.0.next_back()
24+
}
25+
}
26+
1427
struct S(&'static str);
1528
impl std::ops::Drop for S {
1629
fn drop(&mut self) {
@@ -19,7 +32,7 @@ fn drop_order() {
1932
}
2033

2134
let v = vec![S("one"), S("two"), S("three")];
22-
let v = (v.into_iter(), 42);
35+
let v = (DropDeIterator(v.into_iter()), 42);
2336
println!("Last element is {}", v.0.last().unwrap().0);
2437
//~^ ERROR: called `Iterator::last` on a `DoubleEndedIterator`
2538
println!("Done");

tests/ui/double_ended_iterator_last_unfixable.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: called `Iterator::last` on a `DoubleEndedIterator`; this will needlessly iterate the entire iterator
2-
--> tests/ui/double_ended_iterator_last_unfixable.rs:23:36
2+
--> tests/ui/double_ended_iterator_last_unfixable.rs:36:36
33
|
44
LL | println!("Last element is {}", v.0.last().unwrap().0);
55
| ^^^^------
@@ -8,7 +8,7 @@ LL | println!("Last element is {}", v.0.last().unwrap().0);
88
|
99
= note: this change will alter drop order which may be undesirable
1010
note: this must be made mutable to use `.next_back()`
11-
--> tests/ui/double_ended_iterator_last_unfixable.rs:23:36
11+
--> tests/ui/double_ended_iterator_last_unfixable.rs:36:36
1212
|
1313
LL | println!("Last element is {}", v.0.last().unwrap().0);
1414
| ^^^

tests/ui/wildcard_imports.fixed

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use crate::fn_mod::foo;
1616
//~^ wildcard_imports
1717
use crate::mod_mod::inner_mod;
1818
//~^ wildcard_imports
19-
use crate::multi_fn_mod::{multi_bar, multi_foo, multi_inner_mod};
19+
use crate::multi_fn_mod::{multi_foo, multi_bar, multi_inner_mod};
2020
//~^ wildcard_imports
2121
#[macro_use]
2222
use crate::struct_mod::{A, inner_struct_mod};
@@ -26,7 +26,7 @@ use crate::struct_mod::{A, inner_struct_mod};
2626
use wildcard_imports_helper::inner::inner_for_self_import;
2727
use wildcard_imports_helper::inner::inner_for_self_import::inner_extern_bar;
2828
//~^ wildcard_imports
29-
use wildcard_imports_helper::{ExternA, extern_foo};
29+
use wildcard_imports_helper::{extern_foo, ExternA};
3030
//~^ wildcard_imports
3131

3232
use std::io::prelude::*;
@@ -138,7 +138,7 @@ mod in_fn_test {
138138
fn test_extern() {
139139
use wildcard_imports_helper::inner::inner_for_self_import::{self, inner_extern_foo};
140140
//~^ wildcard_imports
141-
use wildcard_imports_helper::{ExternA, extern_foo};
141+
use wildcard_imports_helper::{extern_foo, ExternA};
142142
//~^ wildcard_imports
143143

144144
inner_for_self_import::inner_extern_foo();
@@ -160,7 +160,7 @@ mod in_fn_test {
160160
}
161161

162162
fn test_extern_reexported() {
163-
use wildcard_imports_helper::{ExternExportedEnum, ExternExportedStruct, extern_exported};
163+
use wildcard_imports_helper::{extern_exported, ExternExportedStruct, ExternExportedEnum};
164164
//~^ wildcard_imports
165165

166166
extern_exported();
@@ -190,7 +190,7 @@ mod in_fn_test {
190190
}
191191

192192
fn test_reexported() {
193-
use crate::in_fn_test::{ExportedEnum, ExportedStruct, exported};
193+
use crate::in_fn_test::{exported, ExportedStruct, ExportedEnum};
194194
//~^ wildcard_imports
195195

196196
exported();

tests/ui/wildcard_imports.stderr

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ error: usage of wildcard import
1717
--> tests/ui/wildcard_imports.rs:19:5
1818
|
1919
LL | use crate::multi_fn_mod::*;
20-
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::multi_fn_mod::{multi_bar, multi_foo, multi_inner_mod}`
20+
| ^^^^^^^^^^^^^^^^^^^^^^ help: try: `crate::multi_fn_mod::{multi_foo, multi_bar, multi_inner_mod}`
2121

2222
error: usage of wildcard import
2323
--> tests/ui/wildcard_imports.rs:22:5
@@ -35,7 +35,7 @@ error: usage of wildcard import
3535
--> tests/ui/wildcard_imports.rs:29:5
3636
|
3737
LL | use wildcard_imports_helper::*;
38-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternA, extern_foo}`
38+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`
3939

4040
error: usage of wildcard import
4141
--> tests/ui/wildcard_imports.rs:100:13
@@ -59,7 +59,7 @@ error: usage of wildcard import
5959
--> tests/ui/wildcard_imports.rs:141:13
6060
|
6161
LL | use wildcard_imports_helper::*;
62-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternA, extern_foo}`
62+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_foo, ExternA}`
6363

6464
error: usage of wildcard import
6565
--> tests/ui/wildcard_imports.rs:154:20
@@ -77,13 +77,13 @@ error: usage of wildcard import
7777
--> tests/ui/wildcard_imports.rs:163:13
7878
|
7979
LL | use wildcard_imports_helper::*;
80-
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{ExternExportedEnum, ExternExportedStruct, extern_exported}`
80+
| ^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `wildcard_imports_helper::{extern_exported, ExternExportedStruct, ExternExportedEnum}`
8181

8282
error: usage of wildcard import
8383
--> tests/ui/wildcard_imports.rs:193:9
8484
|
8585
LL | use crate::in_fn_test::*;
86-
| ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::in_fn_test::{ExportedEnum, ExportedStruct, exported}`
86+
| ^^^^^^^^^^^^^^^^^^^^ help: try: `crate::in_fn_test::{exported, ExportedStruct, ExportedEnum}`
8787

8888
error: usage of wildcard import
8989
--> tests/ui/wildcard_imports.rs:203:9

tests/ui/wildcard_imports_2021.edition2018.fixed

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::fn_mod::foo;
1414
//~^ wildcard_imports
1515
use crate::mod_mod::inner_mod;
1616
//~^ wildcard_imports
17-
use crate::multi_fn_mod::{multi_bar, multi_foo, multi_inner_mod};
17+
use crate::multi_fn_mod::{multi_foo, multi_bar, multi_inner_mod};
1818
//~^ wildcard_imports
1919
use crate::struct_mod::{A, inner_struct_mod};
2020
//~^ wildcard_imports
@@ -23,7 +23,7 @@ use crate::struct_mod::{A, inner_struct_mod};
2323
use wildcard_imports_helper::inner::inner_for_self_import::inner_extern_bar;
2424
//~^ wildcard_imports
2525
use wildcard_imports_helper::prelude::v1::*;
26-
use wildcard_imports_helper::{ExternA, extern_foo};
26+
use wildcard_imports_helper::{extern_foo, ExternA};
2727
//~^ wildcard_imports
2828

2929
use std::io::prelude::*;
@@ -132,7 +132,7 @@ mod in_fn_test {
132132
fn test_extern() {
133133
use wildcard_imports_helper::inner::inner_for_self_import::{self, inner_extern_foo};
134134
//~^ wildcard_imports
135-
use wildcard_imports_helper::{ExternA, extern_foo};
135+
use wildcard_imports_helper::{extern_foo, ExternA};
136136
//~^ wildcard_imports
137137

138138
inner_for_self_import::inner_extern_foo();
@@ -154,7 +154,7 @@ mod in_fn_test {
154154
}
155155

156156
fn test_extern_reexported() {
157-
use wildcard_imports_helper::{ExternExportedEnum, ExternExportedStruct, extern_exported};
157+
use wildcard_imports_helper::{extern_exported, ExternExportedStruct, ExternExportedEnum};
158158
//~^ wildcard_imports
159159

160160
extern_exported();
@@ -184,7 +184,7 @@ mod in_fn_test {
184184
}
185185

186186
fn test_reexported() {
187-
use crate::in_fn_test::{ExportedEnum, ExportedStruct, exported};
187+
use crate::in_fn_test::{exported, ExportedStruct, ExportedEnum};
188188
//~^ wildcard_imports
189189

190190
exported();

0 commit comments

Comments
 (0)