Skip to content

Rollup of 13 pull requests #98723

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 206 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
206 commits
Select commit Hold shift + click to select a range
430575b
add `manual_find` lint for function return case
ebobrow Apr 6, 2022
5a70d88
add vec.capacity() to slow_vec_initialization
DevAccentor Jun 5, 2022
63d1c86
[core] add Exclusive to sync
guswynn Jun 1, 2022
6d6c63e
Lint single_match with Options, Results, and Cows
botahamec Jun 9, 2022
2967127
Refactored the candidate type checking
botahamec Jun 9, 2022
b46f1c4
Don't trigger if a binding is in the else pattern
botahamec Jun 10, 2022
b0c2030
Some refactoring
botahamec Jun 10, 2022
01c75e4
Added tests for Cow and Result
botahamec Jun 10, 2022
f3dc7ae
Fixed up the documentation for a couple functions
botahamec Jun 10, 2022
ded2bb5
Slight documentation change
botahamec Jun 10, 2022
9306e9a
Ignore bodies containing `todo!()` in `clippy::if_same_then_else`
May 18, 2022
7cb4cef
feat(fix): ignore todo! and unimplemented! in if_same_then_else
kyoto7250 Jun 16, 2022
922ff84
bless clippy tests
klensy Jun 15, 2022
4d88993
bless clippy ui tests
WaffleLapkin Jun 16, 2022
f8f9d01
Merge commit 'd7b5cbf065b88830ca519adcb73fad4c0d24b1c7' into clippyup
flip1995 Jun 16, 2022
f095f80
Move/rename `lazy::Sync{OnceCell,Lazy}` to `sync::{Once,Lazy}Lock`
WaffleLapkin Jun 16, 2022
a5b6d25
use get_diagnostic_name for checking macro_call
kyoto7250 Jun 17, 2022
72c73f8
remove the rest of unnecessary `to_string`
TaKO8Ki Jun 17, 2022
51e2d6a
Rollup merge of #97798 - WaffleLapkin:allow_for_suggestions_that_are_…
Dylan-DPC Jun 17, 2022
2cc798b
Rollup merge of #98191 - TaKO8Ki:remove-rest-of-unnecessary-to-string…
Dylan-DPC Jun 17, 2022
2bb8c45
feat(lint): add default_iter_empty
kyoto7250 Jun 12, 2022
697c75e
check only the end
kyoto7250 Jun 17, 2022
09c9301
Auto merge of #97892 - klensy:fix-spaces, r=oli-obk
bors Jun 17, 2022
e933bb6
Auto merge of #8989 - kyoto7250:default_iter_empty, r=Alexendoo
bors Jun 17, 2022
f411c18
check macro_backtrace only
kyoto7250 Jun 18, 2022
7a83809
check only first statement
kyoto7250 Jun 18, 2022
040d45e
check macro in eq_block
kyoto7250 Jun 18, 2022
4a02ae9
cargo dev fmt
kyoto7250 Jun 18, 2022
a9215d9
ignore item in thread_local!
kyoto7250 Jun 16, 2022
eeedf72
Use RefCell in needless_return tests
Alexendoo Jun 18, 2022
4737e9e
Rollup merge of #98165 - WaffleLapkin:once_things_renamings, r=m-ou-se
matthiaskrgr Jun 18, 2022
4e7ed42
Add description meta tag for lint list
unvalley Jun 19, 2022
9395c26
remove `span_lint_and_sugg_for_edges` from clippy utils
WaffleLapkin Jun 19, 2022
ee37029
remove last use of MAX_SUGGESTION_HIGHLIGHT_LINES
WaffleLapkin Jun 19, 2022
9d92af7
Auto merge of #9016 - Alexendoo:needless-return-test, r=giraffate
bors Jun 20, 2022
46d056e
check last statement
kyoto7250 Jun 20, 2022
39ffda0
check macro in HitEqInterExpr
kyoto7250 Jun 20, 2022
4a4b5cf
confirm using chain in collapsible_span_lint_calls
kyoto7250 Jun 20, 2022
195f2cb
Auto merge of #9023 - unvalley:add-meta-tag-for-lint-list, r=xFrednet
bors Jun 20, 2022
a0b107b
unused_async: lint async methods
Alexendoo Jun 20, 2022
97d4513
Auto merge of #9025 - Alexendoo:unused-async-method, r=dswij
bors Jun 20, 2022
93c6f9e
Auto merge of #9006 - kyoto7250:issue-8836-v2, r=Jarcho
bors Jun 20, 2022
6fc84d4
put parentheses around neg_multiply suggestion if needed
hellow554 Jun 20, 2022
2476100
Add details about significant drop in match scrutinees causing deadlocks
PrestonFrom Jun 10, 2022
dc7f227
`For` example should be used instead `while` in WHILE_LET_ON_ITERATOR
alex-semenyuk Jun 18, 2022
2bd1581
Add `dev deprecate`
Serial-ATA May 22, 2022
890fd0e
Remove `cargo_dev` dependency
Serial-ATA Jun 21, 2022
e5ebd3e
Implement manual_rem_euclid lint
Jun 21, 2022
6e1df47
Fix case where suggestion errored for infer type
Jun 21, 2022
ab645bb
enum_variant_names should ignore when all prefixes are _
kyoto7250 Jun 21, 2022
bc0bf06
Auto merge of #9017 - alex-semenyuk:while_let_on_iterator_doc_fix, r=…
bors Jun 22, 2022
f9fea17
Auto merge of #9030 - Serial-ATA:remove-clippy-dev-dep, r=flip1995
bors Jun 22, 2022
b969326
Example for VEC_RESIZE_TO_ZERO
alex-semenyuk Jun 22, 2022
75ed0c9
Prefer `.ok()?` over `.unwrap()`
Jun 22, 2022
93e41d3
Fix case where rem was considered commutative
Jun 22, 2022
c8df6d6
Prefer if let chain over macro
Jun 22, 2022
90f8277
Fix case for function params
Jun 22, 2022
61e1870
Add MSRV check for const rem_euclid
Jun 22, 2022
0447cc7
Simplify with let else
Jun 22, 2022
3d366fc
Auto merge of #9026 - hellow554:neg_multiply_precedence, r=xFrednet
bors Jun 22, 2022
6985e65
Auto merge of #9028 - kyoto7250:issue_8798, r=xFrednet
bors Jun 22, 2022
2cc5211
Auto merge of #9034 - alex-semenyuk:example_vec_resize_to_zero, r=gir…
bors Jun 22, 2022
87eded6
Fix `extra_unused_lifetimes` false positive
smoelius Jun 21, 2022
1f707db
Update messages for clarity when linting
PrestonFrom Jun 23, 2022
4182803
Check for `--force-warn` in Clippy's driver run condition
xFrednet Jun 23, 2022
92704b4
Split constant check functions and simplify
Jun 23, 2022
ebf77f6
Fix ICE when deprecating lints in directories
Serial-ATA Jun 23, 2022
029f9aa
add tracking issue for exclusive
guswynn Jun 23, 2022
df26c3f
Add external macro guard and test middle MSRV
Jun 23, 2022
f718984
Auto merge of #8953 - DevAccentor:slow_vector_initialization, r=Manis…
bors Jun 23, 2022
3f47cd1
Auto merge of #9036 - xFrednet:0000-force-warn-in-driver, r=dswij
bors Jun 24, 2022
1d1ae10
Auto merge of #9037 - smoelius:fix-extra-unused-lifetimes-fp, r=dswij
bors Jun 24, 2022
a8f6824
Add test for `extra_unused_lifetimes` FP on derive
dswij Jun 24, 2022
e17864e
Auto merge of #9031 - evantypanski:manual_rem_euclid, r=Jarcho
bors Jun 24, 2022
aec465c
Add test for [`default_deprecation_reason`]
Serial-ATA Jun 24, 2022
93ebd0e
Auto merge of #9015 - kyoto7250:issue_8493, r=Jarcho
bors Jun 25, 2022
7cdaabc
Suggest `pointer::cast` when possible in `transmute_ptr_to_ref`
Jarcho Jun 4, 2022
e7c55a4
Fix `#[expect]` for `clippy::ptr_arg`
xFrednet Jun 25, 2022
811d73a
Test `#[expect]` for `redundant_clone`
xFrednet Jun 25, 2022
a3c7101
Fix `#[expect]` for `clippy::logic_bug`
xFrednet Jun 25, 2022
b6ee6bb
Fix `#[expect]` for `clippy::nonminimal_bool`
xFrednet Jun 25, 2022
b297698
Fix `#[expect]` for `clippy::boxed_local`
xFrednet Jun 25, 2022
54ad99b
Fix `#[expect]` for `clippy::implicit_return`
xFrednet Jun 25, 2022
bdc6ece
Fix `#[expect]` for `clippy::needless_return`
xFrednet Jun 25, 2022
79fc271
Fix `#[expect]` for `unnecessary_unwrap`, `panicking_unwrap`
xFrednet Jun 25, 2022
ae4900c
Fix `#[expect]` for `clippy::macro_use_imports`
xFrednet Jun 25, 2022
525f5ee
Update `useless_attribute` docs and allow `macro_use_imports`
xFrednet Jun 25, 2022
6427ba4
Fix `#[expect]` for `clippy::manual_non_exhaustive`
xFrednet Jun 25, 2022
4d41a97
Add note to `is_lint_allowed` about lint emission
xFrednet Jun 25, 2022
3a31ef7
Give clippy some Dogfood to make it happy =^.^=
xFrednet Jun 25, 2022
8789f4e
Auto merge of #8985 - botahamec:single-match-option, r=llogiq
bors Jun 25, 2022
bf317a8
treat argument as a slice.
kyoto7250 Jun 26, 2022
d827b83
use all instead of join
kyoto7250 Jun 26, 2022
4065702
STRING_ADD example
alex-semenyuk Jun 26, 2022
1691914
STRING_ADD example
alex-semenyuk Jun 26, 2022
11bf291
update node.js version
kyoto7250 Jun 26, 2022
ab58276
Auto merge of #9055 - kyoto7250:update_nodejs_in_github_action, r=Man…
bors Jun 26, 2022
9b15062
Auto merge of #9032 - kyoto7250:issue_9018, r=llogiq
bors Jun 26, 2022
5f2b8e6
feat(new lint): new lint `use_retain`
kyoto7250 Jun 7, 2022
b20b8f1
Update clippy_lints/src/use_retain.rs
kyoto7250 Jun 9, 2022
e3afc72
remove needless return
kyoto7250 Jun 9, 2022
3953c53
change lint type from style to perf
kyoto7250 Jun 9, 2022
fd629c0
check method
kyoto7250 Jun 9, 2022
1421211
rewrite without if_chain macro
kyoto7250 Jun 9, 2022
4decfde
check msrv
kyoto7250 Jun 10, 2022
dd3d0fd
rename use_retain => manual_retain
kyoto7250 Jun 10, 2022
3a9c0ef
fix for git rebase
kyoto7250 Jun 18, 2022
676af45
cargo dev update_lints
kyoto7250 Jun 26, 2022
88da5f2
Auto merge of #8939 - Jarcho:transmute_ptr_to_ref_lt, r=giraffate
bors Jun 27, 2022
57e7e1d
Auto merge of #8871 - Serial-ATA:cargo-dev-deprecate, r=giraffate
bors Jun 27, 2022
6b762ee
Auto merge of #9054 - alex-semenyuk:string_add_example, r=giraffate
bors Jun 27, 2022
65f700f
Fix `let_undescore_lock` false-positive when binding without locking
tsoutsman Jun 13, 2022
889b361
Auto merge of #8990 - tsoutsman:master, r=llogiq
bors Jun 27, 2022
eaa03ea
Auto merge of #8972 - kyoto7250:use_retain, r=llogiq
bors Jun 27, 2022
c6a2221
Fix example `SELF_ASSIGNMENT`
alex-semenyuk Jun 25, 2022
2315f76
Actually check lifetimes in `trivially_copy_pass_by_ref`
Jarcho Apr 6, 2022
c10101c
Don't lint `trivially_copy_pass_by_ref` when unsafe pointers are used
Jarcho Apr 6, 2022
fdd0e72
Auto merge of #8649 - ebobrow:imperative_find, r=flip1995
bors Jun 27, 2022
d855395
Auto merge of #9045 - alex-semenyuk:self_assignment_example, r=llogiq
bors Jun 27, 2022
af0c1fe
fix data race in thread::scope
RalfJung Jun 25, 2022
3cfd1e5
Make messages more accurate, check lint enabled
PrestonFrom Jun 28, 2022
7bc4096
Run cargo dev fmt
PrestonFrom Jun 28, 2022
81737bf
try reading rust-version from Cargo.toml
hellow554 May 2, 2022
83511d1
update README.md to reflect rust-version in cargo.toml
hellow554 May 10, 2022
6384765
parse `Cargo.toml` file in ui-cargo tests
hellow554 Jun 27, 2022
f0a1cd5
add uitests for cargo rust-version field
hellow554 May 10, 2022
373bb57
Auto merge of #8639 - Jarcho:trivially_copy_pass_by_ref_5953, r=dswij
bors Jun 28, 2022
b776fb8
Auto merge of #8774 - hellow554:cargo-rust-version, r=flip1995
bors Jun 28, 2022
d11618e
Update `boxed_local` expect attribute location
xFrednet Jun 28, 2022
c107c97
Better support projection types when finding the signature for an exp…
Jarcho Jan 25, 2022
8a74d33
Add `explicit_auto_deref` lint
Jarcho Jan 27, 2022
ee532c0
Don't lint `explicit_auto_deref` on reborrows
Jarcho Jan 27, 2022
a187d64
Merge different parent walking loops in `dereference.rs`
Jarcho Jan 28, 2022
20ea262
Lint field accesses in `explicit_auto_deref`
Jarcho Jan 28, 2022
442a68c
Only check parent node once in `dereference.rs`
Jarcho Jan 28, 2022
65bc6cb
Lint `explicit_auto_deref` without a leading borrow
Jarcho Jan 28, 2022
0204b95
Lint `explicit_auto_deref` immediately after `needless_borrow`
Jarcho Jan 29, 2022
0b4ba73
Refactor `dereference.rs`
Jarcho Jan 29, 2022
6d21b79
Fix `needless_borrow` suggestion when calling a trait method taking `…
Jarcho Jan 30, 2022
9788107
Handle future precedence issues in `explicit_auto_deref` + cleanup
Jarcho Jan 31, 2022
15df228
Code cleanup
Jarcho Feb 7, 2022
85c1f74
Add `explicit_auto_deref` test for variadic function
Jarcho Jun 13, 2022
dd78ce7
Add `Operators` lint pass
Jarcho May 31, 2022
448b6f4
Move `Arithmetic` into `Operators` lint pass
Jarcho Jun 1, 2022
751131b
Move `AssignOps` into `Operators` lint pass
Jarcho Jun 1, 2022
68a7fd2
Move `BitMask` into `Operators` lint pass
Jarcho Jun 1, 2022
4ac3626
Move `DoubleComparison` into `Operators` lint pass
Jarcho Jun 1, 2022
732d716
Move `DurationSubsec` into `Operators` lint pass
Jarcho Jun 1, 2022
0adb3c0
Move `EqOp` into `Operators` lint pass
Jarcho Jun 1, 2022
3de70a4
Move `ErasingOp` into `Operators` lint pass
Jarcho Jun 1, 2022
56f50d3
Move `FloatEqualityWithoutAbs` into `Operators` lint pass
Jarcho Jun 1, 2022
83de67c
Move `IdentityOp` into `Operators` lint pass
Jarcho Jun 1, 2022
a8df16a
Move `IntegerDivision` into `Operators` lint pass
Jarcho Jun 1, 2022
c0b0ee5
Move some lints from `Misc` to `Operators`
Jarcho Jun 1, 2022
71c2daa
Move `ModuloArithmetic` into `Operators` lint pass
Jarcho Jun 1, 2022
fc5eac5
Move `NeedlessBitwiseBool` into `Operators` lint pass
Jarcho Jun 1, 2022
92891a0
Move `PtrEq` into `Operators` lin pass
Jarcho Jun 1, 2022
5e2a2d3
Fix dogfood
Jarcho Jun 14, 2022
ffbba85
Move `SelfAssignment` into `Operators` lint pass
Jarcho Jun 1, 2022
23c6765
Auto merge of #8921 - Jarcho:merge_passes, r=llogiq
bors Jun 28, 2022
a4130e1
Auto merge of #8355 - Jarcho:explicit_auto_deref_2, r=flip1995
bors Jun 28, 2022
4995b4e
Auto merge of #9046 - xFrednet:rust-97660-expection-something-somethi…
bors Jun 28, 2022
716af21
Factor out hir::Node::Binding
camsteffen Jun 28, 2022
27ff258
Fix height for the source sidebar in mobile mode
GuillaumeGomez Jun 29, 2022
ea97bdc
Update/add tests for source sidebar in mobile mode
GuillaumeGomez Jun 29, 2022
90227c1
Auto merge of #8981 - PrestonFrom:more_details_for_significant_drop_l…
bors Jun 29, 2022
ad970a7
Fix display of toggle on expanded source sidebar
GuillaumeGomez Jun 29, 2022
be56963
Add test for source sidebar toggle
GuillaumeGomez Jun 29, 2022
70f1d0d
Auto merge of #9043 - dswij:9037-test, r=Manishearth
bors Jun 29, 2022
58434ae
Extract util functions from `redundant_pattern_match`
Jarcho Apr 8, 2022
adbc849
Don't lint `while_let_loop` when drop order would change
Jarcho Apr 8, 2022
afd8cf2
add test for 72793
matthiaskrgr Jun 29, 2022
f60ec83
interpret: add From<&MplaceTy> for PlaceTy
RalfJung Jun 29, 2022
277b77a
Update browser-ui-test version to 0.9.7
GuillaumeGomez Jun 29, 2022
398e778
use "or pattern"
tshepang Jun 30, 2022
5d75a9b
fix
tamaroning Jun 30, 2022
88591ba
Auto merge of #8666 - Jarcho:while_let_loop_7913, r=dswij
bors Jun 30, 2022
5d9e1b6
Update large_const_arrays.rs
tamaroning Jun 30, 2022
ff3964a
Auto merge of #9068 - tamaroning:fix-typo-2022-6-30, r=giraffate,xFre…
bors Jun 30, 2022
f26cf11
Merge remote-tracking branch 'upstream/master' into rustup
flip1995 Jun 30, 2022
bf9b39a
Fix dogfood
flip1995 Jun 30, 2022
d9b2e21
Bump nightly version -> 2022-06-30
flip1995 Jun 30, 2022
9de1f9f
Bump Clippy version -> 0.1.64
flip1995 Jun 30, 2022
0cb0f76
Auto merge of #9069 - flip1995:rustup, r=flip1995
bors Jun 30, 2022
721d53a
Merge commit '0cb0f7636851f9fcc57085cf80197a2ef6db098f' into clippyup
flip1995 Jun 30, 2022
5fead7a
Update Cargo.lock
flip1995 Jun 30, 2022
be580a0
Remove unneeded methods declaration for old web browsers
GuillaumeGomez Jun 30, 2022
29e0e14
rustdoc: fix 98690
pinkforest Jun 30, 2022
a3a88c7
llvm-wrapper: adapt for LLVMConstExtractValue removal
krasimirgg Jun 29, 2022
72f6322
Fix scroll when source sidebar is open on mobile
GuillaumeGomez Jun 29, 2022
9a1f52d
Add test to ensure that scroll position is kept when opening/closing …
GuillaumeGomez Jun 29, 2022
8515475
get rid of some tidy 'unnecessarily ignored' warnings
RalfJung Jun 30, 2022
15d3ea5
For diagnostic information of Boolean, remind it as use the type: 'bool'
Jun 29, 2022
0f7955e
Rollup merge of #97629 - guswynn:exclusive_struct, r=m-ou-se
matthiaskrgr Jun 30, 2022
ab4fa8a
Rollup merge of #98503 - RalfJung:scope-race, r=m-ou-se
matthiaskrgr Jun 30, 2022
1a9051e
Rollup merge of #98639 - camsteffen:no-node-binding, r=compiler-errors
matthiaskrgr Jun 30, 2022
971d08f
Rollup merge of #98670 - krasimirgg:llvm-15-LLVMConstExtractValue, r=…
matthiaskrgr Jun 30, 2022
4b7af59
Rollup merge of #98671 - GuillaumeGomez:source-sidebar-fixes, r=notri…
matthiaskrgr Jun 30, 2022
d72908b
Rollup merge of #98677 - lyming2007:issue-98492-fix, r=lcnr
matthiaskrgr Jun 30, 2022
b1ee5c7
Rollup merge of #98684 - matthiaskrgr:ice-test-72793, r=oli-obk
matthiaskrgr Jun 30, 2022
2150a48
Rollup merge of #98688 - RalfJung:from-mplace, r=oli-obk
matthiaskrgr Jun 30, 2022
54e7a63
Rollup merge of #98695 - tshepang:or-pattern, r=compiler-errors
matthiaskrgr Jun 30, 2022
f206c67
Rollup merge of #98706 - flip1995:clippyup, r=Dylan-DPC
matthiaskrgr Jun 30, 2022
94e2d07
Rollup merge of #98708 - pinkforest:rustdoc-fix-98690, r=GuillaumeGomez
matthiaskrgr Jun 30, 2022
d690171
Rollup merge of #98709 - GuillaumeGomez:rm-decl-for-old-browsers, r=D…
matthiaskrgr Jun 30, 2022
4bd8c92
Rollup merge of #98717 - RalfJung:make-tidy-less-annoying, r=jyn514
matthiaskrgr Jun 30, 2022
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
Prev Previous commit
Next Next commit
Move/rename lazy::Sync{OnceCell,Lazy} to sync::{Once,Lazy}Lock
  • Loading branch information
WaffleLapkin committed Jun 16, 2022
commit f095f802dcd0f5ead14539c3f11985b4a3562912
6 changes: 3 additions & 3 deletions clippy_dev/src/bless.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
use crate::cargo_clippy_path;
use std::ffi::OsStr;
use std::fs;
use std::lazy::SyncLazy;
use std::path::{Path, PathBuf};
use std::sync::LazyLock;
use walkdir::{DirEntry, WalkDir};

static CLIPPY_BUILD_TIME: SyncLazy<Option<std::time::SystemTime>> =
SyncLazy::new(|| cargo_clippy_path().metadata().ok()?.modified().ok());
static CLIPPY_BUILD_TIME: LazyLock<Option<std::time::SystemTime>> =
LazyLock::new(|| cargo_clippy_path().metadata().ok()?.modified().ok());

/// # Panics
///
Expand Down
4 changes: 2 additions & 2 deletions clippy_utils/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ pub use self::hir_utils::{both, count_eq, eq_expr_value, over, SpanlessEq, Spanl

use std::collections::hash_map::Entry;
use std::hash::BuildHasherDefault;
use std::lazy::SyncOnceCell;
use std::sync::OnceLock;
use std::sync::{Mutex, MutexGuard};

use if_chain::if_chain;
Expand Down Expand Up @@ -2078,7 +2078,7 @@ pub fn is_hir_ty_cfg_dependant(cx: &LateContext<'_>, ty: &hir::Ty<'_>) -> bool {
false
}

static TEST_ITEM_NAMES_CACHE: SyncOnceCell<Mutex<FxHashMap<LocalDefId, Vec<Symbol>>>> = SyncOnceCell::new();
static TEST_ITEM_NAMES_CACHE: OnceLock<Mutex<FxHashMap<LocalDefId, Vec<Symbol>>>> = OnceLock::new();

fn with_test_item_names<'tcx>(tcx: TyCtxt<'tcx>, module: LocalDefId, f: impl Fn(&[Symbol]) -> bool) -> bool {
let cache = TEST_ITEM_NAMES_CACHE.get_or_init(|| Mutex::new(FxHashMap::default()));
Expand Down
6 changes: 3 additions & 3 deletions src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@ use rustc_tools_util::VersionInfo;

use std::borrow::Cow;
use std::env;
use std::lazy::SyncLazy;
use std::ops::Deref;
use std::panic;
use std::path::{Path, PathBuf};
use std::process::{exit, Command};
use std::sync::LazyLock;

/// If a command-line option matches `find_arg`, then apply the predicate `pred` on its value. If
/// true, then return it. The parameter is assumed to be either `--arg=value` or `--arg value`.
Expand Down Expand Up @@ -152,7 +152,7 @@ You can use tool lints to allow or deny lints from your code, eg.:

const BUG_REPORT_URL: &str = "https://github.com/rust-lang/rust-clippy/issues/new";

static ICE_HOOK: SyncLazy<Box<dyn Fn(&panic::PanicInfo<'_>) + Sync + Send + 'static>> = SyncLazy::new(|| {
static ICE_HOOK: LazyLock<Box<dyn Fn(&panic::PanicInfo<'_>) + Sync + Send + 'static>> = LazyLock::new(|| {
let hook = panic::take_hook();
panic::set_hook(Box::new(|info| report_clippy_ice(info, BUG_REPORT_URL)));
hook
Expand Down Expand Up @@ -219,7 +219,7 @@ fn toolchain_path(home: Option<String>, toolchain: Option<String>) -> Option<Pat
#[allow(clippy::too_many_lines)]
pub fn main() {
rustc_driver::init_rustc_env_logger();
SyncLazy::force(&ICE_HOOK);
LazyLock::force(&ICE_HOOK);
exit(rustc_driver::catch_with_exit_code(move || {
let mut orig_args: Vec<String> = env::args().collect();

Expand Down
4 changes: 2 additions & 2 deletions tests/compile-test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ use std::env::{self, remove_var, set_var, var_os};
use std::ffi::{OsStr, OsString};
use std::fs;
use std::io;
use std::lazy::SyncLazy;
use std::path::{Path, PathBuf};
use std::sync::LazyLock;
use test_utils::IS_RUSTC_TEST_SUITE;

mod test_utils;
Expand Down Expand Up @@ -69,7 +69,7 @@ extern crate tokio;
/// dependencies must be added to Cargo.toml at the project root. Test
/// dependencies that are not *directly* used by this test module require an
/// `extern crate` declaration.
static EXTERN_FLAGS: SyncLazy<String> = SyncLazy::new(|| {
static EXTERN_FLAGS: LazyLock<String> = LazyLock::new(|| {
let current_exe_depinfo = {
let mut path = env::current_exe().unwrap();
path.set_extension("d");
Expand Down
4 changes: 2 additions & 2 deletions tests/test_utils/mod.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#![allow(dead_code)] // see https://github.com/rust-lang/rust/issues/46379

use std::lazy::SyncLazy;
use std::path::PathBuf;
use std::sync::LazyLock;

pub static CARGO_CLIPPY_PATH: SyncLazy<PathBuf> = SyncLazy::new(|| {
pub static CARGO_CLIPPY_PATH: LazyLock<PathBuf> = LazyLock::new(|| {
let mut path = std::env::current_exe().unwrap();
assert!(path.pop()); // deps
path.set_file_name("cargo-clippy");
Expand Down