-------------------------------------------------------------------------------- Profile data file 'results/clgout-nightly-2026-08-14-unicode-normalization-0.1.24-Clippy-Full-Threads1' (creator: callgrind-3.25.1) -------------------------------------------------------------------------------- I1 cache: D1 cache: LL cache: Timerange: Basic block 0 - 400156255 Trigger: Program termination Profiled target: /home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver --crate-name unicode_normalization --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 --cfg feature="default" --cfg feature="std" --check-cfg cfg(docsrs,test) --check-cfg cfg(feature, values("default", "std")) -C metadata=82115397b5a3d871 -C extra-filename=-31f33c6ff05144b9 --out-dir /tmp/.tmpZLX85M/target/debug/deps -L dependency=/tmp/.tmpZLX85M/target/debug/deps --extern tinyvec=/tmp/.tmpZLX85M/target/debug/deps/libtinyvec-57a1765d8309960d.rmeta -Wclippy::all -Zthreads=1 -Adeprecated -Aunknown-lints -Zincremental-verify-ich (PID 728479, part 1) Events recorded: Ir Events shown: Ir Event sort order: Ir Thresholds: 99 Include dirs: User annotated: Auto-annotation: on -------------------------------------------------------------------------------- Ir -------------------------------------------------------------------------------- 2,149,564,047 (100.0%) PROGRAM TOTALS -------------------------------------------------------------------------------- Ir file:function -------------------------------------------------------------------------------- 96,518,778 ( 4.49%) ???:rustc_pattern_analysis::usefulness::compute_exhaustiveness_and_usefulness::::{closure#0}'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 59,393,088 ( 2.76%) site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 51,925,825 ( 2.42%) ???:::advance_token [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 48,925,712 ( 2.28%) ???:>::copy_op_no_validate:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 48,277,223 ( 2.25%) ???:::test_candidates'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 41,360,048 ( 1.92%) ???:>::with::<::with::outer_expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 35,455,463 ( 1.65%) ???:::from_token_lit [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 34,398,875 ( 1.60%) ???:::visit_body'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 31,457,704 ( 1.46%) ???:::as_operand'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 30,669,682 ( 1.43%) ???:0x0000000000173dc0 [/usr/lib/libc.so.6] 26,829,152 ( 1.25%) ???:>::eval_rvalue_into_place'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 24,087,245 ( 1.12%) ???:::collect_tokens_for_expr::<::parse_expr_dot_or_call::{closure#0}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 24,032,621 ( 1.12%) ???:::visit_node_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 22,345,334 ( 1.04%) ???:::next_token_from_cursor [???] 21,806,263 ( 1.01%) ???:::stable_hash::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 21,118,476 ( 0.98%) ???: as rustc_ast::visit::Visitor>::visit_expr'2 [???] 20,617,260 ( 0.96%) ???: as rustc_const_eval::interpret::visitor::ValueVisitor>::walk_value'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 19,513,765 ( 0.91%) ???:>::encode [???] 18,336,162 ( 0.85%) ???:::fully_perform_op::>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 18,287,742 ( 0.85%) ???:::parent_hir_node [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 17,851,586 ( 0.83%) ???:>::try_visit_primitive [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 17,740,827 ( 0.83%) ???:::next [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 17,274,904 ( 0.80%) ???:::span_to_snippet [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 16,413,205 ( 0.76%) ???:::check_expr [???] 15,333,308 ( 0.71%) ???:::check_expr_with_expectation_and_args'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 14,487,210 ( 0.67%) include/jemalloc/internal/rtree.h:free 13,410,934 ( 0.62%) ???:::visit_body [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 12,680,432 ( 0.59%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::first_node_in_macro:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 12,579,430 ( 0.59%) ???:::coerce [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 12,573,759 ( 0.58%) ???:rustc_middle::ty::util::needs_drop_components_with_async [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 12,518,370 ( 0.58%) ???:::lower_expr_mut'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 12,191,718 ( 0.57%) ???:::in_external_macro [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 11,913,032 ( 0.55%) ???:::lookup_byte_offset [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 11,907,570 ( 0.55%) ???:>::push [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 11,581,629 ( 0.54%) ???:rustc_borrowck::borrowck_check_region_constraints [???] 10,753,273 ( 0.50%) ???:::clone [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 10,648,523 ( 0.50%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 10,522,156 ( 0.49%) include/jemalloc/internal/rtree.h:tcache_bin_flush_small 9,797,959 ( 0.46%) ???:::test_candidates [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 9,405,878 ( 0.44%) ???:>::encode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 9,393,919 ( 0.44%) ???:rustc_mir_transform::simplify::simplify_cfg [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 9,121,495 ( 0.42%) ???:::hir_attrs [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 8,998,593 ( 0.42%) ???:rustc_borrowck::get_flow_results [???] 8,949,912 ( 0.42%) ???:rustc_hir_analysis::check::region::resolve_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 8,928,860 ( 0.42%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 8,636,262 ( 0.40%) /rustc/84b36a78a28a63f134171c670be1932ffa2485f8/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/build/tikv-jemalloc-sys/80122c672fbe49ef/out/build/src/tcache.c:tcache_bin_flush_small [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 8,480,452 ( 0.39%) /rustc/84b36a78a28a63f134171c670be1932ffa2485f8/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/build/tikv-jemalloc-sys/80122c672fbe49ef/out/build/src/jemalloc.c:free 8,380,617 ( 0.39%) ???:::lex_token_trees'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 8,068,772 ( 0.38%) include/jemalloc/internal/jemalloc_internal_inlines_c.h:malloc [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 7,975,044 ( 0.37%) ???:::short_write_process_buffer::<8> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 7,796,375 ( 0.36%) ???:::to [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 7,738,488 ( 0.36%) src/arena.c:malloc_default 7,708,007 ( 0.36%) ???:>::read_scalar [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 7,581,499 ( 0.35%) ???:::mirror_expr_inner [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 7,335,281 ( 0.34%) ???:::qualif_local::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 7,103,360 ( 0.33%) ???:>::process_obligations:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,987,476 ( 0.33%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,822,030 ( 0.32%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,745,776 ( 0.31%) ???:md5::compress::soft::compress [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,711,738 ( 0.31%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,637,712 ( 0.31%) ???:::desugaring_kind [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,592,015 ( 0.31%) ???:::bump_minimal [???] 6,519,906 ( 0.30%) ???:::intern_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,426,010 ( 0.30%) ???: as rustc_hir::intravisit::Visitor>::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,306,416 ( 0.29%) ???:::intern_predicate [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,204,990 ( 0.29%) ???:::run_pass [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,190,212 ( 0.29%) ???:::mirror_expr_inner'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,082,548 ( 0.28%) ???:>::visit_with:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,909,566 ( 0.27%) ???:::compute_and_check_or_pat_binding_map [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,889,995 ( 0.27%) ???:rustc_middle::ty::codec::encode_with_shorthand::::type_shorthands> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,874,894 ( 0.27%) ???: as rustc_hir::intravisit::Visitor>::visit_expr::{closure#0}::{closure#0}'2 [???] 5,809,681 ( 0.27%) ???:rustc_middle::ty::util::needs_drop_components_with_async'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,747,586 ( 0.27%) ???:::end_point [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,680,168 ( 0.26%) ???:>>::walk_ref'2 [???] 5,653,847 ( 0.26%) ???: as rustc_ast::visit::Visitor>::visit_id [???] 5,636,070 ( 0.26%) include/jemalloc/internal/cache_bin.h:malloc 5,546,233 ( 0.26%) site/frontend/rust-clippy/clippy_lints/src/combined_early_pass.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 5,502,050 ( 0.26%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:clippy_utils::macros::first_node_in_macro:: 5,489,270 ( 0.26%) ???: as rustc_hir::intravisit::Visitor>::visit_expr'2 [???] 5,321,086 ( 0.25%) ???:::as_temp::{closure#0}'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,315,509 ( 0.25%) ???:::parse_expr_array_or_repeat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,295,811 ( 0.25%) ???:rustc_mir_transform::liveness::check_liveness::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,280,442 ( 0.25%) ???:::check_expr [???] 5,242,241 ( 0.24%) ???:::qualif_local::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,239,648 ( 0.24%) ???:::as_constant [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,219,256 ( 0.24%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,087,708 ( 0.24%) ???:::check_attributes [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,079,720 ( 0.24%) include/jemalloc/internal/cache_bin.h:free 4,600,744 ( 0.21%) site/frontend/rust-clippy/clippy_lints/src/literal_representation.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 4,522,244 ( 0.21%) ???:>::size_and_align_from_meta [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,436,714 ( 0.21%) ???:::promote_temp'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,418,225 ( 0.21%) ???:rustc_borrowck::type_check::liveness::generate [???] 4,406,802 ( 0.21%) site/frontend/rust-clippy/clippy_lints/src/doc/mod.rs:::check_attributes [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 4,377,036 ( 0.20%) include/jemalloc/internal/emap.h:tcache_bin_flush_small 4,322,362 ( 0.20%) ???: as rustc_const_eval::interpret::visitor::ValueVisitor>::visit_value'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,320,101 ( 0.20%) ???:rustc_lint::types::literal::lint_literal [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,312,478 ( 0.20%) ???:::run_pass [???] 4,222,476 ( 0.20%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,218,706 ( 0.20%) ???:::parse_expr_assoc_with'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,107,692 ( 0.19%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,070,757 ( 0.19%) ???:::super_body_preserves_cfg [???] 4,034,875 ( 0.19%) include/jemalloc/internal/sz.h:malloc 3,907,242 ( 0.18%) ???:stacker::remaining_stack [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,833,454 ( 0.18%) ???:::qualif_local:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,832,399 ( 0.18%) include/jemalloc/internal/edata.h:tcache_bin_flush_small 3,792,516 ( 0.18%) ???:::hir_node [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,731,632 ( 0.17%) ???:::do_mir_borrowck [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,676,164 ( 0.17%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,628,102 ( 0.17%) ???: as rustc_const_eval::interpret::visitor::ValueVisitor>::walk_value [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,612,965 ( 0.17%) ???:::expr_into_dest'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,611,072 ( 0.17%) ???:>::compress::<>::to_errors::{closure#2}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,607,638 ( 0.17%) ???:::check_expr_tuple [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,555,090 ( 0.17%) ???:::visit_const_operand'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,553,671 ( 0.17%) ???:core::ptr::drop_glue::> [???] 3,514,200 ( 0.16%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 3,506,097 ( 0.16%) ???:::in_any_value_of_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,441,488 ( 0.16%) ???:0x000000000000fb40 [/usr/lib/ld-linux-x86-64.so.2] 3,440,882 ( 0.16%) ???:::run_pass [???] 3,346,118 ( 0.16%) ???:::take [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,343,888 ( 0.16%) ???:::process_obligation [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,331,612 ( 0.15%) site/frontend/rust-clippy/clippy_lints/src/misc_early/mod.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 3,268,381 ( 0.15%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,174,551 ( 0.15%) ???:::check_expr_tuple'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,168,850 ( 0.15%) site/frontend/rust-clippy/clippy_lints/src/misc.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 3,122,684 ( 0.15%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,109,745 ( 0.14%) ???:::resolve_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,065,829 ( 0.14%) ???:::fully_perform_op::<(), rustc_middle::ty::ParamEnvAnd> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,054,437 ( 0.14%) ???:pthread_mutex_unlock [/usr/lib/libc.so.6] 2,995,804 ( 0.14%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,943,766 ( 0.14%) ???:rustc_hir::intravisit::walk_expr::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,898,290 ( 0.13%) ???:::expect_hir_owner_nodes [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,890,236 ( 0.13%) site/frontend/rust-clippy/clippy_lints/src/casts/mod.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,889,331 ( 0.13%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,810,789 ( 0.13%) site/frontend/rust-clippy/clippy_lints/src/casts/cast_slice_different_sizes.rs:clippy_lints::casts::cast_slice_different_sizes::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,799,113 ( 0.13%) include/jemalloc/internal/arena_inlines_b.h:tcache_bin_flush_small 2,753,593 ( 0.13%) ???:0x00000000001747c0 [/usr/lib/libc.so.6] 2,730,269 ( 0.13%) ???:memchr::arch::x86_64::memchr::memchr_raw::find_avx2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,693,624 ( 0.13%) ???:::match_candidates'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,687,920 ( 0.13%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,663,868 ( 0.12%) site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,647,580 ( 0.12%) ???:pthread_mutex_trylock [/usr/lib/libc.so.6] 2,638,348 ( 0.12%) ???:>::write_discriminant:: [???] 2,616,788 ( 0.12%) ???:>::walk_mut'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,608,624 ( 0.12%) ???:::unescape_1 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,553,344 ( 0.12%) ???:::run_lint [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,545,672 ( 0.12%) ???:::as_rvalue'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,538,094 ( 0.12%) site/frontend/rust-clippy/clippy_lints/src/unit_types/unit_arg.rs:clippy_lints::unit_types::unit_arg::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,521,476 ( 0.12%) ???:::run_lint [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,488,132 ( 0.12%) ???:::is_inhabited_ty'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,481,542 ( 0.12%) site/frontend/rust-clippy/clippy_lints/src/misc_early/mixed_case_hex_literals.rs:clippy_lints::misc_early::mixed_case_hex_literals::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,474,089 ( 0.12%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,398,578 ( 0.11%) site/frontend/rust-clippy/clippy_lints/src/byte_char_slices.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,391,754 ( 0.11%) ???:::run_pass [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,372,284 ( 0.11%) include/jemalloc/internal/thread_event.h:malloc 2,319,270 ( 0.11%) ???:rustc_hir_analysis::check::region::resolve_local::record_rvalue_scope_if_borrow_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,300,706 ( 0.11%) ???:core::slice::memchr::memrchr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,295,159 ( 0.11%) ???:::stable_hash_span [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,281,296 ( 0.11%) ???:>::walk_mut'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,269,171 ( 0.11%) site/frontend/rust-clippy/clippy_lints/src/loops/mod.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,265,989 ( 0.11%) ???:::parse_expr_prefix'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,264,774 ( 0.11%) ???:>::push_stack_frame_done [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,244,960 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/literal_representation.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,236,548 ( 0.10%) ???:::resolve_ident_in_scope_set_inner [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,171,682 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/matches/mod.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,163,124 ( 0.10%) ???:::instantiate_value_path [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,151,900 ( 0.10%) include/jemalloc/internal/bitmap.h:tcache_bin_flush_small 2,148,015 ( 0.10%) ???:::run_lint [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,144,404 ( 0.10%) include/jemalloc/internal/bit_util.h:malloc_default 2,141,031 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/operators/mod.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,138,354 ( 0.10%) ???:rustc_hir::intravisit::walk_expr::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,124,966 ( 0.10%) ???:rustc_hir::intravisit::walk_expr::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,111,416 ( 0.10%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,111,305 ( 0.10%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,111,305 ( 0.10%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,111,305 ( 0.10%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,070,180 ( 0.10%) site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,069,206 ( 0.10%) ???:::range_span [???] 2,068,289 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/dereference.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,061,713 ( 0.10%) ???:::has_trivial_sizedness [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,061,084 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/redundant_async_block.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,059,864 ( 0.10%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:clippy_utils::in_automatically_derived 2,050,124 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/macro_metavars_in_unsafe.rs:::visit_expr'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,041,650 ( 0.09%) ???:>::ty_and_layout_field::field_ty_or_layout::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,018,218 ( 0.09%) ???:rustc_mir_transform::mir_promoted [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,011,170 ( 0.09%) site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::get_source_range [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,995,291 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/strings.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,983,130 ( 0.09%) ???:::is_trivially_freeze [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,965,669 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/raw_strings.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,945,521 ( 0.09%) ???:::check_expr_array [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,928,181 ( 0.09%) ???:::rollback_to [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,926,102 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/repeat_vec_with_capacity.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,922,294 ( 0.09%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,904,314 ( 0.09%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,855,128 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/manual_option_as_slice.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,842,739 ( 0.09%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,840,417 ( 0.09%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_expr::>'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,838,028 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/formatting.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,837,868 ( 0.09%) ???:rustc_hir::intravisit::walk_expr::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,837,500 ( 0.09%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,837,265 ( 0.09%) ???:rustc_hir::intravisit::walk_expr::<::collect_taits_declared_in_body::TaitInBodyFinder>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,819,613 ( 0.08%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/iter.rs:>::next_back [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,808,675 ( 0.08%) site/frontend/rust-clippy/clippy_utils/src/numeric_literal.rs:::new [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,808,160 ( 0.08%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_expr::'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,790,119 ( 0.08%) site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,788,229 ( 0.08%) site/frontend/rust-clippy/clippy_lints/src/ranges.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,787,810 ( 0.08%) site/frontend/rust-clippy/clippy_lints/src/regex.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,773,500 ( 0.08%) site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs:::check_attributes [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,769,831 ( 0.08%) ???:::filter_map_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,760,441 ( 0.08%) ???:>::gather_move [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,728,393 ( 0.08%) site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,728,332 ( 0.08%) ???:rust_psm_stack_pointer [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,727,616 ( 0.08%) site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::if_statement_binops [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,725,595 ( 0.08%) ???:>::tys [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,722,928 ( 0.08%) site/frontend/rust-clippy/clippy_lints/src/useless_conversion.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,717,178 ( 0.08%) site/frontend/rust-clippy/clippy_lints/src/redundant_slicing.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,714,390 ( 0.08%) site/frontend/rust-clippy/clippy_lints/src/octal_escapes.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,708,693 ( 0.08%) site/frontend/rust-clippy/clippy_lints/src/attrs/mod.rs:::check_attributes [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,705,741 ( 0.08%) ???:core::ptr::drop_glue::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,702,340 ( 0.08%) include/jemalloc/internal/sz.h:free 1,690,831 ( 0.08%) site/frontend/rust-clippy/clippy_lints/src/incompatible_msrv.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,690,432 ( 0.08%) ???:0x000000000000ba80 [/usr/lib/ld-linux-x86-64.so.2] 1,668,733 ( 0.08%) ???:::visit_basic_block_data [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,668,022 ( 0.08%) site/frontend/rust-clippy/clippy_lints/src/legacy_numeric_constants.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,658,544 ( 0.08%) ???:::normalize_and_prove_instantiated_clauses [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,649,817 ( 0.08%) site/frontend/rust-clippy/clippy_lints/src/if_let_mutex.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,649,808 ( 0.08%) site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs:::check_expr_post [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,649,808 ( 0.08%) site/frontend/rust-clippy/clippy_lints/src/format.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,649,768 ( 0.08%) site/frontend/rust-clippy/clippy_lints/src/ifs/mod.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,619,971 ( 0.08%) ???:>::walk_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,614,115 ( 0.08%) ???:::resolve_path [???] 1,613,925 ( 0.08%) include/jemalloc/internal/div.h:tcache_bin_flush_small 1,607,912 ( 0.07%) include/jemalloc/internal/cache_bin.h:malloc_default 1,606,372 ( 0.07%) ???:rustc_resolve::rustdoc::unindent_doc_fragments [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,596,820 ( 0.07%) ???:::lint_level_spec_at_node [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,585,176 ( 0.07%) site/frontend/rust-clippy/clippy_lints/src/double_parens.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,584,706 ( 0.07%) site/frontend/rust-clippy/clippy_lints/src/precedence.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,583,400 ( 0.07%) site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::append_opt_vecs:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,582,086 ( 0.07%) site/frontend/rust-clippy/clippy_lints/src/needless_nonzero_get.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,580,955 ( 0.07%) site/frontend/rust-clippy/clippy_lints/src/bit_width.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,570,756 ( 0.07%) ???:::is_inhabited_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,569,378 ( 0.07%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,556,194 ( 0.07%) ???:>::reserve_rehash::<::intern_inner::{closure#0}::{closure#1}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,545,600 ( 0.07%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/spec_from_iter_nested.rs: as alloc::vec::spec_from_iter_nested::SpecFromIterNested, ::len>>>::from_iter [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,515,469 ( 0.07%) site/frontend/rust-clippy/clippy_lints/src/len_zero.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,515,420 ( 0.07%) site/frontend/rust-clippy/clippy_lints/src/redundant_closure_call.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,514,686 ( 0.07%) site/frontend/rust-clippy/clippy_lints/src/manual_is_ascii_check.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,514,590 ( 0.07%) ???:::short_write_process_buffer::<4> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,513,378 ( 0.07%) site/frontend/rust-clippy/clippy_lints/src/bool_comparison.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,512,770 ( 0.07%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::fn_def_id_with_node_args [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,512,700 ( 0.07%) site/frontend/rust-clippy/clippy_lints/src/manual_main_separator_str.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,512,498 ( 0.07%) site/frontend/rust-clippy/clippy_lints/src/unnecessary_mut_passed.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,512,418 ( 0.07%) ???:>::fold_predicate [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,512,349 ( 0.07%) site/frontend/rust-clippy/clippy_lints/src/match_result_ok.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,510,029 ( 0.07%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::in_automatically_derived [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,509,072 ( 0.07%) ???:::short_write_process_buffer::<1> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,500,110 ( 0.07%) ???:>::walk_mut'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,496,682 ( 0.07%) ???:::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,485,820 ( 0.07%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:::check_attributes 1,475,451 ( 0.07%) site/frontend/rust-clippy/clippy_utils/src/numeric_literal.rs:::from_lit_kind [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,470,892 ( 0.07%) ???:core::ptr::drop_glue::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,464,698 ( 0.07%) ???:rustc_middle::ty::trait_def::trait_impls_of_provider [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,457,814 ( 0.07%) ???:0x0000000000173660 [/usr/lib/libc.so.6] 1,457,750 ( 0.07%) ???:::filter_map_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,445,516 ( 0.07%) site/frontend/rust-clippy/clippy_lints/src/strlen_on_c_strings.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,443,918 ( 0.07%) site/frontend/rust-clippy/clippy_lints/src/manual_clamp.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,443,845 ( 0.07%) site/frontend/rust-clippy/clippy_lints/src/nonnull_unchecked_on_box_ptr.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,443,630 ( 0.07%) site/frontend/rust-clippy/clippy_lints/src/partialeq_to_none.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,443,606 ( 0.07%) site/frontend/rust-clippy/clippy_lints/src/utils/author.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,443,606 ( 0.07%) site/frontend/rust-clippy/clippy_lints/src/utils/dump_hir.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,443,582 ( 0.07%) site/frontend/rust-clippy/clippy_lints/src/operators/eq_op.rs:clippy_lints::operators::eq_op::check_assert [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,443,582 ( 0.07%) site/frontend/rust-clippy/clippy_lints/src/useless_vec.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,443,233 ( 0.07%) site/frontend/rust-clippy/clippy_lints/src/unit_types/unit_cmp.rs:clippy_lints::unit_types::unit_cmp::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,437,733 ( 0.07%) ???:::lower_qpath [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,411,529 ( 0.07%) site/frontend/rust-clippy/clippy_lints/src/combined_early_pass.rs:::check_attributes [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,411,529 ( 0.07%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:::check_attributes_post 1,381,394 ( 0.06%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::root_macro_call [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,377,825 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/minmax.rs:clippy_lints::minmax::min_max [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,374,914 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/unnecessary_map_on_constructor.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,350,926 ( 0.06%) ???:::lower_expr_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,342,415 ( 0.06%) ???:::qualif_local:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,333,791 ( 0.06%) ???:>>::drop_slow'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,324,499 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/disallowed_fields.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,321,416 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/float_literal.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,320,092 ( 0.06%) ???:::try_find_coercion_lub [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,313,949 ( 0.06%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:clippy_utils::macros::root_macro_call 1,307,473 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/zombie_processes.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,306,306 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/default.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,306,179 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/needless_bool.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,306,132 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/single_range_in_vec_init.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,305,721 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/casts/cast_slice_different_sizes.rs:clippy_lints::casts::cast_slice_different_sizes::expr_cast_chain_tys [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,286,237 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,276,937 ( 0.06%) site/frontend/rust-clippy/clippy_utils/src/attrs.rs:clippy_utils::attrs::parse_attrs::<::pop_attrs::{closure#0}, rustc_hir::hir::Attribute> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,276,937 ( 0.06%) site/frontend/rust-clippy/clippy_utils/src/attrs.rs:clippy_utils::attrs::parse_attrs::<::push_attrs::{closure#0}, rustc_hir::hir::Attribute> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,276,475 ( 0.06%) ???:::build [???] 1,263,136 ( 0.06%) ???:::decode_span [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,249,611 ( 0.06%) /rustc/84b36a78a28a63f134171c670be1932ffa2485f8/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/build/tikv-jemalloc-sys/80122c672fbe49ef/out/build/src/tcache.c:tcache_bin_flush_stashed [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,245,869 ( 0.06%) ???:>::drop_slow [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,242,421 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/infinite_iter.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,241,449 ( 0.06%) ???:>::super_fold_with:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,239,349 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/manual_pop_if.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,238,825 ( 0.06%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::matching_root_macro_call [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,238,802 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/format_impl.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,238,167 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/needless_borrows_for_generic_args.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,238,106 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/blocks_in_conditions.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,237,951 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/useless_concat.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,237,874 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/manual_ignore_case_cmp.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,237,800 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/swap_ptr_to_ref.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,237,790 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/block_scrutinee.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,237,573 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/implicit_saturating_sub.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,237,560 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/reserve_after_initialization.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,237,510 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/entry.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,237,479 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/manual_take.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,237,470 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/manual_abs_diff.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,237,392 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/await_holding_invalid.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,237,356 ( 0.06%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/map.rs:, clippy_utils::macros::first_node_macro_backtrace::{closure#0}> as core::iter::traits::iterator::Iterator>::try_fold::<(), >::iter_try_fold::flatten, clippy_utils::macros::macro_backtrace::{closure#0}>, clippy_utils::macros::first_node_macro_backtrace::{closure#0}::{closure#0}>, (), core::ops::control_flow::ControlFlow, as core::iter::traits::iterator::Iterator>::try_fold::flatten, clippy_utils::macros::macro_backtrace::{closure#0}>, clippy_utils::macros::first_node_macro_backtrace::{closure#0}::{closure#0}>, (), core::ops::control_flow::ControlFlow, core::iter::traits::iterator::Iterator::find::check::{closure#0}>::{closure#0}>::{closure#0}, core::ops::control_flow::ControlFlow> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,237,356 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/assertions_on_constants.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,237,356 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/format_args.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,237,356 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/write/mod.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,237,356 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/zero_repeat_side_effects.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,225,483 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/unused_rounding.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,224,493 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/utils/format_args_collector.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,218,493 ( 0.06%) include/jemalloc/internal/sz.h:realloc 1,213,249 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/non_copy_const.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,210,591 ( 0.06%) /rustc/84b36a78a28a63f134171c670be1932ffa2485f8/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/build/tikv-jemalloc-sys/80122c672fbe49ef/out/build/src/jemalloc.c:calloc [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,207,558 ( 0.06%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:::check_attributes 1,205,980 ( 0.06%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/spec_from_iter_nested.rs: as alloc::vec::spec_from_iter_nested::SpecFromIterNested<(rustc_span::span_encoding::Span, alloc::string::String), core::iter::adapters::filter_map::FilterMap, clippy_lints::doc::suspicious_doc_comments::collect_doc_replacements::{closure#0}>>>::from_iter [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,205,980 ( 0.06%) site/frontend/rust-clippy/clippy_lints/src/doc/suspicious_doc_comments.rs:clippy_lints::doc::suspicious_doc_comments::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,201,651 ( 0.06%) ???:rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::implementations_of_trait [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,197,405 ( 0.06%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,189,861 ( 0.06%) site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:clippy_utils::msrvs::check_attrs:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,173,971 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/size_of_in_element_count.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,171,603 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/drop_forget_ref.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,171,501 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/transmute/mod.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,171,050 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/unit_return_expecting_ord.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,170,176 ( 0.05%) include/jemalloc/internal/arena_inlines_b.h:malloc_default 1,169,918 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/arc_with_non_send_sync.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,169,898 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/box_default.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,169,878 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/from_raw_with_void_ptr.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,169,508 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/indexing_slicing.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,169,387 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/collapsible_if.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,169,231 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/panicking_overflow_checks.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,169,197 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/default_constructed_unit_structs.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,169,192 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/mem_replace.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,169,175 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/manual_checked_ops.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,169,142 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/default_instead_of_iter_empty.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,169,140 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/manual_rotate.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,169,090 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/implicit_saturating_add.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,169,063 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/from_str_radix_10.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,169,036 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/manual_float_methods.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,169,027 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/replace_box.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,168,996 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/to_digit_is_some.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,168,990 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/explicit_write.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,168,990 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/strings.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,168,981 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/manual_bits.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,168,898 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/unnecessary_owned_empty_strings.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,168,844 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/cloned_ref_to_slice_refs.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,168,810 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/manual_slice_size_calculation.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,168,725 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,168,703 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/manual_rem_euclid.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,168,688 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/string_patterns.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,168,650 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/async_yields_async.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,168,614 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/bool_assert_comparison.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,168,614 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/minmax.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,168,614 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/neg_cmp_op_on_partial_ord.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,168,614 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/operators/float_cmp.rs:clippy_lints::operators::float_cmp::check_assert [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,168,614 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/rc_clone_in_vec_init.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,168,138 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/reference.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,365 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/doc/mod.rs:::check_attributes [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,214 ( 0.05%) ???:>::compress::<>::process_obligations::{closure#1}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,101,424 ( 0.05%) ???:::ensure_source_file_source_present [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,100,136 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/init_numbered_fields.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,099,928 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/manual_strip.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,096,480 ( 0.05%) ???:::node [???] 1,094,322 ( 0.05%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lexer/src/lib.rs:::with_source_text::::{closure#0}> 1,087,775 ( 0.05%) ???:::run_pass [???] 1,087,447 ( 0.05%) ???:0x000000000000aec0 [/usr/lib/ld-linux-x86-64.so.2] 1,080,843 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/int_plus_one.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,075,950 ( 0.05%) include/jemalloc/internal/util.h:tcache_bin_flush_small 1,071,703 ( 0.05%) ???:>::reserve_rehash::, rustc_middle::mir::interpret::allocation::Allocation)>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,065,461 ( 0.05%) ???:::hir_span [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,065,444 ( 0.05%) ???:::make_owner_info [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,042,736 ( 0.05%) ???:::renumber_regions::visit_const_operand::{closure#0}>::{closure#0}> as rustc_type_ir::fold::TypeFolder>::fold_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,039,473 ( 0.05%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,037,295 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/only_used_in_recursion.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,033,908 ( 0.05%) ???:rustc_mir_transform::deref_separator::deref_finder [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,031,617 ( 0.05%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,031,598 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/casts/ptr_cast_constness.rs:clippy_lints::casts::ptr_cast_constness::check_null_ptr_cast_method [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,031,458 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/borrow_deref_ref.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,031,238 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/zero_div_zero.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,029,781 ( 0.05%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 1,027,560 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/loops/while_let_on_iterator.rs:clippy_lints::loops::while_let_on_iterator::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,025,103 ( 0.05%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/memchr.rs:::check_expr 1,020,462 ( 0.05%) ???: as rustc_mir_transform::pass_manager::MirPass>::run_pass [???] 1,018,764 ( 0.05%) site/frontend/rust-clippy/clippy_lints/src/unicode.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,011,509 ( 0.05%) ???:::hir_span_with_body [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,009,183 ( 0.05%) ???:::iterate_to_fixpoint [???] 1,008,642 ( 0.05%) ???:::consume_operand [???] 1,005,443 ( 0.05%) include/jemalloc/internal/rtree.h:pa_alloc 1,001,196 ( 0.05%) ???:::call_once_force::<>>::initialize<>>::get_or_init<::reverse_postorder::{closure#0}>::{closure#0}, !>::{closure#0}>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 989,829 ( 0.05%) ???:rustc_query_impl::execution::try_execute_query::>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 989,029 ( 0.05%) include/jemalloc/internal/ph.h:pa_alloc 985,375 ( 0.05%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/memchr.rs: as alloc::vec::spec_from_iter_nested::SpecFromIterNested, ::len>>>::from_iter 976,877 ( 0.05%) ???:::set_range [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 974,455 ( 0.05%) ???:::mirror_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 972,947 ( 0.05%) ???:rustc_hir::hir::is_range_literal [???] 968,931 ( 0.05%) ???:::decode_span'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 965,783 ( 0.04%) site/frontend/rust-clippy/clippy_lints/src/combined_early_pass.rs:::check_attributes_post [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 965,435 ( 0.04%) site/frontend/rust-clippy/clippy_lints/src/non_octal_unix_permissions.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 962,820 ( 0.04%) ???:thin_vec::drop_non_singleton::>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 959,571 ( 0.04%) ???:rustc_pattern_analysis::usefulness::compute_exhaustiveness_and_usefulness::::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 954,707 ( 0.04%) ???:core::slice::memchr::memchr_aligned [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 951,470 ( 0.04%) src/arena.c:realloc 950,348 ( 0.04%) /rustc/84b36a78a28a63f134171c670be1932ffa2485f8/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/build/tikv-jemalloc-sys/80122c672fbe49ef/out/build/src/jemalloc.c:malloc_default [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 944,052 ( 0.04%) include/jemalloc/internal/ph.h:tcache_bin_flush_small 929,841 ( 0.04%) ???:::validate_local [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 929,102 ( 0.04%) site/frontend/rust-clippy/clippy_lints/src/misc_early/literal_suffix.rs:clippy_lints::misc_early::literal_suffix::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 894,069 ( 0.04%) site/frontend/rust-clippy/clippy_lints/src/main_recursion.rs:::check_expr_post [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 894,022 ( 0.04%) site/frontend/rust-clippy/clippy_lints/src/casts/cast_ptr_alignment.rs:clippy_lints::casts::cast_ptr_alignment::check_cast_method [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 893,781 ( 0.04%) site/frontend/rust-clippy/clippy_lints/src/manual_retain.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 893,694 ( 0.04%) site/frontend/rust-clippy/clippy_lints/src/needless_update.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 876,401 ( 0.04%) ???:::smart_resolve_path_fragment [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 872,507 ( 0.04%) include/jemalloc/internal/tcache_inlines.h:malloc_default 869,481 ( 0.04%) ???:, rustc_borrowck::handle_placeholders::SccAnnotations>>::construct [???] 866,197 ( 0.04%) src/eset.c:pa_alloc 863,266 ( 0.04%) ???:::assemble_candidates [???] 858,105 ( 0.04%) ???:rustc_const_eval::const_eval::eval_queries::eval_to_allocation_raw_provider'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 852,253 ( 0.04%) include/jemalloc/internal/tsd_tls.h:free [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 852,252 ( 0.04%) include/jemalloc/internal/atomic.h:free 850,656 ( 0.04%) ???:rustc_resolve::rustdoc::span_of_fragments [???] 839,016 ( 0.04%) include/jemalloc/internal/edata.h:pa_alloc 830,166 ( 0.04%) ???: as rustc_type_ir::fold::TypeFolder>::fold_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 828,072 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/attr/version.rs:::meets 827,407 ( 0.04%) ???:::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 826,083 ( 0.04%) /rustc/84b36a78a28a63f134171c670be1932ffa2485f8/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/build/tikv-jemalloc-sys/80122c672fbe49ef/out/build/src/jemalloc.c:realloc [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 824,904 ( 0.04%) site/frontend/rust-clippy/clippy_lints/src/disallowed_methods.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 813,589 ( 0.04%) ???:::instantiate_into [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 790,981 ( 0.04%) include/jemalloc/internal/sz.h:pa_alloc 786,106 ( 0.04%) ???:::expr_guaranteed_to_constitute_read_for_never [???] 773,129 ( 0.04%) ???:::encode_crate_root [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 770,292 ( 0.04%) ???:::validate_local'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 768,239 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 767,426 ( 0.04%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 761,732 ( 0.04%) ???:::intern_const [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 761,709 ( 0.04%) ???:rustc_span::normalize_src [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 758,334 ( 0.04%) /rustc/84b36a78a28a63f134171c670be1932ffa2485f8/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/build/tikv-jemalloc-sys/80122c672fbe49ef/out/build/src/jemalloc.c:malloc 757,266 ( 0.04%) site/frontend/rust-clippy/clippy_lints/src/size_of_ref.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 756,162 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/flatten.rs:clippy_lints::operators::eq_op::check_assert 752,371 ( 0.04%) ???:::expr_as_place'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 736,104 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/pattern.rs:::next_match [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 735,831 ( 0.03%) ???:::confirm_candidate [???] 729,640 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lexer/src/lib.rs:::eq [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 720,149 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 709,400 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/mod.rs:clippy_lints::doc::suspicious_doc_comments::check 687,704 ( 0.03%) site/frontend/rust-clippy/clippy_lints/src/ineffective_open_options.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 687,483 ( 0.03%) ???:::match_impl::{closure#0} [???] 686,034 ( 0.03%) site/frontend/rust-clippy/clippy_lints/src/redundant_async_block.rs:clippy_lints::redundant_async_block::desugar_async_block [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 679,276 ( 0.03%) ???:::compare_with [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 678,064 ( 0.03%) ???:rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::attrs_for_def [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 668,965 ( 0.03%) ???:::get_lint_level_spec [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 667,972 ( 0.03%) ???:>::walk_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 667,436 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/traits.rs:::deref 667,245 ( 0.03%) ???:dladdr [/usr/lib/libc.so.6] 663,773 ( 0.03%) ???:::lower_match_arms [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 659,125 ( 0.03%) include/jemalloc/internal/atomic.h:tcache_bin_flush_small 658,300 ( 0.03%) ???:::get_module_children::{closure#0}, core::result::Result::Ok>, core::result::Result> as core::iter::traits::iterator::Iterator>::next [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 656,880 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/iter.rs: as alloc::vec::spec_from_iter_nested::SpecFromIterNested, ::len>>>::from_iter 648,821 ( 0.03%) site/frontend/rust-clippy/clippy_lints/src/multi_assignments.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 645,358 ( 0.03%) ???:::parse_pat_with_range_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 640,432 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_resolve/src/rustdoc.rs:::check_attributes 639,801 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:::check_attributes 638,460 ( 0.03%) site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs:::check_attributes_post [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 633,522 ( 0.03%) ???:::call_once_force::<>>>::initialize<>>>::get_or_init<::predecessors::{closure#0}>::{closure#0}, !>::{closure#0}>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 633,495 ( 0.03%) ???:rustc_query_impl::execution::try_execute_query::>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 629,126 ( 0.03%) ???:rustc_hir::intravisit::walk_expr:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 619,385 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::check_expr 619,018 ( 0.03%) site/frontend/rust-clippy/clippy_lints/src/permissions_set_readonly_false.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 618,400 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr_post 616,761 ( 0.03%) ???:::next'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 608,662 ( 0.03%) ???:rustc_borrowck::type_check::type_check [???] 592,533 ( 0.03%) ???:::check_expr_match [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 591,277 ( 0.03%) ???:::check_static_ptr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 581,732 ( 0.03%) ???:::insert [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 580,791 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs:>::next_back 578,630 ( 0.03%) ???:::check_expr_call [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 576,309 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 576,232 ( 0.03%) site/frontend/rust-clippy/clippy_lints/src/unnested_or_patterns.rs:::check_expr 572,088 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/traits.rs:::new 571,403 ( 0.03%) ???:::call_once_force::<>, rustc_hash::FxBuildHasher>>>::initialize<>, rustc_hash::FxBuildHasher>>>::get_or_init<::resolutions::{closure#0}>::{closure#0}, !>::{closure#0}>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 569,955 ( 0.03%) ???:::visit_expr::{closure#0}'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 557,951 ( 0.03%) site/frontend/rust-clippy/clippy_utils/src/res.rs:::check_expr 557,918 ( 0.03%) ???:::traits_in_scope [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 555,055 ( 0.03%) include/jemalloc/internal/rtree.h:realloc 551,699 ( 0.03%) ???:>::walk_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 550,346 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 550,262 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 550,142 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 550,142 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 550,142 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 550,142 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 550,142 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 550,142 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 550,142 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 550,142 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 550,142 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 550,142 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 550,142 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 550,142 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:clippy_lints::unit_types::unit_arg::check 550,083 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs:::check_expr 549,904 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 549,904 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 549,904 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:clippy_lints::unit_types::unit_cmp::check 547,173 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cmp.rs:::with_source_text::::{closure#0}> 547,103 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:::with_source_text::::{closure#0}> 540,648 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/char/methods.rs:::trim_start_matches::<::is_whitespace> 539,955 ( 0.03%) ???:::filter_map_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 538,273 ( 0.03%) ???:> as rustc_middle::query::caches::QueryCache>::for_each [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 535,183 ( 0.02%) ???:::lower_pat_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 535,144 ( 0.02%) ???:::encode_def_ids'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 527,146 ( 0.02%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 526,942 ( 0.02%) src/arena.c:calloc 526,394 ( 0.02%) include/jemalloc/internal/thread_event.h:calloc 524,444 ( 0.02%) ???:rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::associated_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 521,356 ( 0.02%) src/base.c:pa_alloc 518,479 ( 0.02%) ???:thin_vec::drop_non_singleton::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 515,366 ( 0.02%) include/jemalloc/internal/cache_bin.h:calloc 514,329 ( 0.02%) ???:::span [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 510,944 ( 0.02%) include/jemalloc/internal/fb.h:pa_alloc 505,209 ( 0.02%) ???:::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 504,187 ( 0.02%) ???:rustc_type_ir::relate::structurally_relate_tys::::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 502,660 ( 0.02%) ???:std::exception::~exception() [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 500,066 ( 0.02%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 498,767 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:::trim_start_matches::<::is_whitespace> 498,270 ( 0.02%) ???:::promote_temp [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 487,727 ( 0.02%) ???:::confirm [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 485,640 ( 0.02%) ???:>::reserve_rehash::, alloc::vec::Vec>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 485,432 ( 0.02%) include/jemalloc/internal/sz.h:malloc_default 482,800 ( 0.02%) ???:::parse_path_segment [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 481,574 ( 0.02%) site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check_expr 481,548 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 481,400 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 481,194 ( 0.02%) site/frontend/rust-clippy/clippy_lints/src/regex.rs:::check_expr_post 481,170 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 479,613 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/filter.rs:clippy_utils::in_automatically_derived 479,528 ( 0.02%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::fn_def_id [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 478,403 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::visit_expr'2 474,461 ( 0.02%) ???:rustc_hir_typeck::typeck_with_inspect::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 463,680 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/map.rs:::check_expr 460,383 ( 0.02%) include/jemalloc/internal/cache_bin.h:tcache_bin_flush_stashed 459,801 ( 0.02%) ???:rustc_query_impl::execution::try_execute_query::>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 458,902 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:::check_attributes 458,902 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:::check_attributes_post 454,797 ( 0.02%) ???:>::visit_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 451,494 ( 0.02%) site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::check_attributes 451,494 ( 0.02%) site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::check_attributes_post 448,604 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_attributes [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 448,604 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_attributes_post [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 443,808 ( 0.02%) include/jemalloc/internal/jemalloc_internal_inlines_b.h:malloc_default 443,334 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/attr/version.rs:::meets 443,334 ( 0.02%) /rust/deps/smallvec-1.15.1/src/lib.rs:::meets [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 443,334 ( 0.02%) site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets 443,241 ( 0.02%) ???:__rustc::__rust_alloc [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 440,639 ( 0.02%) ???:llvm::cl::Option::addArgument() [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/libLLVM.so.23.1-rust-1.99.0-nightly] 439,751 ( 0.02%) ???:::instantiate_into'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 438,692 ( 0.02%) ???:::visit_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 436,794 ( 0.02%) ???:rustc_pattern_analysis::rustc::analyze_match [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 435,653 ( 0.02%) ???:::run_pass [???] 430,965 ( 0.02%) site/frontend/rust-clippy/clippy_utils/src/source.rs:::into_range [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 429,876 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/mod.rs:::trim_matches::<::is_whitespace> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 428,364 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/pattern.rs:::new 426,775 ( 0.02%) include/jemalloc/internal/edata.h:malloc_default 425,821 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/mod.rs:::check_expr 425,628 ( 0.02%) /rust/deps/thin-vec-0.2.19/src/lib.rs:::check_attributes 424,074 ( 0.02%) ???:::demand_eqtype_pat_diag [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 421,843 ( 0.02%) ???:>, rustc_middle::query::erase::ErasedData<[u8; 2]>> as rustc_middle::query::caches::QueryCache>::for_each [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 418,597 ( 0.02%) ???:::visit_place [???] 417,921 ( 0.02%) ???:> as rustc_middle::query::caches::QueryCache>::for_each [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 417,859 ( 0.02%) ???:::check_pat_inner [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 416,405 ( 0.02%) include/jemalloc/internal/sz.h:calloc 414,715 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 414,622 ( 0.02%) ???:rustc_mir_dataflow::drop_flag_effects::on_all_children_bits::on_all_children_bits::<&mut rustc_mir_dataflow::drop_flag_effects::drop_flag_effects_for_location<::apply_primary_statement_effect::{closure#0}>::{closure#2}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 412,539 ( 0.02%) site/frontend/rust-clippy/clippy_lints/src/unused_unit.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 412,452 ( 0.02%) site/frontend/rust-clippy/clippy_lints/src/unit_types/mod.rs:::check_expr 412,444 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 412,436 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 411,866 ( 0.02%) ???:rustc_mir_transform::run_analysis_to_runtime_passes'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 411,118 ( 0.02%) ???:rustc_query_impl::execution::try_execute_query::>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 410,285 ( 0.02%) ???:rustc_query_impl::execution::try_execute_query::>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 405,892 ( 0.02%) ???:::mark_live_symbols'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 405,536 ( 0.02%) ???:::poly_select::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 400,621 ( 0.02%) ???:>::union [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 396,618 ( 0.02%) ???:rustc_query_impl::plumbing::verify_query_key_hashes_inner::>>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 391,210 ( 0.02%) include/jemalloc/internal/rtree.h:pa_dalloc 390,181 ( 0.02%) ???:::record_use [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 388,848 ( 0.02%) ???:>::reserve_rehash::>::{closure#0}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 388,448 ( 0.02%) ???:rustc_mir_dataflow::drop_flag_effects::on_all_children_bits::on_all_children_bits::::apply_switch_int_edge_effect::{closure#0}>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 386,400 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs: as alloc::vec::spec_from_iter_nested::SpecFromIterNested, ::len>>>::from_iter 385,845 ( 0.02%) src/extent.c:pa_alloc 385,460 ( 0.02%) ???:::candidate_from_obligation_no_cache [???] 381,392 ( 0.02%) site/frontend/rust-clippy/clippy_utils/src/source.rs:::new [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 380,052 ( 0.02%) site/frontend/rust-clippy/clippy_lints/src/combined_early_pass.rs:::check_variant [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 379,052 ( 0.02%) ???:rustc_trait_selection::traits::project::normalize_projection_term [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 378,432 ( 0.02%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 377,968 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 375,711 ( 0.02%) ???:::start_new_block [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 367,560 ( 0.02%) ???:>, &mut rustc_infer::infer::snapshot::undo_log::InferCtxtUndoLogs>>>::uninlined_get_root_key [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 366,578 ( 0.02%) ???:0x0000000000029600 [/usr/lib/ld-linux-x86-64.so.2] 364,674 ( 0.02%) ???:::parse_path_inner [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 364,205 ( 0.02%) ???:::parse_arm::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 364,165 ( 0.02%) ???:::finish128_inner [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 364,029 ( 0.02%) include/jemalloc/internal/mutex.h:malloc_default 361,233 ( 0.02%) ???:::run_pass [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 360,551 ( 0.02%) ???:::check_expr_post [???] 360,153 ( 0.02%) ???:>::fill_item::<::fresh_args_for_item::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 359,738 ( 0.02%) ???:::add_required_obligations_for_hir [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 358,334 ( 0.02%) include/jemalloc/internal/thread_event.h:malloc_default 356,044 ( 0.02%) ???:>::tys'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 354,700 ( 0.02%) site/frontend/rust-clippy/clippy_utils/src/attrs.rs:::check_attributes 353,628 ( 0.02%) ???:rustc_trait_selection::traits::project::opt_normalize_projection_term [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 350,394 ( 0.02%) ???:::compare [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 348,408 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 348,408 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:::check_expr 347,791 ( 0.02%) site/frontend/rust-clippy/clippy_lints/src/mixed_read_write_in_expression.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 347,760 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/index.rs:clippy_lints::misc_early::mixed_case_hex_literals::check 347,240 ( 0.02%) include/jemalloc/internal/thread_event.h:realloc 345,643 ( 0.02%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::peel_hir_expr_refs [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 345,000 ( 0.02%) ???:::eat_token_lit [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 344,520 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/hir.rs:clippy_lints::casts::cast_slice_different_sizes::expr_cast_chain_tys 344,396 ( 0.02%) ???:rustc_trait_selection::traits::project::confirm_candidate [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 343,933 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/hir.rs:::check_expr 343,828 ( 0.02%) site/frontend/rust-clippy/clippy_lints/src/needless_parens_on_range_literals.rs:::check_expr 343,823 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:::check_expr 343,818 ( 0.02%) ???:::fill_well_known'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 343,710 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:::check_expr 343,710 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:::check_expr 343,710 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:::check_expr 343,710 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:::check_expr 343,710 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:::check_expr 343,710 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/flatten.rs:clippy_lints::operators::float_cmp::check_assert 343,710 ( 0.02%) site/frontend/rust-clippy/clippy_lints/src/functions/mod.rs:::check_expr 342,576 ( 0.02%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 341,007 ( 0.02%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 339,309 ( 0.02%) ???:::is_mutable [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 338,976 ( 0.02%) include/jemalloc/internal/arena_inlines_b.h:realloc 338,924 ( 0.02%) include/jemalloc/internal/ticker.h:malloc_default 335,227 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::into_range 333,835 ( 0.02%) ???: as rustc_hir::intravisit::Visitor>::visit_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 333,163 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::from_lit_kind 327,658 ( 0.02%) ???:, ())>>::reserve_rehash::, (), rustc_hash::FxBuildHasher>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 325,585 ( 0.02%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 322,421 ( 0.01%) include/jemalloc/internal/edata.h:pa_dalloc 320,891 ( 0.01%) ???:::candidate_from_obligation [???] 320,594 ( 0.01%) ???: as rustc_data_structures::stable_hash::StableHash>::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 317,728 ( 0.01%) ???:::write_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 316,023 ( 0.01%) ???:::bump [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 315,084 ( 0.01%) ???:>::new'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 314,866 ( 0.01%) ???:rustc_query_impl::execution::try_execute_query::>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 312,895 ( 0.01%) include/jemalloc/internal/tsd.h:calloc 309,831 ( 0.01%) ???:core::str::converts::from_utf8 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 309,696 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 309,355 ( 0.01%) ???:::check_def_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 309,120 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/cmp.rs:clippy_lints::misc_early::mixed_case_hex_literals::check 309,120 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/pattern.rs: as alloc::vec::spec_from_iter_nested::SpecFromIterNested, ::len>>>::from_iter 308,908 ( 0.01%) ???:::intern_str [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 306,922 ( 0.01%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 305,577 ( 0.01%) ???:rustc_query_impl::execution::try_execute_query::>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 304,955 ( 0.01%) include/jemalloc/internal/tcache_inlines.h:realloc 304,581 ( 0.01%) ???:::hir_body_const_context [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 303,618 ( 0.01%) ???:core::ptr::drop_glue::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 300,719 ( 0.01%) ???:::lower_thir_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 299,179 ( 0.01%) include/jemalloc/internal/cache_bin.h:realloc 298,012 ( 0.01%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 297,164 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/collections/hash/map.rs:::check_attributes 297,164 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/attrs/mod.rs:::check_attributes_post 296,798 ( 0.01%) ???:>::find_cycles_from_node:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 296,698 ( 0.01%) ???:::fold_infer_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 296,400 ( 0.01%) include/jemalloc/internal/cache_bin.h:tcache_bin_flush_small 294,869 ( 0.01%) ???:::shallow_resolve [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 294,050 ( 0.01%) ???:::visit_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 293,372 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/validations.rs:::trim_start_matches::<::is_whitespace> 292,447 ( 0.01%) include/jemalloc/internal/ph.h:pa_dalloc 292,232 ( 0.01%) ???:::check_stability_allow_unstable [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 291,626 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:::trim_matches::<::is_whitespace> 289,250 ( 0.01%) ???:::mirror_exprs [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 289,152 ( 0.01%) ???:::from_scalar_int [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 287,327 ( 0.01%) ???:::compute_drop_data [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 286,275 ( 0.01%) ???:::add_implied_bounds [???] 286,059 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:::check_attributes 285,969 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_attributes 285,138 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/mod.rs:::new 284,685 ( 0.01%) include/jemalloc/internal/ph.h:malloc_default 283,760 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs: as alloc::vec::spec_from_iter_nested::SpecFromIterNested<(rustc_span::span_encoding::Span, alloc::string::String), core::iter::adapters::filter_map::FilterMap, clippy_lints::doc::suspicious_doc_comments::collect_doc_replacements::{closure#0}>>>::from_iter 283,760 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/attrs.rs:::check_attributes_post 280,248 ( 0.01%) ???:::lower_expr_within_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 279,410 ( 0.01%) src/tcache.c:malloc_default 279,170 ( 0.01%) ???:::resolve_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 277,066 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/eta_reduction.rs:::check_expr 276,417 ( 0.01%) ???:::parse_item_kind'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 276,241 ( 0.01%) ???:> as rustc_middle::query::caches::QueryCache>::for_each [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 276,188 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:clippy_utils::macros::root_macro_call 276,096 ( 0.01%) ???:::normalize::<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::generic_args::GenericArg>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 276,024 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cmp.rs:::meets 276,024 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::meets 276,024 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:::meets 275,963 ( 0.01%) ???:::lower_pat_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 275,584 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/vec_init_then_push.rs:::check_expr 275,523 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:clippy_utils::macros::matching_root_macro_call 275,510 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/suspicious_trait_impl.rs:::check_expr 275,386 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::hir 275,224 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 274,996 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 274,968 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 274,968 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 274,968 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 274,968 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 274,968 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 274,592 ( 0.01%) ???:>::decode'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 272,664 ( 0.01%) /rustc/84b36a78a28a63f134171c670be1932ffa2485f8/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/build/tikv-jemalloc-sys/80122c672fbe49ef/out/build/src/pa.c:pa_alloc [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 272,190 ( 0.01%) ???:>>::walk_ref [???] 272,165 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs:::check_lit [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 272,080 ( 0.01%) ???:, usize)>>::reserve_rehash::, usize, rustc_hash::FxBuildHasher>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 271,610 ( 0.01%) ???:::resolve_ident_in_scope_set_inner'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 271,103 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/pattern.rs:>::next_back 270,984 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:::check_expr 270,502 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:clippy_lints::misc_early::mixed_case_hex_literals::check 268,906 ( 0.01%) ???:::node_type [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 268,735 ( 0.01%) ???:rustc_traits::type_op::type_op_prove_predicate [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 268,439 ( 0.01%) ???:::visit_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 267,239 ( 0.01%) ???:::lookup_char_pos [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 266,535 ( 0.01%) ???:::evaluate_trait_predicate_recursively [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 266,532 ( 0.01%) ???:> as rustc_middle::query::caches::QueryCache>::for_each [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 264,712 ( 0.01%) ???:>::fold_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 263,714 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/token.rs:::check_expr 262,848 ( 0.01%) ???:::resolve_arm [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 261,278 ( 0.01%) ???:::make_canonicalized_query_response::<()> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 259,578 ( 0.01%) ???:::impl_or_trait_obligations [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 258,696 ( 0.01%) ???:, ::split>::{closure#0}>, [(rustc_pattern_analysis::constructor::MaybeInfiniteInt, isize); 2], ::split>::{closure#1}> as core::iter::traits::iterator::Iterator>::next [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 258,496 ( 0.01%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 258,427 ( 0.01%) ???:::visit_const_operand [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 257,301 ( 0.01%) ???:::visit_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 257,171 ( 0.01%) ???:::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 256,819 ( 0.01%) ???:::hash_owner_nodes::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 256,809 ( 0.01%) ???:::run_pass [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 253,915 ( 0.01%) ???:::fn_sig [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 253,822 ( 0.01%) ???:>::tys::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 251,451 ( 0.01%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 251,109 ( 0.01%) ???:rustc_mir_build::builder::matches::traverse_candidate::, alloc::vec::into_iter::IntoIter, ::from_candidate::{closure#0}, ::from_candidate::{closure#1}, ::from_candidate::{closure#2}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 249,987 ( 0.01%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 249,987 ( 0.01%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 249,987 ( 0.01%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 245,383 ( 0.01%) ???: as rustc_type_ir::fold::TypeFolder>::fold_ty'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 243,698 ( 0.01%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::dep_graph::graph::DepNodeIndex>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 243,627 ( 0.01%) ???:::solve [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 242,955 ( 0.01%) ???:::visit_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 242,798 ( 0.01%) ???:>::initialize::<>::get_or_init<::create_global_ctxt, rustc_interface::passes::create_and_enter_global_ctxt, rustc_driver_impl::run_compiler::{closure#0}::{closure#1}>::{closure#2}>::{closure#1}>::{closure#0}, !> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 242,706 ( 0.01%) ???:rustc_ast::visit::visit_arms::> [???] 242,524 ( 0.01%) ???:::visit_operand [???] 240,003 ( 0.01%) ???:::visit_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 239,966 ( 0.01%) ???:rustc_mir_build::builder::build_mir_inner_impl [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 238,840 ( 0.01%) ???:rustc_type_ir::relate::structurally_relate_tys::::{closure#0}'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 238,723 ( 0.01%) ???:::resolve_pattern_inner::{closure#0} [???] 238,500 ( 0.01%) ???:::lower_match_tree [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 238,370 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::deref 238,370 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::new 235,622 ( 0.01%) ???:__cxa_finalize [/usr/lib/libc.so.6] 234,820 ( 0.01%) ???:rustc_hir_analysis::hir_ty_lowering::generics::check_generic_arg_count_for_value_path [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 234,212 ( 0.01%) ???:rustc_middle::lint::emit_lint_base::emit_lint_base_impl [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 234,082 ( 0.01%) ???:rustc_query_impl::execution::try_execute_query::>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 233,412 ( 0.01%) include/jemalloc/internal/tcache_inlines.h:calloc 232,472 ( 0.01%) ???:::select [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 232,272 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/pattern.rs:::check_expr 232,272 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/source.rs:::check_expr 231,428 ( 0.01%) ???:rustc_query_impl::execution::try_execute_query::>, false>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 230,554 ( 0.01%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::dep_graph::graph::DepNodeIndex>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 227,232 ( 0.01%) ???:>::drop_and_maybe_poison [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 226,701 ( 0.01%) ???:rustc_mir_build::builder::matches::match_pair::squash_inter_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 225,924 ( 0.01%) ???:::finish [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 224,751 ( 0.01%) ???:::parse_pat_no_top_guard_inner [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 222,777 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:::check_attributes [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 222,777 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:::check_attributes_post [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 222,419 ( 0.01%) ???:::trait_ref_and_own_args_for_alias [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 222,113 ( 0.01%) ???:::encode_def_ids [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 221,916 ( 0.01%) ???: as rustc_ast::visit::Visitor>::visit_pat [???] 221,667 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/mod.rs:::meets 219,886 ( 0.01%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 219,790 ( 0.01%) ???:rustc_hir::intravisit::walk_expr:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 219,467 ( 0.01%) ???:::lower_pattern [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 219,415 ( 0.01%) ???:::visit_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 219,415 ( 0.01%) ???:rustc_hir::intravisit::walk_expr::<::collect_taits_declared_in_body::TaitInBodyFinder> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 219,379 ( 0.01%) ???:::visit_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 219,368 ( 0.01%) ???:rustc_hir::intravisit::walk_expr:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 218,184 ( 0.01%) ???:::hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 217,466 ( 0.01%) ???:::push_assign [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 217,354 ( 0.01%) ???:rustc_traits::evaluate_obligation::evaluate_obligation [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 217,027 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::trim_matches::<::is_whitespace> 216,938 ( 0.01%) ???:::parse_literal_maybe_minus [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 216,640 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/redundant_field_names.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 216,369 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/needless_else.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 216,338 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/almost_complete_range.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 216,231 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/casts/needless_type_cast.rs:rustc_hir::intravisit::walk_expr::> 215,829 ( 0.01%) ???:rustc_hir_analysis::check::wfcheck::check_where_clauses [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 215,149 ( 0.01%) ???:::create_def [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 214,283 ( 0.01%) ???:::register_lints [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 213,420 ( 0.01%) ???:::visit_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 212,864 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/string.rs:::check_attributes 212,820 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint/src/context.rs:::check_attributes 212,820 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:clippy_lints::doc::suspicious_doc_comments::check 212,820 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mut_ptr.rs:clippy_lints::doc::suspicious_doc_comments::check 212,814 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/mod.rs:::check_attributes 212,399 ( 0.01%) ???:>::super_fold_with::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 210,501 ( 0.01%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::dep_graph::graph::DepNodeIndex>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 209,097 ( 0.01%) ???:llvm::DenseMapBase, llvm::detail::DenseMapPair >, llvm::StringRef, llvm::cl::Option*, llvm::DenseMapInfo, llvm::detail::DenseMapPair >::moveFrom(llvm::DenseMap, llvm::detail::DenseMapPair >&) [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/libLLVM.so.23.1-rust-1.99.0-nightly] 207,370 ( 0.01%) include/jemalloc/internal/bit_util.h:pa_alloc 206,660 ( 0.01%) ???:core::slice::sort::unstable::quicksort::quicksort::<(rustc_pattern_analysis::constructor::MaybeInfiniteInt, isize), <(rustc_pattern_analysis::constructor::MaybeInfiniteInt, isize) as core::cmp::PartialOrd>::lt>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 206,483 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::check_expr 206,464 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::check_expr_post 206,440 ( 0.01%) ???:>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 206,226 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint/src/context.rs:::check_expr 206,226 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:, clippy_utils::macros::first_node_macro_backtrace::{closure#0}> as core::iter::traits::iterator::Iterator>::try_fold::<(), >::iter_try_fold::flatten, clippy_utils::macros::macro_backtrace::{closure#0}>, clippy_utils::macros::first_node_macro_backtrace::{closure#0}::{closure#0}>, (), core::ops::control_flow::ControlFlow, as core::iter::traits::iterator::Iterator>::try_fold::flatten, clippy_utils::macros::macro_backtrace::{closure#0}>, clippy_utils::macros::first_node_macro_backtrace::{closure#0}::{closure#0}>, (), core::ops::control_flow::ControlFlow, core::iter::traits::iterator::Iterator::find::check::{closure#0}>::{closure#0}>::{closure#0}, core::ops::control_flow::ControlFlow> 206,226 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs:, clippy_utils::macros::first_node_macro_backtrace::{closure#0}> as core::iter::traits::iterator::Iterator>::try_fold::<(), >::iter_try_fold::flatten, clippy_utils::macros::macro_backtrace::{closure#0}>, clippy_utils::macros::first_node_macro_backtrace::{closure#0}::{closure#0}>, (), core::ops::control_flow::ControlFlow, as core::iter::traits::iterator::Iterator>::try_fold::flatten, clippy_utils::macros::macro_backtrace::{closure#0}>, clippy_utils::macros::first_node_macro_backtrace::{closure#0}::{closure#0}>, (), core::ops::control_flow::ControlFlow, core::iter::traits::iterator::Iterator::find::check::{closure#0}>::{closure#0}>::{closure#0}, core::ops::control_flow::ControlFlow> 206,226 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/control_flow.rs:clippy_lints::operators::eq_op::check_assert 206,226 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:::check_expr 206,226 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:::check_expr 206,226 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:::check_expr 206,226 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:::check_expr 206,226 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:::check_expr 206,226 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:::check_expr 205,904 ( 0.01%) ???:::pop_scope [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 205,732 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:clippy_utils::fn_def_id_with_node_args 205,398 ( 0.01%) ???:>::tys'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 204,076 ( 0.01%) ???:::check_pat_inner'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 203,541 ( 0.01%) ???:::maybe_recover_trailing_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 202,443 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:::check_expr 201,729 ( 0.01%) ???:::lower_pat [???] 200,865 ( 0.01%) include/jemalloc/internal/tsd.h:malloc_default 200,808 ( 0.01%) ???:::visit_operand [???] 200,121 ( 0.01%) ???:rustc_ast_lowering::lower_to_hir [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 199,238 ( 0.01%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 198,671 ( 0.01%) ???:rustc_trait_selection::traits::outlives_bounds::implied_outlives_bounds [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 198,461 ( 0.01%) ???:>::get_attrs [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 198,142 ( 0.01%) ???:rustc_trait_selection::traits::query::type_op::implied_outlives_bounds::compute_implied_outlives_bounds_inner [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 197,550 ( 0.01%) ???:::lower_pattern_range [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 196,312 ( 0.01%) ???:::flat_map_arm [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 196,003 ( 0.01%) ???:>>>, ())>>::reserve_rehash::>>>, (), rustc_type_ir::binder::Binder>>::{closure#1}> [???] 195,516 ( 0.01%) ???:::visit_qpath [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 194,360 ( 0.01%) ???:>::tys [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 194,101 ( 0.01%) ???:::lookup_method_for_operator [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 193,643 ( 0.01%) ???:::check_match [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 193,560 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:::check_expr 193,558 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/iter.rs:::check_expr 193,200 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/mod.rs:clippy_lints::misc_early::mixed_case_hex_literals::check 193,057 ( 0.01%) ???:rustc_query_impl::execution::try_execute_query::>, rustc_middle::query::erase::ErasedData<[u8; 2]>>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 192,851 ( 0.01%) ???:>> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform [???] 191,904 ( 0.01%) ???:::consider_probe::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 191,875 ( 0.01%) ???:0x000000000000ad20 [/usr/lib/ld-linux-x86-64.so.2] 191,656 ( 0.01%) src/sz.c:pa_alloc 191,540 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:clippy_utils::source::get_source_range 190,751 ( 0.01%) ???:>::reserve_rehash::>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 190,380 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/ast.rs:::from_lit_kind 190,336 ( 0.01%) ???:::lint_level_spec_at_node [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 189,974 ( 0.01%) ???:rustc_traits::implied_outlives_bounds::implied_outlives_bounds [???] 188,040 ( 0.01%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 186,704 ( 0.01%) include/jemalloc/internal/mutex.h:pa_alloc 186,425 ( 0.01%) ???:>::visit_ty'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 185,287 ( 0.01%) include/jemalloc/internal/arena_inlines_b.h:calloc 185,108 ( 0.01%) ???:>::instantiate_supertrait [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 184,202 ( 0.01%) include/jemalloc/internal/sz.h:tcache_bin_flush_small 183,991 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_expr::> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 182,988 ( 0.01%) ???:rustc_ty_utils::assoc::associated_items [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 182,865 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/casts/needless_type_cast.rs:rustc_hir::intravisit::walk_expr::>'2 182,754 ( 0.01%) ???:rustc_hir_analysis::check::check::check_item_type [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 182,368 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::eq 182,367 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:::with_source_text::::{closure#0}> 182,173 ( 0.01%) ???: as rustc_data_structures::flat_map_in_place::FlatMapInPlace>::flat_map_in_place::::{closure#0}, smallvec::SmallVec<[rustc_ast::ast::Arm; 1]>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 181,928 ( 0.01%) ???:rustc_trait_selection::traits::normalize_param_env_or_error [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 181,823 ( 0.01%) ???:::opt_associated_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 181,720 ( 0.01%) ???:>::complete::>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 181,562 ( 0.01%) ???:::visit_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 181,200 ( 0.01%) ???:>::super_fold_with:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 180,661 ( 0.01%) ???:::next [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 180,189 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/visitors.rs:rustc_hir::intravisit::walk_expr::> 180,082 ( 0.01%) ???:rustc_type_ir::relate::structurally_relate_tys::::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 179,292 ( 0.01%) ???:>, rustc_middle::query::erase::ErasedData<[u8; 8]>> as rustc_middle::query::caches::QueryCache>::for_each [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 178,857 ( 0.01%) ???:::valtree_to_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 178,640 ( 0.01%) ???:::get_diagnostic_name [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 178,555 ( 0.01%) ???:rustc_query_impl::execution::try_execute_query::>, false>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 176,742 ( 0.01%) ???: as rustc_ast::visit::Visitor>::visit_arm::{closure#0} [???] 176,377 ( 0.01%) ???:::lower_thir_pat'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 175,953 ( 0.01%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::dep_graph::graph::DepNodeIndex>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 175,620 ( 0.01%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 171,236 ( 0.01%) ???:::lower_arm [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 170,160 ( 0.01%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 170,035 ( 0.01%) ???:rustc_hir_analysis::collect::clauses_of::gather_explicit_clauses_of [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 168,707 ( 0.01%) ???:::hir_body_owner_def_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 168,357 ( 0.01%) ???:>::tys::{closure#0}'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 168,042 ( 0.01%) ???:rustc_mir_build::builder::matches::match_pair::squash_inter_pat'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 167,442 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs:::check_pat [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 166,621 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/manual_non_exhaustive.rs:::check_expr 165,668 ( 0.01%) ???:::qpath_res [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 165,461 ( 0.01%) ???:rustc_hir::intravisit::walk_pat_expr::> [???] 165,015 ( 0.01%) ???:>>::upcast_from [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 164,572 ( 0.01%) ???:>::apply_rewrites [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 163,299 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/approx_const.rs:::check_lit [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 162,893 ( 0.01%) ???:::visit_operand [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 162,497 ( 0.01%) ???:thin_vec::drop_non_singleton:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 162,041 ( 0.01%) ???:rustc_query_impl::execution::try_execute_query::>, rustc_middle::query::erase::ErasedData<[u8; 8]>>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 159,818 ( 0.01%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 159,718 ( 0.01%) ???:::check_ident [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 159,194 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/index.rs:::next_match 158,415 ( 0.01%) ???:::lower_node_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 157,922 ( 0.01%) ???:rustc_query_impl::execution::try_execute_query::>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 157,903 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:rustc_hir::intravisit::walk_expr::'2 155,999 ( 0.01%) include/jemalloc/internal/atomic.h:pa_alloc 155,532 ( 0.01%) ???:>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 154,776 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs:::check_expr 154,560 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:::check_expr 154,030 ( 0.01%) ???:::hash_one::<&std::path::PathBuf> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 153,457 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/visitors.rs:rustc_hir::intravisit::walk_expr::>'2 153,431 ( 0.01%) ???:::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 153,405 ( 0.01%) ???:rustc_hir_analysis::collect::item_bounds::impl_super_outlives [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 153,318 ( 0.01%) ???:::typeck_body [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 152,150 ( 0.01%) ???:> as rustc_middle::query::caches::QueryCache>::for_each'2 [???] 151,942 ( 0.01%) ???:::as_operand [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 151,553 ( 0.01%) ???:::const_to_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 151,011 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/source.rs:::get_text::<&rustc_lint::context::EarlyContext> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 150,949 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/mod.rs:::trim_start_matches::<::is_whitespace> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 150,848 ( 0.01%) ???:::lower_generic_args_of_path::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 150,474 ( 0.01%) ???:>::get:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 150,378 ( 0.01%) ???:::validate_place [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 150,274 ( 0.01%) ???:> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 150,251 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/res.rs:::check_expr 150,104 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:rustc_hir::intravisit::walk_expr::'2 150,051 ( 0.01%) include/jemalloc/internal/tsd_tls.h:malloc_default 149,897 ( 0.01%) include/jemalloc/internal/tsd.h:realloc 149,058 ( 0.01%) ???:::mk_type_list [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 148,582 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint/src/levels.rs:::check_attributes 148,564 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/res.rs:::check_expr 148,518 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint/src/passes.rs:::check_attributes [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 147,778 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cmp.rs:::meets 146,601 ( 0.01%) ???:::evaluate_root_obligation [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 146,328 ( 0.01%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 145,432 ( 0.01%) include/jemalloc/internal/mutex.h:tcache_bin_flush_small 145,389 ( 0.01%) ???:::register_predicates::>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 144,718 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/option_env_unwrap.rs:::check_expr 144,160 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/else_if_without_else.rs:::check_expr 144,075 ( 0.01%) ???:::def_key [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 143,838 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/asm_syntax.rs:::check_expr 143,280 ( 0.01%) ???: as rustc_type_ir::visit::TypeVisitor>::visit_ty'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 143,151 ( 0.01%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 143,022 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/source.rs:::deref 142,788 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::new 142,788 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:::new 142,788 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/traits.rs:::new 142,788 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/validations.rs:::new 142,785 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/char/methods.rs:::from_lit_kind 142,785 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/validations.rs:::from_lit_kind 142,611 ( 0.01%) ???:::find_by_ident_and_namespace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 142,294 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mut_ptr.rs:::check_attributes 141,986 ( 0.01%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 141,880 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint/src/context.rs:::check_attributes_post 141,761 ( 0.01%) ???:::parse_outer_attributes [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 141,631 ( 0.01%) include/jemalloc/internal/rtree.h:ecache_evict 140,575 ( 0.01%) include/jemalloc/internal/rtree.h:free_default 140,440 ( 0.01%) ???:::lower_lit [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 140,340 ( 0.01%) ???:> as rustc_middle::query::caches::QueryCache>::for_each [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 138,876 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/lib.rs:::check_expr 138,651 ( 0.01%) ???:rustc_hir_typeck::check::check_fn [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 138,372 ( 0.01%) ???: as rustc_hir::intravisit::Visitor>::visit_path [???] 138,340 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/useless_conversion.rs:::check_expr_post 138,281 ( 0.01%) include/jemalloc/internal/bit_util.h:calloc 137,982 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/temporary_assignment.rs:::check_expr 137,745 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 137,728 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:clippy_utils::in_automatically_derived 137,681 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint/src/context.rs:::check_expr 137,637 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint/src/context.rs:::check_expr 137,613 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/needless_question_mark.rs:::check_expr 137,544 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:::check_expr_post 137,542 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/slow_vector_initialization.rs:::check_expr 137,527 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 137,484 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint/src/context.rs:::check_expr 137,484 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/hygiene.rs:::check_expr 137,484 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/lib.rs:::check_expr 137,484 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/fuse.rs:clippy_lints::operators::float_cmp::check_assert 137,484 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:clippy_lints::operators::float_cmp::check_assert 137,484 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::check_expr 137,484 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::check_expr 137,484 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::check_expr 137,484 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::check_expr 137,484 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::check_expr 137,484 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::check_expr 137,484 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::check_expr 137,484 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/mod.rs:::check_expr_post 137,484 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/pointers_in_nomem_asm_block.rs:::check_expr 137,484 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_lints::operators::eq_op::check_assert 137,484 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_lints::operators::float_cmp::check_assert 137,476 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/lib.rs:::check_expr 137,476 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/lib.rs:::check_expr 137,424 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 137,344 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 137,260 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 137,260 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 137,218 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 137,025 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:clippy_lints::loops::while_let_on_iterator::check 137,008 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::check_expr 137,008 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:clippy_utils::fn_def_id 137,008 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/mod.rs:::check_expr 137,008 ( 0.01%) /rust/deps/hashbrown-0.17.1/src/raw.rs:::check_expr 135,926 ( 0.01%) ???:)>>::reserve_rehash::, rustc_hash::FxBuildHasher>::{closure#0}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 135,681 ( 0.01%) ???:>>::walk_ref [???] 135,284 ( 0.01%) ???:::expr_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 135,251 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:clippy_lints::misc_early::mixed_case_hex_literals::check 134,852 ( 0.01%) ???:::slice_write_process_buffer [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 134,737 ( 0.01%) ???:::trait_of_assoc [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 134,052 ( 0.01%) ???:rustc_mir_build::builder::matches::traverse_candidate::<&mut rustc_mir_build::builder::matches::Candidate, (), core::iter::adapters::rev::Rev>, ::visit_leaves_rev<::lower_match_tree::{closure#1}>::{closure#0}, ::visit_leaves_rev<::lower_match_tree::{closure#1}>::{closure#1}, ::visit_leaves_rev<::lower_match_tree::{closure#1}>::{closure#2}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 133,878 ( 0.01%) ???:, rustc_middle::dep_graph::graph::DepNodeIndex> as rustc_middle::query::caches::QueryCache>::for_each [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 133,787 ( 0.01%) ???:rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::generics_of [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 133,216 ( 0.01%) ???:::hir_enclosing_body_owner [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 132,660 ( 0.01%) ???:>::fold_region [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 132,612 ( 0.01%) ???:rustc_trait_selection::traits::wf::clause_obligations [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 132,426 ( 0.01%) ???:::run_pass [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 132,398 ( 0.01%) ???:rustc_privacy::check_mod_privacy [???] 132,381 ( 0.01%) ???:::validate_place'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 131,421 ( 0.01%) include/jemalloc/internal/tsd_tls.h:calloc 131,064 ( 0.01%) ???:>, ())>>::reserve_rehash::>, (), rustc_hash::FxBuildHasher>::{closure#0}> [???] 130,702 ( 0.01%) ???:::visit_pat'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 130,407 ( 0.01%) ???:>::assumed_wf_types_and_report_errors [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 129,783 ( 0.01%) ???:::check_pat_expr_unadjusted [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 128,496 ( 0.01%) /rustc/84b36a78a28a63f134171c670be1932ffa2485f8/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/build/tikv-jemalloc-sys/80122c672fbe49ef/out/build/src/jemalloc.c:free_default [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 128,292 ( 0.01%) ???:::bind_and_guard_matched_candidate [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 128,241 ( 0.01%) ???:> as rustc_middle::query::caches::QueryCache>::for_each [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 127,872 ( 0.01%) ???:::is_diagnostic_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 127,484 ( 0.01%) ???:rustc_query_impl::query_impl::clauses_of::invoke_provider_fn::__rust_begin_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 127,108 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then::::display::{closure#0}> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 126,428 ( 0.01%) ???:::resolve_type_vars_in_body [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 125,474 ( 0.01%) ???:__cxa_atexit [/usr/lib/libc.so.6] 125,077 ( 0.01%) ???:, rustc_middle::dep_graph::graph::DepNodeIndex))>>::reserve_rehash::<, rustc_middle::dep_graph::graph::DepNodeIndex))>>>::insert_unique::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 124,281 ( 0.01%) ???:>::fold_ty'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 123,825 ( 0.01%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::dep_graph::graph::DepNodeIndex>, false>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 123,470 ( 0.01%) src/emap.c:pa_alloc 123,334 ( 0.01%) ???: as rustc_type_ir::visit::TypeVisitor>::visit_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 123,243 ( 0.01%) ???:::visit_item::{closure#0}::{closure#0}'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 123,108 ( 0.01%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 122,775 ( 0.01%) ???:::mk_args [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 122,767 ( 0.01%) ???:::encode_span [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 122,521 ( 0.01%) ???:::update_decl_chain [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 122,418 ( 0.01%) ???:::resolve_vars_with_obligations:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 122,361 ( 0.01%) ???:, rustc_middle::dep_graph::graph::DepNodeIndex> as rustc_middle::query::caches::QueryCache>::for_each [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 121,996 ( 0.01%) ???:::check_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 121,780 ( 0.01%) ???:core::slice::sort::unstable::quicksort::quicksort::<(rustc_pattern_analysis::constructor::MaybeInfiniteInt, isize), <(rustc_pattern_analysis::constructor::MaybeInfiniteInt, isize) as core::cmp::PartialOrd>::lt> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 121,442 ( 0.01%) ???:rustc_hir::intravisit::walk_pat:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 121,210 ( 0.01%) ???:::decode_symbol [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 121,014 ( 0.01%) ???:rustc_ty_utils::ty::param_env [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 120,976 ( 0.01%) ???:rustc_trait_selection::traits::specialize::specialization_graph_provider [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 120,948 ( 0.01%) ???:::visit_pat'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 120,481 ( 0.01%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::dep_graph::graph::DepNodeIndex>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 120,480 ( 0.01%) ???:rustc_mir_transform::mir_built'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 120,234 ( 0.01%) src/arena.c:tcache_bin_flush_small 119,447 ( 0.01%) src/tcache.c:free_default 119,351 ( 0.01%) ???:::parse_ty_common [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 119,188 ( 0.01%) ???:::pick_all_method [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 118,997 ( 0.01%) src/hook.c:realloc 117,949 ( 0.01%) ???:::hir_maybe_body_owned_by [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 117,774 ( 0.01%) ???:rustc_query_impl::execution::try_execute_query::>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 117,574 ( 0.01%) ???:::lower_pat'2 [???] 116,812 ( 0.01%) ???:::check_args_compatible_inner [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 116,755 ( 0.01%) ???:::lower_pat_mut'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 116,215 ( 0.01%) ???:::def_id_partial_cmp [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 116,147 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/const_ptr.rs:>::next_back 116,143 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs:clippy_lints::misc_early::literal_suffix::check 116,136 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_expr 116,136 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_expr 116,136 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:::check_expr 116,136 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/validations.rs:::check_expr 116,136 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/numeric_literal.rs:::check_expr 116,100 ( 0.01%) ???:::new'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 115,920 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs: as alloc::vec::spec_from_iter_nested::SpecFromIterNested, ::len>>>::from_iter 115,920 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs: as alloc::vec::spec_from_iter_nested::SpecFromIterNested, ::len>>>::from_iter 115,516 ( 0.01%) ???:>::reserve_rehash::>>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 115,253 ( 0.01%) ???:::collect_tokens_for_expr::<::parse_expr_dot_or_call::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 115,164 ( 0.01%) ???:::require_lang_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 114,829 ( 0.01%) ???:::multi_projection_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 114,459 ( 0.01%) ???:::ascribe_user_type [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 113,977 ( 0.01%) include/jemalloc/internal/sz.h:pa_dalloc 113,622 ( 0.01%) ???:core::slice::sort::unstable::ipnsort::<(rustc_pattern_analysis::constructor::MaybeInfiniteInt, isize), <(rustc_pattern_analysis::constructor::MaybeInfiniteInt, isize) as core::cmp::PartialOrd>::lt> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 113,452 ( 0.01%) ???:, rustc_middle::dep_graph::graph::DepNodeIndex> as rustc_middle::query::caches::QueryCache>::for_each [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 113,368 ( 0.01%) ???:::check_expr_method_call [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 113,092 ( 0.01%) ???: as rustc_ast::visit::Visitor>::visit_pat'2 [???] 111,921 ( 0.01%) ???:thin_vec::drop_non_singleton::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 111,203 ( 0.01%) src/extent.c:tcache_bin_flush_small 110,706 ( 0.01%) ???:::normalize::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 110,374 ( 0.01%) ???:rustc_hir_analysis::check::wfcheck::check_fn_or_method [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 110,327 ( 0.01%) ???:> as rustc_data_structures::stable_hash::StableHash>::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 109,930 ( 0.01%) ???:rustc_mir_transform::ffi_unwind_calls::has_ffi_unwind_calls [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 109,717 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/mod.rs:::check_expr 109,472 ( 0.01%) ???:>::relate:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 109,338 ( 0.01%) ???:::lex_token_trees [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 109,115 ( 0.01%) ???:rustc_hir::intravisit::walk_pat::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 107,500 ( 0.01%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 105,618 ( 0.00%) ???:rustc_hir_analysis::collect::generics_of::generics_of [???] 105,531 ( 0.00%) ???:rustc_query_impl::plumbing::verify_query_key_hashes_inner::>, bool), rustc_middle::query::erase::ErasedData<[u8; 8]>>>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 105,321 ( 0.00%) ???:llvm::cl::Option::Option(llvm::cl::NumOccurrencesFlag, llvm::cl::OptionHidden) [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/libLLVM.so.23.1-rust-1.99.0-nightly] 105,092 ( 0.00%) ???:, rustc_middle::dep_graph::graph::DepNodeIndex))>>::reserve_rehash::<, rustc_middle::dep_graph::graph::DepNodeIndex))>>>::insert_unique::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 104,973 ( 0.00%) ???:::type_is_copy_modulo_regions [???] 104,787 ( 0.00%) ???:::add_wf_preds_for_trait_pred [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 104,207 ( 0.00%) ???:::xform_self_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 104,019 ( 0.00%) ???:::normalize:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 103,491 ( 0.00%) ???:rustc_hir::intravisit::walk_pat:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 103,037 ( 0.00%) ???:, rustc_middle::dep_graph::graph::DepNodeIndex> as rustc_middle::query::caches::QueryCache>::for_each [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 102,859 ( 0.00%) ???:::run_lint [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 102,793 ( 0.00%) ???:::leaf_def [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 102,724 ( 0.00%) ???:rustc_mir_build::thir::pattern::pat_from_hir::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 102,306 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 101,818 ( 0.00%) ???:>::get_attrs [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 101,754 ( 0.00%) ???:::evaluate_trait_predicate_recursively'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 101,450 ( 0.00%) ???:::imported_source_file::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 101,430 ( 0.00%) ???:::as_call_operand [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 101,184 ( 0.00%) ???:::check_arm [???] 100,590 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/unicode/unicode_data.rs:::trim_start_matches::<::is_whitespace> 100,155 ( 0.00%) ???:::visit_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 100,110 ( 0.00%) ???:::resolve_crate::{closure#0}'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 99,820 ( 0.00%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 99,801 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 99,230 ( 0.00%) ???:0x0000000000067b30 [/usr/lib/libc.so.6] 98,966 ( 0.00%) ???:rustc_mir_build::thir::constant::lit_to_const [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 98,882 ( 0.00%) ???:::collect_tokens::::parse_stmt_without_recovery::{closure#4}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 98,319 ( 0.00%) ???:::stable_hash::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 98,189 ( 0.00%) ???:::lower_pattern'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 97,962 ( 0.00%) include/jemalloc/internal/atomic.h:realloc 97,709 ( 0.00%) src/emap.c:pa_dalloc 97,607 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:clippy_utils::macros::span_is_local 97,607 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::span_is_local [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 97,474 ( 0.00%) ???:0x0000000000040520 [/usr/lib/libc.so.6] 97,004 ( 0.00%) include/jemalloc/internal/jemalloc_internal_inlines_a.h:realloc 96,981 ( 0.00%) ???:::parse_match_block [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 96,790 ( 0.00%) ???:__rustc::__rdl_dealloc [???] 96,529 ( 0.00%) ???:::resolve_path_with_ribs [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 96,313 ( 0.00%) ???:::as_temp::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 96,003 ( 0.00%) ???:core::fmt::write [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 95,770 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/lib.rs:clippy_utils::source::get_source_range 95,770 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:clippy_utils::source::get_source_range 95,496 ( 0.00%) ???:rustc_mir_build::thir::cx::thir_body [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 95,348 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/mod.rs:::deref 95,348 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/mod.rs:::new 95,267 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/mod.rs:::new 95,190 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/cmp.rs:::from_lit_kind 95,190 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/mod.rs:::from_lit_kind 94,789 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 94,473 ( 0.00%) ???:::check_expr_lit [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 93,909 ( 0.00%) ???:::resolve_regions_with_outlives_env [???] 93,859 ( 0.00%) ???:>::walk::::{closure#0}::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 92,959 ( 0.00%) ???:::decode_syntax_context [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 92,686 ( 0.00%) ???:>::fold_predicate [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 92,538 ( 0.00%) ???:rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::diagnostic_items [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 92,276 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 91,747 ( 0.00%) ???:::walk_::<::walk_always<::lower_pattern::{closure#0}>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 91,519 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_expr::'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 91,300 ( 0.00%) ???:::demand_suptype_with_origin [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 91,285 ( 0.00%) ???:::lower_attrs_vec [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 90,595 ( 0.00%) ???:> as rustc_type_ir::interner::CollectAndApply>>::collect_and_apply::>, core::iter::adapters::copied::Copied>>, rustc_type_ir::relate::relate_args_invariantly::{closure#0}>, ::mk_args_from_iter>, core::iter::adapters::copied::Copied>>, rustc_type_ir::relate::relate_args_invariantly::{closure#0}>, core::result::Result>>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 90,574 ( 0.00%) ???:<[rustc_hir::hir::PathSegment] as rustc_data_structures::stable_hash::StableHash>::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 90,260 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:rustc_hir::intravisit::walk_expr::>'2 89,986 ( 0.00%) ???:rustc_query_impl::query_impl::explicit_clauses_of::invoke_provider_fn::__rust_begin_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 89,946 ( 0.00%) include/jemalloc/internal/tcache_inlines.h:free_default 89,676 ( 0.00%) ???:::lower_pattern_range_endpoint [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 89,640 ( 0.00%) ???:::is_conditionally_const:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 89,438 ( 0.00%) ???:::check_args_compatible_inner'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 89,293 ( 0.00%) ???:>::insert_full [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 89,244 ( 0.00%) src/extent.c:pa_dalloc 89,152 ( 0.00%) include/jemalloc/internal/edata.h:ecache_evict 88,964 ( 0.00%) ???:rustc_mir_build::thir::pattern::check_match::check_match [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 88,919 ( 0.00%) ???:rustc_mir_transform::liveness::check_liveness::{closure#0}'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 88,874 ( 0.00%) ???:::parse_item_kind [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 88,766 ( 0.00%) ???:::is_path_start [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 88,368 ( 0.00%) ???:rustc_query_impl::query_impl::lit_to_const::execute_query_non_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 88,183 ( 0.00%) ???:>::fold_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 87,739 ( 0.00%) ???:::adjust_ident_and_get_scope [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 87,221 ( 0.00%) ???:rustc_trait_selection::traits::project::normalize_projection_term'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 86,995 ( 0.00%) ???:>::types_may_unify_inner [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 86,725 ( 0.00%) ???:>::union'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 86,022 ( 0.00%) ???:::is_exported [???] 85,915 ( 0.00%) ???:rustc_query_impl::plumbing::verify_query_key_hashes_inner::, rustc_middle::query::erase::ErasedData<[u8; 24]>>>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 85,749 ( 0.00%) ???: as core::ops::drop::Drop>::drop::drop_non_singleton::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 85,576 ( 0.00%) ???:::visit_primary_bindings_special::<::declare_bindings::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 85,344 ( 0.00%) ???:::visit_fn [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 84,701 ( 0.00%) ???:realpath [/usr/lib/libc.so.6] 84,680 ( 0.00%) ???:::resolve_ty_and_res_fully_qualified_call [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 84,512 ( 0.00%) ???:rustc_mir_transform::mir_promoted'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 84,158 ( 0.00%) ???:<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::generic_args::GenericArg> as rustc_serialize::serialize::Decodable>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 84,074 ( 0.00%) ???:::visit_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 83,488 ( 0.00%) ???: as rustc_data_structures::stable_hash::StableHash>::stable_hash::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 82,602 ( 0.00%) ???:::lower [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 82,141 ( 0.00%) ???:, ())>>::reserve_rehash::, (), rustc_hash::FxBuildHasher>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 82,069 ( 0.00%) ???:::lower_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 81,882 ( 0.00%) ???:::assemble_inherent_candidates [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 81,552 ( 0.00%) ???: as alloc::vec::spec_extend::SpecExtend>>::spec_extend [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 81,473 ( 0.00%) ???:>::push_stack_frame_raw [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 81,172 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::>, bool), rustc_middle::query::erase::ErasedData<[u8; 8]>>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 80,879 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 80,625 ( 0.00%) ???:::check_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 80,161 ( 0.00%) ???:, rustc_middle::dep_graph::graph::DepNodeIndex))>>::reserve_rehash::<, rustc_middle::dep_graph::graph::DepNodeIndex))>>>::insert_unique::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 79,700 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 78,878 ( 0.00%) ???:, rustc_middle::dep_graph::graph::DepNodeIndex))>>::reserve_rehash::<, rustc_middle::dep_graph::graph::DepNodeIndex))>>>::insert_unique::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 78,814 ( 0.00%) ???:llvm::PassRegistry::registerPass(llvm::PassInfo const&, bool) [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/libLLVM.so.23.1-rust-1.99.0-nightly] 78,755 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_expr::'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 78,587 ( 0.00%) ???:llvm::cl::ParseCommandLineOptions(int, char const* const*, llvm::StringRef, llvm::raw_ostream*, llvm::vfs::FileSystem*, char const*, bool) [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/libLLVM.so.23.1-rust-1.99.0-nightly] 78,568 ( 0.00%) ???:rustc_hir::intravisit::walk_pat::> [???] 78,349 ( 0.00%) ???:>::insert [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 78,314 ( 0.00%) ???:::check_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 78,179 ( 0.00%) ???: as rustc_type_ir::fold::TypeFolder>::fold_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 78,143 ( 0.00%) ???:, rustc_middle::query::erase::ErasedData<[u8; 1]>> as rustc_middle::query::caches::QueryCache>::for_each [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 78,076 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/unwrap.rs:::visit_expr'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 78,006 ( 0.00%) ???:::check_false_global_bounds [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 77,839 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_expr 77,550 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/mod.rs:::check_expr 77,424 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/lib.rs:::check_expr 77,424 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/char/methods.rs:::check_expr 77,424 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cmp.rs:::check_expr 77,424 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/source.rs:::check_expr 77,379 ( 0.00%) ???:rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::associated_item_def_ids [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 77,280 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:::check_expr 77,195 ( 0.00%) ???:, rustc_middle::dep_graph::graph::DepNodeIndex))>>::reserve_rehash::<, rustc_middle::dep_graph::graph::DepNodeIndex))>>>::insert_unique::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 76,812 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 76,636 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:clippy_utils::msrvs::check_attrs:: 76,631 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/functions/too_many_lines.rs:::check_fn 75,875 ( 0.00%) ???:::visit_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 75,799 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:::check_attributes 75,717 ( 0.00%) ???:rustc_codegen_ssa::codegen_attrs::codegen_fn_attrs [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 75,661 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/map.rs:::check 75,589 ( 0.00%) ???:rustc_hir_analysis::check::wfcheck::enter_wf_checking_ctxt:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 75,571 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:::check_attributes 75,159 ( 0.00%) ???:>::eval_rvalue_into_place [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 74,952 ( 0.00%) ???:::visit_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 74,852 ( 0.00%) ???:rustc_lint::levels::skippable_lints'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 74,645 ( 0.00%) include/jemalloc/internal/tsd.h:pa_alloc 74,532 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_attributes 74,532 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_attributes 74,291 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:clippy_utils::msrvs::check_attrs:: 74,103 ( 0.00%) ???:::parse_line [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 73,917 ( 0.00%) ???:::lower_path_segment [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 73,889 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::meets 73,771 ( 0.00%) include/jemalloc/internal/thread_event.h:free_default 73,770 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 73,769 ( 0.00%) ???:::instantiate_identity_into [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 73,763 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs: as alloc::vec::spec_from_iter_nested::SpecFromIterNested<(rustc_span::span_encoding::Span, alloc::string::String), core::iter::adapters::filter_map::FilterMap, clippy_lints::doc::suspicious_doc_comments::collect_doc_replacements::{closure#0}>>>::from_iter 73,735 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/visit.rs:>::walk_ref'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 73,378 ( 0.00%) ???:::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 73,359 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::trim_start_matches::<::is_whitespace> 73,138 ( 0.00%) ???:::ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 73,050 ( 0.00%) ???:::features [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 73,044 ( 0.00%) ???:::lower_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 72,771 ( 0.00%) include/jemalloc/internal/tsd_tls.h:realloc 72,517 ( 0.00%) ???:rustc_passes::diagnostic_items::all_diagnostic_items [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 72,507 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:clippy_utils::attrs::parse_attrs::<::pop_attrs::{closure#0}, rustc_hir::hir::Attribute> 72,485 ( 0.00%) ???:::lower_qpath'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 72,394 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:clippy_utils::attrs::parse_attrs::<::push_attrs::{closure#0}, rustc_hir::hir::Attribute> 72,375 ( 0.00%) include/jemalloc/internal/atomic.h:pa_dalloc 72,280 ( 0.00%) ???:::parse_fn_params [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 72,130 ( 0.00%) ???:>::super_fold_with::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 72,071 ( 0.00%) ???:::get_line [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 72,044 ( 0.00%) ???:::get_str [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 72,029 ( 0.00%) ???:::check_expr_post [???] 71,946 ( 0.00%) ???:::assemble_inherent_impl_candidates_for_type [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 71,792 ( 0.00%) ???:::walk::<::could_be_never_pattern::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 71,661 ( 0.00%) ???:::new'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 71,646 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/const_ptr.rs:::trim_matches::<::is_whitespace> 71,646 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mut_ptr.rs:::trim_matches::<::is_whitespace> 71,646 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/traits.rs:::trim_matches::<::is_whitespace> 71,434 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:clippy_utils::attrs::parse_attrs::<::push_attrs::{closure#0}, rustc_hir::hir::Attribute> 71,409 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/lib.rs:::check_expr 71,352 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/const_ptr.rs:::check_attributes 71,187 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs: as alloc::vec::spec_from_iter_nested::SpecFromIterNested<(rustc_span::span_encoding::Span, alloc::string::String), core::iter::adapters::filter_map::FilterMap, clippy_lints::doc::suspicious_doc_comments::collect_doc_replacements::{closure#0}>>>::from_iter 71,187 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:clippy_utils::attrs::parse_attrs::<::pop_attrs::{closure#0}, rustc_hir::hir::Attribute> 71,112 ( 0.00%) ???:::visit_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 71,106 ( 0.00%) ???:::parse_pat_range_end [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 71,064 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::get_text::<&rustc_lint::context::EarlyContext> 70,997 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::check_expr 70,988 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/validations.rs:::check_attributes 70,940 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:clippy_lints::doc::suspicious_doc_comments::check 70,940 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/spec_from_iter.rs:clippy_lints::doc::suspicious_doc_comments::check 70,940 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:clippy_lints::doc::suspicious_doc_comments::check 70,800 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/filter_map.rs:clippy_utils::macros::root_macro_call 70,375 ( 0.00%) ???:rustc_attr_parsing::context::ATTRIBUTE_PARSERS::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 70,336 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/pattern.rs:::check_fn 70,201 ( 0.00%) ???:::find_library_crate [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 70,135 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:clippy_lints::minmax::min_max 69,897 ( 0.00%) ???:::lower_item_kind [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 69,839 ( 0.00%) ???:, rustc_middle::dep_graph::graph::DepNodeIndex))>>::reserve_rehash::<, rustc_middle::dep_graph::graph::DepNodeIndex))>>>::insert_unique::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 69,819 ( 0.00%) ???:::check_item [???] 69,800 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs:::check_path [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 69,426 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 69,212 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_expr 69,082 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 69,047 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/hygiene.rs:clippy_utils::macros::root_macro_call 68,853 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/neg_multiply.rs:::check_expr 68,784 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:::check_expr 68,765 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:::check_expr_post 68,760 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:::check_expr 68,749 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/hygiene.rs:::check_expr 68,742 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint/src/context.rs:::check_expr 68,742 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/hygiene.rs:::check_expr 68,742 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/hygiene.rs:::check_expr 68,742 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/hygiene.rs:::check_expr 68,742 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/hygiene.rs:::check_expr 68,742 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/hygiene.rs:::check_expr 68,742 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/hygiene.rs:::check_expr 68,742 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/lib.rs:::check_expr 68,742 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cmp.rs:::check_expr 68,742 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cmp.rs:::check_expr 68,742 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/fuse.rs:clippy_lints::operators::eq_op::check_assert 68,742 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::check_expr 68,742 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 68,742 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_expr 68,742 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_expr 68,742 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_expr 68,742 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_expr 68,742 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_expr 68,742 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_expr 68,742 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/map.rs:::check_expr 68,568 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_expr::::check::{closure#0}>>'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 68,525 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint/src/context.rs:::check_expr 68,524 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 68,520 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:::check_expr 68,504 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint/src/context.rs:clippy_utils::fn_def_id_with_node_args 68,504 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:::check_expr 68,504 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/map.rs:::check_expr 68,466 ( 0.00%) ???:::visit_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 68,427 ( 0.00%) ???:rustc_hir_analysis::check::compare_impl_item::compare_impl_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 68,344 ( 0.00%) ???:::encode_info_for_mod [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 68,250 ( 0.00%) include/jemalloc/internal/arena_inlines_b.h:free_default 68,227 ( 0.00%) ???:::assemble_candidates_from_impls [???] 67,965 ( 0.00%) ???:::parse_block [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 67,618 ( 0.00%) ???:::visit_generic_params [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 67,259 ( 0.00%) ???:::check_stability [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 66,880 ( 0.00%) ???:::visit_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 66,852 ( 0.00%) ???:rustc_type_ir::relate::relate_args_with_variances:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 66,743 ( 0.00%) ???:<&mut core::iter::adapters::map::map_fold<&(&str, rustc_target::target_features::Stability, &[&str]), (&str, rustc_target::target_features::Stability, &[&str]), (), <(&str, rustc_target::target_features::Stability, &[&str]) as core::clone::Clone>::clone, core::iter::adapters::map::map_fold<(&str, rustc_target::target_features::Stability, &[&str]), (&str, rustc_target::target_features::Stability), (), rustc_target::target_features::all_rust_features::{closure#0}, core::iter::adapters::filter::filter_fold<(&str, rustc_target::target_features::Stability), (), ::fill_well_known::{closure#3}, core::iter::adapters::map::map_fold<(&str, rustc_target::target_features::Stability), &str, (), ::fill_well_known::{closure#4}, &mut core::iter::adapters::map::map_fold<&str, rustc_span::symbol::Symbol, (), ::intern, core::iter::adapters::map::map_fold, (), core::option::Option::Some, core::iter::adapters::map::map_fold, (core::option::Option, ()), (), , rustc_hash::FxBuildHasher> as core::iter::traits::collect::Extend>>::extend, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>>, rustc_target::target_features::all_rust_features::{closure#0}>, ::fill_well_known::{closure#3}>, ::fill_well_known::{closure#4}>, core::iter::adapters::cloned::Cloned>>, ::intern>, core::option::Option::Some>>::{closure#0}, core::iter::traits::iterator::Iterator::for_each::call<(core::option::Option, ()), , (), rustc_hash::FxBuildHasher> as core::iter::traits::collect::Extend<(core::option::Option, ())>>::extend, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>>, rustc_target::target_features::all_rust_features::{closure#0}>, ::fill_well_known::{closure#3}>, ::fill_well_known::{closure#4}>, core::iter::adapters::cloned::Cloned>>, ::intern>, core::option::Option::Some>, , rustc_hash::FxBuildHasher> as core::iter::traits::collect::Extend>>::extend, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>, core::slice::iter::Iter<(&str, rustc_target::target_features::Stability, &[&str])>>>, rustc_target::target_features::all_rust_features::{closure#0}>, ::fill_well_known::{closure#3}>, ::fill_well_known::{closure#4}>, core::iter::adapters::cloned::Cloned>>, ::intern>, core::option::Option::Some>>::{closure#0}>>::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0} as core::ops::function::FnMut<((), &(&str, rustc_target::target_features::Stability, &[&str]))>>::call_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 66,673 ( 0.00%) ???:::try_plant_decl_into_local_module [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 66,204 ( 0.00%) ???:::is_trivially_wf [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 65,997 ( 0.00%) ???:rustc_hir::intravisit::walk_pat:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 65,850 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 65,772 ( 0.00%) ???:::expr_as_place [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 65,719 ( 0.00%) ???:::build_exit_tree [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 65,445 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:::check_expr 65,295 ( 0.00%) ???:rustc_target::spec::add_link_args [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 65,253 ( 0.00%) ???:::visit_pat'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 65,182 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/misc_early/mod.rs:::check_pat [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 64,932 ( 0.00%) src/pac.c:tcache_bin_flush_small 64,844 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_pat:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 64,554 ( 0.00%) ???:>::from [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 64,525 ( 0.00%) ???:::visit_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 64,416 ( 0.00%) ???:>>::walk_ref'2 [???] 64,327 ( 0.00%) ???:::walk_::<::pat_error_reported::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 64,103 ( 0.00%) ???:rustc_query_impl::query_impl::inferred_outlives_of::invoke_provider_fn::__rust_begin_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 63,712 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 63,625 ( 0.00%) ???:::parse_item_common [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 63,582 ( 0.00%) ???:::expr_into_dest [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 63,537 ( 0.00%) ???:::is_desugaring [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 63,490 ( 0.00%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 63,469 ( 0.00%) ???:::resolve_imports [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 63,024 ( 0.00%) ???:>::reserve_rehash::>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 62,509 ( 0.00%) src/emap.c:tcache_bin_flush_small 62,396 ( 0.00%) ???:core::ptr::drop_glue::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 62,275 ( 0.00%) ???:::check_def_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 62,225 ( 0.00%) ???: as core::clone::Clone>::clone [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 62,053 ( 0.00%) ???:::trait_impl_of_assoc [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 62,025 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 62,023 ( 0.00%) ???:::lookup_probe [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 61,433 ( 0.00%) include/jemalloc/internal/cache_bin.h:free_default 61,321 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_pat:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 61,217 ( 0.00%) ???:::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 61,103 ( 0.00%) ???:::render [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 61,080 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs: as core::clone::Clone>::clone [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 60,996 ( 0.00%) ???:rustc_query_impl::query_impl::impl_trait_header::invoke_provider_fn::__rust_begin_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 60,965 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:::check_expr 60,957 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/ascii.rs:::check_expr 60,819 ( 0.00%) ???:rustc_hir::intravisit::walk_pat:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 60,758 ( 0.00%) ???:::visit_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 60,740 ( 0.00%) ???:rustc_query_impl::query_impl::def_kind::invoke_provider_fn::__rust_begin_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 60,735 ( 0.00%) ???:rustc_hir::intravisit::walk_pat:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 60,735 ( 0.00%) ???:rustc_hir::intravisit::walk_pat:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 60,735 ( 0.00%) ???:rustc_hir::intravisit::walk_pat:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 60,709 ( 0.00%) ???:rustc_passes::reachable::reachable_set'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 60,690 ( 0.00%) ???:rustc_hir::intravisit::walk_pat:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 60,618 ( 0.00%) ???:::hir_body [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 60,614 ( 0.00%) ???:::ast_block'2 [???] 60,465 ( 0.00%) ???:core::ptr::drop_glue::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 60,421 ( 0.00%) ???: as rustc_hir::intravisit::Visitor>::visit_nested_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 60,418 ( 0.00%) ???:::recover_after_dot [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 60,305 ( 0.00%) ???:), rustc_middle::traits::cache::WithDepNode, rustc_middle::traits::SelectionError>>)>>::reserve_rehash::), rustc_middle::traits::cache::WithDepNode, rustc_middle::traits::SelectionError>>, rustc_hash::FxBuildHasher>::{closure#0}> [???] 60,107 ( 0.00%) src/pac.c:pa_alloc 60,060 ( 0.00%) ???:::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 60,054 ( 0.00%) ???:)>, rustc_middle::query::erase::ErasedData<[u8; 32]>> as rustc_middle::query::caches::QueryCache>::for_each [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 59,998 ( 0.00%) include/jemalloc/internal/bit_util.h:realloc 59,981 ( 0.00%) ???:rustc_hir::intravisit::walk_pat::>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 59,920 ( 0.00%) ???:::visit_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 59,822 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_pat:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 59,732 ( 0.00%) include/jemalloc/internal/ph.h:ecache_evict 59,719 ( 0.00%) ???:::parse_stmt_without_recovery'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 59,587 ( 0.00%) src/thread_event.c:free_default 59,549 ( 0.00%) ???:rustc_middle::ty::consts::lit::const_lit_matches_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 59,539 ( 0.00%) ???:rustc_hir_analysis::variance::crate_variances [???] 59,535 ( 0.00%) include/jemalloc/internal/extent.h:pa_dalloc 59,510 ( 0.00%) include/jemalloc/internal/bit_util.h:tcache_bin_flush_small 59,461 ( 0.00%) ???:rustc_hir_analysis::check::region::region_scope_tree [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 59,290 ( 0.00%) ???:rustc_hir::intravisit::walk_pat:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 59,289 ( 0.00%) ???:::as_call_operand'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 59,200 ( 0.00%) ???:rustc_query_impl::query_impl::associated_item::execute_query_non_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 59,164 ( 0.00%) ???:>::walk_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 58,949 ( 0.00%) ???:>::fold_ty'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 58,932 ( 0.00%) ???:::evaluate_obligation_no_overflow [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 58,836 ( 0.00%) ???:>::extend_desugared::>, rustc_trait_selection::traits::fulfill::args_infer_vars::{closure#0}>, core::iter::adapters::map::Map, std::collections::hash::map::IntoIter>, fn((rustc_middle::ty::generic_args::GenericArg, ())) -> rustc_middle::ty::generic_args::GenericArg>, rustc_trait_selection::traits::fulfill::args_infer_vars::{closure#1}>, ::maybe_from_generic_arg>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 58,794 ( 0.00%) ???:rustc_hir::intravisit::walk_pat::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 58,670 ( 0.00%) ???:>::regions [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 58,517 ( 0.00%) ???:::nominal_obligations [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 58,326 ( 0.00%) ???:::build_drop_trees [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 57,980 ( 0.00%) ???:::check_inline_const [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 57,859 ( 0.00%) ???:rustc_hir::intravisit::walk_pat:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 57,646 ( 0.00%) include/jemalloc/internal/ph.h:eset_remove 57,628 ( 0.00%) ???:>::destroy [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 57,417 ( 0.00%) ???:::eq_trace::>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 57,403 ( 0.00%) ???:>, alloc::vec::into_iter::IntoIter>>, rustc_trait_selection::traits::predicates_for_generics<::lookup_method_for_operator::{closure#1}, ::lookup_method_for_operator::{closure#2}>::{closure#0}> as core::iter::traits::iterator::Iterator>::next [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 57,396 ( 0.00%) ???:::next [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 57,259 ( 0.00%) ???:::lookup_source_file [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 57,222 ( 0.00%) ???:>::super_fold_with::::handle_term::outer_exclusive_binder, ::new_error>::{closure#0}>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 56,582 ( 0.00%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 56,508 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_qpath:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 56,409 ( 0.00%) ???:::visit_primary_bindings_special::<::declare_bindings::{closure#0}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 56,390 ( 0.00%) src/bitmap.c:malloc_default 56,346 ( 0.00%) ???:::stable_hash::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 56,249 ( 0.00%) ???:::stmt_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 56,043 ( 0.00%) ???:rustc_hir_analysis::check::check::check_coroutine_obligations [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 55,956 ( 0.00%) ???:>), rustc_middle::traits::cache::WithDepNode)>>::reserve_rehash::>), rustc_middle::traits::cache::WithDepNode, rustc_hash::FxBuildHasher>::{closure#0}> [???] 55,806 ( 0.00%) ???:>::super_visit_with::<::any_free_region_meets::RegionVisitor<::all_free_regions_meet::{closure#0}>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 55,772 ( 0.00%) ???:::add_import::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 55,748 ( 0.00%) ???:::insert [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 55,728 ( 0.00%) ???:>::rebase_onto [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 55,533 ( 0.00%) ???:>::super_fold_with::::renumber_regions::visit_ty::{closure#0}>::{closure#0}>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 55,503 ( 0.00%) ???:::write_str [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 55,494 ( 0.00%) ???:::const_eval_resolve [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 55,427 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 55,394 ( 0.00%) ???:rustc_type_ir::relate::structurally_relate_tys::::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 55,286 ( 0.00%) ???:>::fold_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 55,272 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/visit.rs:>::walk_ref [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 55,154 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/misc_early/redundant_pattern.rs:clippy_lints::misc_early::redundant_pattern::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 55,031 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/incompatible_msrv.rs:::emit_lint_if_under_msrv [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 55,000 ( 0.00%) ???:rustc_query_impl::query_impl::lookup_deprecation_entry::invoke_provider_fn::__rust_begin_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 54,996 ( 0.00%) ???:>, (rustc_middle::query::erase::ErasedData<[u8; 2]>, rustc_middle::dep_graph::graph::DepNodeIndex))>>::reserve_rehash::<>, (rustc_middle::query::erase::ErasedData<[u8; 2]>, rustc_middle::dep_graph::graph::DepNodeIndex))>>>::insert_unique::{closure#0}> [???] 54,991 ( 0.00%) ???:::resolve_doc_links [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 54,889 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_qpath:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 54,716 ( 0.00%) ???:rustc_hir::intravisit::walk_pat::<::collect_taits_declared_in_body::TaitInBodyFinder> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 54,702 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 54,654 ( 0.00%) ???:::check_expr_block [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 54,637 ( 0.00%) ???:::evaluate_predicate_recursively [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 54,440 ( 0.00%) ???:::unresolved_root_variables [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 54,399 ( 0.00%) ???:::parse_stmt_without_recovery [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 54,360 ( 0.00%) ???:::lang_items [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 54,202 ( 0.00%) ???: as rustc_type_ir::visit::TypeVisitor>::visit_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 54,200 ( 0.00%) ???:>, rustc_middle::query::erase::ErasedData<[u8; 8]>> as rustc_middle::query::caches::QueryCache>::for_each'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 54,140 ( 0.00%) ???:::opt_rpitit_info [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 54,076 ( 0.00%) ???:::parse_ty_common'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 54,016 ( 0.00%) ???:::try_to_place [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 53,997 ( 0.00%) ???:::parse_pat_range_begin_with [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 53,955 ( 0.00%) ???:> as rustc_type_ir::interner::CollectAndApply>>::collect_and_apply::>, core::iter::adapters::copied::Copied>>, rustc_type_ir::relate::relate_args_invariantly::{closure#0}>, ::mk_args_from_iter>, core::iter::adapters::copied::Copied>>, rustc_type_ir::relate::relate_args_invariantly::{closure#0}>, core::result::Result>>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 53,846 ( 0.00%) ???:::ast_block [???] 53,483 ( 0.00%) ???:::visit_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 53,483 ( 0.00%) ???:rustc_middle::thir::visit::walk_pat:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 53,406 ( 0.00%) ???:, rustc_middle::dep_graph::graph::DepNodeIndex))>>::reserve_rehash::<, rustc_middle::dep_graph::graph::DepNodeIndex))>>>::insert_unique::{closure#0}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 53,142 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/hir.rs:rustc_hir::intravisit::walk_expr::>'2 53,012 ( 0.00%) ???:rustc_passes::dead::live_symbols_and_ignored_derived_traits'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 52,989 ( 0.00%) ???:rustc_traits::dropck_outlives::dropck_outlives [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 52,888 ( 0.00%) ???:, ())>>::reserve_rehash::, (), rustc_hash::FxBuildHasher>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 52,694 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 52,667 ( 0.00%) include/jemalloc/internal/atomic.h:malloc_default 52,592 ( 0.00%) ???:::fork [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 52,584 ( 0.00%) ???:::stable_hash::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 52,546 ( 0.00%) ???:::check_expr_field [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 52,503 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 52,445 ( 0.00%) ???:::mk_canonical_var_kinds [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 52,445 ( 0.00%) ???:rustc_type_ir::elaborate::elaborate:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 52,436 ( 0.00%) ???:::hir_body_owned_by [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 52,410 ( 0.00%) ???:::collect_tokens_no_attrs::::parse_attribute::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 52,404 ( 0.00%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 51,576 ( 0.00%) ???:rustc_target::spec::crt_objects::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 51,520 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 51,495 ( 0.00%) ???:::parse_fn [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 51,274 ( 0.00%) ???:alloc::fmt::format::format_inner [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 50,967 ( 0.00%) ???:::check_expr_block'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 50,862 ( 0.00%) ???:::qpath_res [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 50,833 ( 0.00%) ???:rustc_hir::intravisit::walk_pat::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 50,569 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/unneeded_struct_pattern.rs:::check_pat [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 50,540 ( 0.00%) ???:> as rustc_serialize::serialize::Decodable>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 50,382 ( 0.00%) ???:, rustc_middle::dep_graph::graph::DepNodeIndex> as rustc_middle::query::caches::QueryCache>::for_each [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 50,311 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/const_ptr.rs:::trim_start_matches::<::is_whitespace> 50,311 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/traits.rs:::trim_start_matches::<::is_whitespace> 50,252 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint/src/context.rs:::emit_span_lint::::display::{closure#0}>::{closure#0}>> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 50,246 ( 0.00%) include/jemalloc/internal/sz.h:eset_remove 50,178 ( 0.00%) ???: as rustc_ast::visit::Visitor>::visit_expr [???] 50,168 ( 0.00%) ???:rustc_type_ir::relate::structurally_relate_tys::::{closure#0}'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 50,064 ( 0.00%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 50,022 ( 0.00%) src/decay.c:tcache_bin_flush_small 49,910 ( 0.00%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 49,910 ( 0.00%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 49,910 ( 0.00%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 49,804 ( 0.00%) ???: as core::clone::Clone>::clone::clone_non_singleton:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 49,717 ( 0.00%) include/jemalloc/internal/edata.h:eset_remove 49,701 ( 0.00%) ???:::visit_pat'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 49,676 ( 0.00%) ???:core::ptr::drop_glue::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 49,675 ( 0.00%) src/eset.c:tcache_bin_flush_small 49,656 ( 0.00%) ???:::visit_nested_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 49,422 ( 0.00%) ???:rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::module_children [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 49,399 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/matches/mod.rs:::check_expr::{closure#0} [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 49,321 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::query::erase::ErasedData<[u8; 24]>>, false>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 49,312 ( 0.00%) ???:__strtoul_internal [/usr/lib/libc.so.6] 49,224 ( 0.00%) src/thread_event.c:malloc_default 49,049 ( 0.00%) ???:::walk::<::resolve_pattern_inner::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 49,034 ( 0.00%) ???:::par_items::::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 48,772 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/source.rs:::check_expr 48,718 ( 0.00%) ???:>::find_cycles_from_node::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 48,606 ( 0.00%) ???:core::slice::sort::unstable::quicksort::quicksort::::sort_unstable_by<::new::{closure#2}>::{closure#0}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 48,568 ( 0.00%) ???:>::reserve_rehash::::{closure#0}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 48,464 ( 0.00%) ???:createX86MCAsmInfo(llvm::MCRegisterInfo const&, llvm::Triple const&, llvm::MCTargetOptions const&) [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/libLLVM.so.23.1-rust-1.99.0-nightly] 48,343 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 48,233 ( 0.00%) ???:::parse_expr_paren_seq [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 48,180 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 48,141 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/almost_complete_range.rs:::check_pat [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 48,089 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/matches/rest_pat_in_fully_bound_struct.rs:clippy_lints::matches::rest_pat_in_fully_bound_struct::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 47,963 ( 0.00%) ???:)>>::reserve_rehash::, rustc_hash::FxBuildHasher>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 47,885 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:clippy_utils::source::get_source_range 47,885 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:clippy_utils::source::get_source_range 47,877 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs:::into_range 47,799 ( 0.00%) ???:::node_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 47,733 ( 0.00%) ???:::parse_item_common'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 47,732 ( 0.00%) ???:::walk_::<::walk_always<::each_binding<::contains_explicit_ref_binding::{closure#0}>::{closure#0}>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 47,674 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::deref [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 47,674 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::new 47,612 ( 0.00%) ???:::visit_pat_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 47,599 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/mod.rs:::from_lit_kind 47,596 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::new 47,595 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_expr 47,595 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::from_lit_kind 47,595 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:::from_lit_kind 47,592 ( 0.00%) ???:core::ptr::drop_glue::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 47,590 ( 0.00%) ???:::get_extern_module_with_lock [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 47,562 ( 0.00%) ???:rustc_ty_utils::needs_drop::needs_drop_raw [???] 47,551 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/cmp.rs:::new 47,540 ( 0.00%) ???:>, &mut rustc_infer::infer::snapshot::undo_log::InferCtxtUndoLogs>>>::uninlined_get_root_key [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 47,523 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/mod.rs:::new 47,523 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/const_ptr.rs:::new 47,486 ( 0.00%) ???:::walk_::<::necessary_variants::{closure#0}> [???] 47,324 ( 0.00%) ???:::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 47,261 ( 0.00%) ???:::deeply_normalize:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 47,255 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 47,239 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:::visit_qpath [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 47,233 ( 0.00%) ???:::try_fold_free_or_assoc [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 47,111 ( 0.00%) ???:::resolve_and_cache_rustdoc_path [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 46,859 ( 0.00%) ???:::hash_expn:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 46,723 ( 0.00%) ???:::visit_path [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 46,704 ( 0.00%) src/tcache.c:realloc 46,590 ( 0.00%) ???:>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 46,503 ( 0.00%) ???:rustc_type_ir::relate::combine::combine_ty_args::>::relate_ty_args::{closure#0}::{closure#0}>::{closure#0}>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 46,414 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/disallowed_fields.rs:::check_pat [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 46,359 ( 0.00%) ???:>::apply_constructor [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 46,354 ( 0.00%) ???:::insert_term [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 46,292 ( 0.00%) ???:::demand_eqtype_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 46,280 ( 0.00%) ???:rustc_query_impl::query_impl::def_ident_span::invoke_provider_fn::__rust_begin_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 46,165 ( 0.00%) ???:> as rustc_middle::query::caches::QueryCache>::for_each [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 46,096 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/pattern.rs:::trim_start_matches::<::is_whitespace> 46,044 ( 0.00%) ???:rustc_ty_utils::implied_bounds::assumed_wf_types [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 45,818 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/returns/needless_return.rs:clippy_lints::returns::needless_return::check_final_expr'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 45,703 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/manual_range_patterns.rs:::check_pat [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 45,658 ( 0.00%) ???:rustc_ast::mut_visit::walk_fn:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 45,512 ( 0.00%) ???:::check_snake_case [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 45,503 ( 0.00%) /rustc/84b36a78a28a63f134171c670be1932ffa2485f8/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/build/tikv-jemalloc-sys/80122c672fbe49ef/out/build/src/extent.c:ecache_evict [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 45,424 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::)>, rustc_middle::query::erase::ErasedData<[u8; 32]>>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 45,270 ( 0.00%) ???:::mirror_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 45,209 ( 0.00%) ???:>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 45,128 ( 0.00%) src/sz.c:tcache_bin_flush_small 45,126 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/misc_early/unneeded_field_pattern.rs:clippy_lints::misc_early::unneeded_field_pattern::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 44,987 ( 0.00%) ???:0x0000000000040c70 [/usr/lib/libc.so.6] 44,938 ( 0.00%) ???:getopts::find_opt [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 44,606 ( 0.00%) ???:rustc_ty_walk::walk_types:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 44,498 ( 0.00%) ???:>, >::flatten_or_pat::{closure#0}>, smallvec::IntoIter<[rustc_pattern_analysis::pat::PatOrWild; 1]>> as core::iter::traits::iterator::Iterator>::next [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 44,422 ( 0.00%) ???:::is_path_start_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 44,332 ( 0.00%) ???:>::walk::::{closure#0}::{closure#0}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 44,313 ( 0.00%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 44,243 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::query::erase::ErasedData<[u8; 1]>>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 44,241 ( 0.00%) ???:::brg_visit_item'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 44,200 ( 0.00%) ???:::eq [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 44,172 ( 0.00%) ???:::walk::<::check_consistent_bindings::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 44,025 ( 0.00%) ???:rustc_hir::intravisit::walk_qpath::> [???] 43,957 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/dereference.rs:::check_pat [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 43,839 ( 0.00%) ???:::assemble_extension_candidates_for_trait [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 43,778 ( 0.00%) src/thread_event.c:realloc 43,592 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 43,524 ( 0.00%) ???:> as rustc_middle::query::caches::QueryCache>::for_each [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 43,522 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 43,428 ( 0.00%) ???:rustc_query_impl::query_impl::implementations_of_trait::execute_query_non_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 43,231 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/needless_borrowed_ref.rs:::check_pat [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 43,158 ( 0.00%) ???: as rustc_hir::intravisit::Visitor>::visit_nested_item'2 [???] 43,107 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 43,076 ( 0.00%) include/jemalloc/internal/mutex.h:pa_dalloc 42,950 ( 0.00%) ???:rustc_query_impl::plumbing::verify_query_key_hashes_inner::), rustc_middle::query::erase::ErasedData<[u8; 16]>>>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 42,911 ( 0.00%) ???:>::fold_predicate [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 42,897 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 42,895 ( 0.00%) ???:::walk_::<::walk_always<::lower_pattern::{closure#0}>::{closure#0}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 42,617 ( 0.00%) ???:::equate_trait_refs [???] 42,588 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:::visit_arm 42,553 ( 0.00%) ???:::walk_::<::is_never_pattern::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 42,543 ( 0.00%) ???: as rustc_type_ir::visit::TypeVisitor>::visit_ty'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 42,524 ( 0.00%) ???:rustc_traits::normalize_projection_ty::normalize_canonicalized_projection [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 42,495 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/matches/collapsible_match.rs:clippy_lints::matches::collapsible_match::check_arm [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 42,400 ( 0.00%) ???: as alloc::vec::spec_extend::SpecExtend>>::spec_extend [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 42,372 ( 0.00%) ???:rustc_ty_utils::instance::resolve_instance_raw [???] 42,265 ( 0.00%) ???:rustc_trait_selection::traits::normalize::normalize_with_depth_to::>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 42,215 ( 0.00%) ???:::finish_grow [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 42,214 ( 0.00%) ???:rustc_lint::levels::shallow_lint_levels_on [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 41,954 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 41,726 ( 0.00%) ???:::confirm_auto_impl_candidate::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 41,709 ( 0.00%) ???: as core::iter::traits::collect::Extend>::extend_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 41,468 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:core::ptr::drop_glue::::{closure#0}>, rustc_middle::lint::LevelSpec>::{closure#0}> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 41,384 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/lint.rs:::emit_span_lint::::display::{closure#0}>::{closure#0}>> 41,384 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs:::emit_span_lint::::display::{closure#0}>::{closure#0}>> 41,378 ( 0.00%) ???:::split::>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 41,355 ( 0.00%) ???:::lower_attrs_with_extra [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 41,341 ( 0.00%) ???:::eq [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 41,150 ( 0.00%) ???:::visit_expr::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 41,049 ( 0.00%) ???:::lower_ty'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 41,024 ( 0.00%) ???:core::ptr::drop_glue::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 40,970 ( 0.00%) ???:::source_callsite [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 40,907 ( 0.00%) ???:rustc_mir_build::check_unsafety::check_unsafety [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 40,562 ( 0.00%) ???:::leak_check [???] 40,553 ( 0.00%) ???:::finalize_import::{closure#2} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 40,322 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 40,305 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 40,299 ( 0.00%) ???:::hash::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 40,223 ( 0.00%) ???: as core::iter::traits::iterator::Iterator>::next [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 39,970 ( 0.00%) ???:> as rustc_middle::query::caches::QueryCache>::for_each'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 39,915 ( 0.00%) ???:rustc_query_impl::plumbing::verify_query_key_hashes_inner::>, rustc_middle::query::erase::ErasedData<[u8; 8]>>>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 39,724 ( 0.00%) ???:::parse_item_impl [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 39,607 ( 0.00%) ???:rustc_trait_selection::traits::type_known_to_meet_bound_modulo_regions [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 39,582 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::query::erase::ErasedData<[u8; 1]>>, false>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 39,457 ( 0.00%) ???:::visit_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 39,364 ( 0.00%) ???:>::drop_slow [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 39,318 ( 0.00%) ???:::visit_pat'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 39,222 ( 0.00%) ???:::maybe_resolve_crate'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 39,141 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/mod.rs:::check_fn 39,121 ( 0.00%) ???:::match_projection_projections [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 39,117 ( 0.00%) ???:>>::from [???] 39,071 ( 0.00%) ???:::visit_assoc_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 39,012 ( 0.00%) ???:::resolve_crate::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 38,950 ( 0.00%) ???:rustc_hir_analysis::check::region::resolve_block'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 38,830 ( 0.00%) ???:::parse_block_common'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 38,819 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_expr 38,796 ( 0.00%) ???:rustc_traits::type_op::type_op_normalize_fn_sig [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 38,795 ( 0.00%) ???:::typeck_root_def_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 38,718 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/traits.rs:>::next_back 38,712 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_data_structures/src/packed.rs:::check_expr 38,712 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint/src/levels.rs:::check_expr 38,712 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint/src/levels.rs:::check_expr 38,712 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint/src/levels.rs:::check_expr 38,712 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/lib.rs:::check_expr 38,712 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/lib.rs:::check_expr 38,712 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:::check_expr 38,712 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:::check_expr 38,712 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/index.rs:::check_expr 38,712 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:::check_expr 38,712 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:::check_expr 38,711 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/cmp.rs:::check_expr 38,693 ( 0.00%) ???:rustc_privacy::effective_visibilities'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 38,640 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/spec_from_iter.rs:::check_expr 38,640 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs: as alloc::vec::spec_from_iter_nested::SpecFromIterNested, ::len>>>::from_iter 38,640 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/index.rs: as alloc::vec::spec_from_iter_nested::SpecFromIterNested, ::len>>>::from_iter 38,640 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/pattern.rs:clippy_lints::misc_early::mixed_case_hex_literals::check 38,473 ( 0.00%) ???:rustc_hir_analysis::check::wfcheck::lint_redundant_lifetimes [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 38,306 ( 0.00%) ???:::visit_pat'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 38,299 ( 0.00%) ???:::instantiate_bound_regions::, ::visit_terminator::{closure#0}>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 38,183 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::visit_arm [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 38,167 ( 0.00%) ???:::parse_block_common [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 37,986 ( 0.00%) ???:, ::candidate_from_obligation_no_cache::{closure#1}>, core::option::Option>, , rustc_middle::traits::SelectionError>>::transpose>, core::result::Result> as core::iter::traits::iterator::Iterator>::next [???] 37,897 ( 0.00%) ???:>::fold_ty'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 37,605 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/combined_early_pass.rs:::check_pat [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 37,296 ( 0.00%) ???:core::ptr::drop_glue::]>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 37,214 ( 0.00%) ???:core::slice::sort::shared::smallsort::bidirectional_merge::::sort_by_key<&core::option::Option, , rustc_middle::ty::assoc::AssocItem> as core::iter::traits::collect::FromIterator<(core::option::Option, rustc_middle::ty::assoc::AssocItem)>>::from_iter, rustc_ty_utils::assoc::associated_items::{closure#0}>, ::new, rustc_ty_utils::assoc::associated_items::{closure#0}>>::{closure#0}>>::{closure#0}>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 37,201 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::dep_graph::graph::DepNodeIndex>, false>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 37,197 ( 0.00%) ???:::visit_nested_item'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 37,179 ( 0.00%) ???:::instantiate_binder_with_fresh_vars::ToFreshVars> as rustc_type_ir::fold::TypeFolder>::fold_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 37,122 ( 0.00%) ???:::build_reduced_graph_for_external_crate_res::{closure#2} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 37,062 ( 0.00%) ???: as core::iter::traits::collect::Extend>::extend_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 36,982 ( 0.00%) ???:0x0000000000176b40 [/usr/lib/libc.so.6] 36,933 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 36,916 ( 0.00%) ???:rustc_hir_analysis::check::region::resolve_block [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 36,844 ( 0.00%) ???:::is_pat_range_end_start::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 36,821 ( 0.00%) /rustc/84b36a78a28a63f134171c670be1932ffa2485f8/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/build/tikv-jemalloc-sys/80122c672fbe49ef/out/build/src/eset.c:eset_remove [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 36,800 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/ast.rs:>::walk_ref [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 36,798 ( 0.00%) ???:>::reserve_rehash::>::{closure#0}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 36,765 ( 0.00%) ???:, rustc_middle::dep_graph::graph::DepNodeIndex))>>::reserve_rehash::<, rustc_middle::dep_graph::graph::DepNodeIndex))>>>::insert_unique::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 36,656 ( 0.00%) ???:<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::generic_args::GenericArg> as rustc_type_ir::fold::TypeFoldable>::fold_with::::renumber_regions<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::generic_args::GenericArg>, ::visit_args::{closure#0}>::{closure#0}>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 36,656 ( 0.00%) ???:::instantiate_bound_regions::, ::instantiate_bound_regions_with_erased>::{closure#0}>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 36,624 ( 0.00%) ???:::putc [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 36,579 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/string.rs:::check_expr 36,579 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:::check_expr 36,438 ( 0.00%) ???:<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::generic_args::GenericArg> as rustc_type_ir::fold::TypeFoldable>::fold_with:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 36,304 ( 0.00%) ???:rustc_query_impl::query_impl::defaultness::invoke_provider_fn::__rust_begin_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 36,294 ( 0.00%) ???:rustc_query_impl::query_impl::generics_of::invoke_provider_fn::__rust_begin_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 36,200 ( 0.00%) ???:rustc_query_impl::query_impl::explicit_clauses_of::execute_query_non_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 36,167 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:::check_expr 36,082 ( 0.00%) ???:>, (rustc_middle::query::erase::ErasedData<[u8; 8]>, rustc_middle::dep_graph::graph::DepNodeIndex))>>::reserve_rehash::<>, (rustc_middle::query::erase::ErasedData<[u8; 8]>, rustc_middle::dep_graph::graph::DepNodeIndex))>>>::insert_unique::{closure#0}> [???] 36,023 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_expr 35,997 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:::check_expr 35,946 ( 0.00%) ???:rustc_span::hygiene::register_expn_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 35,933 ( 0.00%) ???:rustc_hir::intravisit::walk_ty:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 35,933 ( 0.00%) ???:rustc_trait_selection::traits::query::dropck_outlives::compute_dropck_outlives_inner [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 35,830 ( 0.00%) ???:core::ptr::drop_glue::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 35,809 ( 0.00%) ???:::typing_env [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 35,691 ( 0.00%) ???:<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::generic_args::GenericArg> as rustc_type_ir::fold::TypeFoldable>::fold_with:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 35,637 ( 0.00%) ???:::visit_item'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 35,544 ( 0.00%) ???:rustc_lint::levels::shallow_lint_levels_on'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 35,526 ( 0.00%) ???:> as rustc_middle::query::caches::QueryCache>::for_each [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 35,526 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::dep_graph::graph::DepNodeIndex>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 35,522 ( 0.00%) ???:rustc_query_impl::query_impl::def_span::invoke_provider_fn::__rust_begin_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 35,472 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:clippy_utils::diagnostics::span_lint_and_then::::display::{closure#0}> 35,443 ( 0.00%) ???:::register_wf_obligation [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 35,405 ( 0.00%) ???:::write_import_resolutions::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 35,404 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::dep_graph::graph::DepNodeIndex>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 35,395 ( 0.00%) ???:::visit_pat'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 35,370 ( 0.00%) ???:::eq_trace::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 35,276 ( 0.00%) ???:rustc_trait_selection::traits::normalize::normalize_with_depth_to::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 35,110 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::visit_pat [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 35,094 ( 0.00%) /rustc/84b36a78a28a63f134171c670be1932ffa2485f8/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/build/tikv-jemalloc-sys/80122c672fbe49ef/out/build/src/pa.c:pa_dalloc [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 35,025 ( 0.00%) ???:thin_vec::drop_non_singleton:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 34,983 ( 0.00%) ???:::par_hir_body_owners::::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 34,950 ( 0.00%) ???:>>::walk_ref [???] 34,756 ( 0.00%) ???:::record_use'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 34,674 ( 0.00%) ???:::lookup_line [???] 34,560 ( 0.00%) ???:rustc_query_impl::query_impl::inferred_outlives_of::execute_query_non_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 34,554 ( 0.00%) ???:::visit_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 34,526 ( 0.00%) include/jemalloc/internal/tsd.h:pa_dalloc 34,464 ( 0.00%) ???:rustc_query_impl::query_impl::generics_of::execute_query_non_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 34,300 ( 0.00%) ???:::visit_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 34,283 ( 0.00%) ???:::visit_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 34,144 ( 0.00%) ???:::resolve_ident_in_lexical_scope [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 34,092 ( 0.00%) ???:>::reserve_rehash::, rustc_type_ir::sty::Region>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 34,046 ( 0.00%) ???:rustc_lint::impl_trait_overcaptures::check_fn [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 34,033 ( 0.00%) ???:::find [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 34,001 ( 0.00%) src/sz.c:pa_dalloc 33,636 ( 0.00%) ???:::flat_map_item'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 33,559 ( 0.00%) ???:::visit_pat'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 33,552 ( 0.00%) ???:>::reserve_rehash::>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 33,489 ( 0.00%) ???:::fallible_with_capacity:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 33,397 ( 0.00%) ???:core::ptr::drop_glue::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 33,379 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_pat::'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 33,350 ( 0.00%) ???:rustc_query_impl::query_impl::clauses_of::execute_query_non_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 33,155 ( 0.00%) ???:::break_scope [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 33,130 ( 0.00%) ???:::visit_pat'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 33,123 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 33,107 ( 0.00%) ???:, rustc_hash::FxBuildHasher> as core::iter::traits::collect::Extend<(rustc_span::symbol::Ident, rustc_hir::def::Res)>>::extend::, rustc_hash::FxBuildHasher>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 32,940 ( 0.00%) ???:rustc_ast::visit::visit_items::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 32,911 ( 0.00%) ???:0x00000000000162d0 [/usr/lib/ld-linux-x86-64.so.2] 32,854 ( 0.00%) ???:rustc_query_impl::plumbing::verify_query_key_hashes_inner::>>>, rustc_middle::query::erase::ErasedData<[u8; 8]>>>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 32,817 ( 0.00%) ???:::check_expr_call'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 32,809 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::dep_graph::graph::DepNodeIndex>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 32,689 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/consts.rs:::expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 32,639 ( 0.00%) ???:rustc_hir::intravisit::walk_pat::>'2 [???] 32,516 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_error_messages/src/lib.rs:clippy_utils::diagnostics::span_lint_and_then::::display::{closure#0}> 32,512 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 32,437 ( 0.00%) ???: as core::iter::traits::iterator::Iterator>::next [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 32,012 ( 0.00%) ???:::parse_pat_with_range_pat'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 31,885 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_pat::'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 31,878 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/utils/author.rs:::check_arm [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 31,710 ( 0.00%) ???:::visit_fn [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 31,668 ( 0.00%) ???:rustc_middle::ty::codec::encode_with_shorthand::::type_shorthands>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 31,607 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/ty/context.rs:::def_key:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 31,566 ( 0.00%) include/jemalloc/internal/bit_util.h:pa_dalloc 31,560 ( 0.00%) ???:rustc_data_structures::outline::<::lines::{closure#0}, &[rustc_span::RelativeBytePos]> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 31,556 ( 0.00%) ???:> as rustc_middle::query::caches::QueryCache>::for_each [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 31,549 ( 0.00%) ???:::lower_fn_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 31,427 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_pat::'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 31,416 ( 0.00%) ???:::type_dependent_def_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 31,312 ( 0.00%) ???:::check_overloaded_binop [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 31,301 ( 0.00%) ???:::make_all_regions_live::{closure#0}> as rustc_type_ir::visit::TypeVisitor>::visit_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 31,085 ( 0.00%) ???:)>>::reserve_rehash::, rustc_hash::FxBuildHasher>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 31,059 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::dep_graph::graph::DepNodeIndex>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 31,031 ( 0.00%) ???:> as rustc_data_structures::stable_hash::StableHash>::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 31,016 ( 0.00%) ???:::parse_path_segment'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 30,961 ( 0.00%) include/jemalloc/internal/rtree.h:ecache_alloc 30,946 ( 0.00%) ???:<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::generic_args::GenericArg> as rustc_type_ir::fold::TypeFoldable>::fold_with::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 30,945 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::>, rustc_middle::query::erase::ErasedData<[u8; 8]>>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 30,856 ( 0.00%) ???:::lower_ty'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 30,832 ( 0.00%) ???:::is_automatically_derived [???] 30,747 ( 0.00%) ???:::check_expr_struct_fields [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 30,561 ( 0.00%) ???:rustc_const_eval::const_eval::eval_queries::eval_to_allocation_raw_provider [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 30,525 ( 0.00%) ???:rustc_ty_utils::common_traits::is_copy_raw [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 30,478 ( 0.00%) ???:rustc_hir::intravisit::walk_pat::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 30,446 ( 0.00%) src/emap.c:ecache_evict 30,375 ( 0.00%) ???:::eval_stability [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 30,269 ( 0.00%) ???:::implied_target_features [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 30,245 ( 0.00%) ???:::confirm_builtin_candidate::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 30,224 ( 0.00%) /rustc/84b36a78a28a63f134171c670be1932ffa2485f8/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/build/tikv-jemalloc-sys/80122c672fbe49ef/out/build/src/extent.c:ecache_alloc [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 30,173 ( 0.00%) ???:::visit_pat'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 30,165 ( 0.00%) ???:::make_canonicalized_query_response:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 30,163 ( 0.00%) ???:::imported_source_file::{closure#0}'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 30,150 ( 0.00%) ???:rustc_hir::intravisit::walk_pat::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 30,044 ( 0.00%) ???:::visit_pat'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,993 ( 0.00%) ???:::check_expr_method_call'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,930 ( 0.00%) ???: as core::iter::traits::collect::Extend<(rustc_span::symbol::Ident, rustc_resolve::late::BindingInfo)>>::extend::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,902 ( 0.00%) ???:rustc_hir::intravisit::walk_pat::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,879 ( 0.00%) ???:>>::walk_ref [???] 29,813 ( 0.00%) ???:::is_intrinsic [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,775 ( 0.00%) ???:rustc_ast::visit::visit_stmts::> [???] 29,774 ( 0.00%) ???:>::layout_of [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,650 ( 0.00%) ???:>::reserve::do_reserve_and_handle:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,574 ( 0.00%) ???:rustc_borrowck::mir_borrowck [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,538 ( 0.00%) ???:::parse_constness_ [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,521 ( 0.00%) ???:>::walk_mut'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,521 ( 0.00%) ???:::convert_place_derefs_to_mutable [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,503 ( 0.00%) include/jemalloc/internal/edata.h:realloc 29,456 ( 0.00%) ???: as rustc_ast::visit::Visitor>::visit_item [???] 29,441 ( 0.00%) ???:::instantiate_identity_into'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,397 ( 0.00%) ???:rustc_hir::intravisit::walk_pat::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,397 ( 0.00%) ???:rustc_hir::intravisit::walk_pat::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,381 ( 0.00%) ???:rustc_hir::intravisit::walk_pat::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,381 ( 0.00%) ???:rustc_hir::intravisit::walk_pat::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,378 ( 0.00%) ???:::visit_pat'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,375 ( 0.00%) ???:, rustc_middle::query::erase::ErasedData<[u8; 16]>> as rustc_middle::query::caches::QueryCache>::for_each [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,360 ( 0.00%) ???:::visit_ty'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,348 ( 0.00%) ???:rustc_query_impl::query_impl::def_kind::execute_query_non_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,268 ( 0.00%) ???:::insert'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,156 ( 0.00%) ???:::assemble_candidates_from_impls::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,097 ( 0.00%) ???:rustc_ty_utils::opaque_types::opaque_types_defined_by [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,074 ( 0.00%) ???:::new_with_implied_bounds_compat::>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,052 ( 0.00%) ???:llvm::cl::opt >::~opt() [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/libLLVM.so.23.1-rust-1.99.0-nightly] 29,041 ( 0.00%) ???:::walk_::<::pat_error_reported::{closure#0}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 28,897 ( 0.00%) ???:::fully_expand_fragment [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 28,873 ( 0.00%) src/eset.c:pa_dalloc 28,766 ( 0.00%) ???:::flat_map_item'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 28,748 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/doc/mod.rs:clippy_lints::doc::check_doc::> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 28,706 ( 0.00%) ???:::default [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 28,573 ( 0.00%) ???:>::fold_ty'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 28,558 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 28,505 ( 0.00%) ???:rustc_type_ir::relate::relate_args_with_variances::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 28,450 ( 0.00%) ???:::visit_def_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 28,449 ( 0.00%) ???:::from_tokens [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 28,420 ( 0.00%) ???:rustc_trait_selection::traits::impossible_clauses [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 28,377 ( 0.00%) ???:::opt_item_name [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 28,372 ( 0.00%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 28,301 ( 0.00%) ???:::visit_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 28,296 ( 0.00%) include/jemalloc/internal/mutex.h:calloc 28,218 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 28,140 ( 0.00%) ???:::fresh_args_for_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 28,101 ( 0.00%) ???: as rustc_data_structures::flat_map_in_place::FlatMapInPlace>::flat_map_in_place::::{closure#0}, smallvec::SmallVec<[rustc_ast::ast::Stmt; 1]>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 28,098 ( 0.00%) ???:> as rustc_type_ir::interner::CollectAndApply>::collect_and_apply::>, core::iter::adapters::copied::Copied>>, rustc_type_ir::relate::structurally_relate_tys::{closure#0}::{closure#1}>, ::new_tup_from_iter>, core::iter::adapters::copied::Copied>>, rustc_type_ir::relate::structurally_relate_tys::{closure#0}::{closure#1}>, core::result::Result>>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 28,067 ( 0.00%) ???: as rustc_type_ir::visit::TypeVisitor>::visit_ty'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 28,035 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 28,008 ( 0.00%) include/jemalloc/internal/pai.h:pa_alloc 27,974 ( 0.00%) ???:>::fold_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 27,970 ( 0.00%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 27,817 ( 0.00%) ???:rustc_hir::intravisit::walk_pat::<::collect_taits_declared_in_body::TaitInBodyFinder>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 27,559 ( 0.00%) ???:::apply [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 27,525 ( 0.00%) include/jemalloc/internal/tsd_tls.h:free_default 27,487 ( 0.00%) ???:>::normalize::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 27,467 ( 0.00%) ???:::visit_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 27,424 ( 0.00%) ???:::visit_item'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 27,360 ( 0.00%) ???:::parse_pat_ident [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 27,339 ( 0.00%) ???:::visit_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 27,246 ( 0.00%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 27,206 ( 0.00%) include/jemalloc/internal/ticker.h:tcache_bin_flush_small 27,195 ( 0.00%) ???:::lower_poly_trait_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 27,167 ( 0.00%) ???:thin_vec::drop_non_singleton:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 27,131 ( 0.00%) ???:::new_imported_source_file [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 27,125 ( 0.00%) ???:thin_vec::drop_non_singleton:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 27,082 ( 0.00%) ???:::lower_use_tree [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 27,082 ( 0.00%) ???:::parse_next_component_back [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 27,073 ( 0.00%) ???:::expect [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 27,073 ( 0.00%) ???:llvm::DenseMapBase, llvm::detail::DenseMapPair >, llvm::MCRegister, int, llvm::DenseMapInfo, llvm::detail::DenseMapPair >::moveFrom(llvm::DenseMap, llvm::detail::DenseMapPair >&) [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/libLLVM.so.23.1-rust-1.99.0-nightly] 27,071 ( 0.00%) ???:::visit_item'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 27,016 ( 0.00%) ???:rustc_hir::intravisit::walk_pat::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 27,010 ( 0.00%) ???:::stmt_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 26,989 ( 0.00%) include/jemalloc/internal/sz.h:large_ralloc 26,982 ( 0.00%) ???:rustc_ast::visit::visit_stmts::>'2 [???] 26,933 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs:::check_ty [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 26,861 ( 0.00%) ???:::check_expr_with_expectation_and_args [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 26,843 ( 0.00%) ???:::parse_param_general::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 26,823 ( 0.00%) include/jemalloc/internal/atomic.h:ecache_evict 26,784 ( 0.00%) ???: as rustc_hir::intravisit::Visitor>::visit_nested_body [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 26,749 ( 0.00%) ???:::visit_node:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 26,721 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::>>>, rustc_middle::query::erase::ErasedData<[u8; 8]>>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 26,626 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/mod.rs:::check_expr 26,604 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::emit_span_lint::::display::{closure#0}>::{closure#0}>> 26,580 ( 0.00%) ???:rustc_hir_analysis::collect::type_of::type_of [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 26,569 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/returns/needless_return.rs:clippy_lints::returns::needless_return::check_block_return'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 26,533 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/matches/collapsible_match.rs:clippy_lints::matches::collapsible_match::check_match [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 26,515 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::), rustc_middle::query::erase::ErasedData<[u8; 16]>>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 26,507 ( 0.00%) ???:rustc_const_eval::interpret::intern::intern_const_alloc_recursive:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 26,466 ( 0.00%) ???:rustc_passes::dead::check_mod_deathness [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 26,453 ( 0.00%) ???:getenv [/usr/lib/libc.so.6] 26,436 ( 0.00%) ???:::universe_canonicalized_var_kinds [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 26,429 ( 0.00%) ???:core::slice::sort::stable::quicksort::quicksort::::sort_by_key<&core::option::Option, , rustc_middle::ty::assoc::AssocItem> as core::iter::traits::collect::FromIterator<(core::option::Option, rustc_middle::ty::assoc::AssocItem)>>::from_iter, rustc_ty_utils::assoc::associated_items::{closure#0}>, ::new, rustc_ty_utils::assoc::associated_items::{closure#0}>>::{closure#0}>>::{closure#0}>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 26,332 ( 0.00%) ???:::liberate_late_bound_regions::>::{closure#0} [???] 26,306 ( 0.00%) ???:rustc_query_impl::query_impl::hir_owner::invoke_provider_fn::__rust_begin_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 26,295 ( 0.00%) ???: as alloc::vec::spec_from_iter_nested::SpecFromIterNested, ::lower_patterns::{closure#0}>>>::from_iter [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 26,267 ( 0.00%) ???:::new'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 26,258 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::query::erase::ErasedData<[u8; 24]>>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 26,229 ( 0.00%) ???:::clone [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 26,156 ( 0.00%) ???:::pad [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 26,046 ( 0.00%) ???:>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 26,043 ( 0.00%) ???:::lower_method_sig [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 26,007 ( 0.00%) ???:::lower_stmts'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 25,962 ( 0.00%) ???:::parse_visibility [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 25,958 ( 0.00%) ???:rustc_hir_analysis::check::wfcheck::receiver_is_valid [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 25,947 ( 0.00%) src/decay.c:arena_decay 25,923 ( 0.00%) include/jemalloc/internal/jemalloc_internal_inlines_b.h:tcache_bin_flush_small 25,894 ( 0.00%) /rustc/84b36a78a28a63f134171c670be1932ffa2485f8/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/build/tikv-jemalloc-sys/80122c672fbe49ef/out/build/src/large.c:large_ralloc [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 25,773 ( 0.00%) ???:::def_path_hash [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 25,773 ( 0.00%) ???:rustc_query_impl::plumbing::verify_query_key_hashes_inner::>, rustc_middle::query::erase::ErasedData<[u8; 8]>>>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 25,772 ( 0.00%) ???:::lower_fn_decl [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 25,650 ( 0.00%) src/extent_dss.c:pa_dalloc 25,531 ( 0.00%) ???:::write_method_call_and_enforce_effects [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 25,512 ( 0.00%) ???:>::add_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 25,445 ( 0.00%) ???:::visit_pat'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 25,445 ( 0.00%) ???:rustc_middle::thir::visit::walk_pat::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 25,424 ( 0.00%) ???: as rustc_data_structures::flat_map_in_place::FlatMapInPlace>::flat_map_in_place::::{closure#0}, smallvec::SmallVec<[rustc_ast::ast::Stmt; 1]>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 25,389 ( 0.00%) ???: as rustc_type_ir::visit::TypeVisitor>::visit_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 25,366 ( 0.00%) ???:::ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 25,350 ( 0.00%) ???:> as rustc_middle::query::caches::QueryCache>::for_each [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 25,296 ( 0.00%) ???:::check_arm [???] 25,283 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_data_structures/src/sharded.rs:, rustc_middle::dep_graph::graph::DepNodeIndex))>>>::get:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 25,158 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:clippy_lints::doc::doc_suspicious_footnotes::check 25,095 ( 0.00%) ???:::mark_span_with_reason [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 25,083 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/misc_early/unneeded_wildcard_pattern.rs:::check_pat 25,032 ( 0.00%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 25,032 ( 0.00%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 25,032 ( 0.00%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 25,010 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:::init_default_impl_for_type_if_needed 24,986 ( 0.00%) ???:<&mut serde_json::ser::Serializer<&mut alloc::boxed::Box> as serde_core::ser::Serializer>::serialize_str [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 24,870 ( 0.00%) ???:::compute_object_lifetime_defaults [???] 24,865 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/unconditional_recursion.rs:::init_default_impl_for_type_if_needed [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 24,844 ( 0.00%) ???:rustc_hir_analysis::collect::type_of::type_of::{closure#0}::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 24,794 ( 0.00%) ???:>::fill_item::<>::identity_for_item::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 24,780 ( 0.00%) ???:, rustc_middle::dep_graph::graph::DepNodeIndex))>>::reserve_rehash::<, rustc_middle::dep_graph::graph::DepNodeIndex))>>>::insert_unique::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 24,760 ( 0.00%) ???:core::slice::sort::stable::quicksort::quicksort::::sort_by_key<&core::option::Option, , rustc_middle::ty::assoc::AssocItem> as core::iter::traits::collect::FromIterator<(core::option::Option, rustc_middle::ty::assoc::AssocItem)>>::from_iter, rustc_ty_utils::assoc::associated_items::{closure#0}>, ::new, rustc_ty_utils::assoc::associated_items::{closure#0}>>::{closure#0}>>::{closure#0}>::{closure#0}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 24,731 ( 0.00%) ???:llvm::SubtargetFeatureKV const* Find(llvm::StringRef, llvm::ArrayRef) [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/libLLVM.so.23.1-rust-1.99.0-nightly] 24,690 ( 0.00%) ???:rustc_traits::type_op::type_op_ascribe_user_type [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 24,620 ( 0.00%) ???:)>>::reserve_rehash::, rustc_hash::FxBuildHasher>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 24,507 ( 0.00%) ???:>, &mut rustc_infer::infer::snapshot::undo_log::InferCtxtUndoLogs>>>::uninlined_get_root_key [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 24,492 ( 0.00%) ???:::demand_suptype_diag [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 24,483 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 24,428 ( 0.00%) ???:)>>::complete::), rustc_middle::query::erase::ErasedData<[u8; 16]>>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 24,387 ( 0.00%) include/jemalloc/internal/edata.h:calloc 24,386 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:::check_expr 24,386 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/borrow.rs:::check_expr 24,386 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:::check_expr 24,386 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:::check_expr 24,386 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/intrinsics/mod.rs:::check_expr 24,386 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::check_expr 24,350 ( 0.00%) ???:llvm::X86_MC::initLLVMToSEHAndCVRegMapping(llvm::MCRegisterInfo*) [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/libLLVM.so.23.1-rust-1.99.0-nightly] 24,269 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_expr:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 24,253 ( 0.00%) ???:rustc_query_impl::query_impl::type_of::invoke_provider_fn::__rust_begin_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 24,247 ( 0.00%) ???:::walk::<::resolve_pattern_inner::{closure#0}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 24,244 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:rustc_hir::intravisit::walk_qpath:: 24,138 ( 0.00%) ???:>::insert_entry [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 24,110 ( 0.00%) ???:0x0000000000016d80 [/usr/lib/ld-linux-x86-64.so.2] 24,100 ( 0.00%) ???:rustc_query_impl::query_impl::def_ident_span::execute_query_non_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 24,090 ( 0.00%) ???:rustc_const_eval::const_eval::eval_queries::intern_and_validate:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 23,959 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::dep_graph::graph::DepNodeIndex>, false>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 23,903 ( 0.00%) ???:::parent_hir_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 23,871 ( 0.00%) ???:::hir_get_fn_id_for_return_block [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 23,696 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:core::ptr::drop_glue::::{closure#0}>, rustc_middle::lint::LevelSpec>::{closure#0}> 23,666 ( 0.00%) ???:rustc_interface::passes::emit_delayed_lints [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 23,648 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint/src/levels.rs:::emit_span_lint::::display::{closure#0}>::{closure#0}>> 23,505 ( 0.00%) ???:rustc_hir_analysis::check::region::resolve_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 23,504 ( 0.00%) ???:::hir_get_parent_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 23,486 ( 0.00%) ???:::check_expr_closure [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 23,424 ( 0.00%) ???:rustc_query_impl::query_impl::def_span::execute_query_non_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 23,398 ( 0.00%) include/jemalloc/internal/jemalloc_internal_inlines_b.h:calloc 23,352 ( 0.00%) ???:::find_by_ident_and_kind [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 23,350 ( 0.00%) ???:::is_suggestable_infer_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 23,342 ( 0.00%) ???:::alloc_ctxt [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 23,328 ( 0.00%) ???:::resolve_pattern_inner::{closure#0}'2 [???] 23,324 ( 0.00%) ???:rustc_hir_analysis::check_crate [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 23,317 ( 0.00%) ???:::fmt [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 23,228 ( 0.00%) ???:::flat_map_stmt'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 23,217 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::query::erase::ErasedData<[u8; 16]>>, false> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 23,144 ( 0.00%) ???:rustc_query_impl::query_impl::lit_to_const::invoke_provider_fn::__rust_begin_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 23,129 ( 0.00%) include/jemalloc/internal/tsd.h:free_default 23,124 ( 0.00%) include/jemalloc/internal/pai.h:tcache_bin_flush_small 23,124 ( 0.00%) src/pa.c:tcache_bin_flush_small 23,097 ( 0.00%) ???:> as rustc_middle::query::caches::QueryCache>::for_each [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 23,095 ( 0.00%) ???:rustc_query_impl::query_impl::lookup_stability::invoke_provider_fn::__rust_begin_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 23,026 ( 0.00%) ???:::edition [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 23,016 ( 0.00%) ???:>::with_capacity_in [???] 22,983 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/consts.rs:::qpath [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 22,965 ( 0.00%) ???:::next [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 22,910 ( 0.00%) ???:>::super_fold_with::::handle_term::outer_exclusive_binder, ::new_error>::{closure#0}>>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 22,826 ( 0.00%) ???:>::consts::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 22,792 ( 0.00%) ???:>::reserve_rehash::, ()>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 22,772 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:rustc_hir::intravisit::walk_qpath:: 22,752 ( 0.00%) ???:>::insert [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 22,707 ( 0.00%) ???:::check_decl [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 22,671 ( 0.00%) ???:::set_bindings_effective_visibilities [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 22,615 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::never_loop_expr'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 22,550 ( 0.00%) ???:::prohibit_generic_args::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 22,550 ( 0.00%) ???:::visit_item'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 22,545 ( 0.00%) ???:llvm::DenseMapBase, llvm::detail::DenseMapPair >, void const*, llvm::PassInfo const*, llvm::DenseMapInfo, llvm::detail::DenseMapPair >::moveFrom(llvm::DenseMap, llvm::detail::DenseMapPair >&) [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/libLLVM.so.23.1-rust-1.99.0-nightly] 22,515 ( 0.00%) ???:::walk_::<::walk_always<::each_binding<::contains_explicit_ref_binding::{closure#0}>::{closure#0}>::{closure#0}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_utils/src/macros.rs -------------------------------------------------------------------------------- Ir -- line 77 ---------------------------------------- . span_is_local(self.span) . } . } . . /// Returns an iterator of expansions that created the given span . pub fn expn_backtrace(mut span: Span) -> impl Iterator { . std::iter::from_fn(move || { . let ctxt = span.ctxt(); 69,674 ( 0.00%) if ctxt == SyntaxContext::root() { . return None; . } 1,273 ( 0.00%) let expn = ctxt.outer_expn(); 1,280 ( 0.00%) let data = expn.expn_data(); 1,016 ( 0.00%) span = data.call_site; 6,400 ( 0.00%) Some((expn, data)) . }) . } . . /// Checks whether the span is from the root expansion or a locally defined macro 61,000 ( 0.00%) pub fn span_is_local(span: Span) -> bool { 28 ( 0.00%) !span.from_expansion() || expn_is_local(span.ctxt().outer_expn()) 1,239 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::expn_is_local (7x) 36,579 ( 0.00%) } . . /// Checks whether the expansion is the root expansion or a locally defined macro 21 ( 0.00%) pub fn expn_is_local(expn: ExpnId) -> bool { . if expn == ExpnId::root() { . return true; . } 14 ( 0.00%) let data = expn.expn_data(); 7 ( 0.00%) let backtrace = expn_backtrace(data.call_site); . std::iter::once((expn, data)) . .chain(backtrace) 84 ( 0.00%) .find_map(|(_, data)| data.macro_def_id) . .is_none_or(DefId::is_local) 28 ( 0.00%) } . . /// Returns an iterator of macro expansions that created the given span. . /// Note that desugaring expansions are skipped. . pub fn macro_backtrace(span: Span) -> impl Iterator { 2,372 ( 0.00%) expn_backtrace(span).filter_map(|(expn, data)| match data { . ExpnData { 593 ( 0.00%) kind: ExpnKind::Macro(kind, _), 600 ( 0.00%) macro_def_id: Some(def_id), 1,328 ( 0.00%) call_site: span, . .. . } => Some(MacroCall { . def_id, . kind, . expn, . span, . }), . _ => None, -- line 128 ---------------------------------------- -- line 129 ---------------------------------------- . }) . } . . /// If the macro backtrace of `span` has a macro call at the root expansion . /// (i.e. not a nested macro call), returns `Some` with the `MacroCall` . /// . /// If you only want to check whether the root macro has a specific name, . /// consider using [`matching_root_macro_call`] instead. 756,690 ( 0.04%) pub fn root_macro_call(span: Span) -> Option { . macro_backtrace(span).last() 550,320 ( 0.03%) } . . /// A combination of [`root_macro_call`] and . /// [`is_diagnostic_item`](rustc_middle::ty::TyCtxt::is_diagnostic_item) that returns a `MacroCall` . /// at the root expansion if only it matches the given name. 619,110 ( 0.03%) pub fn matching_root_macro_call(cx: &LateContext<'_>, span: Span, name: Symbol) -> Option { 138,185 ( 0.01%) root_macro_call(span).filter(|mc| cx.tcx.is_diagnostic_item(name, mc.def_id)) 3,148,192 ( 0.15%) => site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::root_macro_call (68,790x) 8,766 ( 0.00%) => ???:::is_diagnostic_item (121x) 481,530 ( 0.02%) } . . /// Like [`root_macro_call`], but only returns `Some` if `node` is the "first node" . /// produced by the macro call, as in [`first_node_in_macro`]. . pub fn root_macro_call_first_node(cx: &LateContext<'_>, node: &impl HirNode) -> Option { 1,239,630 ( 0.06%) if first_node_in_macro(cx, node) != Some(ExpnId::root()) { 2,272,024 ( 0.11%) => site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::first_node_in_macro:: (68,742x) . return None; . } . root_macro_call(node.span()) . } . . /// Like [`macro_backtrace`], but only returns macro calls where `node` is the "first node" of the . /// macro call, as in [`first_node_in_macro`]. . pub fn first_node_macro_backtrace(cx: &LateContext<'_>, node: &impl HirNode) -> impl Iterator { 137,484 ( 0.01%) let span = node.span(); 137,484 ( 0.01%) first_node_in_macro(cx, node) 2,272,024 ( 0.11%) => site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::first_node_in_macro:: (68,742x) . .into_iter() . .flat_map(move |expn| macro_backtrace(span).take_while(move |macro_call| macro_call.expn != expn)) . } . . /// If `node` is the "first node" in a macro expansion, returns `Some` with the `ExpnId` of the . /// macro call site (i.e. the parent of the macro expansion). . /// . /// This generally means that `node` is the outermost node of an entire macro expansion, but there -- line 169 ---------------------------------------- -- line 174 ---------------------------------------- . /// just check the context of that span directly (e.g. `parent.span.from_expansion()`). . /// . /// If a macro call is in statement position, it expands to one or more statements. . /// In that case, each statement *and* their immediate descendants will all yield `Some` . /// with the `ExpnId` of the containing block. . /// . /// A node may be the "first node" of multiple macro calls in a macro backtrace. . /// The expansion of the outermost macro call site is returned in such cases. 4,956,246 ( 0.23%) pub fn first_node_in_macro(cx: &LateContext<'_>, node: &impl HirNode) -> Option { . // A node that is not from an expansion can never be the first node in a macro. This is the . // common case, so return before touching the cache. 2,753,470 ( 0.13%) if !node.span().from_expansion() { . return None; . } . . // The macro lints each query this for the node currently being visited, and the combined late . // pass runs all their `check_*` callbacks on that node back to back, so the redundant queries . // are consecutive. A single-slot memo of the last node collapses them to one backtrace walk in . // O(1) memory. The result is a pure function of the `HirId` (the HIR is frozen during lint . // passes), so returning the stored value on a key match is always correct. . let hir_id = node.hir_id(); 4,634 ( 0.00%) if let Some((cached_id, cached)) = LAST_FIRST_NODE_IN_MACRO.get() . && cached_id == hir_id . { . return cached; . } 258 ( 0.00%) let result = first_node_in_macro_uncached(cx, node); . LAST_FIRST_NODE_IN_MACRO.set(Some((hir_id, result))); . result 4,956,246 ( 0.23%) } . . thread_local! { . static LAST_FIRST_NODE_IN_MACRO: Cell)>> = const { Cell::new(None) }; . } . . fn first_node_in_macro_uncached(cx: &LateContext<'_>, node: &impl HirNode) -> Option { . // get the macro expansion or return `None` if not found . // `macro_backtrace` importantly ignores desugaring expansions . let expn = macro_backtrace(node.span()).next()?.expn; . . // get the parent node, possibly skipping over a statement . // if the parent is not found, it is sensible to return `Some(root)` . let mut parent_iter = cx.tcx.hir_parent_iter(node.hir_id()); 236 ( 0.00%) let (parent_id, _) = match parent_iter.next() { . None => return Some(ExpnId::root()), . Some((_, Node::Stmt(_))) => match parent_iter.next() { . None => return Some(ExpnId::root()), . Some(next) => next, . }, . Some(next) => next, . }; . . // get the macro expansion of the parent node 472 ( 0.00%) let parent_span = cx.tcx.hir_span(parent_id); 14,306 ( 0.00%) => ???:::hir_span (118x) . let Some(parent_macro_call) = macro_backtrace(parent_span).next() else { . // the parent node is not in a macro . return Some(ExpnId::root()); . }; . . if parent_macro_call.expn.is_descendant_of(expn) { . // `node` is input to a macro call . return None; -- line 235 ---------------------------------------- -- line 426 ---------------------------------------- . match result { . ControlFlow::Break(is_assert_arg) => is_assert_arg, . ControlFlow::Continue(()) => true, . } . } . . /// Stores AST [`FormatArgs`] nodes for use in late lint passes, as they are in a desugared form in . /// the HIR 1 ( 0.00%) #[derive(Default, Clone)] . pub struct FormatArgsStorage(Arc>>); . . impl FormatArgsStorage { . /// Returns an AST [`FormatArgs`] node if a `format_args` expansion is found as a descendant of . /// `expn_id` . /// . /// See also [`find_format_arg_expr`] . pub fn get(&self, cx: &LateContext<'_>, start: &Expr<'_>, expn_id: ExpnId) -> Option<&FormatArgs> { -- line 442 ---------------------------------------- -- line 457 ---------------------------------------- . })?; . . debug_assert!(self.0.get().is_some(), "`FormatArgsStorage` not yet populated"); . . self.0.get()?.get(&format_args_expr.span.with_parent(None)) . } . . /// Should only be called by `FormatArgsCollector` 2 ( 0.00%) pub fn set(&self, format_args: FxHashMap) { . self.0 . .set(format_args) . .expect("`FormatArgsStorage::set` should only be called once"); 3 ( 0.00%) } . } . . /// Attempt to find the [`rustc_hir::Expr`] that corresponds to the [`FormatArgument`]'s value . pub fn find_format_arg_expr<'hir>(start: &'hir Expr<'hir>, target: &FormatArgument) -> Option<&'hir Expr<'hir>> { . let SpanData { . lo, . hi, . ctxt, -- line 477 ---------------------------------------- 8,870 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/redundant_async_block.rs -------------------------------------------------------------------------------- Ir -- line 35 ---------------------------------------- . pub REDUNDANT_ASYNC_BLOCK, . complexity, . "`async { future.await }` can be replaced by `future`" . } . . declare_lint_pass!(RedundantAsyncBlock => [REDUNDANT_ASYNC_BLOCK]); . . impl<'tcx> LateLintPass<'tcx> for RedundantAsyncBlock { 618,678 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 68,742 ( 0.00%) let span = expr.span; 274,968 ( 0.01%) if !span.in_external_macro(cx.tcx.sess.source_map()) && 548,760 ( 0.03%) let Some(body_expr) = desugar_async_block(cx, expr) && 686,881 ( 0.03%) => site/frontend/rust-clippy/clippy_lints/src/redundant_async_block.rs:clippy_lints::redundant_async_block::desugar_async_block (68,595x) . let Some(expr) = desugar_await(peel_blocks(body_expr)) && . // The await prefix must not come from a macro as its content could change in the future. . expr.span.eq_ctxt(body_expr.span) && . // The await prefix must implement Future, as implementing IntoFuture is not enough. . let Some(future_trait) = cx.tcx.lang_items().future_trait() && . implements_trait(cx, cx.typeck_results().expr_ty(expr), future_trait, &[]) && . // An async block does not have immediate side-effects from a `.await` point-of-view. . (!expr.can_have_side_effects() || desugar_async_block(cx, expr).is_some()) && -- line 54 ---------------------------------------- -- line 59 ---------------------------------------- . REDUNDANT_ASYNC_BLOCK, . span, . "this async expression only awaits a single future", . "you can reduce it to", . snippet(cx, shortened_span, "..").into_owned(), . Applicability::MachineApplicable, . ); . } 549,936 ( 0.03%) } . } . . /// If `expr` is a desugared `async` block, return the original expression if it does not capture . /// any variable by ref. 205,785 ( 0.01%) fn desugar_async_block<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) -> Option<&'tcx Expr<'tcx>> { 137,190 ( 0.01%) if let ExprKind::Closure(Closure { body, def_id, kind, .. }) = expr.kind 36 ( 0.00%) && let body = cx.tcx.hir_body(*body) 847 ( 0.00%) => ???:::hir_body (12x) 24 ( 0.00%) && matches!( . kind, . ClosureKind::Coroutine(CoroutineKind::Desugared( . CoroutineDesugaring::Async, . CoroutineSource::Block . )) . ) . { . cx.typeck_results() -- line 83 ---------------------------------------- -- line 89 ---------------------------------------- . .iter() . .all(|place| matches!(place.info.capture_kind, UpvarCapture::ByValue)) . }) . }) . .then_some(body.value) . } else { . None . } 274,380 ( 0.01%) } 68,619 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/non_octal_unix_permissions.rs -------------------------------------------------------------------------------- Ir -- line 34 ---------------------------------------- . pub NON_OCTAL_UNIX_PERMISSIONS, . correctness, . "use of non-octal value to set unix file permissions, which will be translated into octal" . } . . declare_lint_pass!(NonOctalUnixPermissions => [NON_OCTAL_UNIX_PERMISSIONS]); . . impl<'tcx> LateLintPass<'tcx> for NonOctalUnixPermissions { 274,968 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 343,312 ( 0.02%) match &expr.kind { 220 ( 0.00%) ExprKind::MethodCall(path, func, [param], _) => { 64 ( 0.00%) if let Some(adt) = cx.typeck_results().expr_ty(func).peel_refs().ty_adt_def() 1,280 ( 0.00%) => ???:::expr_ty (32x) 28 ( 0.00%) && matches!( 104 ( 0.00%) (cx.tcx.get_diagnostic_name(adt.did()), path.ident.name), 1,868 ( 0.00%) => ???:::get_diagnostic_name (28x) 40 ( 0.00%) (Some(sym::FsOpenOptions | sym::DirBuilder), sym::mode) . | (Some(sym::FsPermissions), sym::set_mode) . ) . && let ExprKind::Lit(_) = param.kind . && param.span.eq_ctxt(expr.span) . && param . .span . .check_text(cx, |src| !matches!(src.as_bytes(), [b'0', b'o' | b'b', ..])) . { . show_error(cx, param); . } . }, 398 ( 0.00%) ExprKind::Call(func, [param]) => { 664 ( 0.00%) if let ExprKind::Path(ref path) = func.kind 664 ( 0.00%) && let Some(def_id) = cx.qpath_res(path, func.hir_id).opt_def_id() 4,808 ( 0.00%) => ???:::qpath_res (166x) 765 ( 0.00%) && cx.tcx.is_diagnostic_item(sym::permissions_from_mode, def_id) 9,644 ( 0.00%) => ???:::is_diagnostic_item (153x) . && let ExprKind::Lit(_) = param.kind . && param.span.eq_ctxt(expr.span) . && param . .span . .check_text(cx, |src| !matches!(src.as_bytes(), [b'0', b'o' | b'b', ..])) . { . show_error(cx, param); . } . }, . _ => {}, . } 343,710 ( 0.02%) } . } . . fn show_error(cx: &LateContext<'_>, param: &Expr<'_>) { . let mut applicability = Applicability::MachineApplicable; . span_lint_and_sugg( . cx, . NON_OCTAL_UNIX_PERMISSIONS, . param.span, -- line 83 ---------------------------------------- 498 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/doc/mod.rs -------------------------------------------------------------------------------- Ir -- line 731 ---------------------------------------- . valid_idents: &'static FxHashSet, . check_private_items: bool, . } . . impl Documentation { . pub fn new(conf: &'static Conf) -> Self { . Self { . valid_idents: &conf.doc_valid_idents, 3 ( 0.00%) check_private_items: conf.check_private_items, . } . } . } . . impl EarlyLintPass for Documentation { 520,037 ( 0.02%) fn check_attributes(&mut self, cx: &EarlyContext<'_>, attrs: &[rustc_ast::Attribute]) { . include_in_doc_without_cfg::check(cx, attrs); 594,328 ( 0.03%) } . } . . impl<'tcx> LateLintPass<'tcx> for Documentation { 709,400 ( 0.03%) fn check_attributes(&mut self, cx: &LateContext<'tcx>, attrs: &'tcx [Attribute]) { 709,482 ( 0.03%) let Some(headers) = check_attrs(cx, self.valid_idents, attrs) else { . return; . }; . 1,135,587 ( 0.05%) match cx.tcx.hir_node(cx.last_node_with_lint_attrs) { 3,688,776 ( 0.17%) => ???:::hir_node (70,938x) 114 ( 0.00%) Node::Field(FieldDef { span, safety, .. }) => match (headers.safety, safety) { . (false, Safety::Unsafe) => span_lint( . cx, . MISSING_SAFETY_DOC, . *span, . "docs for unsafe field missing `# Safety` section", . ), . (true, Safety::Safe) if cx.tcx.features().unsafe_fields() => span_lint_and_help( . cx, -- line 765 ---------------------------------------- -- line 766 ---------------------------------------- . UNNECESSARY_SAFETY_DOC, . *span, . "field with `# Safety` documentation is not marked unsafe", . None, . "if the field has safety invariants, mark it `unsafe`", . ), . _ => (), . }, 212 ( 0.00%) Node::Item(item) => { . too_long_first_doc_paragraph::check( . cx, . item, . attrs, 424 ( 0.00%) headers.first_paragraph_text_len, 212 ( 0.00%) headers.first_paragraph_md_len, 212 ( 0.00%) self.check_private_items, . ); 966 ( 0.00%) match item.kind { 94 ( 0.00%) ItemKind::Fn { sig, body, .. } 282 ( 0.00%) if !(is_entrypoint_fn(cx, item.owner_id.to_def_id()) 1,645 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_entrypoint_fn (47x) 282 ( 0.00%) || item.span.in_external_macro(cx.tcx.sess.source_map())) => 5,499 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/lib.rs:::in_external_macro (47x) . { 329 ( 0.00%) missing_headers::check(cx, item.owner_id, sig, headers, Some(body), self.check_private_items); 278,624 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/doc/missing_headers.rs:clippy_lints::doc::missing_headers::check (47x) . }, 5 ( 0.00%) ItemKind::Trait { safety, .. } => match (headers.safety, safety) { . (false, Safety::Unsafe) => span_lint( . cx, . MISSING_SAFETY_DOC, . cx.tcx.def_span(item.owner_id), . "docs for unsafe trait missing `# Safety` section", . ), . (true, Safety::Safe) => span_lint( . cx, -- line 798 ---------------------------------------- -- line 800 ---------------------------------------- . cx.tcx.def_span(item.owner_id), . "docs for safe trait have unnecessary `# Safety` section", . ), . _ => (), . }, . _ => (), . } . }, 6 ( 0.00%) Node::TraitItem(trait_item) => { 18 ( 0.00%) if let TraitItemKind::Fn(sig, ..) = trait_item.kind 30 ( 0.00%) && !trait_item.span.in_external_macro(cx.tcx.sess.source_map()) . { 54 ( 0.00%) missing_headers::check(cx, trait_item.owner_id, sig, headers, None, self.check_private_items); 5,508 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/doc/missing_headers.rs:clippy_lints::doc::missing_headers::check (6x) . } . }, 48 ( 0.00%) Node::ImplItem(impl_item) => { 290 ( 0.00%) if let ImplItemKind::Fn(sig, body_id) = impl_item.kind 220 ( 0.00%) && !impl_item.span.in_external_macro(cx.tcx.sess.source_map()) 180 ( 0.00%) && !is_trait_impl_item(cx, impl_item.hir_id()) 5,796 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_trait_impl_item (36x) . { 63 ( 0.00%) missing_headers::check( 75,139 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/doc/missing_headers.rs:clippy_lints::doc::missing_headers::check (9x) . cx, 18 ( 0.00%) impl_item.owner_id, . sig, . headers, . Some(body_id), 9 ( 0.00%) self.check_private_items, . ); . } . }, . _ => {}, . } 567,520 ( 0.03%) } . } . . #[derive(Copy, Clone)] . struct Fragments<'a> { . doc: &'a str, . fragments: &'a [DocFragment], . } . -- line 840 ---------------------------------------- -- line 842 ---------------------------------------- . /// get the span for the markdown range. Note that this function is not cheap, use it with . /// caution. . #[must_use] . fn span(self, cx: &LateContext<'_>, range: Range) -> Option { . source_span_for_markdown_range(cx.tcx, self.doc, &range, self.fragments).map(|(sp, _)| sp) . } . } . 200 ( 0.00%) #[derive(Copy, Clone, Default)] . struct DocHeaders { . safety: bool, . errors: bool, . panics: bool, . first_paragraph_md_len: usize, . first_paragraph_text_len: usize, . } . -- line 858 ---------------------------------------- -- line 867 ---------------------------------------- . // We don't want the parser to choke on intra doc links. Since we don't . // actually care about rendering them, just pretend that all broken links . // point to a fake address. . #[expect(clippy::unnecessary_wraps)] // we're following a type signature . fn fake_broken_link_callback<'a>(_: BrokenLink<'_>) -> Option<(CowStr<'a>, CowStr<'a>)> { . Some(("fake".into(), "fake".into())) . } . 425,640 ( 0.02%) if suspicious_doc_comments::check(cx, attrs) || is_doc_hidden(attrs) { 4,197,133 ( 0.20%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/doc/suspicious_doc_comments.rs:clippy_lints::doc::suspicious_doc_comments::check (70,940x) . return None; . } . 141,876 ( 0.01%) let (fragments, _) = attrs_to_doc_fragments( . attrs.iter().filter_map(|attr| { 690 ( 0.00%) if attr.doc_str_and_fragment_kind().is_none() || attr.span().in_external_macro(cx.sess().source_map()) { . None . } else { . Some((attr, None)) . } . }), . true, . ); . 50 ( 0.00%) let mut doc = String::with_capacity(fragments.iter().map(|frag| frag.doc.as_str().len() + 1).sum()); . . for fragment in &fragments { 414 ( 0.00%) add_doc_fragment(&mut doc, fragment); 36,578 ( 0.00%) => ???:rustc_resolve::rustdoc::add_doc_fragment (138x) . } . doc.pop(); . 70,938 ( 0.00%) if doc.trim().is_empty() { 212,664 ( 0.01%) if let Some(span) = span_of_fragments(&fragments) { 850,656 ( 0.04%) => ???:rustc_resolve::rustdoc::span_of_fragments (70,888x) . span_lint_and_help( . cx, . EMPTY_DOCS, . span, . "empty doc comment", . None, . "consider removing or filling it", . ); . } 212,664 ( 0.01%) return Some(DocHeaders::default()); . } . . // Only emits the allow-by-default `DOC_LINK_CODE`; skip its extra markdown reparse when it's off. 450 ( 0.00%) if !clippy_utils::is_lint_allowed(cx, DOC_LINK_CODE, cx.last_node_with_lint_attrs) { 19,988 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_lint_allowed (50x) . check_for_code_clusters( . cx, . pulldown_cmark::Parser::new_with_broken_link_callback( . &doc, . main_body_opts() - Options::ENABLE_SMART_PUNCTUATION, . Some(&mut fake_broken_link_callback), . ) . .into_offset_iter(), -- line 920 ---------------------------------------- -- line 922 ---------------------------------------- . Fragments { . doc: &doc, . fragments: &fragments, . }, . ); . } . . // Same for the allow-by-default `DOC_PARAGRAPHS_MISSING_PUNCTUATION`, which also reparses. 350 ( 0.00%) if !clippy_utils::is_lint_allowed(cx, DOC_PARAGRAPHS_MISSING_PUNCTUATION, cx.last_node_with_lint_attrs) { 19,988 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_lint_allowed (50x) . doc_paragraphs_missing_punctuation::check( . cx, . &doc, . Fragments { . doc: &doc, . fragments: &fragments, . }, . ); . } . . // NOTE: check_doc uses it own cb function, . // to avoid causing duplicated diagnostics for the broken link checker. 250 ( 0.00%) let mut full_fake_broken_link_callback = |bl: BrokenLink<'_>| -> Option<(CowStr<'_>, CowStr<'_>)> { 4 ( 0.00%) broken_link::check(cx, &bl, &doc, &fragments); 509 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/doc/broken_link.rs:clippy_lints::doc::broken_link::check (1x) 7 ( 0.00%) Some(("fake".into(), "fake".into())) . }; . . // disable smart punctuation to pick up ['link'] more easily . let opts = main_body_opts() - Options::ENABLE_SMART_PUNCTUATION; . let parser = . pulldown_cmark::Parser::new_with_broken_link_callback(&doc, opts, Some(&mut full_fake_broken_link_callback)); . 950 ( 0.00%) Some(check_doc( 274,607 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/doc/mod.rs:clippy_lints::doc::check_doc::> (50x) . cx, . valid_idents, . parser.into_offset_iter(), . &doc, 200 ( 0.00%) Fragments { . doc: &doc, . fragments: &fragments, . }, . attrs, . )) . } . . enum Container { -- line 966 ---------------------------------------- -- line 1053 ---------------------------------------- . . impl CodeTags { . /// Based on . fn parse(lang: &str) -> Self { . let mut tags = Self::default(); . . let mut seen_rust_tags = false; . let mut seen_other_tags = false; 20 ( 0.00%) for item in lang.split([',', ' ', '\t']) { . match item.trim() { . "" => {}, 3 ( 0.00%) "rust" => { . tags.rust = true; . seen_rust_tags = true; . }, . "ignore" => { . tags.ignore = true; . seen_rust_tags = !seen_other_tags; . }, . "no_run" => { . tags.no_run = true; . seen_rust_tags = !seen_other_tags; . }, 1 ( 0.00%) "should_panic" => seen_rust_tags = !seen_other_tags, . "compile_fail" => { . tags.compile_fail = true; . seen_rust_tags = !seen_other_tags || seen_rust_tags; . }, . "test_harness" => { . tags.test_harness = true; . seen_rust_tags = !seen_other_tags || seen_rust_tags; . }, -- line 1084 ---------------------------------------- -- line 1086 ---------------------------------------- . seen_rust_tags = !seen_other_tags || seen_rust_tags; . }, . _ if item.starts_with("ignore-") => seen_rust_tags = true, . _ if item.starts_with("edition") => {}, . _ => seen_other_tags = true, . } . } . 4 ( 0.00%) tags.rust &= seen_rust_tags || !seen_other_tags; . . tags . } . } . . /// Checks parsed documentation. . /// This walks the "events" (think sections of markdown) produced by `pulldown_cmark`, . /// so lints here will generally access that information. . /// Returns documentation headers -- whether a "Safety", "Errors", "Panic" section was found . #[expect(clippy::too_many_lines, reason = "big match statement")] 600 ( 0.00%) fn check_doc<'a, Events: Iterator, Range)>>( . cx: &LateContext<'_>, . valid_idents: &FxHashSet, . events: Events, . doc: &str, . fragments: Fragments<'_>, . attrs: &[Attribute], . ) -> DocHeaders { . // true if a safety header was found . let mut headers = DocHeaders::default(); . let mut code = None; 50 ( 0.00%) let mut in_link = None; . let mut in_heading = false; . let mut in_footnote_definition = false; . let mut ticks_unbalanced = false; . let mut text_to_check: Vec<(CowStr<'_>, Range, isize)> = Vec::new(); . let mut paragraph_range = 0..0; . let mut code_level = 0; . let mut blockquote_level = 0; . let mut collected_breaks: Vec = Vec::new(); . let mut is_first_paragraph = true; . . let mut containers = Vec::new(); . . // Skip collecting text and the per-word scan when `DOC_MARKDOWN` (pedantic) is allowed. 350 ( 0.00%) let check_doc_markdown = !clippy_utils::is_lint_allowed(cx, DOC_MARKDOWN, cx.last_node_with_lint_attrs); 19,988 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_lint_allowed (50x) . 150 ( 0.00%) let mut events = events.peekable(); 3,850 ( 0.00%) => ???:0x0000000000173dc0 (50x) . 5,205 ( 0.00%) while let Some((event, range)) = events.next() { 4,059 ( 0.00%) match event { . Html(tag) | InlineHtml(tag) => { . if tag.starts_with(" { . blockquote_level -= 1; . containers.pop(); . }, . Start(CodeBlock(ref kind)) => { 4 ( 0.00%) code = Some(match kind { . CodeBlockKind::Indented => CodeTags::default(), 12 ( 0.00%) CodeBlockKind::Fenced(lang) => CodeTags::parse(lang), 22 ( 0.00%) => ???:::deref (2x) . }); . }, 2 ( 0.00%) End(TagEnd::CodeBlock) => code = None, 60 ( 0.00%) Start(Link { dest_url, .. }) => in_link = Some(dest_url), 24 ( 0.00%) End(TagEnd::Link) => in_link = None, . Start(Heading { .. } | Paragraph | Item) => { 122 ( 0.00%) if let Start(Heading { .. }) = event { . in_heading = true; . } 122 ( 0.00%) if let Start(Item) = event { . let indent = if let Some((next_event, next_range)) = events.peek() { . let next_start = match next_event { . End(TagEnd::Item) => next_range.end, . _ => next_range.start, . }; . if let Some(refdefrange) = looks_like_refdef(doc, range.start..next_start) && . let Some(refdefspan) = fragments.span(cx, refdefrange.clone()) . { -- line 1201 ---------------------------------------- -- line 1226 ---------------------------------------- . } . } else { . 0 . }; . containers.push(Container::List(indent)); . } . ticks_unbalanced = false; . paragraph_range = range; 244 ( 0.00%) if is_first_paragraph { 250 ( 0.00%) headers.first_paragraph_md_len = doc[paragraph_range.clone()].chars().count(); . } . }, . End(TagEnd::Heading(_) | TagEnd::Paragraph | TagEnd::Item) => { . if is_first_paragraph { . is_first_paragraph = false; . } 305 ( 0.00%) if let End(TagEnd::Heading(_)) = event { . in_heading = false; . } 366 ( 0.00%) if let End(TagEnd::Item) = event { . containers.pop(); . } 122 ( 0.00%) if check_doc_markdown { . if ticks_unbalanced && let Some(span) = fragments.span(cx, paragraph_range.clone()) . .or_else(|| span_of_fragments(fragments.fragments)) { . span_lint_and_help( . cx, . DOC_MARKDOWN, . span, . "backticks are unbalanced", . None, -- line 1256 ---------------------------------------- -- line 1266 ---------------------------------------- . } . } . }, . Start(FootnoteDefinition(..)) => in_footnote_definition = true, . End(TagEnd::FootnoteDefinition) => in_footnote_definition = false, . Start(_) | End(_) // We don't care about other tags . | TaskListMarker(_) | Rule => (), . SoftBreak | HardBreak => { 92 ( 0.00%) if is_first_paragraph { 78 ( 0.00%) headers.first_paragraph_text_len += 1; . } 184 ( 0.00%) if !containers.is_empty() . && !in_footnote_definition . // Tabs aren't handled correctly vvvv . && !doc[range.clone()].contains('\t') . && let Some((next_event, next_range)) = events.peek() . && !matches!(next_event, End(_)) . { . lazy_continuation::check( . cx, -- line 1285 ---------------------------------------- -- line 1294 ---------------------------------------- . if event == HardBreak . && !doc[range.clone()].trim().starts_with('\\') . && let Some(span) = fragments.span(cx, range.clone()) . && !span.from_expansion() . { . collected_breaks.push(span); . } . }, 56 ( 0.00%) Code(code) | InlineMath(code) | DisplayMath(code) => { 42 ( 0.00%) if is_first_paragraph { 32 ( 0.00%) headers.first_paragraph_text_len += code.chars().count(); 88 ( 0.00%) => ???:::deref (8x) . } . } 500 ( 0.00%) Text(text) => { 250 ( 0.00%) if is_first_paragraph { 644 ( 0.00%) headers.first_paragraph_text_len += text.chars().count(); 968 ( 0.00%) => ???:::deref (88x) . } . paragraph_range.end = range.end; . let range_ = range.clone(); 712 ( 0.00%) ticks_unbalanced |= text.contains('`') 1,375 ( 0.00%) => ???:::deref (125x) . && code.is_none() . && doc[range.clone()].bytes().enumerate().any(|(i, c)| { . // scan the markdown source code bytes for backquotes that aren't preceded by backslashes . // - use bytes, instead of chars, to avoid utf8 decoding overhead (special chars are ascii) . // - relevant backquotes are within doc[range], but backslashes are not, because they're not . // actually part of the rendered text (pulldown-cmark doesn't emit any events for escapes) . // - if `range_.start + i == 0`, then `range_.start + i - 1 == -1`, and since we're working in . // usize, that would underflow and maybe panic . c == b'`' && (range_.start + i == 0 || doc.as_bytes().get(range_.start + i - 1) != Some(&b'\\')) . }); 258 ( 0.00%) if Some(&text) == in_link.as_ref() || ticks_unbalanced { . // Probably a link of the form `` . // Which are represented as a link to "http://example.com" with . // text "http://example.com" by pulldown-cmark . continue; . } 250 ( 0.00%) let trimmed_text = text.trim(); 1,375 ( 0.00%) => ???:::deref (125x) 250 ( 0.00%) headers.safety |= in_heading && trimmed_text == "Safety"; . headers.safety |= in_heading && trimmed_text == "SAFETY"; . headers.safety |= in_heading && trimmed_text == "Implementation safety"; . headers.safety |= in_heading && trimmed_text == "Implementation Safety"; 760 ( 0.00%) headers.errors |= in_heading && trimmed_text == "Errors"; 394 ( 0.00%) headers.panics |= in_heading && trimmed_text == "Panics"; . 250 ( 0.00%) if let Some(tags) = code { 12 ( 0.00%) if tags.rust && !tags.compile_fail && !tags.ignore { 4 ( 0.00%) needless_doctest_main::check(cx, &text, range.start, fragments); 11 ( 0.00%) => ???:::deref (1x) . 5 ( 0.00%) if !tags.no_run && !tags.test_harness { 4 ( 0.00%) test_attr_in_doctest::check(cx, &text, range.start, fragments); 11 ( 0.00%) => ???:::deref (1x) . } . } . } else { 123 ( 0.00%) if in_link.is_some() { . link_with_quotes::check(cx, trimmed_text, range.clone(), fragments); . } . if let Some(link) = in_link.as_ref() 69 ( 0.00%) && let Ok(url) = Url::parse(link) 88 ( 0.00%) => ???:::deref (8x) 7 ( 0.00%) && (url.scheme() == "https" || url.scheme() == "http") . { . // Don't check the text associated with external URLs . continue; . } 232 ( 0.00%) if check_doc_markdown { . text_to_check.push((text, range.clone(), code_level)); . } 1,276 ( 0.00%) doc_suspicious_footnotes::check(cx, doc, range, &fragments, attrs); 56,614 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/doc/doc_suspicious_footnotes.rs:clippy_lints::doc::doc_suspicious_footnotes::check (116x) . } 118 ( 0.00%) } . FootnoteReference(_) => {} . } 3,802 ( 0.00%) } 1,280 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:core::ptr::drop_glue:: (122x) 1,007 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:core::ptr::drop_glue:: (64x) . 50 ( 0.00%) doc_comment_double_space_linebreaks::check(cx, &collected_breaks); 750 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/doc/doc_comment_double_space_linebreaks.rs:clippy_lints::doc::doc_comment_double_space_linebreaks::check (50x) . . headers 400 ( 0.00%) } . . fn looks_like_refdef(doc: &str, range: Range) -> Option> { . if range.end < range.start { . return None; . } . . let offset = range.start; . let mut iterator = doc.as_bytes()[range].iter().copied().enumerate(); -- line 1378 ---------------------------------------- 219,228 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/incompatible_msrv.rs -------------------------------------------------------------------------------- Ir -- line 80 ---------------------------------------- . Since(RustcVersion), . } . . /// All known std crates containing a stability attribute. . struct StdCrates([Option; 6]); . impl StdCrates { . fn new(tcx: TyCtxt<'_>) -> Self { . let mut res = Self([None; _]); 42 ( 0.00%) for &krate in tcx.crates(()) { . // FIXME(@Jarcho): We should have an internal lint to detect when this list is out of date. . match tcx.crate_name(krate) { 158 ( 0.00%) sym::alloc => res.0[0] = Some(krate), . sym::core => res.0[1] = Some(krate), . sym::core_arch => res.0[2] = Some(krate), . sym::proc_macro => res.0[3] = Some(krate), . sym::std => res.0[4] = Some(krate), . sym::std_detect => res.0[5] = Some(krate), . _ => {}, . } . } -- line 99 ---------------------------------------- -- line 112 ---------------------------------------- . std_crates: StdCrates, . . // The most recently called path. Used to skip checking the path after it's . // been checked when visiting the call expression. . called_path: Option, . } . . impl IncompatibleMsrv { 9 ( 0.00%) pub fn new(tcx: TyCtxt<'_>, conf: &'static Conf) -> Self { 19 ( 0.00%) Self { 2 ( 0.00%) msrv: conf.msrv.into(), . availability_cache: FxHashMap::default(), 1 ( 0.00%) check_in_tests: conf.check_incompatible_msrv_in_tests, . std_crates: StdCrates::new(tcx), . called_path: None, . } 8 ( 0.00%) } . . /// Returns the availability of `def_id`, whether it is enabled through a feature or . /// available since a given version (the default being Rust 1.0.0). `needs_const` requires . /// the `const`-stability to be looked up instead of the stability in non-`const` contexts. 2,310 ( 0.00%) fn get_def_id_availability(&mut self, tcx: TyCtxt<'_>, def_id: DefId, needs_const: bool) -> Availability { . if let Some(availability) = self.availability_cache.get(&(def_id, needs_const)) { 352 ( 0.00%) return *availability; . } 102 ( 0.00%) let (feature, stability_level) = if needs_const { . tcx.lookup_const_stability(def_id) . .map(|stability| (stability.feature, stability.level)) . .unzip() . } else { . tcx.lookup_stability(def_id) . .map(|stability| (stability.feature, stability.level)) . .unzip() . }; 238 ( 0.00%) let version = if feature.is_some_and(|feature| tcx.features().enabled(feature)) { 1,020 ( 0.00%) => ???:::features (34x) 136 ( 0.00%) => ???:::enabled (34x) . Availability::FeatureEnabled . } else if let Some(StableSince::Version(version)) = . stability_level.as_ref().and_then(StabilityLevel::stable_since) . { . Availability::Since(version) . } else if needs_const { . // Fallback to regular stability . self.get_def_id_availability(tcx, def_id, false) -- line 154 ---------------------------------------- -- line 158 ---------------------------------------- . Availability::Since(RustcVersion { . major: 1, . minor: 0, . patch: 0, . }) . }; . self.availability_cache.insert((def_id, needs_const), version); . version 1,890 ( 0.00%) } . . /// Emit lint if `def_id`, associated with `node` and `span`, is below the current MSRV. 30,660 ( 0.00%) fn emit_lint_if_under_msrv( . &mut self, . cx: &LateContext<'_>, . needs_const: bool, . def_id: DefId, . node: HirId, . span: Span, . ) { . if !self.std_crates.contains(def_id.krate) { . // No stability attributes to lookup for these items. . return; . } . // Use `from_expansion` to fast-path the common case. . if span.from_expansion() { . let expn = span.ctxt().outer_expn_data(); 226 ( 0.00%) match expn.kind { . // FIXME(@Jarcho): Check that the actual desugaring or std macro is supported by the . // current MSRV. Note that nested expansions need to be handled as well. . ExpnKind::AstPass(_) | ExpnKind::Desugaring(_) => return, 23 ( 0.00%) ExpnKind::Macro(..) if expn.macro_def_id.is_some_and(|did| self.std_crates.contains(did.krate)) => { . return; . }, . // All other expansions share the target's MSRV. . // FIXME(@Jarcho): What should we do about version dependant macros from external crates? . _ => {}, . } . } . . // Check `is_in_test` last as it walks the HIR parent chain. 3,360 ( 0.00%) if let Some(current) = self.msrv.current(cx) 2,100 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::current (210x) 3,150 ( 0.00%) && let Availability::Since(version) = self.get_def_id_availability(cx.tcx, def_id, needs_const) 24,974 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/incompatible_msrv.rs:::get_def_id_availability (210x) 840 ( 0.00%) && version > current . && (self.check_in_tests || !is_in_test(cx.tcx, node)) . { . span_lint_and_then( . cx, . INCOMPATIBLE_MSRV, . span, . format!( . "current MSRV (Minimum Supported Rust Version) is `{current}` but this item is stable{} since `{version}`", -- line 208 ---------------------------------------- -- line 210 ---------------------------------------- . ), . |diag| { . if is_under_cfg_attribute(cx, node) { . diag.note_once("you may want to conditionally increase the MSRV considered by Clippy using the `clippy::msrv` attribute"); . } . }, . ); . } 16,352 ( 0.00%) } . } . . impl<'tcx> LateLintPass<'tcx> for IncompatibleMsrv { 618,678 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 480,178 ( 0.02%) match expr.kind { . ExprKind::MethodCall(_, _, _, span) => { 770 ( 0.00%) if let Some(method_did) = cx.typeck_results().type_dependent_def_id(expr.hir_id) { 5,610 ( 0.00%) => ???:::type_dependent_def_id (110x) 1,320 ( 0.00%) self.emit_lint_if_under_msrv(cx, is_in_const_context(cx), method_did, expr.hir_id, span); 22,280 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/incompatible_msrv.rs:::emit_lint_if_under_msrv (110x) 29,580 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_const_context (110x) . } . }, 1,393 ( 0.00%) ExprKind::Call(callee, _) if let ExprKind::Path(qpath) = callee.kind => { 398 ( 0.00%) self.called_path = Some(callee.hir_id); 597 ( 0.00%) let needs_const = is_in_const_context(cx); 53,471 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_const_context (199x) 1,194 ( 0.00%) let def_id = if let Some(def_id) = cx.qpath_res(&qpath, callee.hir_id).opt_def_id() { 5,952 ( 0.00%) => ???:::qpath_res (199x) . def_id 26 ( 0.00%) } else if needs_const && let ty::FnDef(def_id, _) = *cx.typeck_results().expr_ty(callee).kind() { . // Edge case where a function is first assigned then called. . // We previously would have warned for the non-const MSRV, when . // checking the path, but now that it's called the const MSRV . // must also be met. . def_id . } else { . return; . }; 1,302 ( 0.00%) self.emit_lint_if_under_msrv(cx, needs_const, def_id, expr.hir_id, callee.span); . }, . // Desugaring into function calls by the compiler will use `QPath::LangItem` variants. Those should . // not be linted as they will not be generated in older compilers if the function is not available, . // and the compiler is allowed to call unstable functions. 2,060 ( 0.00%) ExprKind::Path(qpath) 18,540 ( 0.00%) if let Some(path_def_id) = cx.qpath_res(&qpath, expr.hir_id).opt_def_id() 48,755 ( 0.00%) => ???:::qpath_res (2,060x) . && self.called_path != Some(expr.hir_id) => . { 10,444 ( 0.00%) self.emit_lint_if_under_msrv(cx, false, path_def_id, expr.hir_id, expr.span); . }, . _ => {}, . } 549,936 ( 0.03%) } . . fn check_ty(&mut self, cx: &LateContext<'tcx>, hir_ty: &'tcx hir::Ty<'tcx, AmbigArg>) { 3,290 ( 0.00%) if let hir::TyKind::Path(qpath) = hir_ty.kind 4,088 ( 0.00%) && let Some(ty_def_id) = cx.qpath_res(&qpath, hir_ty.hir_id).opt_def_id() 11,753 ( 0.00%) => ???:::qpath_res (511x) . // `CStr` and `CString` have been moved around but have been available since Rust 1.0.0 1,792 ( 0.00%) && !matches!(cx.tcx.get_diagnostic_name(ty_def_id), Some(sym::cstr_type | sym::cstring_type)) 12,675 ( 0.00%) => ???:::get_diagnostic_name (256x) . { 2,304 ( 0.00%) self.emit_lint_if_under_msrv(cx, false, ty_def_id, hir_ty.hir_id, hir_ty.span); 16,974 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/incompatible_msrv.rs:::emit_lint_if_under_msrv (256x) . } . } . } . . /// Heuristic checking if the node `hir_id` is under a `#[cfg()]` or `#[cfg_attr()]` . /// attribute. . fn is_under_cfg_attribute(cx: &LateContext<'_>, hir_id: HirId) -> bool { . cx.tcx -- line 272 ---------------------------------------- 4,588 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/attr/version.rs -------------------------------------------------------------------------------- Ir . use std::fmt::{self, Display}; . use std::sync::OnceLock; . . use rustc_macros::{BlobDecodable, Encodable, StableHash, current_rustc_version}; . 848,654 ( 0.04%) #[derive(Encodable, BlobDecodable, Copy, Clone, Debug, PartialEq, Eq, PartialOrd, Ord, Hash)] . #[derive(StableHash)] . pub struct RustcVersion { . pub major: u16, . pub minor: u16, . pub patch: u16, . } . . impl RustcVersion { -- line 14 ---------------------------------------- 423,802 ( 0.02%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/option_env_unwrap.rs -------------------------------------------------------------------------------- Ir -- line 30 ---------------------------------------- . correctness, . "using `option_env!(...).unwrap()` to get environment variable" . } . . declare_lint_pass!(OptionEnvUnwrap => [OPTION_ENV_UNWRAP]); . . impl EarlyLintPass for OptionEnvUnwrap { . fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 144,168 ( 0.01%) if let ExprKind::MethodCall(MethodCall { seg, receiver, .. }) = &expr.kind 550 ( 0.00%) && matches!(seg.ident.name, sym::expect | sym::unwrap) . && is_direct_expn_of(receiver.span, sym::option_env).is_some() . { . span_lint_and_help( . cx, . OPTION_ENV_UNWRAP, . expr.span, . "this will panic at run-time if the environment variable doesn't exist at compile-time", . None, -- line 47 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/cmp.rs -------------------------------------------------------------------------------- Ir -- line 13 ---------------------------------------- . #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] . const impl PartialEq<[U]> for [T] . where . T: [const] PartialEq, . { . #[inline] . fn eq(&self, other: &[U]) -> bool { . let len = self.len(); 1,054 ( 0.00%) if len == other.len() { . // SAFETY: Just checked that they're the same length, and the pointers . // come from references-to-slices so they're guaranteed readable. . unsafe { SlicePartialEq::equal_same_length(self.as_ptr(), other.as_ptr(), len) } . } else { . false . } . } . } -- line 29 ---------------------------------------- -- line 123 ---------------------------------------- . // The codegen backend can still inline it later if needed. . #[rustc_no_mir_inline] . default unsafe fn equal_same_length(lhs: *const Self, rhs: *const B, len: usize) -> bool { . // Implemented as explicit indexing rather . // than zipped iterators for performance reasons. . // See PR https://github.com/rust-lang/rust/pull/116846 . // FIXME(const_hack): make this a `for idx in 0..len` loop. . let mut idx = 0; 4 ( 0.00%) while idx < len { . // SAFETY: idx < len, so both are in-bounds and readable 6 ( 0.00%) if unsafe { *lhs.add(idx) != *rhs.add(idx) } { . return false; . } . idx += 1; . } . . true . } . } -- line 141 ---------------------------------------- -- line 149 ---------------------------------------- . { . #[inline] . unsafe fn equal_same_length(lhs: *const Self, rhs: *const B, len: usize) -> bool { . // SAFETY: by our precondition, `lhs` and `rhs` are guaranteed to be valid . // for reading `len` values, which also means the size is guaranteed . // not to overflow because it exists in memory; . unsafe { . let size = crate::intrinsics::unchecked_mul(len, Self::SIZE); 474,984 ( 0.02%) compare_bytes(lhs as _, rhs as _, size) == 0 22 ( 0.00%) => ???:0x0000000000173660 (1x) . } . } . } . . #[doc(hidden)] . #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] . // intermediate trait for specialization of slice's PartialOrd . const trait SlicePartialOrd: Sized { -- line 165 ---------------------------------------- 40,512 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/default_constructed_unit_structs.rs -------------------------------------------------------------------------------- Ir -- line 46 ---------------------------------------- . "unit structs can be constructed without calling `default`" . } . . declare_lint_pass!(DefaultConstructedUnitStructs => [ . DEFAULT_CONSTRUCTED_UNIT_STRUCTS, . ]); . . fn is_alias(ty: hir::Ty<'_>) -> bool { 15 ( 0.00%) if let hir::TyKind::Path(ref qpath) = ty.kind { 5 ( 0.00%) is_ty_alias(qpath) 80 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_ty_alias (5x) . } else { . false . } . } . . impl LateLintPass<'_> for DefaultConstructedUnitStructs { 481,194 ( 0.02%) fn check_expr<'tcx>(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>) { 137,887 ( 0.01%) if let ExprKind::Call(fn_expr, &[]) = expr.kind . // make sure we have a call to `Default::default` 25 ( 0.00%) && let ExprKind::Path(ref qpath @ hir::QPath::TypeRelative(base, _)) = fn_expr.kind . // make sure this isn't a type alias: . // `::Assoc` cannot be used as a constructor 40 ( 0.00%) && !is_alias(*base) 50 ( 0.00%) && let Res::Def(_, def_id) = cx.qpath_res(qpath, fn_expr.hir_id) 390 ( 0.00%) => ???:::qpath_res (5x) 25 ( 0.00%) && cx.tcx.is_diagnostic_item(sym::default_fn, def_id) 220 ( 0.00%) => ???:::is_diagnostic_item (5x) . // make sure we have a struct with no fields (unit struct) . && let ty::Adt(def, ..) = cx.typeck_results().expr_ty(expr).kind() . && def.is_struct() . && let var @ ty::VariantDef { ctor: Some((hir::def::CtorKind::Const, _)), .. } = def.non_enum_variant() . && !var.is_field_list_non_exhaustive() . && !expr.span.from_expansion() && !qpath.span().from_expansion() . // do not suggest replacing an expression by a type name with placeholders . && !base.is_suggestable_infer_ty() -- line 78 ---------------------------------------- -- line 91 ---------------------------------------- . diag.multipart_suggestion( . "remove this call to `default`", . removals, . Applicability::MachineApplicable, . ); . }, . ); . } 549,936 ( 0.03%) } . } 20 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/double_parens.rs -------------------------------------------------------------------------------- Ir -- line 36 ---------------------------------------- . pub DOUBLE_PARENS, . complexity, . "Warn on unnecessary double parentheses" . } . . declare_lint_pass!(DoubleParens => [DOUBLE_PARENS]); . . impl EarlyLintPass for DoubleParens { 504,203 ( 0.02%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 503,275 ( 0.02%) match &expr.kind { . // ((..)) . // ^^^^^^ expr . // ^^^^ inner . ExprKind::Paren(inner) 78 ( 0.00%) if matches!(inner.kind, ExprKind::Paren(_) | ExprKind::Tup(_)) . && expr.span.eq_ctxt(inner.span) . && !expr.span.in_external_macro(cx.sess().source_map()) . && check_source(cx, inner) => . { . // suggest removing the outer parens . . let mut applicability = Applicability::MachineApplicable; . // We don't need to use `snippet_with_context` here, because: -- line 58 ---------------------------------------- -- line 69 ---------------------------------------- . applicability, . ); . }, . . // func((n)) . // ^^^^^^^^^ expr . // ^^^ arg . // ^ inner 110 ( 0.00%) ExprKind::Call(_, args) | ExprKind::MethodCall(MethodCall { args, .. }) 574 ( 0.00%) if let [arg] = &**args 528 ( 0.00%) && let ExprKind::Paren(inner) = &arg.kind . && expr.span.eq_ctxt(arg.span) . && !arg.span.in_external_macro(cx.sess().source_map()) . && check_source(cx, arg) => . { . // suggest removing the inner parens . . let mut applicability = Applicability::MachineApplicable; . let sugg = snippet_with_context(cx.sess(), inner.span, arg.span.ctxt(), "_", &mut applicability).0; -- line 87 ---------------------------------------- -- line 92 ---------------------------------------- . "unnecessary parentheses", . "remove them", . sugg.to_string(), . applicability, . ); . }, . _ => {}, . } 576,232 ( 0.03%) } . } . . /// Check that the span does indeed look like `( (..) )` . fn check_source(cx: &EarlyContext<'_>, inner: &Expr) -> bool { . if let Some(sfr) = inner.span.get_source_range(cx) . // this is the same as `SourceFileRange::as_str`, but doesn't apply the range right away, because . // we're interested in the source code outside it . && let Some(src) = sfr.sf.src.as_ref().map(|src| src.as_str()) -- line 108 ---------------------------------------- 176 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/pattern.rs -------------------------------------------------------------------------------- Ir -- line 243 ---------------------------------------- . /// . /// Unlike [`next()`][Searcher::next], there is no guarantee that the returned ranges . /// of this and [`next_reject`][Searcher::next_reject] will overlap. This will return . /// `(start_match, end_match)`, where start_match is the index of where . /// the match begins, and end_match is the index after the end of the match. . #[inline] . fn next_match(&mut self) -> Option<(usize, usize)> { . loop { 16 ( 0.00%) match self.next() { . SearchStep::Match(a, b) => return Some((a, b)), . SearchStep::Done => return None, . _ => continue, . } . } . } . . /// Finds the next [`Reject`][SearchStep::Reject] result. See [`next()`][Searcher::next] . /// and [`next_match()`][Searcher::next_match]. . /// . /// Unlike [`next()`][Searcher::next], there is no guarantee that the returned ranges . /// of this and [`next_match`][Searcher::next_match] will overlap. . #[inline] . fn next_reject(&mut self) -> Option<(usize, usize)> { 237,980 ( 0.01%) loop { 47,604 ( 0.00%) match self.next() { . SearchStep::Reject(a, b) => return Some((a, b)), . SearchStep::Done => return None, . _ => continue, . } . } . } . } . -- line 275 ---------------------------------------- -- line 324 ---------------------------------------- . } . } . . /// Finds the next [`Reject`][SearchStep::Reject] result. . /// See [`next_back()`][ReverseSearcher::next_back]. . #[inline] . fn next_reject_back(&mut self) -> Option<(usize, usize)> { . loop { 1,005 ( 0.00%) match self.next_back() { . SearchStep::Reject(a, b) => return Some((a, b)), . SearchStep::Done => return None, . _ => continue, . } . } . } . } . -- line 340 ---------------------------------------- -- line 416 ---------------------------------------- . // starts at the end and only decreases . let slice = unsafe { self.haystack.get_unchecked(old_finger..self.finger_back) }; . let mut iter = slice.chars(); . let old_len = iter.iter.len(); . if let Some(ch) = iter.next() { . // add byte offset of current character . // without re-encoding as utf-8 . self.finger += old_len - iter.iter.len(); 47,596 ( 0.00%) if ch == self.needle { . SearchStep::Match(old_finger, self.finger) . } else { . SearchStep::Reject(old_finger, self.finger) . } . } else { . SearchStep::Done . } . } . #[inline] . fn next_match(&mut self) -> Option<(usize, usize)> { . loop { . // get the haystack after the last character found . let bytes = self.haystack.as_bytes().get(self.finger..self.finger_back)?; . // the last byte of the utf8 encoded needle . // SAFETY: we have an invariant that `utf8_size < 5` 155,512 ( 0.01%) let last_byte = unsafe { *self.utf8_encoded.get_unchecked(self.utf8_size() - 1) }; 238,326 ( 0.01%) if let Some(index) = memchr::memchr(last_byte, bytes) { . // The new finger is the index of the byte we found, . // plus one, since we memchr'd for the last byte of the character. . // . // Note that this doesn't always give us a finger on a UTF8 boundary. . // If we *didn't* find our character . // we may have indexed to the non-last byte of a 3-byte or 4-byte character. . // We can't just skip to the next valid starting byte because a character like . // ꁁ (U+A041 YI SYLLABLE PA), utf-8 `EA 81 81` will have us always find -- line 449 ---------------------------------------- -- line 451 ---------------------------------------- . // . // However, this is totally okay. While we have the invariant that . // self.finger is on a UTF8 boundary, this invariant is not relied upon . // within this method (it is relied upon in CharSearcher::next()). . // . // We only exit this method when we reach the end of the string, or if we . // find something. When we find something the `finger` will be set . // to a UTF8 boundary. 5,864 ( 0.00%) self.finger += index + 1; 14,151 ( 0.00%) if self.finger >= self.utf8_size() { . let found_char = self.finger - self.utf8_size(); . if let Some(slice) = self.haystack.as_bytes().get(found_char..self.finger) { 5,528 ( 0.00%) if slice == &self.utf8_encoded[0..self.utf8_size()] { . return Some((found_char, self.finger)); . } . } . } . } else { . // found nothing, exit 38,695 ( 0.00%) self.finger = self.finger_back; . return None; . } . } . } . . // let next_reject use the default implementation from the Searcher trait . } . -- line 478 ---------------------------------------- -- line 501 ---------------------------------------- . fn next_match_back(&mut self) -> Option<(usize, usize)> { . let haystack = self.haystack.as_bytes(); . loop { . // get the haystack up to but not including the last character searched . let bytes = haystack.get(self.finger..self.finger_back)?; . // the last byte of the utf8 encoded needle . // SAFETY: we have an invariant that `utf8_size < 5` . let last_byte = unsafe { *self.utf8_encoded.get_unchecked(self.utf8_size() - 1) }; 232,308 ( 0.01%) if let Some(index) = memchr::memrchr(last_byte, bytes) { 2,300,706 ( 0.11%) => ???:core::slice::memchr::memrchr (38,718x) . // we searched a slice that was offset by self.finger, . // add self.finger to recoup the original index 7 ( 0.00%) let index = self.finger + index; . // memrchr will return the index of the byte we wish to . // find. In case of an ASCII character, this is indeed . // were we wish our new finger to be ("after" the found . // char in the paradigm of reverse iteration). For . // multibyte chars we need to skip down by the number of more . // bytes they have than ASCII . let shift = self.utf8_size() - 1; 28 ( 0.00%) if index >= shift { . let found_char = index - shift; 21 ( 0.00%) if let Some(slice) = haystack.get(found_char..(found_char + self.utf8_size())) { 7 ( 0.00%) if slice == &self.utf8_encoded[0..self.utf8_size()] { . // move finger to before the character found (i.e., at its start index) 7 ( 0.00%) self.finger_back = found_char; . return Some((self.finger_back, self.finger_back + self.utf8_size())); . } . } . } . // We can't use finger_back = index - size + 1 here. If we found the last char . // of a different-sized character (or the middle byte of a different character) . // we need to bump the finger_back down to `index`. This similarly makes . // `finger_back` have the potential to no longer be on a boundary, -- line 533 ---------------------------------------- -- line 535 ---------------------------------------- . // or when the haystack has been searched completely. . // . // Unlike next_match this does not . // have the problem of repeated bytes in utf-8 because . // we're searching for the last byte, and we can only have . // found the last byte when searching in reverse. . self.finger_back = index; . } else { 38,711 ( 0.00%) self.finger_back = self.finger; . // found nothing, exit . return None; . } . } . } . . // let next_reject_back use the default implementation from the Searcher trait . } -- line 551 ---------------------------------------- -- line 584 ---------------------------------------- . #[inline] . fn is_contained_in(self, haystack: &str) -> bool { . if (self as u32) < 128 { . haystack.as_bytes().contains(&(self as u8)) . } else { . let mut buffer = [0u8; 4]; . self.encode_utf8(&mut buffer).is_contained_in(haystack) . } 9 ( 0.00%) } . . #[inline] . fn is_prefix_of(self, haystack: &str) -> bool { . self.encode_utf8(&mut [0u8; 4]).is_prefix_of(haystack) . } . . #[inline] . fn strip_prefix_of(self, haystack: &str) -> Option<&str> { -- line 600 ---------------------------------------- -- line 691 ---------------------------------------- . fn next(&mut self) -> SearchStep { . let s = &mut self.char_indices; . // Compare lengths of the internal byte slice iterator . // to find length of current char . let pre_len = s.iter.iter.len(); . if let Some((i, c)) = s.next() { . let len = s.iter.iter.len(); . let char_len = pre_len - len; 386 ( 0.00%) if self.char_eq.matches(c) { . return SearchStep::Match(i, i + char_len); . } else { . return SearchStep::Reject(i, i + char_len); . } . } . SearchStep::Done . } . } -- line 707 ---------------------------------------- -- line 970 ---------------------------------------- . /// ``` . /// assert_eq!("Hello world".find("world"), Some(6)); . /// ``` . impl<'b> Pattern for &'b str { . type Searcher<'a> = StrSearcher<'a, 'b>; . . #[inline] . fn into_searcher(self, haystack: &str) -> StrSearcher<'_, 'b> { 38,081 ( 0.00%) StrSearcher::new(haystack, self) 1,284 ( 0.00%) => ???:::new (6x) . } . . /// Checks whether the pattern matches at the front of the haystack. . #[inline] . fn is_prefix_of(self, haystack: &str) -> bool { . haystack.as_bytes().starts_with(self.as_bytes()) . } . . /// Checks whether the pattern matches anywhere in the haystack . #[inline] 20 ( 0.00%) fn is_contained_in(self, haystack: &str) -> bool { . if self.len() == 0 { . return true; . } . 14 ( 0.00%) match self.len().cmp(&haystack.len()) { . Ordering::Less => { . if self.len() == 1 { . return haystack.as_bytes().contains(&self.as_bytes()[0]); . } . . #[cfg(any( . all(target_arch = "x86_64", target_feature = "sse2"), . all(target_arch = "loongarch64", target_feature = "lsx"), -- line 1002 ---------------------------------------- -- line 1007 ---------------------------------------- . return result; . } . } . . self.into_searcher(haystack).next_match().is_some() . } . _ => self == haystack, . } 16 ( 0.00%) } . . /// Removes the pattern from the front of haystack, if it matches. . #[inline] . fn strip_prefix_of(self, haystack: &str) -> Option<&str> { 283 ( 0.00%) if self.is_prefix_of(haystack) { . // SAFETY: prefix was just verified to exist. . unsafe { Some(haystack.get_unchecked(self.as_bytes().len()..)) } . } else { . None . } . } . . /// Checks whether the pattern matches at the back of the haystack. -- line 1028 ---------------------------------------- -- line 1035 ---------------------------------------- . } . . /// Removes the pattern from the back of haystack, if it matches. . #[inline] . fn strip_suffix_of<'a>(self, haystack: &'a str) -> Option<&'a str> . where . Self::Searcher<'a>: ReverseSearcher<'a>, . { 41,496 ( 0.00%) if self.is_suffix_of(haystack) { 29 ( 0.00%) let i = haystack.len() - self.as_bytes().len(); . // SAFETY: suffix was just verified to exist. . unsafe { Some(haystack.get_unchecked(..i)) } . } else { . None . } . } . . #[inline] -- line 1052 ---------------------------------------- -- line 1165 ---------------------------------------- . } . otherwise => otherwise, . } . } . } . } . . #[inline] 38,160 ( 0.00%) fn next_match(&mut self) -> Option<(usize, usize)> { 10,914 ( 0.00%) match self.searcher { . StrSearcherImpl::Empty(..) => loop { . match self.next() { . SearchStep::Match(a, b) => return Some((a, b)), . SearchStep::Done => return None, . SearchStep::Reject(..) => {} . } . }, . StrSearcherImpl::TwoWay(ref mut searcher) => { 10,915 ( 0.00%) let is_long = searcher.memory == usize::MAX; . // write out `true` and `false` cases to encourage the compiler . // to specialize the two cases separately. 5,458 ( 0.00%) if is_long { . searcher.next::( . self.haystack.as_bytes(), . self.needle.as_bytes(), . true, . ) . } else { . searcher.next::( . self.haystack.as_bytes(), . self.needle.as_bytes(), . false, . ) . } . } . } 43,536 ( 0.00%) } . } . . unsafe impl<'a, 'b> ReverseSearcher<'a> for StrSearcher<'a, 'b> { . #[inline] . fn next_back(&mut self) -> SearchStep { . match self.searcher { . StrSearcherImpl::Empty(ref mut searcher) => { . if searcher.is_finished { -- line 1209 ---------------------------------------- -- line 1446 ---------------------------------------- . . #[inline] . fn byteset_create(bytes: &[u8]) -> u64 { . bytes.iter().fold(0, |a, &b| (1 << (b & 0x3f)) | a) . } . . #[inline] . fn byteset_contains(&self, byte: u8) -> bool { 163,416 ( 0.01%) (self.byteset >> ((byte & 0x3f) as usize)) & 1 != 0 . } . . // One of the main ideas of Two-Way is that we factorize the needle into . // two halves, (u, v), and begin trying to find v in the haystack by scanning . // left to right. If v matches, we try to match u by scanning right to left. . // How far we can jump when we encounter a mismatch is all based on the fact . // that (u, v) is a critical factorization for the needle. . #[inline] . fn next(&mut self, haystack: &[u8], needle: &[u8], long_period: bool) -> S::Output . where . S: TwoWayStrategy, . { . // `next()` uses `self.position` as its cursor . let old_pos = self.position; 5,457 ( 0.00%) let needle_last = needle.len() - 1; . 'search: loop { . // Check that we have room to search in . // position + needle_last can not overflow if we assume slices . // are bounded by isize's range. 70,416 ( 0.00%) let tail_byte = match haystack.get(self.position + needle_last) { . Some(&b) => b, . None => { 5,372 ( 0.00%) self.position = haystack.len(); . return S::rejecting(old_pos, self.position); . } . }; . . if S::use_early_reject() && old_pos != self.position { . return S::rejecting(old_pos, self.position); . } . . // Quickly skip by large portions unrelated to our substring 114,837 ( 0.01%) if !self.byteset_contains(tail_byte) { 93,561 ( 0.00%) self.position += needle.len(); . if !long_period { . self.memory = 0; . } . continue 'search; . } . . // See if the right part of the needle matches . let start = -- line 1496 ---------------------------------------- -- line 1497 ---------------------------------------- . if long_period { self.crit_pos } else { cmp::max(self.crit_pos, self.memory) }; . for i in start..needle.len() { . // SAFETY: on every iteration of `'search`, the `haystack.get(self.position + needle_last)` . // check returned `Some`, so `self.position + needle_last < haystack.len()`. . // Since `i < needle.len()` implies `i <= needle_last`, we have . // `self.position + i < haystack.len()`. . // Every path that mutates `self.position` below either returns or re-enters `'search`, . // which re-runs the check before reaching the loop again. 11,207 ( 0.00%) if needle[i] != unsafe { *haystack.get_unchecked(self.position + i) } { 2,862 ( 0.00%) self.position += i - self.crit_pos + 1; 4,311 ( 0.00%) if !long_period { . self.memory = 0; . } . continue 'search; . } . } . . // See if the left part of the needle matches . let start = if long_period { 0 } else { self.memory }; . for i in (start..self.crit_pos).rev() { . // SAFETY: on every iteration of `'search`, the `haystack.get(self.position + needle_last)` . // check returned `Some`, so `self.position + needle_last < haystack.len()`. . // Since `i < self.crit_pos <= needle.len()`, we have `i <= needle_last`, and thus . // `self.position + i <= self.position + needle_last < haystack.len()`. . // Every path that mutates `self.position` below either returns or re-enters `'search`, . // which re-runs the check before reaching the loop again. 117 ( 0.00%) if needle[i] != unsafe { *haystack.get_unchecked(self.position + i) } { 18 ( 0.00%) self.position += self.period; 1,128 ( 0.00%) if !long_period { . self.memory = needle.len() - self.period; . } . continue 'search; . } . } . . // We have found a match! . let match_pos = self.position; . . // Note: add self.period instead of needle.len() to have overlapping matches 172 ( 0.00%) self.position += needle.len(); . if !long_period { 86 ( 0.00%) self.memory = 0; // set to needle.len() - self.period for overlapping matches . } . . return S::matching(match_pos, match_pos + needle.len()); . } . } . . // Follows the ideas in `next()`. . // -- line 1546 ---------------------------------------- -- line 1759 ---------------------------------------- . false . } . #[inline] . fn rejecting(_a: usize, _b: usize) -> Self::Output { . None . } . #[inline] . fn matching(a: usize, b: usize) -> Self::Output { 289 ( 0.00%) Some((a, b)) . } . } . . /// Emit Rejects regularly . enum RejectAndMatch {} . . impl TwoWayStrategy for RejectAndMatch { . type Output = SearchStep; -- line 1775 ---------------------------------------- -- line 1818 ---------------------------------------- . let haystack = haystack.as_bytes(); . . debug_assert!(needle.len() > 1); . . use crate::ops::BitAnd; . use crate::simd::cmp::SimdPartialEq; . use crate::simd::{mask8x16 as Mask, u8x16 as Block}; . 2 ( 0.00%) let first_probe = needle[0]; 2 ( 0.00%) let last_byte_offset = needle.len() - 1; . . // the offset used for the 2nd vector 4 ( 0.00%) let second_probe_offset = if needle.len() == 2 { . // never bail out on len=2 needles because the probes will fully cover them and have . // no degenerate cases. . 1 . } else { . // try a few bytes in case first and last byte of the needle are the same . let Some(second_probe_offset) = 6 ( 0.00%) (needle.len().saturating_sub(4)..needle.len()).rfind(|&idx| needle[idx] != first_probe) . else { . // fall back to other search methods if we can't find any different bytes . // since we could otherwise hit some degenerate cases . return None; . }; . second_probe_offset . }; . . // do a naive search if the haystack is too small to fit 6 ( 0.00%) if haystack.len() < Block::LEN + last_byte_offset { . return Some(haystack.windows(needle.len()).any(|c| c == needle)); . } . . let first_probe: Block = Block::splat(first_probe); . let second_probe: Block = Block::splat(needle[second_probe_offset]); . // first byte are already checked by the outer loop. to verify a match only the . // remainder has to be compared. . let trimmed_needle = &needle[1..]; . . // this #[cold] is load-bearing, benchmark before removing it... . let check_mask = #[cold] 10 ( 0.00%) |idx, mask: u16, skip: bool| -> bool { 2 ( 0.00%) if skip { . return false; . } . . // and so is this. optimizations are weird. . let mut mask = mask; . . while mask != 0 { . let trailing = mask.trailing_zeros(); -- line 1868 ---------------------------------------- -- line 1873 ---------------------------------------- . let sub = haystack.get_unchecked(offset..).get_unchecked(..trimmed_needle.len()); . if small_slice_eq(sub, trimmed_needle) { . return true; . } . } . mask &= !(1 << trailing); . } . false 1 ( 0.00%) }; . . let test_chunk = |idx| -> u16 { . // SAFETY: this requires at least LANES bytes being readable at idx . // that is ensured by the loop ranges (see comments below) . let a: Block = unsafe { haystack.as_ptr().add(idx).cast::().read_unaligned() }; . // SAFETY: this requires LANES + block_offset bytes being readable at idx . let b: Block = unsafe { . haystack.as_ptr().add(idx).add(second_probe_offset).cast::().read_unaligned() -- line 1889 ---------------------------------------- -- line 1896 ---------------------------------------- . mask . }; . . let mut i = 0; . let mut result = false; . // The loop condition must ensure that there's enough headroom to read LANE bytes, . // and not only at the current index but also at the index shifted by block_offset . const UNROLL: usize = 4; 47 ( 0.00%) while i + last_byte_offset + UNROLL * Block::LEN < haystack.len() && !result { . let mut masks = [0u16; UNROLL]; . for j in 0..UNROLL { 7 ( 0.00%) masks[j] = test_chunk(i + j * Block::LEN); . } . for j in 0..UNROLL { . let mask = masks[j]; 65 ( 0.00%) if mask != 0 { 10 ( 0.00%) result |= check_mask(i + j * Block::LEN, mask, result); 29 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/pattern.rs:core::str::pattern::simd_contains::{closure#2} (1x) . } . } 7 ( 0.00%) i += UNROLL * Block::LEN; . } 15 ( 0.00%) while i + last_byte_offset + Block::LEN < haystack.len() && !result { . let mask = test_chunk(i); 5 ( 0.00%) if mask != 0 { . result |= check_mask(i, mask, result); . } . i += Block::LEN; . } . . // Process the tail that didn't fit into LANES-sized steps. . // This simply repeats the same procedure but as right-aligned chunk instead . // of a left-aligned one. The last byte must be exactly flush with the string end so . // we don't miss a single byte or read out of bounds. 2 ( 0.00%) let i = haystack.len() - last_byte_offset - Block::LEN; . let mask = test_chunk(i); 4 ( 0.00%) if mask != 0 { . result |= check_mask(i, mask, result); . } . . Some(result) . } . . /// Compares short slices for equality. . /// -- line 1939 ---------------------------------------- -- line 1955 ---------------------------------------- . // https://github.com/BurntSushi/memchr/blob/8037d11b4357b0f07be2bb66dc2659d9cf28ad32/src/memmem/util.rs#L32 . . // If we don't have enough bytes to do 4-byte at a time loads, then . // fall back to the naive slow version. . // . // Potential alternative: We could do a copy_nonoverlapping combined with a mask instead . // of a loop. Benchmark it. . if x.len() < 4 { 3 ( 0.00%) for (&b1, &b2) in x.iter().zip(y) { 7 ( 0.00%) if b1 != b2 { . return false; . } . } . return true; . } . // When we have 4 or more bytes to compare, then proceed in chunks of 4 at . // a time using unaligned loads. . // -- line 1972 ---------------------------------------- 414,434 ( 0.02%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/await_holding_invalid.rs -------------------------------------------------------------------------------- Ir -- line 178 ---------------------------------------- . AWAIT_HOLDING_REFCELL_REF, . ]); . . pub struct AwaitHolding { . def_ids: DefIdMap<(&'static str, &'static DisallowedPathWithoutReplacement)>, . } . . impl AwaitHolding { 8 ( 0.00%) pub(crate) fn new(tcx: TyCtxt<'_>, conf: &'static Conf) -> Self { . let (def_ids, _) = create_disallowed_map( . tcx, . &conf.await_holding_invalid_types, . PathNS::Type, . crate::disallowed_types::def_kind_predicate, . "type", . false, . ); . Self { def_ids } 8 ( 0.00%) } . } . . impl<'tcx> LateLintPass<'tcx> for AwaitHolding { 549,936 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>) { 137,508 ( 0.01%) if let hir::ExprKind::Closure(hir::Closure { . kind: hir::ClosureKind::Coroutine(hir::CoroutineKind::Desugared(hir::CoroutineDesugaring::Async, _)), . def_id, . .. 12 ( 0.00%) }) = expr.kind . && let Some(coroutine_layout) = cx.tcx.mir_coroutine_witnesses(*def_id) . { . self.check_interior_types(cx, coroutine_layout); . } 549,936 ( 0.03%) } . } . . impl AwaitHolding { . fn check_interior_types(&self, cx: &LateContext<'_>, coroutine: &CoroutineLayout<'_>) { . for (ty_index, ty_cause) in coroutine.field_tys.iter_enumerated() { . if let rustc_middle::ty::Adt(adt, _) = ty_cause.ty.kind() { . let await_points = || { . coroutine -- line 218 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/write/mod.rs -------------------------------------------------------------------------------- Ir -- line 251 ---------------------------------------- . format_args: FormatArgsStorage, . // The outermost `impl Debug` we're currently in. While we're in one, `USE_DEBUG` is deactivated . outermost_debug_impl: Option, . allow_print_in_tests: bool, . } . . impl Write { . pub fn new(conf: &'static Conf, format_args: FormatArgsStorage) -> Self { 3 ( 0.00%) Self { . format_args, . outermost_debug_impl: None, . allow_print_in_tests: conf.allow_print_in_tests, . } . } . . fn in_debug_impl(&self) -> bool { . self.outermost_debug_impl.is_some() . } . } . . impl<'tcx> LateLintPass<'tcx> for Write { . fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) { . // Only check for `impl Debug`s if we're not already in one 498 ( 0.00%) if self.outermost_debug_impl.is_none() && is_debug_impl(cx, item) { 4 ( 0.00%) self.outermost_debug_impl = Some(item.owner_id); . } . } . . fn check_item_post(&mut self, _cx: &LateContext<'_>, item: &Item<'_>) { . // Only clear `self.outermost_debug_impl` if we're escaping the _outermost_ debug impl . if self.outermost_debug_impl == Some(item.owner_id) { 2 ( 0.00%) self.outermost_debug_impl = None; . } . } . 687,420 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . let Some(macro_call) = root_macro_call_first_node(cx, expr) else { . return; . }; . let Some(diag_name) = cx.tcx.get_diagnostic_name(macro_call.def_id) else { . return; . }; . let Some(name) = diag_name.as_str().strip_suffix("_macro") else { . return; -- line 294 ---------------------------------------- -- line 332 ---------------------------------------- . } . . literal::check(cx, format_args, name); . . if !self.in_debug_impl() { . use_debug::check(cx, format_args); . } . } 549,936 ( 0.03%) } . } . . fn is_debug_impl(cx: &LateContext<'_>, item: &Item<'_>) -> bool { 1,278 ( 0.00%) if let ItemKind::Impl(Impl { . of_trait: Some(of_trait), . .. . }) = &item.kind 72 ( 0.00%) && let Some(trait_id) = of_trait.trait_ref.trait_def_id() 312 ( 0.00%) => ???:::trait_def_id (24x) . { 96 ( 0.00%) cx.tcx.is_diagnostic_item(sym::Debug, trait_id) 2,028 ( 0.00%) => ???:::is_diagnostic_item (24x) . } else { . false . } . } 24 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_utils/src/higher.rs -------------------------------------------------------------------------------- Ir -- line 29 ---------------------------------------- . /// entire `for` loop span . pub span: Span, . /// label . pub label: Option, . } . . impl<'tcx> ForLoop<'tcx> { . /// Parses a desugared `for` loop 412,458 ( 0.02%) pub fn hir(expr: &Expr<'tcx>) -> Option { 137,494 ( 0.01%) if let ExprKind::DropTemps(e) = expr.kind 56 ( 0.00%) && let ExprKind::Match(iterexpr, [arm], MatchSource::ForLoopDesugar) = e.kind 32 ( 0.00%) && let ExprKind::Call(_, [arg]) = iterexpr.kind 64 ( 0.00%) && let ExprKind::Loop(block, label, ..) = arm.body.kind 24 ( 0.00%) && let [stmt] = block.stmts 24 ( 0.00%) && let hir::StmtKind::Expr(e) = stmt.kind 40 ( 0.00%) && let ExprKind::Match(_, [_, some_arm], _) = e.kind 48 ( 0.00%) && let hir::PatKind::Struct(_, [field], _) = some_arm.pat.kind . { 88 ( 0.00%) return Some(Self { 8 ( 0.00%) pat: field.pat, . arg, 8 ( 0.00%) body: some_arm.body, 16 ( 0.00%) loop_id: arm.body.hir_id, 16 ( 0.00%) span: expr.span.ctxt().outer_expn_data().call_site, . label, . }); . } 68,735 ( 0.00%) None 412,458 ( 0.02%) } . } . . /// An `if` expression without `let` . pub struct If<'hir> { . /// `if` condition . pub cond: &'hir Expr<'hir>, . /// `if` then expression . pub then: &'hir Expr<'hir>, -- line 65 ---------------------------------------- -- line 66 ---------------------------------------- . /// `else` expression . pub r#else: Option<&'hir Expr<'hir>>, . } . . impl<'hir> If<'hir> { . #[inline] . /// Parses an `if` expression without `let` . pub const fn hir(expr: &Expr<'hir>) -> Option { 1,030,301 ( 0.05%) if let ExprKind::If(cond, then, r#else) = expr.kind 1,496 ( 0.00%) && !has_let_expr(cond) 1,146 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/higher.rs:clippy_utils::higher::has_let_expr (28x) . { . Some(Self { cond, then, r#else }) . } else { . None . } . } . } . -- line 83 ---------------------------------------- -- line 93 ---------------------------------------- . pub if_else: Option<&'hir Expr<'hir>>, . /// `if let PAT = EXPR` . /// ^^^^^^^^^^^^^^ . pub let_span: Span, . } . . impl<'hir> IfLet<'hir> { . /// Parses an `if let` expression 207,762 ( 0.01%) pub fn hir(cx: &LateContext<'_>, expr: &Expr<'hir>) -> Option { 415,758 ( 0.02%) if let ExprKind::If( . &Expr { . kind: . ExprKind::Let(&hir::LetExpr { 24 ( 0.00%) pat: let_pat, . init: let_expr, 12 ( 0.00%) span: let_span, . .. . }), . .. . }, 12 ( 0.00%) if_then, 12 ( 0.00%) if_else, 117 ( 0.00%) ) = expr.kind . { 24 ( 0.00%) let mut iter = cx.tcx.hir_parent_iter(expr.hir_id); 24 ( 0.00%) if let Some((_, Node::Block(Block { stmts: [], .. }))) = iter.next() . && let Some(( . _, . Node::Expr(Expr { . kind: ExprKind::Loop(_, _, LoopSource::While, _), . .. . }), . )) = iter.next() . { . // while loop desugar . return None; . } 48 ( 0.00%) return Some(Self { . let_pat, . let_expr, . if_then, . if_else, . let_span, . }); . } 207,750 ( 0.01%) None 207,762 ( 0.01%) } . } . . /// An `if let` or `match` expression. Useful for lints that trigger on one or the other. . #[derive(Debug)] . pub enum IfLetOrMatch<'hir> { . /// Any `match` expression . Match(&'hir Expr<'hir>, &'hir [Arm<'hir>], MatchSource), . /// scrutinee, pattern, then block, else block -- line 147 ---------------------------------------- -- line 153 ---------------------------------------- . /// `if let PAT = EXPR` . /// ^^^^^^^^^^^^^^ . Span, . ), . } . . impl<'hir> IfLetOrMatch<'hir> { . /// Parses an `if let` or `match` expression 4,503 ( 0.00%) pub fn parse(cx: &LateContext<'_>, expr: &Expr<'hir>) -> Option { 3,002 ( 0.00%) match expr.kind { 24 ( 0.00%) ExprKind::Match(expr, arms, source) => Some(Self::Match(expr, arms, source)), 1,498 ( 0.00%) _ => IfLet::hir(cx, expr).map( 7,493 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (1,498x) . |IfLet { . let_expr, . let_pat, . if_then, . if_else, . let_span, . }| { Self::IfLet(let_expr, let_pat, if_then, if_else, let_span) }, . ), . } 6,004 ( 0.00%) } . . pub fn scrutinee(&self) -> &'hir Expr<'hir> { . match self { . Self::Match(scrutinee, _, _) | Self::IfLet(scrutinee, _, _, _, _) => scrutinee, . } . } . } . -- line 182 ---------------------------------------- -- line 189 ---------------------------------------- . /// `else` expression . pub r#else: Option<&'hir Expr<'hir>>, . } . . impl<'hir> IfOrIfLet<'hir> { . #[inline] . /// Parses an `if` or `if let` expression . pub const fn hir(expr: &Expr<'hir>) -> Option { 167 ( 0.00%) if let ExprKind::If(cond, then, r#else) = expr.kind { . Some(Self { cond, then, r#else }) . } else { . None . } . } . } . . /// Represent a range akin to `ast::ExprKind::Range`. -- line 205 ---------------------------------------- -- line 211 ---------------------------------------- . pub start: Option<&'a Expr<'a>>, . /// The upper bound of the range, or `None` for ranges such as `X..`. . pub end: Option<&'a Expr<'a>>, . pub span: Span, . } . . impl<'a> Range<'a> { . /// Higher a `hir` range to something similar to `ast::ExprKind::Range`. 1,375,400 ( 0.06%) pub fn hir(cx: &LateContext<'_>, expr: &'a Expr<'_>) -> Option> { 275,080 ( 0.01%) let span = expr.range_span()?; 3,039,600 ( 0.14%) => ???:::range_span (137,540x) 238 ( 0.00%) let (ty, start, end) = match expr.kind { . ExprKind::Call(path, [arg1, arg2]) . if let ExprKind::Path(qpath) = path.kind . && cx.tcx.qpath_is_lang_item(qpath, hir::LangItem::RangeInclusiveNew) => . { . (RangeTy::OpsInclusive, Some(arg1), Some(arg2)) . }, 340 ( 0.00%) ExprKind::Struct(&qpath, fields, StructTailExpr::None) => match (cx.tcx.qpath_lang_item(qpath)?, fields) { 3,808 ( 0.00%) => ???:::qpath_lang_item (34x) . (hir::LangItem::RangeFull, []) => (RangeTy::OpsFull, None, None), 36 ( 0.00%) (hir::LangItem::RangeFrom, [start]) if start.ident.name == sym::start => { 12 ( 0.00%) (RangeTy::OpsFrom, Some(start.expr), None) . }, . (hir::LangItem::RangeFromCopy, [start]) if start.ident.name == sym::start => { . (RangeTy::RangeFrom, Some(start.expr), None) . }, 39 ( 0.00%) (hir::LangItem::Range, [start, end] | [end, start]) 26 ( 0.00%) if start.ident.name == sym::start && end.ident.name == sym::end => . { 26 ( 0.00%) (RangeTy::OpsRange, Some(start.expr), Some(end.expr)) 13 ( 0.00%) }, . (hir::LangItem::RangeCopy, [start, end] | [end, start]) . if start.ident.name == sym::start && end.ident.name == sym::end => . { . (RangeTy::RangeRange, Some(start.expr), Some(end.expr)) . }, . (hir::LangItem::RangeInclusiveCopy, [start, last] | [last, start]) . if start.ident.name == sym::start && last.ident.name == sym::last => . { . (RangeTy::RangeInclusive, Some(start.expr), Some(last.expr)) . }, . (hir::LangItem::RangeToInclusive, [end]) if end.ident.name == sym::end => { . (RangeTy::OpsToInclusive, None, Some(end.expr)) . }, . (hir::LangItem::RangeToInclusiveCopy, [last]) if last.ident.name == sym::last => { . (RangeTy::RangeToInclusive, None, Some(last.expr)) 9 ( 0.00%) }, 54 ( 0.00%) (hir::LangItem::RangeTo, [end]) if end.ident.name == sym::end => (RangeTy::OpsTo, None, Some(end.expr)), . _ => return None, . }, . _ => return None, . }; . 136 ( 0.00%) Some(Range { ty, start, end, span }) 1,100,354 ( 0.05%) } . } . . /// A type that can appear as the type of a range expression. . /// . /// This is a component of [`Range`]. . #[derive(Debug, Copy, Clone, Eq, PartialEq)] . pub enum RangeTy { . /// [`core::ops::RangeFrom`] -- line 272 ---------------------------------------- -- line 361 ---------------------------------------- . Repeat(&'a Expr<'a>, &'a Expr<'a>), . /// `vec![a, b, c]` . Vec(&'a [Expr<'a>]), . } . . impl<'a> VecArgs<'a> { . /// Returns the arguments of the `vec!` macro if this expression was expanded . /// from `vec!`. 1,443,582 ( 0.07%) pub fn hir(cx: &LateContext<'_>, expr: &'a Expr<'_>) -> Option> { 413,049 ( 0.02%) if let ExprKind::Call(fun, args) = expr.kind 1,194 ( 0.00%) && let ExprKind::Path(ref qpath) = fun.kind 3,582 ( 0.00%) && is_expn_of(fun.span, sym::vec).is_some() 35,937 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_expn_of (597x) . && let Some(fun_def_id) = cx.qpath_res(qpath, fun.hir_id).opt_def_id() . && let Some(name) = cx.tcx.get_diagnostic_name(fun_def_id) . { . return match (name, args) { . (sym::vec_from_elem, [elem, size]) => { . // `vec![elem; size]` case . Some(VecArgs::Repeat(elem, size)) . }, -- line 380 ---------------------------------------- -- line 381 ---------------------------------------- . (sym::box_assume_init_into_vec_unsafe, [write_box_via_move]) . if let ExprKind::Call(_, [_box, elems]) = write_box_via_move.kind . && let ExprKind::Array(elems) = elems.kind => . { . // `vec![a, b, c]` case . Some(VecArgs::Vec(elems)) . }, . (sym::vec_new, []) => Some(VecArgs::Vec(&[])), 597 ( 0.00%) _ => None, . }; . } . 597 ( 0.00%) None 1,443,582 ( 0.07%) } . } . . /// A desugared `while` loop . pub struct While<'hir> { . /// `while` loop condition . pub condition: &'hir Expr<'hir>, . /// `while` loop body . pub body: &'hir Expr<'hir>, -- line 402 ---------------------------------------- -- line 404 ---------------------------------------- . pub span: Span, . pub label: Option, . } . . impl<'hir> While<'hir> { . #[inline] . /// Parses a desugared `while` loop . pub const fn hir(expr: &Expr<'hir>) -> Option { 11 ( 0.00%) if let ExprKind::Loop( . Block { . expr: . Some(Expr { . kind: ExprKind::If(condition, body, _), . .. . }), . .. . }, . label, . LoopSource::While, 1 ( 0.00%) span, 6 ( 0.00%) ) = expr.kind 4 ( 0.00%) && !has_let_expr(condition) 44 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/higher.rs:clippy_utils::higher::has_let_expr (1x) . { . return Some(Self { . condition, . body, . span, . label, . }); . } -- line 433 ---------------------------------------- -- line 448 ---------------------------------------- . /// ^^^^^^^^^^^^^^ . pub let_span: Span, . } . . impl<'hir> WhileLet<'hir> { . #[inline] . /// Parses a desugared `while let` loop . pub const fn hir(expr: &Expr<'hir>) -> Option { 411,676 ( 0.02%) if let ExprKind::Loop( . &Block { . expr: . Some(&Expr { . kind: . ExprKind::If( . &Expr { . kind: . ExprKind::Let(&hir::LetExpr { -- line 464 ---------------------------------------- -- line 474 ---------------------------------------- . ), . .. . }), . .. . }, . label, . LoopSource::While, . _, 94 ( 0.00%) ) = expr.kind . { . return Some(Self { . let_pat, . let_expr, . if_then, . label, . let_span, . }); -- line 490 ---------------------------------------- -- line 575 ---------------------------------------- . Default, . /// `Vec::with_capacity(123)` . WithConstCapacity(u128), . /// `Vec::with_capacity(slice.len())` . WithExprCapacity(HirId), . } . . /// Checks if the given expression is an initialization of `Vec` and returns its kind. 364 ( 0.00%) pub fn get_vec_init_kind<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) -> Option { 122 ( 0.00%) if let ExprKind::Call(func, args) = expr.kind { 90 ( 0.00%) match func.kind { . ExprKind::Path(QPath::TypeRelative(ty, name)) 24 ( 0.00%) if cx.typeck_results().node_type(ty.hir_id).is_diag_item(cx, sym::Vec) => 123 ( 0.00%) => ???:::node_type (3x) . { . if name.ident.name == sym::new { . return Some(VecInitKind::New); . } else if name.ident.name == symbol::kw::Default { . return Some(VecInitKind::Default); . } else if name.ident.name == sym::with_capacity { . let arg = args.first()?; . return match ConstEvalCtxt::new(cx).eval_local(arg, expr.span.ctxt()) { . Some(Constant::Int(num)) => Some(VecInitKind::WithConstCapacity(num)), . _ => Some(VecInitKind::WithExprCapacity(arg.hir_id)), . }; . } . }, . ExprKind::Path(QPath::Resolved(_, path)) 195 ( 0.00%) if cx.tcx.is_diagnostic_item(sym::default_fn, path.res.opt_def_id()?) 982 ( 0.00%) => ???:::is_diagnostic_item (15x) . && cx.typeck_results().expr_ty(expr).is_diag_item(cx, sym::Vec) => . { . return Some(VecInitKind::Default); . }, . _ => (), . } . } . None 468 ( 0.00%) } . . /// Checks that a condition doesn't have a `let` expression, to keep `If` and `While` from accepting . /// `if let` and `while let`. 3,025 ( 0.00%) pub const fn has_let_expr<'tcx>(cond: &'tcx Expr<'tcx>) -> bool { 4,762 ( 0.00%) match &cond.kind { . ExprKind::Let(_) => true, 1,415 ( 0.00%) ExprKind::Binary(_, lhs, rhs) => has_let_expr(lhs) || has_let_expr(rhs), 5,261 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/higher.rs:clippy_utils::higher::has_let_expr'2 (238x) . _ => false, . } 3,025 ( 0.00%) } 417,194 ( 0.02%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_retain.rs -------------------------------------------------------------------------------- Ir -- line 52 ---------------------------------------- . . impl ManualRetain { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl<'tcx> LateLintPass<'tcx> for ManualRetain { 343,710 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) { 137,484 ( 0.01%) if let Assign(left_expr, collect_expr, _) = &expr.kind 90 ( 0.00%) && let hir::ExprKind::MethodCall(seg, target_expr, [], _) = &collect_expr.kind 6 ( 0.00%) && seg.args.is_none() 15 ( 0.00%) && let Some(collect_def_id) = cx.typeck_results().type_dependent_def_id(collect_expr.hir_id) 153 ( 0.00%) => ???:::type_dependent_def_id (3x) 18 ( 0.00%) && cx.tcx.is_diagnostic_item(sym::iterator_collect_fn, collect_def_id) 197 ( 0.00%) => ???:::is_diagnostic_item (3x) . { . check_into_iter(cx, left_expr, target_expr, expr.span, self.msrv); . check_iter(cx, left_expr, target_expr, expr.span, self.msrv); . check_to_owned(cx, left_expr, target_expr, expr.span, self.msrv); . } 412,452 ( 0.02%) } . } . . fn check_into_iter( . cx: &LateContext<'_>, . left_expr: &hir::Expr<'_>, . target_expr: &hir::Expr<'_>, . parent_expr_span: Span, . msrv: Msrv, -- line 79 ---------------------------------------- 6 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/default_instead_of_iter_empty.rs -------------------------------------------------------------------------------- Ir -- line 27 ---------------------------------------- . pub DEFAULT_INSTEAD_OF_ITER_EMPTY, . style, . "check `std::iter::Empty::default()` and replace with `std::iter::empty()`" . } . . declare_lint_pass!(DefaultIterEmpty => [DEFAULT_INSTEAD_OF_ITER_EMPTY]); . . impl<'tcx> LateLintPass<'tcx> for DefaultIterEmpty { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 137,882 ( 0.01%) if let ExprKind::Call(iter_expr, []) = &expr.kind 25 ( 0.00%) && let ExprKind::Path(QPath::TypeRelative(ty, _)) = &iter_expr.kind 15 ( 0.00%) && let TyKind::Path(ty_path) = &ty.kind 20 ( 0.00%) && let QPath::Resolved(None, path) = ty_path 15 ( 0.00%) && let def::Res::Def(_, def_id) = &path.res 50 ( 0.00%) && cx.tcx.is_diagnostic_item(sym::IterEmpty, *def_id) 220 ( 0.00%) => ???:::is_diagnostic_item (5x) . && let ctxt = expr.span.ctxt() . && ty.span.ctxt() == ctxt . { . let mut applicability = Applicability::MachineApplicable; . let Some(path) = std_or_core(cx) else { return }; . let path = format!("{path}::iter::empty"); . let sugg = make_sugg(cx, ty_path, ctxt, &mut applicability, &path); . span_lint_and_sugg( -- line 49 ---------------------------------------- -- line 51 ---------------------------------------- . DEFAULT_INSTEAD_OF_ITER_EMPTY, . expr.span, . format!("`{path}()` is the more idiomatic way"), . "try", . sugg, . applicability, . ); . } 549,936 ( 0.03%) } . } . . fn make_sugg( . cx: &LateContext<'_>, . ty_path: &QPath<'_>, . ctxt: SyntaxContext, . applicability: &mut Applicability, . path: &str, -- line 67 ---------------------------------------- 5 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/borrow_deref_ref.rs -------------------------------------------------------------------------------- Ir -- line 46 ---------------------------------------- . pub BORROW_DEREF_REF, . complexity, . "deref on an immutable reference returns the same type as itself" . } . . declare_lint_pass!(BorrowDerefRef => [BORROW_DEREF_REF]); . . impl<'tcx> LateLintPass<'tcx> for BorrowDerefRef { 412,452 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'tcx>) { 137,696 ( 0.01%) if let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, addrof_target) = e.kind 72 ( 0.00%) && let ExprKind::Unary(UnOp::Deref, deref_target) = addrof_target.kind . && !matches!(deref_target.kind, ExprKind::Unary(UnOp::Deref, ..)) . && !e.span.from_expansion() . && !deref_target.span.from_expansion() . && !addrof_target.span.from_expansion() . && let ref_ty = cx.typeck_results().expr_ty(deref_target) . && let ty::Ref(_, inner_ty, Mutability::Not) = ref_ty.kind() . && get_parent_expr(cx, e).is_none_or(|parent| { . match parent.kind { -- line 64 ---------------------------------------- -- line 119 ---------------------------------------- . e.span, . "if you would like to deref, try using `&**`", . format!("&**{deref_text}"), . Applicability::MaybeIncorrect, . ); . }, . ); . } 481,194 ( 0.02%) } . } . . /// Checks if `expr` is used as part of a `let` statement containing a `ref mut` binding. . fn potentially_bound_to_mutable_ref<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) -> bool { . matches!(cx.tcx.parent_hir_node(expr.hir_id), Node::LetStmt(let_stmt) . if let_stmt.pat.contains_explicit_ref_binding() == Some(Mutability::Mut)) . } 44 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_rem_euclid.rs -------------------------------------------------------------------------------- Ir -- line 43 ---------------------------------------- . . impl ManualRemEuclid { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl<'tcx> LateLintPass<'tcx> for ManualRemEuclid { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . // (x % c + c) % c 137,484 ( 0.01%) if let ExprKind::Binary(rem_op, rem_lhs, rem_rhs) = expr.kind 76 ( 0.00%) && rem_op.node == BinOpKind::Rem 8 ( 0.00%) && let ExprKind::Binary(add_op, add_lhs, add_rhs) = rem_lhs.kind 1 ( 0.00%) && add_op.node == BinOpKind::Add . && let ctxt = expr.span.ctxt() . && rem_lhs.span.ctxt() == ctxt . && rem_rhs.span.ctxt() == ctxt . && add_lhs.span.ctxt() == ctxt . && add_rhs.span.ctxt() == ctxt . && !expr.span.in_external_macro(cx.sess().source_map()) . && let Some(const1) = check_for_unsigned_int_constant(cx, ctxt, rem_rhs) . && let Some((const2, add_other)) = check_for_either_unsigned_int_constant(cx, ctxt, add_lhs, add_rhs) -- line 64 ---------------------------------------- -- line 93 ---------------------------------------- . MANUAL_REM_EUCLID, . expr.span, . "manual `rem_euclid` implementation", . "consider using", . format!("{rem_of}.rem_euclid({const1})"), . app, . ); . } 549,936 ( 0.03%) } . } . . // Checks if either the left or right expressions can be an unsigned int constant and returns that . // constant along with the other expression unchanged if so . fn check_for_either_unsigned_int_constant<'a>( . cx: &'a LateContext<'_>, . ctxt: SyntaxContext, . left: &'a Expr<'_>, -- line 109 ---------------------------------------- 4 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/from_raw_with_void_ptr.rs -------------------------------------------------------------------------------- Ir -- line 34 ---------------------------------------- . pub FROM_RAW_WITH_VOID_PTR, . suspicious, . "creating a `Box` from a void raw pointer" . } . . declare_lint_pass!(FromRawWithVoidPtr => [FROM_RAW_WITH_VOID_PTR]); . . impl LateLintPass<'_> for FromRawWithVoidPtr { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 138,048 ( 0.01%) if let ExprKind::Call(box_from_raw, [arg]) = expr.kind 682 ( 0.00%) && let ExprKind::Path(QPath::TypeRelative(ty, seg)) = box_from_raw.kind 18 ( 0.00%) && seg.ident.name == sym::from_raw . && let Some(type_str) = ty.basic_res().opt_def_id().and_then(|id| def_id_matches_type(cx, id)) . && let arg_kind = cx.typeck_results().expr_ty(arg).kind() . && let ty::RawPtr(ty, _) = arg_kind . && is_c_void(cx, *ty) . { . let msg = format!("creating a `{type_str}` from a void raw pointer"); . span_lint_and_help( . cx, . FROM_RAW_WITH_VOID_PTR, . expr.span, . msg, . Some(arg.span), . "cast this to a pointer of the appropriate type", . ); . } 549,936 ( 0.03%) } . } . . /// Checks whether a `DefId` matches `Box`, `Rc`, `Arc`, or one of the `Weak` types. . /// Returns a static string slice with the name of the type, if one was found. . fn def_id_matches_type(cx: &LateContext<'_>, def_id: DefId) -> Option<&'static str> { . // Box . if Some(def_id) == cx.tcx.lang_items().owned_box() { . return Some("Box"); -- line 69 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/uint_macros.rs -------------------------------------------------------------------------------- Ir -- line 146 ---------------------------------------- . /// ``` . #[doc = concat!("[`ilog2`]: ", stringify!($SelfT), "::ilog2")] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_math", since = "1.32.0")] . #[must_use = "this returns the result of the operation, \ . without modifying the original"] . #[inline(always)] . pub const fn leading_zeros(self) -> u32 { 512 ( 0.00%) return intrinsics::ctlz(self as $ActualT); . } . . /// Returns the number of trailing zeros in the binary representation . /// of `self`. . /// . /// # Examples . /// . /// ``` -- line 162 ---------------------------------------- -- line 170 ---------------------------------------- . #[doc = concat!("assert_eq!(max.trailing_zeros(), 0);")] . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_math", since = "1.32.0")] . #[must_use = "this returns the result of the operation, \ . without modifying the original"] . #[inline(always)] . pub const fn trailing_zeros(self) -> u32 { 336 ( 0.00%) return intrinsics::cttz(self); . } . . /// Returns the number of leading ones in the binary representation of `self`. . /// . /// # Examples . /// . /// ``` . #[doc = concat!("let n = !(", stringify!($SelfT), "::MAX >> 2);")] -- line 186 ---------------------------------------- -- line 890 ---------------------------------------- . pub const fn checked_add(self, rhs: Self) -> Option { . // This used to use `overflowing_add`, but that means it ends up being . // a `wrapping_add`, losing some optimization opportunities. Notably, . // phrasing it this way helps `.checked_add(1)` optimize to a check . // against `MAX` and a `add nuw`. . // Per , . // LLVM is happy to re-form the intrinsic later if useful. . 1,922 ( 0.00%) if intrinsics::unlikely(intrinsics::add_with_overflow(self, rhs).1) { . None . } else { . // SAFETY: Just checked it doesn't overflow . Some(unsafe { intrinsics::unchecked_add(self, rhs) }) . } . } . . /// Strict integer addition. Computes `self + rhs`, panicking -- line 906 ---------------------------------------- -- line 965 ---------------------------------------- . ( . lhs: $SelfT = self, . rhs: $SelfT = rhs, . ) => !lhs.overflowing_add(rhs).1, . ); . . // SAFETY: this is guaranteed to be safe by the caller. . unsafe { 964 ( 0.00%) intrinsics::unchecked_add(self, rhs) . } . } . . /// Checked addition with a signed integer. Computes `self + rhs`, . /// returning `None` if overflow occurred. . /// . /// # Examples . /// -- line 981 ---------------------------------------- -- line 1044 ---------------------------------------- . without modifying the original"] . #[inline] . pub const fn checked_sub(self, rhs: Self) -> Option { . // Per PR#103299, there's no advantage to the `overflowing` intrinsic . // for *unsigned* subtraction and we just emit the manual check anyway. . // Thus, rather than using `overflowing_sub` that produces a wrapping . // subtraction, check it ourself so we can use an unchecked one. . 509,447 ( 0.02%) if self < rhs { . None . } else { . // SAFETY: just checked this can't overflow 196,810 ( 0.01%) Some(unsafe { intrinsics::unchecked_sub(self, rhs) }) . } . } . . /// Strict integer subtraction. Computes `self - rhs`, panicking if . /// overflow occurred. . /// . /// # Panics . /// -- line 1064 ---------------------------------------- -- line 1353 ---------------------------------------- . ( . lhs: $SelfT = self, . rhs: $SelfT = rhs, . ) => !lhs.overflowing_mul(rhs).1, . ); . . // SAFETY: this is guaranteed to be safe by the caller. . unsafe { 45,150 ( 0.00%) intrinsics::unchecked_mul(self, rhs) . } . } . . /// Checked integer division. Computes `self / rhs`, returning `None` . /// if `rhs == 0`. . /// . /// # Examples . /// -- line 1369 ---------------------------------------- -- line 2448 ---------------------------------------- . #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MAX.saturating_add(127), ", stringify!($SelfT), "::MAX);")] . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[must_use = "this returns the result of the operation, \ . without modifying the original"] . #[rustc_const_stable(feature = "const_saturating_int_methods", since = "1.47.0")] . #[inline(always)] . pub const fn saturating_add(self, rhs: Self) -> Self { 160 ( 0.00%) intrinsics::saturating_add(self, rhs) . } . . /// Saturating addition with a signed integer. Computes `self + rhs`, . /// saturating at the numeric bounds instead of overflowing. . /// . /// # Examples . /// . /// ``` -- line 2464 ---------------------------------------- -- line 2492 ---------------------------------------- . #[doc = concat!("assert_eq!(13", stringify!($SelfT), ".saturating_sub(127), 0);")] . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[must_use = "this returns the result of the operation, \ . without modifying the original"] . #[rustc_const_stable(feature = "const_saturating_int_methods", since = "1.47.0")] . #[inline(always)] . pub const fn saturating_sub(self, rhs: Self) -> Self { 559 ( 0.00%) intrinsics::saturating_sub(self, rhs) . } . . /// Saturating integer subtraction. Computes `self` - `rhs`, saturating at . /// the numeric bounds instead of overflowing. . /// . /// # Examples . /// . /// ``` -- line 2508 ---------------------------------------- -- line 2604 ---------------------------------------- . #[doc = concat!("assert_eq!(200", stringify!($SelfT), ".wrapping_add(", stringify!($SelfT), "::MAX), 199);")] . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0")] . #[must_use = "this returns the result of the operation, \ . without modifying the original"] . #[inline(always)] . pub const fn wrapping_add(self, rhs: Self) -> Self { 52,646 ( 0.00%) intrinsics::wrapping_add(self, rhs) . } . . /// Wrapping (modular) addition with a signed integer. Computes . /// `self + rhs`, wrapping around at the boundary of the type. . /// . /// # Examples . /// . /// ``` -- line 2620 ---------------------------------------- -- line 2641 ---------------------------------------- . #[doc = concat!("assert_eq!(100", stringify!($SelfT), ".wrapping_sub(", stringify!($SelfT), "::MAX), 101);")] . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0")] . #[must_use = "this returns the result of the operation, \ . without modifying the original"] . #[inline(always)] . pub const fn wrapping_sub(self, rhs: Self) -> Self { 2,113 ( 0.00%) intrinsics::wrapping_sub(self, rhs) . } . . /// Wrapping (modular) subtraction with a signed integer. Computes . /// `self - rhs`, wrapping around at the boundary of the type. . /// . /// # Examples . /// . /// ``` -- line 2657 ---------------------------------------- -- line 2680 ---------------------------------------- . /// assert_eq!(25u8.wrapping_mul(12), 44); . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0")] . #[must_use = "this returns the result of the operation, \ . without modifying the original"] . #[inline(always)] . pub const fn wrapping_mul(self, rhs: Self) -> Self { 9,830 ( 0.00%) intrinsics::wrapping_mul(self, rhs) . } . . /// Wrapping (modular) division. Computes `self / rhs`. . /// . /// Wrapped division on unsigned types is just normal division. There's . /// no way wrapping could ever happen. This function exists so that all . /// operations are accounted for in the wrapping operations. . /// -- line 2696 ---------------------------------------- -- line 3164 ---------------------------------------- . /// assert_eq!(1_000_000_000u32.overflowing_mul(10), (1410065408, true)); . /// ``` . #[stable(feature = "wrapping", since = "1.7.0")] . #[rustc_const_stable(feature = "const_wrapping_math", since = "1.32.0")] . #[must_use = "this returns the result of the operation, \ . without modifying the original"] . #[inline(always)] . pub const fn overflowing_mul(self, rhs: Self) -> (Self, bool) { 25,684 ( 0.00%) let (a, b) = intrinsics::mul_with_overflow(self as $ActualT, rhs as $ActualT); . (a as Self, b) . } . . /// Calculates the "full multiplication" `self * rhs + carry` . /// without the possibility to overflow. . /// . /// This returns the low-order (wrapping) bits and the high-order (overflow) bits . /// of the result as two separate values, in that order. -- line 3180 ---------------------------------------- -- line 3844 ---------------------------------------- . #[doc = concat!("assert!(16", stringify!($SelfT), ".is_power_of_two());")] . #[doc = concat!("assert!(!10", stringify!($SelfT), ".is_power_of_two());")] . /// ``` . #[must_use] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_is_power_of_two", since = "1.32.0")] . #[inline(always)] . pub const fn is_power_of_two(self) -> bool { 5 ( 0.00%) self.count_ones() == 1 . } . . // Returns one less than next power of two. . // (For 8u8 next power of two is 8u8 and for 6u8 it is 8u8) . // . // 8u8.one_less_than_next_power_of_two() == 7 . // 6u8.one_less_than_next_power_of_two() == 7 . // . // This method cannot overflow, as in the `next_power_of_two` . // overflow cases it instead ends up returning the maximum value . // of the type, and can return 0 for 0. . #[inline] . const fn one_less_than_next_power_of_two(self) -> Self { . if self <= 1 { return 0; } . 12 ( 0.00%) let p = self - 1; . // SAFETY: Because `p > 0`, it cannot consist entirely of leading zeros. . // That means the shift is always in-bounds, and some processors . // (such as intel pre-haswell) have more efficient ctlz . // intrinsics when the argument is non-zero. 6 ( 0.00%) let z = unsafe { intrinsics::ctlz_nonzero(p) }; 12 ( 0.00%) <$SelfT>::MAX >> z . } . . /// Returns the smallest power of two greater than or equal to `self`. . /// . /// When return value overflows (i.e., `self > (1 << (N-1))` for type . /// `uN`), it panics in debug mode and the return value is wrapped to 0 in . /// release mode (the only situation in which this method can return 0). . /// -- line 3882 ---------------------------------------- -- line 3889 ---------------------------------------- . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_int_pow", since = "1.50.0")] . #[must_use = "this returns the result of the operation, \ . without modifying the original"] . #[inline] . #[rustc_inherit_overflow_checks] . pub const fn next_power_of_two(self) -> Self { 2 ( 0.00%) self.one_less_than_next_power_of_two() + 1 . } . . /// Returns the smallest power of two greater than or equal to `self`. If . /// the next power of two is greater than the type's maximum value, . /// `None` is returned, otherwise the power of two is wrapped in `Some`. . /// . /// # Examples . /// -- line 3905 ---------------------------------------- -- line 4010 ---------------------------------------- . without modifying the original"] . #[allow(unnecessary_transmutes)] . // SAFETY: const sound because integers are plain old datatypes so we can always . // transmute them to arrays of bytes . #[inline] . pub const fn to_ne_bytes(self) -> [u8; size_of::()] { . // SAFETY: integers are plain old datatypes so we can always transmute them to . // arrays of bytes 32 ( 0.00%) unsafe { mem::transmute(self) } . } . . /// Creates a native endian integer value from its representation . /// as a byte array in big endian. . /// . #[doc = $from_xe_bytes_doc] . /// . /// # Examples -- line 4026 ---------------------------------------- 524,711 ( 0.02%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs -------------------------------------------------------------------------------- Ir -- line 565 ---------------------------------------- . ub_checks::maybe_is_aligned_and_not_null(src, align, zero_size) . && ub_checks::maybe_is_aligned_and_not_null(dst, align, zero_size) . && ub_checks::maybe_is_nonoverlapping(src, dst, size, count) . } . ); . . // SAFETY: the safety contract for `copy_nonoverlapping` must be . // upheld by the caller. 24,672 ( 0.00%) unsafe { crate::intrinsics::copy_nonoverlapping(src, dst, count) } 2,044 ( 0.00%) => ???:0x0000000000173dc0 (132x) . } . . /// Copies `count * size_of::()` bytes from `src` to `dst`. The source . /// and destination may overlap. . /// . /// If the source and destination will *never* overlap, . /// [`copy_nonoverlapping`] can be used instead. . /// -- line 581 ---------------------------------------- -- line 656 ---------------------------------------- . src: *const () = src as *const (), . dst: *mut () = dst as *mut (), . align: usize = align_of::(), . zero_size: bool = T::IS_ZST || count == 0, . ) => . ub_checks::maybe_is_aligned_and_not_null(src, align, zero_size) . && ub_checks::maybe_is_aligned_and_not_null(dst, align, zero_size) . ); 111 ( 0.00%) crate::intrinsics::copy(src, dst, count) 111 ( 0.00%) => ???:0x0000000000173dc0 (2x) . } . } . . /// Sets `count * size_of::()` bytes of memory starting at `dst` to . /// `val`. . /// . /// `write_bytes` is similar to C's [`memset`], but sets `count * . /// size_of::()` bytes to `val`. -- line 672 ---------------------------------------- -- line 727 ---------------------------------------- . check_language_ub, . "ptr::write_bytes requires that the destination pointer is aligned and non-null", . ( . addr: *const () = dst as *const (), . align: usize = align_of::(), . zero_size: bool = T::IS_ZST || count == 0, . ) => ub_checks::maybe_is_aligned_and_not_null(addr, align, zero_size) . ); 1,191 ( 0.00%) crate::intrinsics::write_bytes(dst, val, count) 123 ( 0.00%) => ???:0x00000000001747c0 (11x) . } . } . . /// Executes the destructor (if any) of the pointed-to value. . /// . /// This is almost the same as calling [`ptr::read`] and discarding . /// the result, but has the following advantages: . // FIXME: say something more useful than "almost the same"? -- line 743 ---------------------------------------- -- line 834 ---------------------------------------- . // Due to historic reasons, `drop_in_place` takes a pointer rather than a reference, . // which results in worse codegen since we don't apply noalias/dereferenceable llvm . // attributes to pointer arguments. To workaround this without breaking public . // interface, `drop_in_place` calls the lang item, rather than being one directly. . . // SAFETY: . // - compiler glue has the same safety requirements as this function . // - the pointer must be valid as per the safety requirement of this function 21 ( 0.00%) unsafe { drop_glue(&mut *to_drop) } 389 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:core::ptr::drop_glue::<[serde_spanned::spanned::Spanned]> (1x) . } . . /// Helper function for `drop_in_place`. The compiler replaces this by the actual drop glue. . #[lang = "drop_glue"] 180,831 ( 0.01%) pub(crate) const unsafe fn drop_glue(_: &mut T) 200 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:core::ptr::drop_glue:: (8x) . where . T: [const] Destruct, . { . // Code here does not matter - this is replaced by the . // real drop glue by the compiler. . } . . /// Creates a null raw pointer. -- line 855 ---------------------------------------- -- line 1464 ---------------------------------------- . i += 1; . } . } . . // Don't let MIR inline this, because we really want it to keep its noalias metadata . #[rustc_no_mir_inline] . #[inline] . fn swap_chunk(x: &mut MaybeUninit<[u8; N]>, y: &mut MaybeUninit<[u8; N]>) { 474 ( 0.00%) let a = *x; . let b = *y; 1,297 ( 0.00%) *x = b; . *y = a; . } . . #[inline] . unsafe fn swap_nonoverlapping_bytes(x: *mut u8, y: *mut u8, bytes: NonZero) { . // Same as `swap_nonoverlapping::<[u8; N]>`. . unsafe fn swap_nonoverlapping_chunks( . x: *mut MaybeUninit<[u8; N]>, -- line 1482 ---------------------------------------- -- line 1747 ---------------------------------------- . check_language_ub, . "ptr::read requires that the pointer argument is aligned and non-null", . ( . addr: *const () = src as *const (), . align: usize = align_of::(), . is_zst: bool = T::IS_ZST, . ) => ub_checks::maybe_is_aligned_and_not_null(addr, align, is_zst) . ); 4,500 ( 0.00%) crate::intrinsics::read_via_copy(src) . } . } . . /// Reads the value from `src` without moving it. This leaves the . /// memory in `src` unchanged. . /// . /// Unlike [`read`], `read_unaligned` works with unaligned pointers. . /// -- line 1763 ---------------------------------------- -- line 1955 ---------------------------------------- . check_language_ub, . "ptr::write requires that the pointer argument is aligned and non-null", . ( . addr: *mut () = dst as *mut (), . align: usize = align_of::(), . is_zst: bool = T::IS_ZST, . ) => ub_checks::maybe_is_aligned_and_not_null(addr, align, is_zst) . ); 63,525 ( 0.00%) intrinsics::write_via_move(dst, src) 990 ( 0.00%) => ???:0x0000000000173dc0 (33x) . } . } . . /// Overwrites a memory location with the given value without reading or . /// dropping the old value. . /// . /// Unlike [`write()`], the pointer may be unaligned. . /// -- line 1971 ---------------------------------------- -- line 2500 ---------------------------------------- . /// assert!(!std::ptr::eq(&a[0..2], &a[1..3])); . /// ``` . #[stable(feature = "ptr_eq", since = "1.17.0")] . #[inline(always)] . #[must_use = "pointer comparison produces a value"] . #[rustc_diagnostic_item = "ptr_eq"] . #[allow(ambiguous_wide_pointer_comparisons)] // it's actually clear here . pub fn eq(a: *const T, b: *const T) -> bool { 899 ( 0.00%) a == b . } . . /// Compares the *addresses* of the two pointers for equality, . /// ignoring any metadata in fat pointers. . /// . /// If the arguments are thin pointers of the same type, . /// then this is the same as [`eq`]. . /// -- line 2516 ---------------------------------------- -- line 2524 ---------------------------------------- . /// . /// assert!(ptr::addr_eq(whole, first)); . /// assert!(!ptr::eq::(whole, first)); . /// ``` . #[stable(feature = "ptr_addr_eq", since = "1.76.0")] . #[inline(always)] . #[must_use = "pointer comparison produces a value"] . pub fn addr_eq(p: *const T, q: *const U) -> bool { 191,659 ( 0.01%) (p as *const ()) == (q as *const ()) . } . . /// Compares the *addresses* of the two function pointers for equality. . /// . /// This is the same as `f == g`, but using this function makes clear that the potentially . /// surprising semantics of function pointer comparison are involved. . /// . /// There are **very few guarantees** about how functions are compiled and they have no intrinsic -- line 2540 ---------------------------------------- 16,209 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/intrinsics/mod.rs -------------------------------------------------------------------------------- Ir -- line 447 ---------------------------------------- . /// Therefore, implementations must not require the user to uphold . /// any safety invariants. . /// . /// This intrinsic does not have a stable counterpart. . #[unstable(feature = "core_intrinsics", issue = "none")] . #[rustc_nounwind] . #[inline(always)] . pub const fn likely(b: bool) -> bool { 10,429 ( 0.00%) if b { . true . } else { . cold_path(); . false . } . } . . /// Hints to the compiler that branch condition is likely to be false. -- line 463 ---------------------------------------- -- line 470 ---------------------------------------- . /// Therefore, implementations must not require the user to uphold . /// any safety invariants. . /// . /// This intrinsic does not have a stable counterpart. . #[unstable(feature = "core_intrinsics", issue = "none")] . #[rustc_nounwind] . #[inline(always)] . pub const fn unlikely(b: bool) -> bool { 26,834 ( 0.00%) if b { . cold_path(); . true . } else { . false . } . } . . /// Returns either `true_val` or `false_val` depending on condition `b` with a -- line 486 ---------------------------------------- -- line 2207 ---------------------------------------- . #[rustc_nounwind] . #[rustc_intrinsic] . #[rustc_allow_const_fn_unstable(const_trait_impl, funnel_shifts)] . #[miri::intrinsic_fallback_is_spec] . pub const fn rotate_left(x: T, shift: u32) -> T { . // Make sure to call the intrinsic for `funnel_shl`, not the fallback impl. . // SAFETY: we modulo `shift` so that the result is definitely less than the size of . // `T` in bits. 6,369 ( 0.00%) unsafe { unchecked_funnel_shl(x, x, shift % (mem::size_of::() as u32 * 8)) } . } . . /// Performs rotate right. . /// . /// Note that, unlike most intrinsics, this is safe to call; . /// it does not require an `unsafe` block. . /// Therefore, implementations must not require the user to uphold . /// any safety invariants. -- line 2223 ---------------------------------------- -- line 2615 ---------------------------------------- . @capture$([$($binders:tt)*])? { $($arg:ident : $ty:ty = $val:expr),* $(,)? } $( -> $ret:ty )? : . if const . $(#[$compiletime_attr:meta])* $compiletime:block . else . $(#[$runtime_attr:meta])* $runtime:block . ) => {{ . #[inline] . $(#[$runtime_attr])* 24,386 ( 0.00%) fn runtime$(<$($binders)*>)?($($arg: $ty),*) $( -> $ret )? { . $runtime . } . . #[inline] . $(#[$compiletime_attr])* . const fn compiletime$(<$($binders)*>)?($($arg: $ty),*) $( -> $ret )? { . // Don't warn if one of the arguments is unused. . $(let _ = $arg;)* -- line 2631 ---------------------------------------- 5,906 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/minmax.rs -------------------------------------------------------------------------------- Ir -- line 31 ---------------------------------------- . pub MIN_MAX, . correctness, . "`min(_, max(_, _))` (or vice versa) with bounds clamping the result to a constant" . } . . declare_lint_pass!(MinMaxPass => [MIN_MAX]); . . impl<'tcx> LateLintPass<'tcx> for MinMaxPass { 549,936 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 206,226 ( 0.01%) if let Some((outer_max, outer_c, oe)) = min_max(cx, expr) 1,464,074 ( 0.07%) => site/frontend/rust-clippy/clippy_lints/src/minmax.rs:clippy_lints::minmax::min_max (68,742x) . && let Some((inner_max, inner_c, ie)) = min_max(cx, oe) . && outer_max != inner_max . && let Some(ord) = Constant::partial_cmp(cx.tcx, cx.typeck_results().expr_ty(ie), &outer_c, &inner_c) . && matches!( . (outer_max, ord), . (MinMax::Max, Equal | Greater) | (MinMax::Min, Equal | Less) . ) . { . span_lint( . cx, . MIN_MAX, . expr.span, . "this `min`/`max` combination leads to constant result", . ); . } 412,452 ( 0.02%) } . } . . #[derive(PartialEq, Eq, Debug, Clone, Copy)] . enum MinMax { . Min, . Max, . } . 481,194 ( 0.02%) fn min_max<'a>(cx: &LateContext<'_>, expr: &'a Expr<'a>) -> Option<(MinMax, Constant, &'a Expr<'a>)> { 343,312 ( 0.02%) match expr.kind { 199 ( 0.00%) ExprKind::Call(path, args) => { 597 ( 0.00%) if let ExprKind::Path(ref qpath) = path.kind { . cx.typeck_results() 796 ( 0.00%) .qpath_res(qpath, path.hir_id) 4,285 ( 0.00%) => ???:::qpath_res (199x) . .opt_def_id() 1,116 ( 0.00%) .and_then(|def_id| match cx.tcx.get_diagnostic_name(def_id) { 10,860 ( 0.00%) => ???:::get_diagnostic_name (186x) . Some(sym::cmp_min) => fetch_const(cx, expr.span.ctxt(), None, args, MinMax::Min), . Some(sym::cmp_max) => fetch_const(cx, expr.span.ctxt(), None, args, MinMax::Max), . _ => None, . }) . } else { . None . } . }, 316 ( 0.00%) ExprKind::MethodCall(path, receiver, args @ [_], _) => { 32 ( 0.00%) let m = match path.ident.name { 128 ( 0.00%) sym::max => MinMax::Max, . sym::min => MinMax::Min, . _ => return None, . }; . if cx.typeck_results().expr_ty(receiver).is_floating_point() . || cx.ty_based_def(expr).opt_parent(cx).is_diag_item(cx, sym::Ord) . { . fetch_const(cx, expr.span.ctxt(), Some(receiver), args, m) . } else { . None . } . }, . _ => None, . } 549,936 ( 0.03%) } . . fn fetch_const<'a>( . cx: &LateContext<'_>, . ctxt: SyntaxContext, . receiver: Option<&'a Expr<'a>>, . args: &'a [Expr<'a>], . m: MinMax, . ) -> Option<(MinMax, Constant, &'a Expr<'a>)> { -- line 105 ---------------------------------------- 199 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/index.rs -------------------------------------------------------------------------------- Ir -- line 82 ---------------------------------------- . #[inline(always)] . const unsafe fn get_offset_len_noubcheck( . ptr: *const [T], . offset: usize, . len: usize, . ) -> *const [T] { . let ptr = ptr as *const T; . // SAFETY: The caller already checked these preconditions 238,457 ( 0.01%) let ptr = unsafe { crate::intrinsics::offset(ptr, offset) }; . crate::intrinsics::aggregate_raw_ptr(ptr, len) . } . . #[inline(always)] . const unsafe fn get_offset_len_mut_noubcheck( . ptr: *mut [T], . offset: usize, . len: usize, -- line 98 ---------------------------------------- -- line 176 ---------------------------------------- . /// The methods `index` and `index_mut` panic if the index is out of bounds. . #[stable(feature = "slice_get_slice_impls", since = "1.15.0")] . #[rustc_const_unstable(feature = "const_index", issue = "143775")] . const unsafe impl SliceIndex<[T]> for usize { . type Output = T; . . #[inline] . fn get(self, slice: &[T]) -> Option<&T> { 141,193 ( 0.01%) if self < slice.len() { . // SAFETY: `self` is checked to be in bounds. 40 ( 0.00%) unsafe { Some(slice_get_unchecked(slice, self)) } . } else { . None . } . } . . #[inline] . #[rustc_no_writable] . fn get_mut(self, slice: &mut [T]) -> Option<&mut T> { 156 ( 0.00%) if self < slice.len() { . // SAFETY: `self` is checked to be in bounds. . unsafe { Some(slice_get_unchecked(slice, self)) } . } else { . None . } . } . . #[inline] -- line 203 ---------------------------------------- -- line 211 ---------------------------------------- . // SAFETY: the caller guarantees that `slice` is not dangling, so it . // cannot be longer than `isize::MAX`. They also guarantee that . // `self` is in bounds of `slice` so `self` cannot overflow an `isize`, . // so the call to `add` is safe. . unsafe { . // Use intrinsics::assume instead of hint::assert_unchecked so that we don't check the . // precondition of this function twice. . crate::intrinsics::assume(self < slice.len()); 45 ( 0.00%) slice_get_unchecked(slice, self) . } . } . . #[inline] . #[track_caller] . unsafe fn get_unchecked_mut(self, slice: *mut [T]) -> *mut T { . assert_unsafe_precondition!( . check_library_ub, . "slice::get_unchecked_mut requires that the index is within the slice", . (this: usize = self, len: usize = slice.len()) => this < len . ); . // SAFETY: see comments for `get_unchecked` above. 58 ( 0.00%) unsafe { slice_get_unchecked(slice, self) } . } . . #[inline] . fn index(self, slice: &[T]) -> &T { . // N.B., use intrinsic indexing 16,155 ( 0.00%) &(*slice)[self] . } . . #[inline] . #[rustc_no_writable] . fn index_mut(self, slice: &mut [T]) -> &mut T { . // N.B., use intrinsic indexing 1,018 ( 0.00%) &mut (*slice)[self] . } . } . . /// Because `IndexRange` guarantees `start <= end`, fewer checks are needed here . /// than there are for a general `Range` (which might be `100..3`). . #[rustc_const_unstable(feature = "const_index", issue = "143775")] . const unsafe impl SliceIndex<[T]> for ops::IndexRange { . type Output = [T]; -- line 253 ---------------------------------------- -- line 400 ---------------------------------------- . get_offset_len_mut_noubcheck(slice, self.start, new_len) . } . } . . #[inline(always)] . fn index(self, slice: &[T]) -> &[T] { . // Using checked_sub is a safe way to get `SubUnchecked` in MIR . if let Some(new_len) = usize::checked_sub(self.end, self.start) 77,288 ( 0.00%) && self.end <= slice.len() . { . // SAFETY: `self` is checked to be valid and in bounds above. . unsafe { &*get_offset_len_noubcheck(slice, self.start, new_len) } . } else { . slice_index_fail(self.start, self.end, slice.len()) . } . } . -- line 416 ---------------------------------------- -- line 536 ---------------------------------------- . #[inline] . unsafe fn get_unchecked_mut(self, slice: *mut [T]) -> *mut [T] { . // SAFETY: the caller has to uphold the safety contract for `get_unchecked_mut`. . unsafe { (self.start..slice.len()).get_unchecked_mut(slice) } . } . . #[inline] . fn index(self, slice: &[T]) -> &[T] { 198 ( 0.00%) if self.start > slice.len() { . slice_index_fail(self.start, slice.len(), slice.len()) . } . // SAFETY: `self` is checked to be valid and in bounds above. . unsafe { . let new_len = crate::intrinsics::unchecked_sub(slice.len(), self.start); . &*get_offset_len_noubcheck(slice, self.start, new_len) . } . } -- line 552 ---------------------------------------- 135,023 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/useless_concat.rs -------------------------------------------------------------------------------- Ir -- line 28 ---------------------------------------- . pub USELESS_CONCAT, . complexity, . "checks that the `concat` macro has at least two arguments" . } . . declare_lint_pass!(UselessConcat => [USELESS_CONCAT]); . . impl LateLintPass<'_> for UselessConcat { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { . // Check that the expression is generated by a macro. 206,226 ( 0.01%) if expr.span.from_expansion() . // Check that it's a string literal. 7 ( 0.00%) && let ExprKind::Lit(lit) = expr.kind 21 ( 0.00%) && let LitKind::Str(lit_s, _) = lit.node . // Get the direct parent of the expression. 35 ( 0.00%) && let Some(macro_call) = macro_backtrace(expr.span).next() . // Check if the `concat` macro from the `core` library. 49 ( 0.00%) && cx.tcx.is_diagnostic_item(sym::macro_concat, macro_call.def_id) 630 ( 0.00%) => ???:::is_diagnostic_item (7x) . // We get the original code to parse it. . && let Some(original_code) = snippet_opt(cx, macro_call.span) . // This check allows us to ensure that the code snippet: . // 1. Doesn't come from proc-macro expansion. . // 2. Doesn't come from foreign macro expansion. . // . // It works as follows: if the snippet we get doesn't contain `concat!(`, then it . // means it's not code written in the current crate so we shouldn't lint. -- line 53 ---------------------------------------- -- line 94 ---------------------------------------- . macro_call.span, . "unneeded use of `concat!` macro", . "replace with", . format!("{lit_s:?}"), . Applicability::MachineApplicable, . ); . } . } 549,936 ( 0.03%) } . } 483 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_main_separator_str.rs -------------------------------------------------------------------------------- Ir -- line 41 ---------------------------------------- . . impl ManualMainSeparatorStr { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl LateLintPass<'_> for ManualMainSeparatorStr { 687,420 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 137,484 ( 0.01%) let (target, _) = peel_hir_expr_refs(expr); 344,068 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::peel_hir_expr_refs (68,742x) 137,782 ( 0.01%) if let ExprKind::MethodCall(path, receiver, &[], _) = target.kind 78 ( 0.00%) && path.ident.name == sym::to_string . && let ExprKind::Path(QPath::Resolved(None, path)) = receiver.kind . && let Res::Def(DefKind::Const { .. }, receiver_def_id) = path.res . && cx.ty_based_def(target).opt_parent(cx).is_diag_item(cx, sym::ToString) . && cx.tcx.is_diagnostic_item(sym::path_main_separator, receiver_def_id) . && let ty::Ref(_, ty, Mutability::Not) = cx.typeck_results().expr_ty_adjusted(expr).kind() . && ty.is_str() . && self.msrv.meets(cx, msrvs::PATH_MAIN_SEPARATOR_STR) . { -- line 60 ---------------------------------------- -- line 63 ---------------------------------------- . MANUAL_MAIN_SEPARATOR_STR, . expr.span, . "taking a reference on `std::path::MAIN_SEPARATOR` conversion to `String`", . "replace with", . "std::path::MAIN_SEPARATOR_STR".to_owned(), . Applicability::MachineApplicable, . ); . } 549,936 ( 0.03%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/needless_bool.rs -------------------------------------------------------------------------------- Ir -- line 118 ---------------------------------------- . return true; . } . inner = i; . } . false . } . . impl<'tcx> LateLintPass<'tcx> for NeedlessBool { 618,678 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { . use self::Expression::{Bool, RetBool}; 137,484 ( 0.01%) if !e.span.from_expansion() . && let Some(higher::If { . cond, . then, . r#else: Some(else_expr), . }) = higher::If::hir(e) 18 ( 0.00%) && !span_contains_comment(cx, e.span) . { . let reduce = |ret, not| { . span_lint_and_then( . cx, . NEEDLESS_BOOL, . e.span, . "this if-then-else expression returns a bool literal", . |diag| { -- line 142 ---------------------------------------- -- line 159 ---------------------------------------- . { . snip = snip.maybe_paren(); . } . . diag.span_suggestion(e.span, "you can reduce it to", snip.to_string(), applicability); . }, . ); . }; 28 ( 0.00%) if let Some(a) = fetch_bool_block(then) 279 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_lints::needless_bool::fetch_bool_block (7x) . && let Some(b) = fetch_bool_block(else_expr) . { . match (a, b) { . (RetBool(true), RetBool(true)) | (Bool(true), Bool(true)) => { . span_lint( . cx, . NEEDLESS_BOOL, . e.span, -- line 175 ---------------------------------------- -- line 186 ---------------------------------------- . }, . (RetBool(true), RetBool(false)) => reduce(true, false), . (Bool(true), Bool(false)) => reduce(false, false), . (RetBool(false), RetBool(true)) => reduce(true, true), . (Bool(false), Bool(true)) => reduce(false, true), . _ => (), . } . } 35 ( 0.00%) if let Some((lhs_a, a)) = fetch_assign(then) 154 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_lints::needless_bool::fetch_assign (7x) . && let Some((lhs_b, b)) = fetch_assign(else_expr) . && SpanlessEq::new(cx).eq_expr(SyntaxContext::root(), lhs_a, lhs_b) . { . let mut applicability = Applicability::MachineApplicable; . let cond = Sugg::hir_with_context(cx, cond, e.span.ctxt(), "..", &mut applicability); . let (lhs, _) = snippet_with_context(cx, lhs_a.span, e.span.ctxt(), "..", &mut applicability); . let mut sugg = if a == b { . format!("{cond}; {lhs} = {a:?};") -- line 202 ---------------------------------------- -- line 214 ---------------------------------------- . e.span, . "this if-then-else expression assigns a bool literal", . "you can reduce it to", . sugg, . applicability, . ); . } . } 549,936 ( 0.03%) } . 1,204 ( 0.00%) fn check_block(&mut self, cx: &LateContext<'tcx>, block: &'tcx Block<'tcx>) { . // Detect the early-return form: . // if c { . // return Ok(true); . // } . // Ok(false) . // and reduce it to `Ok(c)`. The optional `Ok(..)` wrapper can be any tuple-like . // constructor (or absent), as long as the guard and the trailing expression use the . // same one. Constructors are pure, so folding the condition in keeps the behavior. 516 ( 0.00%) if let Some(tail) = block.expr 220 ( 0.00%) && !tail.span.from_expansion() 330 ( 0.00%) && let [.., last_stmt] = block.stmts 103 ( 0.00%) && let StmtKind::Semi(if_expr) | StmtKind::Expr(if_expr) = last_stmt.kind 22 ( 0.00%) && !if_expr.span.from_expansion() . && let Some(higher::If { . cond, . then, . r#else: None, . }) = higher::If::hir(if_expr) 11 ( 0.00%) && let ExprKind::Ret(Some(ret)) = peel_blocks_with_stmt(then).kind 32 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::peel_blocks_with_stmt (2x) 3 ( 0.00%) && let Some((then_func, then_val)) = fetch_bool_and_wrapper(ret) 15 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/needless_bool.rs:clippy_lints::needless_bool::fetch_bool_and_wrapper (1x) . && let Some((tail_func, tail_val)) = fetch_bool_and_wrapper(tail) . // `if c { return Ok(true) } Ok(true)` is always the same value; the condition might . // have side effects, so don't touch it. Comparing the values here is cheap, so do it . // before the constructor resolution in `wrapper_ctors_match`, which needs `qpath_res`. . && then_val != tail_val . && wrapper_ctors_match(cx, then_func, tail_func) . { . let span = if_expr.span.to(tail.span); -- line 252 ---------------------------------------- -- line 274 ---------------------------------------- . NEEDLESS_BOOL, . span, . "this `if` guard returns a bool literal and is followed by another", . "you can reduce it to", . sugg, . applicability, . ); . } 1,376 ( 0.00%) } . } . . /// Returns the optional constructor call wrapping a bool literal (e.g. the `Ok` in `Ok(true)`) . /// along with the bool value. The constructor is returned as the unresolved callee expression; . /// resolving it to a `DefId` (via [`wrapper_ctors_match`]) needs `qpath_res`, which is . /// comparatively expensive, so callers should only do that once the cheap bool-value comparison . /// has passed. A bare bool literal yields `None`. . fn fetch_bool_and_wrapper<'tcx>(expr: &'tcx Expr<'tcx>) -> Option<(Option<&'tcx Expr<'tcx>>, bool)> { . let expr = peel_blocks(expr); . if let Some(value) = fetch_bool_expr(expr) { . return Some((None, value)); . } 2 ( 0.00%) if let ExprKind::Call(func, [arg]) = expr.kind . && let Some(value) = fetch_bool_expr(arg) . { . return Some((Some(func), value)); . } . None 1 ( 0.00%) } . . /// Checks whether two optional wrapper-constructor call expressions (as returned by . /// [`fetch_bool_and_wrapper`]) are absent on both sides, or call the same tuple-like constructor. . fn wrapper_ctors_match(cx: &LateContext<'_>, a: Option<&Expr<'_>>, b: Option<&Expr<'_>>) -> bool { . fn resolve_ctor(cx: &LateContext<'_>, func: &Expr<'_>) -> Option { . if let ExprKind::Path(qpath) = &func.kind . && let Res::Def(DefKind::Ctor(..), did) = cx.qpath_res(qpath, func.hir_id) . { -- line 309 ---------------------------------------- -- line 319 ---------------------------------------- . } . . enum Expression { . Bool(bool), . RetBool(bool), . } . . fn fetch_bool_block(expr: &Expr<'_>) -> Option { 21 ( 0.00%) match peel_blocks_with_stmt(expr).kind { . ExprKind::Ret(Some(ret)) => Some(Expression::RetBool(fetch_bool_expr(ret)?)), . _ => Some(Expression::Bool(fetch_bool_expr(expr)?)), . } 7 ( 0.00%) } . . fn fetch_bool_expr(expr: &Expr<'_>) -> Option { . if let ExprKind::Lit(lit_ptr) = peel_blocks(expr).kind 6 ( 0.00%) && let LitKind::Bool(value) = lit_ptr.node . { . return Some(value); . } . None . } . . fn fetch_assign<'tcx>(expr: &'tcx Expr<'tcx>) -> Option<(&'tcx Expr<'tcx>, bool)> { 28 ( 0.00%) if let ExprKind::Assign(lhs, rhs, _) = peel_blocks_with_stmt(expr).kind { . fetch_bool_expr(rhs).map(|b| (lhs, b)) . } else { . None . } 7 ( 0.00%) } . . fn is_as_argument(cx: &LateContext<'_>, e: &Expr<'_>) -> bool { . matches!(get_parent_expr(cx, e).map(|e| e.kind), Some(ExprKind::Cast(_, _))) . } . . fn is_operand_of_binary_or_unary(cx: &LateContext<'_>, e: &Expr<'_>) -> bool { . matches!( . get_parent_expr(cx, e).map(|e| e.kind), -- line 356 ---------------------------------------- 117 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/flatten.rs -------------------------------------------------------------------------------- Ir -- line 15 ---------------------------------------- . #[must_use = "iterators are lazy and do nothing unless consumed"] . #[stable(feature = "rust1", since = "1.0.0")] . pub struct FlatMap { . inner: FlattenCompat, ::IntoIter>, . } . . impl U> FlatMap { . pub(in crate::iter) fn new(iter: I, f: F) -> FlatMap { 549,944 ( 0.03%) FlatMap { inner: FlattenCompat::new(iter.map(f)) } . } . . pub(crate) fn into_parts(self) -> (Option, Option, Option) { . ( . self.inner.frontiter, . self.inner.iter.into_inner().map(Map::into_inner), . self.inner.backiter, . ) -- line 31 ---------------------------------------- -- line 183 ---------------------------------------- . #[stable(feature = "iterator_flatten", since = "1.29.0")] . pub struct Flatten> { . inner: FlattenCompat::IntoIter>, . } . . #[rustc_const_unstable(feature = "const_iter", issue = "92476")] . const impl> Flatten { . pub(in super::super) fn new(iter: I) -> Flatten { 990 ( 0.00%) Flatten { inner: FlattenCompat::new(iter) } . } . } . . #[stable(feature = "iterator_flatten", since = "1.29.0")] . impl fmt::Debug for Flatten . where . I: fmt::Debug + Iterator>, . U: fmt::Debug + Iterator, -- line 199 ---------------------------------------- -- line 242 ---------------------------------------- . self.inner.try_fold(init, fold) . } . . #[inline] . fn fold(self, init: Acc, fold: Fold) -> Acc . where . Fold: FnMut(Acc, Self::Item) -> Acc, . { 2,249 ( 0.00%) self.inner.fold(init, fold) . } . . #[inline] . fn advance_by(&mut self, n: usize) -> Result<(), NonZero> { . self.inner.advance_by(n) . } . . #[inline] -- line 258 ---------------------------------------- -- line 383 ---------------------------------------- . fn iter_fold(self, mut acc: Acc, mut fold: Fold) -> Acc . where . Fold: FnMut(Acc, U) -> Acc, . { . #[inline] . fn flatten( . fold: &mut impl FnMut(Acc, T::IntoIter) -> Acc, . ) -> impl FnMut(Acc, T) -> Acc + '_ { 6 ( 0.00%) move |acc, iter| fold(acc, iter.into_iter()) . } . 367 ( 0.00%) if let Some(iter) = self.frontiter { . acc = fold(acc, iter); . } . 15 ( 0.00%) acc = self.iter.fold(acc, flatten(&mut fold)); . 881 ( 0.00%) if let Some(iter) = self.backiter { . acc = fold(acc, iter); . } . . acc . } . . /// Folds over the inner iterators as long as the given function returns successfully, . /// always storing the most recent inner iterator in `self.frontiter`. -- line 408 ---------------------------------------- -- line 418 ---------------------------------------- . #[inline] . fn flatten<'a, T: IntoIterator, Acc, R: Try>( . frontiter: &'a mut Option, . fold: &'a mut impl FnMut(Acc, &mut T::IntoIter) -> R, . ) -> impl FnMut(Acc, T) -> R + 'a { . move |acc, iter| fold(acc, frontiter.insert(iter.into_iter())) . } . 2 ( 0.00%) if let Some(iter) = &mut self.frontiter { . acc = fold(acc, iter)?; . } 206,226 ( 0.01%) self.frontiter = None; . 1 ( 0.00%) acc = self.iter.try_fold(acc, flatten(&mut self.frontiter, &mut fold))?; 68,742 ( 0.00%) self.frontiter = None; . 137,484 ( 0.01%) if let Some(iter) = &mut self.backiter { . acc = fold(acc, iter)?; . } . self.backiter = None; . . try { acc } . } . } . -- line 442 ---------------------------------------- -- line 514 ---------------------------------------- . where . I: Iterator>, . U: Iterator, . { . type Item = U::Item; . . #[inline] . default fn next(&mut self) -> Option { 72 ( 0.00%) loop { . if let elt @ Some(_) = and_then_or_clear(&mut self.frontiter, Iterator::next) { . return elt; . } 510 ( 0.00%) match self.iter.next() { . None => return and_then_or_clear(&mut self.backiter, Iterator::next), . Some(inner) => self.frontiter = Some(inner.into_iter()), . } . } . } . . #[inline] . default fn size_hint(&self) -> (usize, Option) { -- line 534 ---------------------------------------- -- line 602 ---------------------------------------- . } . } . . #[inline] . default fn count(self) -> usize { . #[inline] . #[rustc_inherit_overflow_checks] . fn count(acc: usize, iter: U) -> usize { 81 ( 0.00%) acc + iter.count() . } . 50 ( 0.00%) self.iter_fold(0, count) . } . . #[inline] . default fn last(self) -> Option { . #[inline] . fn last(last: Option, iter: U) -> Option { . iter.last().or(last) . } -- line 621 ---------------------------------------- -- line 847 ---------------------------------------- . // `frontiter` or `backiter` without consuming the item, so we **must** override those. . impl Iterator for FlattenCompat . where . I: Iterator>, . U: Iterator + OneShot, . { . #[inline] . fn next(&mut self) -> Option { 1,114 ( 0.00%) while let Some(inner) = self.iter.next() { 132 ( 0.00%) if let item @ Some(_) = inner.into_iter().next() { . return item; . } . } . None . } . . #[inline] . fn size_hint(&self) -> (usize, Option) { -- line 864 ---------------------------------------- 137,987 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/misc_early/unneeded_wildcard_pattern.rs -------------------------------------------------------------------------------- Ir -- line 2 ---------------------------------------- . use rustc_ast::ast::{Pat, PatFieldsRest, PatKind}; . use rustc_errors::Applicability; . use rustc_lint::{EarlyContext, LintContext as _}; . use rustc_span::Span; . . use super::UNNEEDED_WILDCARD_PATTERN; . . pub(super) fn check(cx: &EarlyContext<'_>, pat: &Pat) { 22,531 ( 0.00%) if let PatKind::TupleStruct(_, _, ref patterns) | PatKind::Tuple(ref patterns) = pat.kind . && let Some(rest_index) = patterns.iter().position(Pat::is_rest) . { . if let Some((left_index, left_pat)) = patterns[..rest_index] . .iter() . .rev() . .take_while(|pat| matches!(pat.kind, PatKind::Wild)) . .enumerate() . .last() -- line 18 ---------------------------------------- -- line 29 ---------------------------------------- . && !pat.span.in_external_macro(cx.sess().source_map()) . { . span_lint( . cx, . patterns[rest_index].span.shrink_to_hi().to(right_pat.span), . right_index == 0, . ); . } 2,507 ( 0.00%) } else if let PatKind::Struct(_, _, patfields, rest) = &pat.kind . && let PatFieldsRest::Rest(rspan) = rest . && let Some((right_index, _right_pat)) = patfields . .iter() . .rev() . .take_while(|patfield| matches!(patfield.pat.kind, PatKind::Wild)) . .enumerate() . .last() . // Only run if `rest_pattern_accessible_field` is Allow, as they otherwise will contradict each other. -- line 45 ---------------------------------------- 45 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs -------------------------------------------------------------------------------- Ir -- line 71 ---------------------------------------- . label = "expected an `{This:resolved}` closure, found `{Self}`" . )] . #[fundamental] // so that regex can rely that `&str: !FnMut` . #[must_use = "closures are lazy and do nothing unless called"] . #[rustc_const_unstable(feature = "const_trait_impl", issue = "143874")] . pub const trait Fn: [const] FnMut { . /// Performs the call operation. . #[unstable(feature = "fn_traits", issue = "29625")] 2 ( 0.00%) extern "rust-call" fn call(&self, args: Args) -> Self::Output; 28 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/manual_filter.rs:clippy_lints::matches::manual_filter::get_cond_expr (1x) . } . . /// The version of the call operator that takes a mutable receiver. . /// . /// Instances of `FnMut` can be called repeatedly and may mutate state. . /// . /// `FnMut` is implemented automatically by closures which take mutable . /// references to captured variables, as well as all types that implement -- line 87 ---------------------------------------- -- line 158 ---------------------------------------- . label = "expected an `{This:resolved}` closure, found `{Self}`" . )] . #[fundamental] // so that regex can rely that `&str: !FnMut` . #[must_use = "closures are lazy and do nothing unless called"] . #[rustc_const_unstable(feature = "const_trait_impl", issue = "143874")] . pub const trait FnMut: FnOnce { . /// Performs the call operation. . #[unstable(feature = "fn_traits", issue = "29625")] 20 ( 0.00%) extern "rust-call" fn call_mut(&mut self, args: Args) -> Self::Output; 63 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/cmp.rs:::from_full_name (1x) . } . . /// The version of the call operator that takes a by-value receiver. . /// . /// Instances of `FnOnce` can be called, but might not be callable multiple . /// times. Because of this, if the only thing known about a type is that it . /// implements `FnOnce`, it can only be called once. . /// -- line 174 ---------------------------------------- -- line 242 ---------------------------------------- . pub const trait FnOnce { . /// The returned type after the call operator is used. . #[lang = "fn_once_output"] . #[stable(feature = "fn_once_output", since = "1.12.0")] . type Output; . . /// Performs the call operation. . #[unstable(feature = "fn_traits", issue = "29625")] 56,604 ( 0.00%) extern "rust-call" fn call_once(self, args: Args) -> Self::Output; 1,047,782 ( 0.05%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/src/driver.rs:clippy_driver::main (1x) . } . . mod impls { . use crate::marker::Tuple; . . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_trait_impl", issue = "143874")] . const impl Fn for &F -- line 258 ---------------------------------------- -- line 289 ---------------------------------------- . } . . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_trait_impl", issue = "143874")] . const impl FnMut for &mut F . where . F: [const] FnMut, . { 995 ( 0.00%) extern "rust-call" fn call_mut(&mut self, args: A) -> F::Output { 185 ( 0.00%) (*self).call_mut(args) 1,244 ( 0.00%) } . } . . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_trait_impl", issue = "143874")] . const impl FnOnce for &mut F . where . F: [const] FnMut, . { . type Output = F::Output; . extern "rust-call" fn call_once(self, args: A) -> F::Output { 72 ( 0.00%) (*self).call_mut(args) . } . } . } 15 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/doc/suspicious_doc_comments.rs -------------------------------------------------------------------------------- Ir -- line 4 ---------------------------------------- . use rustc_errors::Applicability; . use rustc_hir::Attribute; . use rustc_hir::attrs::AttributeKind; . use rustc_lint::LateContext; . use rustc_span::Span; . . use super::SUSPICIOUS_DOC_COMMENTS; . 496,580 ( 0.02%) pub fn check(cx: &LateContext<'_>, attrs: &[Attribute]) -> bool { . let replacements: Vec<_> = collect_doc_replacements(attrs); . 141,880 ( 0.01%) if let Some((&(lo_span, _), &(hi_span, _))) = replacements.first().zip(replacements.last()) { . span_lint_and_then( . cx, . SUSPICIOUS_DOC_COMMENTS, . lo_span.to(hi_span), . "this is an outer doc comment and does not apply to the parent module or crate", . |diag| { . diag.multipart_suggestion( . "use an inner doc comment to document the parent module or crate", -- line 23 ---------------------------------------- -- line 26 ---------------------------------------- . ); . }, . ); . . true . } else { . false . } 567,520 ( 0.03%) } . . fn collect_doc_replacements(attrs: &[Attribute]) -> Vec<(Span, String)> { . attrs . .iter() . .filter_map(|attr| { 984 ( 0.00%) if let Attribute::Parsed(AttributeKind::DocComment { . style: AttrStyle::Outer, . kind: DocFragmentKind::Sugared(comment_kind), . comment, . .. . }) = attr . && let Some(com) = comment.as_str().strip_prefix('!') . { . let sugg = match comment_kind { . CommentKind::Block => format!("/*!{com}*/"), . CommentKind::Line => format!("//!{com}"), . }; . Some((attr.span(), sugg)) . } else { 247 ( 0.00%) None . } . }) . .collect() . } 138 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/unnested_or_patterns.rs -------------------------------------------------------------------------------- Ir -- line 57 ---------------------------------------- . impl UnnestedOrPatterns { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl EarlyLintPass for UnnestedOrPatterns { . fn check_arm(&mut self, cx: &EarlyContext<'_>, a: &ast::Arm) { 5,952 ( 0.00%) if self.msrv.meets(msrvs::OR_PATTERNS) { 35,712 ( 0.00%) => /rust/deps/smallvec-1.15.1/src/lib.rs:::meets (1,488x) . lint_unnested_or_patterns(cx, &a.pat); . } . } . . fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &ast::Expr) { 360,145 ( 0.02%) if self.msrv.meets(msrvs::OR_PATTERNS) 1,728,696 ( 0.08%) => /rust/deps/smallvec-1.15.1/src/lib.rs:::meets (72,029x) . && let ast::ExprKind::Let(pat, _, _, _) = &e.kind . { . lint_unnested_or_patterns(cx, pat); . } . } . . fn check_param(&mut self, cx: &EarlyContext<'_>, p: &ast::Param) { 528 ( 0.00%) if self.msrv.meets(msrvs::OR_PATTERNS) { 3,168 ( 0.00%) => /rust/deps/smallvec-1.15.1/src/lib.rs:::meets (132x) . lint_unnested_or_patterns(cx, &p.pat); . } . } . . fn check_local(&mut self, cx: &EarlyContext<'_>, l: &ast::Local) { 148 ( 0.00%) if self.msrv.meets(msrvs::OR_PATTERNS) { 888 ( 0.00%) => /rust/deps/smallvec-1.15.1/src/lib.rs:::meets (37x) . lint_unnested_or_patterns(cx, &l.pat); . } . } . . extract_msrv_attr!(); . } . . fn lint_unnested_or_patterns(cx: &EarlyContext<'_>, pat: &Pat) { -- line 93 ---------------------------------------- 216,087 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs -------------------------------------------------------------------------------- Ir -- line 81 ---------------------------------------- . Method(Ident, &'a FnSig<'a>), . . /// `|x, y| {}` . Closure, . } . . impl<'a> FnKind<'a> { . pub fn header(&self) -> Option<&FnHeader> { 672 ( 0.00%) match *self { 141 ( 0.00%) FnKind::ItemFn(_, _, ref header) => Some(header), 108 ( 0.00%) FnKind::Method(_, ref sig) => Some(&sig.header), . FnKind::Closure => None, . } . } . . pub fn constness(self) -> Constness { . self.header().map_or(Constness::NotConst, |header| header.constness) . } . -- line 99 ---------------------------------------- -- line 230 ---------------------------------------- . /// nothing. **You probably don't want to override this method** -- . /// instead, override [`Self::NestedFilter`] or use the "shallow" or . /// "deep" visit patterns described at . /// [`intravisit`](self). The only reason to override . /// this method is if you want a nested pattern but cannot supply a . /// `TyCtxt`; see `maybe_tcx` for advice. . fn visit_nested_item(&mut self, id: ItemId) -> Self::Result { . if Self::NestedFilter::INTER { 4 ( 0.00%) let item = self.maybe_tcx().hir_item(id); 53 ( 0.00%) => ???:::hir_item (1x) . try_visit!(self.visit_item(item)); . } . Self::Result::output() . } . . /// Like `visit_nested_item()`, but for trait items. See . /// `visit_nested_item()` for advice on when to override this . /// method. -- line 246 ---------------------------------------- -- line 252 ---------------------------------------- . Self::Result::output() . } . . /// Like `visit_nested_item()`, but for impl items. See . /// `visit_nested_item()` for advice on when to override this . /// method. . fn visit_nested_impl_item(&mut self, id: ImplItemId) -> Self::Result { . if Self::NestedFilter::INTER { 160 ( 0.00%) let item = self.maybe_tcx().hir_impl_item(id); 2,120 ( 0.00%) => ???:::hir_impl_item (40x) . try_visit!(self.visit_impl_item(item)); . } . Self::Result::output() . } . . /// Like `visit_nested_item()`, but for foreign items. See . /// `visit_nested_item()` for advice on when to override this . /// method. -- line 268 ---------------------------------------- -- line 274 ---------------------------------------- . Self::Result::output() . } . . /// Invoked to visit the body of a function, method or closure. Like . /// `visit_nested_item`, does nothing by default unless you override . /// `Self::NestedFilter`. . fn visit_nested_body(&mut self, id: BodyId) -> Self::Result { . if Self::NestedFilter::INTRA { 1,153 ( 0.00%) let body = self.maybe_tcx().hir_body(id); 364 ( 0.00%) => ???:::hir_body (7x) . try_visit!(self.visit_body(body)); . } . Self::Result::output() . } . . fn visit_param(&mut self, param: &'v Param<'v>) -> Self::Result { . walk_param(self, param) . } . . /// Visits the top-level item and (optionally) nested items / impl items. See . /// `visit_nested_item` for details. . fn visit_item(&mut self, i: &'v Item<'v>) -> Self::Result { 4 ( 0.00%) walk_item(self, i) 100 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_item::> (1x) . } . . fn visit_body(&mut self, b: &Body<'v>) -> Self::Result { . walk_body(self, b) . } . . /////////////////////////////////////////////////////////////////////////// . -- line 303 ---------------------------------------- -- line 312 ---------------------------------------- . } . fn visit_mod(&mut self, m: &'v Mod<'v>, _s: Span, _n: HirId) -> Self::Result { . walk_mod(self, m) . } . fn visit_foreign_item(&mut self, i: &'v ForeignItem<'v>) -> Self::Result { . walk_foreign_item(self, i) . } . fn visit_local(&mut self, l: &'v LetStmt<'v>) -> Self::Result { 538 ( 0.00%) walk_local(self, l) 7,250 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_local::> (1x) . } 99 ( 0.00%) fn visit_block(&mut self, b: &'v Block<'v>) -> Self::Result { 5,810 ( 0.00%) walk_block(self, b) 38,077 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_block::> (36x) . } . fn visit_stmt(&mut self, s: &'v Stmt<'v>) -> Self::Result { 796 ( 0.00%) walk_stmt(self, s) 21,777 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_stmt::::check::{closure#0}>> (45x) . } . fn visit_arm(&mut self, a: &'v Arm<'v>) -> Self::Result { 7,574 ( 0.00%) walk_arm(self, a) 112,919 ( 0.01%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_arm::> (1,480x) 33,705 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_arm::>'2 (38x) . } . fn visit_pat(&mut self, p: &'v Pat<'v>) -> Self::Result { 16,119 ( 0.00%) walk_pat(self, p) 4,272 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_pat:: (126x) . } . fn visit_pat_field(&mut self, f: &'v PatField<'v>) -> Self::Result { . walk_pat_field(self, f) . } . fn visit_pat_expr(&mut self, expr: &'v PatExpr<'v>) -> Self::Result { . walk_pat_expr(self, expr) . } . fn visit_lit(&mut self, _hir_id: HirId, _lit: Lit, _is_negated_pat: bool) -> Self::Result { -- line 340 ---------------------------------------- -- line 343 ---------------------------------------- . fn visit_anon_const(&mut self, c: &'v AnonConst) -> Self::Result { . walk_anon_const(self, c) . } . fn visit_inline_const(&mut self, c: &'v ConstBlock) -> Self::Result { . walk_inline_const(self, c) . } . . fn visit_generic_arg(&mut self, generic_arg: &'v GenericArg<'v>) -> Self::Result { 83 ( 0.00%) walk_generic_arg(self, generic_arg) 512 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_generic_arg::> (3x) . } . . /// All types are treated as ambiguous types for the purposes of hir visiting in . /// order to ensure that visitors can handle infer vars without it being too error-prone. . /// . /// The [`Visitor::visit_infer`] method should be overridden in order to handle infer vars. . fn visit_ty(&mut self, t: &'v Ty<'v, AmbigArg>) -> Self::Result { 3,352 ( 0.00%) walk_ty(self, t) 11,253 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_ty::> (135x) . } . . fn visit_const_item_rhs(&mut self, c: ConstItemRhs<'v>) -> Self::Result { . walk_const_item_rhs(self, c) . } . . /// All consts are treated as ambiguous consts for the purposes of hir visiting in . /// order to ensure that visitors can handle infer vars without it being too error-prone. . /// . /// The [`Visitor::visit_infer`] method should be overridden in order to handle infer vars. . fn visit_const_arg(&mut self, c: &'v ConstArg<'v, AmbigArg>) -> Self::Result { 15 ( 0.00%) walk_const_arg(self, c) 136 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_const_arg:: (1x) . } . . #[allow(unused_variables)] . fn visit_infer(&mut self, inf_id: HirId, inf_span: Span, kind: InferKind<'v>) -> Self::Result { . self.visit_id(inf_id) . } . . fn visit_lifetime(&mut self, lifetime: &'v Lifetime) -> Self::Result { . walk_lifetime(self, lifetime) . } . . fn visit_expr(&mut self, ex: &'v Expr<'v>) -> Self::Result { 8,014 ( 0.00%) walk_expr(self, ex) 643 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_expr:: (4x) . } . fn visit_expr_field(&mut self, field: &'v ExprField<'v>) -> Self::Result { . walk_expr_field(self, field) . } . fn visit_const_arg_expr_field(&mut self, field: &'v ConstArgExprField<'v>) -> Self::Result { . walk_const_arg_expr_field(self, field) . } . fn visit_pattern_type_pattern(&mut self, p: &'v TyPat<'v>) -> Self::Result { -- line 392 ---------------------------------------- -- line 394 ---------------------------------------- . } . fn visit_generic_param(&mut self, p: &'v GenericParam<'v>) -> Self::Result { . walk_generic_param(self, p) . } . fn visit_const_param_default(&mut self, _param: HirId, ct: &'v ConstArg<'v>) -> Self::Result { . walk_const_param_default(self, ct) . } . fn visit_generics(&mut self, g: &'v Generics<'v>) -> Self::Result { 119 ( 0.00%) walk_generics(self, g) 4,739 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_generics:: (7x) . } . fn visit_where_predicate(&mut self, predicate: &'v WherePredicate<'v>) -> Self::Result { 36 ( 0.00%) walk_where_predicate(self, predicate) 5,255 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_where_predicate:: (18x) . } . fn visit_fn_ret_ty(&mut self, ret_ty: &'v FnRetTy<'v>) -> Self::Result { . walk_fn_ret_ty(self, ret_ty) . } . fn visit_fn_decl(&mut self, fd: &'v FnDecl<'v>) -> Self::Result { 29 ( 0.00%) walk_fn_decl(self, fd) 2,563 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_fn_decl:: (7x) . } 16 ( 0.00%) fn visit_fn( . &mut self, . fk: FnKind<'v>, . fd: &'v FnDecl<'v>, . b: BodyId, . _: Span, . id: LocalDefId, . ) -> Self::Result { 181 ( 0.00%) walk_fn(self, fk, fd, b, id) 1,516 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_fn::>'2 (5x) 13 ( 0.00%) } . fn visit_use(&mut self, path: &'v UsePath<'v>, hir_id: HirId) -> Self::Result { . walk_use(self, path, hir_id) . } . fn visit_trait_item(&mut self, ti: &'v TraitItem<'v>) -> Self::Result { . walk_trait_item(self, ti) . } . fn visit_trait_item_ref(&mut self, ii: &'v TraitItemId) -> Self::Result { . walk_trait_item_ref(self, *ii) . } . fn visit_impl_item(&mut self, ii: &'v ImplItem<'v>) -> Self::Result { 120 ( 0.00%) walk_impl_item(self, ii) 57,108 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_impl_item::> (40x) . } . fn visit_foreign_item_ref(&mut self, ii: &'v ForeignItemId) -> Self::Result { . walk_foreign_item_ref(self, *ii) . } . fn visit_impl_item_ref(&mut self, ii: &'v ImplItemId) -> Self::Result { . walk_impl_item_ref(self, *ii) . } . fn visit_trait_ref(&mut self, t: &'v TraitRef<'v>) -> Self::Result { . walk_trait_ref(self, t) . } . fn visit_param_bound(&mut self, bounds: &'v GenericBound<'v>) -> Self::Result { 78 ( 0.00%) walk_param_bound(self, bounds) 2,464 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_param_bound::> (21x) 18 ( 0.00%) } . fn visit_precise_capturing_arg(&mut self, arg: &'v PreciseCapturingArg<'v>) -> Self::Result { . walk_precise_capturing_arg(self, arg) . } . fn visit_poly_trait_ref(&mut self, t: &'v PolyTraitRef<'v>) -> Self::Result { 36 ( 0.00%) walk_poly_trait_ref(self, t) 2,010 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_poly_trait_ref:: (9x) . } . fn visit_opaque_ty(&mut self, opaque: &'v OpaqueTy<'v>) -> Self::Result { . walk_opaque_ty(self, opaque) . } . fn visit_variant_data(&mut self, s: &'v VariantData<'v>) -> Self::Result { . walk_struct_def(self, s) . } . fn visit_field_def(&mut self, s: &'v FieldDef<'v>) -> Self::Result { -- line 459 ---------------------------------------- -- line 464 ---------------------------------------- . } . fn visit_variant(&mut self, v: &'v Variant<'v>) -> Self::Result { . walk_variant(self, v) . } . fn visit_label(&mut self, label: &'v Label) -> Self::Result { . walk_label(self, label) . } . // The span is that of the surrounding type/pattern/expr/whatever. 14,343 ( 0.00%) fn visit_qpath(&mut self, qpath: &'v QPath<'v>, id: HirId, _span: Span) -> Self::Result { 32,945 ( 0.00%) walk_qpath(self, qpath, id) 444 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_qpath:: (10x) 12,294 ( 0.00%) } . fn visit_path(&mut self, path: &Path<'v>, _id: HirId) -> Self::Result { 2,459 ( 0.00%) walk_path(self, path) 8,598 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_path::> (264x) . } . fn visit_path_segment(&mut self, path_segment: &'v PathSegment<'v>) -> Self::Result { 606 ( 0.00%) walk_path_segment(self, path_segment) 7,649 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_path_segment:: (203x) 110 ( 0.00%) } 473 ( 0.00%) fn visit_generic_args(&mut self, generic_args: &'v GenericArgs<'v>) -> Self::Result { 12 ( 0.00%) walk_generic_args(self, generic_args) 606 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_generic_args:: (6x) 456 ( 0.00%) } 243 ( 0.00%) fn visit_assoc_item_constraint( . &mut self, . constraint: &'v AssocItemConstraint<'v>, . ) -> Self::Result { 62 ( 0.00%) walk_assoc_item_constraint(self, constraint) 1,162 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_assoc_item_constraint::> (14x) . } . fn visit_attribute(&mut self, _attr: &'v Attribute) -> Self::Result { . Self::Result::output() . } . fn visit_defaultness(&mut self, defaultness: &'v Defaultness) -> Self::Result { . walk_defaultness(self, defaultness) . } . fn visit_inline_asm(&mut self, asm: &'v InlineAsm<'v>, id: HirId) -> Self::Result { -- line 496 ---------------------------------------- -- line 516 ---------------------------------------- . walk_unambig_const_arg(self, c) . } . } . impl<'v, V: Visitor<'v>> VisitorExt<'v> for V {} . . pub fn walk_param<'v, V: Visitor<'v>>(visitor: &mut V, param: &'v Param<'v>) -> V::Result { . let Param { hir_id, pat, ty_span: _, span: _ } = param; . try_visit!(visitor.visit_id(*hir_id)); 315 ( 0.00%) visitor.visit_pat(pat) . } . 65 ( 0.00%) pub fn walk_item<'v, V: Visitor<'v>>(visitor: &mut V, item: &'v Item<'v>) -> V::Result { . let Item { owner_id: _, kind, span: _, vis_span: _, eii: _ } = item; . try_visit!(visitor.visit_id(item.hir_id())); 40 ( 0.00%) match *kind { . ItemKind::ExternCrate(orig_name, ident) => { . visit_opt!(visitor, visit_name, orig_name); . try_visit!(visitor.visit_ident(ident)); . } . ItemKind::Use(ref path, kind) => { 1 ( 0.00%) try_visit!(visitor.visit_use(path, item.hir_id())); . match kind { . UseKind::Single(ident) => try_visit!(visitor.visit_ident(ident)), . UseKind::Glob | UseKind::ListStem => {} . } . } . ItemKind::Static(_, ident, ref typ, body) => { . try_visit!(visitor.visit_ident(ident)); . try_visit!(visitor.visit_ty_unambig(typ)); -- line 544 ---------------------------------------- -- line 545 ---------------------------------------- . try_visit!(visitor.visit_nested_body(body)); . } . ItemKind::Const(ident, ref generics, ref typ, rhs) => { . try_visit!(visitor.visit_ident(ident)); . try_visit!(visitor.visit_generics(generics)); . try_visit!(visitor.visit_ty_unambig(typ)); . try_visit!(visitor.visit_const_item_rhs(rhs)); . } 28 ( 0.00%) ItemKind::Fn { ident, sig, generics, body: body_id, .. } => { . try_visit!(visitor.visit_ident(ident)); . try_visit!(visitor.visit_fn( . FnKind::ItemFn(ident, generics, sig.header), . sig.decl, . body_id, . item.span, . item.owner_id.def_id, . )); -- line 561 ---------------------------------------- -- line 628 ---------------------------------------- . } . ItemKind::TraitAlias(_constness, ident, ref generics, bounds) => { . try_visit!(visitor.visit_ident(ident)); . try_visit!(visitor.visit_generics(generics)); . walk_list!(visitor, visit_param_bound, bounds); . } . } . V::Result::output() 64 ( 0.00%) } . . pub fn walk_body<'v, V: Visitor<'v>>(visitor: &mut V, body: &Body<'v>) -> V::Result { . let Body { params, value } = body; 320 ( 0.00%) walk_list!(visitor, visit_param, *params); 708 ( 0.00%) visitor.visit_expr(*value) 246,937 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/visitors.rs: as rustc_hir::intravisit::Visitor>::visit_expr (23x) . } . . pub fn walk_ident<'v, V: Visitor<'v>>(visitor: &mut V, ident: Ident) -> V::Result { . visitor.visit_name(ident.name) . } . . pub fn walk_mod<'v, V: Visitor<'v>>(visitor: &mut V, module: &'v Mod<'v>) -> V::Result { . let Mod { spans: _, item_ids } = module; -- line 649 ---------------------------------------- -- line 670 ---------------------------------------- . ForeignItemKind::Static(ref typ, _, _) => { . try_visit!(visitor.visit_ty_unambig(typ)); . } . ForeignItemKind::Type => (), . } . V::Result::output() . } . 1,234 ( 0.00%) pub fn walk_local<'v, V: Visitor<'v>>(visitor: &mut V, local: &'v LetStmt<'v>) -> V::Result { . // Intentionally visiting the expr first - the initialization expr . // dominates the local's definition. . let LetStmt { super_: _, pat, ty, init, els, hir_id, span: _, source: _ } = local; 922 ( 0.00%) visit_opt!(visitor, visit_expr, *init); 8,662 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/macro_metavars_in_unsafe.rs:::visit_expr'2 (24x) . try_visit!(visitor.visit_id(*hir_id)); 198 ( 0.00%) try_visit!(visitor.visit_pat(*pat)); 603 ( 0.00%) visit_opt!(visitor, visit_block, *els); 384 ( 0.00%) visit_opt!(visitor, visit_ty_unambig, *ty); . V::Result::output() 1,149 ( 0.00%) } . 5,011 ( 0.00%) pub fn walk_block<'v, V: Visitor<'v>>(visitor: &mut V, block: &'v Block<'v>) -> V::Result { . let Block { stmts, expr, hir_id, rules: _, span: _, targeted_by_break: _ } = block; . try_visit!(visitor.visit_id(*hir_id)); 1,820 ( 0.00%) walk_list!(visitor, visit_stmt, *stmts); 3,682 ( 0.00%) visit_opt!(visitor, visit_expr, *expr); 304 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/visitors.rs:::check_expr::{closure#0}> as rustc_hir::intravisit::Visitor>::visit_expr (1x) . V::Result::output() 1,697 ( 0.00%) } . 1,280 ( 0.00%) pub fn walk_stmt<'v, V: Visitor<'v>>(visitor: &mut V, statement: &'v Stmt<'v>) -> V::Result { . let Stmt { kind, hir_id, span: _ } = statement; . try_visit!(visitor.visit_id(*hir_id)); 4,362 ( 0.00%) match *kind { 240 ( 0.00%) StmtKind::Let(ref local) => visitor.visit_local(local), 1 ( 0.00%) StmtKind::Item(item) => visitor.visit_nested_item(item), . StmtKind::Expr(ref expression) | StmtKind::Semi(ref expression) => { 1,348 ( 0.00%) visitor.visit_expr(expression) 10,445 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/visitors.rs:::check_expr::{closure#0}> as rustc_hir::intravisit::Visitor>::visit_expr (3x) . } . } 10 ( 0.00%) } . 18,184 ( 0.00%) pub fn walk_arm<'v, V: Visitor<'v>>(visitor: &mut V, arm: &'v Arm<'v>) -> V::Result { . let Arm { hir_id, span: _, pat, guard, body } = arm; . try_visit!(visitor.visit_id(*hir_id)); 7,622 ( 0.00%) try_visit!(visitor.visit_pat(*pat)); 23,010 ( 0.00%) visit_opt!(visitor, visit_expr, *guard); 558 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/macro_metavars_in_unsafe.rs:::visit_expr'2 (1x) 13,809 ( 0.00%) visitor.visit_expr(*body) 83,240 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/visitors.rs: as rustc_hir::intravisit::Visitor>::visit_expr'2 (23x) . } . . pub fn walk_ty_pat<'v, V: Visitor<'v>>(visitor: &mut V, pattern: &'v TyPat<'v>) -> V::Result { . let TyPat { kind, hir_id, span: _ } = pattern; . try_visit!(visitor.visit_id(*hir_id)); . match *kind { . TyPatKind::Range(lower_bound, upper_bound) => { . try_visit!(visitor.visit_const_arg_unambig(lower_bound)); -- line 723 ---------------------------------------- -- line 724 ---------------------------------------- . try_visit!(visitor.visit_const_arg_unambig(upper_bound)); . } . TyPatKind::Or(patterns) => walk_list!(visitor, visit_pattern_type_pattern, patterns), . TyPatKind::NotNull | TyPatKind::Err(_) => (), . } . V::Result::output() . } . 84,085 ( 0.00%) pub fn walk_pat<'v, V: Visitor<'v>>(visitor: &mut V, pattern: &'v Pat<'v>) -> V::Result { . let Pat { hir_id, kind, span, default_binding_modes: _ } = pattern; . try_visit!(visitor.visit_id(*hir_id)); 73,944 ( 0.00%) match *kind { 163 ( 0.00%) PatKind::TupleStruct(ref qpath, children, _) => { 54 ( 0.00%) try_visit!(visitor.visit_qpath(qpath, *hir_id, *span)); 342 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:::visit_qpath (10x) 230 ( 0.00%) walk_list!(visitor, visit_pat, children); . } 176 ( 0.00%) PatKind::Struct(ref qpath, fields, _) => { 48 ( 0.00%) try_visit!(visitor.visit_qpath(qpath, *hir_id, *span)); 528 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:::visit_qpath (16x) 127 ( 0.00%) walk_list!(visitor, visit_pat_field, fields); . } 3,659 ( 0.00%) PatKind::Or(pats) => walk_list!(visitor, visit_pat, pats), 144 ( 0.00%) PatKind::Tuple(tuple_elements, _) => { 864 ( 0.00%) walk_list!(visitor, visit_pat, tuple_elements); . } . PatKind::Box(ref subpattern) . | PatKind::Deref(ref subpattern) . | PatKind::Ref(ref subpattern, _, _) => { 17 ( 0.00%) try_visit!(visitor.visit_pat(subpattern)); . } . PatKind::Binding(_, _hir_id, ident, ref optional_subpattern) => { . try_visit!(visitor.visit_ident(ident)); 2,436 ( 0.00%) visit_opt!(visitor, visit_pat, optional_subpattern); . } 2,748 ( 0.00%) PatKind::Expr(ref expression) => try_visit!(visitor.visit_pat_expr(expression)), . PatKind::Range(ref lower_bound, ref upper_bound, _) => { 11,861 ( 0.00%) visit_opt!(visitor, visit_pat_expr, lower_bound); 11,853 ( 0.00%) visit_opt!(visitor, visit_pat_expr, upper_bound); . } . PatKind::Missing | PatKind::Never | PatKind::Wild | PatKind::Err(_) => (), . PatKind::Slice(prepatterns, ref slice_pattern, postpatterns) => { . walk_list!(visitor, visit_pat, prepatterns); . visit_opt!(visitor, visit_pat, slice_pattern); . walk_list!(visitor, visit_pat, postpatterns); . } . PatKind::Guard(subpat, condition) => { . try_visit!(visitor.visit_pat(subpat)); . try_visit!(visitor.visit_expr(condition)); . } . } . V::Result::output() 60,289 ( 0.00%) } . . pub fn walk_pat_field<'v, V: Visitor<'v>>(visitor: &mut V, field: &'v PatField<'v>) -> V::Result { . let PatField { hir_id, ident, pat, is_shorthand: _, span: _ } = field; . try_visit!(visitor.visit_id(*hir_id)); . try_visit!(visitor.visit_ident(*ident)); 56 ( 0.00%) visitor.visit_pat(*pat) . } . . pub fn walk_pat_expr<'v, V: Visitor<'v>>(visitor: &mut V, expr: &'v PatExpr<'v>) -> V::Result { . let PatExpr { hir_id, span, kind } = expr; 82 ( 0.00%) try_visit!(visitor.visit_id(*hir_id)); 23,926 ( 0.00%) match kind { . PatExprKind::Lit { lit, negated } => visitor.visit_lit(*hir_id, *lit, *negated), 509 ( 0.00%) PatExprKind::Path(qpath) => visitor.visit_qpath(qpath, *hir_id, *span), 1,134 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:::visit_qpath (30x) . } . } . . pub fn walk_anon_const<'v, V: Visitor<'v>>(visitor: &mut V, constant: &'v AnonConst) -> V::Result { . let AnonConst { hir_id, def_id: _, body, span: _ } = constant; . try_visit!(visitor.visit_id(*hir_id)); 6 ( 0.00%) visitor.visit_nested_body(*body) . } . . pub fn walk_inline_const<'v, V: Visitor<'v>>( . visitor: &mut V, . constant: &'v ConstBlock, . ) -> V::Result { . let ConstBlock { hir_id, def_id: _, body } = constant; . try_visit!(visitor.visit_id(*hir_id)); . visitor.visit_nested_body(*body) . } . 1,466,823 ( 0.07%) pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr<'v>) -> V::Result { . let Expr { hir_id, kind, span } = expression; 142,846 ( 0.01%) try_visit!(visitor.visit_id(*hir_id)); 676,772 ( 0.03%) match *kind { 34 ( 0.00%) ExprKind::Array(subexpressions) => { 215,999 ( 0.01%) walk_list!(visitor, visit_expr, subexpressions); 4,230,420 ( 0.20%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/macro_metavars_in_unsafe.rs:::visit_expr'2 (35,997x) . } . ExprKind::ConstBlock(ref const_block) => { . try_visit!(visitor.visit_inline_const(const_block)) 1 ( 0.00%) } . ExprKind::Repeat(ref element, ref count) => { . try_visit!(visitor.visit_expr(element)); . try_visit!(visitor.visit_const_arg_unambig(count)); . } 221 ( 0.00%) ExprKind::Struct(ref qpath, fields, ref optional_base) => { 307 ( 0.00%) try_visit!(visitor.visit_qpath(qpath, *hir_id, *span)); 792 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:::visit_qpath (24x) 272 ( 0.00%) walk_list!(visitor, visit_expr_field, fields); 356 ( 0.00%) match optional_base { . StructTailExpr::Base(base) => try_visit!(visitor.visit_expr(base)), . StructTailExpr::None . | StructTailExpr::NoneWithError(_) . | StructTailExpr::DefaultFields(_) => {} . } . } 29,659 ( 0.00%) ExprKind::Tup(subexpressions) => { 192,576 ( 0.01%) walk_list!(visitor, visit_expr, subexpressions); 787 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/visitors.rs:::check_expr::{closure#0}> as rustc_hir::intravisit::Visitor>::visit_expr'2 (1x) . } 2,332 ( 0.00%) ExprKind::Call(ref callee_expression, arguments) => { 3,479 ( 0.00%) try_visit!(visitor.visit_expr(callee_expression)); 32,233 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/visitors.rs: as rustc_hir::intravisit::Visitor>::visit_expr'2 (32x) 4,871 ( 0.00%) walk_list!(visitor, visit_expr, arguments); 62,481 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/visitors.rs: as rustc_hir::intravisit::Visitor>::visit_expr'2 (56x) . } 2,232 ( 0.00%) ExprKind::MethodCall(ref segment, receiver, arguments, _) => { 1,060 ( 0.00%) try_visit!(visitor.visit_path_segment(segment)); 5 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:::check_expr::{closure#0}> as rustc_hir::intravisit::Visitor>::visit_path_segment (1x) 2,202 ( 0.00%) try_visit!(visitor.visit_expr(receiver)); 360 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/visitors.rs: as rustc_hir::intravisit::Visitor>::visit_expr (5x) 803 ( 0.00%) walk_list!(visitor, visit_expr, arguments); 29,095 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/visitors.rs: as rustc_hir::intravisit::Visitor>::visit_expr'2 (8x) . } . ExprKind::Use(expr, _) => { . try_visit!(visitor.visit_expr(expr)); . } . ExprKind::Binary(_, ref left_expression, ref right_expression) => { 332 ( 0.00%) try_visit!(visitor.visit_expr(left_expression)); 64 ( 0.00%) try_visit!(visitor.visit_expr(right_expression)); . } . ExprKind::AddrOf(_, _, ref subexpression) | ExprKind::Unary(_, ref subexpression) => { 57 ( 0.00%) try_visit!(visitor.visit_expr(subexpression)); . } . ExprKind::Cast(ref subexpression, ref typ) | ExprKind::Type(ref subexpression, ref typ) => { 327 ( 0.00%) try_visit!(visitor.visit_expr(subexpression)); 3,882 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/macro_metavars_in_unsafe.rs:::visit_expr'2 (20x) 67 ( 0.00%) try_visit!(visitor.visit_ty_unambig(typ)); . } . ExprKind::DropTemps(ref subexpression) => { 16 ( 0.00%) try_visit!(visitor.visit_expr(subexpression)); . } 18 ( 0.00%) ExprKind::Let(LetExpr { span: _, pat, ty, init, recovered: _ }) => { . // match the visit order in walk_local 37 ( 0.00%) try_visit!(visitor.visit_expr(init)); 775 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/macro_metavars_in_unsafe.rs:::visit_expr'2 (3x) 17 ( 0.00%) try_visit!(visitor.visit_pat(pat)); 39 ( 0.00%) visit_opt!(visitor, visit_ty_unambig, ty); . } . ExprKind::If(ref cond, ref then, ref else_opt) => { 432 ( 0.00%) try_visit!(visitor.visit_expr(cond)); 7,058 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/visitors.rs: as rustc_hir::intravisit::Visitor>::visit_expr'2 (2x) 448 ( 0.00%) try_visit!(visitor.visit_expr(then)); 14,629 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/visitors.rs: as rustc_hir::intravisit::Visitor>::visit_expr (25x) 1,580 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/visitors.rs: as rustc_hir::intravisit::Visitor>::visit_expr'2 (4x) 333 ( 0.00%) visit_opt!(visitor, visit_expr, else_opt); . } . ExprKind::Loop(ref block, ref opt_label, _, _) => { . visit_opt!(visitor, visit_label, opt_label); 68 ( 0.00%) try_visit!(visitor.visit_block(block)); . } 554 ( 0.00%) ExprKind::Match(ref subexpression, arms, _) => { 807 ( 0.00%) try_visit!(visitor.visit_expr(subexpression)); 35,797 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/visitors.rs: as rustc_hir::intravisit::Visitor>::visit_expr'2 (9x) 10,938 ( 0.00%) walk_list!(visitor, visit_arm, arms); . } . ExprKind::Closure(&Closure { 63 ( 0.00%) def_id, . binder: _, 60 ( 0.00%) bound_generic_params, 53 ( 0.00%) fn_decl, 52 ( 0.00%) body, . capture_clause: _, . fn_decl_span: _, . fn_arg_span: _, . kind: _, . constness: _, . explicit_captures: _, . }) => { . walk_list!(visitor, visit_generic_param, bound_generic_params); 64 ( 0.00%) try_visit!(visitor.visit_fn(FnKind::Closure, fn_decl, body, *span, def_id)); 62 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:::visit_fn (2x) 8 ( 0.00%) } . ExprKind::Block(ref block, ref opt_label) => { . visit_opt!(visitor, visit_label, opt_label); 943 ( 0.00%) try_visit!(visitor.visit_block(block)); . } . ExprKind::Assign(ref lhs, ref rhs, _) => { 140 ( 0.00%) try_visit!(visitor.visit_expr(rhs)); 28 ( 0.00%) try_visit!(visitor.visit_expr(lhs)); . } . ExprKind::AssignOp(_, ref left_expression, ref right_expression) => { 10 ( 0.00%) try_visit!(visitor.visit_expr(right_expression)); 2 ( 0.00%) try_visit!(visitor.visit_expr(left_expression)); . } . ExprKind::Field(ref subexpression, ident) => { 197 ( 0.00%) try_visit!(visitor.visit_expr(subexpression)); . try_visit!(visitor.visit_ident(ident)); . } . ExprKind::Index(ref main_expression, ref index_expression, _) => { 65 ( 0.00%) try_visit!(visitor.visit_expr(main_expression)); 13 ( 0.00%) try_visit!(visitor.visit_expr(index_expression)); . } 6,485 ( 0.00%) ExprKind::Path(ref qpath) => { 39,560 ( 0.00%) try_visit!(visitor.visit_qpath(qpath, *hir_id, *span)); 264 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:::visit_qpath (8x) . } . ExprKind::Break(ref destination, ref opt_expr) => { . visit_opt!(visitor, visit_label, &destination.label); 144 ( 0.00%) visit_opt!(visitor, visit_expr, opt_expr); . } . ExprKind::Continue(ref destination) => { . visit_opt!(visitor, visit_label, &destination.label); . } . ExprKind::Ret(ref optional_expression) => { 299 ( 0.00%) visit_opt!(visitor, visit_expr, optional_expression); . } . ExprKind::Become(ref expr) => try_visit!(visitor.visit_expr(expr)), . ExprKind::InlineAsm(ref asm) => { . try_visit!(visitor.visit_inline_asm(asm, *hir_id)); . } . ExprKind::OffsetOf(ref container, ref fields) => { . try_visit!(visitor.visit_ty_unambig(container)); . walk_list!(visitor, visit_ident, fields.iter().copied()); -- line 934 ---------------------------------------- -- line 939 ---------------------------------------- . ExprKind::UnsafeBinderCast(_kind, expr, ty) => { . try_visit!(visitor.visit_expr(expr)); . visit_opt!(visitor, visit_ty_unambig, ty); . } . ExprKind::Lit(lit) => try_visit!(visitor.visit_lit(*hir_id, lit, false)), . ExprKind::Err(_) => {} . } . V::Result::output() 1,113,556 ( 0.05%) } . . pub fn walk_expr_field<'v, V: Visitor<'v>>(visitor: &mut V, field: &'v ExprField<'v>) -> V::Result { . let ExprField { hir_id, ident, expr, span: _, is_shorthand: _ } = field; . try_visit!(visitor.visit_id(*hir_id)); . try_visit!(visitor.visit_ident(*ident)); 630 ( 0.00%) visitor.visit_expr(*expr) 35,904 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/visitors.rs: as rustc_hir::intravisit::Visitor>::visit_expr'2 (22x) . } . . pub fn walk_const_arg_expr_field<'v, V: Visitor<'v>>( . visitor: &mut V, . field: &'v ConstArgExprField<'v>, . ) -> V::Result { . let ConstArgExprField { hir_id, field, expr, span: _ } = field; . try_visit!(visitor.visit_id(*hir_id)); -- line 961 ---------------------------------------- -- line 966 ---------------------------------------- . /// We track whether an infer var is from a [`Ty`], [`ConstArg`], or [`GenericArg`] so that . /// HIR visitors overriding [`Visitor::visit_infer`] can determine what kind of infer is being visited . pub enum InferKind<'hir> { . Ty(&'hir Ty<'hir>), . Const(&'hir ConstArg<'hir>), . Ambig(&'hir InferArg), . } . 497 ( 0.00%) pub fn walk_generic_arg<'v, V: Visitor<'v>>( . visitor: &mut V, . generic_arg: &'v GenericArg<'v>, . ) -> V::Result { 1,990 ( 0.00%) match generic_arg { 28 ( 0.00%) GenericArg::Lifetime(lt) => visitor.visit_lifetime(lt), 464 ( 0.00%) GenericArg::Type(ty) => visitor.visit_ty(ty), 1,260 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/lifetimes.rs:::visit_ty (10x) . GenericArg::Const(ct) => visitor.visit_const_arg(ct), . GenericArg::Infer(inf) => { . let InferArg { hir_id, span } = inf; . visitor.visit_infer(*hir_id, *span, InferKind::Ambig(inf)) . } . } 80 ( 0.00%) } . . pub fn walk_unambig_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty<'v>) -> V::Result { . match typ.try_as_ambig_ty() { 1,209 ( 0.00%) Some(ambig_ty) => visitor.visit_ty(ambig_ty), 25,225 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/types/type_complexity.rs:::visit_ty (188x) . None => { . let Ty { hir_id, span, kind: _ } = typ; . visitor.visit_infer(*hir_id, *span, InferKind::Ty(typ)) . } . } . } . 16,724 ( 0.00%) pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty<'v, AmbigArg>) -> V::Result { . let Ty { hir_id, span: _, kind } = typ; . try_visit!(visitor.visit_id(*hir_id)); . 8,234 ( 0.00%) match *kind { 3 ( 0.00%) TyKind::Slice(ref ty) => try_visit!(visitor.visit_ty_unambig(ty)), . TyKind::Ptr(ref mutable_type) => try_visit!(visitor.visit_ty_unambig(mutable_type.ty)), . TyKind::Ref(ref lifetime, ref mutable_type) => { 64 ( 0.00%) try_visit!(visitor.visit_lifetime(lifetime)); 136 ( 0.00%) try_visit!(visitor.visit_ty_unambig(mutable_type.ty)); . } . TyKind::Never => {} 93 ( 0.00%) TyKind::Tup(tuple_element_types) => { 119 ( 0.00%) walk_list!(visitor, visit_ty_unambig, tuple_element_types); . } . TyKind::FnPtr(ref function_declaration) => { . walk_list!(visitor, visit_generic_param, function_declaration.generic_params); . try_visit!(visitor.visit_fn_decl(function_declaration.decl)); . } . TyKind::UnsafeBinder(ref unsafe_binder) => { . walk_list!(visitor, visit_generic_param, unsafe_binder.generic_params); . try_visit!(visitor.visit_ty_unambig(unsafe_binder.inner_ty)); . } 571 ( 0.00%) TyKind::Path(ref qpath) => { . try_visit!(visitor.visit_qpath(qpath, typ.hir_id, typ.span)); . } . TyKind::OpaqueDef(opaque) => { . try_visit!(visitor.visit_opaque_ty(opaque)); . } . TyKind::TraitAscription(bounds) => { . walk_list!(visitor, visit_param_bound, bounds); . } . TyKind::Array(ref ty, ref length) => { 9 ( 0.00%) try_visit!(visitor.visit_ty_unambig(ty)); 7 ( 0.00%) try_visit!(visitor.visit_const_arg_unambig(length)); . } . TyKind::TraitObject(bounds, ref lifetime) => { . for bound in bounds { . try_visit!(visitor.visit_poly_trait_ref(bound)); . } . try_visit!(visitor.visit_lifetime(lifetime)); . } . TyKind::InferDelegation(..) | TyKind::Err(_) => {} -- line 1041 ---------------------------------------- -- line 1051 ---------------------------------------- . TyKind::View(ty, fields) => { . try_visit!(visitor.visit_ty_unambig(ty)); . for field in fields { . try_visit!(visitor.visit_ident(*field)); . } . } . } . V::Result::output() 7,784 ( 0.00%) } . . pub fn walk_const_item_rhs<'v, V: Visitor<'v>>( . visitor: &mut V, . ct_rhs: ConstItemRhs<'v>, . ) -> V::Result { . match ct_rhs { . ConstItemRhs::Body(body_id) => visitor.visit_nested_body(body_id), . ConstItemRhs::TypeConst(const_arg) => visitor.visit_const_arg_unambig(const_arg), -- line 1067 ---------------------------------------- -- line 1076 ---------------------------------------- . Some(ambig_ct) => visitor.visit_const_arg(ambig_ct), . None => { . let ConstArg { hir_id, kind: _, span } = const_arg; . visitor.visit_infer(*hir_id, *span, InferKind::Const(const_arg)) . } . } . } . 55 ( 0.00%) pub fn walk_const_arg<'v, V: Visitor<'v>>( . visitor: &mut V, . const_arg: &'v ConstArg<'v, AmbigArg>, . ) -> V::Result { . let ConstArg { hir_id, kind, span: _ } = const_arg; . try_visit!(visitor.visit_id(*hir_id)); 35 ( 0.00%) match kind { . ConstArgKind::Tup(exprs) => { . walk_list!(visitor, visit_const_arg_unambig, *exprs); . V::Result::output() . } . ConstArgKind::Struct(qpath, field_exprs) => { . try_visit!(visitor.visit_qpath(qpath, *hir_id, qpath.span())); . . for field_expr in *field_exprs { -- line 1098 ---------------------------------------- -- line 1110 ---------------------------------------- . } . ConstArgKind::Array(array_expr) => { . for arg in array_expr.elems { . try_visit!(visitor.visit_const_arg_unambig(*arg)); . } . V::Result::output() . } . ConstArgKind::Path(qpath) => visitor.visit_qpath(qpath, *hir_id, qpath.span()), 5 ( 0.00%) ConstArgKind::Anon(anon) => visitor.visit_anon_const(*anon), . ConstArgKind::Error(_) => V::Result::output(), // errors and spans are not important . ConstArgKind::Literal { .. } => V::Result::output(), // FIXME(mcga) . } 51 ( 0.00%) } . . pub fn walk_generic_param<'v, V: Visitor<'v>>( . visitor: &mut V, . param: &'v GenericParam<'v>, . ) -> V::Result { . let GenericParam { . hir_id, . def_id: _, -- line 1130 ---------------------------------------- -- line 1135 ---------------------------------------- . colon_span: _, . source: _, . } = param; . try_visit!(visitor.visit_id(*hir_id)); . match *name { . ParamName::Plain(ident) | ParamName::Error(ident) => try_visit!(visitor.visit_ident(ident)), . ParamName::Fresh => {} . } 683 ( 0.00%) match *kind { . GenericParamKind::Lifetime { .. } => {} . GenericParamKind::Type { ref default, .. } => { 273 ( 0.00%) visit_opt!(visitor, visit_ty_unambig, default) . } . GenericParamKind::Const { ref ty, ref default } => { . try_visit!(visitor.visit_ty_unambig(ty)); . if let Some(default) = default { . try_visit!(visitor.visit_const_param_default(*hir_id, default)); . } . } . } -- line 1154 ---------------------------------------- -- line 1157 ---------------------------------------- . . pub fn walk_const_param_default<'v, V: Visitor<'v>>( . visitor: &mut V, . ct: &'v ConstArg<'v>, . ) -> V::Result { . visitor.visit_const_arg_unambig(ct) . } . 1,231 ( 0.00%) pub fn walk_generics<'v, V: Visitor<'v>>(visitor: &mut V, generics: &'v Generics<'v>) -> V::Result { . let &Generics { 178 ( 0.00%) params, 356 ( 0.00%) predicates, . has_where_clause_predicates: _, . where_clause_span: _, . span: _, . } = generics; . walk_list!(visitor, visit_generic_param, params); 100 ( 0.00%) walk_list!(visitor, visit_where_predicate, predicates); 4,304 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/extra_unused_type_parameters.rs:::visit_where_predicate (9x) . V::Result::output() 1,104 ( 0.00%) } . 108 ( 0.00%) pub fn walk_where_predicate<'v, V: Visitor<'v>>( . visitor: &mut V, . predicate: &'v WherePredicate<'v>, . ) -> V::Result { 18 ( 0.00%) let &WherePredicate { hir_id, kind, span: _ } = predicate; . try_visit!(visitor.visit_id(hir_id)); 36 ( 0.00%) match *kind { . WherePredicateKind::BoundPredicate(WhereBoundPredicate { . ref bounded_ty, 36 ( 0.00%) bounds, 18 ( 0.00%) bound_generic_params, . origin: _, . }) => { 18 ( 0.00%) try_visit!(visitor.visit_ty_unambig(bounded_ty)); 36 ( 0.00%) walk_list!(visitor, visit_param_bound, bounds); 3,743 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:::visit_param_bound (18x) . walk_list!(visitor, visit_generic_param, bound_generic_params); . } . WherePredicateKind::RegionPredicate(WhereRegionPredicate { . ref lifetime, . bounds, . in_where_clause: _, . }) => { . try_visit!(visitor.visit_lifetime(lifetime)); . walk_list!(visitor, visit_param_bound, bounds); . } . } . V::Result::output() 108 ( 0.00%) } . 99 ( 0.00%) pub fn walk_fn_decl<'v, V: Visitor<'v>>( . visitor: &mut V, . function_declaration: &'v FnDecl<'v>, . ) -> V::Result { . let FnDecl { inputs, output, fn_decl_kind: _ } = function_declaration; 236 ( 0.00%) walk_list!(visitor, visit_ty_unambig, *inputs); . visitor.visit_fn_ret_ty(output) 56 ( 0.00%) } . . pub fn walk_fn_ret_ty<'v, V: Visitor<'v>>(visitor: &mut V, ret_ty: &'v FnRetTy<'v>) -> V::Result { 636 ( 0.00%) if let FnRetTy::Return(output_ty) = *ret_ty { . try_visit!(visitor.visit_ty_unambig(output_ty)); . } . V::Result::output() . } . 1,806 ( 0.00%) pub fn walk_fn<'v, V: Visitor<'v>>( . visitor: &mut V, . function_kind: FnKind<'v>, . function_declaration: &'v FnDecl<'v>, . body_id: BodyId, . _: LocalDefId, . ) -> V::Result { . try_visit!(visitor.visit_fn_decl(function_declaration)); 47 ( 0.00%) try_visit!(walk_fn_kind(visitor, function_kind)); . visitor.visit_nested_body(body_id) 1,208 ( 0.00%) } . . pub fn walk_fn_kind<'v, V: Visitor<'v>>(visitor: &mut V, function_kind: FnKind<'v>) -> V::Result { 308 ( 0.00%) match function_kind { . FnKind::ItemFn(_, generics, ..) => { . try_visit!(visitor.visit_generics(generics)); . } . FnKind::Closure | FnKind::Method(..) => {} . } . V::Result::output() . } . . pub fn walk_use<'v, V: Visitor<'v>>( . visitor: &mut V, . path: &'v UsePath<'v>, . hir_id: HirId, . ) -> V::Result { 2 ( 0.00%) let UsePath { segments, ref res, span } = *path; 27 ( 0.00%) for res in res.present_items() { . try_visit!(visitor.visit_path(&Path { segments, res, span }, hir_id)); . } . V::Result::output() . } . . pub fn walk_trait_item<'v, V: Visitor<'v>>( . visitor: &mut V, . trait_item: &'v TraitItem<'v>, -- line 1259 ---------------------------------------- -- line 1291 ---------------------------------------- . } . V::Result::output() . } . . pub fn walk_trait_item_ref<'v, V: Visitor<'v>>(visitor: &mut V, id: TraitItemId) -> V::Result { . visitor.visit_nested_trait_item(id) . } . 396 ( 0.00%) pub fn walk_impl_item<'v, V: Visitor<'v>>( . visitor: &mut V, . impl_item: &'v ImplItem<'v>, . ) -> V::Result { . let ImplItem { owner_id: _, ident, ref generics, ref impl_kind, ref kind, span: _ } = . *impl_item; . . try_visit!(visitor.visit_ident(ident)); 44 ( 0.00%) try_visit!(visitor.visit_generics(generics)); . try_visit!(visitor.visit_id(impl_item.hir_id())); . match impl_kind { . ImplItemImplKind::Inherent { vis_span: _ } => {} . ImplItemImplKind::Trait { defaultness, trait_item_def_id: _ } => { . try_visit!(visitor.visit_defaultness(defaultness)); . } . } 352 ( 0.00%) match *kind { . ImplItemKind::Const(ref ty, rhs) => { . try_visit!(visitor.visit_ty_unambig(ty)); . visitor.visit_const_item_rhs(rhs) . } 80 ( 0.00%) ImplItemKind::Fn(ref sig, body_id) => visitor.visit_fn( 216 ( 0.00%) FnKind::Method(impl_item.ident, sig), 40 ( 0.00%) sig.decl, . body_id, . impl_item.span, . impl_item.owner_id.def_id, 36 ( 0.00%) ), 4 ( 0.00%) ImplItemKind::Type(ref ty) => visitor.visit_ty_unambig(ty), . } 320 ( 0.00%) } . . pub fn walk_foreign_item_ref<'v, V: Visitor<'v>>(visitor: &mut V, id: ForeignItemId) -> V::Result { . visitor.visit_nested_foreign_item(id) . } . . pub fn walk_impl_item_ref<'v, V: Visitor<'v>>(visitor: &mut V, id: ImplItemId) -> V::Result { . visitor.visit_nested_impl_item(id) . } . . pub fn walk_trait_ref<'v, V: Visitor<'v>>( . visitor: &mut V, . trait_ref: &'v TraitRef<'v>, . ) -> V::Result { . let TraitRef { hir_ref_id, path } = trait_ref; . try_visit!(visitor.visit_id(*hir_ref_id)); 146 ( 0.00%) visitor.visit_path(*path, *hir_ref_id) . } . 415 ( 0.00%) pub fn walk_param_bound<'v, V: Visitor<'v>>( . visitor: &mut V, . bound: &'v GenericBound<'v>, . ) -> V::Result { 548 ( 0.00%) match *bound { 144 ( 0.00%) GenericBound::Trait(ref typ) => visitor.visit_poly_trait_ref(typ), 8,254 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/lifetimes.rs:::visit_poly_trait_ref (18x) . GenericBound::Outlives(ref lifetime) => visitor.visit_lifetime(lifetime), . GenericBound::Use(args, _) => { . walk_list!(visitor, visit_precise_capturing_arg, args); . V::Result::output() . } . } 312 ( 0.00%) } . . pub fn walk_precise_capturing_arg<'v, V: Visitor<'v>>( . visitor: &mut V, . arg: &'v PreciseCapturingArg<'v>, . ) -> V::Result { . match *arg { . PreciseCapturingArg::Lifetime(lt) => visitor.visit_lifetime(lt), . PreciseCapturingArg::Param(param) => { . let PreciseCapturingNonLifetimeArg { hir_id, ident, res: _ } = param; . try_visit!(visitor.visit_id(hir_id)); . visitor.visit_ident(ident) . } . } . } . 81 ( 0.00%) pub fn walk_poly_trait_ref<'v, V: Visitor<'v>>( . visitor: &mut V, . trait_ref: &'v PolyTraitRef<'v>, . ) -> V::Result { . let PolyTraitRef { bound_generic_params, modifiers: _, trait_ref, span: _ } = trait_ref; 82 ( 0.00%) walk_list!(visitor, visit_generic_param, *bound_generic_params); . visitor.visit_trait_ref(trait_ref) 72 ( 0.00%) } . . pub fn walk_opaque_ty<'v, V: Visitor<'v>>(visitor: &mut V, opaque: &'v OpaqueTy<'v>) -> V::Result { . let &OpaqueTy { hir_id, def_id: _, bounds, origin: _, span: _ } = opaque; . try_visit!(visitor.visit_id(hir_id)); . walk_list!(visitor, visit_param_bound, bounds); . V::Result::output() . } . -- line 1391 ---------------------------------------- -- line 1450 ---------------------------------------- . } . . pub fn walk_lifetime<'v, V: Visitor<'v>>(visitor: &mut V, lifetime: &'v Lifetime) -> V::Result { . let Lifetime { hir_id, ident, kind: _, source: _, syntax: _ } = lifetime; . try_visit!(visitor.visit_id(*hir_id)); . visitor.visit_ident(*ident) . } . 47,241 ( 0.00%) pub fn walk_qpath<'v, V: Visitor<'v>>( . visitor: &mut V, . qpath: &'v QPath<'v>, . id: HirId, . ) -> V::Result { 17,337 ( 0.00%) match *qpath { . QPath::Resolved(ref maybe_qself, ref path) => { 17,038 ( 0.00%) visit_opt!(visitor, visit_ty_unambig, maybe_qself); 8,519 ( 0.00%) visitor.visit_path(path, id) . } . QPath::TypeRelative(ref qself, ref segment) => { 46 ( 0.00%) try_visit!(visitor.visit_ty_unambig(qself)); 94 ( 0.00%) visitor.visit_path_segment(segment) . } . } 41,992 ( 0.00%) } . 85 ( 0.00%) pub fn walk_path<'v, V: Visitor<'v>>(visitor: &mut V, path: &Path<'v>) -> V::Result { . let Path { segments, span: _, res: _ } = path; 8,705 ( 0.00%) walk_list!(visitor, visit_path_segment, *segments); 3,167 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:::visit_path_segment (18x) . V::Result::output() 383 ( 0.00%) } . . pub fn walk_path_segment<'v, V: Visitor<'v>>( . visitor: &mut V, . segment: &'v PathSegment<'v>, . ) -> V::Result { . let PathSegment { ident, hir_id, res: _, args, infer_args: _, delegation_child_segment: _ } = . segment; . try_visit!(visitor.visit_ident(*ident)); . try_visit!(visitor.visit_id(*hir_id)); 29,760 ( 0.00%) visit_opt!(visitor, visit_generic_args, *args); 602 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/lifetimes.rs: as rustc_hir::intravisit::Visitor>::visit_generic_args (3x) . V::Result::output() 303 ( 0.00%) } . 54 ( 0.00%) pub fn walk_generic_args<'v, V: Visitor<'v>>( . visitor: &mut V, . generic_args: &'v GenericArgs<'v>, . ) -> V::Result { . let GenericArgs { args, constraints, parenthesized: _, span_ext: _ } = generic_args; 605 ( 0.00%) walk_list!(visitor, visit_generic_arg, *args); 4,956 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs: as rustc_hir::intravisit::Visitor>::visit_generic_arg (45x) 545 ( 0.00%) walk_list!(visitor, visit_assoc_item_constraint, *constraints); 1,374 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:::visit_assoc_item_constraint (10x) . V::Result::output() 48 ( 0.00%) } . 248 ( 0.00%) pub fn walk_assoc_item_constraint<'v, V: Visitor<'v>>( . visitor: &mut V, . constraint: &'v AssocItemConstraint<'v>, . ) -> V::Result { . let AssocItemConstraint { hir_id, ident, gen_args, kind: _, span: _ } = constraint; . try_visit!(visitor.visit_id(*hir_id)); . try_visit!(visitor.visit_ident(*ident)); 219 ( 0.00%) try_visit!(visitor.visit_generic_args(*gen_args)); 672 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/lifetimes.rs: as rustc_hir::intravisit::Visitor>::visit_generic_args'2 (32x) 241 ( 0.00%) match constraint.kind { 226 ( 0.00%) AssocItemConstraintKind::Equality { ref term } => match term { . Term::Ty(ty) => try_visit!(visitor.visit_ty_unambig(ty)), . Term::Const(c) => try_visit!(visitor.visit_const_arg_unambig(c)), . }, . AssocItemConstraintKind::Bound { bounds } => { . walk_list!(visitor, visit_param_bound, bounds) . } . } . V::Result::output() -- line 1520 ---------------------------------------- 171,111 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/unused_rounding.rs -------------------------------------------------------------------------------- Ir -- line 29 ---------------------------------------- . pub UNUSED_ROUNDING, . nursery, . "Uselessly rounding a whole number floating-point literal" . } . . declare_lint_pass!(UnusedRounding => [UNUSED_ROUNDING]); . . fn is_useless_rounding(cx: &EarlyContext<'_>, expr: &Expr) -> Option<(Symbol, String)> { 144,058 ( 0.01%) if let ExprKind::MethodCall(MethodCall { . seg: name_ident, . receiver, . .. . }) = &expr.kind 110 ( 0.00%) && let method_name = name_ident.ident.name 660 ( 0.00%) && matches!(method_name, sym::ceil | sym::floor | sym::round) . && let ExprKind::Lit(token_lit) = &receiver.kind . && token_lit.is_semantic_float() . && let Ok(f) = token_lit.symbol.as_str().replace('_', "").parse::() . && f.fract() == 0.0 . { . Some((method_name, snippet(cx, receiver.span, "..").into())) . } else { . None . } . } . . impl EarlyLintPass for UnusedRounding { 504,203 ( 0.02%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 110 ( 0.00%) if let Some((method_name, float)) = is_useless_rounding(cx, expr) { . span_lint_and_sugg( . cx, . UNUSED_ROUNDING, . expr.span, . format!("used the `{method_name}` method with a whole number float"), . format!("remove the `{method_name}` method call"), . float, . Applicability::MachineApplicable, . ); . } 576,232 ( 0.03%) } . } 110 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/bit_width.rs -------------------------------------------------------------------------------- Ir -- line 93 ---------------------------------------- . . impl ManualBitWidth { . pub fn new(conf: &Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl LateLintPass<'_> for ManualBitWidth { 687,420 ( 0.03%) fn check_expr<'tcx>(&mut self, cx: &LateContext<'tcx>, expr: &Expr<'tcx>) { 206,226 ( 0.01%) if expr.span.in_external_macro(cx.sess().source_map()) { . return; . } . 137,340 ( 0.01%) match expr.kind { . // `T::BITS - n.leading_zeros()` . ExprKind::Binary(op, left, right) . if op.node == BinOpKind::Sub 33 ( 0.00%) && let ExprKind::MethodCall(leading_zeros, recv, [], _) = right.kind . && leading_zeros.ident.name == sym::leading_zeros . && let ExprKind::Path(QPath::TypeRelative(hir_ty, segment)) = left.kind . && segment.ident.name == sym::BITS . && let right_ty = cx.typeck_results().expr_ty(recv) . && let Some(right_int_kind) = get_int_kind(cx, right_ty) . && let left_ty = cx.typeck_results().node_type(hir_ty.hir_id) . && let Some(left_int_kind) = get_int_kind(cx, left_ty) . && self.msrv.meets(cx, msrvs::BIT_WIDTH) -- line 118 ---------------------------------------- -- line 124 ---------------------------------------- . emit_manual_bit_width(cx, recv, expr, right_int_kind); . } else { . // mismatched calling types . emit_type_mismatch(cx, recv, expr, right_int_kind); . } . }, . _ => {}, . } 549,936 ( 0.03%) } . } . . fn get_int_kind<'a>(cx: &LateContext<'a>, ty: Ty<'a>) -> Option> { . match ty.kind() { . // int::BITS or uint::BITS . ty::Int(int_ty) => Some(IntKind::Int(*int_ty)), . ty::Uint(uint_ty) => Some(IntKind::Uint(*uint_ty)), . // NonZero::::BITS -- line 140 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs -------------------------------------------------------------------------------- Ir -- line 584 ---------------------------------------- . use crate::num::NonZero; . use crate::ops::{self, ControlFlow, Deref, DerefMut, Residual, Try}; . use crate::panicking::{panic, panic_display}; . use crate::pin::Pin; . use crate::{cmp, convert, hint, mem, slice}; . . /// The `Option` type. See [the module level documentation](self) for more. . #[doc(search_unbox)] 381 ( 0.00%) #[derive(Copy, Debug, Hash)] 144 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::hash:: (4x) . #[derive_const(Eq)] . #[rustc_diagnostic_item = "Option"] . #[lang = "Option"] . #[stable(feature = "rust1", since = "1.0.0")] . #[allow(clippy::derived_hash_with_manual_eq)] // PartialEq is manually implemented equivalently . pub enum Option { . /// No value. . #[lang = "None"] -- line 600 ---------------------------------------- -- line 626 ---------------------------------------- . /// let x: Option = None; . /// assert_eq!(x.is_some(), false); . /// ``` . #[must_use = "if you intended to assert that this has a value, consider `.unwrap()` instead"] . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_option_basics", since = "1.48.0")] . pub const fn is_some(&self) -> bool { 423,739 ( 0.02%) matches!(*self, Some(_)) . } . . /// Returns `true` if the option is a [`Some`] and the value inside of it matches a predicate. . /// . /// # Examples . /// . /// ``` . /// let x: Option = Some(2); -- line 642 ---------------------------------------- -- line 652 ---------------------------------------- . /// assert_eq!(x.as_ref().is_some_and(|x| x.len() > 1), true); . /// println!("still alive {:?}", x); . /// ``` . #[must_use] . #[inline] . #[stable(feature = "is_some_and", since = "1.70.0")] . #[rustc_const_unstable(feature = "const_option_ops", issue = "143956")] . pub const fn is_some_and(self, f: impl [const] FnOnce(T) -> bool + [const] Destruct) -> bool { 140,549 ( 0.01%) match self { . None => false, 1,476 ( 0.00%) Some(x) => f(x), 429 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/only_used_in_recursion.rs:::check_expr::{closure#0} (39x) . } . } . . /// Returns `true` if the option is a [`None`] value. . /// . /// # Examples . /// . /// ``` -- line 670 ---------------------------------------- -- line 701 ---------------------------------------- . /// assert_eq!(x.as_ref().is_none_or(|x| x.len() > 1), true); . /// println!("still alive {:?}", x); . /// ``` . #[must_use] . #[inline] . #[stable(feature = "is_none_or", since = "1.82.0")] . #[rustc_const_unstable(feature = "const_option_ops", issue = "143956")] . pub const fn is_none_or(self, f: impl [const] FnOnce(T) -> bool + [const] Destruct) -> bool { 280,976 ( 0.01%) match self { . None => true, . Some(x) => f(x), . } . } . . ///////////////////////////////////////////////////////////////////////// . // Adapter for working with references . ///////////////////////////////////////////////////////////////////////// -- line 717 ---------------------------------------- -- line 735 ---------------------------------------- . /// // then consume *that* with `map`, leaving `text` on the stack. . /// let text_length: Option = text.as_ref().map(|s| s.len()); . /// println!("still can print text: {text:?}"); . /// ``` . #[inline] . #[rustc_const_stable(feature = "const_option_basics", since = "1.48.0")] . #[stable(feature = "rust1", since = "1.0.0")] . pub const fn as_ref(&self) -> Option<&T> { 288,767 ( 0.01%) match *self { . Some(ref x) => Some(x), . None => None, . } . } . . /// Converts from `&mut Option` to `Option<&mut T>`. . /// . /// # Examples -- line 751 ---------------------------------------- -- line 757 ---------------------------------------- . /// None => {}, . /// } . /// assert_eq!(x, Some(42)); . /// ``` . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_option", since = "1.83.0")] . pub const fn as_mut(&mut self) -> Option<&mut T> { 6,778 ( 0.00%) match *self { . Some(ref mut x) => Some(x), . None => None, . } . } . . /// Converts from [Pin]<[&]Option\> to Option<[Pin]<[&]T>>. . /// . /// [&]: reference "shared reference" -- line 773 ---------------------------------------- -- line 802 ---------------------------------------- . None => None, . } . } . } . . #[inline] . const fn len(&self) -> usize { . // Using the intrinsic avoids emitting a branch to get the 0 or 1. 151 ( 0.00%) let discriminant: isize = crate::intrinsics::discriminant_value(self); . discriminant as usize . } . . /// Returns a slice of the contained value, if any. If this is `None`, an . /// empty slice is returned. This can be useful to have a single type of . /// iterator over an `Option` or slice. . /// . /// Note: Should you have an `Option<&T>` and wish to get a slice of `T`, -- line 818 ---------------------------------------- -- line 959 ---------------------------------------- . /// Styles"](../../std/error/index.html#common-message-styles) in the [`std::error`](../../std/error/index.html) module docs. . #[inline] . #[track_caller] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_diagnostic_item = "option_expect"] . #[rustc_allow_const_fn_unstable(const_precise_live_drops)] . #[rustc_const_stable(feature = "const_option", since = "1.83.0")] . pub const fn expect(self, msg: &str) -> T { 500,517 ( 0.02%) match self { 77,422 ( 0.00%) Some(val) => val, . None => expect_failed(msg), . } . } . . /// Returns the contained [`Some`] value, consuming the `self` value. . /// . /// Because this function may panic, its use is generally discouraged. . /// Panics are meant for unrecoverable errors, and -- line 976 ---------------------------------------- -- line 1004 ---------------------------------------- . /// ``` . #[inline(always)] . #[track_caller] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_diagnostic_item = "option_unwrap"] . #[rustc_allow_const_fn_unstable(const_precise_live_drops)] . #[rustc_const_stable(feature = "const_option", since = "1.83.0")] . pub const fn unwrap(self) -> T { 808 ( 0.00%) match self { 639 ( 0.00%) Some(val) => val, . None => unwrap_failed(), . } . } . . /// Returns the contained [`Some`] value or a provided default. . /// . /// Arguments passed to `unwrap_or` are eagerly evaluated; if you are passing . /// the result of a function call, it is recommended to use [`unwrap_or_else`], -- line 1021 ---------------------------------------- -- line 1032 ---------------------------------------- . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_allow_const_fn_unstable(const_precise_live_drops)] . #[rustc_const_unstable(feature = "const_option_ops", issue = "143956")] . pub const fn unwrap_or(self, default: T) -> T . where . T: [const] Destruct, . { 19,572 ( 0.00%) match self { 202 ( 0.00%) Some(x) => x, . None => default, . } . } . . /// Returns the contained [`Some`] value or computes it from a closure. . /// . /// # Examples . /// -- line 1049 ---------------------------------------- -- line 1055 ---------------------------------------- . #[inline] . #[track_caller] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_option_ops", issue = "143956")] . pub const fn unwrap_or_else(self, f: F) -> T . where . F: [const] FnOnce() -> T + [const] Destruct, . { 151 ( 0.00%) match self { 378 ( 0.00%) Some(x) => x, . None => f(), . } . } . . /// Returns the contained [`Some`] value or a default. . /// . /// Consumes the `self` argument then, if [`Some`], returns the contained . /// value, otherwise if [`None`], returns the [default value] for that -- line 1072 ---------------------------------------- -- line 1087 ---------------------------------------- . /// [`FromStr`]: crate::str::FromStr . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_option_ops", issue = "143956")] . pub const fn unwrap_or_default(self) -> T . where . T: [const] Default, . { 492 ( 0.00%) match self { 675 ( 0.00%) Some(x) => x, . None => T::default(), . } . } . . /// Returns the contained [`Some`] value, consuming the `self` value, . /// without checking that the value is not [`None`]. . /// . /// # Safety -- line 1104 ---------------------------------------- -- line 1154 ---------------------------------------- . /// ``` . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_option_ops", issue = "143956")] . pub const fn map(self, f: F) -> Option . where . F: [const] FnOnce(T) -> U + [const] Destruct, . { 158,459 ( 0.01%) match self { 24,092 ( 0.00%) Some(x) => Some(f(x)), 37 ( 0.00%) None => None, . } . } . . /// Calls a function with a reference to the contained value if [`Some`]. . /// . /// Returns the original option. . /// . /// # Examples -- line 1172 ---------------------------------------- -- line 1219 ---------------------------------------- . #[stable(feature = "rust1", since = "1.0.0")] . #[must_use = "if you don't need the returned value, use `if let` instead"] . #[rustc_const_unstable(feature = "const_option_ops", issue = "143956")] . pub const fn map_or(self, default: U, f: F) -> U . where . F: [const] FnOnce(T) -> U + [const] Destruct, . U: [const] Destruct, . { 1,533 ( 0.00%) match self { 164 ( 0.00%) Some(t) => f(t), 120 ( 0.00%) None => default, . } 190,404 ( 0.01%) } 72 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:core::ptr::drop_glue:: (12x) . . /// Computes a default function result (if none), or . /// applies a different function to the contained value (if any). . /// . /// # Basic examples . /// . /// ``` . /// let k = 21; -- line 1239 ---------------------------------------- -- line 1266 ---------------------------------------- . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_option_ops", issue = "143956")] . pub const fn map_or_else(self, default: D, f: F) -> U . where . D: [const] FnOnce() -> U + [const] Destruct, . F: [const] FnOnce(T) -> U + [const] Destruct, . { 24,761 ( 0.00%) match self { 3 ( 0.00%) Some(t) => f(t), . None => default(), . } 29 ( 0.00%) } . . /// Maps an `Option` to a `U` by applying function `f` to the contained . /// value if the option is [`Some`], otherwise if [`None`], returns the . /// [default value] for the type `U`. . /// . /// # Examples . /// . /// ``` -- line 1286 ---------------------------------------- -- line 1533 ---------------------------------------- . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_confusables("flat_map", "flatmap")] . #[rustc_const_unstable(feature = "const_option_ops", issue = "143956")] . pub const fn and_then(self, f: F) -> Option . where . F: [const] FnOnce(T) -> Option + [const] Destruct, . { 96,335 ( 0.00%) match self { 477,397 ( 0.02%) Some(x) => f(x), 325 ( 0.00%) None => None, . } . } . . /// Returns [`None`] if the option is [`None`], otherwise calls `predicate` . /// with the wrapped value and returns: . /// . /// - [`Some(t)`] if `predicate` returns `true` (where `t` is the wrapped . /// value), and -- line 1551 ---------------------------------------- -- line 1571 ---------------------------------------- . #[inline] . #[stable(feature = "option_filter", since = "1.27.0")] . #[rustc_const_unstable(feature = "const_option_ops", issue = "143956")] . pub const fn filter

(self, predicate: P) -> Self . where . P: [const] FnOnce(&T) -> bool + [const] Destruct, . T: [const] Destruct, . { 206,738 ( 0.01%) if let Some(x) = self { 303 ( 0.00%) if predicate(&x) { 10 ( 0.00%) return Some(x); . } . } 68,790 ( 0.00%) None 5 ( 0.00%) } . . /// Returns the option if it contains a value, otherwise returns `optb`. . /// . /// Arguments passed to `or` are eagerly evaluated; if you are passing the . /// result of a function call, it is recommended to use [`or_else`], which is . /// lazily evaluated. . /// . /// [`or_else`]: Option::or_else -- line 1593 ---------------------------------------- -- line 1613 ---------------------------------------- . /// ``` . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_option_ops", issue = "143956")] . pub const fn or(self, optb: Option) -> Option . where . T: [const] Destruct, . { 56 ( 0.00%) match self { . x @ Some(_) => x, . None => optb, . } . } . . /// Returns the option if it contains a value, otherwise calls `f` and . /// returns the result. . /// -- line 1629 ---------------------------------------- -- line 1642 ---------------------------------------- . #[rustc_const_unstable(feature = "const_option_ops", issue = "143956")] . pub const fn or_else(self, f: F) -> Option . where . F: [const] FnOnce() -> Option + [const] Destruct, . //FIXME(const_hack): this `T: [const] Destruct` is unnecessary, but even precise live drops can't tell . // no value of type `T` gets dropped here . T: [const] Destruct, . { 578 ( 0.00%) match self { . x @ Some(_) => x, . None => f(), . } . } . . /// Returns [`Some`] if exactly one of `self`, `optb` is [`Some`], otherwise returns [`None`]. . /// . /// # Examples -- line 1658 ---------------------------------------- -- line 1714 ---------------------------------------- . #[must_use = "if you intended to set a value, consider assignment instead"] . #[inline] . #[stable(feature = "option_insert", since = "1.53.0")] . #[rustc_const_unstable(feature = "const_option_ops", issue = "143956")] . pub const fn insert(&mut self, value: T) -> &mut T . where . T: [const] Destruct, . { 11 ( 0.00%) *self = Some(value); . . // SAFETY: the code above just filled the option . unsafe { self.as_mut().unwrap_unchecked() } . } . . /// Inserts `value` into the option if it is [`None`], then . /// returns a mutable reference to the contained value. . /// -- line 1730 ---------------------------------------- -- line 1976 ---------------------------------------- . /// ``` . #[stable(feature = "option_zip_option", since = "1.46.0")] . #[rustc_const_unstable(feature = "const_option_ops", issue = "143956")] . pub const fn zip(self, other: Option) -> Option<(T, U)> . where . T: [const] Destruct, . U: [const] Destruct, . { 21 ( 0.00%) match (self, other) { . (Some(a), Some(b)) => Some((a, b)), . _ => None, . } . } . . /// Combines the value in `self` with the value in another `Option`, using the function `f`. . /// . /// If `self` is `Some(s)` and `other` is `Some(o)`, this method returns `Some(f(s, o))`. -- line 1992 ---------------------------------------- -- line 2130 ---------------------------------------- . #[rustc_const_stable(feature = "const_option", since = "1.83.0")] . pub const fn copied(self) -> Option . where . T: Copy, . { . // FIXME(const-hack): this implementation, which sidesteps using `Option::map` since it's not const . // ready yet, should be reverted when possible to avoid code repetition . match self { 74,965 ( 0.00%) Some(&v) => Some(v), . None => None, . } . } . . /// Maps an `Option<&T>` to an `Option` by cloning the contents of the . /// option. . /// . /// # Examples -- line 2146 ---------------------------------------- -- line 2266 ---------------------------------------- . const impl Clone for Option . where . // FIXME(const_hack): the T: [const] Destruct should be inferred from the Self: [const] Destruct in clone_from. . // See https://github.com/rust-lang/rust/issues/144207 . T: [const] Clone + [const] Destruct, . { . #[inline] . fn clone(&self) -> Self { 6,006 ( 0.00%) match self { . Some(x) => Some(x.clone()), . None => None, . } . } . . #[inline] . fn clone_from(&mut self, source: &Self) { . match (self, source) { -- line 2282 ---------------------------------------- -- line 2431 ---------------------------------------- . impl crate::marker::StructuralPartialEq for Option {} . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] . const impl PartialEq for Option { . #[inline] . fn eq(&self, other: &Self) -> bool { . // Spelling out the cases explicitly optimizes better than . // `_ => false` 1,114,540 ( 0.05%) match (self, other) { 2 ( 0.00%) (Some(l), Some(r)) => *l == *r, 39 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eq (1x) . (Some(_), None) => false, . (None, Some(_)) => false, . (None, None) => true, . } . } . } . . // Manually implementing here somewhat improves codegen for -- line 2448 ---------------------------------------- -- line 2844 ---------------------------------------- . /// assert_eq!(res, None); . /// assert_eq!(shared, 6); . /// ``` . /// . /// Since the third element caused an underflow, no further elements were taken, . /// so the final value of `shared` is 6 (= `3 + 2 + 1`), not 16. . #[inline] . fn from_iter>>(iter: I) -> Option { 1 ( 0.00%) iter::try_process(iter.into_iter(), |i| i.collect()) 217 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/mod.rs:core::iter::adapters::try_process::, ::multi::{closure#0}>, clippy_utils::consts::Constant, core::option::Option, > as core::iter::traits::collect::FromIterator>>::from_iter, ::multi::{closure#0}>>::{closure#0}, alloc::vec::Vec> (1x) . } . } . . #[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")] . #[rustc_const_unstable(feature = "const_try", issue = "74935")] . const impl ops::Try for Option { . type Output = T; . type Residual = Option; -- line 2860 ---------------------------------------- -- line 2861 ---------------------------------------- . . #[inline] . fn from_output(output: Self::Output) -> Self { . Some(output) . } . . #[inline] . fn branch(self) -> ControlFlow { 278,803 ( 0.01%) match self { 384 ( 0.00%) Some(v) => ControlFlow::Continue(v), . None => ControlFlow::Break(None), . } . } . } . . #[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")] . #[rustc_const_unstable(feature = "const_try", issue = "74935")] . // Note: manually specifying the residual type instead of using the default to work around . // https://github.com/rust-lang/rust/issues/99940 . const impl ops::FromResidual> for Option { . #[inline] . fn from_residual(residual: Option) -> Self { . match residual { 375 ( 0.00%) None => None, . } . } . } . . #[diagnostic::do_not_recommend] . #[unstable(feature = "try_trait_v2_yeet", issue = "96374")] . #[rustc_const_unstable(feature = "const_try", issue = "74935")] . const impl ops::FromResidual> for Option { -- line 2892 ---------------------------------------- -- line 2929 ---------------------------------------- . /// ``` . #[inline] . #[stable(feature = "option_flattening", since = "1.40.0")] . #[rustc_allow_const_fn_unstable(const_precise_live_drops)] . #[rustc_const_stable(feature = "const_option", since = "1.83.0")] . pub const fn flatten(self) -> Option { . // FIXME(const-hack): could be written with `and_then` . match self { 3 ( 0.00%) Some(inner) => inner, 8 ( 0.00%) None => None, . } 1 ( 0.00%) } . } . . impl<'a, T> Option<&'a Option> { . /// Converts from `Option<&Option>` to `Option<&T>`. . /// . /// # Examples . /// . /// Basic usage: -- line 2948 ---------------------------------------- 569,252 ( 0.03%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/to_digit_is_some.rs -------------------------------------------------------------------------------- Ir -- line 43 ---------------------------------------- . . impl ToDigitIsSome { . pub(crate) fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl<'tcx> LateLintPass<'tcx> for ToDigitIsSome { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) { 137,704 ( 0.01%) if let hir::ExprKind::MethodCall(is_some_path, to_digit_expr, [], _) = &expr.kind 156 ( 0.00%) && is_some_path.ident.name == sym::is_some . { 6 ( 0.00%) let match_result = match to_digit_expr.kind { . hir::ExprKind::MethodCall(to_digits_path, char_arg, [radix_arg], _) => { . if to_digits_path.ident.name == sym::to_digit . && cx.typeck_results().expr_ty_adjusted(char_arg).is_char() . { . Some((true, char_arg, radix_arg)) . } else { . None . } -- line 63 ---------------------------------------- -- line 89 ---------------------------------------- . format!("{char_arg_snip}.is_digit({radix_snip})") . } else { . format!("char::is_digit({char_arg_snip}, {radix_snip})") . }, . applicability, . ); . } . } 549,936 ( 0.03%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/assertions_on_constants.rs -------------------------------------------------------------------------------- Ir -- line 39 ---------------------------------------- . } . impl AssertionsOnConstants { . pub fn new(conf: &Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl<'tcx> LateLintPass<'tcx> for AssertionsOnConstants { 687,420 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { . if let Some(macro_call) = root_macro_call_first_node(cx, e) . && let is_debug = match cx.tcx.get_diagnostic_name(macro_call.def_id) { . Some(sym::debug_assert_macro) => true, . Some(sym::assert_macro) => false, . _ => return, . } . && let Some((condition, _)) = find_assert_args(cx, e, macro_call.expn) . // Check if the whole expression can be moved into a const context. -- line 55 ---------------------------------------- -- line 76 ---------------------------------------- . ( . "this assertion is always `false`", . "replace this with `panic!()` or `unreachable!()`", . ) . }; . . span_lint_and_help(cx, ASSERTIONS_ON_CONSTANTS, macro_call.span, msg, None, help); . } 549,936 ( 0.03%) } . } . . fn as_bool_lit(e: &Expr<'_>) -> Option { . if let ExprKind::Lit(l) = e.kind . && let LitKind::Bool(b) = l.node . { . Some(b) . } else { -- line 92 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_slice_size_calculation.rs -------------------------------------------------------------------------------- Ir -- line 47 ---------------------------------------- . . impl ManualSliceSizeCalculation { . pub fn new(conf: &Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl<'tcx> LateLintPass<'tcx> for ManualSliceSizeCalculation { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 137,484 ( 0.01%) if let ExprKind::Binary(ref op, left, right) = expr.kind 76 ( 0.00%) && BinOpKind::Mul == op.node 10 ( 0.00%) && !expr.span.from_expansion() 10 ( 0.00%) && let Some((receiver, refs_count)) = simplify(cx, left, right) . && (!is_in_const_context(cx) || self.msrv.meets(cx, msrvs::CONST_SIZE_OF_VAL)) . { . let ctxt = expr.span.ctxt(); . let mut app = Applicability::MachineApplicable; . let deref = if refs_count > 0 { . "*".repeat(refs_count - 1) . } else { . "&".into() -- line 67 ---------------------------------------- -- line 74 ---------------------------------------- . MANUAL_SLICE_SIZE_CALCULATION, . expr.span, . "manual slice size calculation", . "try", . format!("{sugg}::mem::size_of_val({deref}{val_name})"), . app, . ); . } 549,936 ( 0.03%) } . } . . fn simplify<'tcx>( . cx: &LateContext<'tcx>, . expr1: &'tcx Expr<'tcx>, . expr2: &'tcx Expr<'tcx>, . ) -> Option<(&'tcx Expr<'tcx>, usize)> { 20 ( 0.00%) let expr1 = expr_or_init(cx, expr1); 572 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::expr_or_init (5x) 20 ( 0.00%) let expr2 = expr_or_init(cx, expr2); 150 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::expr_or_init (5x) . 40 ( 0.00%) simplify_half(cx, expr1, expr2).or_else(|| simplify_half(cx, expr2, expr1)) 270 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_slice_size_calculation.rs:clippy_lints::manual_slice_size_calculation::simplify_half (10x) . } . 70 ( 0.00%) fn simplify_half<'tcx>( . cx: &LateContext<'tcx>, . expr1: &'tcx Expr<'tcx>, . expr2: &'tcx Expr<'tcx>, . ) -> Option<(&'tcx Expr<'tcx>, usize)> { 50 ( 0.00%) if !expr1.span.from_expansion() . // expr1 is `[T1].len()`? . && let ExprKind::MethodCall(method_path, receiver, [], _) = expr1.kind . && method_path.ident.name == sym::len . && let receiver_ty = cx.typeck_results().expr_ty(receiver) . && let (receiver_ty, refs_count, _) = peel_and_count_ty_refs(receiver_ty) . && let ty::Slice(ty1) = receiver_ty.kind() . // expr2 is `size_of::()`? . && let ExprKind::Call(func, []) = expr2.kind -- line 109 ---------------------------------------- -- line 113 ---------------------------------------- . && let Some(ty2) = cx.typeck_results().node_args(func.hir_id).types().next() . // T1 == T2? . && *ty1 == ty2 . { . Some((receiver, refs_count)) . } else { . None . } 90 ( 0.00%) } 20 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/multi_assignments.rs -------------------------------------------------------------------------------- Ir -- line 27 ---------------------------------------- . pub MULTI_ASSIGNMENTS, . suspicious, . "instead of using `a = b = c;` use `a = c; b = c;`" . } . . declare_lint_pass!(MultiAssignments => [MULTI_ASSIGNMENTS]); . . fn strip_paren_blocks(expr: &Expr) -> &Expr { 392 ( 0.00%) match &expr.kind { . ExprKind::Paren(e) => strip_paren_blocks(e), . ExprKind::Block(b, _) => { . if let [ . Stmt { . kind: StmtKind::Expr(e), . .. . }, . ] = &b.stmts[..] -- line 43 ---------------------------------------- -- line 47 ---------------------------------------- . expr . } . }, . _ => expr, . } . } . . impl EarlyLintPass for MultiAssignments { 216,087 ( 0.01%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 144,058 ( 0.01%) if let ExprKind::Assign(target, source, _) = &expr.kind { 84 ( 0.00%) if let ExprKind::Assign(_target, _source, _) = &strip_paren_blocks(target).kind { . span_lint(cx, MULTI_ASSIGNMENTS, expr.span, "assignments don't nest intuitively"); . } 84 ( 0.00%) if let ExprKind::Assign(_target, _source, _) = &strip_paren_blocks(source).kind { . span_lint(cx, MULTI_ASSIGNMENTS, expr.span, "assignments don't nest intuitively"); . } . } 288,116 ( 0.01%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/functions/mod.rs -------------------------------------------------------------------------------- Ir -- line 493 ---------------------------------------- . RESULT_LARGE_ERR, . RESULT_UNIT_ERR, . TOO_MANY_ARGUMENTS, . TOO_MANY_LINES, . ]); . . impl EarlyLintPass for EarlyFunctions { . fn check_fn(&mut self, cx: &EarlyContext<'_>, fn_kind: visit::FnKind<'_>, _: Span, _: ast::NodeId) { 330 ( 0.00%) duplicate_underscore_argument::check(cx, fn_kind); 90,549 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/duplicate_underscore_argument.rs:clippy_lints::functions::duplicate_underscore_argument::check (110x) . } . } . . pub struct Functions { . too_many_arguments_threshold: u64, . too_many_lines_threshold: u64, . large_error_threshold: u64, . large_error_ignored: DefIdSet, -- line 509 ---------------------------------------- -- line 510 ---------------------------------------- . avoid_breaking_exported_api: bool, . /// A set of resolved `def_id` of traits that are configured to allow . /// function params renaming. . trait_ids: DefIdSet, . msrv: Msrv, . } . . impl Functions { 10 ( 0.00%) pub fn new(tcx: TyCtxt<'_>, conf: &'static Conf) -> Self { 8 ( 0.00%) Self { 2 ( 0.00%) too_many_arguments_threshold: conf.too_many_arguments_threshold, . too_many_lines_threshold: conf.too_many_lines_threshold, 1 ( 0.00%) large_error_threshold: conf.large_error_threshold, . large_error_ignored: conf . .large_error_ignored . .iter() . .flat_map(|ignored_ty| lookup_path_str(tcx, PathNS::Type, ignored_ty)) . .collect(), 1 ( 0.00%) avoid_breaking_exported_api: conf.avoid_breaking_exported_api, . trait_ids: conf . .allow_renamed_params_for . .iter() . .flat_map(|p| lookup_path_str(tcx, PathNS::Type, p)) . .collect(), 2 ( 0.00%) msrv: conf.msrv.into(), . } 9 ( 0.00%) } . } . . impl<'tcx> LateLintPass<'tcx> for Functions { 1,248 ( 0.00%) fn check_fn( . &mut self, . cx: &LateContext<'tcx>, . kind: intravisit::FnKind<'tcx>, . decl: &'tcx hir::FnDecl<'_>, . body: &'tcx hir::Body<'_>, . span: Span, . def_id: LocalDefId, . ) { 104 ( 0.00%) let hir_id = cx.tcx.local_def_id_to_hir_id(def_id); 1,040 ( 0.00%) too_many_arguments::check_fn(cx, kind, decl, hir_id, def_id, self.too_many_arguments_threshold); 416 ( 0.00%) too_many_lines::check_fn(cx, kind, body, span, def_id, self.too_many_lines_threshold); . not_unsafe_ptr_arg_deref::check_fn(cx, kind, decl, body, def_id); 1,352 ( 0.00%) misnamed_getters::check_fn(cx, kind, decl, body, span); 4,927 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/misnamed_getters.rs:clippy_lints::functions::misnamed_getters::check_fn (104x) 47 ( 0.00%) impl_trait_in_params::check_fn(cx, &kind, body, hir_id); 1,352 ( 0.00%) ref_option::check_fn( 45,111 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/ref_option.rs:clippy_lints::functions::ref_option::check_fn (104x) . cx, . kind, . decl, . span, . hir_id, . def_id, . body, 208 ( 0.00%) self.avoid_breaking_exported_api, . ); 728 ( 0.00%) } . . fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>) { 639 ( 0.00%) must_use::check_item(cx, item); 516,059 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/must_use.rs:clippy_lints::functions::must_use::check_item (213x) 639 ( 0.00%) result::check_item( 16,568 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::check_item (213x) . cx, . item, 213 ( 0.00%) self.large_error_threshold, 213 ( 0.00%) &self.large_error_ignored, 213 ( 0.00%) self.msrv, . ); . } . 490 ( 0.00%) fn check_impl_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::ImplItem<'_>) { 147 ( 0.00%) must_use::check_impl_item(cx, item); 22,082 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/must_use.rs:clippy_lints::functions::must_use::check_impl_item (49x) 147 ( 0.00%) result::check_impl_item( 13,273 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::check_impl_item (49x) . cx, . item, 49 ( 0.00%) self.large_error_threshold, 49 ( 0.00%) &self.large_error_ignored, 49 ( 0.00%) self.msrv, . ); . impl_trait_in_params::check_impl_item(cx, item); 245 ( 0.00%) renamed_function_params::check_impl_item(cx, item, &self.trait_ids); 23,463 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/renamed_function_params.rs:clippy_lints::functions::renamed_function_params::check_impl_item (49x) 392 ( 0.00%) } . 60 ( 0.00%) fn check_trait_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::TraitItem<'_>) { 6 ( 0.00%) too_many_arguments::check_trait_item(cx, item, self.too_many_arguments_threshold); . not_unsafe_ptr_arg_deref::check_trait_item(cx, item); 18 ( 0.00%) must_use::check_trait_item(cx, item); 1,708 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/must_use.rs:clippy_lints::functions::must_use::check_trait_item (6x) 18 ( 0.00%) result::check_trait_item( 2,172 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::check_trait_item (6x) . cx, . item, 6 ( 0.00%) self.large_error_threshold, 6 ( 0.00%) &self.large_error_ignored, 6 ( 0.00%) self.msrv, . ); 6 ( 0.00%) impl_trait_in_params::check_trait_item(cx, item, self.avoid_breaking_exported_api); 24 ( 0.00%) ref_option::check_trait_item(cx, item, self.avoid_breaking_exported_api); 1,224 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/ref_option.rs:clippy_lints::functions::ref_option::check_trait_item (6x) 48 ( 0.00%) } . . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>) { 343,710 ( 0.02%) result::check_expr(cx, expr, self.large_error_threshold, &self.large_error_ignored); 1,169,781 ( 0.05%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::check_expr (68,742x) . } . } 1,550 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/unnecessary_map_on_constructor.rs -------------------------------------------------------------------------------- Ir -- line 32 ---------------------------------------- . "using `map`/`map_err` on `Option` or `Result` constructors" . } . . declare_lint_pass!(UnnecessaryMapOnConstructor => [ . UNNECESSARY_MAP_ON_CONSTRUCTOR, . ]); . . impl<'tcx> LateLintPass<'tcx> for UnnecessaryMapOnConstructor { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx rustc_hir::Expr<'tcx>) { 206,226 ( 0.01%) if !expr.span.from_expansion() 316 ( 0.00%) && let hir::ExprKind::MethodCall(path, recv, [map_arg], ..) = expr.kind 64 ( 0.00%) && !map_arg.span.from_expansion() 116 ( 0.00%) && let hir::ExprKind::Path(fun) = map_arg.kind 54 ( 0.00%) && let Some(sym::Option | sym::Result) = cx.typeck_results().expr_ty(recv).opt_diag_name(cx) 520 ( 0.00%) => ???:::expr_ty (13x) . { . let (constructor_path, constructor_item) = if let hir::ExprKind::Call(constructor, [arg, ..]) = recv.kind . && let hir::ExprKind::Path(constructor_path) = constructor.kind . && !constructor.span.from_expansion() . && !arg.span.from_expansion() . { . (constructor_path, arg) . } else { -- line 53 ---------------------------------------- -- line 81 ---------------------------------------- . "unnecessary `{}` on constructor `{constructor_snippet}(_)`", . path.ident.name . ), . "try", . format!("{constructor_snippet}({fun_snippet}({constructor_arg_snippet}))"), . app, . ); . } 549,936 ( 0.03%) } . } 137,008 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs -------------------------------------------------------------------------------- Ir -- line 460 ---------------------------------------- . /// assert_eq!(13, unsafe { mem::size_of_val_raw(y) }); . /// ``` . #[inline] . #[must_use] . #[stable(feature = "layout_for_ptr", since = "CURRENT_RUSTC_VERSION")] . #[rustc_const_stable(feature = "layout_for_ptr", since = "CURRENT_RUSTC_VERSION")] . pub const unsafe fn size_of_val_raw(val: *const T) -> usize { . // SAFETY: the caller must provide a valid raw pointer 1 ( 0.00%) unsafe { intrinsics::size_of_val(val) } . } . . /// Returns the [ABI]-required minimum alignment of a type in bytes. . /// . /// Every reference to a value of the type `T` must be a multiple of this number. . /// . /// This is the alignment used for struct fields. It may be smaller than the preferred alignment. . /// -- line 476 ---------------------------------------- -- line 634 ---------------------------------------- . /// . /// [type-layout]: ../../reference/type-layout.html#r-layout.primitive . #[inline] . #[must_use] . #[stable(feature = "layout_for_ptr", since = "CURRENT_RUSTC_VERSION")] . #[rustc_const_stable(feature = "layout_for_ptr", since = "CURRENT_RUSTC_VERSION")] . pub const unsafe fn align_of_val_raw(val: *const T) -> usize { . // SAFETY: the caller must provide a valid raw pointer 1 ( 0.00%) unsafe { intrinsics::align_of_val(val) } . } . . /// Returns `true` if dropping values of type `T` matters. . /// . /// This is purely an optimization hint, and may be implemented conservatively: . /// it may return `true` for types that don't actually need to be dropped. . /// As such always returning `true` would be a valid implementation of . /// this function. However if this function actually returns `false`, then you -- line 650 ---------------------------------------- -- line 825 ---------------------------------------- . /// ``` . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_swap", since = "1.85.0")] . #[rustc_diagnostic_item = "mem_swap"] . pub const fn swap(x: &mut T, y: &mut T) { . // SAFETY: `&mut` guarantees these are typed readable and writable . // as well as non-overlapping. 116 ( 0.00%) unsafe { intrinsics::typed_swap_nonoverlapping(x, y) } . } . . /// Replaces `dest` with the default value of `T`, returning the previous `dest` value. . /// . /// * If you want to replace the values of two variables, see [`swap`]. . /// * If you want to replace with a passed value instead of the default value, see [`replace`]. . /// . /// # Examples -- line 841 ---------------------------------------- -- line 967 ---------------------------------------- . // such that the old value is not duplicated. Nothing is dropped and . // nothing here can panic. . unsafe { . // Ideally we wouldn't use the intrinsics here, but going through the . // `ptr` methods introduces two unnecessary UbChecks, so until we can . // remove those for pointers that come from references, this uses the . // intrinsics instead so this stays very cheap in MIR (and debug). . 418,968 ( 0.02%) let result = crate::intrinsics::read_via_copy(dest); 287,417 ( 0.01%) crate::intrinsics::write_via_move(dest, src); . result . } . } . . /// Disposes of a value. . /// . /// This effectively does nothing for types which implement `Copy`, e.g. . /// integers. Such values are copied and _then_ moved into the function, so the -- line 984 ---------------------------------------- -- line 1406 ---------------------------------------- . /// // ⚠️ This is undefined behavior. Don't do this. ⚠️ . /// // assert_eq!(0, unsafe { std::mem::transmute::<_, u8>(std::mem::discriminant(&unit_like)) }); . /// ``` . #[stable(feature = "discriminant_value", since = "1.21.0")] . #[rustc_const_stable(feature = "const_discriminant", since = "1.75.0")] . #[rustc_diagnostic_item = "mem_discriminant"] . #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces . pub const fn discriminant(v: &T) -> Discriminant { 339 ( 0.00%) Discriminant(intrinsics::discriminant_value(v)) . } . . /// Returns the number of variants in the enum type `T`. . /// . /// If `T` is not an enum, calling this function will not result in undefined behavior, but the . /// return value is unspecified. Equally, if `T` is an enum with more variants than `usize::MAX` . /// the return value is unspecified. Uninhabited variants will be counted. . /// -- line 1422 ---------------------------------------- 69,482 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/blocks_in_conditions.rs -------------------------------------------------------------------------------- Ir -- line 47 ---------------------------------------- . "useless or complex blocks that can be eliminated in conditions" . } . . declare_lint_pass!(BlocksInConditions => [BLOCKS_IN_CONDITIONS]); . . const BRACED_EXPR_MESSAGE: &str = "omit braces around single expression condition"; . . impl<'tcx> LateLintPass<'tcx> for BlocksInConditions { 549,936 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 137,484 ( 0.01%) if expr.span.from_expansion() { . return; . } . 204 ( 0.00%) let Some((cond, keyword, desc)) = higher::If::hir(expr) . .map(|hif| (hif.cond, "if", "an `if` condition")) 84 ( 0.00%) .or(if let ExprKind::Match(match_ex, _, MatchSource::Normal) = expr.kind { . Some((match_ex, "match", "a `match` scrutinee")) . } else { . None . }) . else { . return; . }; 153 ( 0.00%) let complex_block_message = format!( . "in {desc}, avoid complex blocks or closures with blocks; \ . instead, move the block or closure higher and bind it with a `let`", . ); . 102 ( 0.00%) if let ExprKind::Block(block, _) = &cond.kind { . if !block.span.eq_ctxt(expr.span) { . // If the block comes from a macro, or as an argument to a macro, . // do not lint. . return; . } . if block.rules == BlockCheckMode::DefaultBlock { . if block.stmts.is_empty() { . if let Some(ex) = &block.expr { -- line 83 ---------------------------------------- -- line 129 ---------------------------------------- . "let res = {}; {keyword} res", . snippet_block_with_applicability(cx, block.span, "..", Some(expr.span), &mut applicability), . ), . applicability, . ); . } . } . } 549,936 ( 0.03%) } . } 207 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/unicode/unicode_data.rs -------------------------------------------------------------------------------- Ir 101,780 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs -------------------------------------------------------------------------------- Ir -- line 72 ---------------------------------------- . /// the form of the code. No crates in `rustc-perf` need more than 15 bits . /// for `ctxt_or_parent_or_marker`, but larger crates might need more than 16 . /// bits. The number of bits needed for `parent` hasn't been measured, . /// because `parent` isn't currently used by default. . /// . /// In order to reliably use parented spans in incremental compilation, . /// accesses to `lo` and `hi` must introduce a dependency to the parent definition's span. . /// This is performed using the callback `SPAN_TRACK` to access the query engine. 928 ( 0.00%) #[derive(Clone, Copy, Eq, PartialEq, Hash)] . #[rustc_pass_by_value] . pub struct Span { . lo_or_index: u32, . len_with_tag_or_marker: u16, . ctxt_or_parent_or_marker: u16, . } . . // Convenience structures for all span formats. -- line 88 ---------------------------------------- -- line 109 ---------------------------------------- . #[derive(Clone, Copy)] . struct Interned { . index: u32, . } . . impl InlineCtxt { . #[inline] . fn data(self) -> SpanData { 50,340 ( 0.00%) let len = self.len as u32; . debug_assert!(len <= MAX_LEN); 51,648 ( 0.00%) SpanData { . lo: BytePos(self.lo), . hi: BytePos(self.lo.debug_strict_add(len)), . ctxt: SyntaxContext::from_u16(self.ctxt), . parent: None, . } . } . #[inline] . fn span(lo: u32, len: u16, ctxt: u16) -> Span { -- line 127 ---------------------------------------- -- line 159 ---------------------------------------- . (span.lo_or_index, span.len_with_tag_or_marker, span.ctxt_or_parent_or_marker); . InlineParent { lo, len_with_tag, parent } . } . } . . impl PartiallyInterned { . #[inline] . fn data(self) -> SpanData { 106 ( 0.00%) SpanData { . ctxt: SyntaxContext::from_u16(self.ctxt), 60 ( 0.00%) ..with_span_interner(|interner| interner.spans[self.index as usize]) . } . } . #[inline] . fn span(index: u32, ctxt: u16) -> Span { . let (lo_or_index, len_with_tag_or_marker, ctxt_or_parent_or_marker) = . (index, BASE_LEN_INTERNED_MARKER, ctxt); . Span { lo_or_index, len_with_tag_or_marker, ctxt_or_parent_or_marker } . } -- line 177 ---------------------------------------- -- line 204 ---------------------------------------- . macro_rules! match_span_kind { . ( . $span:expr, . InlineCtxt($span1:ident) => $arm1:expr, . InlineParent($span2:ident) => $arm2:expr, . PartiallyInterned($span3:ident) => $arm3:expr, . Interned($span4:ident) => $arm4:expr, . ) => { 7,067,461 ( 0.33%) if $span.len_with_tag_or_marker != BASE_LEN_INTERNED_MARKER { 12,915,515 ( 0.60%) if $span.len_with_tag_or_marker & PARENT_TAG == 0 { . // Inline-context format. . let $span1 = InlineCtxt::from_span($span); . $arm1 . } else { . // Inline-parent format. . let $span2 = InlineParent::from_span($span); . $arm2 . } 549,290 ( 0.03%) } else if $span.ctxt_or_parent_or_marker != CTXT_INTERNED_MARKER { . // Partially-interned format. . let $span3 = PartiallyInterned::from_span($span); . $arm3 . } else { . // Interned format. . let $span4 = Interned::from_span($span); . $arm4 . } -- line 230 ---------------------------------------- -- line 240 ---------------------------------------- . const CTXT_INTERNED_MARKER: u16 = 0b1111_1111_1111_1111; . . /// The dummy span has zero position, length, and context, and no parent. . pub const DUMMY_SP: Span = . Span { lo_or_index: 0, len_with_tag_or_marker: 0, ctxt_or_parent_or_marker: 0 }; . . impl Span { . #[inline] 54 ( 0.00%) pub fn new( . mut lo: BytePos, . mut hi: BytePos, . ctxt: SyntaxContext, . parent: Option, . ) -> Self { 294 ( 0.00%) if lo > hi { . std::mem::swap(&mut lo, &mut hi); . } . . // Small len and ctxt may enable one of fully inline formats (or may not). 9 ( 0.00%) let (len, ctxt32) = (hi.0 - lo.0, ctxt.as_u32()); 1,249 ( 0.00%) if len <= MAX_LEN && ctxt32 <= MAX_CTXT { 669 ( 0.00%) match parent { . None => return InlineCtxt::span(lo.0, len as u16, ctxt32 as u16), . Some(parent) => { . let parent32 = parent.local_def_index.as_u32(); . if ctxt32 == 0 && parent32 <= MAX_CTXT { . return InlineParent::span(lo.0, len as u16, parent32 as u16); . } . } . } -- line 269 ---------------------------------------- -- line 274 ---------------------------------------- . with_span_interner(|interner| interner.intern(&SpanData { lo, hi, ctxt, parent })) . }; . if ctxt32 <= MAX_CTXT { . // Interned ctxt should never be read, so it can use any value. . PartiallyInterned::span(index(SyntaxContext::from_u32(u32::MAX)), ctxt32 as u16) . } else { . Interned::span(index(ctxt)) . } 2,007 ( 0.00%) } . . #[inline] 371 ( 0.00%) pub fn data(self) -> SpanData { . let data = self.data_untracked(); 2,063 ( 0.00%) if let Some(parent) = data.parent { . (*SPAN_TRACK)(parent); . } . data 212 ( 0.00%) } . . /// Internal function to translate between an encoded span and the expanded representation. . /// This function must not be used outside the incremental engine. . #[inline] . pub fn data_untracked(self) -> SpanData { . match_span_kind! { . self, . InlineCtxt(span) => span.data(), . InlineParent(span) => span.data(), 60 ( 0.00%) PartiallyInterned(span) => span.data(), . Interned(span) => span.data(), . } . } . . /// Returns `true` if this span comes from any kind of macro, desugaring or inlining. . #[inline] . pub fn from_expansion(self) -> bool { . let ctxt = match_span_kind! { -- line 309 ---------------------------------------- -- line 383 ---------------------------------------- . #[inline] . pub fn ctxt(self) -> SyntaxContext { . self.inline_ctxt() . .unwrap_or_else(|index| with_span_interner(|interner| interner.spans[index].ctxt)) . } . . #[inline] . pub fn eq_ctxt(self, other: Span) -> bool { 676 ( 0.00%) match (self.inline_ctxt(), other.inline_ctxt()) { . (Ok(ctxt1), Ok(ctxt2)) => ctxt1 == ctxt2, . // If `inline_ctxt` returns `Ok` the context is <= MAX_CTXT. . // If it returns `Err` the span is fully interned and the context is > MAX_CTXT. . // As these do not overlap an `Ok` and `Err` result cannot have an equal context. . (Ok(_), Err(_)) | (Err(_), Ok(_)) => false, . (Err(index1), Err(index2)) => with_span_interner(|interner| { . interner.spans[index1].ctxt == interner.spans[index2].ctxt . }), -- line 399 ---------------------------------------- 4,994,895 ( 0.23%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/if_let_mutex.rs -------------------------------------------------------------------------------- Ir -- line 47 ---------------------------------------- . correctness, . "locking a `Mutex` in an `if let` block can cause deadlocks" . } . . declare_lint_pass!(IfLetMutex => [IF_LET_MUTEX]); . . impl<'tcx> LateLintPass<'tcx> for IfLetMutex { . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 206,226 ( 0.01%) if cx.tcx.sess.edition() >= Edition2024 { . return; . } . 68,745 ( 0.00%) if let Some(higher::IfLet { . let_expr, . if_then, . if_else: Some(if_else), . .. 137,490 ( 0.01%) }) = higher::IfLet::hir(cx, expr) 344,262 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (68,742x) . && let ctxt = expr.span.ctxt() . && let Some(op_mutex) = for_each_expr_without_closures(let_expr, |e| mutex_lock_call(cx, ctxt, e, None)) . && let Some(arm_mutex) = . for_each_expr_without_closures((if_then, if_else), |e| mutex_lock_call(cx, ctxt, e, Some(op_mutex))) . { . let diag = |diag: &mut Diag<'_, ()>| { . diag.span_label( . op_mutex.span, -- line 72 ---------------------------------------- -- line 81 ---------------------------------------- . span_lint_and_then( . cx, . IF_LET_MUTEX, . expr.span, . "calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a deadlock", . diag, . ); . } 68,742 ( 0.00%) } . } . . fn mutex_lock_call<'tcx>( . cx: &LateContext<'tcx>, . ctxt: SyntaxContext, . expr: &'tcx Expr<'_>, . op_mutex: Option<&'tcx Expr<'_>>, . ) -> ControlFlow<&'tcx Expr<'tcx>> { -- line 97 ---------------------------------------- 1,168,614 ( 0.05%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/loops/while_let_on_iterator.rs -------------------------------------------------------------------------------- Ir -- line 11 ---------------------------------------- . use rustc_hir::intravisit::{Visitor, walk_expr}; . use rustc_hir::{Closure, Expr, ExprKind, HirId, LetStmt, Mutability, UnOp}; . use rustc_lint::LateContext; . use rustc_middle::hir::nested_filter::OnlyBodies; . use rustc_middle::ty::adjustment::{Adjust, DerefAdjustKind}; . use rustc_span::Symbol; . use rustc_span::symbol::sym; . 479,528 ( 0.02%) pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . if let Some(higher::WhileLet { if_then, let_pat, let_expr, label, .. }) = higher::WhileLet::hir(expr) . // check for `Some(..)` pattern . && let Some(some_pat) = as_some_pattern(cx, let_pat) . // check for call to `Iterator::next` . && let ExprKind::MethodCall(method_name, iter_expr, [], _) = let_expr.kind . && method_name.ident.name == sym::next . && cx.ty_based_def(let_expr).opt_parent(cx).is_diag_item(cx, sym::Iterator) . && let Some(iter_expr_struct) = try_parse_iter_expr(cx, iter_expr) -- line 27 ---------------------------------------- -- line 61 ---------------------------------------- . WHILE_LET_ON_ITERATOR, . expr.span.with_hi(let_expr.span.hi()), . "this loop could be written as a `for` loop", . "try", . format!("{loop_label}for {loop_var} in {iterator_by_ref}"), . applicability, . ); . } 548,032 ( 0.03%) } . . #[derive(Debug)] . struct IterExpr { . /// The fields used, in order of child to parent. . fields: Vec, . /// The path being used. . path: Res, . /// Whether or not the iterator can be moved. -- line 77 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/needless_question_mark.rs -------------------------------------------------------------------------------- Ir -- line 60 ---------------------------------------- . * Return statement . * A body's value (single line closure) . * . * What do we not match: . * Implicit calls to `from(..)` on the error value . */ . . fn check_expr(&mut self, cx: &LateContext<'_>, expr: &'_ Expr<'_>) { 137,556 ( 0.01%) if let ExprKind::Ret(Some(e)) = expr.kind { 57 ( 0.00%) check(cx, e); 1,198 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/needless_question_mark.rs:clippy_lints::needless_question_mark::check (19x) . } . } . . fn check_body(&mut self, cx: &LateContext<'_>, body: &'_ Body<'_>) { 548 ( 0.00%) if let ExprKind::Block( . Block { . expr: . Some(Expr { . kind: ExprKind::DropTemps(async_body), . .. . }), . .. . }, . _, 417 ( 0.00%) ) = body.value.kind . { . if let ExprKind::Block(Block { expr: Some(expr), .. }, ..) = async_body.kind { . check(cx, expr.peel_blocks()); . } . } else { . check(cx, body.value.peel_blocks()); . } . } . } . . fn check(cx: &LateContext<'_>, expr: &Expr<'_>) { 448 ( 0.00%) if let ExprKind::Call(path, [arg]) = expr.kind 158 ( 0.00%) && let Res::Def(DefKind::Ctor(..), ctor_id) = path.res(cx) . && let Some(variant_id) = cx.tcx.opt_parent(ctor_id) 52 ( 0.00%) && let variant = if cx.tcx.lang_items().option_some_variant() == Some(variant_id) { 330 ( 0.00%) => ???:::lang_items (11x) . "Some" 9 ( 0.00%) } else if cx.tcx.lang_items().result_ok_variant() == Some(variant_id) { 90 ( 0.00%) => ???:::lang_items (3x) . "Ok" . } else { . return; . } 22 ( 0.00%) && let ExprKind::Match(inner_expr_with_q, _, MatchSource::TryDesugar(_)) = &arg.kind . && let ExprKind::Call(called, [inner_expr]) = &inner_expr_with_q.kind . && let ExprKind::Path(qpath) = called.kind . && cx.tcx.qpath_is_lang_item(qpath, LangItem::TryTraitBranch) . && expr.span.eq_ctxt(inner_expr.span) . && let expr_ty = cx.typeck_results().expr_ty(expr) . && let inner_ty = cx.typeck_results().expr_ty(inner_expr) . && expr_ty == inner_ty . { -- line 114 ---------------------------------------- -- line 128 ---------------------------------------- . String::new(), . ), . ], . Applicability::MachineApplicable, . ); . }, . ); . } 160 ( 0.00%) } 338 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs -------------------------------------------------------------------------------- Ir -- line 17 ---------------------------------------- . let $len = unsafe { &mut *(&raw mut $this.end_or_len).cast::() }; . $zst_body . } else { . // SAFETY: for non-ZSTs, the type invariant ensures it cannot be null . let $end = unsafe { &mut *(&raw mut $this.end_or_len).cast::>() }; . $other_body . } . }}; 284,226 ( 0.01%) ($this:ident, $len:ident => $zst_body:expr, $end:ident => $other_body:expr,) => {{ . #![allow(unused_unsafe)] // we're sometimes used within an unsafe block . 172 ( 0.00%) if T::IS_ZST { . let $len = $this.end_or_len.addr(); . $zst_body . } else { . // SAFETY: for non-ZSTs, the type invariant ensures it cannot be null 2 ( 0.00%) let $end = unsafe { mem::transmute::<*const T, NonNull>($this.end_or_len) }; . $other_body . } . }}; . } . . // Inlining is_empty and len makes a huge performance difference . macro_rules! is_empty { . ($self: ident) => { -- line 41 ---------------------------------------- -- line 85 ---------------------------------------- . } . . // Helper function for creating a slice from the iterator. . #[inline(always)] . fn make_slice(&self) -> &'a [T] { . // SAFETY: the iterator was created from a slice with pointer . // `self.ptr` and length `len!(self)`. This guarantees that all . // the prerequisites for `from_raw_parts` are fulfilled. 2 ( 0.00%) unsafe { from_raw_parts(self.ptr.as_ptr(), len!(self)) } . } . . // Helper function for moving the start of the iterator forwards by `offset` elements, . // returning the old start. . // Unsafe because the offset must not exceed `self.len()`. . #[inline(always)] . unsafe fn post_inc_start(&mut self, offset: usize) -> NonNull { . let old = self.ptr; -- line 101 ---------------------------------------- -- line 153 ---------------------------------------- . impl<'a, T> Iterator for $name<'a, T> { . type Item = $elem; . . #[inline] . fn next(&mut self) -> Option<$elem> { . // intentionally not using the helpers because this is . // one of the most mono'd things in the library. . 100 ( 0.00%) let ptr = self.ptr; 88 ( 0.00%) let end_or_len = self.end_or_len; . // SAFETY: See inner comments. (For some reason having multiple . // block breaks inlining this -- if you can fix that please do!) . unsafe { . if T::IS_ZST { . let len = end_or_len.addr(); . if len == 0 { . return None; . } -- line 170 ---------------------------------------- -- line 172 ---------------------------------------- . // cannot wrap. (Ideally this would be `checked_sub`, which . // does the same thing internally, but as of 2025-02 that . // doesn't optimize quite as small in MIR.) . self.end_or_len = without_provenance_mut(len.unchecked_sub(1)); . } else { . // SAFETY: by type invariant, the `end_or_len` field is always . // non-null for a non-ZST pointee. (This transmute ensures we . // get `!nonnull` metadata on the load of the field.) 2,177,864 ( 0.10%) if ptr == crate::intrinsics::transmute::<$ptr, NonNull>(end_or_len) { . return None; . } . // SAFETY: since it's not empty, per the check above, moving . // forward one keeps us inside the slice, and this is valid. 749 ( 0.00%) self.ptr = ptr.add(1); . } . // SAFETY: Now that we know it wasn't empty and we've moved past . // the first one (to avoid giving a duplicate `&mut` next time), . // we can give out a reference to it. . Some({ptr}.$into_ref()) . } . } . -- line 193 ---------------------------------------- -- line 217 ---------------------------------------- . . #[inline] . fn count(self) -> usize { . len!(self) . } . . #[inline] . fn nth(&mut self, n: usize) -> Option<$elem> { 54 ( 0.00%) if n >= len!(self) { . // This iterator is now empty. . if_zst!(mut self, . len => *len = 0, . end => self.ptr = *end, . ); . return None; . } . // SAFETY: We are in bounds. `post_inc_start` does the right thing even for ZSTs. -- line 233 ---------------------------------------- -- line 266 ---------------------------------------- . return init; . } . let mut acc = init; . let mut i = 0; . let len = len!(self); . loop { . // SAFETY: the loop iterates `i in 0..len`, which always is in bounds of . // the slice allocation 1,507 ( 0.00%) acc = f(acc, unsafe { & $( $mut_ )? *self.ptr.add(i).as_ptr() }); . // SAFETY: `i` can't overflow since it'll only reach usize::MAX if the . // slice had that length, in which case we'll break out of the loop . // after the increment . i = unsafe { i.unchecked_add(1) }; 7,373 ( 0.00%) if i == len { . break; . } . } 112 ( 0.00%) acc . } . . // We override the default implementation, which uses `try_fold`, . // because this simple implementation generates less LLVM IR and is . // faster to compile. . #[inline] . fn for_each(mut self, mut f: F) . where -- line 291 ---------------------------------------- -- line 302 ---------------------------------------- . // faster to compile. . #[inline] . fn all(&mut self, mut f: F) -> bool . where . Self: Sized, . F: FnMut(Self::Item) -> bool, . { . while let Some(x) = self.next() { 32,353 ( 0.00%) if !f(x) { . return false; . } . } . true . } . . // We override the default implementation, which uses `try_fold`, . // because this simple implementation generates less LLVM IR and is -- line 318 ---------------------------------------- -- line 319 ---------------------------------------- . // faster to compile. . #[inline] . fn any(&mut self, mut f: F) -> bool . where . Self: Sized, . F: FnMut(Self::Item) -> bool, . { . while let Some(x) = self.next() { 26,054 ( 0.00%) if f(x) { . return true; . } . } . false . } . . // We override the default implementation, which uses `try_fold`, . // because this simple implementation generates less LLVM IR and is -- line 335 ---------------------------------------- -- line 336 ---------------------------------------- . // faster to compile. . #[inline] . fn find

(&mut self, mut predicate: P) -> Option . where . Self: Sized, . P: FnMut(&Self::Item) -> bool, . { . while let Some(x) = self.next() { 7,933 ( 0.00%) if predicate(&x) { . return Some(x); . } . } . None . } . . // We override the default implementation, which uses `try_fold`, . // because this simple implementation generates less LLVM IR and is -- line 352 ---------------------------------------- -- line 353 ---------------------------------------- . // faster to compile. . #[inline] . fn find_map(&mut self, mut f: F) -> Option . where . Self: Sized, . F: FnMut(Self::Item) -> Option, . { . while let Some(x) = self.next() { 1,975 ( 0.00%) if let Some(y) = f(x) { 8,603 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:<&mut clippy_lints::doc::suspicious_doc_comments::collect_doc_replacements::{closure#0} as core::ops::function::FnMut<(&rustc_hir::hir::Attribute,)>>::call_mut (247x) . return Some(y); . } . } . None 3 ( 0.00%) } . . // We override the default implementation, which uses `try_fold`, . // because this simple implementation generates less LLVM IR and is . // faster to compile. Also, the `assume` avoids a bounds check. . #[inline] . fn position

(&mut self, mut predicate: P) -> Option where . Self: Sized, . P: FnMut(Self::Item) -> bool, . { . let n = len!(self); . let mut i = 0; . while let Some(x) = self.next() { 4,117 ( 0.00%) if predicate(x) { . // SAFETY: we are guaranteed to be in bounds by the loop invariant: . // when `i >= n`, `self.next()` returns `None` and the loop breaks. . unsafe { assert_unchecked(i < n) }; . return Some(i); . } 1,878 ( 0.00%) i += 1; . } . None . } . . // We override the default implementation, which uses `try_fold`, . // because this simple implementation generates less LLVM IR and is . // faster to compile. Also, the `assume` avoids a bounds check. . #[inline] -- line 393 ---------------------------------------- -- line 394 ---------------------------------------- . fn rposition

(&mut self, mut predicate: P) -> Option where . P: FnMut(Self::Item) -> bool, . Self: Sized + ExactSizeIterator + DoubleEndedIterator . { . let n = len!(self); . let mut i = n; . while let Some(x) = self.next_back() { . i -= 1; 96 ( 0.00%) if predicate(x) { . // SAFETY: `i` must be lower than `n` since it starts at `n` . // and is only decreasing. . unsafe { assert_unchecked(i < n) }; . return Some(i); . } . } . None . } -- line 410 ---------------------------------------- 1,199,101 ( 0.06%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/unused_unit.rs -------------------------------------------------------------------------------- Ir -- line 46 ---------------------------------------- . &mut self, . cx: &LateContext<'tcx>, . kind: FnKind<'tcx>, . decl: &'tcx FnDecl<'tcx>, . body: &'tcx Body<'tcx>, . span: Span, . _def_id: LocalDefId, . ) { 290 ( 0.00%) if let FnRetTy::Return(hir_ty) = decl.output 2 ( 0.00%) && is_unit_ty(hir_ty) . && !hir_ty.span.from_expansion() . && get_def(span) == get_def(hir_ty.span) . { . // The explicit `-> ()` in the closure signature might be necessary for multiple reasons: . // - Implicit types in closure signatures are forbidden when `for<...>` is present . // - If the closure body ends with a function call, and that function's return type is generic, the . // `-> ()` could be required for it to be inferred . // -- line 63 ---------------------------------------- -- line 75 ---------------------------------------- . && let Some(expr) = block.expr . && is_never_expr(cx, expr).is_some() . { . return; . } . . lint_unneeded_unit_return(cx, hir_ty.span, span); . } 104 ( 0.00%) } . . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 343,797 ( 0.02%) if let ExprKind::Ret(Some(expr)) | ExprKind::Break(_, Some(expr)) = expr.kind . && is_unit_expr(expr) . && !expr.span.from_expansion() . { . span_lint_and_sugg( . cx, . UNUSED_UNIT, . expr.span, . "unneeded `()`", . "remove the `()`", . String::new(), . Applicability::MachineApplicable, . ); . } 68,742 ( 0.00%) } . 258 ( 0.00%) fn check_poly_trait_ref(&mut self, cx: &LateContext<'tcx>, poly: &'tcx PolyTraitRef<'tcx>) { 169 ( 0.00%) if let [segment] = &poly.trait_ref.path.segments 160 ( 0.00%) && matches!(segment.ident.name, sym::Fn | sym::FnMut | sym::FnOnce) 27 ( 0.00%) && let Some(args) = segment.args 9 ( 0.00%) && args.parenthesized == GenericArgsParentheses::ParenSugar 27 ( 0.00%) && let [constraint] = &args.constraints 9 ( 0.00%) && constraint.ident.name == sym::Output 45 ( 0.00%) && let AssocItemConstraintKind::Equality { term: Term::Ty(hir_ty) } = constraint.kind 27 ( 0.00%) && args.span_ext.hi() != poly.span.hi() 8 ( 0.00%) && !hir_ty.span.from_expansion() 12 ( 0.00%) && args.span_ext.hi() != hir_ty.span.hi() . && is_unit_ty(hir_ty) . { . lint_unneeded_unit_return(cx, hir_ty.span, poly.span); . } 301 ( 0.00%) } . } . . impl EarlyLintPass for UnusedUnit { . /// Check for unit expressions in blocks. This is left in the early pass because some macros . /// expand its inputs as-is, making it invisible to the late pass. See #4076. 648 ( 0.00%) fn check_block(&mut self, cx: &EarlyContext<'_>, block: &Block) { . if let Some(stmt) = block.stmts.last() 322 ( 0.00%) && let StmtKind::Expr(expr) = &stmt.kind 327 ( 0.00%) && let rustc_ast::ExprKind::Tup(inner) = &expr.kind 2 ( 0.00%) && inner.is_empty() . && let ctxt = block.span.ctxt() . && stmt.span.ctxt() == ctxt . && expr.span.ctxt() == ctxt . && expr.attrs.is_empty() . { . let sp = expr.span; . span_lint_and_sugg( . cx, -- line 135 ---------------------------------------- -- line 136 ---------------------------------------- . UNUSED_UNIT, . sp, . "unneeded unit expression", . "remove the final `()`", . String::new(), . Applicability::MachineApplicable, . ); . } 810 ( 0.00%) } . } . . fn is_unit_ty(ty: &Ty<'_>) -> bool { 174 ( 0.00%) matches!(ty.kind, TyKind::Tup([])) . } . . // get the def site . #[must_use] . fn get_def(span: Span) -> Option { . if span.from_expansion() { . Some(span.ctxt().outer_expn_data().def_site) . } else { -- line 156 ---------------------------------------- 1,401 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/ineffective_open_options.rs -------------------------------------------------------------------------------- Ir -- line 38 ---------------------------------------- . pub INEFFECTIVE_OPEN_OPTIONS, . suspicious, . "usage of both `write(true)` and `append(true)` on same `OpenOptions`" . } . . declare_lint_pass!(IneffectiveOpenOptions => [INEFFECTIVE_OPEN_OPTIONS]); . . impl<'tcx> LateLintPass<'tcx> for IneffectiveOpenOptions { 274,968 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 137,736 ( 0.01%) if let ExprKind::MethodCall(name, recv, [_], _) = expr.kind 32 ( 0.00%) && name.ident.name == sym::open . && !expr.span.from_expansion() . && cx . .typeck_results() . .expr_ty(recv) . .peel_refs() . .is_diag_item(cx, sym::FsOpenOptions) . { . let mut append = false; -- line 56 ---------------------------------------- -- line 94 ---------------------------------------- . write_span, . "unnecessary use of `.write(true)` because there is `.append(true)`", . "remove `.write(true)`", . String::new(), . Applicability::MachineApplicable, . ); . } . } 274,968 ( 0.01%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/unwrap.rs -------------------------------------------------------------------------------- Ir -- line 170 ---------------------------------------- . impl Local { . fn snippet(&self, cx: &LateContext<'_>) -> Cow<'static, str> { . match *self { . Self::WithFieldAccess { span, .. } => snippet(cx.sess(), span, "_"), . Self::Pure { local_id } => cx.tcx.hir_name(local_id).to_string().into(), . } . } . 5 ( 0.00%) fn is_potentially_local_place(&self, place: &Place<'_>) -> bool { 2 ( 0.00%) match self { . Self::WithFieldAccess { . local_id, . field_indices, . .. . } => { . let field_projections = place . .projections . .iter() 2 ( 0.00%) .filter(|proj| matches!(proj.kind, ProjectionKind::Field(_, _))) . .collect::>(); 1 ( 0.00%) is_potentially_local_place(*local_id, place) . // If there were projections other than field projections, err on the side of caution and say that they . // _might_ be mutating something. . // . // The reason we use `<=` and not `==` is that a mutation of `struct` or `struct.field1` should count as . // mutation of the child fields such as `struct.field1.field2` 2 ( 0.00%) && field_projections.len() <= field_indices.len() 3 ( 0.00%) && iter::zip(&field_projections, field_indices.iter().copied().rev()).all(|(proj, field_idx)| { 3 ( 0.00%) match proj.kind { . ProjectionKind::Field(f_idx, _) => f_idx == field_idx, . // If this is a projection we don't expect, it _might_ be mutating something . _ => false, . } . }) . }, . Self::Pure { local_id } => is_potentially_local_place(*local_id, place), . } 5 ( 0.00%) } . } . . /// Contains information about whether a variable can be unwrapped. . #[derive(Clone, Debug)] . struct UnwrapInfo<'tcx> { . /// The variable that is checked . local: Local, . /// The if itself -- line 215 ---------------------------------------- -- line 236 ---------------------------------------- . if_expr: &'tcx Expr<'_>, . expr: &'tcx Expr<'_>, . branch: &'tcx Expr<'_>, . invert: bool, . is_entire_condition: bool, . ) -> Vec> { . fn option_or_result_call(cx: &LateContext<'_>, ty: Ty<'_>, method_name: Symbol) -> Option<(UnwrappableKind, bool)> { . match (ty.opt_diag_name(cx)?, method_name) { 2 ( 0.00%) (sym::Option, sym::is_some) => Some((UnwrappableKind::Option, true)), 1 ( 0.00%) (sym::Option, sym::is_none) => Some((UnwrappableKind::Option, false)), . (sym::Result, sym::is_ok) => Some((UnwrappableKind::Result, true)), . (sym::Result, sym::is_err) => Some((UnwrappableKind::Result, false)), . _ => None, . } . } . 532 ( 0.00%) fn inner<'tcx>( . cx: &LateContext<'tcx>, . if_expr: &'tcx Expr<'_>, . expr: &'tcx Expr<'_>, . branch: &'tcx Expr<'_>, . invert: bool, . is_entire_condition: bool, . out: &mut Vec>, . ) { 236 ( 0.00%) match expr.kind { 4 ( 0.00%) ExprKind::Binary(op, left, right) 98 ( 0.00%) if matches!( 64 ( 0.00%) (invert, op.node), . (false, BinOpKind::And | BinOpKind::BitAnd) | (true, BinOpKind::Or | BinOpKind::BitOr) . ) => . { 14 ( 0.00%) inner(cx, if_expr, left, branch, invert, false, out); 64 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unwrap.rs:clippy_lints::unwrap::collect_unwrap_info::inner'2 (2x) . inner(cx, if_expr, right, branch, invert, false, out); . }, . ExprKind::Unary(UnOp::Not, expr) => inner(cx, if_expr, expr, branch, !invert, false, out), 9 ( 0.00%) ExprKind::MethodCall(method_name, receiver, [], _) 36 ( 0.00%) if let Some(local) = extract_local(cx, receiver) 513 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unwrap.rs:clippy_lints::unwrap::extract_local (3x) 3 ( 0.00%) && let ty = cx.typeck_results().expr_ty(receiver) 120 ( 0.00%) => ???:::expr_ty (3x) . && let name = method_name.ident.name 6 ( 0.00%) && let Some((kind, unwrappable)) = option_or_result_call(cx, ty, name) => . { . let safe_to_unwrap = unwrappable != invert; . 4 ( 0.00%) out.push(UnwrapInfo { . local, . if_expr, . check: expr, . check_name: name, . branch, . safe_to_unwrap, . kind, . is_entire_condition, . }); . }, . _ => {}, . } 288 ( 0.00%) } . . let mut out = vec![]; 144 ( 0.00%) inner(cx, if_expr, expr, branch, invert, is_entire_condition, &mut out); 1,523 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unwrap.rs:clippy_lints::unwrap::collect_unwrap_info::inner (30x) 108 ( 0.00%) out . } . . /// Extracts either a local used by itself ([`Local::Pure`]), or (one or more levels of) field . /// access to a local ([`Local::WithFieldAccess`]) 888 ( 0.00%) fn extract_local(cx: &LateContext<'_>, mut expr: &Expr<'_>) -> Option { 111 ( 0.00%) let span = expr.span; . let mut field_indices = vec![]; 685 ( 0.00%) while let ExprKind::Field(recv, _) = expr.kind 182 ( 0.00%) && let Some(field_idx) = cx.typeck_results().opt_field_index(expr.hir_id) 1,026 ( 0.00%) => ???:::opt_field_index (26x) . { . field_indices.push(field_idx); . expr = recv; . } . let local_id = expr.res_local_id()?; 78 ( 0.00%) if field_indices.is_empty() { 156 ( 0.00%) Some(Local::Pure { local_id }) . } else { 104 ( 0.00%) Some(Local::WithFieldAccess { . local_id, 104 ( 0.00%) field_indices, . span, . }) . } 914 ( 0.00%) } . . /// A HIR visitor delegate that checks if a local variable of type `Option` or `Result` is mutated, . /// *except* for if `.as_mut()` is called. . /// The reason for why we allow that one specifically is that `.as_mut()` cannot change . /// the variant, and that is important because this lint relies on the fact that . /// `is_some` + `unwrap` is equivalent to `if let Some(..) = ..`, which it would not be if . /// the option is changed to None between `is_some` and `unwrap`, ditto for `Result`. . /// (And also `.as_mut()` is a somewhat common method that is still worth linting on.) -- line 329 ---------------------------------------- -- line 336 ---------------------------------------- . /// Checks if the parent of the expression pointed at by the given `HirId` is a call to . /// `.as_mut()`. . /// . /// Used by the mutation visitor to specifically allow `.as_mut()` calls. . /// In particular, the `HirId` that the visitor receives is the id of the local expression . /// (i.e. the `x` in `x.as_mut()`), and that is the reason for why we care about its parent . /// expression: that will be where the actual method call is. . fn is_as_mut_use(tcx: TyCtxt<'_>, expr_id: HirId) -> bool { 3 ( 0.00%) if let Node::Expr(mutating_expr) = tcx.parent_hir_node(expr_id) 88 ( 0.00%) => ???:::parent_hir_node (1x) . && let ExprKind::MethodCall(path, _, [], _) = mutating_expr.kind . { . path.ident.name == sym::as_mut . } else { . false . } . } . . impl<'tcx> Delegate<'tcx> for MutationVisitor<'tcx, '_> { . fn borrow(&mut self, cat: &PlaceWithHirId<'tcx>, diag_expr_id: HirId, bk: ty::BorrowKind) { 2 ( 0.00%) if let ty::BorrowKind::Mutable = bk 5 ( 0.00%) && self.local.is_potentially_local_place(&cat.place) 184 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unwrap.rs:::is_potentially_local_place (1x) 1 ( 0.00%) && !is_as_mut_use(self.tcx, diag_expr_id) . { . self.is_mutated = true; . } . } . . fn mutate(&mut self, cat: &PlaceWithHirId<'tcx>, _: HirId) { . if self.local.is_potentially_local_place(&cat.place) { . self.is_mutated = true; -- line 365 ---------------------------------------- -- line 369 ---------------------------------------- . fn consume(&mut self, _: &PlaceWithHirId<'tcx>, _: HirId) {} . . fn use_cloned(&mut self, _: &PlaceWithHirId<'tcx>, _: HirId) {} . . fn fake_read(&mut self, _: &PlaceWithHirId<'tcx>, _: FakeReadCause, _: HirId) {} . } . . impl<'tcx> UnwrappableVariablesVisitor<'_, 'tcx> { 324 ( 0.00%) fn visit_branch( . &mut self, . if_expr: &'tcx Expr<'_>, . cond: &'tcx Expr<'_>, . branch: &'tcx Expr<'_>, . else_branch: bool, . ) { . let prev_len = self.unwrappables.len(); 263 ( 0.00%) for unwrap_info in collect_unwrap_info(self.cx, if_expr, cond, branch, else_branch, true) { 4 ( 0.00%) let mut delegate = MutationVisitor { . is_mutated: false, . local: &unwrap_info.local, 2 ( 0.00%) tcx: self.cx.tcx, . }; . . let vis = ExprUseVisitor::for_clippy(self.cx, cond.hir_id.owner.def_id, &mut delegate); 3 ( 0.00%) vis.walk_expr(cond).into_ok(); 2,146 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir_typeck/src/expr_use_visitor.rs:>::walk_expr (1x) 3 ( 0.00%) vis.walk_expr(branch).into_ok(); 8,281 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir_typeck/src/expr_use_visitor.rs:>::walk_expr (1x) . 2 ( 0.00%) if delegate.is_mutated { . // if the variable is mutated, we don't know whether it can be unwrapped. . // it might have been changed to `None` in between `is_some` + `unwrap`. . continue; . } . self.unwrappables.push(unwrap_info); . } 108 ( 0.00%) walk_expr(self, branch); 23,076 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_expr::'2 (30x) . self.unwrappables.truncate(prev_len); 288 ( 0.00%) } . } . . enum AsRefKind { . AsRef, . AsMut, . } . . /// Checks if the expression is a method call to `as_{ref,mut}` and returns the receiver of it. . /// If it isn't, the expression itself is returned. . fn consume_option_as_ref<'tcx>(expr: &'tcx Expr<'tcx>) -> (&'tcx Expr<'tcx>, Option) { 284 ( 0.00%) if let ExprKind::MethodCall(path, recv, [], _) = expr.kind { 15 ( 0.00%) match path.ident.name { 60 ( 0.00%) sym::as_ref => (recv, Some(AsRefKind::AsRef)), . sym::as_mut => (recv, Some(AsRefKind::AsMut)), . _ => (expr, None), . } . } else { . (expr, None) . } . } . . impl<'tcx> Visitor<'tcx> for UnwrappableVariablesVisitor<'_, 'tcx> { . type NestedFilter = nested_filter::OnlyBodies; . 26,163 ( 0.00%) fn visit_expr(&mut self, expr: &'tcx Expr<'_>) { . // Skip checking inside closures since they are visited through `Unwrap::check_fn()` already. 19,893 ( 0.00%) if matches!(expr.kind, ExprKind::Closure(_)) { . return; . } . if let Some(higher::If { cond, then, r#else }) = higher::If::hir(expr) { 78 ( 0.00%) walk_expr(self, cond); 6,485 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_expr::'2 (26x) 156 ( 0.00%) self.visit_branch(expr, cond, then, false); 33,899 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unwrap.rs:::visit_branch (22x) 3,018 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unwrap.rs:::visit_branch'2 (4x) 52 ( 0.00%) if let Some(else_inner) = r#else { 130 ( 0.00%) self.visit_branch(expr, cond, else_inner, true); 3,063 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unwrap.rs:::visit_branch (8x) 1,916 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unwrap.rs:::visit_branch'2 (2x) . } . } else { . // find `unwrap[_err]()` or `expect("...")` calls: 108 ( 0.00%) if let ExprKind::MethodCall(method_name, self_arg, ..) = expr.kind 108 ( 0.00%) && let (self_arg, as_ref_kind) = consume_option_as_ref(self_arg) 1,056 ( 0.00%) && let Some(local) = extract_local(self.cx, self_arg) 339 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unwrap.rs:clippy_lints::unwrap::extract_local (5x) 525 ( 0.00%) && matches!(method_name.ident.name, sym::unwrap | sym::expect | sym::unwrap_err) . && let call_to_unwrap = matches!(method_name.ident.name, sym::unwrap | sym::expect) . && let Some(unwrappable) = self.unwrappables.iter().find(|u| u.local == local) . // Span contexts should not differ with the conditional branch . && let span_ctxt = expr.span.ctxt() . && unwrappable.branch.span.ctxt() == span_ctxt . && unwrappable.check.span.ctxt() == span_ctxt . && !expr.span.in_external_macro(self.cx.tcx.sess.source_map()) . { -- line 454 ---------------------------------------- -- line 505 ---------------------------------------- . expr.span, . format!("this call to `{}()` will always panic", method_name.ident.name), . |diag| { . diag.span_label(unwrappable.check.span, "because of this check"); . }, . ); . } . } 8,607 ( 0.00%) walk_expr(self, expr); 387,858 ( 0.02%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_expr:: (95x) . } 23,176 ( 0.00%) } . . fn maybe_tcx(&mut self) -> Self::MaybeTyCtxt { 96 ( 0.00%) self.cx.tcx . } . } . . impl<'tcx> LateLintPass<'tcx> for Unwrap { 728 ( 0.00%) fn check_fn( . &mut self, . cx: &LateContext<'tcx>, . kind: FnKind<'tcx>, . decl: &'tcx FnDecl<'_>, . body: &'tcx Body<'_>, . span: Span, . fn_id: LocalDefId, . ) { . if span.from_expansion() { . return; . } . 475 ( 0.00%) let mut v = UnwrappableVariablesVisitor { . unwrappables: Vec::new(), . cx, 95 ( 0.00%) msrv: self.msrv, . }; . 380 ( 0.00%) walk_fn(&mut v, kind, decl, body.id(), fn_id); 425,965 ( 0.02%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_fn:: (95x) 520 ( 0.00%) } . } 567 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_utils/src/attrs.rs -------------------------------------------------------------------------------- Ir -- line 8 ---------------------------------------- . use rustc_lexer::TokenKind; . use rustc_lint::LateContext; . use rustc_middle::ty::{AdtDef, TyCtxt}; . use rustc_session::Session; . use rustc_span::{Span, Symbol}; . use std::str::FromStr as _; . . /// Validates a single clippy attribute and emits errors for unknown or deprecated ones. 2,169 ( 0.00%) pub fn check_clippy_attr(sess: &Session, attr: &A) { 101 ( 0.00%) if let [clippy, segment2] = &*attr.path() . && *clippy == sym::clippy . { . let path_span = attr . .path_span() . .expect("Clippy attributes are unparsed and have a span"); . . match *segment2 { . sym::cyclomatic_complexity => { -- line 25 ---------------------------------------- -- line 40 ---------------------------------------- . | sym::msrv . | sym::has_significant_drop . | sym::format_args => {}, . _ => { . sess.dcx().span_err(path_span, "usage of unknown attribute"); . }, . } . } 1,687 ( 0.00%) } . . /// Given `attrs`, extract all the instances of a built-in Clippy attribute called `name` . pub fn get_builtin_attr<'a, A: AttributeExt + 'a>(attrs: &'a [A], name: Symbol) -> impl Iterator { . attrs.iter().filter(move |attr| { 65 ( 0.00%) if let [clippy, segment2] = &*attr.path() . && *clippy == sym::clippy . { . if *segment2 == sym::cyclomatic_complexity { . return false; . } . *segment2 == name . } else { . false -- line 61 ---------------------------------------- -- line 87 ---------------------------------------- . } . . /// Checks whether `attrs` contain `#[doc(hidden)]` . pub fn is_doc_hidden(attrs: &[impl AttributeExt]) -> bool { . attrs.iter().any(AttributeExt::is_doc_hidden) . } . . /// Checks whether the given ADT, or any of its fields/variants, are marked as `#[non_exhaustive]` 168 ( 0.00%) pub fn has_non_exhaustive_attr(tcx: TyCtxt<'_>, adt: AdtDef<'_>) -> bool { 42 ( 0.00%) adt.is_variant_list_non_exhaustive() 693 ( 0.00%) || find_attr!(tcx, adt.did(), NonExhaustive(..)) 1,995 ( 0.00%) => ???:>::get_attrs (21x) . || adt.variants().iter().any(|variant_def| { 498 ( 0.00%) variant_def.is_field_list_non_exhaustive() || find_attr!(tcx, variant_def.def_id, NonExhaustive(..)) 11,745 ( 0.00%) => ???:>::get_attrs (51x) . }) . || adt . .all_fields() 52 ( 0.00%) .any(|field_def| find_attr!(tcx, field_def.did, NonExhaustive(..))) 3,838 ( 0.00%) => ???:>::get_attrs (17x) 168 ( 0.00%) } . . /// Checks whether the given span contains a `#[cfg(..)]` attribute 35 ( 0.00%) pub fn span_contains_cfg(cx: &LateContext<'_>, s: Span) -> bool { . s.check_text(cx, |src| { . // PERF: A `#[cfg]` needs a literal `#`, so skip the lexer when the source has none. 26 ( 0.00%) if !src.contains('#') { . return false; . } . . let mut iter = tokenize_with_text(src); . . // Search for the token sequence [`#`, `[`, `cfg`] . while iter.any(|(t, ..)| matches!(t, TokenKind::Pound)) { . let mut iter = iter.by_ref().skip_while(|(t, ..)| { -- line 118 ---------------------------------------- -- line 124 ---------------------------------------- . if matches!(iter.next(), Some((TokenKind::OpenBracket, ..))) . && matches!(iter.next(), Some((TokenKind::Ident, "cfg", _))) . { . return true; . } . } . false . }) 105 ( 0.00%) } . . /// Currently used to keep track of the current value of `#[clippy::cognitive_complexity(N)]` . pub struct LimitStack { . default: u64, . stack: Vec, . } . . impl Drop for LimitStack { -- line 140 ---------------------------------------- -- line 149 ---------------------------------------- . /// Initialize the stack starting with a default value, which usually comes from configuration . pub fn new(limit: u64) -> Self { . Self { . default: limit, . stack: vec![], . } . } . pub fn limit(&self) -> u64 { 95 ( 0.00%) self.stack.last().copied().unwrap_or(self.default) . } . pub fn push_attrs(&mut self, sess: &Session, attrs: &[impl AttributeExt], name: Symbol) { . let stack = &mut self.stack; 283,760 ( 0.01%) parse_attrs(sess, attrs, name, |val| stack.push(val)); 1,422,585 ( 0.07%) => site/frontend/rust-clippy/clippy_utils/src/attrs.rs:clippy_utils::attrs::parse_attrs::<::push_attrs::{closure#0}, rustc_hir::hir::Attribute> (70,940x) . } . pub fn pop_attrs(&mut self, sess: &Session, attrs: &[impl AttributeExt], name: Symbol) { . let stack = &mut self.stack; 283,760 ( 0.01%) parse_attrs(sess, attrs, name, |val| { 1,422,664 ( 0.07%) => site/frontend/rust-clippy/clippy_utils/src/attrs.rs:clippy_utils::attrs::parse_attrs::<::pop_attrs::{closure#0}, rustc_hir::hir::Attribute> (70,940x) . let popped = stack.pop(); . debug_assert_eq!(popped, Some(val)); . }); . } . } . 1,418,800 ( 0.07%) fn parse_attrs(sess: &Session, attrs: &[impl AttributeExt], name: Symbol, mut f: F) { . for attr in get_builtin_attr(attrs, name) { . let Some(value) = attr.value_str() else { . sess.dcx().span_err(attr.span(), "bad clippy attribute"); . continue; . }; . let Ok(value) = u64::from_str(value.as_str()) else { . sess.dcx().span_err(attr.span(), "not a number"); . continue; . }; . f(value); . } 1,135,040 ( 0.05%) } 70,996 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/replace_box.rs -------------------------------------------------------------------------------- Ir -- line 37 ---------------------------------------- . #[clippy::version = "1.92.0"] . pub REPLACE_BOX, . perf, . "assigning a newly created box to `Box` is inefficient" . } . . impl_lint_pass!(ReplaceBox => [REPLACE_BOX]); . 5 ( 0.00%) #[derive(Default)] . pub struct ReplaceBox { . consumed_locals: FxHashSet, . loaded_bodies: SmallVec<[BodyId; 2]>, . } . . impl ReplaceBox { . fn get_consumed_locals(&mut self, cx: &LateContext<'_>) -> &FxHashSet { . if let Some(body_id) = cx.enclosing_body -- line 53 ---------------------------------------- -- line 66 ---------------------------------------- . } . . &self.consumed_locals . } . } . . impl LateLintPass<'_> for ReplaceBox { . fn check_body_post(&mut self, _: &LateContext<'_>, body: &Body<'_>) { 282 ( 0.00%) if self.loaded_bodies.first().is_some_and(|&x| x == body.id()) { . self.consumed_locals.clear(); . self.loaded_bodies.clear(); . } . } . 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &'_ Expr<'_>) { 137,484 ( 0.01%) if let ExprKind::Assign(lhs, rhs, _) = &expr.kind 84 ( 0.00%) && !lhs.span.from_expansion() 84 ( 0.00%) && !rhs.span.from_expansion() 54 ( 0.00%) && let lhs_ty = cx.typeck_results().expr_ty(lhs) 1,080 ( 0.00%) => ???:::expr_ty (27x) 108 ( 0.00%) && let Some(inner_ty) = lhs_ty.boxed_ty() 213 ( 0.00%) => ???:::boxed_ty (27x) . // No diagnostic for late-initialized locals . && lhs.res_local_id().is_none_or(|local| local_is_initialized(cx, local)) . // No diagnostic if this is a local that has been moved, or the field . // of a local that has been moved, or several chained field accesses of a local . && local_base(lhs).is_none_or(|(base_id, _)| { . !self.get_consumed_locals(cx).contains(&base_id) . }) . { -- line 93 ---------------------------------------- -- line 132 ---------------------------------------- . expr.span, . "replace existing content with inner value instead", . suggestion, . app, . ); . }); . } . } 549,936 ( 0.03%) } . } . . fn is_default_call(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { . matches!(expr.kind, ExprKind::Call(func, _args) if is_default_equivalent_call(cx, func, Some(expr))) . } . . fn get_box_new_payload<'tcx>(cx: &LateContext<'_>, expr: &Expr<'tcx>) -> Option<&'tcx Expr<'tcx>> { . if let ExprKind::Call(box_new, [arg]) = expr.kind -- line 148 ---------------------------------------- 83 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/redundant_closure_call.rs -------------------------------------------------------------------------------- Ir -- line 88 ---------------------------------------- . &'tcx hir::Expr<'tcx>, . &'tcx hir::FnDecl<'tcx>, . ty::Asyncness, . &'tcx [Param<'tcx>], . CaptureBy, . )> { . let mut data = None; . 348 ( 0.00%) while let ExprKind::Closure(closure) = expr.kind . && let body = cx.tcx.hir_body(closure.body) . && !contains_early_return(body.value) . && steps > 0 . { . let mut unwrapped_body_value = body.value; . let mut asyncness = ty::Asyncness::No; . let mut capture_clause = closure.capture_clause; . -- line 104 ---------------------------------------- -- line 147 ---------------------------------------- . /// ^^ this is the call expression we were given . /// ^^ this is what we want to return (and the depth is 3) . /// ``` . fn get_parent_call_exprs<'tcx>( . cx: &LateContext<'tcx>, . mut expr: &'tcx hir::Expr<'tcx>, . ) -> (&'tcx hir::Expr<'tcx>, usize) { . let mut depth = 1; 870 ( 0.00%) while let Some(parent) = get_parent_expr(cx, expr) 17,226 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (174x) 145 ( 0.00%) && let ExprKind::Call(recv, _) = parent.kind . && expr.span == recv.span . { . expr = parent; . depth += 1; . } . (expr, depth) . } . . impl<'tcx> LateLintPass<'tcx> for RedundantClosureCall { 549,936 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>) { 412,158 ( 0.02%) if expr.span.in_external_macro(cx.sess().source_map()) { . return; . } . 174 ( 0.00%) if let ExprKind::Call(recv, _) = expr.kind . // don't lint if the receiver is a call, too. . // we do this in order to prevent linting multiple times; consider: . // `(|| || 1)()()` . // ^^ we only want to lint for this call (but we walk up the calls to consider both calls). . // without this check, we'd end up linting twice. 348 ( 0.00%) && !matches!(recv.kind, ExprKind::Call(..)) . // Check if `recv` comes from a macro expansion. If it does, make sure that it's an expansion that is . // the same as the one the call is in. . // For instance, let's assume `x!()` returns a closure: . // B ---v . // x!()() . // ^- A . // The call happens in the expansion `A`, while the closure originates from the expansion `B`. . // We don't want to suggest replacing `x!()()` with `x!()`. 348 ( 0.00%) && recv.span.ctxt().outer_expn() == expr.span.ctxt().outer_expn() . && let (full_expr, call_depth) = get_parent_call_exprs(cx, expr) . && let Some((mut body, fn_decl, coroutine_kind, params, capture_clause)) = . find_innermost_closure(cx, recv, call_depth) . // outside macros we lint properly. Inside macros, we lint only ||() style closures. . && (!matches!(expr.span.ctxt().outer_expn_data().kind, ExpnKind::Macro(_, _)) || params.is_empty()) . { . span_lint_and_then( . cx, -- line 194 ---------------------------------------- -- line 229 ---------------------------------------- . .maybe_paren(); . } . . diag.span_suggestion(full_expr.span, "try doing something like", hint, applicability); . } . }, . ); . } 549,936 ( 0.03%) } . 1,204 ( 0.00%) fn check_block(&mut self, cx: &LateContext<'tcx>, block: &'tcx hir::Block<'_>) { . fn count_closure_usage<'tcx>( . cx: &LateContext<'tcx>, . block: &'tcx hir::Block<'_>, . path: &'tcx hir::Path<'tcx>, . ) -> usize { . struct ClosureUsageCount<'a, 'tcx> { . cx: &'a LateContext<'tcx>, . path: &'tcx hir::Path<'tcx>, -- line 247 ---------------------------------------- -- line 265 ---------------------------------------- . self.cx.tcx . } . } . let mut closure_usage_count = ClosureUsageCount { cx, path, count: 0 }; . closure_usage_count.visit_block(block); . closure_usage_count.count . } . 213 ( 0.00%) for w in block.stmts.windows(2) { 163 ( 0.00%) if let hir::StmtKind::Let(local) = w[0].kind 63 ( 0.00%) && let Some(t) = local.init 42 ( 0.00%) && let ExprKind::Closure { .. } = t.kind . && let hir::PatKind::Binding(_, _, ident, _) = local.pat.kind . && let hir::StmtKind::Semi(second) = w[1].kind . && let ExprKind::Assign(_, call, _) = second.kind . && let ExprKind::Call(closure, _) = call.kind . && let ExprKind::Path(hir::QPath::Resolved(_, path)) = closure.kind . && ident == path.segments[0].ident . && count_closure_usage(cx, block, path) == 1 . { -- line 284 ---------------------------------------- -- line 286 ---------------------------------------- . cx, . REDUNDANT_CLOSURE_CALL, . second.hir_id, . second.span, . "closure called just once immediately after it was declared", . ); . } . } 1,376 ( 0.00%) } . } 1,198 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/casts/needless_type_cast.rs -------------------------------------------------------------------------------- Ir -- line 19 ---------------------------------------- . init: Option<&'a Expr<'a>>, . } . . struct UsageInfo<'a> { . cast_to: Option>, . in_generic_context: bool, . } . 1,128 ( 0.00%) pub(super) fn check<'a>(cx: &LateContext<'a>, body: &Body<'a>) { . let mut bindings: FxHashMap> = FxHashMap::default(); . 141 ( 0.00%) for_each_expr_without_closures(body.value, |expr| { 343,424 ( 0.02%) match expr.kind { 162 ( 0.00%) ExprKind::Block(block, _) => { 162 ( 0.00%) for stmt in block.stmts { 341 ( 0.00%) if let StmtKind::Let(let_stmt) = stmt.kind { 111 ( 0.00%) collect_binding_from_local(cx, let_stmt, &mut bindings); 432 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/casts/needless_type_cast.rs:clippy_lints::casts::needless_type_cast::collect_binding_from_local (24x) . } . } . }, 3 ( 0.00%) ExprKind::Let(let_expr) => { 9 ( 0.00%) collect_binding_from_let(cx, let_expr, &mut bindings); 54 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/casts/needless_type_cast.rs:clippy_lints::casts::needless_type_cast::collect_binding_from_let (3x) . }, . _ => {}, . } . ControlFlow::<()>::Continue(()) . }); . . #[allow(rustc::potential_query_instability)] 423 ( 0.00%) let mut binding_vec: Vec<_> = bindings.into_iter().collect(); . binding_vec.sort_by_key(|(_, info)| info.ty_span.lo()); . 141 ( 0.00%) for (hir_id, binding_info) in binding_vec { . check_binding_usages(cx, body, hir_id, &binding_info); . } 1,128 ( 0.00%) } . 21 ( 0.00%) fn collect_binding_from_let<'a>( . cx: &LateContext<'a>, . let_expr: &rustc_hir::LetExpr<'a>, . bindings: &mut FxHashMap>, . ) { 3 ( 0.00%) if let_expr.ty.is_none() . || let_expr.span.from_expansion() . || has_generic_return_type(cx, let_expr.init) . || contains_unsafe(let_expr.init) . { . return; . } . . if let PatKind::Binding(_, hir_id, _, _) = let_expr.pat.kind -- line 69 ---------------------------------------- -- line 76 ---------------------------------------- . BindingInfo { . source_ty: ty, . ty_span: ty_hir.span, . init: Some(let_expr.init), . }, . ); . } . } 24 ( 0.00%) } . 259 ( 0.00%) fn collect_binding_from_local<'a>( . cx: &LateContext<'a>, . let_stmt: &LetStmt<'a>, . bindings: &mut FxHashMap>, . ) { 37 ( 0.00%) if let_stmt.ty.is_none() . || let_stmt.span.from_expansion() . || let_stmt . .init . .is_some_and(|init| has_generic_return_type(cx, init) || contains_unsafe(init)) . { . return; . } . -- line 99 ---------------------------------------- -- line 107 ---------------------------------------- . BindingInfo { . source_ty: ty, . ty_span: ty_hir.span, . init: let_stmt.init, . }, . ); . } . } 296 ( 0.00%) } . . fn contains_unsafe(expr: &Expr<'_>) -> bool { . for_each_expr_without_closures(expr, |e| { . if let ExprKind::Block(block, _) = e.kind . && let BlockCheckMode::UnsafeBlock(UnsafeSource::UserProvided) = block.rules . { . return ControlFlow::Break(()); . } -- line 123 ---------------------------------------- 66,640 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs -------------------------------------------------------------------------------- Ir -- line 91 ---------------------------------------- . . pub struct NonExpressiveNames { . pub single_char_binding_names_threshold: u64, . } . . impl NonExpressiveNames { . pub fn new(conf: &'static Conf) -> Self { . Self { 3 ( 0.00%) single_char_binding_names_threshold: conf.single_char_binding_names_threshold, . } . } . } . . struct ExistingName { . interned: Symbol, . span: Span, . len: usize, -- line 107 ---------------------------------------- -- line 113 ---------------------------------------- . cx: &'a EarlyContext<'tcx>, . threshold: u64, . . /// A stack of scopes containing the single-character bindings in each scope. . single_char_names: Vec>, . } . . impl SimilarNamesLocalVisitor<'_, '_> { 3,266 ( 0.00%) fn check_single_char_names(&self) { 1,633 ( 0.00%) if self.single_char_names.last().map(Vec::len) == Some(0) { . return; . } . . let num_single_char_names = self.single_char_names.iter().flatten().count(); 100 ( 0.00%) if num_single_char_names as u64 > self.threshold { . let span = self . .single_char_names . .iter() . .flatten() . .map(|ident| ident.span) . .collect::>(); . span_lint( . self.cx, . MANY_SINGLE_CHAR_NAMES, . span, . format!("{num_single_char_names} bindings with single-character names in scope"), . ); . } 4,899 ( 0.00%) } . } . . // this list contains lists of names that are allowed to be similar . // the assumption is that no name is ever contained in multiple lists. . const ALLOWED_TO_BE_SIMILAR: &[&[&str]] = &[ . &["parsed", "parser"], . &["lhs", "rhs"], . &["tx", "rx"], -- line 149 ---------------------------------------- -- line 155 ---------------------------------------- . &["iter", "item"], . ]; . . /// Characters that look visually similar . const SIMILAR_CHARS: &[(char, char)] = &[('l', 'i'), ('l', '1'), ('i', '1'), ('u', 'v')]; . . /// Return true if two characters are visually similar . fn chars_are_similar(a: char, b: char) -> bool { 98 ( 0.00%) a == b || SIMILAR_CHARS.contains(&(a, b)) || SIMILAR_CHARS.contains(&(b, a)) . } . . struct SimilarNamesNameVisitor<'a, 'tcx, 'b>(&'b mut SimilarNamesLocalVisitor<'a, 'tcx>); . . impl<'tcx> Visitor<'tcx> for SimilarNamesNameVisitor<'_, 'tcx, '_> { 15,462 ( 0.00%) fn visit_pat(&mut self, pat: &'tcx Pat) { 15,135 ( 0.00%) match pat.kind { 664 ( 0.00%) PatKind::Ident(_, ident, _) => { 332 ( 0.00%) if !pat.span.from_expansion() { 166 ( 0.00%) self.check_ident(ident); . } . }, . PatKind::Struct(_, _, ref fields, _) => { . for field in fields { . if !field.is_shorthand { . self.visit_pat(&field.pat); . } . } . }, . // just go through the first pattern, as either all patterns . // bind the same bindings or rustc would have errored much earlier 2 ( 0.00%) PatKind::Or(ref pats) => self.visit_pat(&pats[0]), . _ => walk_pat(self, pat), . } 1,328 ( 0.00%) } . } . . #[must_use] . fn get_exemptions(interned_name: &str) -> Option<&'static [&'static str]> { . ALLOWED_TO_BE_SIMILAR . .iter() . .find(|&&list| allowed_to_be_similar(interned_name, list)) . .copied() . } . . #[must_use] . fn allowed_to_be_similar(interned_name: &str, list: &[&str]) -> bool { . list.iter() 977 ( 0.00%) .any(|&name| interned_name.starts_with(name) || interned_name.ends_with(name)) . } . . impl SimilarNamesNameVisitor<'_, '_, '_> { 171 ( 0.00%) fn check_short_ident(&mut self, ident: Ident) { . // Ignore shadowing . if self . .0 . .single_char_names . .iter() . .flatten() . .any(|id| id.name == ident.name) . { . return; . } . . if let Some(scope) = &mut self.0.single_char_names.last_mut() { . scope.push(ident); . } 228 ( 0.00%) } . . fn check_ident(&mut self, ident: Ident) { . let interned_name = ident.name.as_str(); . // name can be empty if it comes from recovery . if interned_name.chars().any(char::is_uppercase) || interned_name.is_empty() { . return; . } . if interned_name.chars().all(|c| c.is_ascii_digit() || c == '_') { -- line 229 ---------------------------------------- -- line 230 ---------------------------------------- . span_lint( . self.0.cx, . JUST_UNDERSCORES_AND_DIGITS, . ident.span, . "consider choosing a more descriptive name", . ); . return; . } 155 ( 0.00%) if interned_name.starts_with('_') { . // these bindings are typically unused or represent an ignored portion of a destructuring pattern . return; . } . let count = interned_name.chars().count(); 308 ( 0.00%) if count < 3 { 154 ( 0.00%) if count == 1 { 228 ( 0.00%) self.check_short_ident(ident); 4,479 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::check_short_ident (51x) . } . return; . } . for existing_name in &self.0.names { 49 ( 0.00%) if allowed_to_be_similar(interned_name, existing_name.exemptions) { . continue; . } . . let existing_str = existing_name.interned.as_str(); . . // The first char being different is usually enough to set identifiers apart, as long . // as the characters aren't too similar. . if !chars_are_similar( . interned_name.chars().next().expect("len >= 1"), . existing_str.chars().next().expect("len >= 1"), . ) { . continue; . } . . // Skip similarity check if both names are exactly 3 characters 3 ( 0.00%) if count == 3 && existing_name.len == 3 { . continue; . } . 9 ( 0.00%) let dissimilar = match existing_name.len.cmp(&count) { 2 ( 0.00%) Ordering::Greater => existing_name.len - count != 1 || levenstein_not_1(interned_name, existing_str), 9 ( 0.00%) Ordering::Less => count - existing_name.len != 1 || levenstein_not_1(existing_str, interned_name), . Ordering::Equal => Self::equal_length_strs_not_similar(interned_name, existing_str), . }; . 2 ( 0.00%) if dissimilar { . continue; . } . 7 ( 0.00%) span_lint_and_then( 739 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then::::check_ident::{closure#1}> (1x) 1 ( 0.00%) self.0.cx, . SIMILAR_NAMES, 1 ( 0.00%) ident.span, . "binding's name is too similar to existing binding", . |diag| { . diag.span_note(existing_name.span, "existing binding defined here"); . }, . ); . return; . } . self.0.names.push(ExistingName { . interned: ident.name, 76 ( 0.00%) span: ident.span, . len: count, . exemptions: get_exemptions(interned_name).unwrap_or(&[]), . }); . } . . fn equal_length_strs_not_similar(interned_name: &str, existing_name: &str) -> bool { . let mut interned_chars = interned_name.chars(); . let mut existing_chars = existing_name.chars(); . let first_i = interned_chars.next().expect("we know we have at least one char"); . let first_e = existing_chars.next().expect("we know we have at least one char"); 13 ( 0.00%) let eq_or_numeric = |(a, b): (char, char)| a == b || a.is_numeric() && b.is_numeric(); . . if eq_or_numeric((first_i, first_e)) { . let last_i = interned_chars.next_back().expect("we know we have at least two chars"); . let last_e = existing_chars.next_back().expect("we know we have at least two chars"); . if eq_or_numeric((last_i, last_e)) { 2 ( 0.00%) if interned_chars . .zip(existing_chars) . .filter(|&ie| !eq_or_numeric(ie)) . .count() . != 1 . { . return true; . } . } else { -- line 318 ---------------------------------------- -- line 355 ---------------------------------------- . let single_char_count = self.single_char_names.len(); . f(self); . self.names.truncate(n); . self.single_char_names.truncate(single_char_count); . } . } . . impl<'tcx> Visitor<'tcx> for SimilarNamesLocalVisitor<'_, 'tcx> { 315 ( 0.00%) fn visit_local(&mut self, local: &'tcx Local) { . if let Some((init, els)) = &local.kind.init_else_opt() { . self.apply(|this| walk_expr(this, init)); . if let Some(els) = els { . self.apply(|this| walk_block(this, els)); . } . } . // add the pattern after the expression because the bindings aren't available . // yet in the init . // expression 140 ( 0.00%) SimilarNamesNameVisitor(self).visit_pat(&local.pat); 19,801 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::visit_pat (35x) 280 ( 0.00%) } 630 ( 0.00%) fn visit_block(&mut self, blk: &'tcx Block) { 20 ( 0.00%) self.single_char_names.push(vec![]); . . self.apply(|this| walk_block(this, blk)); . 140 ( 0.00%) self.check_single_char_names(); 425 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::check_single_char_names (33x) . self.single_char_names.pop(); 544 ( 0.00%) } 13,320 ( 0.00%) fn visit_arm(&mut self, arm: &'tcx Arm) { 15 ( 0.00%) self.single_char_names.push(vec![]); . . self.apply(|this| { 5,920 ( 0.00%) SimilarNamesNameVisitor(this).visit_pat(&arm.pat); 161,965 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::visit_pat (1,468x) 4,440 ( 0.00%) if let Some(body) = &arm.body { . this.apply(|this| walk_expr(this, body)); . } . }); . 2,960 ( 0.00%) self.check_single_char_names(); 17,641 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::check_single_char_names (1,468x) . self.single_char_names.pop(); 11,840 ( 0.00%) } . fn visit_item(&mut self, _: &Item) { . // do not recurse into inner items . } . } . . impl EarlyLintPass for NonExpressiveNames { . fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) { 264 ( 0.00%) if item.span.in_external_macro(cx.sess().source_map()) { . return; . } . 94 ( 0.00%) if let ItemKind::Fn(ast::Fn { . ref sig, . body: Some(ref blk), . .. 188 ( 0.00%) }) = item.kind . { 235 ( 0.00%) do_check(self, cx, &item.attrs, &sig.decl, blk); 443,809 ( 0.02%) => site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:clippy_lints::non_expressive_names::do_check (47x) . } . } . . fn check_impl_item(&mut self, cx: &EarlyContext<'_>, item: &AssocItem) { 227 ( 0.00%) if item.span.in_external_macro(cx.sess().source_map()) { . return; . } . 36 ( 0.00%) if let AssocItemKind::Fn(ast::Fn { . ref sig, . body: Some(ref blk), . .. 108 ( 0.00%) }) = item.kind . { 144 ( 0.00%) do_check(self, cx, &item.attrs, &sig.decl, blk); 74,602 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:clippy_lints::non_expressive_names::do_check (36x) . } . } . } . 913 ( 0.00%) fn do_check(lint: &NonExpressiveNames, cx: &EarlyContext<'_>, attrs: &[Attribute], decl: &FnDecl, blk: &Block) { . if !attrs.iter().any(|attr| attr.has_name(sym::test)) { 664 ( 0.00%) let mut visitor = SimilarNamesLocalVisitor { . names: Vec::new(), . cx, . threshold: lint.single_char_binding_names_threshold, 249 ( 0.00%) single_char_names: vec![vec![]], . }; . . // initialize with function arguments . for arg in &decl.inputs { 424 ( 0.00%) SimilarNamesNameVisitor(&mut visitor).visit_pat(&arg.pat); 36,966 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::visit_pat (106x) . } . // walk all other bindings . walk_block(&mut visitor, blk); . 83 ( 0.00%) visitor.check_single_char_names(); 1,878 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::check_single_char_names (83x) . } 664 ( 0.00%) } . . /// Precondition: `a_name.chars().count() < b_name.chars().count()`. . #[must_use] 1 ( 0.00%) fn levenstein_not_1(a_name: &str, b_name: &str) -> bool { . debug_assert!(a_name.chars().count() < b_name.chars().count()); . let mut a_chars = a_name.chars(); . let mut b_chars = b_name.chars(); 4 ( 0.00%) while let (Some(a), Some(b)) = (a_chars.next(), b_chars.next()) { 4 ( 0.00%) if a == b { . continue; . } . if let Some(b2) = b_chars.next() { . // check if there's just one character inserted 2 ( 0.00%) return a != b2 || a_chars.ne(b_chars); . } . // tuple . // ntuple . return true; . } . // for item in items . true 2 ( 0.00%) } 4,075 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs -------------------------------------------------------------------------------- Ir -- line 2128 ---------------------------------------- . // `ArcInner` structure itself is `Sync` because the inner data is . // `Sync` as well, so we're ok loaning out an immutable pointer to these . // contents. . unsafe { self.ptr.as_ref() } . } . . // Non-inlined part of `drop`. . #[inline(never)] 2 ( 0.00%) unsafe fn drop_slow(&mut self) { . // Drop the weak ref collectively held by all strong references when this . // variable goes out of scope. This ensures that the memory is deallocated . // even if the destructor of `T` panics. . // Take a reference to `self.alloc` instead of cloning because 1. it'll last long . // enough, and 2. you should be able to drop `Arc`s with unclonable allocators 2 ( 0.00%) let _weak = Weak { ptr: self.ptr, alloc: &self.alloc }; . . // Destroy the data at this time, even though we must not free the box . // allocation itself (there might still be weak pointers lying around). . // We cannot use `get_mut_unchecked` here, because `self.alloc` is borrowed. . unsafe { ptr::drop_in_place(&mut (*self.ptr.as_ptr()).data) }; . } . . /// Returns `true` if the two `Arc`s point to the same allocation in a vein similar to -- line 2150 ---------------------------------------- -- line 2424 ---------------------------------------- . // the worst already happened and we actually do overflow the `usize` counter. However, that . // requires the counter to grow from `isize::MAX` to `usize::MAX` between the increment . // above and the `abort` below, which seems exceedingly unlikely. . // . // This is a global invariant, and also applies when using a compare-exchange loop to increment . // counters in other methods. . // Otherwise, the counter could be brought to an almost-overflow using a compare-exchange loop, . // and then overflow using a few `fetch_add`s. 537 ( 0.00%) if old_size > MAX_REFCOUNT { . abort(); . } . 1,052 ( 0.00%) unsafe { Self::from_inner_in(self.ptr, self.alloc.clone()) } . } . } . . #[unstable(feature = "ergonomic_clones", issue = "132290")] . impl UseCloned for Arc {} . . #[unstable(feature = "share_trait", issue = "156756")] . impl Share for Arc {} . . #[stable(feature = "rust1", since = "1.0.0")] . impl Deref for Arc { . type Target = T; . . #[inline] . fn deref(&self) -> &T { 767,840 ( 0.04%) &self.inner().data . } . } . . #[unstable(feature = "pin_coerce_unsized_trait", issue = "150112")] . unsafe impl PinCoerceUnsized for Arc {} . . #[unstable(feature = "deref_pure_trait", issue = "87121")] . unsafe impl DerefPure for Arc {} -- line 2460 ---------------------------------------- -- line 2850 ---------------------------------------- . /// drop(foo); // Doesn't print anything . /// drop(foo2); // Prints "dropped!" . /// ``` . #[inline] . fn drop(&mut self) { . // Because `fetch_sub` is already atomic, we do not need to synchronize . // with other threads unless we are going to delete the object. This . // same logic applies to the below `fetch_sub` to the `weak` count. 97,316 ( 0.00%) if self.inner().strong.fetch_sub(1, Release) != 1 { . return; . } . . // This fence is needed to prevent reordering of use of the data and . // deletion of the data. Because it is marked `Release`, the decreasing . // of the reference count synchronizes with this `Acquire` fence. This . // means that use of the data happens before decreasing the reference . // count, which happens before this fence, which happens before the -- line 2866 ---------------------------------------- -- line 2893 ---------------------------------------- . // used by Default::default. . debug_assert!( . !ptr::addr_eq(self.ptr.as_ptr(), &STATIC_INNER_SLICE.inner), . "Arcs backed by a static should never reach a strong count of 0. \ . Likely decrement_strong_count or from_raw were called too many times.", . ); . . unsafe { 6 ( 0.00%) self.drop_slow(); 100 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:>>>::drop_slow (1x) 75 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:>>>::drop_slow (1x) . } . } . } . . impl Arc { . /// Attempts to downcast the `Arc` to a concrete type. . /// . /// # Examples -- line 2909 ---------------------------------------- -- line 3372 ---------------------------------------- . } . } . . /// Returns `None` when the pointer is dangling and there is no allocated `ArcInner`, . /// (i.e., when this `Weak` was created by `Weak::new`). . #[inline] . fn inner(&self) -> Option> { . let ptr = self.ptr.as_ptr(); 2 ( 0.00%) if is_dangling(ptr) { . None . } else { . // We are careful to *not* create a reference covering the "data" field, as . // the field may be mutated concurrently (for example, if the last `Arc` . // is dropped, the data field will be dropped in-place). . Some(unsafe { WeakInner { strong: &(*ptr).strong, weak: &(*ptr).weak } }) . } . } -- line 3388 ---------------------------------------- -- line 3524 ---------------------------------------- . // the memory orderings . // . // It's not necessary to check for the locked state here, because the . // weak count can only be locked if there was precisely one weak ref, . // meaning that drop could only subsequently run ON that remaining weak . // ref, which can only happen after the lock is released. . let inner = if let Some(inner) = self.inner() { inner } else { return }; . 2 ( 0.00%) if inner.weak.fetch_sub(1, Release) == 1 { . acquire!(inner.weak); . . // Make sure we aren't trying to "deallocate" the shared static for empty slices . // used by Default::default. . debug_assert!( . !ptr::addr_eq(self.ptr.as_ptr(), &STATIC_INNER_SLICE.inner), . "Arc/Weaks backed by a static should never be deallocated. \ . Likely decrement_strong_count or from_raw were called too many times.", -- line 3540 ---------------------------------------- 2,157,563 ( 0.10%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/collapsible_if.rs -------------------------------------------------------------------------------- Ir -- line 90 ---------------------------------------- . pub fn new(conf: &'static Conf) -> Self { . Self { . msrv: conf.msrv.into(), . lint_commented_code: conf.lint_commented_code, . } . } . . fn check_collapsible_else_if(&self, cx: &LateContext<'_>, then_span: Span, else_block: &Block<'_>) { 8 ( 0.00%) if let Some(else_) = expr_block(else_block) 16 ( 0.00%) && !else_.span.from_expansion() 16 ( 0.00%) && let ExprKind::If(else_if_cond, ..) = else_.kind . && self.check_significant_tokens_and_expect_attrs(cx, else_block, else_, sym::collapsible_else_if) . { . span_lint_hir_and_then( . cx, . COLLAPSIBLE_ELSE_IF, . else_.hir_id, . else_block.span, . "this `else { if .. }` block can be collapsed", -- line 108 ---------------------------------------- -- line 160 ---------------------------------------- . ), . applicability, . ); . }, . ); . } . } . 128 ( 0.00%) fn check_collapsible_if_if(&self, cx: &LateContext<'_>, expr: &Expr<'_>, check: &Expr<'_>, then: &Block<'_>) { . if let Some(inner) = expr_block(then) 21 ( 0.00%) && let ExprKind::If(check_inner, _, None) = &inner.kind . && self.eligible_condition(cx, check_inner) . && expr.span.eq_ctxt(inner.span) . && self.check_significant_tokens_and_expect_attrs(cx, then, inner, sym::collapsible_if) . && let then_closing_bracket = { . let end = then.span.shrink_to_hi(); . end.with_lo(end.lo() - BytePos(1)) . } . && !span_contains_cfg(cx, inner.span.between(then_closing_bracket)) -- line 178 ---------------------------------------- -- line 209 ---------------------------------------- . . sugg.extend(parens_around(check)); . sugg.extend(parens_around(check_inner)); . . diag.multipart_suggestion("collapse nested if block", sugg, Applicability::MachineApplicable); . }, . ); . } 128 ( 0.00%) } . . fn eligible_condition(&self, cx: &LateContext<'_>, cond: &Expr<'_>) -> bool { 62 ( 0.00%) !matches!(cond.kind, ExprKind::Let(..)) || can_use_if_let_chains(cx, self.msrv) 18 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::can_use_if_let_chains (3x) . } . . // Check that nothing significant can be found between the initial `{` of `inner_if` and . // the beginning of `inner_if_expr`... . // . // Unless it's only an `#[expect(clippy::collapsible{,_else}_if)]` attribute, in which case we . // _do_ need to lint, in order to actually fulfill its expectation (#13365) . fn check_significant_tokens_and_expect_attrs( -- line 228 ---------------------------------------- -- line 256 ---------------------------------------- . . // There are other attributes, which are significant tokens -- check failed . _ => false, . } . } . } . . impl LateLintPass<'_> for CollapsibleIf { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 137,484 ( 0.01%) if let ExprKind::If(cond, then, else_) = &expr.kind 58 ( 0.00%) && !expr.span.from_expansion() . { 84 ( 0.00%) if let Some(else_) = else_ . // Short circuit if both `if` branches contain only a single `if {..} else {}`, as . // collapsing such blocks can lead to less readable code (#4971) 9 ( 0.00%) && !(single_inner_if_else(then) && single_inner_if_else(else_)) 45 ( 0.00%) && let ExprKind::Block(else_, None) = else_.kind . { 9 ( 0.00%) self.check_collapsible_else_if(cx, then.span, else_); . } else if else_.is_none() 44 ( 0.00%) && self.eligible_condition(cx, cond) 96 ( 0.00%) && let ExprKind::Block(then, None) = then.kind . { 224 ( 0.00%) self.check_collapsible_if_if(cx, expr, cond, then); 401 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/collapsible_if.rs:::check_collapsible_if_if (16x) . } . } 549,808 ( 0.03%) } . } . . /// Returns true if `expr` is a block that contains only one `if {..} else {}` statement . fn single_inner_if_else(expr: &Expr<'_>) -> bool { 45 ( 0.00%) if let ExprKind::Block(block, None) = expr.kind 8 ( 0.00%) && let Some(inner_expr) = expr_block(block) 16 ( 0.00%) && let ExprKind::If(_, _, else_) = inner_expr.kind . && else_.is_some() . { . true . } else { . false . } . } . . /// If `block` is a block with either one expression or a statement containing an expression, . /// return the expression. We don't peel blocks recursively, as extra blocks might be intentional. . fn expr_block<'tcx>(block: &Block<'tcx>) -> Option<&'tcx Expr<'tcx>> { 98 ( 0.00%) match (block.stmts, block.expr) { 106 ( 0.00%) ([], expr) => expr, 45 ( 0.00%) ([stmt], None) if let StmtKind::Semi(expr) = stmt.kind => Some(expr), . _ => None, . } . } . . /// If the expression is a `||`, suggest parentheses around it. . pub(super) fn parens_around(expr: &Expr<'_>) -> Vec<(Span, String)> { . if let ExprKind::Binary(op, _, _) = expr.peel_drop_temps().kind . && op.node == BinOpKind::Or -- line 311 ---------------------------------------- 36 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/explicit_write.rs -------------------------------------------------------------------------------- Ir -- line 47 ---------------------------------------- . . impl ExplicitWrite { . pub fn new(format_args: FormatArgsStorage) -> Self { . Self { format_args } . } . } . . impl<'tcx> LateLintPass<'tcx> for ExplicitWrite { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . // match call to unwrap 137,782 ( 0.01%) if let ExprKind::MethodCall(unwrap_fun, write_call, [], _) = expr.kind 78 ( 0.00%) && unwrap_fun.ident.name == sym::unwrap . // match call to write_fmt . && let ExprKind::MethodCall(write_fun, write_recv, [write_arg], _) = *look_in_block(cx, &write_call.kind) . && let ExprKind::Call(write_recv_path, []) = write_recv.kind . && write_fun.ident.name == sym::write_fmt . && let Some(def_id) = write_recv_path.basic_res().opt_def_id() . { . // match calls to std::io::stdout() / std::io::stderr () . let (dest_name, prefix) = match cx.tcx.get_diagnostic_name(def_id) { -- line 66 ---------------------------------------- -- line 105 ---------------------------------------- . EXPLICIT_WRITE, . expr.span, . format!("use of `{used}.unwrap()`"), . "try", . format!("{prefix}{sugg_mac}!({inputs_snippet})"), . applicability, . ); . } 549,936 ( 0.03%) } . } . . /// If `kind` is a block that looks like `{ let result = $expr; result }` then . /// returns $expr. Otherwise returns `kind`. . fn look_in_block<'tcx, 'hir>(cx: &LateContext<'tcx>, kind: &'tcx ExprKind<'hir>) -> &'tcx ExprKind<'hir> { . if let ExprKind::Block(block, _label @ None) = kind . && let Block { . stmts: [Stmt { kind: StmtKind::Let(local), .. }], -- line 121 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/control_flow.rs -------------------------------------------------------------------------------- Ir -- line 103 ---------------------------------------- . #[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")] . #[rustc_const_unstable(feature = "const_try", issue = "74935")] . const impl ops::Try for ControlFlow { . type Output = C; . type Residual = ControlFlow; . . #[inline] . fn from_output(output: Self::Output) -> Self { 140 ( 0.00%) ControlFlow::Continue(output) . } . . #[inline] . fn branch(self) -> ControlFlow { 206,238 ( 0.01%) match self { . ControlFlow::Continue(c) => ControlFlow::Continue(c), 4 ( 0.00%) ControlFlow::Break(b) => ControlFlow::Break(ControlFlow::Break(b)), . } . } . } . . #[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")] . #[rustc_const_unstable(feature = "const_try", issue = "74935")] . // Note: manually specifying the residual type instead of using the default to work around . // https://github.com/rust-lang/rust/issues/99940 . const impl ops::FromResidual> for ControlFlow { . #[inline] . fn from_residual(residual: ControlFlow) -> Self { . match residual { 2,127 ( 0.00%) ControlFlow::Break(b) => ControlFlow::Break(b), . } . } . } . . #[unstable(feature = "try_trait_v2_residual", issue = "91285")] . #[rustc_const_unstable(feature = "const_try_residual", issue = "91285")] . const impl ops::Residual for ControlFlow { . type TryType = ControlFlow; -- line 139 ---------------------------------------- -- line 149 ---------------------------------------- . /// . /// assert!(ControlFlow::<&str, i32>::Break("Stop right there!").is_break()); . /// assert!(!ControlFlow::<&str, i32>::Continue(3).is_break()); . /// ``` . #[inline] . #[stable(feature = "control_flow_enum_is", since = "1.59.0")] . #[rustc_const_stable(feature = "min_const_control_flow", since = "1.95.0")] . pub const fn is_break(&self) -> bool { 9 ( 0.00%) matches!(*self, ControlFlow::Break(_)) . } . . /// Returns `true` if this is a `Continue` variant. . /// . /// # Examples . /// . /// ``` . /// use std::ops::ControlFlow; -- line 165 ---------------------------------------- -- line 187 ---------------------------------------- . /// ``` . #[inline] . #[stable(feature = "control_flow_enum", since = "1.83.0")] . #[rustc_const_unstable(feature = "const_control_flow", issue = "148739")] . pub const fn break_value(self) -> Option . where . Self: [const] Destruct, . { 768 ( 0.00%) match self { 225 ( 0.00%) ControlFlow::Continue(..) => None, 1,676 ( 0.00%) ControlFlow::Break(x) => Some(x), . } . } . . /// Converts the `ControlFlow` into a `Result` which is `Ok` if the . /// `ControlFlow` was `Break` and `Err` if otherwise. . /// . /// # Examples . /// -- line 205 ---------------------------------------- -- line 427 ---------------------------------------- . impl ControlFlow { . /// Creates a `ControlFlow` from any type implementing `Try`. . #[inline] . #[rustc_const_unstable(feature = "const_control_flow", issue = "148739")] . pub(crate) const fn from_try(r: R) -> Self . where . R: [const] ops::Try, . { 2 ( 0.00%) match R::branch(r) { . ControlFlow::Continue(v) => ControlFlow::Continue(v), . ControlFlow::Break(v) => ControlFlow::Break(R::from_residual(v)), . } . } . . /// Converts a `ControlFlow` into any type implementing `Try`. . #[inline] . #[rustc_const_unstable(feature = "const_control_flow", issue = "148739")] . pub(crate) const fn into_try(self) -> R . where . R: [const] ops::Try, . { 3 ( 0.00%) match self { . ControlFlow::Continue(v) => R::from_output(v), . ControlFlow::Break(v) => v, . } . } . } 830 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/iter.rs -------------------------------------------------------------------------------- Ir -- line 181 ---------------------------------------- . #[inline] . fn next(&mut self) -> Option<(usize, char)> { . let pre_len = self.iter.iter.len(); . match self.iter.next() { . None => None, . Some(ch) => { . let index = self.front_offset; . let len = self.iter.iter.len(); 9,988 ( 0.00%) self.front_offset += pre_len - len; . Some((index, ch)) . } . } . } . . #[inline] . fn count(self) -> usize { . self.iter.count() -- line 197 ---------------------------------------- -- line 543 ---------------------------------------- . impl<'a, P> Iterator for $reverse_iterator<'a, P> . where . P: Pattern: ReverseSearcher<'a>>, . { . type Item = $iterty; . . #[inline] . fn next(&mut self) -> Option<$iterty> { 77,429 ( 0.00%) self.0.next_back() 5,126,217 ( 0.24%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/iter.rs:>::next_back (77,422x) . } . } . . $(#[$common_stability_attribute])* . impl<'a, P> Clone for $reverse_iterator<'a, P> . where . P: Pattern: Clone>, . { -- line 559 ---------------------------------------- -- line 636 ---------------------------------------- . .finish() . } . } . . impl<'a, P: Pattern> SplitInternal<'a, P> { . #[inline] . fn get_end(&mut self) -> Option<&'a str> { . if !self.finished { 38,723 ( 0.00%) self.finished = true; . 38,715 ( 0.00%) if self.allow_trailing_empty || self.end - self.start > 0 { . // SAFETY: `self.start` and `self.end` always lie on unicode boundaries. 67 ( 0.00%) let string = unsafe { self.matcher.haystack().get_unchecked(self.start..self.end) }; . return Some(string); . } . } . . None . } . . #[inline] . fn next(&mut self) -> Option<&'a str> { 232,180 ( 0.01%) if self.finished { . return None; . } . 38,757 ( 0.00%) let haystack = self.matcher.haystack(); . match self.matcher.next_match() { . // SAFETY: `Searcher` guarantees that `a` and `b` lie on unicode boundaries. . Some((a, b)) => unsafe { 19 ( 0.00%) let elt = haystack.get_unchecked(self.start..a); 19 ( 0.00%) self.start = b; . Some(elt) 10 ( 0.00%) }, 77 ( 0.00%) None => self.get_end(), . } . } . . #[inline] . fn next_inclusive(&mut self) -> Option<&'a str> { 5,912 ( 0.00%) if self.finished { . return None; . } . 408 ( 0.00%) let haystack = self.matcher.haystack(); . match self.matcher.next_match() { . // SAFETY: `Searcher` guarantees that `b` lies on unicode boundary, . // and self.start is either the start of the original string, . // or `b` was assigned to it, so it also lies on unicode boundary. . Some((_, b)) => unsafe { 168 ( 0.00%) let elt = haystack.get_unchecked(self.start..b); 168 ( 0.00%) self.start = b; . Some(elt) 168 ( 0.00%) }, 238 ( 0.00%) None => self.get_end(), . } . } . . #[inline] 542,003 ( 0.03%) fn next_back(&mut self) -> Option<&'a str> . where . P::Searcher<'a>: ReverseSearcher<'a>, . { 154,858 ( 0.01%) if self.finished { . return None; . } . 77,436 ( 0.00%) if !self.allow_trailing_empty { . self.allow_trailing_empty = true; . match self.next_back() { . Some(elt) if !elt.is_empty() => return Some(elt), . _ => { . if self.finished { . return None; . } . } . } . } . 116,154 ( 0.01%) let haystack = self.matcher.haystack(); . match self.matcher.next_match_back() { . // SAFETY: `Searcher` guarantees that `a` and `b` lie on unicode boundaries. . Some((a, b)) => unsafe { 7 ( 0.00%) let elt = haystack.get_unchecked(b..self.end); 7 ( 0.00%) self.end = a; . Some(elt) . }, . // SAFETY: `self.start` and `self.end` always lie on unicode boundaries. . None => unsafe { 38,711 ( 0.00%) self.finished = true; 77,422 ( 0.00%) Some(haystack.get_unchecked(self.start..self.end)) . }, . } 619,439 ( 0.03%) } . . #[inline] . fn next_back_inclusive(&mut self) -> Option<&'a str> . where . P::Searcher<'a>: ReverseSearcher<'a>, . { . if self.finished { . return None; -- line 737 ---------------------------------------- -- line 1161 ---------------------------------------- . #[derive(Clone, Debug)] . pub struct Lines<'a>(pub(super) Map, LinesMap>); . . #[stable(feature = "rust1", since = "1.0.0")] . impl<'a> Iterator for Lines<'a> { . type Item = &'a str; . . #[inline] 1,680 ( 0.00%) fn next(&mut self) -> Option<&'a str> { . self.0.next() 2,160 ( 0.00%) } . . #[inline] . fn size_hint(&self) -> (usize, Option) { . self.0.size_hint() . } . . #[inline] . fn last(mut self) -> Option<&'a str> { -- line 1179 ---------------------------------------- 628,008 ( 0.03%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/filter.rs -------------------------------------------------------------------------------- Ir -- line 20 ---------------------------------------- . #[derive(Clone)] . pub struct Filter { . // Used for `SplitWhitespace` and `SplitAsciiWhitespace` `as_str` methods . pub(crate) iter: I, . predicate: P, . } . impl Filter { . pub(in crate::iter) const fn new(iter: I, predicate: P) -> Filter { 222,308 ( 0.01%) Filter { iter, predicate } . } . } . . impl Filter . where . I: Iterator, . P: FnMut(&I::Item) -> bool, . { -- line 36 ---------------------------------------- -- line 71 ---------------------------------------- . f.debug_struct("Filter").field("iter", &self.iter).finish() . } . } . . fn filter_fold( . mut predicate: impl FnMut(&T) -> bool, . mut fold: impl FnMut(Acc, T) -> Acc, . ) -> impl FnMut(Acc, T) -> Acc { 129 ( 0.00%) move |acc, item| if predicate(&item) { fold(acc, item) } else { acc } . } . . fn filter_try_fold<'a, T, Acc, R: Try>( . predicate: &'a mut impl FnMut(&T) -> bool, . mut fold: impl FnMut(Acc, T) -> R + 'a, . ) -> impl FnMut(Acc, T) -> R + 'a { 137,579 ( 0.01%) move |acc, item| if predicate(&item) { fold(acc, item) } else { try { acc } } . } . . #[stable(feature = "rust1", since = "1.0.0")] . impl Iterator for Filter . where . P: FnMut(&I::Item) -> bool, . { . type Item = I::Item; . . #[inline] 448 ( 0.00%) fn next(&mut self) -> Option { . self.iter.find(&mut self.predicate) 448 ( 0.00%) } . . #[inline] . fn next_chunk( . &mut self, . ) -> Result<[Self::Item; N], array::IntoIter> { . // avoid codegen for the dead branch . let fun = const { . if crate::mem::needs_drop::() { -- line 107 ---------------------------------------- -- line 130 ---------------------------------------- . // less readable and also less backwards-compatible to Rust before 1.10. . // . // Using the branchless version will also simplify the LLVM byte code, thus . // leaving more budget for LLVM optimizations. . #[inline] . fn count(self) -> usize { . #[inline] . fn to_usize(mut predicate: impl FnMut(&T) -> bool) -> impl FnMut(T) -> usize { 2,840 ( 0.00%) move |x| predicate(&x) as usize . } . . let before = self.iter.size_hint().1.unwrap_or(usize::MAX); . let total = self.iter.map(to_usize(self.predicate)).sum(); . // SAFETY: `total` and `before` came from the same iterator of type `I` . unsafe { . ::assume_count_le_upper_bound(total, before); . } -- line 146 ---------------------------------------- -- line 149 ---------------------------------------- . . #[inline] . fn try_fold(&mut self, init: Acc, fold: Fold) -> R . where . Self: Sized, . Fold: FnMut(Acc, Self::Item) -> R, . R: Try, . { 3 ( 0.00%) self.iter.try_fold(init, filter_try_fold(&mut self.predicate, fold)) 217 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/chain.rs:, clippy_lints::loops::manual_memcpy::get_assignments::{closure#0}>, core::option::IntoIter<&rustc_hir::hir::Expr>> as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::adapters::filter::filter_try_fold<&rustc_hir::hir::Expr, (), core::ops::control_flow::ControlFlow>, clippy_lints::loops::manual_memcpy::get_assignments::{closure#1}, core::iter::adapters::map::map_try_fold<&rustc_hir::hir::Expr, core::option::Option<(&rustc_hir::hir::Expr, &rustc_hir::hir::Expr)>, (), core::ops::control_flow::ControlFlow>, clippy_lints::loops::manual_memcpy::get_assignment, &mut &mut core::iter::adapters::map::map_try_fold, core::option::Option<(rustc_middle::ty::Ty, clippy_lints::loops::manual_memcpy::IndexExpr, clippy_lints::loops::manual_memcpy::IndexExpr)>, (), core::ops::control_flow::ControlFlow>, clippy_lints::loops::manual_memcpy::check::{closure#0}, core::iter::adapters::map::map_try_fold, core::option::Option, (), core::ops::control_flow::ControlFlow>, clippy_lints::loops::manual_memcpy::check::{closure#1}, , clippy_lints::loops::manual_memcpy::get_assignments::{closure#0}>, core::option::IntoIter<&rustc_hir::hir::Expr>>, clippy_lints::loops::manual_memcpy::get_assignments::{closure#1}>, clippy_lints::loops::manual_memcpy::get_assignment>>>, core::option::IntoIter>>, clippy_lints::loops::manual_memcpy::check::{closure#0}>, clippy_lints::loops::manual_memcpy::check::{closure#1}>, core::option::Option> as core::iter::traits::iterator::Iterator>::try_fold<(), core::iter::traits::iterator::Iterator::try_for_each::call, core::ops::control_flow::ControlFlow::Break>::{closure#0}, core::ops::control_flow::ControlFlow>::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}, core::ops::control_flow::ControlFlow>> (1x) . } . . #[inline] . fn fold(self, init: Acc, fold: Fold) -> Acc . where . Fold: FnMut(Acc, Self::Item) -> Acc, . { 575 ( 0.00%) self.iter.fold(init, filter_fold(self.predicate, fold)) . } . } . . #[stable(feature = "rust1", since = "1.0.0")] . impl DoubleEndedIterator for Filter . where . P: FnMut(&I::Item) -> bool, . { -- line 173 ---------------------------------------- 138,951 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/ranges.rs -------------------------------------------------------------------------------- Ir -- line 184 ---------------------------------------- . . impl Ranges { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl<'tcx> LateLintPass<'tcx> for Ranges { 618,678 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 137,484 ( 0.01%) if let ExprKind::Binary(ref op, l, r) = expr.kind 76 ( 0.00%) && matches!( 152 ( 0.00%) op.node, . BinOpKind::And | BinOpKind::BitAnd | BinOpKind::Or | BinOpKind::BitOr . ) 30 ( 0.00%) && self.msrv.meets(cx, msrvs::RANGE_CONTAINS) 135 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (5x) 20 ( 0.00%) && !is_in_const_context(cx) 1,355 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_const_context (5x) . { 35 ( 0.00%) check_possible_range_contains(cx, op.node, l, r, expr, expr.span); 1,406 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/ranges.rs:clippy_lints::ranges::check_possible_range_contains (5x) . } . 412,485 ( 0.02%) if let Some(range) = higher::Range::hir(cx, expr) { 3,100,449 ( 0.14%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (68,742x) . check_exclusive_range_plus_one(cx, expr, &range); . check_inclusive_range_minus_one(cx, expr, &range); . check_reversed_empty_range(cx, expr, &range); . } 549,936 ( 0.03%) } . } . 45 ( 0.00%) fn check_possible_range_contains( . cx: &LateContext<'_>, . op: BinOpKind, . left: &Expr<'_>, . right: &Expr<'_>, . expr: &Expr<'_>, . span: Span, . ) { 50 ( 0.00%) let combine_and = match op { . BinOpKind::And | BinOpKind::BitAnd => true, . BinOpKind::Or | BinOpKind::BitOr => false, . _ => return, . }; . // value, name, order (higher/lower), inclusiveness 181 ( 0.00%) if let (Some(l), Some(r)) = (check_range_bounds(cx, left), check_range_bounds(cx, right)) { 969 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/ranges.rs:clippy_lints::ranges::check_range_bounds (10x) . // we only lint comparisons on the same name and with different . // direction 1 ( 0.00%) if l.id != r.id || l.ord == r.ord { . return; . } . let ord = Constant::partial_cmp(cx.tcx, cx.typeck_results().expr_ty(l.expr), &l.val, &r.val); . if combine_and && ord == Some(r.ord) { . // order lower bound and upper bound . let (l_span, u_span, l_inc, u_inc) = if r.ord == Ordering::Less { . (l.val_span, r.val_span, l.inc, r.inc) . } else { -- line 237 ---------------------------------------- -- line 291 ---------------------------------------- . MANUAL_RANGE_CONTAINS, . span, . format!("manual `!{range_type}::contains` implementation"), . "use", . format!("!({lo}{space}{range_op}{hi}).contains(&{name})"), . applicability, . ); . } 8 ( 0.00%) } . . // If the LHS is the same operator, we have to recurse to get the "real" RHS, since they have . // the same operator precedence 8 ( 0.00%) if let ExprKind::Binary(ref lhs_op, _left, new_lhs) = left.kind 3 ( 0.00%) && op == lhs_op.node . && let new_span = Span::new(new_lhs.span.lo(), right.span.hi(), expr.span.ctxt(), expr.span.parent()) . && new_span.check_text(cx, |src| { . // Do not continue if we have mismatched number of parens, otherwise the suggestion is wrong . src.matches('(').count() == src.matches(')').count() . }) . { . check_possible_range_contains(cx, op, new_lhs, right, expr, new_span); . } 40 ( 0.00%) } . . struct RangeBounds<'a> { . val: Constant, . expr: &'a Expr<'a>, . id: HirId, . name_span: Span, . val_span: Span, . ord: Ordering, . inc: bool, . } . . // Takes a binary expression such as x <= 2 as input . // Breaks apart into various pieces, such as the value of the number, . // hir id of the variable, and direction/inclusiveness of the operator 70 ( 0.00%) fn check_range_bounds<'a>(cx: &'a LateContext<'_>, ex: &'a Expr<'_>) -> Option> { 20 ( 0.00%) if let ExprKind::Binary(ref op, l, r) = ex.kind { 91 ( 0.00%) let (inclusive, ordering) = match op.node { . BinOpKind::Gt => (false, Ordering::Greater), . BinOpKind::Ge => (true, Ordering::Greater), . BinOpKind::Lt => (false, Ordering::Less), . BinOpKind::Le => (true, Ordering::Less), . _ => return None, . }; . if let Some(id) = l.res_local_id() { 29 ( 0.00%) if let Some(c) = ConstEvalCtxt::new(cx).eval(r) { 423 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval (3x) 168 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::new (3x) 12 ( 0.00%) return Some(RangeBounds { . val: c, . expr: r, . id, 2 ( 0.00%) name_span: l.span, 4 ( 0.00%) val_span: r.span, . ord: ordering, . inc: inclusive, . }); . } . } else if let Some(id) = r.res_local_id() . && let Some(c) = ConstEvalCtxt::new(cx).eval(l) . { . return Some(RangeBounds { -- line 352 ---------------------------------------- -- line 356 ---------------------------------------- . name_span: r.span, . val_span: l.span, . ord: ordering.reverse(), . inc: inclusive, . }); . } . } . None 80 ( 0.00%) } . . /// Check whether `expr` could switch range types without breaking the typing requirements. This is . /// generally the case when `expr` is used as an iterator for example, or as a slice or `&str` . /// index. . /// . /// FIXME: Note that the current implementation may still return false positives. A proper fix would . /// check that the obligations are still satisfied after switching the range type. . fn can_switch_ranges<'tcx>( -- line 372 ---------------------------------------- -- line 515 ---------------------------------------- . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'_>, . range: &higher::Range<'tcx>, . kind: RangeLimits, . predicate: impl for<'hir> FnOnce(&Expr<'hir>) -> Option<&'hir Expr<'hir>>, . lint: &'static Lint, . msg: &'static str, . ) { 11 ( 0.00%) if let higher::Range { 14 ( 0.00%) start, . end: Some(end), . ty, 14 ( 0.00%) span, 11 ( 0.00%) } = *range 56 ( 0.00%) && span.can_be_used_for_suggestions() 392 ( 0.00%) => ???:::can_be_used_for_suggestions (14x) . && ty.limits() == kind . && let Some(y) = predicate(end) . && can_switch_ranges(cx, span.ctxt(), expr, kind, cx.typeck_results().expr_ty(y)) . { . // Suggest the opposite range limits to the ones being checked. . let operator = match kind { . RangeLimits::HalfOpen => "..=", . RangeLimits::Closed => "..", -- line 537 ---------------------------------------- -- line 554 ---------------------------------------- . None => {}, . } . }); . } . } . . fn check_reversed_empty_range(cx: &LateContext<'_>, expr: &Expr<'_>, range: &higher::Range<'_>) { . fn inside_indexing_expr(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { 4 ( 0.00%) matches!( 12 ( 0.00%) get_parent_expr(cx, expr), 297 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (3x) . Some(Expr { . kind: ExprKind::Index(..), . .. . }) . ) . } . 33 ( 0.00%) fn is_for_loop_arg(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { . let mut cur_expr = expr; 15 ( 0.00%) while let Some(parent_expr) = get_parent_expr(cx, cur_expr) { 396 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (4x) 5 ( 0.00%) match higher::ForLoop::hir(parent_expr) { 15 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (1x) . Some(higher::ForLoop { arg, .. }) if arg.hir_id == expr.hir_id => return true, . _ => cur_expr = parent_expr, . } . } . . false 24 ( 0.00%) } . . fn is_empty_range(limits: RangeLimits, ordering: Ordering) -> bool { . match limits { . RangeLimits::HalfOpen => ordering != Ordering::Less, . RangeLimits::Closed => ordering == Ordering::Greater, . } . } . 7 ( 0.00%) if let higher::Range { . start: Some(start), . end: Some(end), 4 ( 0.00%) ty: range_ty, 4 ( 0.00%) span, 7 ( 0.00%) } = *range 12 ( 0.00%) && let ty = cx.typeck_results().expr_ty(start) 160 ( 0.00%) => ???:::expr_ty (4x) 16 ( 0.00%) && let ty::Int(_) | ty::Uint(_) = ty.kind() 16 ( 0.00%) && let ecx = ConstEvalCtxt::new(cx) 224 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::new (4x) 48 ( 0.00%) && let Some(start_idx) = ecx.eval(start) 552 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval (4x) 28 ( 0.00%) && let Some(end_idx) = ecx.eval(end) 559 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval (4x) 36 ( 0.00%) && let Some(ordering) = Constant::partial_cmp(cx.tcx, ty, &start_idx, &end_idx) 165 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::partial_cmp (3x) 3 ( 0.00%) && is_empty_range(range_ty.limits(), ordering) . { 1 ( 0.00%) if inside_indexing_expr(cx, expr) { . // Avoid linting `N..N` as it has proven to be useful, see #5689 and #5628 ... . if ordering != Ordering::Equal { . span_lint( . cx, . REVERSED_EMPTY_RANGES, . span, . "this range is reversed and using it to index a slice will panic at run-time", . ); . } . // ... except in for loop arguments for backwards compatibility with `reverse_range_loop` 18 ( 0.00%) } else if ordering != Ordering::Equal || is_for_loop_arg(cx, expr) { 496 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/ranges.rs:clippy_lints::ranges::check_reversed_empty_range::is_for_loop_arg (3x) . span_lint_and_then( . cx, . REVERSED_EMPTY_RANGES, . span, . "this range is empty so it will yield no values", . |diag| { . if ordering != Ordering::Equal { . let start_snippet = snippet(cx, start.span, "_"); -- line 623 ---------------------------------------- -- line 633 ---------------------------------------- . range in reverse", . format!("({end_snippet}{dots}{start_snippet}).rev()"), . Applicability::MaybeIncorrect, . ); . } . }, . ); . } 7 ( 0.00%) } 175 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:core::ptr::drop_glue:: (7x) . } . . fn y_plus_one<'tcx>(expr: &Expr<'tcx>) -> Option<&'tcx Expr<'tcx>> { 14 ( 0.00%) match expr.kind { . ExprKind::Binary( . Spanned { . node: BinOpKind::Add, .. . }, . lhs, . rhs, . ) => { . if is_integer_literal(lhs, 1) { -- line 653 ---------------------------------------- 69,051 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/operators/eq_op.rs -------------------------------------------------------------------------------- Ir -- line 2 ---------------------------------------- . use clippy_utils::diagnostics::{span_lint, span_lint_and_then}; . use clippy_utils::macros::{find_assert_eq_args, first_node_macro_backtrace}; . use clippy_utils::{eq_expr_value, is_in_test_function, sym}; . use rustc_hir::{BinOpKind, Expr}; . use rustc_lint::LateContext; . . use super::EQ_OP; . 618,678 ( 0.03%) pub(crate) fn check_assert<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 68,742 ( 0.00%) if let Some(macro_call) = first_node_macro_backtrace(cx, e).find(|macro_call| { . matches!( . cx.tcx.get_diagnostic_name(macro_call.def_id), . Some(sym::assert_eq_macro | sym::assert_ne_macro | sym::debug_assert_eq_macro | sym::debug_assert_ne_macro) . ) . }) && let Some((lhs, rhs, _)) = find_assert_eq_args(cx, e, macro_call.expn) . && eq_expr_value(cx, macro_call.span.ctxt(), lhs, rhs) . && macro_call.is_local() . && !is_in_test_function(cx.tcx, e.hir_id) -- line 19 ---------------------------------------- -- line 23 ---------------------------------------- . EQ_OP, . lhs.span.to(rhs.span), . format!( . "identical args used in this `{}!` macro call", . cx.tcx.item_name(macro_call.def_id) . ), . ); . } 549,936 ( 0.03%) } . 675 ( 0.00%) pub(crate) fn check<'tcx>( . cx: &LateContext<'tcx>, . e: &'tcx Expr<'_>, . op: BinOpKind, . left: &'tcx Expr<'_>, . right: &'tcx Expr<'_>, . ) { . if is_useless_with_eq_exprs(op) 315 ( 0.00%) && eq_expr_value(cx, e.span.ctxt(), left, right) 80,689 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:clippy_utils::hir_utils::eq_expr_value (45x) . && !is_in_test_function(cx.tcx, e.hir_id) . { . span_lint_and_then( . cx, . EQ_OP, . e.span, . format!("equal expressions as operands to `{}`", op.as_str()), . |diag| { -- line 49 ---------------------------------------- -- line 50 ---------------------------------------- . if let BinOpKind::Ne = op . && cx.typeck_results().expr_ty(left).is_floating_point() . { . diag.note("if you intended to check if the operand is NaN, use `.is_nan()` instead"); . } . }, . ); . } 600 ( 0.00%) } 206,406 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/redundant_field_names.rs -------------------------------------------------------------------------------- Ir -- line 44 ---------------------------------------- . impl RedundantFieldNames { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl EarlyLintPass for RedundantFieldNames { . fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 144,058 ( 0.01%) if let ExprKind::Struct(ref se) = expr.kind 52 ( 0.00%) && self.msrv.meets(msrvs::FIELD_INIT_SHORTHAND) 312 ( 0.00%) => /rust/deps/smallvec-1.15.1/src/lib.rs:::meets (13x) . { 13 ( 0.00%) for field in &se.fields { 92 ( 0.00%) if !field.is_shorthand 156 ( 0.00%) && let ExprKind::Path(None, path) = &field.expr.kind 24 ( 0.00%) && let [segment] = path.segments.as_slice() 8 ( 0.00%) && segment.args.is_none() . && segment.ident == field.ident . && field.span.eq_ctxt(field.ident.span) . && !field.span.in_external_macro(cx.sess().source_map()) . { . span_lint_and_sugg( . cx, . REDUNDANT_FIELD_NAMES, . field.span, -- line 67 ---------------------------------------- -- line 68 ---------------------------------------- . "redundant field names in struct initialization", . "replace it with", . field.ident.to_string(), . Applicability::MachineApplicable, . ); . } . } . } 72,029 ( 0.00%) } . . extract_msrv_attr!(); . } 208 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/spec_from_iter.rs -------------------------------------------------------------------------------- Ir -- line 24 ---------------------------------------- . pub(super) trait SpecFromIter { . fn from_iter(iter: I) -> Self; . } . . impl SpecFromIter for Vec . where . I: Iterator, . { 2,269 ( 0.00%) default fn from_iter(iterator: I) -> Self { 110,488 ( 0.01%) SpecFromIterNested::from_iter(iterator) 1,608 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/spec_from_iter_nested.rs: as alloc::vec::spec_from_iter_nested::SpecFromIterNested, as clippy_config::de::FromDefault<&[&str]>>::from_default::{closure#0}>>>::from_iter (5x) 2,042 ( 0.00%) } . } . . impl SpecFromIter> for Vec { . fn from_iter(iterator: IntoIter) -> Self { . // A common case is passing a vector into a function which immediately . // re-collects into a vector. We can short circuit this if the IntoIter . // has not been advanced at all. . // When it has been advanced We can also reuse the memory and move the data to the front. -- line 42 ---------------------------------------- 5 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/lib.rs -------------------------------------------------------------------------------- Ir -- line 177 ---------------------------------------- . } . } . . #[inline] . pub fn with_session_globals(f: F) -> R . where . F: FnOnce(&SessionGlobals) -> R, . { 10,625 ( 0.00%) SESSION_GLOBALS.with(f) 184 ( 0.00%) => /rust/deps/scoped-tls-1.0.1/src/lib.rs:>::with::::data::{closure#0}>::{closure#0}, rustc_span::SpanData> (4x) . } . . /// Default edition, no source map. . pub fn create_default_session_globals_then(f: impl FnOnce() -> R) -> R { . create_session_globals_then(edition::DEFAULT_EDITION, &[], None, f) . } . . // If this ever becomes non thread-local, `decode_syntax_context` -- line 193 ---------------------------------------- -- line 228 ---------------------------------------- . } . } . . #[inline] . pub fn with_metavar_spans(f: impl FnOnce(&MetavarSpansMap) -> R) -> R { . with_session_globals(|session_globals| f(&session_globals.metavar_spans)) . } . 21 ( 0.00%) bitflags::bitflags! { . /// Scopes used to determined if it need to apply to `--remap-path-prefix` . #[derive(Debug, Eq, PartialEq, Clone, Copy, Ord, PartialOrd, Hash)] . pub struct RemapPathScopeComponents: u8 { . /// Apply remappings to the expansion of `std::file!()` macro . const MACRO = 1 << 0; . /// Apply remappings to printed compiler diagnostics . const DIAGNOSTICS = 1 << 1; . /// Apply remappings to debug information -- line 244 ---------------------------------------- -- line 387 ---------------------------------------- . /// Returns the path suitable for reading from the file system on the local host, . /// if this information exists. . /// . /// May not exists if the filename was imported from another crate. . /// . /// Avoid embedding this in build artifacts; prefer `path()` or `embeddable_name()`. . #[inline] . pub fn local_path(&self) -> Option<&Path> { 11 ( 0.00%) if self.was_not_remapped() { . Some(&self.maybe_remapped.name) . } else if let Some(local) = &self.local { . Some(&local.name) . } else { . None . } . } . -- line 403 ---------------------------------------- -- line 404 ---------------------------------------- . /// Returns the path suitable for reading from the file system on the local host, . /// if this information exists. . /// . /// May not exists if the filename was imported from another crate. . /// . /// Avoid embedding this in build artifacts; prefer `path()` or `embeddable_name()`. . #[inline] . pub fn into_local_path(self) -> Option { 10 ( 0.00%) if self.was_not_remapped() { 20 ( 0.00%) Some(self.maybe_remapped.name) . } else if let Some(local) = self.local { . Some(local.name) . } else { . None . } 40 ( 0.00%) } . . /// Returns whenever the filename was remapped. . #[inline] . pub(crate) fn was_remapped(&self) -> bool { . !self.scopes.is_empty() . } . . /// Returns whenever the filename was fully remapped. -- line 427 ---------------------------------------- -- line 702 ---------------------------------------- . Span::new(self.lo, self.hi, self.ctxt, self.parent) . } . #[inline] . pub fn with_lo(&self, lo: BytePos) -> Span { . Span::new(lo, self.hi, self.ctxt, self.parent) . } . #[inline] . pub fn with_hi(&self, hi: BytePos) -> Span { 98 ( 0.00%) Span::new(self.lo, hi, self.ctxt, self.parent) 108 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::new (4x) . } . /// Avoid if possible, `Span::map_ctxt` should be preferred. . #[inline] . fn with_ctxt(&self, ctxt: SyntaxContext) -> Span { . Span::new(self.lo, self.hi, ctxt, self.parent) . } . /// Avoid if possible, `Span::with_parent` should be preferred. . #[inline] -- line 718 ---------------------------------------- -- line 745 ---------------------------------------- . fn cmp(&self, rhs: &Self) -> Ordering { . Ord::cmp(&self.data(), &rhs.data()) . } . } . . impl Span { . #[inline] . pub fn lo(self) -> BytePos { 504 ( 0.00%) self.data().lo . } . #[inline] . pub fn with_lo(self, lo: BytePos) -> Span { . self.data().with_lo(lo) . } . #[inline] . pub fn hi(self) -> BytePos { 577 ( 0.00%) self.data().hi 546 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::data (26x) . } . #[inline] . pub fn with_hi(self, hi: BytePos) -> Span { 18 ( 0.00%) self.data().with_hi(hi) 84 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::data (4x) . } . #[inline] . pub fn with_ctxt(self, ctxt: SyntaxContext) -> Span { . self.map_ctxt(|_| ctxt) . } . . #[inline] . pub fn is_visible(self, sm: &SourceMap) -> bool { -- line 773 ---------------------------------------- -- line 774 ---------------------------------------- . !self.is_dummy() && sm.is_span_accessible(self) . } . . /// Returns whether this span originates in a foreign crate's external macro. . /// . /// This is used to test whether a lint should not even begin to figure out whether it should . /// be reported on the current node. . #[inline] 324 ( 0.00%) pub fn in_external_macro(self, sm: &SourceMap) -> bool { 638,340 ( 0.03%) self.ctxt().in_external_macro(sm) 2,828 ( 0.00%) => ???:::in_external_macro (28x) . } . . /// Returns `true` if `span` originates in a derive-macro's expansion. . pub fn in_derive_expansion(self) -> bool { . matches!(self.ctxt().outer_expn_data().kind, ExpnKind::Macro(MacroKind::Derive, _)) . } . . /// Return whether `span` is generated by `async` or `await`. -- line 791 ---------------------------------------- -- line 2364 ---------------------------------------- . } . . pub fn count_lines(&self) -> usize { . self.lines().len() . } . . #[inline] . pub fn absolute_position(&self, pos: RelativeBytePos) -> BytePos { 6 ( 0.00%) BytePos::from_u32(pos.to_u32() + self.start_pos.to_u32()) . } . . #[inline] . pub fn relative_position(&self, pos: BytePos) -> RelativeBytePos { 362 ( 0.00%) RelativeBytePos::from_u32(pos.to_u32() - self.start_pos.to_u32()) . } . . #[inline] . pub fn end_position(&self) -> BytePos { . self.absolute_position(self.normalized_source_len) . } . . /// Finds the line containing the given position. The return value is the -- line 2385 ---------------------------------------- -- line 2649 ---------------------------------------- . impl Pos for $ident { . #[inline(always)] . fn from_usize(n: usize) -> $ident { . $ident(n as $inner_ty) . } . . #[inline(always)] . fn to_usize(&self) -> usize { 95,770 ( 0.00%) self.0 as usize . } . . #[inline(always)] . fn from_u32(n: u32) -> $ident { . $ident(n as $inner_ty) . } . . #[inline(always)] . fn to_u32(&self) -> u32 { 6 ( 0.00%) self.0 as u32 . } . } . . impl Add for $ident { . type Output = $ident; . . #[inline(always)] . fn add(self, rhs: $ident) -> $ident { -- line 2675 ---------------------------------------- -- line 2677 ---------------------------------------- . } . } . . impl Sub for $ident { . type Output = $ident; . . #[inline(always)] . fn sub(self, rhs: $ident) -> $ident { 207 ( 0.00%) $ident(self.0 - rhs.0) . } . } . )* . }; . } . . impl_pos! { . /// A byte offset. . /// . /// Keep this small (currently 32-bits), as AST contains a lot of them. 161 ( 0.00%) #[derive(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Debug)] . pub struct BytePos(pub u32); . . /// A byte offset relative to file beginning. . #[derive(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Debug, StableHash)] . pub struct RelativeBytePos(pub u32); . . /// A character offset. . /// -- line 2704 ---------------------------------------- 210,610 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/ascii.rs -------------------------------------------------------------------------------- Ir -- line 660 ---------------------------------------- . const SIMD_MIN_LEN: usize = NEON_CHUNK_SIZE; . . const_eval_select!( . @capture { bytes: &[u8] } -> bool: . if const { . is_ascii_simple(bytes) . } else { . // For small inputs, use usize-at-a-time processing to avoid SSE2 call overhead. 24,386 ( 0.00%) if bytes.len() < SIMD_MIN_LEN { . let chunks = bytes.chunks_exact(USIZE_SIZE); . let remainder = chunks.remainder(); . for chunk in chunks { . let word = usize::from_ne_bytes(chunk.try_into().unwrap()); 24,378 ( 0.00%) if (word & NONASCII_MASK) != 0 { . return false; . } . } . return remainder.iter().all(|b| b.is_ascii()); . } . . #[cfg(all(target_arch = "x86_64", target_feature = "sse2"))] . { is_ascii_sse2(bytes) } -- line 681 ---------------------------------------- 12,193 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/unicode.rs -------------------------------------------------------------------------------- Ir -- line 74 ---------------------------------------- . . declare_lint_pass!(Unicode => [ . INVISIBLE_CHARACTERS, . NON_ASCII_LITERAL, . UNICODE_NOT_NFC, . ]); . . impl LateLintPass<'_> for Unicode { 274,968 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &'_ Expr<'_>) { 149,684 ( 0.01%) if let ExprKind::Lit(lit) = expr.kind 152,802 ( 0.01%) && let LitKind::Str(_, _) | LitKind::Char(_) = lit.node . { 24,400 ( 0.00%) check_str(cx, lit.span, expr.hir_id); . } 343,710 ( 0.02%) } . } . . fn escape>(s: T) -> String { . let mut result = String::new(); . for c in s { . if c as u32 > 0x7F { . for d in c.escape_unicode() { . result.push(d); -- line 96 ---------------------------------------- -- line 98 ---------------------------------------- . } else { . result.push(c); . } . } . result . } . . fn check_str(cx: &LateContext<'_>, span: Span, id: HirId) { 48,800 ( 0.00%) if !span_is_local(span) { 196,782 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::span_is_local (12,200x) . return; . } . . let string = snippet(cx, span, ""); . // All three lints here can only fire when the snippet contains a non-ASCII character. Note . // that the snippet can contain non-ASCII characters even when the literal's value does not, . // e.g. the literal produced by `file!()` inside a macro spans the whole macro invocation. . if string.is_ascii() { -- line 114 ---------------------------------------- 24,400 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/needless_parens_on_range_literals.rs -------------------------------------------------------------------------------- Ir -- line 41 ---------------------------------------- . declare_lint_pass!(NeedlessParensOnRangeLiterals => [ . NEEDLESS_PARENS_ON_RANGE_LITERALS, . ]); . . fn snippet_enclosed_in_parenthesis(snippet: &str) -> bool { . snippet.starts_with('(') && snippet.ends_with(')') . } . 180 ( 0.00%) fn check_for_parens(cx: &LateContext<'_>, e: &Expr<'_>, is_start: bool) { 30 ( 0.00%) if is_start . && let ExprKind::Lit(literal) = e.kind 8 ( 0.00%) && let ast::LitKind::Float(_sym, ast::LitFloatType::Unsuffixed) = literal.node . { . // don't check floating point literals on the start expression of a range . return; . } 39 ( 0.00%) if let ExprKind::Lit(literal) = e.kind . // the indicator that parenthesis surround the literal is that the span of the expression and the literal differ 49 ( 0.00%) && (literal.span.data().hi - literal.span.data().lo) != (e.span.data().hi - e.span.data().lo) . // inspect the source code of the expression for parenthesis . && snippet_enclosed_in_parenthesis(&snippet(cx, e.span, "")) . { . let mut applicability = Applicability::MachineApplicable; . span_lint_and_then( . cx, . NEEDLESS_PARENS_ON_RANGE_LITERALS, . e.span, . "needless parenthesis on range literals can be removed", . |diag| { . let suggestion = snippet_with_applicability(cx, literal.span, "_", &mut applicability); . diag.span_suggestion(e.span, "try", suggestion, applicability); . }, . ); . } 120 ( 0.00%) } . . impl<'tcx> LateLintPass<'tcx> for NeedlessParensOnRangeLiterals { . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 343,732 ( 0.02%) if let Some(higher::Range { start, end, .. }) = higher::Range::hir(cx, expr) { 3,100,449 ( 0.14%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (68,742x) 22 ( 0.00%) if let Some(start) = start { 24 ( 0.00%) check_for_parens(cx, start, true); 328 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/needless_parens_on_range_literals.rs:clippy_lints::needless_parens_on_range_literals::check_for_parens (8x) . } 22 ( 0.00%) if let Some(end) = end { 28 ( 0.00%) check_for_parens(cx, end, false); 270 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/needless_parens_on_range_literals.rs:clippy_lints::needless_parens_on_range_literals::check_for_parens (7x) . } . } . } . } 39 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/visit.rs -------------------------------------------------------------------------------- Ir -- line 81 ---------------------------------------- . } . . impl<'a, V: Visitor<'a>, T: ?Sized> Visitable<'a, V> for Box . where . T: Visitable<'a, V>, . { . type Extra = T::Extra; . fn visit(&'a self, visitor: &mut V, extra: Self::Extra) -> V::Result { 2,565 ( 0.00%) (**self).visit(visitor, extra) . } . } . . impl<'a, V: Visitor<'a>, T> Visitable<'a, V> for Option . where . T: Visitable<'a, V>, . { . type Extra = T::Extra; . fn visit(&'a self, visitor: &mut V, extra: Self::Extra) -> V::Result { 17,242 ( 0.00%) if let Some(this) = self { . try_visit!(this.visit(visitor, extra)); . } . V::Result::output() . } . } . . impl<'a, V: Visitor<'a>, T> Visitable<'a, V> for Spanned . where -- line 107 ---------------------------------------- -- line 197 ---------------------------------------- . . pub(crate) trait Walkable<'a, V: Visitor<'a>> { . #[must_use] . fn walk_ref(&'a self, visitor: &mut V) -> V::Result; . } . . macro_rules! visit_visitable { . ($visitor:expr, $($expr:expr),* $(,)?) => {{ 160 ( 0.00%) $(try_visit!(Visitable::visit($expr, $visitor, ()));)* 152 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/ast.rs:>::walk_ref (4x) . }}; . } . . macro_rules! visit_visitable_with { . ($visitor:expr, $expr:expr, $extra:expr $(,)?) => { . try_visit!(Visitable::visit($expr, $visitor, $extra)) . }; . } . . macro_rules! walk_walkable { . ($visitor:expr, $expr:expr, ) => { 22,637 ( 0.00%) Walkable::walk_ref($expr, $visitor) 38 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/ast.rs:>::walk_ref'2 (1x) . }; . } . . macro_rules! impl_visitable { . (|&$lt:lifetime $self:ident: $self_ty:ty, . $vis:ident: &mut $vis_ty:ident, . $extra:ident: $extra_ty:ty| $block:block) => { . #[allow(unused_parens, non_local_definitions)] -- line 225 ---------------------------------------- -- line 232 ---------------------------------------- . }; . } . . macro_rules! impl_walkable { . ($(<$K:ident: $Kb:ident>)? |&$lt:lifetime $self:ident: $self_ty:ty, . $vis:ident: &mut $vis_ty:ident| $block:block) => { . #[allow(unused_parens, non_local_definitions)] . impl<$($K: $Kb,)? $lt, $vis_ty: Visitor<$lt>> Walkable<$lt, $vis_ty> for $self_ty { 43,965 ( 0.00%) fn walk_ref(&$lt $self, $vis: &mut $vis_ty) -> V::Result { . $block 36,680 ( 0.00%) } . } . }; . } . . macro_rules! impl_visitable_noop { . (<$lt:lifetime> $($ty:ty,)*) => { . $( . impl_visitable!(|&$lt self: $ty, _vis: &mut V, _extra: ()| { -- line 250 ---------------------------------------- -- line 286 ---------------------------------------- . . macro_rules! impl_visitable_calling_walkable { . (<$lt:lifetime> . $( fn $method:ident($ty:ty $(, $extra_name:ident: $extra_ty:ty)?); )* . ) => { . $(fn $method(&mut self, node: &$lt $ty $(, $extra_name:$extra_ty)?) -> Self::Result { . impl_visitable!(|&$lt self: $ty, visitor: &mut V, extra: ($($extra_ty)?)| { . let ($($extra_name)?) = extra; 497 ( 0.00%) visitor.$method(self $(, $extra_name)?) 12,615 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::visit_pat'2 (93x) . }); . walk_walkable!(self, node, ) . })* . }; . } . . macro_rules! define_named_walk { . ($Visitor:ident<$lt:lifetime> -- line 302 ---------------------------------------- -- line 655 ---------------------------------------- . // for `MutVisitor`: `Span` and `NodeId` are mutated at the caller site. . fn visit_fn( . &mut self, . fk: FnKind<$($lt)? $(${ignore($mut)} '_)?>, . _: &AttrVec, . _: Span, . _: NodeId, . ) -> Self::Result { 12 ( 0.00%) walk_fn(self, fk) 513 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/visit.rs:rustc_ast::visit::walk_fn:: (1x) . } . . // (non-mut) `Visitor`-only methods . $( . fn visit_stmt(&mut self, s: &$lt Stmt) -> Self::Result { 624 ( 0.00%) walk_stmt(self, s) 458,851 ( 0.02%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/visit.rs:rustc_ast::visit::walk_stmt:: (124x) . } . . fn visit_nested_use_tree(&mut self, use_tree: &$lt UseTree, id: NodeId) -> Self::Result { . try_visit!(self.visit_id(id)); . self.visit_use_tree(use_tree) . } . )? . -- line 677 ---------------------------------------- -- line 922 ---------------------------------------- . visit_visitable!($($mut)? vis, alias), . ForeignItemKind::MacCall(mac) => . visit_visitable!($($mut)? vis, mac), . } . V::Result::output() . } . } . 96 ( 0.00%) pub fn walk_fn<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, kind: FnKind<$($lt)? $(${ignore($mut)} '_)?>) -> V::Result { 36 ( 0.00%) match kind { . FnKind::Fn( . _ctxt, . // Visibility is visited as a part of the item. . _vis, . Fn { defaultness, ident, sig, generics, contract, body, define_opaque, eii_impl }, . ) => { . let FnSig { header, decl, span } = sig; . visit_visitable!($($mut)? vis, . defaultness, ident, header, generics, decl, . contract, body, span, define_opaque, eii_impl . ); . } 12 ( 0.00%) FnKind::Closure(binder, coroutine_kind, decl, body) => . visit_visitable!($($mut)? vis, binder, coroutine_kind, decl, body), . } . V::Result::output() . } . . impl_walkable!(|&$($mut)? $($lt)? self: Impl, vis: &mut V| { . let Impl { generics, of_trait, self_ty, items, constness: _ } = self; . try_visit!(vis.visit_generics(generics)); -- line 952 ---------------------------------------- -- line 957 ---------------------------------------- . try_visit!(vis.visit_ty(self_ty)); . visit_visitable_with!($($mut)? vis, items, AssocCtxt::Impl { of_trait: of_trait.is_some() }); . V::Result::output() . }); . . // Special case to call `visit_method_receiver_expr`. . impl_walkable!(|&$($mut)? $($lt)? self: MethodCall, vis: &mut V| { . let MethodCall { seg, receiver, args, span } = self; 110 ( 0.00%) try_visit!(vis.visit_method_receiver_expr(receiver)); . visit_visitable!($($mut)? vis, seg, args, span); . V::Result::output() . }); . . impl_walkable!(|&$($mut)? $($lt)? self: Expr, vis: &mut V| { . let Expr { id, kind, span, attrs, tokens: _ } = self; . visit_visitable!($($mut)? vis, id, attrs); 24,460 ( 0.00%) match kind { . ExprKind::Array(exprs) => . visit_visitable!($($mut)? vis, exprs), . ExprKind::ConstBlock(anon_const) => . visit_visitable!($($mut)? vis, anon_const), . ExprKind::Repeat(element, count) => . visit_visitable!($($mut)? vis, element, count), . ExprKind::Struct(se) => . visit_visitable!($($mut)? vis, se), -- line 981 ---------------------------------------- -- line 994 ---------------------------------------- . ExprKind::Cast(subexpression, typ) | ExprKind::Type(subexpression, typ) => . visit_visitable!($($mut)? vis, subexpression, typ), . ExprKind::Let(pat, expr, span, _recovered) => . visit_visitable!($($mut)? vis, pat, expr, span), . ExprKind::If(head_expression, if_block, optional_else) => . visit_visitable!($($mut)? vis, head_expression, if_block, optional_else), . ExprKind::While(subexpression, block, opt_label) => . visit_visitable!($($mut)? vis, subexpression, block, opt_label), 8 ( 0.00%) ExprKind::ForLoop(ForLoop { pat, iter, body, label, kind }) => . visit_visitable!($($mut)? vis, pat, iter, body, label, kind), . ExprKind::Loop(block, opt_label, span) => . visit_visitable!($($mut)? vis, block, opt_label, span), . ExprKind::Match(subexpression, arms, kind) => . visit_visitable!($($mut)? vis, subexpression, arms, kind), . ExprKind::Closure(Closure { 12 ( 0.00%) binder, . capture_clause, 12 ( 0.00%) coroutine_kind, . constness, . movability, 12 ( 0.00%) fn_decl, 12 ( 0.00%) body, . fn_decl_span, . fn_arg_span, . }) => { . visit_visitable!($($mut)? vis, constness, movability, capture_clause); 48 ( 0.00%) let kind = FnKind::Closure(binder, coroutine_kind, fn_decl, body); . try_visit!(vis.visit_fn(kind, attrs, *span, *id)); . visit_visitable!($($mut)? vis, fn_decl_span, fn_arg_span); 12 ( 0.00%) } . ExprKind::Block(block, opt_label) => . visit_visitable!($($mut)? vis, block, opt_label), . ExprKind::Gen(capt, body, kind, decl_span) => . visit_visitable!($($mut)? vis, capt, body, kind, decl_span), . ExprKind::Await(expr, span) . | ExprKind::Move(expr, span) . | ExprKind::Use(expr, span) => . visit_visitable!($($mut)? vis, expr, span), -- line 1031 ---------------------------------------- -- line 1161 ---------------------------------------- . . fn $name<'a, V: Visitor<'a>>( . vis: &mut V, . values: &'a ThinVec<$Ty>, . $( . $param: $ParamTy, . )* . ) -> V::Result { 1,780 ( 0.00%) walk_list!(vis, $visit_fn, values$(,$param)*); 364,899 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::visit_arm (1,459x) . V::Result::output() . } . )+ . } . } . . generate_list_visit_fns! { . visit_items, Box, visit_item; -- line 1177 ---------------------------------------- -- line 1184 ---------------------------------------- . visit_variants, Variant, visit_variant; . visit_assoc_items, Box, visit_assoc_item, ctxt: AssocCtxt; . visit_where_predicates, WherePredicate, visit_where_predicate; . visit_params, Param, visit_param; . visit_field_defs, FieldDef, visit_field_def; . visit_arms, Arm, visit_arm; . } . 2,000 ( 0.00%) pub fn walk_stmt<'a, V: Visitor<'a>>(visitor: &mut V, statement: &'a Stmt) -> V::Result { . let Stmt { id, kind, span: _ } = statement; . try_visit!(visitor.visit_id(*id)); 1,250 ( 0.00%) match kind { 350 ( 0.00%) StmtKind::Let(local) => try_visit!(visitor.visit_local(local)), 17,531 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::visit_local (22x) . StmtKind::Item(item) => try_visit!(visitor.visit_item(item)), 214 ( 0.00%) StmtKind::Expr(expr) | StmtKind::Semi(expr) => try_visit!(visitor.visit_expr(expr)), . StmtKind::Empty => {} . StmtKind::MacCall(mac) => { . let MacCallStmt { mac, attrs, style: _, tokens: _ } = &**mac; . walk_list!(visitor, visit_attribute, attrs); . try_visit!(visitor.visit_mac_call(mac)); . } . } . V::Result::output() 8 ( 0.00%) } 16,804 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/misc_early/literal_suffix.rs -------------------------------------------------------------------------------- Ir . use clippy_utils::diagnostics::span_lint_and_then; . use rustc_errors::Applicability; . use rustc_lint::EarlyContext; . use rustc_span::Span; . . use super::{SEPARATED_LITERAL_SUFFIX, UNSEPARATED_LITERAL_SUFFIX}; . 464,544 ( 0.02%) pub(super) fn check(cx: &EarlyContext<'_>, lit_span: Span, lit_snip: &str, suffix: &str, sugg_type: &str) { 77,424 ( 0.00%) let Some(maybe_last_sep_idx) = lit_snip.len().checked_sub(suffix.len() + 1) else { . return; // It's useless so shouldn't lint. . }; . // Do not lint when literal is unsuffixed. 77,424 ( 0.00%) if !suffix.is_empty() { 4 ( 0.00%) if lit_snip.as_bytes()[maybe_last_sep_idx] == b'_' { . #[expect(clippy::collapsible_span_lint_calls, reason = "rust-clippy#7797")] . span_lint_and_then( . cx, . SEPARATED_LITERAL_SUFFIX, . lit_span, . format!("{sugg_type} type suffix should not be separated by an underscore"), . |diag| { . diag.span_suggestion( -- line 22 ---------------------------------------- -- line 24 ---------------------------------------- . "remove the underscore", . format!("{}{suffix}", &lit_snip[..maybe_last_sep_idx]), . Applicability::MachineApplicable, . ); . }, . ); . } else { . #[expect(clippy::collapsible_span_lint_calls, reason = "rust-clippy#7797")] 2 ( 0.00%) span_lint_and_then( . cx, . UNSEPARATED_LITERAL_SUFFIX, . lit_span, 3 ( 0.00%) format!("{sugg_type} type suffix should be separated by an underscore"), . |diag| { . diag.span_suggestion( . lit_span, . "add an underscore", . format!("{}_{suffix}", &lit_snip[..=maybe_last_sep_idx]), . Applicability::MachineApplicable, . ); . }, . ); . } . } 309,696 ( 0.01%) } 5 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/lint.rs -------------------------------------------------------------------------------- Ir -- line 378 ---------------------------------------- . /// The innermost function for emitting lints implementing the [`trait@Diagnostic`] trait. . /// . /// If you are looking to implement a lint, look for higher level functions, . /// for example: . /// . /// - [`TyCtxt::emit_node_span_lint`] . /// - `LintContext::opt_span_lint` . #[track_caller] 554 ( 0.00%) pub fn emit_lint_base<'a, D: Diagnostic<'a, ()> + 'a>( . sess: &'a Session, . lint: &'static Lint, . level_spec: impl Into, . span: Option, . decorate: D, . ) { . // Avoid codegen bloat from monomorphization by immediately doing dyn dispatch of `decorate` to . // the "real" work. -- line 394 ---------------------------------------- -- line 572 ---------------------------------------- . let citation = . format!("for more information, see {}", future_incompatible.reason.reference()); . err.note(citation); . } . . explain_lint_level_source(sess, lint, level, src, &mut err); . err.emit(); . } 24,440 ( 0.00%) emit_lint_base_impl( 138 ( 0.00%) => ???:rustc_middle::lint::emit_lint_base::emit_lint_base_impl (1x) . sess, . lint, . level_spec.into(), 18,330 ( 0.00%) span, 17 ( 0.00%) Box::new(move |dcx, level| decorate.into_diag(dcx, level)), 4,642 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:::{closure#0}> as rustc_errors::diagnostic::Diagnostic<()>>::into_diag (1x) . ); 324 ( 0.00%) } -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cmp.rs -------------------------------------------------------------------------------- Ir -- line 268 ---------------------------------------- . /// . /// This default shouldn't be overridden without good reason, . /// such as when forwarding to another PartialEq implementation. . #[inline] . #[must_use] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_diagnostic_item = "cmp_partialeq_ne"] . fn ne(&self, other: &Rhs) -> bool { 552,167 ( 0.03%) !self.eq(other) 30 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs: as core::cmp::PartialEq>::eq (6x) . } . } . . /// Derive macro generating an impl of the trait [`PartialEq`]. . /// The behavior of this macro is described in detail [here](PartialEq#derivable). . #[rustc_builtin_macro] . #[stable(feature = "builtin_macro_prelude", since = "1.38.0")] . #[allow_internal_unstable(core_intrinsics, structural_match)] -- line 284 ---------------------------------------- -- line 402 ---------------------------------------- . /// . /// assert_eq!(1.cmp(&2), Ordering::Less); . /// . /// assert_eq!(1.cmp(&1), Ordering::Equal); . /// . /// assert_eq!(2.cmp(&1), Ordering::Greater); . /// ``` . #[derive(Copy, Debug, Hash)] 6 ( 0.00%) #[derive_const(Clone, Eq, PartialOrd, Ord, PartialEq)] . #[stable(feature = "rust1", since = "1.0.0")] . // This is a lang item only so that `BinOp::Cmp` in MIR can return it. . // It has no special behavior, but does require that the three variants . // `Less`/`Equal`/`Greater` remain `-1_i8`/`0_i8`/`+1_i8` respectively. . #[lang = "Ordering"] . #[repr(i8)] . pub enum Ordering { . /// An ordering where a compared value is less than another. -- line 418 ---------------------------------------- -- line 486 ---------------------------------------- . /// assert_eq!(Ordering::Equal.is_lt(), false); . /// assert_eq!(Ordering::Greater.is_lt(), false); . /// ``` . #[inline] . #[must_use] . #[rustc_const_stable(feature = "ordering_helpers", since = "1.53.0")] . #[stable(feature = "ordering_helpers", since = "1.53.0")] . pub const fn is_lt(self) -> bool { 1 ( 0.00%) self.as_raw() < 0 . } . . /// Returns `true` if the ordering is the `Greater` variant. . /// . /// # Examples . /// . /// ``` . /// use std::cmp::Ordering; -- line 502 ---------------------------------------- -- line 505 ---------------------------------------- . /// assert_eq!(Ordering::Equal.is_gt(), false); . /// assert_eq!(Ordering::Greater.is_gt(), true); . /// ``` . #[inline] . #[must_use] . #[rustc_const_stable(feature = "ordering_helpers", since = "1.53.0")] . #[stable(feature = "ordering_helpers", since = "1.53.0")] . pub const fn is_gt(self) -> bool { 1,416 ( 0.00%) self.as_raw() > 0 . } . . /// Returns `true` if the ordering is either the `Less` or `Equal` variant. . /// . /// # Examples . /// . /// ``` . /// use std::cmp::Ordering; -- line 521 ---------------------------------------- -- line 524 ---------------------------------------- . /// assert_eq!(Ordering::Equal.is_le(), true); . /// assert_eq!(Ordering::Greater.is_le(), false); . /// ``` . #[inline] . #[must_use] . #[rustc_const_stable(feature = "ordering_helpers", since = "1.53.0")] . #[stable(feature = "ordering_helpers", since = "1.53.0")] . pub const fn is_le(self) -> bool { 34 ( 0.00%) self.as_raw() <= 0 . } . . /// Returns `true` if the ordering is either the `Greater` or `Equal` variant. . /// . /// # Examples . /// . /// ``` . /// use std::cmp::Ordering; -- line 540 ---------------------------------------- -- line 543 ---------------------------------------- . /// assert_eq!(Ordering::Equal.is_ge(), true); . /// assert_eq!(Ordering::Greater.is_ge(), true); . /// ``` . #[inline] . #[must_use] . #[rustc_const_stable(feature = "ordering_helpers", since = "1.53.0")] . #[stable(feature = "ordering_helpers", since = "1.53.0")] . pub const fn is_ge(self) -> bool { 638,713 ( 0.03%) self.as_raw() >= 0 . } . . /// Reverses the `Ordering`. . /// . /// * `Less` becomes `Greater`. . /// * `Greater` becomes `Less`. . /// * `Equal` becomes `Equal`. . /// -- line 559 ---------------------------------------- -- line 1043 ---------------------------------------- . #[inline] . #[must_use] . #[rustc_diagnostic_item = "cmp_ord_max"] . fn max(self, other: Self) -> Self . where . Self: Sized + [const] Destruct, . { . if other < self { self } else { other } 6,051 ( 0.00%) } . . /// Compares and returns the minimum of two values. . /// . /// Returns the first argument if the comparison determines them to be equal. . /// . /// # Examples . /// . /// ``` -- line 1059 ---------------------------------------- -- line 1082 ---------------------------------------- . #[inline] . #[must_use] . #[rustc_diagnostic_item = "cmp_ord_min"] . fn min(self, other: Self) -> Self . where . Self: Sized + [const] Destruct, . { . if other < self { other } else { self } 804 ( 0.00%) } . . /// Restrict a value to a certain interval. . /// . /// Returns `max` if `self` is greater than `max`, and `min` if `self` is . /// less than `min`. Otherwise this returns `self`. . /// . /// # Panics . /// -- line 1098 ---------------------------------------- -- line 1615 ---------------------------------------- . #[stable(feature = "cmp_min_max_by", since = "1.53.0")] . #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] . pub const fn min_by Ordering>( . v1: T, . v2: T, . compare: F, . ) -> T { . if compare(&v1, &v2).is_le() { v1 } else { v2 } 132 ( 0.00%) } . . /// Returns the element that gives the minimum value from the specified function. . /// . /// Returns the first argument if the comparison determines them to be equal. . /// . /// # Examples . /// . /// ``` -- line 1631 ---------------------------------------- -- line 1722 ---------------------------------------- . #[stable(feature = "cmp_min_max_by", since = "1.53.0")] . #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] . pub const fn max_by Ordering>( . v1: T, . v2: T, . compare: F, . ) -> T { . if compare(&v1, &v2).is_gt() { v1 } else { v2 } 288 ( 0.00%) } . . /// Returns the element that gives the maximum value from the specified function. . /// . /// Returns the second argument if the comparison determines them to be equal. . /// . /// # Examples . /// . /// ``` -- line 1738 ---------------------------------------- -- line 1889 ---------------------------------------- . /// NOTE: Calling this on a non-primitive type (such as `()`) . /// leads to an infinitely-looping self-recursive implementation. . macro_rules! impl_partial_eq_for_primitive { . ($($t:ty)*) => ($( . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] . const impl PartialEq for $t { . #[inline] 22,640 ( 0.00%) fn eq(&self, other: &Self) -> bool { *self == *other } . // Override the default to use the primitive implementation for `!=`. . #[inline] . fn ne(&self, other: &Self) -> bool { *self != *other } . } . )*) . } . . impl_partial_eq_for_primitive! { -- line 1905 ---------------------------------------- -- line 1928 ---------------------------------------- . } . . eq_impl! { () bool char usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 } . . #[rustfmt::skip] . macro_rules! partial_ord_methods_primitive_impl { . () => { . #[inline(always)] 3,154 ( 0.00%) fn lt(&self, other: &Self) -> bool { *self < *other } . #[inline(always)] 24 ( 0.00%) fn le(&self, other: &Self) -> bool { *self <= *other } . #[inline(always)] . fn gt(&self, other: &Self) -> bool { *self > *other } . #[inline(always)] . fn ge(&self, other: &Self) -> bool { *self >= *other } . . // These implementations are the same for `Ord` or `PartialOrd` types . // because if either is NAN the `==` test will fail so we end up in . // the `Break` case and the comparison will correctly return `false`. -- line 1946 ---------------------------------------- -- line 2023 ---------------------------------------- . partial_ord_methods_primitive_impl!(); . } . . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] . const impl Ord for $t { . #[inline] . fn cmp(&self, other: &Self) -> Ordering { 39 ( 0.00%) crate::intrinsics::three_way_compare(*self, *other) . } . . #[inline] . #[track_caller] . fn clamp(self, min: Self, max: Self) -> Self . { . const_assert!( . min <= max, -- line 2039 ---------------------------------------- -- line 2135 ---------------------------------------- . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] . const impl PartialEq<&B> for &A . where . A: [const] PartialEq, . { . #[inline] . fn eq(&self, other: &&B) -> bool { 251 ( 0.00%) PartialEq::eq(*self, *other) 215 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs: as core::cmp::PartialEq>::eq (43x) . } . #[inline] . fn ne(&self, other: &&B) -> bool { . PartialEq::ne(*self, *other) . } . } . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] -- line 2151 ---------------------------------------- 1,874 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/utils/dump_hir.rs -------------------------------------------------------------------------------- Ir -- line 18 ---------------------------------------- . /// fn foo(input: u32) -> u64 { . /// input as u64 . /// } . /// ``` . DumpHir => [] . ); . . impl<'tcx> LateLintPass<'tcx> for DumpHir { 1,704 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>) { 278 ( 0.00%) if has_attr(cx, item.hir_id()) { . println!("{item:#?}"); . } 1,704 ( 0.00%) } . 549,936 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) { 206,232 ( 0.01%) if has_attr(cx, expr.hir_id) { . println!("{expr:#?}"); . } 549,936 ( 0.03%) } . 1,440 ( 0.00%) fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx hir::Stmt<'_>) { 724 ( 0.00%) match stmt.kind { 488 ( 0.00%) hir::StmtKind::Expr(e) | hir::StmtKind::Semi(e) if has_attr(cx, e.hir_id) => return, . _ => {}, . } 358 ( 0.00%) if has_attr(cx, stmt.hir_id) { . println!("{stmt:#?}"); . } 1,280 ( 0.00%) } . 48 ( 0.00%) fn check_trait_item(&mut self, cx: &LateContext<'_>, item: &TraitItem<'_>) { 12 ( 0.00%) if has_attr(cx, item.hir_id()) { . println!("{item:#?}"); . } 48 ( 0.00%) } . 392 ( 0.00%) fn check_impl_item(&mut self, cx: &LateContext<'_>, item: &hir::ImplItem<'_>) { 88 ( 0.00%) if has_attr(cx, item.hir_id()) { . println!("{item:#?}"); . } 392 ( 0.00%) } . } . . fn has_attr(cx: &LateContext<'_>, hir_id: hir::HirId) -> bool { 138,974 ( 0.01%) let attrs = cx.tcx.hir_attrs(hir_id); 312 ( 0.00%) => ???:::hir_attrs (6x) 116 ( 0.00%) get_builtin_attr(attrs, sym::dump).count() > 0 . } 232 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_data_structures/src/sharded.rs -------------------------------------------------------------------------------- Ir -- line 87 ---------------------------------------- . #[track_caller] . pub fn lock_shard_by_hash(&self, hash: u64) -> LockGuard<'_, T> { . self.lock_shard_by_index(get_shard_hash(hash)) . } . . #[inline] . #[track_caller] . pub fn lock_shard_by_index(&self, i: usize) -> LockGuard<'_, T> { 5,463 ( 0.00%) match self { . Self::Single(single) => { . // Synchronization is disabled so use the `lock_assume_no_sync` method optimized . // for that case. . . // SAFETY: We know `is_dyn_thread_safe` was false when creating the lock thus . // `might_be_dyn_thread_safe` was also false. . unsafe { single.lock_assume(Mode::NoSync) } . } -- line 103 ---------------------------------------- -- line 148 ---------------------------------------- . } . pub fn len(&self) -> usize { . self.lock_shards().map(|shard| shard.len()).sum() . } . } . . impl ShardedHashMap { . #[inline] 6,717 ( 0.00%) pub fn get(&self, key: &Q) -> Option . where . K: Borrow, . Q: Hash + Eq, . V: Clone, . { . let hash = make_hash(key); . let shard = self.lock_shard_by_hash(hash); . let (_, value) = shard.find(hash, |(k, _)| k.borrow() == key)?; 4,257 ( 0.00%) Some(value.clone()) 8,080 ( 0.00%) } . . #[inline] . pub fn get_or_insert_with(&self, key: K, default: impl FnOnce() -> V) -> V . where . V: Copy, . { . let hash = make_hash(&key); . let mut shard = self.lock_shard_by_hash(hash); -- line 174 ---------------------------------------- 3,747 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/raw_strings.rs -------------------------------------------------------------------------------- Ir -- line 60 ---------------------------------------- . . pub struct RawStrings { . pub allow_one_hash_in_raw_strings: bool, . } . . impl RawStrings { . pub fn new(conf: &'static Conf) -> Self { . Self { 1 ( 0.00%) allow_one_hash_in_raw_strings: conf.allow_one_hash_in_raw_strings, . } . } . } . . impl EarlyLintPass for RawStrings { 648,261 ( 0.03%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 251,279 ( 0.01%) if let ExprKind::FormatArgs(format_args) = &expr.kind . && !format_args.span.in_external_macro(cx.sess().source_map()) . && format_args.span.check_text(cx, |src| src.starts_with('r')) . && let Some(str) = snippet_opt(cx.sess(), format_args.span) . && let count_hash = str.bytes().skip(1).take_while(|b| *b == b'#').count() . && let Some(str) = str.get(count_hash + 2..str.len() - count_hash - 1) . { . self.check_raw_string( . cx, -- line 83 ---------------------------------------- -- line 84 ---------------------------------------- . str, . format_args.span, . "r", . u8::try_from(count_hash).unwrap(), . "string", . ); . } . 217,732 ( 0.01%) if let ExprKind::Lit(lit) = expr.kind 272,165 ( 0.01%) && let (prefix, max) = match lit.kind { . LitKind::StrRaw(max) => ("r", max), . LitKind::ByteStrRaw(max) => ("br", max), . LitKind::CStrRaw(max) => ("cr", max), . _ => return, . } . && !expr.span.in_external_macro(cx.sess().source_map()) . && expr.span.check_text(cx, |src| src.starts_with(prefix)) . { . self.check_raw_string(cx, lit.symbol.as_str(), expr.span, prefix, max, lit.kind.descr()); . } 576,232 ( 0.03%) } . } . . impl RawStrings { . fn check_raw_string(&self, cx: &EarlyContext<'_>, str: &str, lit_span: Span, prefix: &str, max: u8, descr: &str) { . if !str.contains(['\\', '"']) { . span_lint_and_then( . cx, . NEEDLESS_RAW_STRINGS, -- line 112 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/implicit_saturating_sub.rs -------------------------------------------------------------------------------- Ir -- line 90 ---------------------------------------- . . impl ImplicitSaturatingSub { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl<'tcx> LateLintPass<'tcx> for ImplicitSaturatingSub { 549,936 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 137,484 ( 0.01%) if expr.span.from_expansion() { . return; . } . if let Some(higher::If { cond, then, r#else: None }) = higher::If::hir(expr) . . // Check if the conditional expression is a binary operation 32 ( 0.00%) && let ExprKind::Binary(ref cond_op, cond_left, cond_right) = cond.kind . { 24 ( 0.00%) check_with_condition(cx, expr, cond_op.node, cond_left, cond_right, then, self.msrv); . } else if let Some(higher::If { . cond, . then: if_block, . r#else: Some(else_block), . }) = higher::If::hir(expr) 18 ( 0.00%) && let ExprKind::Binary(ref cond_op, cond_left, cond_right) = cond.kind . { 7 ( 0.00%) check_manual_check( . cx, expr, cond_op, cond_left, cond_right, if_block, else_block, self.msrv, . ); . } 549,904 ( 0.03%) } . } . . #[expect(clippy::too_many_arguments)] . fn check_manual_check<'tcx>( . cx: &LateContext<'tcx>, . expr: &Expr<'tcx>, . condition: &BinOp, . left_hand: &Expr<'tcx>, . right_hand: &Expr<'tcx>, . if_block: &Expr<'tcx>, . else_block: &Expr<'tcx>, . msrv: Msrv, . ) { 14 ( 0.00%) let ty = cx.typeck_results().expr_ty(left_hand); 280 ( 0.00%) => ???:::expr_ty (7x) . if ty.is_numeric() && !ty.is_signed() { 33 ( 0.00%) match condition.node { 5 ( 0.00%) BinOpKind::Gt | BinOpKind::Ge => check_gt( . cx, . condition.span, 1 ( 0.00%) expr.span, . left_hand, . right_hand, . if_block, . else_block, . msrv, 1 ( 0.00%) matches!( 4 ( 0.00%) clippy_utils::get_parent_expr(cx, expr), 99 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (1x) . Some(Expr { . kind: ExprKind::If(..), . .. . }) . ), . ), . BinOpKind::Lt | BinOpKind::Le => check_gt( . cx, -- line 154 ---------------------------------------- -- line 168 ---------------------------------------- . ), . ), . _ => {}, . } . } . } . . #[expect(clippy::too_many_arguments)] 13 ( 0.00%) fn check_gt( . cx: &LateContext<'_>, . condition_span: Span, . expr_span: Span, . big_expr: &Expr<'_>, . little_expr: &Expr<'_>, . if_block: &Expr<'_>, . else_block: &Expr<'_>, . msrv: Msrv, . is_composited: bool, . ) { 8 ( 0.00%) if !big_expr.can_have_side_effects() && !little_expr.can_have_side_effects() { 36 ( 0.00%) => ???:::can_have_side_effects (2x) . check_subtraction( . cx, . condition_span, . expr_span, . big_expr, . little_expr, . if_block, . else_block, . msrv, . is_composited, . ); . } 8 ( 0.00%) } . . #[expect(clippy::too_many_arguments)] . fn check_subtraction( . cx: &LateContext<'_>, . condition_span: Span, . expr_span: Span, . big_expr: &Expr<'_>, . little_expr: &Expr<'_>, . if_block: &Expr<'_>, . else_block: &Expr<'_>, . msrv: Msrv, . is_composited: bool, . ) { . let if_block = peel_blocks(if_block); . let else_block = peel_blocks(else_block); 1 ( 0.00%) if is_integer_literal(if_block, 0) { . // We need to check this case as well to prevent infinite recursion. . if is_integer_literal(else_block, 0) { . // Well, seems weird but who knows? . return; . } . // If the subtraction is done in the `else` block, then we need to also revert the two . // variables as it means that the check was reverted too. . check_subtraction( -- line 224 ---------------------------------------- -- line 229 ---------------------------------------- . big_expr, . else_block, . if_block, . msrv, . is_composited, . ); . return; . } 1 ( 0.00%) if is_integer_literal(else_block, 0) . && let ExprKind::Binary(op, left, right) = if_block.kind . && let BinOpKind::Sub = op.node . { . let ctxt = expr_span.ctxt(); . if eq_expr_value(cx, ctxt, left, big_expr) && eq_expr_value(cx, ctxt, right, little_expr) { . // This part of the condition is voluntarily split from the one before to ensure that . // if `snippet_opt` fails, it won't try the next conditions. . if !is_in_const_context(cx) || msrv.meets(cx, msrvs::SATURATING_SUB_CONST) { -- line 245 ---------------------------------------- -- line 307 ---------------------------------------- . expr: &Expr<'tcx>, . cond_op: BinOpKind, . cond_left: &Expr<'tcx>, . cond_right: &Expr<'tcx>, . then: &Expr<'tcx>, . msrv: Msrv, . ) { . // Ensure that the binary operator is >, !=, or < 12 ( 0.00%) if (BinOpKind::Ne == cond_op || BinOpKind::Gt == cond_op || BinOpKind::Lt == cond_op) . . // Check if assign operation is done . && let Some(target) = subtracts_one(cx, then) . . // Extracting out the variable name . && let ExprKind::Path(QPath::Resolved(_, ares_path)) = target.kind . { . let ctxt = expr.span.ctxt(); -- line 323 ---------------------------------------- -- line 389 ---------------------------------------- . } . }, . _ => (), . } . } . } . . fn subtracts_one<'a>(cx: &LateContext<'_>, expr: &'a Expr<'a>) -> Option<&'a Expr<'a>> { 24 ( 0.00%) match peel_blocks_with_stmt(expr).kind { . ExprKind::AssignOp(ref op1, target, value) => { . // Check if literal being subtracted is one . (AssignOpKind::SubAssign == op1.node && is_integer_literal(value, 1)).then_some(target) . }, . ExprKind::Assign(target, value, _) => { . if let ExprKind::Binary(ref op1, left1, right1) = value.kind . && BinOpKind::Sub == op1.node . && SpanlessEq::new(cx).eq_expr(expr.span.ctxt(), left1, target) -- line 405 ---------------------------------------- 87 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_bits.rs -------------------------------------------------------------------------------- Ir -- line 42 ---------------------------------------- . . impl ManualBits { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl<'tcx> LateLintPass<'tcx> for ManualBits { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 137,484 ( 0.01%) if let ExprKind::Binary(bin_op, left_expr, right_expr) = expr.kind 152 ( 0.00%) && let BinOpKind::Mul = &bin_op.node 10 ( 0.00%) && !expr.span.from_expansion() 5 ( 0.00%) && let ctxt = expr.span.ctxt() 10 ( 0.00%) && left_expr.span.ctxt() == ctxt 10 ( 0.00%) && right_expr.span.ctxt() == ctxt . && let Some((real_ty_span, resolved_ty, other_expr)) = get_one_size_of_ty(cx, left_expr, right_expr) . && matches!(resolved_ty.kind(), ty::Int(_) | ty::Uint(_)) . && let ExprKind::Lit(lit) = &other_expr.kind . && let LitKind::Int(Pu128(8), _) = lit.node . && self.msrv.meets(cx, msrvs::INTEGER_BITS) . { . let mut app = Applicability::MachineApplicable; . let ty_snip = snippet_with_context(cx, real_ty_span, ctxt, "..", &mut app).0; -- line 64 ---------------------------------------- -- line 69 ---------------------------------------- . MANUAL_BITS, . expr.span, . "usage of `size_of::()` to obtain the size of `T` in bits", . "consider using", . sugg, . app, . ); . } 549,936 ( 0.03%) } . } . . fn get_one_size_of_ty<'tcx>( . cx: &LateContext<'tcx>, . expr1: &'tcx Expr<'_>, . expr2: &'tcx Expr<'_>, . ) -> Option<(Span, Ty<'tcx>, &'tcx Expr<'tcx>)> { 70 ( 0.00%) match (get_size_of_ty(cx, expr1), get_size_of_ty(cx, expr2)) { 140 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_bits.rs:clippy_lints::manual_bits::get_size_of_ty (10x) . (Some((real_ty_span, resolved_ty)), None) => Some((real_ty_span, resolved_ty, expr2)), . (None, Some((real_ty_span, resolved_ty))) => Some((real_ty_span, resolved_ty, expr1)), . _ => None, . } . } . 50 ( 0.00%) fn get_size_of_ty<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) -> Option<(Span, Ty<'tcx>)> { 20 ( 0.00%) if let ExprKind::Call(count_func, []) = expr.kind . && let ExprKind::Path(ref count_func_qpath) = count_func.kind . && let QPath::Resolved(_, count_func_path) = count_func_qpath . && let Some(segment_zero) = count_func_path.segments.first() . && let Some(args) = segment_zero.args . && let Some(real_ty_span) = args.args.first().map(GenericArg::span) . && let Some(def_id) = cx.qpath_res(count_func_qpath, count_func.hir_id).opt_def_id() . && cx.tcx.is_diagnostic_item(sym::mem_size_of, def_id) . { . cx.typeck_results() . .node_args(count_func.hir_id) . .types() . .next() . .map(|resolved_ty| (real_ty_span, resolved_ty)) . } else { 10 ( 0.00%) None . } 60 ( 0.00%) } . . fn create_sugg(cx: &LateContext<'_>, expr: &Expr<'_>, base_sugg: String) -> String { . if let Some(parent_expr) = get_parent_expr(cx, expr) { . if is_ty_conversion(parent_expr) { . return base_sugg; . } . . // These expressions have precedence over casts, the suggestion therefore -- line 118 ---------------------------------------- 110 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/entry.rs -------------------------------------------------------------------------------- Ir -- line 58 ---------------------------------------- . perf, . "use of `contains_key` followed by `insert` on a `HashMap` or `BTreeMap`" . } . . declare_lint_pass!(HashMapPass => [MAP_ENTRY]); . . impl<'tcx> LateLintPass<'tcx> for HashMapPass { . #[expect(clippy::too_many_lines)] 549,936 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 137,484 ( 0.01%) if expr.span.from_expansion() { . return; . } . . let Some(higher::If { . cond: cond_expr, . then: then_expr, . r#else: else_expr, . }) = higher::If::hir(expr) -- line 75 ---------------------------------------- -- line 205 ---------------------------------------- . lint_msg, . None, . format!( . "consider using the `Entry` API: https://doc.rust-lang.org/std/collections/struct.{}.html#entry-api", . map_ty.name() . ), . ); . } 549,936 ( 0.03%) } . } . . #[derive(Clone, Copy)] . enum MapType { . Hash, . BTree, . } . impl MapType { -- line 221 ---------------------------------------- -- line 255 ---------------------------------------- . } . . /// Inspect the given expression and return details about the `contains_key` check. . /// . /// If the given expression is not a `contains_key` check against a `BTreeMap` or a `HashMap`, . /// return `None`. . fn try_parse_contains<'tcx>(cx: &LateContext<'_>, expr: &'tcx Expr<'_>) -> Option<(MapType, ContainsExpr<'tcx>)> { . let mut negated = false; 75 ( 0.00%) let expr = peel_hir_expr_while(expr, |e| match e.kind { . ExprKind::Unary(UnOp::Not, e) => { . negated = !negated; . Some(e) . }, . _ => None, . }); . 54 ( 0.00%) if let ExprKind::MethodCall(_, map, [arg], _) = expr.kind . && let Expr { . kind: ExprKind::AddrOf(_, _, key), . span: key_span, . .. . } = arg . && key_span.eq_ctxt(expr.span) . { . let id = cx.typeck_results().type_dependent_def_id(expr.hir_id)?; -- line 279 ---------------------------------------- 25 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs -------------------------------------------------------------------------------- Ir -- line 454 ---------------------------------------- . /// let mut vec: Vec = Vec::new(); . /// ``` . #[inline] . #[rustc_const_stable(feature = "const_vec_new", since = "1.39.0")] . #[rustc_diagnostic_item = "vec_new"] . #[stable(feature = "rust1", since = "1.0.0")] . #[must_use] . pub const fn new() -> Self { 290,263 ( 0.01%) Vec { buf: RawVec::new(), len: 0 } . } . . /// Constructs a new, empty `Vec` with at least the specified capacity. . /// . /// The vector will be able to hold at least `capacity` elements without . /// reallocating. This method is allowed to allocate for more elements than . /// `capacity`. If `capacity` is zero, the vector will not allocate. . /// -- line 470 ---------------------------------------- -- line 961 ---------------------------------------- . /// // A vector of a zero-sized type will always over-allocate, since no . /// // allocation is necessary . /// let vec_units = Vec::<(), System>::with_capacity_in(10, System); . /// assert_eq!(vec_units.capacity(), usize::MAX); . /// ``` . #[inline] . #[unstable(feature = "allocator_api", issue = "32838")] . pub fn with_capacity_in(capacity: usize, alloc: A) -> Self { 226,175 ( 0.01%) Vec { buf: RawVec::with_capacity_in(capacity, alloc), len: 0 } . } . . /// Appends an element to the back of a collection. . /// . /// # Panics . /// . /// Panics if the new capacity exceeds `isize::MAX` _bytes_. . /// -- line 977 ---------------------------------------- -- line 1021 ---------------------------------------- . /// capacity after the push, *O*(*capacity*) time is taken to copy the . /// vector's elements to a larger allocation. This expensive operation is . /// offset by the *capacity* *O*(1) insertions it allows. . #[inline] . #[stable(feature = "push_mut", since = "1.95.0")] . #[must_use = "if you don't need a reference to the value, use `Vec::push` instead"] . pub fn push_mut(&mut self, value: T) -> &mut T { . // Inform codegen that the length does not change across grow_one(). 4,806 ( 0.00%) let len = self.len; . // This will panic or abort if we would allocate > isize::MAX bytes . // or if the length increment would overflow for zero-sized types. 10,476 ( 0.00%) if len == self.buf.capacity() { 1,009 ( 0.00%) self.buf.grow_one(); 1,018 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:>::grow_one (10x) 550 ( 0.00%) => ???:>::grow_one (10x) . } . unsafe { . let end = self.as_mut_ptr().add(len); . ptr::write(end, value); 10,565 ( 0.00%) self.len = len + 1; . // SAFETY: We just wrote a value to the pointer that will live the lifetime of the reference. . &mut *end . } . } . } . . impl Vec { . /// Constructs a new, empty `Vec`. -- line 1046 ---------------------------------------- -- line 1188 ---------------------------------------- . capacity: usize, . alloc: A, . ) -> Self { . ub_checks::assert_unsafe_precondition!( . check_library_ub, . "Vec::from_raw_parts_in requires that length <= capacity", . (length: usize = length, capacity: usize = capacity) => length <= capacity . ); 963 ( 0.00%) unsafe { Vec { buf: RawVec::from_raw_parts_in(ptr, capacity, alloc), len: length } } . } . . #[doc(alias = "from_non_null_parts_in")] . /// Creates a `Vec` directly from a `NonNull` pointer, a length, a capacity, . /// and an allocator. . /// . /// # Safety . /// -- line 1204 ---------------------------------------- -- line 1453 ---------------------------------------- . /// let mut vec = vec![1]; . /// vec.reserve(10); . /// assert!(vec.capacity() >= 11); . /// ``` . #[cfg(not(no_global_oom_handling))] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_diagnostic_item = "vec_reserve"] . pub fn reserve(&mut self, additional: usize) { 541 ( 0.00%) self.buf.reserve(self.len, additional); . } . . /// Reserves the minimum capacity for at least `additional` more elements to . /// be inserted in the given `Vec`. Unlike [`reserve`], this will not . /// deliberately over-allocate to speculatively avoid frequent allocations. . /// After calling `reserve_exact`, capacity will be greater than or equal to . /// `self.len() + additional`. Does nothing if the capacity is already . /// sufficient. -- line 1469 ---------------------------------------- -- line 1590 ---------------------------------------- . /// ``` . #[cfg(not(no_global_oom_handling))] . #[stable(feature = "rust1", since = "1.0.0")] . #[inline] . pub fn shrink_to_fit(&mut self) { . // The capacity is never less than the length, and there's nothing to do when . // they are equal, so we can avoid the panic case in `RawVec::shrink_to_fit` . // by only calling it with a greater capacity. 331 ( 0.00%) if self.capacity() > self.len { . self.buf.shrink_to_fit(self.len); . } . } . . /// Shrinks the capacity of the vector with a lower bound. . /// . /// The capacity will remain at least as large as both the length . /// and the supplied value. -- line 1606 ---------------------------------------- -- line 1815 ---------------------------------------- . // case avoids creating an invalid slice, and . // * the `len` of the vector is shrunk before calling `drop_in_place`, . // such that no value will be dropped twice in case `drop_in_place` . // were to panic once (if it panics twice, the program aborts). . unsafe { . // Note: It's intentional that this is `>` and not `>=`. . // Changing it to `>=` has negative performance . // implications in some cases. See #78884 for more. 18,393 ( 0.00%) if len > self.len { . return; . } . let remaining_len = self.len - len; . let s = self.as_mut_ptr().add(len).cast_slice(remaining_len); 7,646 ( 0.00%) self.len = len; . ptr::drop_in_place(s); . } . } . . /// Extracts a slice containing the entire vector. . /// . /// Equivalent to `&s[..]`. . /// -- line 1836 ---------------------------------------- -- line 1857 ---------------------------------------- . // * obeys size and address-wrapping constraints . // . // * We only construct `&mut` references to `self.buf` through `&mut self` methods; borrow- . // check ensures that it is not possible to mutably alias `self.buf` within the . // returned lifetime. . unsafe { . // normally this would use `slice::from_raw_parts`, but it's . // instantiated often enough that avoiding the UB check is worth it 510,451 ( 0.02%) &*core::intrinsics::aggregate_raw_ptr::<*const [T], _, _>(self.as_ptr(), self.len) . } . } . . /// Extracts a mutable slice of the entire vector. . /// . /// Equivalent to `&mut s[..]`. . /// . /// # Examples -- line 1873 ---------------------------------------- -- line 1896 ---------------------------------------- . // * obeys size and address-wrapping constraints . // . // * We only construct references to `self.buf` through `&self` and `&mut self` methods; . // borrow-check ensures that it is not possible to construct a reference to `self.buf` . // within the returned lifetime. . unsafe { . // normally this would use `slice::from_raw_parts_mut`, but it's . // instantiated often enough that avoiding the UB check is worth it 72,254 ( 0.00%) &mut *core::intrinsics::aggregate_raw_ptr::<*mut [T], _, _>(self.as_mut_ptr(), self.len) . } . } . . /// Returns a raw pointer to the vector's buffer, or a dangling raw pointer . /// valid for zero sized reads if the vector didn't allocate. . /// . /// The caller must ensure that the vector outlives the pointer this . /// function returns, or else it will end up dangling. -- line 1912 ---------------------------------------- -- line 2216 ---------------------------------------- . #[rustc_const_unstable(feature = "const_heap", issue = "79597")] . pub const unsafe fn set_len(&mut self, new_len: usize) { . ub_checks::assert_unsafe_precondition!( . check_library_ub, . "Vec::set_len requires that new_len <= capacity()", . (new_len: usize = new_len, capacity: usize = self.capacity()) => new_len <= capacity . ); . 5,216 ( 0.00%) self.len = new_len; . } . . /// Removes an element from the vector and returns it. . /// . /// The removed element is replaced by the last element of the vector. . /// . /// This does not preserve ordering of the remaining elements, but is *O*(1). . /// If you need to preserve the element order, use [`remove`] instead. -- line 2232 ---------------------------------------- -- line 2254 ---------------------------------------- . #[cold] . #[cfg_attr(not(panic = "immediate-abort"), inline(never))] . #[optimize(size)] . fn assert_failed(index: usize, len: usize) -> ! { . panic!("swap_remove index (is {index}) should be < len (is {len})"); . } . . let len = self.len(); 40 ( 0.00%) if index >= len { . assert_failed(index, len); . } . unsafe { . // We replace self[index] with the last element. Note that if the . // bounds check above succeeds there must be a last element (which . // can be self[index] itself). . let value = ptr::read(self.as_ptr().add(index)); . let base_ptr = self.as_mut_ptr(); 20 ( 0.00%) ptr::copy(base_ptr.add(len - 1), base_ptr.add(index), 1); . self.set_len(len - 1); . value . } . } . . /// Inserts an element at position `index` within the vector, shifting all . /// elements after it to the right. . /// -- line 2279 ---------------------------------------- -- line 2505 ---------------------------------------- . /// ``` . #[stable(feature = "vec_retain_mut", since = "1.61.0")] . pub fn retain_mut(&mut self, mut f: F) . where . F: FnMut(&mut T) -> bool, . { . let original_len = self.len(); . 40 ( 0.00%) if original_len == 0 { . // Empty case: explicit return allows better optimization, vs letting compiler infer it . return; . } . . // Vec: [Kept, Kept, Hole, Hole, Hole, Hole, Unchecked, Unchecked] . // | ^- write ^- read | . // |<- original_len ->| . // Kept: Elements which predicate returns true on. -- line 2521 ---------------------------------------- -- line 2865 ---------------------------------------- . /// . /// # Time complexity . /// . /// Takes *O*(1) time. . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_diagnostic_item = "vec_pop"] . pub fn pop(&mut self) -> Option { 6,730 ( 0.00%) if self.len == 0 { . None . } else { . unsafe { 4,483 ( 0.00%) self.len -= 1; . core::hint::assert_unchecked(self.len < self.capacity()); 20 ( 0.00%) Some(ptr::read(self.as_ptr().add(self.len()))) . } . } . } . . /// Removes and returns the last element from a vector if the predicate . /// returns `true`, or [`None`] if the predicate returns false or the vector . /// is empty (the predicate will not be called in that case). . /// -- line 2887 ---------------------------------------- -- line 2973 ---------------------------------------- . Ok(()) . } . . /// Appends elements to `self` from other buffer without reserving additional capacity. . #[inline] . unsafe fn append_elements_unreserved(&mut self, other: *const [T]) { . let count = other.len(); . let len = self.len(); 392 ( 0.00%) if count > 0 { . unsafe { . ptr::copy_nonoverlapping(other as *const T, self.as_mut_ptr().add(len), count) . }; . } 1,115 ( 0.00%) self.len += count; . } . . /// Removes the subslice indicated by the given range from the vector, . /// returning a double-ended iterator over the removed subslice. . /// . /// If the iterator is dropped before being fully consumed, . /// it drops the remaining removed elements. . /// -- line 2994 ---------------------------------------- -- line 3074 ---------------------------------------- . . // SAFETY: . // - `elems` comes directly from `as_mut_slice` and is therefore valid. . // - Setting `self.len` before calling `drop_in_place` means that, . // if an element's `Drop` impl panics, the vector's `Drop` impl will . // do nothing (leaking the rest of the elements) instead of dropping . // some twice. . unsafe { 286 ( 0.00%) self.len = 0; . ptr::drop_in_place(elems); . } . } . . /// Returns the number of elements in the vector, also referred to . /// as its 'length'. . /// . /// # Examples -- line 3090 ---------------------------------------- -- line 3093 ---------------------------------------- . /// let a = vec![1, 2, 3]; . /// assert_eq!(a.len(), 3); . /// ``` . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_vec_string_slice", since = "1.87.0")] . #[rustc_confusables("length", "size")] . pub const fn len(&self) -> usize { 6,528 ( 0.00%) let len = self.len; . . // SAFETY: The maximum capacity of `Vec` is `isize::MAX` bytes, so the maximum value can . // be returned is `usize::checked_div(size_of::()).unwrap_or(usize::MAX)`, which . // matches the definition of `T::MAX_SLICE_LEN`. . unsafe { intrinsics::assume(len <= T::MAX_SLICE_LEN) }; . . len . } -- line 3109 ---------------------------------------- -- line 3118 ---------------------------------------- . /// . /// v.push(1); . /// assert!(!v.is_empty()); . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_diagnostic_item = "vec_is_empty"] . #[rustc_const_stable(feature = "const_vec_string_slice", since = "1.87.0")] . pub const fn is_empty(&self) -> bool { 1,632 ( 0.00%) self.len() == 0 . } . . /// Splits the collection into two at the given index. . /// . /// Returns a newly allocated vector containing the elements in the range . /// `[at, len)`. After the call, the original vector will be left containing . /// the elements `[0, at)` with its previous capacity unchanged. . /// -- line 3134 ---------------------------------------- -- line 3868 ---------------------------------------- . #[cfg(not(no_global_oom_handling))] . #[stable(feature = "rust1", since = "1.0.0")] . impl Clone for Vec { . /// Creates a new `Vec` by deep-copying the contents of an existing `Vec`. . /// . /// This method will allocate a new `Vec` and `clone` all of `self`'s contents . /// into it. The capacity of the duplicate `Vec` is not forced to match the . /// capacity of the original. 21,404 ( 0.00%) fn clone(&self) -> Self { . let alloc = self.allocator().clone(); 2 ( 0.00%) <[T]>::to_vec_in(&**self, alloc) 27,518 ( 0.00%) } . . /// Overwrites the contents of `self` with a clone of the contents of `source`. . /// . /// This method is preferred over simply assigning `source.clone()` to `self`, . /// as it avoids reallocation if possible. Additionally, if the element type . /// `T` overrides `clone_from()`, this will reuse the resources of `self`'s . /// elements as well. . /// -- line 3887 ---------------------------------------- -- line 3915 ---------------------------------------- . /// let v: Vec = vec![0xa8, 0x3c, 0x09]; . /// let s: &[u8] = &[0xa8, 0x3c, 0x09]; . /// assert_eq!(b.hash_one(v), b.hash_one(s)); . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . impl Hash for Vec { . #[inline] . fn hash(&self, state: &mut H) { 46 ( 0.00%) Hash::hash(&**self, state) . } . } . . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_index", issue = "143775")] . const impl, A: Allocator> Index for Vec { . type Output = I::Output; . -- line 3931 ---------------------------------------- -- line 3988 ---------------------------------------- . /// LONG_LIVED.lock().unwrap().push(result); . /// } . /// ``` . #[cfg(not(no_global_oom_handling))] . #[stable(feature = "rust1", since = "1.0.0")] . impl FromIterator for Vec { . #[inline] . fn from_iter>(iter: I) -> Vec { 227 ( 0.00%) >::from_iter(iter.into_iter()) 314 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/spec_from_iter.rs: as alloc::vec::spec_from_iter::SpecFromIter, clippy_lints::loops::manual_memcpy::get_assignments::{closure#0}>, core::option::IntoIter<&rustc_hir::hir::Expr>>, clippy_lints::loops::manual_memcpy::get_assignments::{closure#1}>, clippy_lints::loops::manual_memcpy::get_assignment>>>, core::option::IntoIter>>, clippy_lints::loops::manual_memcpy::check::{closure#0}>, clippy_lints::loops::manual_memcpy::check::{closure#1}>, core::option::Option>>>::from_iter (1x) . } . } . . #[stable(feature = "rust1", since = "1.0.0")] . impl IntoIterator for Vec { . type Item = T; . type IntoIter = IntoIter; . -- line 4004 ---------------------------------------- -- line 4026 ---------------------------------------- . let buf = me.buf.non_null(); . let begin = buf.as_ptr(); . let end = if T::IS_ZST { . begin.wrapping_byte_add(me.len()) . } else { . begin.add(me.len()) as *const T . }; . let cap = me.buf.capacity(); 7 ( 0.00%) IntoIter { buf, phantom: PhantomData, cap, alloc, ptr: buf, end } . } . } . } . . #[stable(feature = "rust1", since = "1.0.0")] . impl<'a, T, A: Allocator> IntoIterator for &'a Vec { . type Item = &'a T; . type IntoIter = slice::Iter<'a, T>; -- line 4042 ---------------------------------------- -- line 4056 ---------------------------------------- . } . } . . #[cfg(not(no_global_oom_handling))] . #[stable(feature = "rust1", since = "1.0.0")] . impl Extend for Vec { . #[inline] . fn extend>(&mut self, iter: I) { 1 ( 0.00%) >::spec_extend(self, iter.into_iter()) 519 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/spec_extend.rs: as alloc::vec::spec_extend::SpecExtend>>::spec_extend (1x) . } . . #[inline] . fn extend_one(&mut self, item: T) { . self.push(item); . } . . #[inline] -- line 4072 ---------------------------------------- -- line 4084 ---------------------------------------- . } . } . } . . impl Vec { . // leaf method to which various SpecFrom/SpecExtend implementations delegate when . // they have no further optimizations to apply . #[cfg(not(no_global_oom_handling))] 10 ( 0.00%) fn extend_desugared>(&mut self, mut iterator: I) { . // This is the case for a general iterator. . // . // This function should be the moral equivalent of: . // . // for item in iterator { . // self.push(item); . // } 3,442 ( 0.00%) while let Some(element) = iterator.next() { 35,830 ( 0.00%) => /home/moon/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/toml_parser-1.1.2+spec-1.1.0/src/lexer/mod.rs:::next (271x) . let len = self.len(); 954 ( 0.00%) if len == self.capacity() { . let (lower, _) = iterator.size_hint(); . self.reserve(lower.saturating_add(1)); . } . unsafe { . ptr::write(self.as_mut_ptr().add(len), element); . // Since next() executes user code which can panic we have to bump the length . // after each step. . // NB can't overflow since we would have had to alloc the address space 477 ( 0.00%) self.set_len(len + 1); . } . } 8 ( 0.00%) } . . // specific extend for `TrustedLen` iterators, called both by the specializations . // and internal places where resolving specialization makes compilation slower . #[cfg(not(no_global_oom_handling))] . fn extend_trusted(&mut self, iterator: impl iter::TrustedLen) { . let (low, high) = iterator.size_hint(); . if let Some(additional) = high { . debug_assert_eq!( -- line 4122 ---------------------------------------- -- line 4124 ---------------------------------------- . additional, . "TrustedLen iterator's size hint is not exact: {:?}", . (low, high) . ); . self.reserve(additional); . unsafe { . let ptr = self.as_mut_ptr(); . let mut local_len = SetLenOnDrop::new(&mut self.len); 20 ( 0.00%) iterator.for_each(move |element| { . ptr::write(ptr.add(local_len.current_len()), element); . // Since the loop executes user code which can panic we have to update . // the length every step to correctly drop what we've written. . // NB can't overflow since we would have had to alloc the address space . local_len.increment_len(1); . }); . } . } else { -- line 4140 ---------------------------------------- -- line 4345 ---------------------------------------- . } . } . . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_heap", issue = "79597")] . const unsafe impl<#[may_dangle] T: [const] Destruct, A: [const] Allocator + [const] Destruct> Drop . for Vec . { 371 ( 0.00%) fn drop(&mut self) { . unsafe { . // use drop for [T] . // use a raw slice to refer to the elements of the vector as weakest necessary type; . // could avoid questions of validity in certain cases 3,886 ( 0.00%) self.as_mut_ptr().cast_slice(self.len).drop_in_place() . } . // RawVec handles deallocation 462 ( 0.00%) } . } . . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_default", issue = "143894")] . const impl Default for Vec { . /// Creates an empty `Vec`. . /// . /// The vector will not allocate until elements are pushed onto it. -- line 4369 ---------------------------------------- 80,306 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/spec_from_iter_nested.rs -------------------------------------------------------------------------------- Ir -- line 10 ---------------------------------------- . pub(super) trait SpecFromIterNested { . fn from_iter(iter: I) -> Self; . } . . impl SpecFromIterNested for Vec . where . I: Iterator, . { 844,472 ( 0.04%) default fn from_iter(mut iterator: I) -> Self { . // Unroll the first iteration, as the vector is going to be . // expanded on this iteration in every case when the iterable is not . // empty, but the loop in extend_desugared() is not going to see the . // vector being full in the few subsequent loop iterations. . // So we get better branch prediction. 116,869 ( 0.01%) let mut vector = match iterator.next() { 3,207 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/filter.rs:, core::slice::iter::Iter>>, clippy_lints::ptr::ptr_arg::check_fn_args::{closure#0}>, clippy_lints::ptr::ptr_arg::check_body::{closure#0}> as core::iter::traits::iterator::Iterator>::next (56x) . None => return Vec::new(), 19 ( 0.00%) Some(element) => { . let (lower, _) = iterator.size_hint(); . let initial_capacity = . cmp::max(RawVec::::MIN_NON_ZERO_CAP, lower.saturating_add(1)); . let mut vector = Vec::with_capacity(initial_capacity); . unsafe { . // SAFETY: We requested capacity at least 1 . ptr::write(vector.as_mut_ptr(), element); . vector.set_len(1); . } 116,434 ( 0.01%) vector . } . }; . // must delegate to spec_extend() since extend() itself delegates . // to spec_from for empty Vecs 387,539 ( 0.02%) as SpecExtend>::spec_extend(&mut vector, iterator); 30 ( 0.00%) => ???:0x0000000000173dc0 (1x) 271,426 ( 0.01%) vector 1,031,575 ( 0.05%) } . } . . impl SpecFromIterNested for Vec . where . I: TrustedLen, . { 780 ( 0.00%) fn from_iter(iterator: I) -> Self { 42 ( 0.00%) let mut vector = match iterator.size_hint() { . (_, Some(upper)) => Vec::with_capacity(upper), . // TrustedLen contract guarantees that `size_hint() == (_, None)` means that there . // are more than `usize::MAX` elements. . // Since the previous branch would eagerly panic if the capacity is too large . // (via `with_capacity`) we do the same here. . _ => panic!("capacity overflow"), . }; . // reuse extend specialization for TrustedLen 42 ( 0.00%) vector.spec_extend(iterator); 709 ( 0.00%) vector 819 ( 0.00%) } . } 1,103 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/arc_with_non_send_sync.rs -------------------------------------------------------------------------------- Ir -- line 38 ---------------------------------------- . pub ARC_WITH_NON_SEND_SYNC, . suspicious, . "using `Arc` with a type that does not implement `Send` and `Sync`" . } . . declare_lint_pass!(ArcWithNonSendSync => [ARC_WITH_NON_SEND_SYNC]); . . impl<'tcx> LateLintPass<'tcx> for ArcWithNonSendSync { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 138,048 ( 0.01%) if let ExprKind::Call(func, [arg]) = expr.kind 682 ( 0.00%) && let ExprKind::Path(QPath::TypeRelative(func_ty, func_name)) = func.kind 18 ( 0.00%) && func_name.ident.name == sym::new 8 ( 0.00%) && !expr.span.from_expansion() 24 ( 0.00%) && cx.typeck_results().node_type(func_ty.hir_id).is_diag_item(cx, sym::Arc) 164 ( 0.00%) => ???:::node_type (4x) . && let arg_ty = cx.typeck_results().expr_ty(arg) . // make sure that the type is not and does not contain any type parameters . && arg_ty.walk().all(|arg| { . !matches!(arg.kind(), GenericArgKind::Type(ty) if matches!(ty.kind(), ty::Param(_))) . }) . && let Some(send) = cx.tcx.get_diagnostic_item(sym::Send) . && let Some(sync) = cx.tcx.lang_items().sync_trait() . && let [is_send, is_sync] = [send, sync].map(|id| implements_trait(cx, arg_ty, id, &[])) -- line 59 ---------------------------------------- -- line 78 ---------------------------------------- . diag.help("if the `Arc` will not be used across threads replace it with an `Rc`"); . diag.help(format!( . "otherwise make `{arg_ty}` `Send` and `Sync` or consider a wrapper type such as `Mutex`" . )); . }); . }, . ); . } 549,936 ( 0.03%) } . } 8 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/unit_types/mod.rs -------------------------------------------------------------------------------- Ir -- line 105 ---------------------------------------- . . impl UnitTypes { . pub fn new(format_args: FormatArgsStorage) -> Self { . Self { format_args } . } . } . . impl<'tcx> LateLintPass<'tcx> for UnitTypes { 407 ( 0.00%) fn check_local(&mut self, cx: &LateContext<'tcx>, local: &'tcx LetStmt<'tcx>) { . let_unit_value::check(cx, &self.format_args, local); 296 ( 0.00%) } . . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 206,226 ( 0.01%) unit_cmp::check(cx, expr); 2,122,925 ( 0.10%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/unit_types/unit_cmp.rs:clippy_lints::unit_types::unit_cmp::check (68,742x) 206,226 ( 0.01%) unit_arg::check(cx, expr); 9,200,865 ( 0.43%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/unit_types/unit_arg.rs:clippy_lints::unit_types::unit_arg::check (68,742x) . } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/matches/mod.rs -------------------------------------------------------------------------------- Ir -- line 1048 ---------------------------------------- . msrv: conf.msrv.into(), . infallible_destructuring_match_linted: false, . } . } . } . . impl<'tcx> LateLintPass<'tcx> for Matches { . #[expect(clippy::too_many_lines)] 618,678 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . let from_expansion = expr.span.from_expansion(); . 206,562 ( 0.01%) if let ExprKind::Match(ex, arms, source) = expr.kind { 332 ( 0.00%) if is_direct_expn_of(expr.span, sym::matches).is_some() 3,009 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_direct_expn_of (48x) . && let [arm, _] = arms . { . redundant_pattern_match::check_match(cx, expr, ex, arms); . redundant_pattern_match::check_matches_true(cx, expr, arm, ex); . } 288 ( 0.00%) if expr.span.in_external_macro(cx.tcx.sess.source_map()) { . return; . } . 97 ( 0.00%) if source == MatchSource::Normal && !is_span_match(cx, expr.span) { . return; . } 450 ( 0.00%) if matches!(source, MatchSource::Normal | MatchSource::ForLoopDesugar) { 294 ( 0.00%) significant_drop_in_scrutinee::check_match(cx, expr, ex, arms, source); 31,905 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/significant_drop_in_scrutinee.rs:clippy_lints::matches::significant_drop_in_scrutinee::check_match (42x) . } . 270 ( 0.00%) collapsible_match::check_match(cx, ex, arms, self.msrv); 132,978 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/collapsible_match.rs:clippy_lints::matches::collapsible_match::check_match (45x) 90 ( 0.00%) if !from_expansion { . // These don't depend on a relationship between multiple arms 145 ( 0.00%) match_wild_err_arm::check(cx, ex, arms); 11,506 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/match_wild_err_arm.rs:clippy_lints::matches::match_wild_err_arm::check (29x) 145 ( 0.00%) wild_in_or_pats::check(cx, ex, arms); 36,315 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/wild_in_or_pats.rs:clippy_lints::matches::wild_in_or_pats::check (29x) . } . 135 ( 0.00%) if let MatchSource::TryDesugar(_) = source { 9 ( 0.00%) try_err::check(cx, expr, ex); 474 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/try_err.rs:clippy_lints::matches::try_err::check (3x) . } . . if !from_expansion 29 ( 0.00%) && let mut has_cfg = false 29 ( 0.00%) && let mut has_comments = false 13,687 ( 0.00%) && walk_intra_arm_text(cx, expr.span, ex.span, arms, |s| { 17,771 ( 0.00%) let mut iter = tokenize_with_text(s).filter(|(t, ..)| match t { . TokenKind::Whitespace => false, . TokenKind::LineComment { .. } | TokenKind::BlockComment { .. } => { 2 ( 0.00%) has_comments = true; . false . }, . _ => true, . }); . while let Some((t, ..)) = iter.next() { . if matches!(t, TokenKind::Pound) . && matches!(iter.next(), Some((TokenKind::OpenBracket, ..))) . && matches!(iter.next(), Some((TokenKind::Ident, "cfg", _))) . { . has_cfg = true; . } . } 12,048 ( 0.00%) }) . && !has_cfg . { 26 ( 0.00%) if source == MatchSource::Normal { 182 ( 0.00%) let is_match_like_matches = self.msrv.meets(cx, msrvs::MATCHES_MACRO) 702 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (26x) . && match_like_matches::check_match(cx, expr, ex, arms); . // Even when the lint is allowed on the match expression, an arm can carry its . // own `#[expect]`/`#[warn]` attribute, which `match_same_arms::check` handles . // at arm granularity. Only skip the check when no arm has attributes. . if !(is_match_like_matches 182 ( 0.00%) || (is_lint_allowed(cx, MATCH_SAME_ARMS, expr.hir_id) 17,624 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_lint_allowed (26x) 1,480 ( 0.00%) && arms.iter().all(|arm| cx.tcx.hir_attrs(arm.hir_id).is_empty()))) 75,174 ( 0.00%) => ???:::hir_attrs (1,480x) . { . match_same_arms::check(cx, arms); . } . 208 ( 0.00%) redundant_pattern_match::check_match(cx, expr, ex, arms); 706 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/redundant_pattern_match.rs:clippy_lints::matches::redundant_pattern_match::check_match (26x) 182 ( 0.00%) single_match::check(cx, ex, arms, expr, has_comments); 152,545 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/single_match.rs:clippy_lints::matches::single_match::check (26x) 156 ( 0.00%) match_bool::check(cx, ex, arms, expr); 1,962 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/match_bool.rs:clippy_lints::matches::match_bool::check (26x) 130 ( 0.00%) overlapping_arms::check(cx, ex, arms); 1,884 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/overlapping_arms.rs:clippy_lints::matches::overlapping_arms::check (26x) 130 ( 0.00%) match_wild_enum::check(cx, ex, arms); 3,669 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/match_wild_enum.rs:clippy_lints::matches::match_wild_enum::check (26x) 156 ( 0.00%) match_as_ref::check(cx, ex, arms, expr); 3,139 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/match_as_ref.rs:clippy_lints::matches::match_as_ref::check (26x) 156 ( 0.00%) needless_match::check_match(cx, ex, arms, expr); 10,684 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/needless_match.rs:clippy_lints::matches::needless_match::check_match (26x) 130 ( 0.00%) match_str_case_mismatch::check(cx, ex, arms); 1,702 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/match_str_case_mismatch.rs:clippy_lints::matches::match_str_case_mismatch::check (26x) 130 ( 0.00%) redundant_guards::check(cx, arms, self.msrv); 9,793 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/redundant_guards.rs:clippy_lints::matches::redundant_guards::check (26x) . 104 ( 0.00%) if !is_in_const_context(cx) { 6,996 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_const_context (26x) 182 ( 0.00%) manual_unwrap_or::check_match(cx, expr, ex, arms); 5,503 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/manual_unwrap_or.rs:clippy_lints::matches::manual_unwrap_or::check_match (26x) 156 ( 0.00%) manual_map::check_match(cx, expr, ex, arms); 3,566 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/manual_map.rs:clippy_lints::matches::manual_map::check_match (26x) 156 ( 0.00%) manual_filter::check_match(cx, ex, arms, expr); 3,372 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/manual_filter.rs:clippy_lints::matches::manual_filter::check_match (26x) 182 ( 0.00%) manual_ok_err::check_match(cx, expr, ex, arms); 2,647 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/manual_ok_err.rs:clippy_lints::matches::manual_ok_err::check_match (26x) . } . 52 ( 0.00%) if self.infallible_destructuring_match_linted { . self.infallible_destructuring_match_linted = false; . } else { 156 ( 0.00%) match_single_binding::check(cx, ex, arms, expr); 806 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/match_single_binding.rs:clippy_lints::matches::match_single_binding::check (26x) . } . } . match_ref_pats::check(cx, ex, arms.iter().map(|el| el.pat), expr); . } 412,182 ( 0.02%) } else if let Some(if_let) = higher::IfLet::hir(cx, expr) { 344,022 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (68,694x) 15 ( 0.00%) if expr.span.in_external_macro(cx.tcx.sess.source_map()) { . return; . } . collapsible_match::check_if_let( . cx, 12 ( 0.00%) if_let.let_span.ctxt(), 3 ( 0.00%) if_let.let_pat, 3 ( 0.00%) if_let.if_then, 3 ( 0.00%) if_let.if_else, 3 ( 0.00%) if_let.let_expr, 3 ( 0.00%) self.msrv, . ); . significant_drop_in_scrutinee::check_if_let(cx, expr, if_let.let_expr, if_let.if_then, if_let.if_else); 9 ( 0.00%) if !from_expansion { 6 ( 0.00%) if let Some(else_expr) = if_let.if_else { . if self.msrv.meets(cx, msrvs::MATCHES_MACRO) { . match_like_matches::check_if_let( . cx, . expr, . if_let.let_pat, . if_let.let_expr, . if_let.if_then, . else_expr, -- line 1172 ---------------------------------------- -- line 1203 ---------------------------------------- . redundant_pattern_match::check_if_let( . cx, . expr, . if_let.let_pat, . if_let.let_expr, . if_let.if_else.is_some(), . if_let.let_span, . ); 9 ( 0.00%) needless_match::check_if_let(cx, expr, &if_let); 867 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/needless_match.rs:clippy_lints::matches::needless_match::check_if_let (3x) . } . } else { 343,455 ( 0.02%) if expr.span.in_external_macro(cx.tcx.sess.source_map()) { . return; . } . if let Some(while_let) = higher::WhileLet::hir(expr) { . significant_drop_in_scrutinee::check_while_let(cx, expr, while_let.let_expr, while_let.if_then); . } 20 ( 0.00%) if !from_expansion { . redundant_pattern_match::check(cx, expr); . } . } 549,936 ( 0.03%) } . . fn check_local(&mut self, cx: &LateContext<'tcx>, local: &'tcx LetStmt<'_>) { 37 ( 0.00%) self.infallible_destructuring_match_linted |= 148 ( 0.00%) local.els.is_none() && infallible_destructuring_match::check(cx, local); 1,143 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/infallible_destructuring_match.rs:clippy_lints::matches::infallible_destructuring_match::check (37x) . } . . fn check_pat(&mut self, cx: &LateContext<'tcx>, pat: &'tcx Pat<'_>) { 7,611 ( 0.00%) rest_pat_in_fully_bound_struct::check(cx, pat); 68,442 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/rest_pat_in_fully_bound_struct.rs:clippy_lints::matches::rest_pat_in_fully_bound_struct::check (2,537x) . } . } . . /// Calls the given function for each segment of the source text within the . /// match block which is not part of any arm. For the purposes of this function . /// attributes on an arm are not considered part of the arm. . /// . /// This will return whether all the relevant source text could be retrieved. If -- line 1240 ---------------------------------------- -- line 1243 ---------------------------------------- . #[must_use] . fn walk_intra_arm_text( . cx: &LateContext<'_>, . match_sp: Span, . scrutinee_sp: Span, . arms: &[Arm<'_>], . mut f: impl FnMut(&str), . ) -> bool { 174 ( 0.00%) if let Some(src) = match_sp.get_source_range(cx) 58 ( 0.00%) && let scrutinee_sp = scrutinee_sp.source_callsite().data() 1,054 ( 0.00%) => ???:::source_callsite (29x) . && let block_start = (scrutinee_sp.hi.0 - src.sf.start_pos.0) as usize . && let Some(src_text) = src.sf.src.as_ref().map(|x| &***x) 29 ( 0.00%) && let Some(block_text) = src_text.get(block_start..src.range.end) 58 ( 0.00%) && let Some(stripped_text) = block_text.trim_start_matches(is_whitespace).strip_prefix('{') 1,246 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/mod.rs:::trim_start_matches:: (29x) . && let arms_start = block_start + (block_text.len() - stripped_text.len()) . && let Some(arms_end) = stripped_text 78 ( 0.00%) .trim_end_matches(|c| is_whitespace(c) || c == ')') 676 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/mod.rs:::trim_end_matches::::check_expr::{closure#0}>::{closure#1}> (26x) . .strip_suffix('}') 52 ( 0.00%) .map(|s| src.range.end - (stripped_text.len() - s.len())) . && let Some(range) = arms.iter().try_fold(arms_start..arms_end, |range, arm| { 1,480 ( 0.00%) let arm_sp: rustc_span::SpanData = arm.span.source_callsite().data(); 38,480 ( 0.00%) => ???:::source_callsite (1,480x) 4,440 ( 0.00%) let arm_range = (arm_sp.lo.0 - src.sf.start_pos.0) as usize..(arm_sp.hi.0 - src.sf.start_pos.0) as usize; 8,880 ( 0.00%) if range.start <= arm_range.start . && arm_range.end <= range.end . && let Some(src) = src_text.get(range.start..arm_range.start) . { 5,920 ( 0.00%) f(src); 538,774 ( 0.03%) => site/frontend/rust-clippy/clippy_lints/src/matches/mod.rs:::check_expr::{closure#0} (1,480x) . Some(arm_range.end..range.end) . } else { . None . } . }) . && let Some(src) = src_text.get(range) . { 26 ( 0.00%) f(src); 9,412 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/matches/mod.rs:::check_expr::{closure#0} (26x) . true . } else { . false . } . } . . /// Checks if `pat` contains OR patterns that cannot be nested due to a too low MSRV. . fn pat_contains_disallowed_or(cx: &LateContext<'_>, pat: &Pat<'_>, msrv: Msrv) -> bool { -- line 1285 ---------------------------------------- 18,930 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/attrs/mod.rs -------------------------------------------------------------------------------- Ir -- line 506 ---------------------------------------- . . impl Attributes { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl<'tcx> LateLintPass<'tcx> for Attributes { 1,917 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) { 1,065 ( 0.00%) let attrs = cx.tcx.hir_attrs(item.hir_id()); 9,626 ( 0.00%) => ???:::hir_attrs (213x) 567 ( 0.00%) if let ItemKind::Fn { ident, body, .. } = item.kind { 329 ( 0.00%) inline_always::check(cx, item.span, ident.name, attrs, Some(body)); 4,967 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/attrs/inline_always.rs:clippy_lints::attrs::inline_always::check (47x) . } 166 ( 0.00%) repr_attributes::check(cx, item.span, attrs, self.msrv); 1,491 ( 0.00%) } . . fn check_impl_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx ImplItem<'_>) { 233 ( 0.00%) if let ImplItemKind::Fn(_, body) = item.kind { 315 ( 0.00%) inline_always::check( 1,466 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/attrs/inline_always.rs:clippy_lints::attrs::inline_always::check (45x) . cx, 45 ( 0.00%) item.span, 45 ( 0.00%) item.ident.name, 180 ( 0.00%) cx.tcx.hir_attrs(item.hir_id()), 2,337 ( 0.00%) => ???:::hir_attrs (45x) . Some(body), . ); . } . } . . fn check_trait_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx TraitItem<'_>) { 12 ( 0.00%) if let TraitItemKind::Fn(_, kind) = item.kind { 36 ( 0.00%) let body = match kind { . TraitFn::Required(_) => None, . TraitFn::Provided(body) => Some(body), . }; 84 ( 0.00%) inline_always::check(cx, item.span, item.ident.name, cx.tcx.hir_attrs(item.hir_id()), body); 312 ( 0.00%) => ???:::hir_attrs (6x) 268 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/attrs/inline_always.rs:clippy_lints::attrs::inline_always::check (6x) . } . } . } . . pub struct EarlyAttributes { . msrv: MsrvStack, . } . . impl EarlyAttributes { . pub fn new(conf: &'static Conf) -> Self { 11 ( 0.00%) Self { msrv: conf.msrv.into() } . } . } . . impl EarlyLintPass for EarlyAttributes { 1,440 ( 0.00%) fn check_attribute(&mut self, cx: &EarlyContext<'_>, attr: &Attribute) { 720 ( 0.00%) deprecated_cfg_attr::check(cx, attr, &self.msrv); 7,587 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/attrs/deprecated_cfg_attr.rs:clippy_lints::attrs::deprecated_cfg_attr::check (240x) 720 ( 0.00%) deprecated_cfg_attr::check_clippy(cx, attr); 13,277 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/attrs/deprecated_cfg_attr.rs:clippy_lints::attrs::deprecated_cfg_attr::check_clippy (240x) . non_minimal_cfg::check(cx, attr); 960 ( 0.00%) } . . extract_msrv_attr!(); . } . . pub struct PostExpansionEarlyAttributes { . msrv: MsrvStack, . } . . impl PostExpansionEarlyAttributes { . pub fn new(conf: &'static Conf) -> Self { 1 ( 0.00%) Self { msrv: conf.msrv.into() } . } . } . . impl EarlyLintPass for PostExpansionEarlyAttributes { . fn check_crate(&mut self, cx: &EarlyContext<'_>, _krate: &ast::Crate) { . blanket_clippy_restriction_lints::check_command_line(cx); . } . 2,410 ( 0.00%) fn check_attribute(&mut self, cx: &EarlyContext<'_>, attr: &Attribute) { 723 ( 0.00%) check_clippy_attr(cx.sess(), attr); 14,589 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/attrs.rs:clippy_utils::attrs::check_clippy_attr:: (241x) 1,205 ( 0.00%) if let Some(items) = &attr.meta_item_list() 7,906 ( 0.00%) => ???:::meta_item_list (241x) 173 ( 0.00%) && let Some(name) = attr.name() 153 ( 0.00%) => ???:::name (17x) . { 50 ( 0.00%) if matches!(name, sym::allow) && self.msrv.meets(msrvs::LINT_REASONS_STABILIZATION) { 240 ( 0.00%) => /rust/deps/smallvec-1.15.1/src/lib.rs:::meets (10x) . allow_attributes::check(cx, attr); . } 50 ( 0.00%) if matches!(name, sym::allow | sym::expect) && self.msrv.meets(msrvs::LINT_REASONS_STABILIZATION) { 240 ( 0.00%) => /rust/deps/smallvec-1.15.1/src/lib.rs:::meets (10x) . allow_attributes_without_reason::check(cx, name, items, attr); . } . if is_lint_level(name) { . blanket_clippy_restriction_lints::check(cx, name, items); . } 34 ( 0.00%) if items.is_empty() || !attr.has_name(sym::deprecated) { . return; . } . for item in items { . if let MetaItemInner::MetaItem(mi) = &item . && let MetaItemKind::NameValue(lit) = &mi.kind . && mi.has_name(sym::since) . { . deprecated_semver::check(cx, item.span(), lit); -- line 602 ---------------------------------------- -- line 603 ---------------------------------------- . } . } . } . . if attr.has_name(sym::should_panic) { . should_panic_without_expect::check(cx, attr); . } . 84 ( 0.00%) if attr.has_name(sym::ignore) . && let AttrKind::Normal(normal_attr) = &attr.kind . && !matches!(normal_attr.item.args, AttrArgs::Eq { .. }) . { . span_lint_and_help( . cx, . IGNORE_WITHOUT_REASON, . attr.span, . "`#[ignore]` without reason", . None, . "add a reason with `= \"..\"`", . ); . } 1,928 ( 0.00%) } . . fn check_item(&mut self, cx: &EarlyContext<'_>, item: &'_ ast::Item) { 510 ( 0.00%) match item.kind { 120 ( 0.00%) ast::ItemKind::ExternCrate(..) | ast::ItemKind::Use(..) => useless_attribute::check(cx, item, &item.attrs), 1,299 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/attrs/useless_attribute.rs:clippy_lints::attrs::useless_attribute::check (40x) . _ => {}, . } . 850 ( 0.00%) mixed_attributes_style::check(cx, item.span, &item.attrs); 79,247 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/attrs/mixed_attributes_style.rs:clippy_lints::attrs::mixed_attributes_style::check (170x) . } . 742,910 ( 0.03%) fn check_attributes(&mut self, cx: &EarlyContext<'_>, attrs: &[Attribute]) { 222,873 ( 0.01%) self.msrv.check_attributes(attrs); 228,462 ( 0.01%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_attributes (74,291x) . duplicated_attributes::check(cx, attrs); 148,582 ( 0.01%) msrvs::check_attrs(cx.sess(), attrs); 1,342,156 ( 0.06%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:clippy_utils::msrvs::check_attrs:: (74,291x) 594,328 ( 0.03%) } . . fn check_attributes_post(&mut self, _cx: &EarlyContext<'_>, attrs: &[Attribute]) { 297,164 ( 0.01%) self.msrv.check_attributes_post(attrs); 228,462 ( 0.01%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_attributes_post (74,291x) . } . } 13 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/reserve_after_initialization.rs -------------------------------------------------------------------------------- Ir -- line 29 ---------------------------------------- . #[clippy::version = "1.74.0"] . pub RESERVE_AFTER_INITIALIZATION, . complexity, . "`reserve` called immediately after `Vec` creation" . } . . impl_lint_pass!(ReserveAfterInitialization => [RESERVE_AFTER_INITIALIZATION]); . 1 ( 0.00%) #[derive(Default)] . pub struct ReserveAfterInitialization { . searcher: Option, . } . . struct VecReserveSearcher { . local_id: HirId, . err_span: Span, . init_part: String, -- line 45 ---------------------------------------- -- line 62 ---------------------------------------- . s, . Applicability::HasPlaceholders, . ); . } . } . . impl<'tcx> LateLintPass<'tcx> for ReserveAfterInitialization { . fn check_block(&mut self, _: &LateContext<'tcx>, _: &'tcx Block<'tcx>) { 172 ( 0.00%) self.searcher = None; . } . 222 ( 0.00%) fn check_local(&mut self, cx: &LateContext<'tcx>, local: &'tcx LetStmt<'tcx>) { 111 ( 0.00%) if let Some(init_expr) = local.init 255 ( 0.00%) && let PatKind::Binding(BindingMode::MUT, id, _, None) = local.pat.kind 12 ( 0.00%) && !local.span.in_external_macro(cx.sess().source_map()) 24 ( 0.00%) && let Some(init) = get_vec_init_kind(cx, init_expr) 191 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:clippy_utils::higher::get_vec_init_kind (4x) . && !matches!( . init, . VecInitKind::WithExprCapacity(_) | VecInitKind::WithConstCapacity(_) . ) . { . self.searcher = Some(VecReserveSearcher { . local_id: id, . err_span: local.span, -- line 85 ---------------------------------------- -- line 90 ---------------------------------------- . .shrink_to_lo() . .to(init_expr.span.source_callsite().shrink_to_lo()), . "..", . ) . .into_owned(), . space_hint: String::new(), . }); . } 259 ( 0.00%) } . 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 206,226 ( 0.01%) if self.searcher.is_none() 28 ( 0.00%) && let ExprKind::Assign(left, right, _) = expr.kind 81 ( 0.00%) && let ExprKind::Path(QPath::Resolved(None, path)) = left.kind 15 ( 0.00%) && let Res::Local(id) = path.res 15 ( 0.00%) && !expr.span.in_external_macro(cx.sess().source_map()) 30 ( 0.00%) && let Some(init) = get_vec_init_kind(cx, right) 95 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:clippy_utils::higher::get_vec_init_kind (5x) . && !matches!( . init, . VecInitKind::WithExprCapacity(_) | VecInitKind::WithConstCapacity(_) . ) . { . self.searcher = Some(VecReserveSearcher { . local_id: id, . err_span: expr.span, -- line 114 ---------------------------------------- -- line 116 ---------------------------------------- . cx, . left.span.shrink_to_lo().to(right.span.source_callsite().shrink_to_lo()), . "..", . ) . .into_owned(), // see `assign_expression` test . space_hint: String::new(), . }); . } 549,936 ( 0.03%) } . 1,120 ( 0.00%) fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx Stmt<'_>) { 320 ( 0.00%) if let Some(searcher) = self.searcher.take() { . if let StmtKind::Expr(expr) | StmtKind::Semi(expr) = stmt.kind . && let ExprKind::MethodCall(name, self_arg, [space_hint], _) = expr.kind . && self_arg.res_local_id() == Some(searcher.local_id) . && name.ident.name == sym::reserve . && !is_from_proc_macro(cx, expr) . { . self.searcher = Some(VecReserveSearcher { . err_span: searcher.err_span.to(stmt.span), . space_hint: snippet(cx, space_hint.span, "..").into_owned(), . ..searcher . }); . } else { . searcher.display_err(cx); . } . } 1,280 ( 0.00%) } . 688 ( 0.00%) fn check_block_post(&mut self, cx: &LateContext<'tcx>, _: &'tcx Block<'tcx>) { 344 ( 0.00%) if let Some(searcher) = self.searcher.take() { . searcher.display_err(cx); . } 688 ( 0.00%) } . } 63 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/regex.rs -------------------------------------------------------------------------------- Ir -- line 110 ---------------------------------------- . #[derive(Copy, Clone)] . enum RegexKind { . Unicode, . UnicodeSet, . Bytes, . BytesSet, . } . 7 ( 0.00%) #[derive(Default)] . pub struct Regex { . definitions: DefIdMap, . loop_stack: Vec<(OwnerId, Span)>, . } . . impl<'tcx> LateLintPass<'tcx> for Regex { 7 ( 0.00%) fn check_crate(&mut self, cx: &LateContext<'tcx>) { . let mut resolve = |path: &PathLookup, kind: RegexKind| { . for &id in path.get(cx) { . self.definitions.insert(id, kind); . } . }; . . resolve(&paths::REGEX_NEW, RegexKind::Unicode); . resolve(&paths::REGEX_BUILDER_NEW, RegexKind::Unicode); . resolve(&paths::REGEX_SET_NEW, RegexKind::UnicodeSet); . resolve(&paths::REGEX_BYTES_NEW, RegexKind::Bytes); . resolve(&paths::REGEX_BYTES_BUILDER_NEW, RegexKind::Bytes); . resolve(&paths::REGEX_BYTES_SET_NEW, RegexKind::BytesSet); 6 ( 0.00%) } . 549,936 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 550,102 ( 0.03%) if let ExprKind::Call(fun, [arg]) = expr.kind 166 ( 0.00%) && let Some(def_id) = fun.res(cx).opt_def_id() . && let Some(regex_kind) = self.definitions.get(&def_id) . { . if let Some(&(loop_item_id, loop_span)) = self.loop_stack.last() . && loop_item_id == fun.hir_id.owner . && (matches!(arg.kind, ExprKind::Lit(_)) || const_str(cx, arg).is_some()) . { . span_lint_and_help( . cx, -- line 150 ---------------------------------------- -- line 157 ---------------------------------------- . } . . match regex_kind { . RegexKind::Unicode => check_regex(cx, arg, true), . RegexKind::UnicodeSet => check_set(cx, arg, true), . RegexKind::Bytes => check_regex(cx, arg, false), . RegexKind::BytesSet => check_set(cx, arg, false), . } 137,494 ( 0.01%) } else if let ExprKind::Loop(block, _, _, span) = expr.kind { 10 ( 0.00%) self.loop_stack.push((block.hir_id.owner, span)); . } 549,936 ( 0.03%) } . . fn check_expr_post(&mut self, _: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 481,194 ( 0.02%) if matches!(expr.kind, ExprKind::Loop(..)) { . self.loop_stack.pop(); . } . } . } . . fn lint_syntax_error(cx: &LateContext<'_>, error: ®ex_syntax::Error, unescaped: &str, base: Span, offset: u8) { . let parts: Option<(_, _, &dyn Display)> = match &error { . regex_syntax::Error::Parse(e) => Some((e.span(), e.auxiliary_span(), e.kind())), -- line 179 ---------------------------------------- 167 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/neg_cmp_op_on_partial_ord.rs -------------------------------------------------------------------------------- Ir -- line 38 ---------------------------------------- . pub NEG_CMP_OP_ON_PARTIAL_ORD, . complexity, . "The use of negated comparison operators on partially ordered types may produce confusing code." . } . . declare_lint_pass!(NoNegCompOpForPartialOrd => [NEG_CMP_OP_ON_PARTIAL_ORD]); . . impl<'tcx> LateLintPass<'tcx> for NoNegCompOpForPartialOrd { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 137,484 ( 0.01%) if let ExprKind::Unary(UnOp::Not, inner) = expr.kind . && let ExprKind::Binary(ref op, left, _) = inner.kind . && let BinOpKind::Le | BinOpKind::Ge | BinOpKind::Lt | BinOpKind::Gt = op.node . && !expr.span.in_external_macro(cx.sess().source_map()) . { . let ty = cx.typeck_results().expr_ty(left); . . let implements_ord = { . if let Some(id) = cx.tcx.get_diagnostic_item(sym::Ord) { -- line 55 ---------------------------------------- -- line 74 ---------------------------------------- . expr.span, . "the use of negated comparison operators on partially ordered \ . types produces code that is hard to read and refactor, please \ . consider using the `partial_cmp` method instead, to make it \ . clear that the two values could be incomparable", . ); . } . } 549,936 ( 0.03%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/question_mark.rs -------------------------------------------------------------------------------- Ir -- line 130 ---------------------------------------- . fn init_expr_can_use_question_mark(cx: &LateContext<'_>, init_expr: &Expr<'_>) -> bool { . let init_ty = cx.typeck_results().expr_ty_adjusted(init_expr); . cx.tcx . .lang_items() . .try_trait() . .is_some_and(|did| implements_trait(cx, init_ty, did, &[])) . } . 74 ( 0.00%) if let StmtKind::Let(LetStmt { . pat, . init: Some(init_expr), . els: Some(els), . .. 148 ( 0.00%) }) = stmt.kind . && init_expr_can_use_question_mark(cx, init_expr) . && let Some(ret) = find_let_else_ret_expression(els) . && let Some(inner_pat) = pat_and_expr_can_be_question_mark(cx, pat, ret) . && !span_contains_comment(cx, els.span) . && !span_contains_cfg(cx, els.span) . { . let mut applicability = Applicability::MaybeIncorrect; . let init_expr_str = -- line 151 ---------------------------------------- -- line 198 ---------------------------------------- . "this `let...else` may be rewritten with the `?` operator", . "replace it with", . sugg, . applicability, . ); . } . } . 80 ( 0.00%) fn is_early_return(smbl: Symbol, cx: &LateContext<'_>, if_block: &IfBlockType<'_>) -> bool { 30 ( 0.00%) match *if_block { 4 ( 0.00%) IfBlockType::IfIs(caller, caller_ty, call_sym, if_then) => { . // If the block could be identified as `if x.is_none()/is_err()`, . // we then only need to check the if_then return to see if it is none/err. 8 ( 0.00%) caller_ty.is_diag_item(cx, smbl) 8 ( 0.00%) && expr_return_none_or_err(smbl, cx, if_then, caller, None) 52 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:clippy_lints::question_mark::expr_return_none_or_err (1x) . && match smbl { . sym::Option => call_sym == sym::is_none, . sym::Result => call_sym == sym::is_err, . _ => false, . } . }, 6 ( 0.00%) IfBlockType::IfLet(res, let_expr_ty, let_pat_sym, let_expr, if_then, if_else) => { 12 ( 0.00%) let_expr_ty.is_diag_item(cx, smbl) . && match smbl { 12 ( 0.00%) sym::Option => { . // We only need to check `if let Some(x) = option` not `if let None = option`, . // because the later one will be suggested as `if option.is_none()` thus causing conflict. 3 ( 0.00%) res.ctor_parent(cx).is_lang_item(cx, OptionSome) . && if_else.is_some_and(|inner| expr_return_none_or_err(smbl, cx, inner, let_expr, None)) . }, . sym::Result => { . (res.ctor_parent(cx).is_lang_item(cx, ResultOk) . && if_else.is_some_and(|inner| { . expr_return_none_or_err(smbl, cx, inner, let_expr, Some(let_pat_sym)) . })) . || res.ctor_parent(cx).is_lang_item(cx, ResultErr) . && expr_return_none_or_err(smbl, cx, if_then, let_expr, Some(let_pat_sym)) . && if_else.is_none() . }, . _ => false, . } . }, . } 80 ( 0.00%) } . 4 ( 0.00%) fn expr_return_none_or_err( . smbl: Symbol, . cx: &LateContext<'_>, . expr: &Expr<'_>, . cond_expr: &Expr<'_>, . err_sym: Option, . ) -> bool { 12 ( 0.00%) match peel_blocks_with_stmt(expr).kind { . ExprKind::Ret(Some(ret_expr)) => expr_return_none_or_err(smbl, cx, ret_expr, cond_expr, err_sym), . ExprKind::Path(ref qpath) => match smbl { . sym::Option => cx . .qpath_res(qpath, expr.hir_id) . .ctor_parent(cx) . .is_lang_item(cx, OptionNone), . sym::Result => expr.res_local_id().is_some() && expr.res_local_id() == cond_expr.res_local_id(), . _ => false, -- line 258 ---------------------------------------- -- line 266 ---------------------------------------- . && let Some(PathSegment { ident, .. }) = arg_path.segments.first() . { . return segment.ident.name == sym::Err && err_sym == ident.name; . } . false . }, . _ => false, . } 5 ( 0.00%) } . . /// Checks if the given expression on the given context matches the following structure: . /// . /// ```ignore . /// if option.is_none() { . /// return None; . /// } . /// ``` -- line 282 ---------------------------------------- -- line 285 ---------------------------------------- . /// if result.is_err() { . /// return result; . /// } . /// ``` . /// . /// If it matches, it will suggest to use the `?` operator instead . fn check_is_none_or_err_and_early_return<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'tcx>) { . if let Some(higher::If { cond, then, r#else }) = higher::If::hir(expr) 156 ( 0.00%) && !is_else_clause(cx.tcx, expr) 3,692 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_else_clause (26x) 56 ( 0.00%) && let ExprKind::MethodCall(segment, caller, [], _) = &cond.kind 4 ( 0.00%) && let caller_ty = cx.typeck_results().expr_ty(caller) 80 ( 0.00%) => ???:::expr_ty (2x) 20 ( 0.00%) && let if_block = IfBlockType::IfIs(caller, caller_ty, segment.ident.name, then) 20 ( 0.00%) && (is_early_return(sym::Option, cx, &if_block) || is_early_return(sym::Result, cx, &if_block)) 471 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:clippy_lints::question_mark::is_early_return (4x) . { . let mut applicability = Applicability::MachineApplicable; . let receiver_str = snippet_with_context(cx, caller.span, expr.span.ctxt(), "..", &mut applicability).0; . let by_ref = !cx.type_is_copy_modulo_regions(caller_ty) . && !matches!(caller.kind, ExprKind::Call(..) | ExprKind::MethodCall(..)); . let sugg = if let Some(else_inner) = r#else { . if eq_expr_value(cx, expr.span.ctxt(), caller, peel_blocks(else_inner)) { . format!("Some({receiver_str}?)") -- line 305 ---------------------------------------- -- line 324 ---------------------------------------- . . #[derive(Clone, Copy, Debug)] . enum TryMode { . Result, . Option, . } . . fn find_try_mode<'tcx>(cx: &LateContext<'tcx>, scrutinee: &Expr<'tcx>) -> Option { 30 ( 0.00%) let scrutinee_ty = cx.typeck_results().expr_ty_adjusted(scrutinee).peel_refs(); 702 ( 0.00%) => ???:::expr_ty_adjusted (10x) . let ty::Adt(scrutinee_adt_def, _) = scrutinee_ty.kind() else { . return None; . }; . 27 ( 0.00%) match cx.tcx.get_diagnostic_name(scrutinee_adt_def.did())? { 693 ( 0.00%) => ???:::get_diagnostic_name (9x) 63 ( 0.00%) sym::Result => Some(TryMode::Result), . sym::Option => Some(TryMode::Option), . _ => None, . } . } . . // Check that `pat` is `{ctor_lang_item}(val)`, returning `val`. 1 ( 0.00%) fn extract_ctor_call<'a, 'tcx>( . cx: &LateContext<'tcx>, . expected_ctor: LangItem, . pat: &'a Pat<'tcx>, . ) -> Option<&'a Pat<'tcx>> { 6 ( 0.00%) if let PatKind::TupleStruct(variant_path, [val_binding], _) = &pat.kind 2 ( 0.00%) && cx 6 ( 0.00%) .qpath_res(variant_path, pat.hir_id) 23 ( 0.00%) => ???:::qpath_res (1x) 1 ( 0.00%) .ctor_parent(cx) . .is_lang_item(cx, expected_ctor) . { . Some(val_binding) . } else { . None . } 1 ( 0.00%) } . . // Extracts the local ID of a plain `val` pattern. . fn extract_binding_pat(pat: &Pat<'_>) -> Option { 6 ( 0.00%) if let PatKind::Binding(_, binding, _, None) = pat.kind { . Some(binding) . } else { . None . } . } . . fn check_arm_is_some_or_ok<'tcx>( . cx: &LateContext<'tcx>, -- line 372 ---------------------------------------- -- line 374 ---------------------------------------- . arm: &Arm<'tcx>, . ) -> Option> { . let happy_ctor = match mode { . TryMode::Result => ResultOk, . TryMode::Option => OptionSome, . }; . . // Check for `Ok(val)` or `Some(val)` 1 ( 0.00%) if arm.guard.is_none() 9 ( 0.00%) && let Some(val_binding) = extract_ctor_call(cx, happy_ctor, arm.pat) 207 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:clippy_lints::question_mark::extract_ctor_call (1x) . // Extract out `val` . && let Some(binding) = extract_binding_pat(val_binding) . { . // Check body is just `=> val` 3 ( 0.00%) return Some(if peel_blocks(arm.body).res_local_id() == Some(binding) { . IfLetOrMatchThen::DirectReturn . } else { . IfLetOrMatchThen::ManualUnwrap(val_binding.span, arm.body) . }); . } . . None . } . . fn check_arm_is_none_or_err<'tcx>(cx: &LateContext<'tcx>, mode: TryMode, arm: &Arm<'tcx>) -> bool { 18 ( 0.00%) if arm.guard.is_some() { . return false; . } . 36 ( 0.00%) let arm_body = peel_blocks(arm.body); 36 ( 0.00%) match mode { . TryMode::Result => { . // Check that pat is Err(val) . if let Some(ok_pat) = extract_ctor_call(cx, ResultErr, arm.pat) . && let Some(ok_val) = extract_binding_pat(ok_pat) . // check `=> return Err(...)` . && let ExprKind::Ret(Some(wrapped_ret_expr)) = arm_body.kind . && let ExprKind::Call(ok_ctor, [ret_expr]) = wrapped_ret_expr.kind . && ok_ctor.res(cx).ctor_parent(cx).is_lang_item(cx, ResultErr) -- line 412 ---------------------------------------- -- line 415 ---------------------------------------- . { . true . } else { . false . } . }, . TryMode::Option => { . // Check the pat is `None` 72 ( 0.00%) if is_none_pattern(cx, arm.pat) 1,818 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_none_pattern (18x) . // Check `=> return None` 21 ( 0.00%) && let ExprKind::Ret(Some(ret_expr)) = arm_body.kind 5 ( 0.00%) && is_none_expr(cx, ret_expr) 175 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/res.rs:clippy_utils::is_none_expr (1x) 2 ( 0.00%) && !ret_expr.span.from_expansion() . { . true . } else { . false . } . }, . } 18 ( 0.00%) } . . /// Check if `expr` is `val` or `val.into()` . fn is_local_or_local_into(cx: &LateContext<'_>, expr: &Expr<'_>, val: HirId) -> bool { . let is_into_call = fn_def_id_with_node_args(cx, expr) . .and_then(|(fn_def_id, _)| cx.tcx.trait_of_assoc(fn_def_id)) . .is_some_and(|trait_def_id| cx.tcx.is_diagnostic_item(sym::Into, trait_def_id)); . match expr.kind { . ExprKind::MethodCall(_, recv, [], _) | ExprKind::Call(_, [recv]) => { . is_into_call && recv.res_local_id() == Some(val) . }, . _ => expr.res_local_id() == Some(val), . } . } . 90 ( 0.00%) fn check_arms_are_try<'tcx>( . cx: &LateContext<'tcx>, . mode: TryMode, . arm1: &Arm<'tcx>, . arm2: &Arm<'tcx>, . ) -> Option> { 36 ( 0.00%) (check_arm_is_none_or_err(cx, mode, arm2).then(|| check_arm_is_some_or_ok(cx, mode, arm1))) 1,117 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:clippy_lints::question_mark::check_arm_is_none_or_err (9x) 36 ( 0.00%) .or_else(|| check_arm_is_none_or_err(cx, mode, arm1).then(|| check_arm_is_some_or_ok(cx, mode, arm2))) 1,508 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:clippy_lints::question_mark::check_arm_is_none_or_err (9x) . .flatten() 54 ( 0.00%) } . . #[derive(Debug)] . enum IfLetOrMatchThen<'tcx> { . /// Return the binding from an if let or match arm as is. . DirectReturn, . /// Working on the binding from an if let or match arm as if it comes from a `?`. . ManualUnwrap(Span, &'tcx Expr<'tcx>), . } . 616 ( 0.00%) fn check_if_try_match<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'tcx>) { 360 ( 0.00%) if let ExprKind::Match(scrutinee, [arm1, arm2], MatchSource::Normal | MatchSource::Postfix) = expr.kind 22 ( 0.00%) && !expr.span.from_expansion() 20 ( 0.00%) && let Some(mode) = find_try_mode(cx, scrutinee) 54 ( 0.00%) && !span_contains_cfg(cx, expr.span) 10,470 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/attrs.rs:clippy_utils::attrs::span_contains_cfg (9x) 48 ( 0.00%) && let Some(if_let_or_match_then) = check_arms_are_try(cx, mode, arm1, arm2) 3,132 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:clippy_lints::question_mark::check_arms_are_try (9x) . { 9 ( 0.00%) span_lint_and_then( 362,912 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then:: (1x) . cx, . QUESTION_MARK, . expr.span, . "this `match` expression can be replaced with `?`", 5 ( 0.00%) |diag| { 1 ( 0.00%) let mut applicability = Applicability::MachineApplicable; . let scrutinee_snippet = 3 ( 0.00%) snippet_with_applicability(cx, scrutinee.span.source_callsite(), "..", &mut applicability); 26 ( 0.00%) => ???:::source_callsite (1x) 3 ( 0.00%) match if_let_or_match_then { . IfLetOrMatchThen::DirectReturn => { . diag.span_suggestion( 1 ( 0.00%) expr.span, . "try instead", 3 ( 0.00%) scrutinee_snippet.into_owned() + "?", . applicability, . ); . }, . IfLetOrMatchThen::ManualUnwrap(binding_span, arm_body) => { . let indent = indent_of(cx, expr.span).unwrap_or_default(); . let arm_body_snippet = snippet_with_applicability(cx, arm_body.span, "..", &mut applicability); . let mut sugg = reindent_multiline(&arm_body_snippet, true, Some(indent)); . let binding_snippet = snippet_with_applicability(cx, binding_span, "..", &mut applicability); -- line 498 ---------------------------------------- -- line 509 ---------------------------------------- . ); . } . diag.span_suggestion(expr.span, "try instead", sugg, applicability); . }, . } . }, . ); . } 616 ( 0.00%) } . . fn check_if_let_some_or_err_and_early_return<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'tcx>) { 77 ( 0.00%) if let Some(higher::IfLet { . let_pat, . let_expr, . if_then, . if_else, . .. 385 ( 0.00%) }) = higher::IfLet::hir(cx, expr) 937 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (77x) 12 ( 0.00%) && let PatKind::TupleStruct(ref path1, [field], ddpos) = let_pat.kind . && ddpos.as_opt_usize().is_none() 27 ( 0.00%) && let PatKind::Binding(BindingMode(by_ref, _), bind_id, ident, None) = field.kind 9 ( 0.00%) && let caller_ty = cx.typeck_results().expr_ty(let_expr) 120 ( 0.00%) => ???:::expr_ty (3x) 42 ( 0.00%) && let if_block = IfBlockType::IfLet( 24 ( 0.00%) cx.qpath_res(path1, let_pat.hir_id), 69 ( 0.00%) => ???:::qpath_res (3x) . caller_ty, . ident.name, . let_expr, . if_then, . if_else, . ) 15 ( 0.00%) && let is_option_early_return = is_early_return(sym::Option, cx, &if_block) 888 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:clippy_lints::question_mark::is_early_return (3x) 21 ( 0.00%) && (is_option_early_return || is_early_return(sym::Result, cx, &if_block)) 408 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:clippy_lints::question_mark::is_early_return (3x) . && if_else . .map(|e| eq_expr_value(cx, expr.span.ctxt(), let_expr, peel_blocks(e))) . .is_none_or(|e| !e) . { . if !is_copy(cx, caller_ty) . && let Some(hir_id) = let_expr.res_local_id() . && local_used_after_expr(cx, hir_id, expr) . { -- line 548 ---------------------------------------- -- line 602 ---------------------------------------- . . impl QuestionMark { . fn inside_try_block(&self) -> bool { . self.try_block_depth_stack.last() > Some(&0) . } . } . . fn is_try_block(cx: &LateContext<'_>, bl: &Block<'_>) -> bool { 688 ( 0.00%) if let Some(expr) = bl.expr 676 ( 0.00%) && let ExprKind::Call(callee, [_]) = expr.kind 420 ( 0.00%) && let ExprKind::Path(qpath) = callee.kind 120 ( 0.00%) && cx.tcx.qpath_is_lang_item(qpath, LangItem::TryTraitFromOutput) 1,794 ( 0.00%) => ???:::qpath_is_lang_item (30x) . { . true . } else { . false . } . } . . fn is_inferred_ret_closure(expr: &Expr<'_>) -> bool { 480,982 ( 0.02%) let ExprKind::Closure(closure) = expr.kind else { . return false; . }; . 72 ( 0.00%) match closure.fn_decl.output { . FnRetTy::Return(ret_ty) => ret_ty.is_suggestable_infer_ty(), . FnRetTy::DefaultReturn(_) => true, . } . } . . impl<'tcx> LateLintPass<'tcx> for QuestionMark { 1,120 ( 0.00%) fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx Stmt<'_>) { . // Cheap `let` check before the costlier lint level and const context queries. 320 ( 0.00%) if !matches!(stmt.kind, StmtKind::Let(..)) { . return; . } . 555 ( 0.00%) if !is_lint_allowed(cx, QUESTION_MARK_USED, stmt.hir_id) || !self.msrv.meets(cx, msrvs::QUESTION_MARK_OPERATOR) 23,601 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_lint_allowed (37x) 999 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (37x) . { . return; . } . 259 ( 0.00%) if !self.inside_try_block() && !is_in_const_context(cx) { 9,962 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_const_context (37x) . check_let_some_else_return_none(cx, stmt); . } . self.check_manual_let_else(cx, stmt); 1,280 ( 0.00%) } . 687,420 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 206,226 ( 0.01%) if is_inferred_ret_closure(expr) { 12 ( 0.00%) self.inferred_ret_closure_stack += 1; . return; . } . . // Cheap `if`/`match` check before the costlier lint level and const context queries. . if matches!(expr.kind, ExprKind::If(..) | ExprKind::Match(..)) 231 ( 0.00%) && !self.inside_try_block() 308 ( 0.00%) && !is_in_const_context(cx) 20,677 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_const_context (77x) 539 ( 0.00%) && is_lint_allowed(cx, QUESTION_MARK_USED, expr.hir_id) 58,205 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_lint_allowed (77x) 462 ( 0.00%) && self.msrv.meets(cx, msrvs::QUESTION_MARK_OPERATOR) 2,079 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (77x) . { . check_is_none_or_err_and_early_return(cx, expr); . check_if_let_some_or_err_and_early_return(cx, expr); . 154 ( 0.00%) if self.inferred_ret_closure_stack == 0 { 231 ( 0.00%) check_if_try_match(cx, expr); 380,050 ( 0.02%) => site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:clippy_lints::question_mark::check_if_try_match (77x) . } . } 549,948 ( 0.03%) } . . fn check_expr_post(&mut self, _: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 12 ( 0.00%) if is_inferred_ret_closure(expr) { 12 ( 0.00%) self.inferred_ret_closure_stack -= 1; . } . } . . fn check_block(&mut self, cx: &LateContext<'tcx>, block: &'tcx Block<'tcx>) { 262 ( 0.00%) if is_try_block(cx, block) { . *self . .try_block_depth_stack . .last_mut() . .expect("blocks are always part of bodies and must have a depth") += 1; . } . } . . fn check_body(&mut self, _: &LateContext<'tcx>, _: &Body<'tcx>) { -- line 687 ---------------------------------------- -- line 688 ---------------------------------------- . self.try_block_depth_stack.push(0); . } . . fn check_body_post(&mut self, _: &LateContext<'tcx>, _: &Body<'tcx>) { . self.try_block_depth_stack.pop(); . } . . fn check_block_post(&mut self, cx: &LateContext<'tcx>, block: &'tcx Block<'tcx>) { 262 ( 0.00%) if is_try_block(cx, block) { . *self . .try_block_depth_stack . .last_mut() . .expect("blocks are always part of bodies and must have a depth") -= 1; . } . } . } 667 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/non_copy_const.rs -------------------------------------------------------------------------------- Ir -- line 191 ---------------------------------------- . (Self::Maybe, _) | (_, Self::Maybe) => Some(Self::Maybe), . (Self::Yes, Self::Yes) => Some(Self::Yes), . }) . .unwrap_or(Self::No) . } . . /// Checks if this is definitely `Freeze`. . fn is_freeze(self) -> bool { 41 ( 0.00%) matches!(self, Self::Yes) . } . . /// Checks if this is definitely not `Freeze`. . fn is_not_freeze(self) -> bool { . matches!(self, Self::No) . } . } . -- line 207 ---------------------------------------- -- line 259 ---------------------------------------- . ignore_tys: DefIdSet, . // Cache checked types. We can recurse through a type multiple times so this . // can be hit quite frequently. . freeze_tys: FxHashMap, IsFreeze>, . } . . impl<'tcx> NonCopyConst<'tcx> { . pub fn new(tcx: TyCtxt<'tcx>, conf: &'static Conf) -> Self { 4 ( 0.00%) Self { . ignore_tys: conf . .ignore_interior_mutability . .iter() 16 ( 0.00%) .flat_map(|ignored_ty| lookup_path_str(tcx, PathNS::Type, ignored_ty)) 25,101 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/paths.rs:clippy_utils::paths::lookup_path_str (4x) . .collect(), . freeze_tys: FxHashMap::default(), . } . } . . /// Checks if a value of the given type is `Freeze`, or may be depending on the value. 900 ( 0.00%) fn is_ty_freeze(&mut self, tcx: TyCtxt<'tcx>, typing_env: TypingEnv<'tcx>, ty: Ty<'tcx>) -> IsFreeze { . // FIXME: this should probably be using the trait solver . let ty = tcx . .try_normalize_erasing_regions(typing_env, Unnormalized::new_wip(ty)) . .unwrap_or(ty); . match self.freeze_tys.entry(ty) { 132 ( 0.00%) Entry::Occupied(e) => *e.get(), . Entry::Vacant(e) => { . let e = e.insert(IsFreeze::Yes); 54 ( 0.00%) if ty.is_freeze(tcx, typing_env) { 400 ( 0.00%) => ???:::is_freeze (9x) . return IsFreeze::Yes; . } . let is_freeze = match *ty.kind() { . ty::Adt(adt, _) if adt.is_unsafe_cell() => { . *e = IsFreeze::No; . return IsFreeze::No; . }, . ty::Adt(adt, _) if self.ignore_tys.contains(&adt.did()) => return IsFreeze::Yes, -- line 295 ---------------------------------------- -- line 331 ---------------------------------------- . }, . }; . if !is_freeze.is_freeze() { . self.freeze_tys.insert(ty, is_freeze); . } . is_freeze . }, . } 600 ( 0.00%) } . . /// Checks if the given constant value is `Freeze`. Returns `Err` if the constant . /// cannot be read, but the result depends on the value. . fn is_value_freeze( . &mut self, . tcx: TyCtxt<'tcx>, . typing_env: TypingEnv<'tcx>, . ty: Ty<'tcx>, -- line 347 ---------------------------------------- -- line 709 ---------------------------------------- . _ => return None, . }; . src_expr = use_expr; . } . } . } . . impl<'tcx> LateLintPass<'tcx> for NonCopyConst<'tcx> { 1,491 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) { 426 ( 0.00%) if let ItemKind::Const(ident, .., ct_rhs) = item.kind 34 ( 0.00%) && !ident.is_special() 204 ( 0.00%) && let ty = cx.tcx.type_of(item.owner_id).instantiate_identity().skip_norm_wip() 340 ( 0.00%) && match self.is_ty_freeze(cx.tcx, cx.typing_env(), ty) { 9,092 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/non_copy_const.rs:::is_ty_freeze (34x) 714 ( 0.00%) => ???:::typing_env (34x) . IsFreeze::No => true, . IsFreeze::Yes => false, . IsFreeze::Maybe => match cx.tcx.const_eval_poly(item.owner_id.to_def_id()) { . Ok(val) if let Ok(is_freeze) = self.is_value_freeze(cx.tcx, cx.typing_env(), ty, val) => !is_freeze, . // FIXME: we just assume mgca rhs's are freeze . _ => const_item_rhs_to_expr(cx.tcx, ct_rhs).is_some_and(|e| !self.is_init_expr_freeze( . cx.tcx, . cx.typing_env(), -- line 729 ---------------------------------------- -- line 749 ---------------------------------------- . if implements_trait(cx, ty, sync_trait, &[]) { . diag.help("did you mean to make this a `static` item"); . } else { . diag.help("did you mean to make this a `thread_local!` item"); . } . }, . ); . } 1,704 ( 0.00%) } . 48 ( 0.00%) fn check_trait_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx TraitItem<'_>) { 12 ( 0.00%) if let TraitItemKind::Const(_, ct_rhs_opt) = item.kind . && let ty = cx.tcx.type_of(item.owner_id).instantiate_identity().skip_norm_wip() . && match self.is_ty_freeze(cx.tcx, cx.typing_env(), ty) { . IsFreeze::No => true, . IsFreeze::Maybe if let Some(ct_rhs) = ct_rhs_opt => { . match cx.tcx.const_eval_poly(item.owner_id.to_def_id()) { . Ok(val) if let Ok(is_freeze) = self.is_value_freeze(cx.tcx, cx.typing_env(), ty, val) => { . !is_freeze . }, -- line 768 ---------------------------------------- -- line 784 ---------------------------------------- . { . span_lint( . cx, . DECLARE_INTERIOR_MUTABLE_CONST, . item.ident.span, . "named constant with interior mutability", . ); . } 48 ( 0.00%) } . 343 ( 0.00%) fn check_impl_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx ImplItem<'_>) { 98 ( 0.00%) if let ImplItemKind::Const(_, ct_rhs) = item.kind . && let ty = cx.tcx.type_of(item.owner_id).instantiate_identity().skip_norm_wip() . && match self.is_ty_freeze(cx.tcx, cx.typing_env(), ty) { . IsFreeze::Yes => false, . IsFreeze::No => { . // If this is a trait impl, check if the trait definition is the source . // of the cell. . if let Node::Item(parent_item) = cx.tcx.parent_hir_node(item.hir_id()) . && let ItemKind::Impl(impl_block) = parent_item.kind -- line 803 ---------------------------------------- -- line 843 ---------------------------------------- . { . span_lint( . cx, . DECLARE_INTERIOR_MUTABLE_CONST, . item.ident.span, . "named constant with interior mutability", . ); . } 392 ( 0.00%) } . 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 139,544 ( 0.01%) if let ExprKind::Path(qpath) = &e.kind . && let typeck = cx.typeck_results() 39,548 ( 0.00%) && let Res::Def(DefKind::Const { .. } | DefKind::AssocConst { .. }, did) = typeck.qpath_res(qpath, e.hir_id) 32,200 ( 0.00%) => ???:::qpath_res (2,060x) . // As of `1.80` constant contexts can't borrow any type with interior mutability 216 ( 0.00%) && !is_in_const_context(cx) 13,556 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_const_context (54x) 615 ( 0.00%) && !self.is_ty_freeze(cx.tcx, cx.typing_env(), typeck.expr_ty(e)).is_freeze() 3,297 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/non_copy_const.rs:::is_ty_freeze (41x) 1,640 ( 0.00%) => ???:::expr_ty (41x) 1,230 ( 0.00%) => ???:::typing_env (41x) . && let Some(borrow_src) = { . // The extra block helps formatting a lot. . if let Ok(val) = cx.tcx.const_eval_resolve( . cx.typing_env(), . UnevaluatedConst::new(did, typeck.node_args(e.hir_id)), . DUMMY_SP, . ) && let Ok(src) = self.is_non_freeze_val_borrowed(cx.tcx, cx.typing_env(), typeck, e, val) . { -- line 867 ---------------------------------------- -- line 884 ---------------------------------------- . |diag| { . if let Some(note) = borrow_src.cause.note() { . diag.note(note); . } . diag.help("this lint can be silenced by assigning the value to a local variable before borrowing"); . }, . ); . } 549,936 ( 0.03%) } . } . . struct ReplaceAssocFolder<'tcx> { . tcx: TyCtxt<'tcx>, . trait_id: DefId, . self_ty: Ty<'tcx>, . } . impl<'tcx> TypeFolder> for ReplaceAssocFolder<'tcx> { -- line 900 ---------------------------------------- 2,232 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/unit_types/unit_arg.rs -------------------------------------------------------------------------------- Ir -- line 7 ---------------------------------------- . use clippy_utils::{is_empty_block, is_expr_default, is_from_proc_macro}; . use rustc_errors::Applicability; . use rustc_hir::{Block, Expr, ExprKind, MatchSource, Node, StmtKind}; . use rustc_lint::LateContext; . use rustc_span::SyntaxContext; . . use super::{UNIT_ARG, utils}; . 618,678 ( 0.03%) pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 137,484 ( 0.01%) if expr.span.from_expansion() { . return; . } . . // apparently stuff in the desugaring of `?` can trigger this . // so check for that here . // only the calls to `Try::from_error` is marked as desugared, . // so we need to check both the current Expr and its parent. 137,482 ( 0.01%) if is_questionmark_desugar_marked_call(expr) { . return; . } 614,635 ( 0.03%) if let Node::Expr(parent_expr) = cx.tcx.parent_hir_node(expr.hir_id) 6,028,352 ( 0.28%) => ???:::parent_hir_node (68,504x) 1,155 ( 0.00%) && is_questionmark_desugar_marked_call(parent_expr) . { . return; . } . 273,688 ( 0.01%) let (receiver, args) = match expr.kind { . ExprKind::Call(_, args) => (None, args), 428 ( 0.00%) ExprKind::MethodCall(_, receiver, args, _) => (Some(receiver), args), . _ => return, . }; . . let args_to_recover = receiver . .into_iter() . .chain(args) . .filter(|arg| { 711 ( 0.00%) if cx.typeck_results().expr_ty(arg).is_unit() && !utils::is_unit_literal(arg) { 14,120 ( 0.00%) => ???:::expr_ty (353x) . !matches!( . &arg.kind, . ExprKind::Match(.., MatchSource::TryDesugar(_)) | ExprKind::Path(..) . ) . } else { . false . } . }) . .collect::>(); 265 ( 0.00%) if !args_to_recover.is_empty() && !is_from_proc_macro(cx, expr) { . lint_unit_args(cx, expr, args_to_recover.as_slice()); . } 549,936 ( 0.03%) } . . fn is_questionmark_desugar_marked_call(expr: &Expr<'_>) -> bool { . use rustc_span::hygiene::DesugaringKind; 201,710 ( 0.01%) if let ExprKind::Call(callee, _) = expr.kind { 1,629 ( 0.00%) callee.span.is_desugaring(DesugaringKind::QuestionMark) 52,255 ( 0.00%) => ???:::is_desugaring (543x) . } else { . false . } . } . . fn lint_unit_args<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>, args_to_recover: &[&'tcx Expr<'tcx>]) { . let mut applicability = Applicability::MachineApplicable; . let (singular, plural) = if args_to_recover.len() > 1 { -- line 69 ---------------------------------------- 1,004 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/bool_comparison.rs -------------------------------------------------------------------------------- Ir -- line 31 ---------------------------------------- . pub BOOL_COMPARISON, . complexity, . "comparing a variable to a boolean, e.g., `if x == true` or `if x != true`" . } . . declare_lint_pass!(BoolComparison => [BOOL_COMPARISON]); . . impl<'tcx> LateLintPass<'tcx> for BoolComparison { 618,678 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 206,226 ( 0.01%) if e.span.from_expansion() { . return; . } . 225 ( 0.00%) if let ExprKind::Binary(Spanned { node, .. }, left_side, right_side) = e.kind 450 ( 0.00%) && is_expn_of(left_side.span, sym::cfg).is_none() 2,775 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_expn_of (75x) 450 ( 0.00%) && is_expn_of(right_side.span, sym::cfg).is_none() 2,775 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_expn_of (75x) 375 ( 0.00%) && cx.typeck_results().expr_ty(left_side).is_bool() 3,000 ( 0.00%) => ???:::expr_ty (75x) 15 ( 0.00%) && cx.typeck_results().expr_ty(right_side).is_bool() 120 ( 0.00%) => ???:::expr_ty (3x) . { 3 ( 0.00%) let ignore_case = None::<(fn(_) -> _, &str)>; 3 ( 0.00%) let ignore_no_literal = None::<(fn(_, _) -> _, &str)>; 9 ( 0.00%) match node { . BinOpKind::Eq => { . let true_case = Some((|h| h, "equality checks against true are unnecessary")); . let false_case = Some(( . |h: Sugg<'tcx>| !h, . "equality checks against false can be replaced by a negation", . )); . check_comparison(cx, e, true_case, false_case, true_case, false_case, ignore_no_literal); . }, -- line 60 ---------------------------------------- -- line 94 ---------------------------------------- . Some(( . |l: Sugg<'tcx>, r: Sugg<'tcx>| l.bit_and(&(!r)), . "order comparisons between booleans can be simplified", . )), . ), . _ => (), . } . } 549,936 ( 0.03%) } . } . . fn check_comparison<'a, 'tcx>( . cx: &LateContext<'tcx>, . e: &'tcx Expr<'_>, . left_true: Option<(impl FnOnce(Sugg<'a>) -> Sugg<'a>, &'static str)>, . left_false: Option<(impl FnOnce(Sugg<'a>) -> Sugg<'a>, &'static str)>, . right_true: Option<(impl FnOnce(Sugg<'a>) -> Sugg<'a>, &'static str)>, -- line 110 ---------------------------------------- 137,008 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/misc_early/mixed_case_hex_literals.rs -------------------------------------------------------------------------------- Ir . use clippy_utils::diagnostics::span_lint_and_help; . use rustc_lint::EarlyContext; . use rustc_span::Span; . . use super::MIXED_CASE_HEX_LITERALS; . 540,960 ( 0.03%) pub(super) fn check(cx: &EarlyContext<'_>, lit_span: Span, suffix: &str, lit_snip: &str) { . let num_end_idx = match lit_snip.strip_suffix(suffix) { 38,640 ( 0.00%) Some(p) if p.ends_with('_') => lit_snip.len() - (suffix.len() + 1), . Some(_) => lit_snip.len() - suffix.len(), . None => lit_snip.len(), . }; . 77,280 ( 0.00%) if num_end_idx <= 2 { . // It's meaningless or causes range error. . return; . } . . let mut seen = (false, false); . for ch in &lit_snip.as_bytes()[2..num_end_idx] { . match ch { 541,004 ( 0.03%) b'a'..=b'f' => seen.0 = true, 405,747 ( 0.02%) b'A'..=b'F' => seen.1 = true, . _ => {}, . } 485,432 ( 0.02%) if seen.0 && seen.1 { . let raw_digits = &lit_snip[2..num_end_idx]; . let (sugg_lower, sugg_upper) = if suffix.is_empty() { . ( . format!("0x{}", raw_digits.to_lowercase()), . format!("0x{}", raw_digits.to_uppercase()), . ) . } else { . ( -- line 34 ---------------------------------------- -- line 43 ---------------------------------------- . lit_span, . "inconsistent casing in hexadecimal literal", . None, . format!("consider using `{sugg_lower}` or `{sugg_upper}`"), . ); . return; . } . } 309,120 ( 0.01%) } 83,359 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/asm_syntax.rs -------------------------------------------------------------------------------- Ir -- line 136 ---------------------------------------- . if let ItemKind::GlobalAsm(inline_asm) = &item.kind { . check_asm_syntax(INLINE_ASM_X86_INTEL_SYNTAX, cx, inline_asm, item.span, AsmStyle::Intel); . } . } . } . . impl EarlyLintPass for InlineAsmX86AttSyntax { . fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 143,838 ( 0.01%) if let ExprKind::InlineAsm(inline_asm) = &expr.kind { . check_asm_syntax(INLINE_ASM_X86_ATT_SYNTAX, cx, inline_asm, expr.span, AsmStyle::Att); . } . } . . fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) { 369 ( 0.00%) if let ItemKind::GlobalAsm(inline_asm) = &item.kind { . check_asm_syntax(INLINE_ASM_X86_ATT_SYNTAX, cx, inline_asm, item.span, AsmStyle::Att); . } . } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/dereference.rs -------------------------------------------------------------------------------- Ir -- line 146 ---------------------------------------- . . impl_lint_pass!(Dereferencing<'_> => [ . EXPLICIT_AUTO_DEREF, . EXPLICIT_DEREF_METHODS, . NEEDLESS_BORROW, . REF_BINDING_TO_REFERENCE, . ]); . 11 ( 0.00%) #[derive(Default)] . pub struct Dereferencing<'tcx> { . state: Option<(State, StateData<'tcx>)>, . . // While parsing a `deref` method call in ufcs form, the path to the function is itself an . // expression. This is to store the id of that expression so it can be skipped when . // `check_expr` is called for it. . skip_expr: Option, . -- line 162 ---------------------------------------- -- line 235 ---------------------------------------- . /// All the replacements which need to be made. . replacements: Vec<(Span, String)>, . /// The [`HirId`] that the lint should be emitted at. . hir_id: HirId, . } . . impl<'tcx> LateLintPass<'tcx> for Dereferencing<'tcx> { . #[expect(clippy::too_many_lines)] 549,936 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . // Skip path expressions from deref calls. e.g. `Deref::deref(e)` 137,484 ( 0.01%) if Some(expr.hir_id) == self.skip_expr.take() { . return; . } . . if let Some(local) = expr.res_local_id() { . self.check_local_usage(cx, expr, local); . } . . // Stop processing sub expressions when a macro call is seen 137,484 ( 0.01%) if expr.span.from_expansion() { 476 ( 0.00%) if let Some((state, data)) = self.state.take() { . self.report(cx, expr, state, data, cx.typeck_results()); . } . return; . } . . let typeck = cx.typeck_results(); . let Some((kind, sub_expr, skip_expr)) = try_parse_ref_op(cx.tcx, typeck, expr) else { . // The whole chain of reference operations has been seen 136,966 ( 0.01%) if let Some((state, data)) = self.state.take() { . self.report(cx, expr, state, data, typeck); . } . return; . }; 21 ( 0.00%) self.skip_expr = skip_expr; . 42 ( 0.00%) if is_from_proc_macro(cx, expr) { . if let Some((state, data)) = self.state.take() { . self.report(cx, expr, state, data, cx.typeck_results()); . } . return; . } . 42 ( 0.00%) match (self.state.take(), kind) { . (None, kind) => { 84 ( 0.00%) let expr_ty = typeck.expr_ty(expr); 840 ( 0.00%) => ???:::expr_ty (21x) 105 ( 0.00%) let use_site = get_expr_use_site(cx.tcx, typeck, SyntaxContext::root(), expr); 5,482 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_expr_use_site (21x) 135 ( 0.00%) let adjusted_ty = use_site.adjustments.last().map_or(expr_ty, |a| a.target); . 231 ( 0.00%) match kind { . RefOp::Deref if use_site.same_ctxt => { . let use_node = use_site.use_node(cx); . let sub_ty = typeck.expr_ty(sub_expr); . if let ExprUseNode::FieldAccess(name) = use_node . && !use_site.moved_before_use . && !ty_contains_field(sub_ty, name.name) . { . self.state = Some(( -- line 292 ---------------------------------------- -- line 328 ---------------------------------------- . mutbl, . }, . StateData { . first_expr: expr, . adjusted_ty, . }, . )); . }, 42 ( 0.00%) RefOp::AddrOf(mutability) if use_site.same_ctxt => { . // Find the number of times the borrow is auto-derefed. . let mut iter = use_site.adjustments.iter(); . let mut deref_count = 0usize; . let next_adjust = loop { . match iter.next() { . Some(adjust) => { 153 ( 0.00%) if !matches!(adjust.kind, Adjust::Deref(_)) { . break Some(adjust); 34 ( 0.00%) } else if !adjust.target.is_ref() { . deref_count += 1; . break iter.next(); . } . deref_count += 1; . }, . None => break None, . } . }; . 126 ( 0.00%) let use_node = use_site.use_node(cx); 474 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:::use_node (21x) 84 ( 0.00%) let stability = use_node.defined_ty(cx).map_or(TyCoercionStability::None, |ty| { 1,399 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:::defined_ty (21x) 34 ( 0.00%) TyCoercionStability::for_defined_ty(cx, ty, use_node.is_return()) 2,108 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/dereference.rs:::for_defined_ty (17x) . }); 273 ( 0.00%) let can_auto_borrow = match use_node { . ExprUseNode::FieldAccess(_) . if !use_site.moved_before_use && matches!(sub_expr.kind, ExprKind::Field(..)) => . { . // `DerefMut` will not be automatically applied to `ManuallyDrop<_>` . // field expressions when the base type is a union and the parent . // expression is also a field access. . // . // e.g. `&mut x.y.z` where `x` is a union, and accessing `z` requires a -- line 367 ---------------------------------------- -- line 467 ---------------------------------------- . // // Removing the borrow will cause `x` to be moved . // Some(x) => &mut *x, . // None => y . // }; . // } . // ``` . let (required_refs, msg) = if can_auto_borrow { . (1, if deref_count == 1 { borrow_msg } else { deref_msg }) 106 ( 0.00%) } else if let Some(&Adjustment { . kind: Adjust::Borrow(AutoBorrow::Ref(mutability)), . .. 21 ( 0.00%) }) = next_adjust 136 ( 0.00%) && matches!(mutability, AutoBorrowMutability::Mut { .. }) . && !stability.is_reborrow_stable() . { . (3, deref_msg) . } else { . (2, deref_msg) . }; . 42 ( 0.00%) if deref_count >= required_refs { . self.state = Some(( . State::DerefedBorrow(DerefedBorrow { . // One of the required refs is for the current borrow expression, the remaining ones . // can't be removed without breaking the code. See earlier comment. . count: deref_count - required_refs, . msg, . stability, . for_field_access: if let ExprUseNode::FieldAccess(name) = use_node -- line 495 ---------------------------------------- -- line 500 ---------------------------------------- . None . }, . }), . StateData { . first_expr: expr, . adjusted_ty, . }, . )); 21 ( 0.00%) } else if stability.is_deref_stable() . // Auto-deref doesn't combine with other adjustments 136 ( 0.00%) && next_adjust.is_none_or(|a| matches!(a.kind, Adjust::Deref(_) | Adjust::Borrow(_))) . && iter.all(|a| matches!(a.kind, Adjust::Deref(_) | Adjust::Borrow(_))) . { . self.state = Some(( . State::Borrow { mutability }, . StateData { . first_expr: expr, . adjusted_ty, . }, -- line 518 ---------------------------------------- -- line 642 ---------------------------------------- . derefs_manually_drop: derefs_manually_drop || is_manually_drop(sub_expr_ty), . }, . data, . )); . }, . . (Some((state, data)), _) => self.report(cx, expr, state, data, typeck), . } 549,936 ( 0.03%) } . 17,759 ( 0.00%) fn check_pat(&mut self, cx: &LateContext<'tcx>, pat: &'tcx Pat<'_>) { 5,695 ( 0.00%) if let PatKind::Binding(BindingMode::REF, id, name, _) = pat.kind { . if let Some(opt_prev_pat) = self.ref_locals.get_mut(&id) { . // This binding id has been seen before. Add this pattern to the list of changes. . if let Some(prev_pat) = opt_prev_pat { . if pat.span.from_expansion() { . // Doesn't match the context of the previous pattern. Can't lint here. . *opt_prev_pat = None; . } else { . prev_pat.spans.push(pat.span); -- line 661 ---------------------------------------- -- line 685 ---------------------------------------- . spans: vec![pat.span], . app, . replacements: vec![(pat.span, snip.into())], . hir_id: pat.hir_id, . }), . ); . } . } 20,296 ( 0.00%) } . 987 ( 0.00%) fn check_body_post(&mut self, cx: &LateContext<'tcx>, body: &Body<'_>) { . if Some(body.id()) == self.current_body { . for pat in self.ref_locals.drain(..).filter_map(|(_, x)| x) { . let replacements = pat.replacements; . let app = pat.app; . let lint = if pat.always_deref { . NEEDLESS_BORROW . } else { . REF_BINDING_TO_REFERENCE -- line 703 ---------------------------------------- -- line 710 ---------------------------------------- . "this pattern creates a reference to a reference", . |diag| { . diag.multipart_suggestion("try", replacements, app); . }, . ); . } . self.current_body = None; . } 1,128 ( 0.00%) } . . fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) { . // Only check for `impl Deref(Mut)`s if we're not already in one 474 ( 0.00%) if !self.in_deref_impl() && is_deref_or_derefmut_impl(cx, item) { . self.outermost_deref_impl = Some(item.owner_id); . } . } . . fn check_item_post(&mut self, _cx: &LateContext<'_>, item: &Item<'_>) { . // Only clear `self.outermost_deref_impl` if we're escaping the _outermost_ `impl Deref(Mut)` . if self.outermost_deref_impl == Some(item.owner_id) { . self.outermost_deref_impl = None; . } . } . } . . fn is_deref_or_derefmut_impl(cx: &LateContext<'_>, item: &Item<'_>) -> bool { 852 ( 0.00%) if let hir::ItemKind::Impl(impl_) = item.kind . && let Some(of_trait) = impl_.of_trait 72 ( 0.00%) && let Some(trait_id) = of_trait.trait_ref.trait_def_id() 312 ( 0.00%) => ???:::trait_def_id (24x) . { 96 ( 0.00%) cx.tcx.lang_items().deref_trait() == Some(trait_id) || cx.tcx.lang_items().deref_mut_trait() == Some(trait_id) 1,440 ( 0.00%) => ???:::lang_items (48x) . } else { . false . } . } . . fn try_parse_ref_op<'tcx>( . tcx: TyCtxt<'tcx>, . typeck: &'tcx TypeckResults<'_>, . expr: &'tcx Expr<'_>, . ) -> Option<(RefOp, &'tcx Expr<'tcx>, Option)> { 411,692 ( 0.02%) let (call_path_id, def_id, arg) = match expr.kind { 1,000 ( 0.00%) ExprKind::MethodCall(_, arg, [], _) => (None, typeck.type_dependent_def_id(expr.hir_id)?, arg), 3,978 ( 0.00%) => ???:::type_dependent_def_id (78x) . ExprKind::Call( . &Expr { 109 ( 0.00%) kind: ExprKind::Path(QPath::Resolved(None, path)), 96 ( 0.00%) hir_id, . .. . }, 412 ( 0.00%) [arg], . ) => (Some(hir_id), path.res.opt_def_id()?, arg), . ExprKind::Unary(UnOp::Deref, sub_expr) if !typeck.expr_ty(sub_expr).is_raw_ptr() => { . return Some((RefOp::Deref, sub_expr, None)); . }, . ExprKind::AddrOf(BorrowKind::Ref, mutability, sub_expr) => { 105 ( 0.00%) return Some((RefOp::AddrOf(mutability), sub_expr, None)); . }, . _ => return None, . }; 1,566 ( 0.00%) let mutbl = match tcx.get_diagnostic_name(def_id) { 11,170 ( 0.00%) => ???:::get_diagnostic_name (174x) . Some(sym::deref_method) => Mutability::Not, . Some(sym::deref_mut_method) => Mutability::Mut, . _ => return None, . }; . Some(( . RefOp::Method { . mutbl, . is_ufcs: call_path_id.is_some(), -- line 777 ---------------------------------------- -- line 821 ---------------------------------------- . #[derive(Clone, Copy, Debug)] . enum TyCoercionStability { . Deref, . Reborrow, . None, . } . impl TyCoercionStability { . fn is_deref_stable(self) -> bool { 42 ( 0.00%) matches!(self, Self::Deref) . } . . fn is_reborrow_stable(self) -> bool { . matches!(self, Self::Deref | Self::Reborrow) . } . 102 ( 0.00%) fn for_defined_ty<'tcx>(cx: &LateContext<'tcx>, ty: DefinedTy<'tcx>, for_return: bool) -> Self { 51 ( 0.00%) match ty { . DefinedTy::Hir(ty) => Self::for_hir_ty(ty), 51 ( 0.00%) DefinedTy::Mir { def_site_def_id, ty } => Self::for_mir_ty( . cx.tcx, . def_site_def_id, 51 ( 0.00%) cx.tcx.instantiate_bound_regions_with_erased(ty), 459 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/ty/fold.rs:::instantiate_bound_regions_with_erased:: (17x) . for_return, . ), . } 119 ( 0.00%) } . . // Checks the stability of type coercions when assigned to a binding with the given explicit type. . // . // e.g. . // let x = Box::new(Box::new(0u32)); . // let y1: &Box<_> = x.deref(); . // let y2: &Box<_> = &x; . // -- line 854 ---------------------------------------- -- line 907 ---------------------------------------- . Self::for_hir_ty(ty) . }, . TyKind::UnsafeBinder(..) => Self::None, . }; . } . } . . fn for_mir_ty<'tcx>(tcx: TyCtxt<'tcx>, def_site_def_id: Option, ty: Ty<'tcx>, for_return: bool) -> Self { 34 ( 0.00%) let ty::Ref(_, mut ty, _) = *ty.kind() else { . return Self::None; . }; . 34 ( 0.00%) if let Some(def_id) = def_site_def_id { 68 ( 0.00%) let typing_env = ty::TypingEnv::non_body_analysis(tcx, def_id); 850 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/ty/mod.rs:::non_body_analysis:: (17x) . ty = tcx . .try_normalize_erasing_regions(typing_env, Unnormalized::new_wip(ty)) . .unwrap_or(ty); . } . loop { 85 ( 0.00%) break match *ty.kind() { . ty::Ref(_, ref_ty, _) => { . ty = ref_ty; . continue; . }, . ty::Param(_) if for_return => Self::Deref, . ty::Alias( . _, . ty::AliasTy { -- line 934 ---------------------------------------- -- line 1030 ---------------------------------------- . } . . impl<'tcx> Dereferencing<'tcx> { . fn in_deref_impl(&self) -> bool { . self.outermost_deref_impl.is_some() . } . . fn check_local_usage(&mut self, cx: &LateContext<'tcx>, e: &Expr<'tcx>, local: HirId) { 1,528 ( 0.00%) if let Some(outer_pat) = self.ref_locals.get_mut(&local) 4,584 ( 0.00%) => /rust/deps/indexmap-2.14.0/src/map.rs:>::get_mut:: (382x) . && let Some(pat) = outer_pat . // Check for auto-deref . && !matches!( . cx.typeck_results().expr_adjustments(e), . [ . Adjustment { . kind: Adjust::Deref(_), . .. -- line 1046 ---------------------------------------- 138,355 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/unnecessary_owned_empty_strings.rs -------------------------------------------------------------------------------- Ir -- line 31 ---------------------------------------- . "detects cases of references to owned empty strings being passed as an argument to a function expecting `&str`" . } . . declare_lint_pass!(UnnecessaryOwnedEmptyStrings => [ . UNNECESSARY_OWNED_EMPTY_STRINGS, . ]); . . impl<'tcx> LateLintPass<'tcx> for UnnecessaryOwnedEmptyStrings { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 137,696 ( 0.01%) if let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner_expr) = expr.kind 72 ( 0.00%) && let ExprKind::Call(fun, args) = inner_expr.kind . && let ExprKind::Path(ref qpath) = fun.kind . && let Some(fun_def_id) = cx.qpath_res(qpath, fun.hir_id).opt_def_id() . && let ty::Ref(_, inner_str, _) = cx.typeck_results().expr_ty_adjusted(expr).kind() . && inner_str.is_str() . { . let fun_name = cx.tcx.get_diagnostic_name(fun_def_id); . if fun_name == Some(sym::string_new) { . span_lint_and_sugg( -- line 49 ---------------------------------------- -- line 69 ---------------------------------------- . expr.span, . "usage of `&String::from(\"\")` for a function expecting a `&str` argument", . "try", . "\"\"".to_owned(), . Applicability::MachineApplicable, . ); . } . } 549,936 ( 0.03%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/block_scrutinee.rs -------------------------------------------------------------------------------- Ir -- line 27 ---------------------------------------- . pub BLOCK_SCRUTINEE, . suspicious, . "warns when the scrutinee is wrapped in a block in older editions" . } . . declare_lint_pass!(BlockScrutinee => [BLOCK_SCRUTINEE]); . . impl<'tcx> LateLintPass<'tcx> for BlockScrutinee { 343,710 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 206,226 ( 0.01%) if cx.tcx.sess.edition() >= Edition::Edition2024 { . return; . } . 343,716 ( 0.02%) let (scrutinee, keyword_fallback) = match expr.kind { 144 ( 0.00%) ExprKind::Match(scrutinee, _, _) => (scrutinee, "`match`"), 6 ( 0.00%) ExprKind::Let(let_expr) => (let_expr.init, "`if let` / `while let`"), . _ => return, . }; . 160 ( 0.00%) if scrutinee.span.from_expansion() || expr.span.from_expansion() { . return; . } . 58 ( 0.00%) if let ExprKind::Block(block, _) = scrutinee.kind . && matches!(block.rules, BlockCheckMode::DefaultBlock) . && block.stmts.is_empty() . && let Some(inner_expr) = block.expr . { . let inner_snippet = snippet(cx, inner_expr.span, ".."); . . let main_msg = "this scrutinee is wrapped in a block"; . -- line 58 ---------------------------------------- -- line 102 ---------------------------------------- . vec![ . (outer_span.shrink_to_lo(), format!("let res = {inner_snippet};\n{pad}")), . (scrutinee.span, "res".to_string()), . ], . Applicability::MaybeIncorrect, . ); . }); . } 343,710 ( 0.02%) } . } 60 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/transmute/mod.rs -------------------------------------------------------------------------------- Ir -- line 518 ---------------------------------------- . Sugg::NonParen(format!("{}.{}", outer_sugg.maybe_paren(), first.name).into()), . ) . } else { . (outer_type, outer_sugg) . } . } . } . impl<'tcx> LateLintPass<'tcx> for Transmute { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 138,048 ( 0.01%) if let ExprKind::Call(path_expr, [arg]) = e.kind 1,108 ( 0.00%) && let ExprKind::Path(QPath::Resolved(None, path)) = path_expr.kind . && let Some(def_id) = path.res.opt_def_id() 945 ( 0.00%) && cx.tcx.is_diagnostic_item(sym::transmute, def_id) 10,724 ( 0.00%) => ???:::is_diagnostic_item (135x) . { . // Avoid suggesting non-const operations in const contexts: . // - from/to bits (https://github.com/rust-lang/rust/issues/73736) . // - dereferencing raw pointers (https://github.com/rust-lang/rust/issues/51911) . // - char conversions (https://github.com/rust-lang/rust/issues/89259) . let const_context = is_in_const_context(cx); . . let (from_ty, from_ty_adjusted) = match cx.typeck_results().expr_adjustments(arg) { -- line 538 ---------------------------------------- -- line 563 ---------------------------------------- . | (unsound_collection_transmute::check(cx, e, from_ty, to_ty) . || transmute_undefined_repr::check(cx, e, from_ty, to_ty)) . | (eager_transmute::check(cx, e, arg, from_ty, to_ty)); . . if !linted { . transmutes_expressible_as_ptr_casts::check(cx, e, from_ty, from_ty_adjusted, to_ty, arg, const_context); . } . } 549,936 ( 0.03%) } . } 270 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/byte_char_slices.rs -------------------------------------------------------------------------------- Ir -- line 32 ---------------------------------------- . pub BYTE_CHAR_SLICES, . style, . "hard to read byte char slice" . } . . declare_lint_pass!(ByteCharSlice => [BYTE_CHAR_SLICES]); . . impl<'tcx> LateLintPass<'tcx> for ByteCharSlice { 618,678 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 137,484 ( 0.01%) if !expr.span.from_expansion() . && let Some((has_ref, slice)) = is_byte_char_slices(cx, expr) . { . span_lint_and_then( . cx, . BYTE_CHAR_SLICES, . expr.span, . "can be more succinctly written as a byte str", . |diag| { -- line 49 ---------------------------------------- -- line 64 ---------------------------------------- . if !has_ref && !cx.typeck_results().expr_ty_adjusted(expr).is_array_slice() { . sugg = sugg.deref(); . } . . diag.span_suggestion(expr.span, "try", sugg, app); . }, . ); . } 549,936 ( 0.03%) } . } . . /// Checks whether the slice is that of byte chars, and if so, builds a byte-string out of it . fn is_byte_char_slices<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) -> Option<(bool, Vec)> { 205,617 ( 0.01%) let (has_ref, expr) = if let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner) = expr.kind { . (true, inner) 342,415 ( 0.02%) } else if let Some(parent) = get_parent_expr(cx, expr) // Already checked by the parent expr. 6,779,817 ( 0.32%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (68,483x) 133,303 ( 0.01%) && let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, _) = parent.kind . { . return None; . } else { . (false, expr) . }; . 137,029 ( 0.01%) if let ExprKind::Array(members) = expr.kind 34 ( 0.00%) && !members.is_empty() 17 ( 0.00%) && !span_contains_comment(cx, expr.span) 85 ( 0.00%) && !span_contains_cfg(cx, expr.span) 593,160 ( 0.03%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/attrs.rs:clippy_utils::attrs::span_contains_cfg (17x) . { . return members . .iter() . .try_fold(Vec::new(), |mut acc, member| { 34 ( 0.00%) if let ExprKind::Lit(lit) = member.kind 26 ( 0.00%) && let LitKind::Byte(_) = lit.node . && expr.span.eq_ctxt(member.span) . { . acc.push(lit.span); . return Some(acc); . } . None . }) . .map(|s| (has_ref, s)); -- line 104 ---------------------------------------- 273,920 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/traits.rs -------------------------------------------------------------------------------- Ir -- line 121 ---------------------------------------- . /// Check that a range is in bounds for slicing a string. . /// If this returns true, it is safe to call `slice.get_unchecked(range)` or . /// `slice.get_unchecked_mut(range)`. . #[inline(always)] . const fn check_range(slice: &str, range: crate::range::Range) -> bool { . let crate::range::Range { start, end } = range; . let bytes = slice.as_bytes(); . 433,093 ( 0.02%) if start > end || end > slice.len() { . return false; . } . 195,540 ( 0.01%) if start == slice.len() { . // If `start == slice.len()`, then `end == slice.len()` must also be true. . return true; . } . . // SAFETY: . // `start > end || end > slice.len()` is false, so `start <= end <= slice.len()` is true. . // `start == slice.len()` is false, so `start < slice.len()` is also true. . // . // No need to check for `end == 0`, because if `end == 0` is true then `start == slice.len()` . // would also be true, which is already handled above. . unsafe { 293,019 ( 0.01%) (start == 0 || bytes.as_ptr().add(start).read().is_utf8_char_boundary()) 195,336 ( 0.01%) && (end == slice.len() || bytes.as_ptr().add(end).read().is_utf8_char_boundary()) . } . } . . /// Implements substring slicing with syntax `&self[begin .. end]` or `&mut . /// self[begin .. end]`. . /// . /// Returns a slice of the given string from the byte range . /// [`begin`, `end`). -- line 154 ---------------------------------------- -- line 213 ---------------------------------------- . end: usize = self.end, . len: usize = slice.len() . ) => end >= start && end <= len, . ); . . // SAFETY: the caller guarantees that `self` is in bounds of `slice` . // which satisfies all the conditions for `add`. . unsafe { 256,358 ( 0.01%) let new_len = unchecked_sub(self.end, self.start); . slice.as_ptr().add(self.start).cast_slice(new_len) as *const str . } . } . #[inline] . #[track_caller] . unsafe fn get_unchecked_mut(self, slice: *mut str) -> *mut Self::Output { . let slice = slice as *mut [u8]; . -- line 229 ---------------------------------------- -- line 254 ---------------------------------------- . } . . #[stable(feature = "new_range_api", since = "1.96.0")] . #[rustc_const_unstable(feature = "const_index", issue = "143775")] . const unsafe impl SliceIndex for range::Range { . type Output = str; . #[inline] . fn get(self, slice: &str) -> Option<&Self::Output> { 145,711 ( 0.01%) if check_range(slice, self) { . // SAFETY: just checked that `self` is in bounds, . // and we are passing in a safe reference, so the return value will also be one. . // We also checked char boundaries, so this is valid UTF-8. . Some(unsafe { &*self.get_unchecked(slice) }) . } else { . None . } . } -- line 270 ---------------------------------------- -- line 297 ---------------------------------------- . end: usize = self.end, . len: usize = slice.len() . ) => end >= start && end <= len, . ); . . // SAFETY: the caller guarantees that `self` is in bounds of `slice` . // which satisfies all the conditions for `add`. . unsafe { 83 ( 0.00%) let new_len = unchecked_sub(self.end, self.start); . slice.as_ptr().add(self.start).cast_slice(new_len) as *const str . } . } . #[inline] . #[track_caller] . unsafe fn get_unchecked_mut(self, slice: *mut str) -> *mut Self::Output { . let slice = slice as *mut [u8]; . -- line 313 ---------------------------------------- -- line 416 ---------------------------------------- . /// Panics if `end` does not point to the starting byte offset of a . /// character (as defined by `is_char_boundary`), or if `end > len`. . #[stable(feature = "str_checked_slicing", since = "1.20.0")] . #[rustc_const_unstable(feature = "const_index", issue = "143775")] . const unsafe impl SliceIndex for ops::RangeTo { . type Output = str; . #[inline] . fn get(self, slice: &str) -> Option<&Self::Output> { 51 ( 0.00%) if slice.is_char_boundary(self.end) { . // SAFETY: just checked that `end` is on a char boundary, . // and we are passing in a safe reference, so the return value will also be one. . Some(unsafe { &*self.get_unchecked(slice) }) . } else { . None . } . } . #[inline] -- line 432 ---------------------------------------- 52,795 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/zombie_processes.rs -------------------------------------------------------------------------------- Ir -- line 53 ---------------------------------------- . pub ZOMBIE_PROCESSES, . suspicious, . "not waiting on a spawned child process" . } . . declare_lint_pass!(ZombieProcesses => [ZOMBIE_PROCESSES]); . . impl<'tcx> LateLintPass<'tcx> for ZombieProcesses { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 274,968 ( 0.01%) if let ExprKind::Call(..) | ExprKind::MethodCall(..) = expr.kind 618 ( 0.00%) && let child_ty = cx.typeck_results().expr_ty(expr) 12,384 ( 0.00%) => ???:::expr_ty (309x) 448 ( 0.00%) && child_ty.is_diag_item(cx, sym::Child) . { . match cx.tcx.parent_hir_node(expr.hir_id) { . Node::LetStmt(local) . if let PatKind::Binding(_, local_id, ..) = local.pat.kind . && let Some(enclosing_block) = get_enclosing_block(cx, expr.hir_id) => . { . let mut vis = WaitFinder { . cx, -- line 72 ---------------------------------------- -- line 110 ---------------------------------------- . .. . }) => { . // Immediately dropped. E.g. `std::process::Command::new("echo").spawn().unwrap();` . check(cx, expr, Cause::NeverWait, true); . }, . _ => {}, . } . } 549,936 ( 0.03%) } . } . . struct MaybeWait(Span); . . /// A visitor responsible for finding a `wait()` call on a local variable. . /// . /// Note that this visitor does NOT explicitly look for `wait()` calls directly, but rather does the . /// inverse -- checking if all uses of the local are either: -- line 126 ---------------------------------------- 309 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_option_as_slice.rs -------------------------------------------------------------------------------- Ir -- line 48 ---------------------------------------- . . impl ManualOptionAsSlice { . pub fn new(conf: &Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl LateLintPass<'_> for ManualOptionAsSlice { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 343,710 ( 0.02%) let span = expr.span; . if span.from_expansion() { . return; . } 479,116 ( 0.02%) match expr.kind { 71 ( 0.00%) ExprKind::Match(scrutinee, [arm1, arm2], _) 166 ( 0.00%) if is_none_pattern(cx, arm2.pat) && check_arms(cx, arm2, arm1) 828 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_none_pattern (13x) 171 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_option_as_slice.rs:clippy_lints::manual_option_as_slice::check_arms (4x) 92 ( 0.00%) || is_none_pattern(cx, arm1.pat) && check_arms(cx, arm1, arm2) => 1,022 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_none_pattern (13x) 207 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_option_as_slice.rs:clippy_lints::manual_option_as_slice::check_arms (5x) . { . check_as_ref(cx, scrutinee, span, self.msrv); . }, 9 ( 0.00%) ExprKind::If(cond, then, Some(other)) => { 18 ( 0.00%) if let ExprKind::Let(let_expr) = cond.kind . && let Some(binding) = extract_ident_from_some_pat(cx, let_expr.pat) . && check_some_body(cx, binding, then) . && is_empty_slice(cx, other.peel_blocks()) . { . check_as_ref(cx, let_expr.init, span, self.msrv); . } . }, 550 ( 0.00%) ExprKind::MethodCall(seg, callee, [], _) if seg.ident.name == sym::unwrap_or_default => { . check_map(cx, callee, span, self.msrv); . }, 128 ( 0.00%) ExprKind::MethodCall(seg, callee, [or], _) => match seg.ident.name { 128 ( 0.00%) sym::unwrap_or if is_empty_slice(cx, or) => { . check_map(cx, callee, span, self.msrv); . }, . sym::unwrap_or_else if returns_empty_slice(cx, or) => { . check_map(cx, callee, span, self.msrv); . }, . _ => {}, . }, . ExprKind::MethodCall(seg, callee, [or_else, map], _) => match seg.ident.name { -- line 89 ---------------------------------------- -- line 92 ---------------------------------------- . }, . sym::map_or_else if returns_empty_slice(cx, or_else) && is_slice_from_ref(cx, map) => { . check_as_ref(cx, callee, span, self.msrv); . }, . _ => {}, . }, . _ => {}, . } 549,936 ( 0.03%) } . } . . fn check_map(cx: &LateContext<'_>, map: &Expr<'_>, span: Span, msrv: Msrv) { . if let ExprKind::MethodCall(seg, callee, [mapping], _) = map.kind . && seg.ident.name == sym::map . && is_slice_from_ref(cx, mapping) . { . check_as_ref(cx, callee, span, msrv); -- line 108 ---------------------------------------- -- line 160 ---------------------------------------- . { . seg.ident.name == name . } else { . false . } . } . . fn check_arms(cx: &LateContext<'_>, none_arm: &Arm<'_>, some_arm: &Arm<'_>) -> bool { 18 ( 0.00%) if none_arm.guard.is_none() . && some_arm.guard.is_none() 27 ( 0.00%) && is_empty_slice(cx, none_arm.body) 243 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_option_as_slice.rs:clippy_lints::manual_option_as_slice::is_empty_slice (9x) . && let Some(name) = extract_ident_from_some_pat(cx, some_arm.pat) . { . check_some_body(cx, name, some_arm.body) . } else { . false . } 9 ( 0.00%) } . . fn returns_empty_slice(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { . match expr.kind { . ExprKind::Path(_) => expr.res(cx).is_diag_item(cx, sym::default_fn), . ExprKind::Closure(cl) => is_empty_slice(cx, cx.tcx.hir_body(cl.body).value), . _ => false, . } . } . . /// Returns if expr returns an empty slice. If: . /// - An indexing operation to an empty array with a built-in range. `[][..]` . /// - An indexing operation with a zero-ended range. `expr[..0]` . /// - A reference to an empty array. `&[]` . /// - Or a call to `Default::default`. 27 ( 0.00%) fn is_empty_slice(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { 9 ( 0.00%) let expr = peel_hir_expr_refs(expr.peel_blocks()).0; 45 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::peel_hir_expr_refs (9x) 63 ( 0.00%) match expr.kind { . ExprKind::Index(arr, range, _) => match arr.kind { . ExprKind::Array([]) => is_range_literal(range), . ExprKind::Array(_) => { . let Some(range) = clippy_utils::higher::Range::hir(cx, range) else { . return false; . }; . range.end.is_some_and(|e| clippy_utils::is_integer_literal(e, 0)) . }, . _ => false, . }, . ExprKind::Array([]) => true, . ExprKind::Call(def, []) => def.res(cx).is_diag_item(cx, sym::default_fn), . _ => false, . } 27 ( 0.00%) } . . fn is_slice_from_ref(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { . expr.basic_res().is_diag_item(cx, sym::slice_from_ref) . } 119 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/format_args.rs -------------------------------------------------------------------------------- Ir -- line 321 ---------------------------------------- . ty_msrv_map: FxHashMap, Option>, . has_derived_debug: FxHashMap, bool>, . has_pointer_format: FxHashMap, bool>, . } . . impl<'tcx> FormatArgs<'tcx> { . pub fn new(tcx: TyCtxt<'tcx>, conf: &'static Conf, format_args: FormatArgsStorage) -> Self { . let ty_msrv_map = make_ty_msrv_map(tcx); 13 ( 0.00%) Self { . format_args, . msrv: conf.msrv.into(), 1 ( 0.00%) ignore_mixed: conf.allow_mixed_uninlined_format_args, . ty_msrv_map, . has_derived_debug: FxHashMap::default(), . has_pointer_format: FxHashMap::default(), . } . } . } . . impl<'tcx> LateLintPass<'tcx> for FormatArgs<'tcx> { 687,420 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { . if let Some(macro_call) = root_macro_call_first_node(cx, expr) . && is_format_macro(cx, macro_call.def_id) . && let Some(format_args) = self.format_args.get(cx, expr, macro_call.expn) . { . let mut linter = FormatArgsExpr { . cx, . expr, . macro_call: ¯o_call, -- line 349 ---------------------------------------- -- line 357 ---------------------------------------- . . linter.check_trailing_comma(); . linter.check_templates(); . . if self.msrv.meets(cx, msrvs::FORMAT_ARGS_CAPTURE) { . linter.check_uninlined_args(); . } . } 549,936 ( 0.03%) } . } . . struct FormatArgsExpr<'a, 'tcx> { . cx: &'a LateContext<'tcx>, . expr: &'tcx Expr<'tcx>, . macro_call: &'a MacroCall, . format_args: &'a rustc_ast::FormatArgs, . ignore_mixed: bool, -- line 373 ---------------------------------------- -- line 866 ---------------------------------------- . } . } . } . . fn make_ty_msrv_map(tcx: TyCtxt<'_>) -> FxHashMap, Option> { . [(sym::OsStr, Some(msrvs::OS_STR_DISPLAY)), (sym::Path, None)] . .into_iter() . .filter_map(|(name, feature)| { 6 ( 0.00%) tcx.get_diagnostic_item(name).map(|def_id| { 216,786 ( 0.01%) => ???:::get_diagnostic_item (2x) . let ty = Ty::new_adt(tcx, tcx.adt_def(def_id), List::empty()); . (ty, feature) . }) . }) . .collect() . } . . fn count_needed_derefs<'tcx, I>(mut ty: Ty<'tcx>, mut iter: I) -> (usize, Ty<'tcx>) -- line 882 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/needless_borrows_for_generic_args.rs -------------------------------------------------------------------------------- Ir -- line 67 ---------------------------------------- . /// be moved. . possible_borrowers: Vec<(LocalDefId, PossibleBorrowerMap<'tcx, 'tcx>)>, . . // `IntoIterator` for arrays requires Rust 1.53. . msrv: Msrv, . } . impl NeedlessBorrowsForGenericArgs<'_> { . pub fn new(conf: &'static Conf) -> Self { 4 ( 0.00%) Self { . possible_borrowers: Vec::new(), . msrv: conf.msrv.into(), . } . } . } . . impl<'tcx> LateLintPass<'tcx> for NeedlessBorrowsForGenericArgs<'tcx> { 549,936 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 137,484 ( 0.01%) if matches!(expr.kind, ExprKind::AddrOf(..)) 88 ( 0.00%) && !expr.span.from_expansion() 231 ( 0.00%) && let use_site = get_expr_use_site(cx.tcx, cx.typeck_results(), SyntaxContext::root(), expr) 5,482 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_expr_use_site (21x) 84 ( 0.00%) && use_site.same_ctxt . && !use_site.is_ty_unified 168 ( 0.00%) && let use_node = use_site.use_node(cx) 474 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:::use_node (21x) 143 ( 0.00%) && let Some(DefinedTy::Mir { def_site_def_id: _, ty }) = use_node.defined_ty(cx) 1,399 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:::defined_ty (21x) 34 ( 0.00%) && let ty::Param(param_ty) = *ty.skip_binder().kind() . && let Some((hir_id, fn_id, i)) = match use_node { . ExprUseNode::MethodArg(_, _, 0) => None, . ExprUseNode::MethodArg(hir_id, None, i) => cx . .typeck_results() . .type_dependent_def_id(hir_id) . .map(|id| (hir_id, id, i)), . ExprUseNode::FnArg( . &Expr { -- line 99 ---------------------------------------- -- line 128 ---------------------------------------- . |diag| { . let mut app = Applicability::MachineApplicable; . let snip_span = peel_n_hir_expr_refs(expr, count).0.span; . let snip = snippet_with_context(cx, snip_span, expr.span.ctxt(), "..", &mut app).0; . diag.span_suggestion(expr.span, "change this to", snip.into_owned(), app); . }, . ); . } 549,936 ( 0.03%) } . 987 ( 0.00%) fn check_body_post(&mut self, cx: &LateContext<'tcx>, body: &Body<'_>) { . if self . .possible_borrowers . .last() . .is_some_and(|&(local_def_id, _)| local_def_id == cx.tcx.hir_body_owner_def_id(body.id())) . { . self.possible_borrowers.pop(); . } 1,128 ( 0.00%) } . } . . fn path_has_args(p: &QPath<'_>) -> bool { . match *p { . QPath::Resolved(_, Path { segments: [.., s], .. }) | QPath::TypeRelative(_, s) => s.args.is_some(), . QPath::Resolved(..) => false, . } . } -- line 154 ---------------------------------------- 63 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/mixed_read_write_in_expression.rs -------------------------------------------------------------------------------- Ir -- line 82 ---------------------------------------- . declare_lint_pass!(EvalOrderDependence => [ . DIVERGING_SUB_EXPRESSION, . MIXED_READ_WRITE_IN_EXPRESSION, . ]); . . impl<'tcx> LateLintPass<'tcx> for EvalOrderDependence { . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . // Find a write to a local variable. 274,998 ( 0.01%) let var = if let ExprKind::Assign(lhs, ..) | ExprKind::AssignOp(_, lhs, _) = expr.kind . && let Some(var) = lhs.res_local_id() 18 ( 0.00%) && expr.span.desugaring_kind().is_none() 576 ( 0.00%) => ???:::desugaring_kind (6x) . { . var . } else { . return; . }; 30 ( 0.00%) let mut visitor = ReadVisitor { . cx, . var, . write_expr: expr, . last_expr: expr, . }; . check_for_unsequenced_reads(&mut visitor); 68,742 ( 0.00%) } . fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx Stmt<'_>) { 716 ( 0.00%) match stmt.kind { 37 ( 0.00%) StmtKind::Let(local) => { 111 ( 0.00%) if let LetStmt { init: Some(e), .. } = local { 111 ( 0.00%) DivergenceVisitor { cx }.visit_expr(e); 21,024 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/mixed_read_write_in_expression.rs:::visit_expr (37x) . } . }, 610 ( 0.00%) StmtKind::Expr(e) | StmtKind::Semi(e) => DivergenceVisitor { cx }.maybe_walk_expr(e), 80,318 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/mixed_read_write_in_expression.rs:::maybe_walk_expr (122x) . StmtKind::Item(..) => {}, . } . } . } . . struct DivergenceVisitor<'a, 'tcx> { . cx: &'a LateContext<'tcx>, . } . . impl<'tcx> DivergenceVisitor<'_, 'tcx> { 3,275 ( 0.00%) fn maybe_walk_expr(&mut self, e: &'tcx Expr<'_>) { 5,084 ( 0.00%) match e.kind { . ExprKind::Closure(..) | ExprKind::If(..) | ExprKind::Loop(..) => {}, 66 ( 0.00%) ExprKind::Match(e, arms, _) => { 66 ( 0.00%) self.visit_expr(e); 25,564 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/mixed_read_write_in_expression.rs:::visit_expr (12x) 667 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/mixed_read_write_in_expression.rs:::visit_expr'2 (2x) . for arm in arms { 111 ( 0.00%) if let Some(if_expr) = arm.guard { . self.visit_expr(if_expr); . } . // make sure top level arm expressions aren't linted 111 ( 0.00%) self.maybe_walk_expr(arm.body); 3,988 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/mixed_read_write_in_expression.rs:::maybe_walk_expr'2 (29x) . } . }, 4,186 ( 0.00%) _ => walk_expr(self, e), 60,694 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_expr:: (124x) . } 342 ( 0.00%) } . . fn report_diverging_sub_expr(&self, e: &Expr<'_>) { . if let Some(macro_call) = root_macro_call_first_node(self.cx, e) . && self.cx.tcx.is_diagnostic_item(sym::todo_macro, macro_call.def_id) . { . return; . } . span_lint(self.cx, DIVERGING_SUB_EXPRESSION, e.span, "sub-expression diverges"); -- line 147 ---------------------------------------- -- line 148 ---------------------------------------- . } . } . . fn stmt_might_diverge(stmt: &Stmt<'_>) -> bool { . !matches!(stmt.kind, StmtKind::Item(..)) . } . . impl<'tcx> Visitor<'tcx> for DivergenceVisitor<'_, 'tcx> { 3,472 ( 0.00%) fn visit_expr(&mut self, e: &'tcx Expr<'_>) { 3,457 ( 0.00%) match e.kind { . // fix #10776 . ExprKind::Block(block, ..) => match (block.stmts, block.expr) { . (stmts, Some(e)) if stmts.iter().all(|stmt| !stmt_might_diverge(stmt)) => { . self.visit_expr(e); . }, . ([first @ .., stmt], None) . if first.iter().all(|stmt| !stmt_might_diverge(stmt)) . && let StmtKind::Expr(e) | StmtKind::Semi(e) = stmt.kind => . { . self.visit_expr(e); . }, . _ => {}, . }, . ExprKind::Continue(_) | ExprKind::Break(_, _) | ExprKind::Ret(_) => self.report_diverging_sub_expr(e), 57 ( 0.00%) ExprKind::Call(func, _) => { 114 ( 0.00%) let typ = self.cx.typeck_results().expr_ty(func); 1,760 ( 0.00%) => ???:::expr_ty (44x) . if typ.is_fn() { 336 ( 0.00%) let sig = typ.fn_sig(self.cx.tcx); 22,701 ( 0.00%) => ???:::fn_sig (43x) 448 ( 0.00%) if self.cx.tcx.instantiate_bound_regions_with_erased(sig).output().kind() == &ty::Never { 12,966 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/ty/fold.rs:::instantiate_bound_regions_with_erased::> (43x) . self.report_diverging_sub_expr(e); . } . } . }, . ExprKind::MethodCall(..) => { 24 ( 0.00%) let borrowed_table = self.cx.typeck_results(); 96 ( 0.00%) if borrowed_table.expr_ty(e).is_never() { 360 ( 0.00%) => ???:::expr_ty (9x) . self.report_diverging_sub_expr(e); . } . }, . _ => { . // do not lint expressions referencing objects of type `!`, as that required a . // diverging expression . // to begin with . }, . } 1,488 ( 0.00%) self.maybe_walk_expr(e); 36,322 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/mixed_read_write_in_expression.rs:::maybe_walk_expr'2 (148x) 14,214 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/mixed_read_write_in_expression.rs:::maybe_walk_expr (37x) 2,976 ( 0.00%) } . fn visit_block(&mut self, _: &'tcx Block<'_>) { . // don't continue over blocks, LateLintPass already does that . } . } . . /// Walks up the AST from the given write expression (`vis.write_expr`) looking . /// for reads to the same variable that are unsequenced relative to the write. . /// -- line 202 ---------------------------------------- -- line 207 ---------------------------------------- . /// and `|| x = 1` don't necessarily evaluate `x`), and . /// . /// * which one is evaluated first depends on the order of sub-expression evaluation. Blocks, `if`s, . /// loops, `match`es, and the short-circuiting logical operators are considered to have a defined . /// evaluation order. . /// . /// When such a read is found, the lint is triggered. . fn check_for_unsequenced_reads(vis: &mut ReadVisitor<'_, '_>) { 24 ( 0.00%) let mut cur_id = vis.write_expr.hir_id; . loop { 696 ( 0.00%) let parent_id = vis.cx.tcx.parent_hir_id(cur_id); 6,201 ( 0.00%) => ???:::parent_hir_id (117x) 117 ( 0.00%) if parent_id == cur_id { . break; . } . 1,275 ( 0.00%) let stop_early = match vis.cx.tcx.hir_node(parent_id) { 6,084 ( 0.00%) => ???:::hir_node (117x) 50 ( 0.00%) Node::Expr(expr) => check_expr(vis, expr), 69 ( 0.00%) Node::Stmt(stmt) => check_stmt(vis, stmt), . Node::Item(_) => { . // We reached the top of the function, stop. . break; . }, . _ => StopEarly::KeepGoing, . }; . match stop_early { . StopEarly::Stop => break, -- line 232 ---------------------------------------- -- line 289 ---------------------------------------- . } . . vis.last_expr = expr; . . StopEarly::KeepGoing . } . . fn check_stmt<'tcx>(vis: &mut ReadVisitor<'_, 'tcx>, stmt: &'tcx Stmt<'_>) -> StopEarly { 69 ( 0.00%) match stmt.kind { . StmtKind::Expr(expr) | StmtKind::Semi(expr) => check_expr(vis, expr), . // If the declaration is of a local variable, check its initializer . // expression if it has one. Otherwise, keep going. . StmtKind::Let(local) => local . .init . .as_ref() . .map_or(StopEarly::KeepGoing, |expr| check_expr(vis, expr)), . StmtKind::Item(..) => StopEarly::KeepGoing, -- line 305 ---------------------------------------- 2,821 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/validations.rs -------------------------------------------------------------------------------- Ir -- line 29 ---------------------------------------- . /// . /// # Safety . /// . /// `bytes` must produce a valid UTF-8-like (UTF-8 or WTF-8) string . #[unstable(feature = "str_internals", issue = "none")] . #[inline] . pub unsafe fn next_code_point<'a, I: Iterator>(bytes: &mut I) -> Option { . // Decode UTF-8 214,298 ( 0.01%) let x = *bytes.next()?; 429,940 ( 0.02%) if x < 128 { . return Some(x as u32); . } . . // Multibyte case follows . // Decode from a byte combination out of: [[[x y] z] w] . // NOTE: Performance is sensitive to the exact formulation here . let init = utf8_first_byte(x, 2); . // SAFETY: `bytes` produces an UTF-8-like string, -- line 46 ---------------------------------------- -- line 76 ---------------------------------------- . /// `bytes` must produce a valid UTF-8-like (UTF-8 or WTF-8) string . #[inline] . pub(super) unsafe fn next_code_point_reverse<'a, I>(bytes: &mut I) -> Option . where . I: DoubleEndedIterator, . { . // Decode UTF-8 . let w = match *bytes.next_back()? { 3,447 ( 0.00%) next_byte if next_byte < 128 => return Some(next_byte as u32), . back_byte => back_byte, . }; . . // Multibyte case follows . // Decode from a byte combination out of: [x [y [z w]]] . let mut ch; . // SAFETY: `bytes` produces an UTF-8-like string, . // so the iterator must produce a value here. -- line 92 ---------------------------------------- 150,458 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_is_ascii_check.rs -------------------------------------------------------------------------------- Ir -- line 85 ---------------------------------------- . /// 'A..=F' . UpperHexLetter, . /// '0..=9' | 'a..=f' | 'A..=F' . HexDigit, . Otherwise, . } . . impl<'tcx> LateLintPass<'tcx> for ManualIsAsciiCheck { 618,678 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 206,366 ( 0.01%) if !matches!( 137,484 ( 0.01%) expr.kind, 158 ( 0.00%) ExprKind::Match(_, [_, ..], _) | ExprKind::MethodCall(_, _, [_], _) . ) { . return; . } . 560 ( 0.00%) if !self.msrv.meets(cx, msrvs::IS_ASCII_DIGIT) { 2,160 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (80x) . return; . } . 320 ( 0.00%) if is_in_const_context(cx) && !self.msrv.meets(cx, msrvs::IS_ASCII_DIGIT_CONST) { 21,512 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_const_context (80x) . return; . } . 656 ( 0.00%) let (arg, span, range) = if let ExprKind::Match(recv, [arm, ..], _) = expr.kind 336 ( 0.00%) && let Some(macro_call) = matching_root_macro_call(cx, expr.span, sym::matches_macro) 7,376 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::matching_root_macro_call (48x) . { . let recv = peel_ref_operators(cx, recv); . let range = check_pat(&arm.pat.kind); . (recv, macro_call.span, range) 160 ( 0.00%) } else if let ExprKind::MethodCall(path, receiver, [arg], ..) = expr.kind 32 ( 0.00%) && path.ident.name == sym::contains . && let Some(higher::Range { . start: Some(start), . end: Some(end), . ty: range_ty, . span: _, . }) = higher::Range::hir(cx, receiver) . && let RangeLimits::Closed = range_ty.limits() . && !matches!(cx.typeck_results().expr_ty(arg).peel_refs().kind(), ty::Param(_)) -- line 124 ---------------------------------------- -- line 127 ---------------------------------------- . let range = check_expr_range(start, end); . (arg, expr.span, range) . } else { . return; . }; . . let ty_sugg = get_ty_sugg(cx, arg); . check_is_ascii(cx, span, arg, &range, ty_sugg); 549,936 ( 0.03%) } . } . . fn get_ty_sugg<'tcx>(cx: &LateContext<'tcx>, arg: &Expr<'_>) -> Option<(Span, Ty<'tcx>)> { . let local_hid = arg.res_local_id()?; . if let Node::Param(Param { ty_span, span, .. }) = cx.tcx.parent_hir_node(local_hid) . // `ty_span` and `span` are the same for inferred type, thus a type suggestion must be given . && ty_span == span . { -- line 143 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_utils/src/msrvs.rs -------------------------------------------------------------------------------- Ir -- line 110 ---------------------------------------- . } . } . . impl Msrv { . /// Returns the MSRV at the current node . /// . /// If the crate being linted uses an `#[clippy::msrv]` attribute this will search the parent . /// nodes for that attribute, prefer to run this check after cheaper pattern matching operations 630 ( 0.00%) pub fn current(self, cx: &LateContext<'_>) -> Option { 138,222 ( 0.01%) if SEEN_MSRV_ATTR.load(Ordering::Relaxed) { . self.for_attrs(cx.tcx, cx.last_node_with_lint_attrs) . } else { . self.0 . } 840 ( 0.00%) } . . /// Returns the MSRV at the specified node . /// . /// If the crate being linted uses an `#[clippy::msrv]` attribute this will search the parent . /// nodes for that attribute, prefer to run this check after cheaper pattern matching operations . pub fn at(self, tcx: TyCtxt<'_>, node: HirId) -> Option { . if SEEN_MSRV_ATTR.load(Ordering::Relaxed) { . self.for_attrs(tcx, node) -- line 132 ---------------------------------------- -- line 141 ---------------------------------------- . .find_map(|id| parse_attrs(tcx.hir_attrs(id))) . .or(self.0) . } . . /// Checks if a required version from [this module](self) is met at the current node . /// . /// If the crate being linted uses an `#[clippy::msrv]` attribute this will search the parent . /// nodes for that attribute, prefer to run this check after cheaper pattern matching operations 690,060 ( 0.03%) pub fn meets(self, cx: &LateContext<'_>, required: RustcVersion) -> bool { 552,048 ( 0.03%) self.current(cx).is_none_or(|msrv| msrv >= required) 552,048 ( 0.03%) } . /// Checks if a required version from [this module](self) is met at the specified node . /// . /// If the crate being linted uses an `#[clippy::msrv]` attribute this will search the parent . /// nodes for that attribute, prefer to run this check after cheaper pattern matching operations . pub fn meets_at(self, tcx: TyCtxt<'_>, node: HirId, required: RustcVersion) -> bool { . self.at(tcx, node).is_none_or(|msrv| msrv >= required) . } . -- line 159 ---------------------------------------- -- line 232 ---------------------------------------- . } . . impl MsrvStack { . pub fn current(&self) -> Option { . self.stack.last().copied() . } . . pub fn meets(&self, required: RustcVersion) -> bool { 369,445 ( 0.02%) self.current().is_none_or(|msrv| msrv >= required) 73,889 ( 0.00%) } . . pub fn check_attributes(&mut self, attrs: &[Attribute]) { . if let Some(version) = parse_attrs(attrs) { . SEEN_MSRV_ATTR.store(true, Ordering::Relaxed); . self.stack.push(version); . } 445,714 ( 0.02%) } . . pub fn check_attributes_post(&mut self, attrs: &[Attribute]) { . if parse_attrs(attrs).is_some() { . self.stack.pop(); . } 445,714 ( 0.02%) } . } . . fn parse_attrs(attrs: &[impl AttributeExt]) -> Option { 11,560 ( 0.00%) let msrv_attr = attrs.iter().find(|attr| attr.path_matches(&[sym::clippy, sym::msrv]))?; 8,204 ( 0.00%) => ???:::path_matches (1,445x) . . let msrv = msrv_attr.value_str()?; . . parse_version(msrv) . } . 594,328 ( 0.03%) pub fn check_attrs(sess: &Session, attrs: &[impl AttributeExt]) { 964 ( 0.00%) let mut msrv_attrs = attrs.iter().filter(|attr| attr.path_matches(&[sym::clippy, sym::msrv])); 1,368 ( 0.00%) => ???:::path_matches (241x) . . let Some(msrv_attr) = msrv_attrs.next() else { . return; . }; . . if let Some(duplicate) = msrv_attrs.next_back() { . sess.dcx() . .struct_span_err(duplicate.span(), "`clippy::msrv` is defined multiple times") -- line 274 ---------------------------------------- -- line 280 ---------------------------------------- . sess.dcx().span_err(msrv_attr.span(), "bad clippy attribute"); . return; . }; . . if parse_version(msrv).is_none() { . sess.dcx() . .span_err(msrv_attr.span(), format!("`{msrv}` is not a valid Rust version")); . } 594,328 ( 0.03%) } 138,253 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/main_recursion.rs -------------------------------------------------------------------------------- Ir -- line 29 ---------------------------------------- . . #[derive(Default)] . pub struct MainRecursion { . has_no_std_attr: bool, . } . . impl LateLintPass<'_> for MainRecursion { . fn check_crate(&mut self, cx: &LateContext<'_>) { 3 ( 0.00%) self.has_no_std_attr = is_no_std_crate(cx); 244 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_no_std_crate (1x) . } . 274,968 ( 0.01%) fn check_expr_post(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 275,366 ( 0.01%) if self.has_no_std_attr { . return; . } . . if let ExprKind::Call(func, []) = &expr.kind 25 ( 0.00%) && let ExprKind::Path(QPath::Resolved(_, path)) = &func.kind . && let Some(def_id) = path.res.opt_def_id() . && is_entrypoint_fn(cx, def_id) . { . span_lint_and_help( . cx, . MAIN_RECURSION, . func.span, . format!("recursing into entrypoint `{}`", snippet(cx, func.span, "main")), . None, . "consider using another function for this recursion", . ); . } 343,710 ( 0.02%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs -------------------------------------------------------------------------------- Ir -- line 5094 ---------------------------------------- . allowed_dotfiles: FxHashSet<&'static str>, . format_args: FormatArgsStorage, . allow_unwrap_types: Vec, . unwrap_allowed_ids: FxHashSet, . unwrap_allowed_aliases: Vec, . } . . impl Methods { 10 ( 0.00%) pub fn new(conf: &'static Conf, format_args: FormatArgsStorage) -> Self { . let mut allowed_dotfiles: FxHashSet<_> = conf.allowed_dotfiles.iter().map(|s| &**s).collect(); . allowed_dotfiles.extend(DEFAULT_ALLOWED_DOTFILES); . 21 ( 0.00%) Self { 1 ( 0.00%) avoid_breaking_exported_api: conf.avoid_breaking_exported_api, 1 ( 0.00%) msrv: conf.msrv.into(), . allow_expect_in_tests: conf.allow_expect_in_tests, . allow_unwrap_in_tests: conf.allow_unwrap_in_tests, 1 ( 0.00%) allow_expect_in_consts: conf.allow_expect_in_consts, 1 ( 0.00%) allow_unwrap_in_consts: conf.allow_unwrap_in_consts, 6 ( 0.00%) allowed_dotfiles, 1 ( 0.00%) format_args, 3 ( 0.00%) allow_unwrap_types: conf.allow_unwrap_types.clone(), 33 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs: as core::clone::Clone>::clone (1x) . unwrap_allowed_ids: FxHashSet::default(), . unwrap_allowed_aliases: Vec::new(), . } 9 ( 0.00%) } . } . . /// Extracts a method call name, args, and `Span` of the method name. . /// This ensures that neither the receiver nor any of the arguments . /// come from expansion. 152 ( 0.00%) pub fn method_call<'tcx>(recv: &'tcx Expr<'tcx>) -> Option<(Symbol, &'tcx Expr<'tcx>, &'tcx [Expr<'tcx>], Span, Span)> { 820 ( 0.00%) if let ExprKind::MethodCall(path, receiver, args, call_span) = recv.kind 170 ( 0.00%) && !args.iter().any(|e| e.range_span().unwrap_or(e.span).from_expansion()) 44 ( 0.00%) => ???:::range_span (2x) 448 ( 0.00%) && !receiver.range_span().unwrap_or(receiver.span).from_expansion() 44 ( 0.00%) => ???:::range_span (2x) . { 248 ( 0.00%) Some((path.ident.name, receiver, args, path.ident.span, call_span)) . } else { 17 ( 0.00%) None . } 152 ( 0.00%) } . . impl<'tcx> LateLintPass<'tcx> for Methods { 8 ( 0.00%) fn check_crate(&mut self, cx: &LateContext<'tcx>) { . for s in &self.allow_unwrap_types { . let def_ids = clippy_utils::paths::lookup_path_str(cx.tcx, clippy_utils::paths::PathNS::Type, s); . for def_id in def_ids { . if cx.tcx.def_kind(def_id) == rustc_hir::def::DefKind::TyAlias { . self.unwrap_allowed_aliases.push(def_id); . } else { . self.unwrap_allowed_ids.insert(def_id); . } . } . } 8 ( 0.00%) } . 549,936 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 137,484 ( 0.01%) if expr.span.from_expansion() { . return; . } . 478,676 ( 0.02%) match expr.kind { 632 ( 0.00%) ExprKind::Call(func, args) => { 790 ( 0.00%) unnecessary_fallible_conversions::check_function(cx, expr, func); 24,290 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/unnecessary_fallible_conversions.rs:clippy_lints::methods::unnecessary_fallible_conversions::check_function (158x) 1,738 ( 0.00%) manual_c_str_literals::check(cx, expr, func, args, self.msrv); 4,198 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/manual_c_str_literals.rs:clippy_lints::methods::manual_c_str_literals::check (158x) 1,264 ( 0.00%) useless_nonzero_new_unchecked::check(cx, expr, func, args, self.msrv); 3,102 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/useless_nonzero_new_unchecked.rs:clippy_lints::methods::useless_nonzero_new_unchecked::check (158x) 1,264 ( 0.00%) io_other_error::check(cx, expr, func, args, self.msrv); 672 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/io_other_error.rs:clippy_lints::methods::io_other_error::check (158x) 1,580 ( 0.00%) swap_with_temporary::check(cx, expr, func, args); 13,443 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/swap_with_temporary.rs:clippy_lints::methods::swap_with_temporary::check (158x) 948 ( 0.00%) ip_constant::check(cx, expr, func, args); 3,708 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/ip_constant.rs:clippy_lints::methods::ip_constant::check (158x) 474 ( 0.00%) clone_on_copy::check_function(cx, expr); 30,710 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/clone_on_copy.rs:clippy_lints::methods::clone_on_copy::check_function (158x) 1,738 ( 0.00%) unwrap_expect_used::check_call( 11,859 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/unwrap_expect_used.rs:clippy_lints::methods::unwrap_expect_used::check_call (158x) . cx, . expr, . func, . args, 158 ( 0.00%) self.allow_unwrap_in_tests, 158 ( 0.00%) self.allow_expect_in_tests, 158 ( 0.00%) self.allow_unwrap_in_consts, 158 ( 0.00%) self.allow_expect_in_consts, 158 ( 0.00%) &self.unwrap_allowed_ids, . &self.unwrap_allowed_aliases, . ); . }, . ExprKind::MethodCall(..) => { 990 ( 0.00%) self.check_methods(cx, expr); 106,942 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:::check_methods (110x) . }, 369 ( 0.00%) ExprKind::Binary(op, lhs, rhs) if op.node == hir::BinOpKind::Eq || op.node == hir::BinOpKind::Ne => { 48 ( 0.00%) let mut info = BinaryExprInfo { . expr, . chain: lhs, . other: rhs, . eq: op.node == hir::BinOpKind::Eq, . }; . lint_binary_expr_with_method_call(cx, &mut info); . }, . ExprKind::Binary(op, lhs, rhs) if op.node == hir::BinOpKind::Or => { . manual_is_variant_and::check_or(cx, expr, lhs, rhs, self.msrv); . }, . _ => (), . } 549,056 ( 0.03%) } . 490 ( 0.00%) fn check_impl_item(&mut self, cx: &LateContext<'tcx>, impl_item: &'tcx hir::ImplItem<'_>) { 147 ( 0.00%) if impl_item.span.in_external_macro(cx.sess().source_map()) { . return; . } . 188 ( 0.00%) if let hir::ImplItemKind::Fn(ref sig, id) = impl_item.kind { 180 ( 0.00%) let parent = cx.tcx.hir_get_parent_item(impl_item.hir_id()).def_id; 3,312 ( 0.00%) => ???:::hir_get_parent_item (36x) 144 ( 0.00%) let item = cx.tcx.hir_expect_item(parent); 1,836 ( 0.00%) => ???:::hir_expect_item (36x) 108 ( 0.00%) let self_ty = cx.tcx.type_of(item.owner_id).instantiate_identity().skip_norm_wip(); 144 ( 0.00%) let implements_trait = matches!(item.kind, hir::ItemKind::Impl(hir::Impl { of_trait: Some(_), .. })); . . let method_sig = cx.tcx.fn_sig(impl_item.owner_id).instantiate_identity().skip_norm_wip(); 72 ( 0.00%) let method_sig = cx.tcx.instantiate_bound_regions_with_erased(method_sig); 18,641 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/ty/fold.rs:::instantiate_bound_regions_with_erased::> (36x) 36 ( 0.00%) let first_arg_ty_opt = method_sig.inputs().iter().next().copied(); 288 ( 0.00%) should_implement_trait::check_impl_item(cx, impl_item, self_ty, implements_trait, first_arg_ty_opt, sig); 1,321 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/should_implement_trait.rs:clippy_lints::methods::should_implement_trait::check_impl_item (36x) . 144 ( 0.00%) if sig.decl.implicit_self().has_implicit_self() 288 ( 0.00%) => ???:::implicit_self (36x) 62 ( 0.00%) && !(self.avoid_breaking_exported_api 155 ( 0.00%) && cx.effective_visibilities.is_exported(impl_item.owner_id.def_id)) 1,897 ( 0.00%) => ???:::is_exported (31x) 16 ( 0.00%) && let Some(first_arg) = iter_input_pats(sig.decl, cx.tcx.hir_body(id)).next() 222 ( 0.00%) => ???:::hir_body (4x) 8 ( 0.00%) && let Some(first_arg_ty) = first_arg_ty_opt . { 24 ( 0.00%) wrong_self_convention::check( 2,372 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/wrong_self_convention.rs:clippy_lints::methods::wrong_self_convention::check (4x) . cx, 4 ( 0.00%) impl_item.ident.name, . self_ty, . first_arg_ty, 8 ( 0.00%) first_arg.pat.span, . implements_trait, . false, . ); . } . . new_ret_no_self::check_impl_item(cx, impl_item, self_ty, implements_trait); . } 392 ( 0.00%) } . 42 ( 0.00%) fn check_trait_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx TraitItem<'_>) { 12 ( 0.00%) if let TraitItemKind::Fn(ref sig, _) = item.kind 30 ( 0.00%) && !item.span.in_external_macro(cx.tcx.sess.source_map()) . { 24 ( 0.00%) if sig.decl.implicit_self().has_implicit_self() 48 ( 0.00%) => ???:::implicit_self (6x) . && let Some(first_arg_hir_ty) = sig.decl.inputs.first() 6 ( 0.00%) && let Some(&first_arg_ty) = cx . .tcx 12 ( 0.00%) .fn_sig(item.owner_id) . .instantiate_identity() . .skip_norm_wip() . .inputs() . .skip_binder() . .first() . { . let self_ty = TraitRef::identity(cx.tcx, item.owner_id.to_def_id()).self_ty(); 36 ( 0.00%) wrong_self_convention::check( 3,298 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/wrong_self_convention.rs:clippy_lints::methods::wrong_self_convention::check (6x) . cx, 12 ( 0.00%) item.ident.name, . self_ty, . first_arg_ty, 6 ( 0.00%) first_arg_hir_ty.span, . false, . true, . ); . } . 18 ( 0.00%) new_ret_no_self::check_trait_item(cx, item); 102 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/new_ret_no_self.rs:clippy_lints::methods::new_ret_no_self::check_trait_item (6x) . } 48 ( 0.00%) } . } . . impl Methods { . #[expect(clippy::too_many_lines)] 770 ( 0.00%) fn check_methods<'tcx>(&self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . // Handle method calls whose receiver and arguments may not come from expansion . if let Some((name, recv, args, span, call_span)) = method_call(expr) { . match (name, args) { 665 ( 0.00%) (sym::add | sym::sub | sym::wrapping_add | sym::wrapping_sub, [_arg]) => { 2 ( 0.00%) zst_offset::check(cx, expr, recv); 67 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/zst_offset.rs:clippy_lints::methods::zst_offset::check (1x) . }, . (sym::all, [arg]) => { . needless_character_iteration::check(cx, expr, recv, arg, true); . match method_call(recv) { . Some((sym::cloned, recv2, [], _, _)) => { . iter_overeager_cloned::check( . cx, . expr, -- line 5280 ---------------------------------------- -- line 5331 ---------------------------------------- . manual_contains::check(cx, expr, iter_recv, arg); . }, . _ => {}, . } . }, . (sym::arg, [arg]) => { . suspicious_command_arg_space::check(cx, recv, arg, span); . }, 839 ( 0.00%) (sym::as_deref | sym::as_deref_mut, []) => { . needless_option_as_deref::check(cx, expr, recv, name); . }, . (sym::as_bytes, []) => { . if let Some((sym::as_str, recv, [], as_str_span, _)) = method_call(recv) { . redundant_as_str::check(cx, expr, recv, as_str_span, span); . } . sliced_string_as_bytes::check(cx, expr, recv); . }, . (sym::as_mut | sym::as_ref, []) => useless_asref::check(cx, expr, name, recv), . (sym::as_ptr, []) => manual_c_str_literals::check_as_ptr(cx, expr, recv, self.msrv), . (sym::assume_init, []) => uninit_assumed_init::check(cx, expr, recv), . (sym::bytes, []) => unbuffered_bytes::check(cx, expr, recv), . (sym::cloned, []) => { 18 ( 0.00%) cloned_instead_of_copied::check(cx, expr, recv, span, self.msrv); 4,065 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/cloned_instead_of_copied.rs:clippy_lints::methods::cloned_instead_of_copied::check (2x) 6 ( 0.00%) if let Some((method @ (sym::as_ref | sym::as_mut), as_ref_recv, [], as_ref_ident_span, _)) = 8 ( 0.00%) method_call(recv) 270 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (2x) . { . option_as_ref_cloned::check(cx, span, method, as_ref_recv, as_ref_ident_span); . } . }, 14 ( 0.00%) (sym::collect, []) if cx.ty_based_def(expr).opt_parent(cx).is_diag_item(cx, sym::Iterator) => { 116 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/res.rs: as clippy_utils::res::MaybeDef>::opt_parent:: (1x) 9 ( 0.00%) needless_collect::check(cx, span, expr, recv, call_span); 3,932 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/needless_collect.rs:clippy_lints::methods::needless_collect::check (1x) 5 ( 0.00%) match method_call(recv) { 20 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (1x) . Some((name @ (sym::cloned | sym::copied), recv2, [], _, _)) => { . iter_cloned_collect::check(cx, name, expr, recv2); . }, . Some((sym::map, m_recv, [m_arg], m_ident_span, _)) => { . map_collect_result_unit::check(cx, expr, m_recv, m_arg); . format_collect::check(cx, expr, m_arg, m_ident_span); . }, . Some((sym::take, take_self_arg, [take_arg], _, _)) => { -- line 5370 ---------------------------------------- -- line 5531 ---------------------------------------- . recv, . recv2, . iter_overeager_cloned::Op::NeedlessMove(arg), . false, . ), . _ => {}, . }, . (sym::get, [arg]) => { 24 ( 0.00%) get_first::check(cx, expr, recv, arg); 1,382 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/get_first.rs:clippy_lints::methods::get_first::check (3x) 15 ( 0.00%) get_last_with_len::check(cx, expr, recv, arg); 51 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/get_last_with_len.rs:clippy_lints::methods::get_last_with_len::check (3x) . }, . (sym::get_or_insert_with, [arg]) => { . unnecessary_lazy_eval::check(cx, expr, recv, arg, "get_or_insert", false); . }, . (sym::hash, [arg]) => { . unit_hash::check(cx, expr, recv, arg); . }, . (sym::is_empty, []) => { 7 ( 0.00%) match method_call(recv) { 20 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (1x) . Some((prev_method @ (sym::as_bytes | sym::bytes), prev_recv, [], _, _)) => { . needless_as_bytes::check(cx, prev_method, name, prev_recv, expr.span); . }, . Some((sym::as_str, recv, [], as_str_span, _)) => { . redundant_as_str::check(cx, expr, recv, as_str_span, span); . }, . _ => {}, . } 4 ( 0.00%) is_empty::check(cx, expr, recv); 359 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/is_empty.rs:clippy_lints::methods::is_empty::check (1x) . }, . (sym::is_file, []) => filetype_is_file::check(cx, expr, recv), . (sym::is_digit, [radix]) => is_digit_ascii_radix::check(cx, expr, recv, radix, self.msrv), . (sym::is_none, []) => check_is_some_is_none(cx, expr, recv, call_span, false, self.msrv), 8 ( 0.00%) (sym::is_some, []) => check_is_some_is_none(cx, expr, recv, call_span, true, self.msrv), 23 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::check_is_some_is_none (1x) . (sym::is_some_and, [arg]) => manual_is_variant_and::check_ok_is_some_and(cx, expr, recv, arg), . (sym::iter | sym::iter_mut | sym::into_iter, []) => { 24 ( 0.00%) iter_on_single_or_empty_collections::check(cx, expr, name, recv); 5,197 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/iter_on_single_or_empty_collections.rs:clippy_lints::methods::iter_on_single_or_empty_collections::check (6x) . }, . (sym::join, [join_arg]) => { . if let Some((sym::collect, _, _, span, _)) = method_call(recv) { . unnecessary_join::check(cx, expr, recv, join_arg, span); . } else { . join_absolute_paths::check(cx, recv, join_arg, expr.span); . } . }, -- line 5574 ---------------------------------------- -- line 5581 ---------------------------------------- . recv2, . iter_overeager_cloned::Op::LaterCloned, . false, . ); . } . double_ended_iterator_last::check(cx, expr, recv, call_span); . }, . (sym::len, []) => { 24 ( 0.00%) if let Some((prev_method @ (sym::as_bytes | sym::bytes), prev_recv, [], _, _)) = method_call(recv) { 120 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (6x) . needless_as_bytes::check(cx, prev_method, sym::len, prev_recv, expr.span); . } . }, . (sym::lock, []) => { . mut_mutex_lock::check(cx, expr, recv, span); . }, . (name @ (sym::map | sym::map_err), [m_arg]) => { . if name == sym::map { 24 ( 0.00%) map_clone::check(cx, expr, recv, m_arg, self.msrv); 2,097 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/map_clone.rs:clippy_lints::methods::map_clone::check (3x) 24 ( 0.00%) map_with_unused_argument_over_ranges::check(cx, expr, recv, m_arg, self.msrv, span); 258 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/map_with_unused_argument_over_ranges.rs:clippy_lints::methods::map_with_unused_argument_over_ranges::check (3x) 15 ( 0.00%) manual_is_variant_and::check_map(cx, expr, self.msrv); 360 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/manual_is_variant_and.rs:clippy_lints::methods::manual_is_variant_and::check_map (3x) 27 ( 0.00%) match method_call(recv) { 60 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (3x) . Some((map_name @ (sym::iter | sym::into_iter), recv2, _, _, _)) => { . iter_kv_map::check(cx, map_name, expr, recv2, m_arg, self.msrv, sym::map); . }, . Some((sym::cloned, recv2, [], _, _)) => iter_overeager_cloned::check( . cx, . expr, . recv, . recv2, -- line 5609 ---------------------------------------- -- line 5610 ---------------------------------------- . iter_overeager_cloned::Op::NeedlessMove(m_arg), . false, . ), . _ => {}, . } . } else { . map_err_ignore::check(cx, expr, m_arg); . } 15 ( 0.00%) if let Some((name, recv2, args, span2, _)) = method_call(recv) { 60 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (3x) . match (name, args) { . (sym::as_mut, []) => option_as_ref_deref::check(cx, expr, recv2, m_arg, true, self.msrv), . (sym::as_ref, []) => option_as_ref_deref::check(cx, expr, recv2, m_arg, false, self.msrv), . (sym::filter, [f_arg]) => { . filter_map::check(cx, expr, recv2, f_arg, span2, recv, m_arg, span, false); . }, . (sym::find, [f_arg]) => { . filter_map::check(cx, expr, recv2, f_arg, span2, recv, m_arg, span, true); . }, . _ => {}, . } . } 24 ( 0.00%) map_identity::check(cx, expr, recv, m_arg, name, span); 2,286 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/map_identity.rs:clippy_lints::methods::map_identity::check (3x) 21 ( 0.00%) manual_inspect::check(cx, expr, m_arg, name, span, self.msrv); 2,238 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/manual_inspect.rs:clippy_lints::methods::manual_inspect::check (3x) . }, . (sym::map_or, [def, map]) => { . option_map_or_none::check(cx, expr, recv, def, map); . manual_ok_or::check(cx, expr, recv, def, map); . unnecessary_map_or::check(cx, expr, recv, def, map, span, self.msrv); . }, . (sym::map_or_else, [def, map]) => { . result_map_or_else_none::check(cx, expr, recv, def, map); . unnecessary_map_or_else::check(cx, expr, recv, def, map, call_span); . }, . (sym::next, []) => { 12 ( 0.00%) if let Some((name2, recv2, args2, _, _)) = method_call(recv) { 60 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (3x) . match (name2, args2) { . (sym::cloned, []) => iter_overeager_cloned::check( . cx, . expr, . recv, . recv2, . iter_overeager_cloned::Op::LaterCloned, . false, -- line 5652 ---------------------------------------- -- line 5696 ---------------------------------------- . }, . (sym::ok_or_else, [arg]) => { . unnecessary_lazy_eval::check(cx, expr, recv, arg, "ok_or", true); . }, . (sym::open, [_]) => { . open_options::check(cx, expr, recv); . }, . (sym::or_else, [arg]) => { 8 ( 0.00%) if !bind_instead_of_map::check_or_else_err(cx, expr, recv, arg) { 16 ( 0.00%) unnecessary_lazy_eval::check(cx, expr, recv, arg, "or", false); . } . }, . (sym::peek, []) => { . by_ref_peekable_peek::check(cx, expr, recv); . }, . (sym::push, [arg]) => { 12 ( 0.00%) path_buf_push_overwrite::check(cx, expr, arg); 3,054 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/path_buf_push_overwrite.rs:clippy_lints::methods::path_buf_push_overwrite::check (6x) . }, . (sym::read_to_end, [_]) => { . verbose_file_reads::check(cx, expr, recv, verbose_file_reads::READ_TO_END_MSG); . }, . (sym::read_to_string, [_]) => { . verbose_file_reads::check(cx, expr, recv, verbose_file_reads::READ_TO_STRING_MSG); . }, . (sym::read_line, [arg]) => { -- line 5720 ---------------------------------------- -- line 5778 ---------------------------------------- . str_splitn::check(cx, name, expr, recv, pat_arg, count, self.msrv); . } . }, . (sym::splitn_mut | sym::rsplitn_mut, [count_arg, _]) => { . if let Some(Constant::Int(count)) = ConstEvalCtxt::new(cx).eval(count_arg) { . suspicious_splitn::check(cx, name, expr, recv, count); . } . }, 373 ( 0.00%) (sym::step_by, [arg]) => iterator_step_by_zero::check(cx, expr, arg), 4 ( 0.00%) (sym::take, [arg]) => { . iter_out_of_bounds::check_take(cx, expr, recv, arg); . manual_repeat_n::check(cx, expr, recv, arg, self.msrv); . if let Some((sym::cloned, recv2, [], _span2, _)) = method_call(recv) { . iter_overeager_cloned::check( . cx, . expr, . recv, . recv2, . iter_overeager_cloned::Op::LaterCloned, . false, . ); . } . }, 16 ( 0.00%) (sym::take, []) => needless_option_take::check(cx, expr, recv), 108 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/needless_option_take.rs:clippy_lints::methods::needless_option_take::check (4x) . (sym::then, [arg]) => { . if !self.msrv.meets(cx, msrvs::BOOL_THEN_SOME) { . return; . } . unnecessary_lazy_eval::check(cx, expr, recv, arg, "then_some", true); 4 ( 0.00%) }, . (sym::try_into, []) if cx.ty_based_def(expr).opt_parent(cx).is_diag_item(cx, sym::TryInto) => { . unnecessary_fallible_conversions::check_method(cx, expr); . }, . (sym::to_owned, []) => { . if !suspicious_to_owned::check(cx, expr, span) { . implicit_clone::check(cx, name, expr, recv); . } . }, 560 ( 0.00%) (sym::to_os_string | sym::to_path_buf | sym::to_string | sym::to_vec, []) => { . implicit_clone::check(cx, name, expr, recv); . }, . (sym::type_id, []) => { . type_id_on_box::check(cx, recv, expr.span); . }, . (sym::unwrap, []) => { . match method_call(recv) { . Some((sym::get, recv, [get_arg], _, _)) => { -- line 5824 ---------------------------------------- -- line 5829 ---------------------------------------- . }, . Some((sym::or, recv, [or_arg], or_span, _)) => { . or_then_unwrap::check(cx, expr, recv, or_arg, or_span); . }, . _ => {}, . } . unnecessary_literal_unwrap::check(cx, expr, recv, name, args); . }, 75 ( 0.00%) (sym::unwrap_or, [u_arg]) => { . match method_call(recv) { . Some((arith @ (sym::checked_add | sym::checked_sub | sym::checked_mul), lhs, [rhs], _, _)) => { . manual_saturating_arithmetic::check_unwrap_or(cx, expr, lhs, rhs, u_arg, arith); . }, . Some((sym::map, m_recv, [m_arg], span, _)) => { . map_unwrap_or::check(cx, expr, m_recv, m_arg, recv, u_arg, span, self.msrv); . }, . Some((then_method @ (sym::then | sym::then_some), t_recv, [t_arg], _, _)) => { -- line 5845 ---------------------------------------- -- line 5871 ---------------------------------------- . t_recv, . t_arg, . then_method, . obfuscated_if_else::Unwrap::OrDefault, . ); . }, . _ => {}, . } 3 ( 0.00%) unnecessary_literal_unwrap::check(cx, expr, recv, name, args); . }, . (sym::unwrap_or_else, [u_arg]) => { . match method_call(recv) { . Some((sym::map, recv, [map_arg], _, _)) . if map_unwrap_or_else::check(cx, expr, recv, map_arg, u_arg, self.msrv) => {}, . Some((then_method @ (sym::then | sym::then_some), t_recv, [t_arg], _, _)) => { . obfuscated_if_else::check( . cx, -- line 5887 ---------------------------------------- -- line 5899 ---------------------------------------- . unnecessary_literal_unwrap::check(cx, expr, recv, name, args); . }, . (sym::wake, []) => { . waker_clone_wake::check(cx, expr, recv); . }, . (sym::write, []) => { . readonly_write_lock::check(cx, expr, recv); . }, 60 ( 0.00%) (sym::zip, [arg]) => { 3 ( 0.00%) if let ExprKind::MethodCall(name, iter_recv, [], _) = recv.kind . && name.ident.name == sym::iter . { . range_zip_with_len::check(cx, expr, iter_recv, arg); . } . }, . _ => {}, . } . } . // Handle method calls whose receiver and arguments may come from expansion . if let ExprKind::MethodCall(path, recv, args, call_span) = expr.kind { 110 ( 0.00%) let method_span = path.ident.span; . . // Those methods do their own method name checking as they deal with multiple methods. 1,650 ( 0.00%) or_fun_call::check(cx, expr, method_span, path.ident.name, recv, args, self.msrv); 1,487 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/or_fun_call.rs:clippy_lints::methods::or_fun_call::check (110x) 990 ( 0.00%) unnecessary_to_owned::check(cx, expr, path.ident.name, recv, args, self.msrv); 40,297 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/unnecessary_to_owned.rs:clippy_lints::methods::unnecessary_to_owned::check (110x) . 110 ( 0.00%) match (path.ident.name, args) { 1,056 ( 0.00%) (sym::clone, []) => { 18 ( 0.00%) clone_on_ref_ptr::check(cx, expr, recv); 408 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/clone_on_ref_ptr.rs:clippy_lints::methods::clone_on_ref_ptr::check (3x) 15 ( 0.00%) clone_on_copy::check(cx, expr, recv); 1,965 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/clone_on_copy.rs:clippy_lints::methods::clone_on_copy::check (3x) . }, . (sym::expect, [arg]) => { . unwrap_expect_used::check( . cx, . expr, . recv, . false, . self.allow_expect_in_consts, -- line 5936 ---------------------------------------- -- line 5952 ---------------------------------------- . &self.unwrap_allowed_ids, . &self.unwrap_allowed_aliases, . unwrap_expect_used::Variant::Expect, . ); . }, . (sym::insert_str | sym::push_str, _) => { . single_char_add_str::check(cx, expr, recv, args); . }, 12 ( 0.00%) (sym::into_iter, []) => { 6 ( 0.00%) into_iter_on_ref::check(cx, expr, method_span, recv); 426 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/into_iter_on_ref.rs:clippy_lints::methods::into_iter_on_ref::check (6x) . }, . (sym::map_or, [def, map]) => { . map_or_identity::check(cx, expr, recv, call_span, def, map); . }, . 6 ( 0.00%) (sym::to_string, []) => { . inefficient_to_string::check(cx, expr, recv, self.msrv); . }, 2 ( 0.00%) (sym::truncate, [arg]) => { 1 ( 0.00%) manual_clear::check(cx, expr, recv, arg, method_span); 183 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/manual_clear.rs:clippy_lints::methods::manual_clear::check (1x) 1 ( 0.00%) }, . (sym::unwrap, []) => { . unwrap_expect_used::check( . cx, . expr, . recv, . false, . self.allow_unwrap_in_consts, . self.allow_unwrap_in_tests, -- line 5980 ---------------------------------------- -- line 5994 ---------------------------------------- . &self.unwrap_allowed_ids, . &self.unwrap_allowed_aliases, . unwrap_expect_used::Variant::Unwrap, . ); . }, . _ => {}, . } . } 880 ( 0.00%) } . } . 13 ( 0.00%) fn check_is_some_is_none<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'tcx>, . recv: &'tcx Expr<'tcx>, . call_span: Span, . is_some: bool, . msrv: Msrv, . ) { . match method_call(recv) { -- line 6013 ---------------------------------------- -- line 6020 ---------------------------------------- . Some((sym::first, f_recv, [], _, _)) => { . unnecessary_first_then_check::check(cx, call_span, recv, f_recv, is_some); . }, . Some((sym::filter, f_recv, [arg], _, _)) => { . manual_is_variant_and::check_is_some_is_none(cx, call_span, f_recv, arg, is_some, msrv); . }, . _ => {}, . } 8 ( 0.00%) } . . /// Used for `lint_binary_expr_with_method_call`. . #[derive(Copy, Clone)] . struct BinaryExprInfo<'a> { . expr: &'a Expr<'a>, . chain: &'a Expr<'a>, . other: &'a Expr<'a>, . eq: bool, . } . . /// Checks for the `CHARS_NEXT_CMP` and `CHARS_LAST_CMP` lints. . fn lint_binary_expr_with_method_call(cx: &LateContext<'_>, info: &mut BinaryExprInfo<'_>) { . macro_rules! lint_with_both_lhs_and_rhs { . ($func:expr, $cx:expr, $info:ident) => { 96 ( 0.00%) if !$func($cx, $info) { . ::std::mem::swap(&mut $info.chain, &mut $info.other); 108 ( 0.00%) if $func($cx, $info) { 4,332 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/chars_last_cmp_with_unwrap.rs:clippy_lints::methods::chars_last_cmp_with_unwrap::check (12x) . return; . } . } . }; . } . . lint_with_both_lhs_and_rhs!(chars_next_cmp::check, cx, info); . lint_with_both_lhs_and_rhs!(chars_last_cmp::check, cx, info); -- line 6053 ---------------------------------------- 2,232 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/reference.rs -------------------------------------------------------------------------------- Ir -- line 34 ---------------------------------------- . pub DEREF_ADDROF, . complexity, . "use of `*&` or `*&mut` in an expression" . } . . declare_lint_pass!(DerefAddrOf => [DEREF_ADDROF]); . . impl LateLintPass<'_> for DerefAddrOf { 412,452 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'_>, e: &Expr<'_>) { 206,226 ( 0.01%) if !e.span.from_expansion() . && let ExprKind::Unary(UnOp::Deref, deref_target) = e.kind . && !deref_target.span.from_expansion() . && let ExprKind::AddrOf(_, _, addrof_target) = deref_target.kind . // NOTE(tesuji): `*&` forces rustc to const-promote the array to `.rodata` section. . // See #12854 for details. . && !matches!(addrof_target.kind, ExprKind::Array(_)) . && deref_target.span.eq_ctxt(e.span) . && !addrof_target.span.from_expansion() -- line 51 ---------------------------------------- -- line 73 ---------------------------------------- . DEREF_ADDROF, . e.span, . "immediately dereferencing a reference", . "try", . sugg.to_string(), . applicability, . ); . } 412,452 ( 0.02%) } . } . . /// Is this a `ManuallyDrop` reached through a union, and when is `DerefMut` called on it? . enum ManuallyDropThroughUnion { . /// `ManuallyDrop` reached through a union and immediately explicitely dereferenced . Directly, . /// `ManuallyDrop` reached through a union, and dereferenced later on . Indirect, -- line 89 ---------------------------------------- 137,008 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/hir.rs -------------------------------------------------------------------------------- Ir -- line 408 ---------------------------------------- . } . } . . pub fn invalid() -> Self { . Self::new(Ident::dummy(), HirId::INVALID, Res::Err) . } . . pub fn args(&self) -> &GenericArgs<'hir> { 156 ( 0.00%) if let Some(ref args) = self.args { args } else { GenericArgs::NONE } . } . } . . #[derive(Clone, Copy, Debug, StableHash)] . pub enum ConstItemRhs<'hir> { . Body(BodyId), . TypeConst(&'hir ConstArg<'hir>), . } -- line 424 ---------------------------------------- -- line 482 ---------------------------------------- . . impl<'hir> ConstArg<'hir> { . /// Converts a `ConstArg` in an unambiguous position to one in an ambiguous position. This is . /// fallible as the [`ConstArgKind::Infer`] variant is not present in ambiguous positions. . /// . /// Functions accepting ambiguous consts will not handle the [`ConstArgKind::Infer`] variant, if . /// infer consts are relevant to you then care should be taken to handle them separately. . pub fn try_as_ambig_ct(&self) -> Option<&ConstArg<'hir, AmbigArg>> { 14 ( 0.00%) if let ConstArgKind::Infer(()) = self.kind { . return None; . } . . // SAFETY: `ConstArg` is `repr(C)` and `ConstArgKind` is marked `repr(u8)` so that the layout is . // the same across different ZST type arguments. We also asserted that the `self` is . // not a `ConstArgKind::Infer` so there is no risk of transmuting a `()` to `AmbigArg`. . let ptr = self as *const ConstArg<'hir> as *const ConstArg<'hir, AmbigArg>; . Some(unsafe { &*ptr }) -- line 498 ---------------------------------------- -- line 746 ---------------------------------------- . Some(self.span_ext).filter(|span| !span.is_empty()) . } . . pub fn is_empty(&self) -> bool { . self.args.is_empty() . } . } . 45 ( 0.00%) #[derive(Copy, Clone, PartialEq, Eq, Debug, StableHash)] . pub enum GenericArgsParentheses { . No, . /// Bounds for `feature(return_type_notation)`, like `T: Trait`, . /// where the args are explicitly elided with `..` . ReturnTypeNotation, . /// parenthesized function-family traits, like `T: Fn(u32) -> i32` . ParenSugar, . } . . /// The modifiers on a trait bound. 80 ( 0.00%) #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, StableHash)] . pub struct TraitBoundModifiers { . pub constness: BoundConstness, . pub polarity: BoundPolarity, . } . . impl TraitBoundModifiers { . pub const NONE: Self = . TraitBoundModifiers { constness: BoundConstness::Never, polarity: BoundPolarity::Positive }; -- line 773 ---------------------------------------- -- line 777 ---------------------------------------- . pub enum GenericBound<'hir> { . Trait(PolyTraitRef<'hir>), . Outlives(&'hir Lifetime), . Use(&'hir [PreciseCapturingArg<'hir>], Span), . } . . impl GenericBound<'_> { . pub fn trait_ref(&self) -> Option<&TraitRef<'_>> { 45 ( 0.00%) match self { . GenericBound::Trait(data) => Some(&data.trait_ref), . _ => None, . } . } . . pub fn span(&self) -> Span { . match self { . GenericBound::Trait(t, ..) => t.span, -- line 793 ---------------------------------------- -- line 855 ---------------------------------------- . pub source: GenericParamSource, . } . . impl<'hir> GenericParam<'hir> { . /// Synthetic type-parameters are inserted after normal ones. . /// In order for normal parameters to be able to refer to synthetic ones, . /// scans them first. . pub fn is_impl_trait(&self) -> bool { 34 ( 0.00%) matches!(self.kind, GenericParamKind::Type { synthetic: true, .. }) . } . . /// This can happen for `async fn`, e.g. `async fn f<'_>(&'_ self)`. . /// . /// See `lifetime_to_generic_param` in `rustc_ast_lowering` for more information. . pub fn is_elided_lifetime(&self) -> bool { 72 ( 0.00%) matches!(self.kind, GenericParamKind::Lifetime { kind: LifetimeParamKind::Elided(_) }) . } . . pub fn is_lifetime(&self) -> bool { . matches!(self.kind, GenericParamKind::Lifetime { .. }) . } . } . . /// Records where the generic parameter originated from. -- line 878 ---------------------------------------- -- line 972 ---------------------------------------- . "" . } . } . . pub fn bounds_for_param( . &self, . param_def_id: LocalDefId, . ) -> impl Iterator> { 62 ( 0.00%) self.predicates.iter().filter_map(move |pred| match pred.kind { . WherePredicateKind::BoundPredicate(bp) 186 ( 0.00%) if bp.is_param_bound(param_def_id.to_def_id()) => 651 ( 0.00%) => ???:::is_param_bound (31x) . { . Some(bp) . } . _ => None, . }) . } . . pub fn outlives_for_param( -- line 990 ---------------------------------------- -- line 1221 ---------------------------------------- . pub fn bounds(&self) -> GenericBounds<'hir> { . match self { . WherePredicateKind::BoundPredicate(p) => p.bounds, . WherePredicateKind::RegionPredicate(p) => p.bounds, . } . } . } . 18 ( 0.00%) #[derive(Copy, Clone, Debug, StableHash, PartialEq, Eq)] . pub enum PredicateOrigin { . WhereClause, . GenericParam, . ImplTrait, . } . . /// A type bound (e.g., `for<'c> Foo: Send + Clone + 'c`). . #[derive(Debug, Clone, Copy, StableHash)] -- line 1237 ---------------------------------------- -- line 1437 ---------------------------------------- . #[inline] . fn value_span(&self) -> Option { . self.value_lit().map(|i| i.span) . } . . /// For a single-segment attribute, returns its name; otherwise, returns `None`. . #[inline] . fn name(&self) -> Option { 300 ( 0.00%) match &self { . Attribute::Unparsed(n) => { 24 ( 0.00%) if let [ident] = n.path.segments.as_ref() { . Some(*ident) . } else { . None . } . } . _ => None, . } . } -- line 1455 ---------------------------------------- -- line 1468 ---------------------------------------- . Some(*span) . } else { . None . } . } . . #[inline] . fn span(&self) -> Span { 1,242 ( 0.00%) match &self { . Attribute::Unparsed(u) => u.span, . // FIXME: should not be needed anymore when all attrs are parsed . Attribute::Parsed(AttributeKind::DocComment { span, .. }) => *span, . Attribute::Parsed(AttributeKind::Deprecated { span, .. }) => *span, . Attribute::Parsed(AttributeKind::CfgTrace(cfgs)) => cfgs[0].1, . a => panic!("can't get the span of an arbitrary parsed attribute: {a:?}"), . } . } -- line 1484 ---------------------------------------- -- line 1490 ---------------------------------------- . matches!(n.args, AttrArgs::Empty) . } . _ => false, . } . } . . #[inline] . fn symbol_path(&self) -> Option> { 2,496 ( 0.00%) match &self { 130 ( 0.00%) Attribute::Unparsed(n) => Some(n.path.segments.iter().copied().collect()), . _ => None, . } . } . . fn path_span(&self) -> Option { . match &self { . Attribute::Unparsed(attr) => Some(attr.path.span), . Attribute::Parsed(_) => None, -- line 1507 ---------------------------------------- -- line 1517 ---------------------------------------- . } . . fn is_automatically_derived_attr(&self) -> bool { . matches!(self, Attribute::Parsed(AttributeKind::AutomaticallyDerived)) . } . . #[inline] . fn doc_str_and_fragment_kind(&self) -> Option<(Symbol, DocFragmentKind)> { 486 ( 0.00%) match &self { . Attribute::Parsed(AttributeKind::DocComment { kind, comment, .. }) => { 1,104 ( 0.00%) Some((*comment, *kind)) . } . _ => None, . } . } . . fn doc_resolution_scope(&self) -> Option { . match self { . Attribute::Parsed(AttributeKind::DocComment { style, .. }) => Some(*style), -- line 1535 ---------------------------------------- -- line 1536 ---------------------------------------- . Attribute::Unparsed(attr) if self.has_name(sym::doc) && self.value_str().is_some() => { . Some(attr.style) . } . _ => None, . } . } . . fn is_proc_macro_attr(&self) -> bool { 204 ( 0.00%) matches!( . self, . Attribute::Parsed( . AttributeKind::ProcMacro . | AttributeKind::ProcMacroAttribute . | AttributeKind::ProcMacroDerive { .. } . ) . ) . } . . fn is_doc_hidden(&self) -> bool { 2,342 ( 0.00%) matches!(self, Attribute::Parsed(AttributeKind::Doc(d)) if d.hidden.is_some()) . } . . fn is_doc_keyword_or_attribute(&self) -> bool { . matches!(self, Attribute::Parsed(AttributeKind::Doc(d)) if d.attribute.is_some() || d.keyword.is_some()) . } . . fn is_rustc_doc_primitive(&self) -> bool { . matches!(self, Attribute::Parsed(AttributeKind::RustcDocPrimitive(..))) -- line 1563 ---------------------------------------- -- line 2052 ---------------------------------------- . assert!(n < u32::MAX as usize); . Self(n as u32) . } . None => Self(u32::MAX), . } . } . . pub fn as_opt_usize(&self) -> Option { 44 ( 0.00%) if self.0 == u32::MAX { None } else { Some(self.0 as usize) } . } . } . . impl fmt::Debug for DotDotPos { . fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { . self.as_opt_usize().fmt(f) . } . } -- line 2068 ---------------------------------------- -- line 2256 ---------------------------------------- . #[stable_hash(ignore)] . pub hir_id: HirId, . pub ident: Ident, . pub expr: &'hir Expr<'hir>, . pub span: Span, . pub is_shorthand: bool, . } . 10 ( 0.00%) #[derive(Copy, Clone, PartialEq, Debug, StableHash)] . pub enum BlockCheckMode { . DefaultBlock, . UnsafeBlock(UnsafeSource), . } . . #[derive(Copy, Clone, PartialEq, Debug, StableHash)] . pub enum UnsafeSource { . CompilerGenerated, -- line 2272 ---------------------------------------- -- line 2302 ---------------------------------------- . #[derive(Debug, Clone, Copy, StableHash)] . pub struct Body<'hir> { . pub params: &'hir [Param<'hir>], . pub value: &'hir Expr<'hir>, . } . . impl<'hir> Body<'hir> { . pub fn id(&self) -> BodyId { 1,749 ( 0.00%) BodyId { hir_id: self.value.hir_id } . } . } . . /// The type of source expression that caused this coroutine to be created. . #[derive(Clone, PartialEq, Eq, Debug, Copy, Hash, StableHash, Encodable, Decodable)] . pub enum CoroutineKind { . /// A coroutine that comes from a desugaring. . Desugared(CoroutineDesugaring, CoroutineSource), -- line 2318 ---------------------------------------- -- line 2719 ---------------------------------------- . . /// If `Self.kind` is `ExprKind::DropTemps(expr)`, drill down until we get a non-`DropTemps` . /// `Expr`. This is used in suggestions to ignore this `ExprKind` as it is semantically . /// silent, only signaling the ownership system. By doing this, suggestions that check the . /// `ExprKind` of any given `Expr` for presentation don't have to care about `DropTemps` . /// beyond remembering to call this function before doing analysis on it. . pub fn peel_drop_temps(&self) -> &Self { . let mut expr = self; 14,309 ( 0.00%) while let ExprKind::DropTemps(inner) = &expr.kind { . expr = inner; . } . expr . } . . pub fn peel_blocks(&self) -> &Self { . let mut expr = self; 346,006 ( 0.02%) while let ExprKind::Block(Block { expr: Some(inner), .. }, _) = &expr.kind { . expr = inner; . } . expr . } . . pub fn peel_borrows(&self) -> &Self { . let mut expr = self; 206,316 ( 0.01%) while let ExprKind::AddrOf(.., inner) = &expr.kind { 45 ( 0.00%) expr = inner; . } . expr . } . . pub fn can_have_side_effects(&self) -> bool { . match self.peel_drop_temps().kind { . ExprKind::Path(_) | ExprKind::Lit(_) | ExprKind::OffsetOf(..) | ExprKind::Use(..) => { . false -- line 2752 ---------------------------------------- -- line 3137 ---------------------------------------- . AwaitDesugar, . /// A desugared `expr = expr`, where the LHS is a tuple, struct, array or underscore expression. . AssignDesugar, . /// A contract `#[ensures(..)]` attribute injects a let binding for the check that runs at point of return. . Contract, . } . . /// Hints at the original code for a `match _ { .. }`. 71 ( 0.00%) #[derive(Copy, Clone, PartialEq, Eq, Hash, Debug, StableHash, Encodable, Decodable)] . pub enum MatchSource { . /// A `match _ { .. }`. . Normal, . /// A `expr.match { .. }`. . Postfix, . /// A desugared `for _ in _ { .. }` loop. . ForLoopDesugar, . /// A desugared `?` operator. -- line 3153 ---------------------------------------- -- line 3316 ---------------------------------------- . fn expect_failed(ident: &'static str, found: T) -> ! { . panic!("{ident}: found {found:?}") . } . . impl<'hir> TraitItem<'hir> { . #[inline] . pub fn hir_id(&self) -> HirId { . // Items are always HIR owners. 24 ( 0.00%) HirId::make_owner(self.owner_id.def_id) . } . . pub fn trait_item_id(&self) -> TraitItemId { . TraitItemId { owner_id: self.owner_id } . } . . expect_methods_self_kind! { . expect_const, (&'hir Ty<'hir>, Option>), -- line 3332 ---------------------------------------- -- line 3402 ---------------------------------------- . trait_item_def_id: Result, . }, . } . . impl<'hir> ImplItem<'hir> { . #[inline] . pub fn hir_id(&self) -> HirId { . // Items are always HIR owners. 392 ( 0.00%) HirId::make_owner(self.owner_id.def_id) . } . . pub fn impl_item_id(&self) -> ImplItemId { . ImplItemId { owner_id: self.owner_id } . } . . pub fn vis_span(&self) -> Option { . match self.impl_kind { -- line 3418 ---------------------------------------- -- line 3559 ---------------------------------------- . . impl<'hir> Ty<'hir> { . /// Converts a `Ty` in an unambiguous position to one in an ambiguous position. This is . /// fallible as the [`TyKind::Infer`] variant is not present in ambiguous positions. . /// . /// Functions accepting ambiguous types will not handle the [`TyKind::Infer`] variant, if . /// infer types are relevant to you then care should be taken to handle them separately. . pub fn try_as_ambig_ty(&self) -> Option<&Ty<'hir, AmbigArg>> { 3,501 ( 0.00%) if let TyKind::Infer(()) = self.kind { . return None; . } . . // SAFETY: `Ty` is `repr(C)` and `TyKind` is marked `repr(u8)` so that the layout is . // the same across different ZST type arguments. We also asserted that the `self` is . // not a `TyKind::Infer` so there is no risk of transmuting a `()` to `AmbigArg`. . let ptr = self as *const Ty<'hir> as *const Ty<'hir, AmbigArg>; . Some(unsafe { &*ptr }) . } . } . . impl<'hir> Ty<'hir, AmbigArg> { . pub fn peel_refs(&self) -> &Ty<'hir> { . let mut final_ty = self.as_unambig_ty(); 57 ( 0.00%) while let TyKind::Ref(_, MutTy { ty, .. }) = &final_ty.kind { 7 ( 0.00%) final_ty = ty; . } . final_ty . } . } . . impl<'hir> Ty<'hir> { . pub fn peel_refs(&self) -> &Self { . let mut final_ty = self; 27 ( 0.00%) while let TyKind::Ref(_, MutTy { ty, .. }) = &final_ty.kind { 9 ( 0.00%) final_ty = ty; . } . final_ty . } . . /// Returns `true` if `param_def_id` matches the `bounded_ty` of this predicate. . pub fn as_generic_param(&self) -> Option<(DefId, Ident)> { 949 ( 0.00%) let TyKind::Path(QPath::Resolved(None, path)) = self.kind else { . return None; . }; 298 ( 0.00%) let [segment] = &path.segments else { . return None; . }; 789 ( 0.00%) match path.res { 144 ( 0.00%) Res::Def(DefKind::TyParam, def_id) | Res::SelfTyParam { trait_: def_id } => { 144 ( 0.00%) Some((def_id, segment.ident)) . } . _ => None, . } . } . . pub fn find_self_aliases(&self) -> Vec { . use crate::intravisit::Visitor; . struct MyVisitor(Vec); -- line 3616 ---------------------------------------- -- line 3729 ---------------------------------------- . } . } . . /// Returns the matching `PrimTy` for a `Symbol` such as "str" or "i32". . /// Returns `None` if no matching type is found. . pub fn from_name(name: Symbol) -> Option { . let ty = match name { . // any changes here should also be reflected in `PrimTy::ALL` 405 ( 0.00%) sym::i8 => Self::Int(IntTy::I8), . sym::i16 => Self::Int(IntTy::I16), . sym::i32 => Self::Int(IntTy::I32), . sym::i64 => Self::Int(IntTy::I64), . sym::i128 => Self::Int(IntTy::I128), . sym::isize => Self::Int(IntTy::Isize), . sym::u8 => Self::Uint(UintTy::U8), . sym::u16 => Self::Uint(UintTy::U16), . sym::u32 => Self::Uint(UintTy::U32), -- line 3745 ---------------------------------------- -- line 3751 ---------------------------------------- . sym::f64 => Self::Float(FloatTy::F64), . sym::f128 => Self::Float(FloatTy::F128), . sym::bool => Self::Bool, . sym::char => Self::Char, . sym::str => Self::Str, . _ => return None, . }; . Some(ty) 45 ( 0.00%) } . } . . #[derive(Debug, Clone, Copy, StableHash)] . pub struct FnPtrTy<'hir> { . pub safety: Safety, . pub abi: ExternAbi, . pub generic_params: &'hir [GenericParam<'hir>], . pub decl: &'hir FnDecl<'hir>, -- line 3767 ---------------------------------------- -- line 4215 ---------------------------------------- . . /// Do the function arguments end with a C-style variadic argument? . pub fn c_variadic(self) -> bool { . self.flags & Self::C_VARIADIC_FLAG != 0 . } . . /// Is lifetime elision allowed? . pub fn lifetime_elision_allowed(self) -> bool { 82 ( 0.00%) self.flags & Self::LIFETIME_ELISION_ALLOWED_FLAG != 0 . } . . /// Get the splatted argument index, if any. . pub fn splatted(self) -> Option { . if self.splatted == Self::NO_SPLATTED_ARG_INDEX { None } else { Some(self.splatted) } . } . } . -- line 4231 ---------------------------------------- -- line 4266 ---------------------------------------- . self.fn_decl_kind.implicit_self() . } . . pub fn c_variadic(&self) -> bool { . self.fn_decl_kind.c_variadic() . } . . pub fn lifetime_elision_allowed(&self) -> bool { 41 ( 0.00%) self.fn_decl_kind.lifetime_elision_allowed() . } . . pub fn splatted(&self) -> Option { . self.fn_decl_kind.splatted() . } . . pub fn dummy(span: Span) -> Self { . Self { -- line 4282 ---------------------------------------- -- line 4301 ---------------------------------------- . /// Represents when a function does not have a self argument or . /// when a function has a `self: X` argument. . None, . } . . impl ImplicitSelfKind { . /// Does this represent an implicit self? . pub fn has_implicit_self(&self) -> bool { 225 ( 0.00%) !matches!(*self, ImplicitSelfKind::None) . } . } . . #[derive(Copy, Clone, PartialEq, Eq, Encodable, Decodable, Debug, StableHash)] . pub enum IsAsync { . Async(Span), . NotAsync, . } . . impl IsAsync { . pub fn is_async(self) -> bool { 196 ( 0.00%) matches!(self, IsAsync::Async(_)) . } . } . . #[derive(Copy, Clone, PartialEq, Eq, Debug, Encodable, Decodable, StableHash)] . #[derive(Default)] . pub enum Defaultness { . Default { . has_value: bool, -- line 4329 ---------------------------------------- -- line 4359 ---------------------------------------- . DefaultReturn(Span), . /// Everything else. . Return(&'hir Ty<'hir>), . } . . impl<'hir> FnRetTy<'hir> { . #[inline] . pub fn span(&self) -> Span { 640 ( 0.00%) match *self { 10 ( 0.00%) Self::DefaultReturn(span) => span, 300 ( 0.00%) Self::Return(ref ty) => ty.span, . } . } . . pub fn is_suggestable_infer_ty(&self) -> Option<&'hir Ty<'hir>> { . if let Self::Return(ty) = self . && ty.is_suggestable_infer_ty() . { . return Some(*ty); -- line 4377 ---------------------------------------- -- line 4594 ---------------------------------------- . /// either an `EiiImpls` or `EiiExternTarget` attribute . pub eii: bool, . } . . impl<'hir> Item<'hir> { . #[inline] . pub fn hir_id(&self) -> HirId { . // Items are always HIR owners. 1,472 ( 0.00%) HirId::make_owner(self.owner_id.def_id) . } . . #[inline] . pub fn item_id(&self) -> ItemId { . ItemId { owner_id: self.owner_id } . } . . /// Check if this is an [`ItemKind::Enum`], [`ItemKind::Struct`] or -- line 4610 ---------------------------------------- -- line 4714 ---------------------------------------- . fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { . f.write_str(match *self { . Self::Unsafe => "unsafe", . Self::Safe => "safe", . }) . } . } . 4 ( 0.00%) #[derive(Copy, Clone, PartialEq, Eq, Debug, Encodable, Decodable, StableHash)] . pub enum Constness { . Const { always: bool }, . NotConst, . } . . /// This impl exists as an optimization so that metadata deserialization can . /// store the value directly and not have to encode it wrapped in another `Option`. . impl Default for Constness { -- line 4730 ---------------------------------------- -- line 4789 ---------------------------------------- . pub safety: HeaderSafety, . pub constness: Constness, . pub asyncness: IsAsync, . pub abi: ExternAbi, . } . . impl FnHeader { . pub fn is_async(&self) -> bool { 105 ( 0.00%) matches!(self.asyncness, IsAsync::Async(_)) . } . . pub fn is_unsafe(&self) -> bool { . self.safety().is_unsafe() . } . . pub fn is_safe(&self) -> bool { . self.safety().is_safe() . } . . pub fn safety(&self) -> Safety { 415 ( 0.00%) match self.safety { . HeaderSafety::SafeTargetFeatures => Safety::Unsafe, . HeaderSafety::Normal(safety) => safety, . } . } . } . . #[derive(Debug, Clone, Copy, StableHash)] . pub enum ItemKind<'hir> { -- line 4817 ---------------------------------------- -- line 4905 ---------------------------------------- . // We do not put a `Span` in `Defaultness` because it breaks foreign crate metadata . // decoding as `Span`s cannot be decoded when a `Session` is not available. . pub defaultness_span: Option, . pub trait_ref: TraitRef<'hir>, . } . . impl ItemKind<'_> { . pub fn ident(&self) -> Option { 57 ( 0.00%) match *self { . ItemKind::ExternCrate(_, ident) . | ItemKind::Use(_, UseKind::Single(ident)) . | ItemKind::Static(_, ident, ..) . | ItemKind::Const(ident, ..) . | ItemKind::Fn { ident, .. } . | ItemKind::Macro(ident, ..) . | ItemKind::Mod(ident, ..) . | ItemKind::TyAlias(ident, ..) -- line 4921 ---------------------------------------- -- line 4925 ---------------------------------------- . | ItemKind::Trait { ident, .. } . | ItemKind::TraitAlias(_, ident, ..) => Some(ident), . . ItemKind::Use(_, UseKind::Glob | UseKind::ListStem) . | ItemKind::ForeignMod { .. } . | ItemKind::GlobalAsm { .. } . | ItemKind::Impl(_) => None, . } 5 ( 0.00%) } . . pub fn generics(&self) -> Option<&Generics<'_>> { . Some(match self { . ItemKind::Fn { generics, .. } . | ItemKind::TyAlias(_, generics, _) . | ItemKind::Const(_, generics, _, _) . | ItemKind::Enum(_, generics, _) . | ItemKind::Struct(_, generics, _) -- line 4941 ---------------------------------------- 195,422 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/temporary_assignment.rs -------------------------------------------------------------------------------- Ir -- line 21 ---------------------------------------- . pub TEMPORARY_ASSIGNMENT, . complexity, . "assignments to temporaries" . } . . declare_lint_pass!(TemporaryAssignment => [TEMPORARY_ASSIGNMENT]); . . fn is_temporary(expr: &Expr<'_>) -> bool { 112 ( 0.00%) matches!(&expr.kind, ExprKind::Struct(..) | ExprKind::Tup(..)) . } . . impl<'tcx> LateLintPass<'tcx> for TemporaryAssignment { . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 137,484 ( 0.01%) if let ExprKind::Assign(target, ..) = &expr.kind { . let mut base = target; 330 ( 0.00%) while let ExprKind::Field(f, _) | ExprKind::Index(f, _, _) = &base.kind { . base = f; . } . if is_temporary(base) && !is_adjusted(cx, base) { . span_lint(cx, TEMPORARY_ASSIGNMENT, expr.span, "assignment to temporary"); . } . } . } . } -- line 44 ---------------------------------------- 56 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/pointers_in_nomem_asm_block.rs -------------------------------------------------------------------------------- Ir -- line 30 ---------------------------------------- . suspicious, . "pointers in nomem asm block" . } . . declare_lint_pass!(PointersInNomemAsmBlock => [POINTERS_IN_NOMEM_ASM_BLOCK]); . . impl<'tcx> LateLintPass<'tcx> for PointersInNomemAsmBlock { . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &Expr<'tcx>) { 137,484 ( 0.01%) if let ExprKind::InlineAsm(asm) = &expr.kind { . check_asm(cx, asm); . } . } . } . . fn check_asm(cx: &LateContext<'_>, asm: &InlineAsm<'_>) { . if !asm.options.contains(InlineAsmOptions::NOMEM) { . return; -- line 46 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/literal_representation.rs -------------------------------------------------------------------------------- Ir -- line 161 ---------------------------------------- . LargeDigitGroups, . DecimalRepresentation, . MistypedLiteralSuffix, . UnusualByteGroupings, . } . . impl WarningType { . fn lint_and_text(&self) -> (&'static Lint, &'static str, &'static str) { 20,692 ( 0.00%) match self { . Self::MistypedLiteralSuffix => ( . MISTYPED_LITERAL_SUFFIXES, . "mistyped literal suffix", . "did you mean to write", . ), . Self::UnreadableLiteral => (UNREADABLE_LITERAL, "long literal lacking separators", "consider"), . Self::LargeDigitGroups => (LARGE_DIGIT_GROUPS, "digit groups should be smaller", "consider"), . Self::InconsistentDigitGrouping => ( -- line 177 ---------------------------------------- -- line 188 ---------------------------------------- . UNUSUAL_BYTE_GROUPINGS, . "digits of hex, binary or octal literal not in groups of equal size", . "consider", . ), . } . } . . fn display(&self, num_lit: &NumericLiteral<'_>, cx: &EarlyContext<'_>, span: Span) { 11,824 ( 0.00%) let (lint, message, try_msg) = self.lint_and_text(); . #[expect(clippy::collapsible_span_lint_calls, reason = "rust-clippy#7797")] 29,560 ( 0.00%) span_lint_and_then(cx, lint, span, message, |diag| { 2,092,650 ( 0.10%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then::::display::{closure#0}> (2,956x) . diag.span_suggestion(span, try_msg, num_lit.format(), Applicability::MaybeIncorrect); . }); . } . } . . pub struct LiteralDigitGrouping { . lint_fraction_readability: bool, . } . . impl EarlyLintPass for LiteralDigitGrouping { 504,203 ( 0.02%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { . // `NumericLiteral::from_lit_kind` only accepts integer and float literals. 198,491 ( 0.01%) if let ExprKind::Lit(lit) = expr.kind 163,299 ( 0.01%) && matches!(lit.kind, token::LitKind::Integer | token::LitKind::Float) 154,848 ( 0.01%) && !expr.span.in_external_macro(cx.sess().source_map()) . { . self.check_lit(cx, lit, expr.span); . } 576,232 ( 0.03%) } . } . . // Length of each UUID hyphenated group in hex digits. . const UUID_GROUP_LENS: [usize; 5] = [8, 4, 4, 4, 12]; . . impl LiteralDigitGrouping { . pub fn new(conf: &'static Conf) -> Self { . Self { 2 ( 0.00%) lint_fraction_readability: conf.unreadable_literal_lint_fractions, . } . } . . fn check_lit(&self, cx: &EarlyContext<'_>, lit: token::Lit, span: Span) { 270,984 ( 0.01%) if let Some(src) = span.get_text(cx) 309,696 ( 0.01%) && let Ok(lit_kind) = LitKind::from_token_lit(lit) 8,572,052 ( 0.40%) => ???:::from_token_lit (38,712x) 812,952 ( 0.04%) && let Some(mut num_lit) = NumericLiteral::from_lit_kind(&src, &lit_kind) 5,999,845 ( 0.28%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/numeric_literal.rs:::from_lit_kind (38,712x) 967,800 ( 0.05%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::deref (38,712x) . { . if !Self::check_for_mistyped_suffix(cx, span, &mut num_lit) { . return; . } . . if Self::is_literal_uuid_formatted(&num_lit) { . return; . } . 116,136 ( 0.01%) let result = (|| { 38,640 ( 0.00%) let integral_group_size = Self::get_group_size(num_lit.integer.split('_'), num_lit.radix, true)?; 107,268 ( 0.00%) if let Some(fraction) = num_lit.fraction { . let fractional_group_size = . Self::get_group_size(fraction.rsplit('_'), num_lit.radix, self.lint_fraction_readability)?; . . let consistent = Self::parts_consistent( . integral_group_size, . fractional_group_size, . num_lit.integer.len(), . fraction.len(), -- line 253 ---------------------------------------- -- line 272 ---------------------------------------- . warning_type.display(&num_lit, cx, span); . } . } . } . } . . // Returns `false` if the check fails . fn check_for_mistyped_suffix(cx: &EarlyContext<'_>, span: Span, num_lit: &mut NumericLiteral<'_>) -> bool { 38,712 ( 0.00%) if num_lit.suffix.is_some() { . return true; . } . 116,133 ( 0.01%) let (part, mistyped_suffixes, is_float) = if let Some((_, exponent)) = &mut num_lit.exponent { . (exponent, &["32", "64"][..], true) 38,711 ( 0.00%) } else if num_lit.fraction.is_some() { . return true; . } else { . (&mut num_lit.integer, &["8", "16", "32", "64"][..], false) . }; . 77,422 ( 0.00%) let mut split = part.rsplit('_'); 77,422 ( 0.00%) let last_group = split.next().expect("At least one group"); 38,711 ( 0.00%) if split.next().is_some() && mistyped_suffixes.contains(&last_group) { . let main_part = &part[..part.len() - last_group.len()]; . let missing_char; . if is_float { . missing_char = 'f'; . } else { . let radix = match num_lit.radix { . Radix::Binary => 2, . Radix::Octal => 8, -- line 302 ---------------------------------------- -- line 336 ---------------------------------------- . } . } . . /// Checks whether the numeric literal matches the formatting of a UUID. . /// . /// Returns `true` if the radix is hexadecimal, and the groups match the . /// UUID format of 8-4-4-4-12. . fn is_literal_uuid_formatted(num_lit: &NumericLiteral<'_>) -> bool { 77,280 ( 0.00%) if num_lit.radix != Radix::Hexadecimal { . return false; . } . . // UUIDs should not have a fraction . if num_lit.fraction.is_some() { . return false; . } . 77,280 ( 0.00%) let group_sizes: Vec = num_lit.integer.split('_').map(str::len).collect(); 77,280 ( 0.00%) if UUID_GROUP_LENS.len() == group_sizes.len() { . iter::zip(&UUID_GROUP_LENS, &group_sizes).all(|(&a, &b)| a == b) . } else { . false . } . } . . /// Given the sizes of the digit groups of both integral and fractional . /// parts, and the length -- line 362 ---------------------------------------- -- line 386 ---------------------------------------- . groups: impl Iterator, . radix: Radix, . lint_unreadable: bool, . ) -> Result, WarningType> { . let mut groups = groups.map(str::len); . . let first = groups.next().expect("At least one group"); . 77,424 ( 0.00%) if (radix == Radix::Binary || radix == Radix::Octal || radix == Radix::Hexadecimal) . && let Some(second_size) = groups.next() . && (!groups.all(|i| i == second_size) || first > second_size) . { . return Err(WarningType::UnusualByteGroupings); . } . . if let Some(second) = groups.next() { . if !groups.all(|x| x == second) || first > second { . Err(WarningType::InconsistentDigitGrouping) . } else if second > 4 { . Err(WarningType::LargeDigitGroups) . } else { . Ok(Some(second)) . } 77,424 ( 0.00%) } else if first > 5 && lint_unreadable { . Err(WarningType::UnreadableLiteral) . } else { . Ok(None) . } . } . } . . pub struct DecimalLiteralRepresentation { . threshold: u64, . } . . impl EarlyLintPass for DecimalLiteralRepresentation { 504,203 ( 0.02%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { . // Only integer tokens can produce `LitKind::Int`. 144,058 ( 0.01%) if let ExprKind::Lit(lit) = expr.kind . && lit.kind == token::LitKind::Integer 116,136 ( 0.01%) && !expr.span.in_external_macro(cx.sess().source_map()) . { 193,560 ( 0.01%) self.check_lit(cx, lit, expr.span); . } 576,232 ( 0.03%) } . } . . impl DecimalLiteralRepresentation { . pub fn new(conf: &'static Conf) -> Self { . Self { 2 ( 0.00%) threshold: conf.literal_representation_threshold, . } . } . fn check_lit(&self, cx: &EarlyContext<'_>, lit: token::Lit, span: Span) { . // Lint integral literals. 270,984 ( 0.01%) if let Ok(lit_kind) = LitKind::from_token_lit(lit) 8,572,052 ( 0.40%) => ???:::from_token_lit (38,712x) 154,848 ( 0.01%) && let LitKind::Int(val, _) = lit_kind 38,712 ( 0.00%) && val >= u128::from(self.threshold) 88,830 ( 0.00%) && let Some(src) = span.get_text(cx) 3,526,551 ( 0.16%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/source.rs:::get_text::<&rustc_lint::context::EarlyContext> (8,883x) 53,298 ( 0.00%) && let Some(num_lit) = NumericLiteral::from_lit_kind(&src, &lit_kind) 1,376,863 ( 0.06%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/numeric_literal.rs:::from_lit_kind (8,883x) 222,075 ( 0.01%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::deref (8,883x) . && num_lit.radix == Radix::Decimal . { 3 ( 0.00%) let hex = format!("{val:#X}"); 5 ( 0.00%) let num_lit = NumericLiteral::new(&hex, num_lit.suffix, false); 71 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/numeric_literal.rs:::new (1x) 2 ( 0.00%) let _: Result<(), ()> = Self::do_lint(num_lit.integer).map_err(|warning_type| { . warning_type.display(&num_lit, cx, span); . }); . } . } . . fn do_lint(digits: &str) -> Result<(), WarningType> { 2 ( 0.00%) if digits.len() == 1 { . // Lint for 1 digit literals, if someone really sets the threshold that low . if digits == "1" . || digits == "2" . || digits == "4" . || digits == "8" . || digits == "3" . || digits == "7" . || digits == "F" . { . return Err(WarningType::DecimalRepresentation); . } 2 ( 0.00%) } else if digits.len() < 4 { . // Lint for Literals with a hex-representation of 2 or 3 digits . let f = &digits[0..1]; // first digit . let s = &digits[1..]; // suffix . . // Powers of 2 . if ((f.eq("1") || f.eq("2") || f.eq("4") || f.eq("8")) && s.chars().all(|c| c == '0')) . // Powers of 2 minus 1 . || ((f.eq("1") || f.eq("3") || f.eq("7") || f.eq("F")) && s.chars().all(|c| c == 'F')) -- line 477 ---------------------------------------- -- line 480 ---------------------------------------- . } . } else { . // Lint for Literals with a hex-representation of 4 digits or more . let f = &digits[0..1]; // first digit . let m = &digits[1..digits.len() - 1]; // middle digits, except last . let s = &digits[1..]; // suffix . . // Powers of 2 with a margin of +15/-16 3 ( 0.00%) if ((f.eq("1") || f.eq("2") || f.eq("4") || f.eq("8")) && m.chars().all(|c| c == '0')) . || ((f.eq("1") || f.eq("3") || f.eq("7") || f.eq("F")) && m.chars().all(|c| c == 'F')) . // Lint for representations with only 0s and Fs, while allowing 7 as the first . // digit . || ((f.eq("7") || f.eq("F")) && s.chars().all(|c| c == '0' || c == 'F')) . { . return Err(WarningType::DecimalRepresentation); . } . } -- line 496 ---------------------------------------- 616,202 ( 0.03%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/casts/cast_slice_different_sizes.rs -------------------------------------------------------------------------------- Ir -- line 4 ---------------------------------------- . use rustc_ast::Mutability; . use rustc_hir::{Expr, ExprKind, Node}; . use rustc_lint::LateContext; . use rustc_middle::ty::layout::LayoutOf as _; . use rustc_middle::ty::{self, Ty, TypeAndMut}; . . use super::CAST_SLICE_DIFFERENT_SIZES; . 756,162 ( 0.04%) pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'tcx>, msrv: Msrv) { . // if this cast is the child of another cast expression then don't emit something for it, the full . // chain will be analyzed 273,100 ( 0.01%) if is_child_of_cast(cx, expr) { . return; . } . 68,719 ( 0.00%) if let Some(CastChainInfo { . left_cast, . start_ty, . end_ty, 343,595 ( 0.02%) }) = expr_cast_chain_tys(cx, expr) 1,651,181 ( 0.08%) => site/frontend/rust-clippy/clippy_lints/src/casts/cast_slice_different_sizes.rs:clippy_lints::casts::cast_slice_different_sizes::expr_cast_chain_tys (68,719x) . && let (Ok(from_layout), Ok(to_layout)) = (cx.layout_of(start_ty.ty), cx.layout_of(end_ty.ty)) . { . let from_size = from_layout.size.bytes(); . let to_size = to_layout.size.bytes(); . if from_size != to_size . && from_size != 0 . && to_size != 0 . && msrv.meets(cx, msrvs::PTR_SLICE_RAW_PARTS) -- line 31 ---------------------------------------- -- line 58 ---------------------------------------- . format!("replace with `ptr::slice_from_raw_parts{mutbl_fn_str}`"), . sugg, . rustc_errors::Applicability::HasPlaceholders, . ); . }, . ); . } . } 549,936 ( 0.03%) } . . fn is_child_of_cast(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { 137,484 ( 0.01%) let parent = cx.tcx.parent_hir_node(expr.hir_id); 6,049,296 ( 0.28%) => ???:::parent_hir_node (68,742x) 343,490 ( 0.02%) let expr = match parent { 110 ( 0.00%) Node::Block(block) => { 330 ( 0.00%) if let Some(parent_expr) = block.expr { . parent_expr . } else { . return false; . } . }, 133,528 ( 0.01%) Node::Expr(expr) => expr, . _ => return false, . }; . 66,874 ( 0.00%) matches!(expr.kind, ExprKind::Cast(..)) . } . . /// Returns the type T of the pointed to *const [T] or *mut [T] and the mutability of the slice if . /// the type is one of those slices . fn get_raw_slice_ty_mut(ty: Ty<'_>) -> Option> { 40 ( 0.00%) match ty.kind() { . ty::RawPtr(slice_ty, mutbl) => match slice_ty.kind() { . ty::Slice(ty) => Some(TypeAndMut { ty: *ty, mutbl: *mutbl }), . _ => None, . }, . _ => None, . } . } . -- line 96 ---------------------------------------- -- line 102 ---------------------------------------- . start_ty: TypeAndMut<'tcx>, . /// The final type of the cast chain . end_ty: TypeAndMut<'tcx>, . } . . /// Returns a `CastChainInfo` with the left-most cast in the chain and the original ptr T and final . /// ptr U if the expression is composed of casts. . /// Returns None if the expr is not a Cast 549,752 ( 0.03%) fn expr_cast_chain_tys<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'tcx>) -> Option> { 68,699 ( 0.00%) if let ExprKind::Cast(cast_expr, _cast_to_hir_ty) = expr.peel_blocks().kind { 60 ( 0.00%) let cast_to = cx.typeck_results().expr_ty(expr); 800 ( 0.00%) => ???:::expr_ty (20x) . let to_slice_ty = get_raw_slice_ty_mut(cast_to)?; . . // If the expression that makes up the source of this cast is itself a cast, recursively . // call `expr_cast_chain_tys` and update the end type with the final target type. . // Otherwise, this cast is not immediately nested, just construct the info for this cast . if let Some(prev_info) = expr_cast_chain_tys(cx, cast_expr) { . Some(CastChainInfo { . end_ty: to_slice_ty, -- line 120 ---------------------------------------- -- line 125 ---------------------------------------- . let from_slice_ty = get_raw_slice_ty_mut(cast_from)?; . Some(CastChainInfo { . left_cast: cast_expr, . start_ty: from_slice_ty, . end_ty: to_slice_ty, . }) . } . } else { 68,699 ( 0.00%) None . } 549,752 ( 0.03%) } 206,180 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/mod.rs -------------------------------------------------------------------------------- Ir -- line 167 ---------------------------------------- . /// assert!(!s.is_empty()); . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_str_is_empty", since = "1.39.0")] . #[rustc_no_implicit_autorefs] . #[must_use] . #[inline] . pub const fn is_empty(&self) -> bool { 73,794 ( 0.00%) self.len() == 0 . } . . /// Converts a slice of bytes to a string slice. . /// . /// A string slice ([`&str`]) is made of bytes ([`u8`]), and a byte slice . /// ([`&[u8]`][byteslice]) is made of bytes, so this function converts between . /// the two. Not all byte slices are valid string slices, however: [`&str`] requires . /// that it is valid UTF-8. `from_utf8()` checks to ensure that the bytes are valid -- line 183 ---------------------------------------- -- line 371 ---------------------------------------- . #[stable(feature = "is_char_boundary", since = "1.9.0")] . #[rustc_const_stable(feature = "const_is_char_boundary", since = "1.86.0")] . #[inline] . pub const fn is_char_boundary(&self, index: usize) -> bool { . // 0 is always ok. . // Test for 0 explicitly so that it can optimize out the check . // easily and skip reading string data for that case. . // Note that optimizing `self.get(..index)` relies on this. 402 ( 0.00%) if index == 0 { . return true; . } . 96,002 ( 0.00%) if index >= self.len() { . // For `true` we have two options: . // . // - index == self.len() . // Empty strings are valid, so return true . // - index > self.len() . // In this case return false . // . // The check is placed exactly here, because it improves generated . // code on higher opt-levels. See PR #84751 for more details. 1 ( 0.00%) index == self.len() . } else { . self.as_bytes()[index].is_utf8_char_boundary() . } . } . . /// Finds the closest `x` not exceeding `index` where [`is_char_boundary(x)`] is `true`. . /// . /// This method can help you truncate a string so that it's still valid UTF-8, but doesn't -- line 401 ---------------------------------------- -- line 934 ---------------------------------------- . /// assert_eq!(None, s.split_at_checked(16)); // Beyond the string length . /// ``` . #[inline] . #[must_use] . #[stable(feature = "split_at_checked", since = "1.80.0")] . #[rustc_const_stable(feature = "const_str_split_at", since = "1.86.0")] . pub const fn split_at_checked(&self, mid: usize) -> Option<(&str, &str)> { . // is_char_boundary checks that the index is in [0, .len()] 47,909 ( 0.00%) if self.is_char_boundary(mid) { . // SAFETY: just checked that `mid` is on a char boundary. . Some(unsafe { self.split_at_unchecked(mid) }) . } else { . None . } . } . . /// Divides one mutable string slice into two at an index. -- line 950 ---------------------------------------- -- line 997 ---------------------------------------- . #[inline] . const unsafe fn split_at_unchecked(&self, mid: usize) -> (&str, &str) { . let len = self.len(); . let ptr = self.as_ptr(); . // SAFETY: caller guarantees `mid` is on a char boundary. . unsafe { . ( . from_utf8_unchecked(slice::from_raw_parts(ptr, mid)), 47,680 ( 0.00%) from_utf8_unchecked(slice::from_raw_parts(ptr.add(mid), len - mid)), . ) . } . } . . /// Divides one string slice into two at an index. . /// . /// # Safety . /// -- line 1013 ---------------------------------------- -- line 1375 ---------------------------------------- . /// let bananas = "bananas"; . /// . /// assert!(bananas.contains("nana")); . /// assert!(!bananas.contains("apples")); . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[inline] . pub fn contains(&self, pat: P) -> bool { 46 ( 0.00%) pat.is_contained_in(self) 509 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/pattern.rs:<&str as core::str::pattern::Pattern>::is_contained_in (2x) . } . . /// Returns `true` if the given pattern matches a prefix of this . /// string slice. . /// . /// Returns `false` if it does not. . /// . /// The [pattern] can be a `&str`, in which case this function will return true if -- line 1391 ---------------------------------------- -- line 1489 ---------------------------------------- . /// let s = "Löwe 老虎 Léopard"; . /// let x: &[_] = &['1', '2']; . /// . /// assert_eq!(s.find(x), None); . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[inline] . pub fn find(&self, pat: P) -> Option { 16,200 ( 0.00%) pat.into_searcher(self).next_match().map(|(i, _)| i) 896,725 ( 0.04%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/pattern.rs:::next_match (5,400x) . } . . /// Returns the byte index for the first character of the last match of the pattern in . /// this string slice. . /// . /// Returns [`None`] if the pattern doesn't match. . /// . /// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a -- line 1505 ---------------------------------------- -- line 1663 ---------------------------------------- . /// ``` . /// . /// Use [`split_whitespace`] for this behavior. . /// . /// [`split_whitespace`]: str::split_whitespace . #[stable(feature = "rust1", since = "1.0.0")] . #[inline] . pub fn split(&self, pat: P) -> Split<'_, P> { 324 ( 0.00%) Split(SplitInternal { . start: 0, . end: self.len(), . matcher: pat.into_searcher(self), . allow_trailing_empty: true, . finished: false, . }) . } . -- line 1679 ---------------------------------------- -- line 1762 ---------------------------------------- . /// assert_eq!(v, ["ghi", "def", "abc"]); . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[inline] . pub fn rsplit(&self, pat: P) -> RSplit<'_, P> . where . for<'a> P::Searcher<'a>: ReverseSearcher<'a>, . { 387,187 ( 0.02%) RSplit(self.split(pat).0) . } . . /// Returns an iterator over substrings of the given string slice, separated . /// by characters matched by a pattern. . /// . /// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a . /// function or closure that determines if a character matches. . /// -- line 1778 ---------------------------------------- -- line 1977 ---------------------------------------- . /// ``` . /// assert_eq!("cfg".split_once('='), None); . /// assert_eq!("cfg=".split_once('='), Some(("cfg", ""))); . /// assert_eq!("cfg=foo".split_once('='), Some(("cfg", "foo"))); . /// assert_eq!("cfg=foo=bar".split_once('='), Some(("cfg", "foo=bar"))); . /// ``` . #[stable(feature = "str_split_once", since = "1.52.0")] . #[inline] 192 ( 0.00%) pub fn split_once(&self, delimiter: P) -> Option<(&'_ str, &'_ str)> { 117 ( 0.00%) let (start, end) = delimiter.into_searcher(self).next_match()?; 4,121 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/pattern.rs:::next_match (33x) . // SAFETY: `Searcher` is known to return valid indices. 27 ( 0.00%) unsafe { Some((self.get_unchecked(..start), self.get_unchecked(end..))) } 127 ( 0.00%) } . . /// Splits the string on the last occurrence of the specified delimiter and . /// returns prefix before delimiter and suffix after delimiter. . /// . /// # Examples . /// . /// ``` . /// assert_eq!("cfg".rsplit_once('='), None); -- line 1997 ---------------------------------------- -- line 2179 ---------------------------------------- . /// assert_eq!("Hello\tworld", s.trim()); . /// ``` . #[inline] . #[must_use = "this returns the trimmed string as a slice, \ . without modifying the original"] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_diagnostic_item = "str_trim"] . pub fn trim(&self) -> &str { 143,500 ( 0.01%) self.trim_matches(char::is_whitespace) 22,511 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/mod.rs:::trim_matches::<::is_whitespace> (498x) . } . . /// Returns a string slice with leading whitespace removed. . /// . /// 'Whitespace' is defined according to the terms of the Unicode Derived . /// Core Property `White_Space`, which includes newlines. . /// . /// # Text directionality -- line 2195 ---------------------------------------- -- line 2218 ---------------------------------------- . /// assert!(Some('ע') == s.trim_start().chars().next()); . /// ``` . #[inline] . #[must_use = "this returns the trimmed string as a new slice, \ . without modifying the original"] . #[stable(feature = "trim_direction", since = "1.30.0")] . #[rustc_diagnostic_item = "str_trim_start"] . pub fn trim_start(&self) -> &str { 50,311 ( 0.00%) self.trim_start_matches(char::is_whitespace) 424,148 ( 0.02%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/mod.rs:::trim_start_matches::<::is_whitespace> (2,716x) . } . . /// Returns a string slice with trailing whitespace removed. . /// . /// 'Whitespace' is defined according to the terms of the Unicode Derived . /// Core Property `White_Space`, which includes newlines. . /// . /// # Text directionality -- line 2234 ---------------------------------------- -- line 2369 ---------------------------------------- . /// A more complex pattern, using a closure: . /// . /// ``` . /// assert_eq!("1foo1barXX".trim_matches(|c| c == '1' || c == 'X'), "foo1bar"); . /// ``` . #[must_use = "this returns the trimmed string as a new slice, \ . without modifying the original"] . #[stable(feature = "rust1", since = "1.0.0")] 214,962 ( 0.01%) pub fn trim_matches(&self, pat: P) -> &str . where . for<'a> P::Searcher<'a>: DoubleEndedSearcher<'a>, . { . let mut i = 0; . let mut j = 0; . let mut matcher = pat.into_searcher(self); . if let Some((a, b)) = matcher.next_reject() { . i = a; -- line 2385 ---------------------------------------- -- line 2386 ---------------------------------------- . j = b; // Remember earliest known match, correct it below if . // last match is different . } . if let Some((_, b)) = matcher.next_reject_back() { . j = b; . } . // SAFETY: `Searcher` is known to return valid indices. . unsafe { self.get_unchecked(i..j) } 214,962 ( 0.01%) } . . /// Returns a string slice with all prefixes that match a pattern . /// repeatedly removed. . /// . /// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a . /// function or closure that determines if a character matches. . /// . /// [`char`]: prim@char -- line 2402 ---------------------------------------- -- line 2416 ---------------------------------------- . /// assert_eq!("123foo1bar123".trim_start_matches(char::is_numeric), "foo1bar123"); . /// . /// let x: &[_] = &['1', '2']; . /// assert_eq!("12foo1bar12".trim_start_matches(x), "foo1bar12"); . /// ``` . #[must_use = "this returns the trimmed string as a new slice, \ . without modifying the original"] . #[stable(feature = "trim_direction", since = "1.30.0")] 100,680 ( 0.00%) pub fn trim_start_matches(&self, pat: P) -> &str { . let mut i = self.len(); . let mut matcher = pat.into_searcher(self); . if let Some((a, _)) = matcher.next_reject() { . i = a; . } . // SAFETY: `Searcher` is known to return valid indices. . unsafe { self.get_unchecked(i..self.len()) } 50,340 ( 0.00%) } . . /// Returns a string slice with the prefix removed. . /// . /// If the string starts with the pattern `prefix`, returns the substring after the prefix, . /// wrapped in `Some`. Unlike [`trim_start_matches`], this method removes the prefix exactly once. . /// . /// If the string does not start with `prefix`, returns `None`. . /// -- line 2440 ---------------------------------------- -- line 2635 ---------------------------------------- . /// A more complex pattern, using a closure: . /// . /// ``` . /// assert_eq!("1fooX".trim_end_matches(|c| c == '1' || c == 'X'), "1foo"); . /// ``` . #[must_use = "this returns the trimmed string as a new slice, \ . without modifying the original"] . #[stable(feature = "trim_direction", since = "1.30.0")] 26 ( 0.00%) pub fn trim_end_matches(&self, pat: P) -> &str . where . for<'a> P::Searcher<'a>: ReverseSearcher<'a>, . { . let mut j = 0; . let mut matcher = pat.into_searcher(self); . if let Some((_, b)) = matcher.next_reject_back() { . j = b; . } . // SAFETY: `Searcher` is known to return valid indices. . unsafe { self.get_unchecked(0..j) } 26 ( 0.00%) } . . /// Returns a string slice with all prefixes that match a pattern . /// repeatedly removed. . /// . /// The [pattern] can be a `&str`, [`char`], a slice of [`char`]s, or a . /// function or closure that determines if a character matches. . /// . /// [`char`]: prim@char -- line 2662 ---------------------------------------- -- line 3316 ---------------------------------------- . unsafe { from_utf8_unchecked_mut(&mut []) } . } . } . . impl_fn_for_zst! { . /// A nameable, cloneable fn type . #[derive(Clone)] . struct LinesMap impl<'a> Fn = |line: &'a str| -> &'a str { 2,920 ( 0.00%) let Some(line) = line.strip_suffix('\n') else { return line }; . let Some(line) = line.strip_suffix('\r') else { return line }; . line . }; . . #[derive(Clone)] . struct CharEscapeDebugContinue impl Fn = |c: char| -> char::EscapeDebug { . c.escape_debug_ext(EscapeDebugExtArgs { . escape_grapheme_extender: false, -- line 3332 ---------------------------------------- 149,591 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/casts/ptr_cast_constness.rs -------------------------------------------------------------------------------- Ir -- line 5 ---------------------------------------- . use clippy_utils::{std_or_core, sym}; . use rustc_errors::Applicability; . use rustc_hir::{self as hir, Expr, ExprKind, QPath}; . use rustc_lint::LateContext; . use rustc_middle::ty::{self, Ty, TypeVisitableExt as _}; . . use super::PTR_CAST_CONSTNESS; . 140 ( 0.00%) pub(super) fn check<'tcx>( . cx: &LateContext<'_>, . expr: &Expr<'_>, . cast_from_expr: &Expr<'_>, . cast_from: Ty<'tcx>, . cast_to: Ty<'tcx>, . msrv: Msrv, . ) { 40 ( 0.00%) if let ty::RawPtr(from_ty, from_mutbl) = cast_from.kind() . && let ty::RawPtr(to_ty, to_mutbl) = cast_to.kind() . && from_mutbl != to_mutbl . && from_ty == to_ty . && !from_ty.has_erased_regions() . { . if let ExprKind::Call(func, []) = cast_from_expr.kind . && let ExprKind::Path(QPath::Resolved(None, path)) = func.kind . && let Some(defid) = path.res.opt_def_id() -- line 29 ---------------------------------------- -- line 69 ---------------------------------------- . expr.span, . "`as` casting between raw pointers while changing only its constness", . format!("try `pointer::cast_{constness}`, a safer alternative"), . format!("{}.cast_{constness}()", sugg.maybe_paren()), . app, . ); . } . } 160 ( 0.00%) } . 412,452 ( 0.02%) pub(super) fn check_null_ptr_cast_method(cx: &LateContext<'_>, expr: &Expr<'_>) { 137,782 ( 0.01%) if let ExprKind::MethodCall(method, cast_from_expr, [], _) = expr.kind 170 ( 0.00%) && let ExprKind::Call(func, []) = cast_from_expr.kind . && let ExprKind::Path(QPath::Resolved(None, path)) = func.kind . && let Some(defid) = path.res.opt_def_id() . && let method = match (cx.tcx.get_diagnostic_name(defid), method.ident.name) { . (Some(sym::ptr_null), sym::cast_mut) => "null_mut", . (Some(sym::ptr_null_mut), sym::cast_const) => "null", . _ => return, . } . && let Some(prefix) = std_or_core(cx) -- line 89 ---------------------------------------- -- line 97 ---------------------------------------- . PTR_CAST_CONSTNESS, . expr.span, . "changing constness of a null pointer", . format!("use `{method}()` directly instead"), . format!("{prefix}::ptr::{method}::<{after_lt}"), . app, . ); . } 481,194 ( 0.02%) } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/mem_replace.rs -------------------------------------------------------------------------------- Ir -- line 292 ---------------------------------------- . . impl MemReplace { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl<'tcx> LateLintPass<'tcx> for MemReplace { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 137,892 ( 0.01%) if let ExprKind::Call(func, [dest, src]) = expr.kind . // Check that `expr` is a call to `mem::replace()` 30 ( 0.00%) && let ExprKind::Path(ref func_qpath) = func.kind 40 ( 0.00%) && let Some(def_id) = cx.qpath_res(func_qpath, func.hir_id).opt_def_id() 285 ( 0.00%) => ???:::qpath_res (10x) 60 ( 0.00%) && cx.tcx.is_diagnostic_item(sym::mem_replace, def_id) 486 ( 0.00%) => ???:::is_diagnostic_item (10x) . // Check that second argument is `Option::None` . && !check_replace_option_with_none(cx, src, dest, expr.span) . && !check_replace_option_with_some(cx, src, dest, expr.span, self.msrv) . && !check_replace_with_default(cx, src, dest, expr, self.msrv) . { . check_replace_with_uninit(cx, src, dest, expr.span); . } 549,936 ( 0.03%) } . } 40 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/map.rs -------------------------------------------------------------------------------- Ir -- line 61 ---------------------------------------- . pub struct Map { . // Used for `SplitWhitespace` and `SplitAsciiWhitespace` `as_str` methods . pub(crate) iter: I, . f: F, . } . . impl Map { . pub(in crate::iter) const fn new(iter: I, f: F) -> Map { 466,599 ( 0.02%) Map { iter, f } . } . . pub(crate) fn into_inner(self) -> I { . self.iter . } . } . . #[stable(feature = "core_impl_debug", since = "1.9.0")] -- line 77 ---------------------------------------- -- line 80 ---------------------------------------- . f.debug_struct("Map").field("iter", &self.iter).finish() . } . } . . fn map_fold( . mut f: impl FnMut(T) -> B, . mut g: impl FnMut(Acc, B) -> Acc, . ) -> impl FnMut(Acc, T) -> Acc { 97 ( 0.00%) move |acc, elt| g(acc, f(elt)) . } . . fn map_try_fold<'a, T, B, Acc, R>( . f: &'a mut impl FnMut(T) -> B, . mut g: impl FnMut(Acc, B) -> R + 'a, . ) -> impl FnMut(Acc, T) -> R + 'a { 274 ( 0.00%) move |acc, elt| g(acc, f(elt)) 160 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/function.rs:<&mut &mut core::iter::adapters::map::map_try_fold, core::option::Option<(rustc_middle::ty::Ty, clippy_lints::loops::manual_memcpy::IndexExpr, clippy_lints::loops::manual_memcpy::IndexExpr)>, (), core::ops::control_flow::ControlFlow>, clippy_lints::loops::manual_memcpy::check::{closure#0}, core::iter::adapters::map::map_try_fold, core::option::Option, (), core::ops::control_flow::ControlFlow>, clippy_lints::loops::manual_memcpy::check::{closure#1}, , clippy_lints::loops::manual_memcpy::get_assignments::{closure#0}>, core::option::IntoIter<&rustc_hir::hir::Expr>>, clippy_lints::loops::manual_memcpy::get_assignments::{closure#1}>, clippy_lints::loops::manual_memcpy::get_assignment>>>, core::option::IntoIter>>, clippy_lints::loops::manual_memcpy::check::{closure#0}>, clippy_lints::loops::manual_memcpy::check::{closure#1}>, core::option::Option> as core::iter::traits::iterator::Iterator>::try_fold<(), core::iter::traits::iterator::Iterator::try_for_each::call, core::ops::control_flow::ControlFlow::Break>::{closure#0}, core::ops::control_flow::ControlFlow>::{closure#0}>::{closure#0}>::{closure#0} as core::ops::function::FnMut<((), core::option::Option<(&rustc_hir::hir::Expr, &rustc_hir::hir::Expr)>)>>::call_mut (1x) . } . . #[stable(feature = "rust1", since = "1.0.0")] . impl Iterator for Map . where . F: FnMut(I::Item) -> B, . { . type Item = B; . . #[inline] 1,227 ( 0.00%) fn next(&mut self) -> Option { 1,511 ( 0.00%) self.iter.next().map(&mut self.f) 7,552 ( 0.00%) => ???:::next (118x) 1,014 ( 0.00%) } . . #[inline] . fn size_hint(&self) -> (usize, Option) { . self.iter.size_hint() . } . 687,420 ( 0.03%) fn try_fold(&mut self, init: Acc, g: G) -> R . where . Self: Sized, . G: FnMut(Acc, Self::Item) -> R, . R: Try, . { 5 ( 0.00%) self.iter.try_fold(init, map_try_fold(&mut self.f, g)) 276 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/chain.rs:, clippy_lints::loops::manual_memcpy::get_assignments::{closure#0}>, core::option::IntoIter<&rustc_hir::hir::Expr>>, clippy_lints::loops::manual_memcpy::get_assignments::{closure#1}>, clippy_lints::loops::manual_memcpy::get_assignment>>>, core::option::IntoIter>> as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::adapters::map::map_try_fold, core::option::Option<(rustc_middle::ty::Ty, clippy_lints::loops::manual_memcpy::IndexExpr, clippy_lints::loops::manual_memcpy::IndexExpr)>, (), core::ops::control_flow::ControlFlow>, clippy_lints::loops::manual_memcpy::check::{closure#0}, core::iter::adapters::map::map_try_fold, core::option::Option, (), core::ops::control_flow::ControlFlow>, clippy_lints::loops::manual_memcpy::check::{closure#1}, , clippy_lints::loops::manual_memcpy::get_assignments::{closure#0}>, core::option::IntoIter<&rustc_hir::hir::Expr>>, clippy_lints::loops::manual_memcpy::get_assignments::{closure#1}>, clippy_lints::loops::manual_memcpy::get_assignment>>>, core::option::IntoIter>>, clippy_lints::loops::manual_memcpy::check::{closure#0}>, clippy_lints::loops::manual_memcpy::check::{closure#1}>, core::option::Option> as core::iter::traits::iterator::Iterator>::try_fold<(), core::iter::traits::iterator::Iterator::try_for_each::call, core::ops::control_flow::ControlFlow::Break>::{closure#0}, core::ops::control_flow::ControlFlow>::{closure#0}>::{closure#0}>::{closure#0}, core::ops::control_flow::ControlFlow>> (1x) 549,936 ( 0.03%) } . 2,084 ( 0.00%) fn fold(self, init: Acc, g: G) -> Acc . where . G: FnMut(Acc, Self::Item) -> Acc, . { 19 ( 0.00%) self.iter.fold(init, map_fold(self.f, g)) 1,912 ( 0.00%) } . . #[inline] . unsafe fn __iterator_get_unchecked(&mut self, idx: usize) -> B . where . Self: TrustedRandomAccessNoCoerce, . { . // SAFETY: the caller must uphold the contract for . // `Iterator::__iterator_get_unchecked`. -- line 137 ---------------------------------------- 582 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs -------------------------------------------------------------------------------- Ir -- line 114 ---------------------------------------- . #[stable(feature = "global_alloc", since = "1.28.0")] . #[must_use = "losing the pointer will leak memory"] . #[inline] . #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces . pub unsafe fn alloc(layout: Layout) -> *mut u8 { . unsafe { . // Make sure we don't accidentally allow omitting the allocator shim in . // stable code until it is actually stabilized. 4,213 ( 0.00%) __rust_no_alloc_shim_is_unstable_v2(); 2 ( 0.00%) => ???:std::exception::~exception() (2x) . 144,683 ( 0.01%) __rust_alloc(layout.size(), layout.alignment()) 76 ( 0.00%) => ???:__rustc::__rust_alloc (2x) . } . } . . /// Deallocates memory with the global allocator. . /// . /// This function forwards calls to the [`GlobalAlloc::dealloc`] method . /// of the allocator registered with the `#[global_allocator]` attribute . /// if there is one, or the `std` crate’s default. -- line 132 ---------------------------------------- -- line 161 ---------------------------------------- . pub unsafe fn dealloc(ptr: *mut u8, layout: Layout) { . unsafe { dealloc_nonnull(NonNull::new_unchecked(ptr), layout) } . } . . /// Same as [`dealloc`] but when you already have a non-null pointer . #[inline] . #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces . unsafe fn dealloc_nonnull(ptr: NonNull, layout: Layout) { 273,481 ( 0.01%) unsafe { __rust_dealloc(ptr, layout.size(), layout.alignment()) } 1,900 ( 0.00%) => ???:__rustc::__rdl_dealloc (50x) . } . . /// Reallocates memory with the global allocator. . /// . /// This function forwards calls to the [`GlobalAlloc::realloc`] method . /// of the allocator registered with the `#[global_allocator]` attribute . /// if there is one, or the `std` crate’s default. . /// -- line 177 ---------------------------------------- -- line 214 ---------------------------------------- . pub unsafe fn realloc(ptr: *mut u8, layout: Layout, new_size: usize) -> *mut u8 { . unsafe { realloc_nonnull(NonNull::new_unchecked(ptr), layout, new_size) } . } . . /// Same as [`realloc`] but when you already have a non-null pointer . #[inline] . #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces . unsafe fn realloc_nonnull(ptr: NonNull, layout: Layout, new_size: usize) -> *mut u8 { 1,208 ( 0.00%) unsafe { __rust_realloc(ptr, layout.size(), layout.alignment(), new_size) } 6,537 ( 0.00%) => ???:__rustc::__rust_realloc (27x) . } . . /// Allocates zero-initialized memory with the global allocator. . /// . /// This function forwards calls to the [`GlobalAlloc::alloc_zeroed`] method . /// of the allocator registered with the `#[global_allocator]` attribute . /// if there is one, or the `std` crate’s default. . /// -- line 230 ---------------------------------------- -- line 284 ---------------------------------------- . __rust_alloc_zeroed(layout.size(), layout.alignment()) . } . } . . impl Global { . #[inline] . #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces . fn alloc_impl_runtime(layout: Layout, zeroed: bool) -> Result, AllocError> { 916 ( 0.00%) match layout.size() { . 0 => Ok(layout.dangling_ptr().cast_slice(0)), . // SAFETY: `layout` is non-zero in size, . size => unsafe { 465 ( 0.00%) let raw_ptr = if zeroed { alloc_zeroed(layout) } else { alloc(layout) }; 4 ( 0.00%) => ???:std::exception::~exception() (4x) . let ptr = NonNull::new(raw_ptr).ok_or(AllocError)?; . Ok(ptr.cast_slice(size)) . }, . } . } . . #[inline] . #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces . fn deallocate_impl_runtime(ptr: NonNull, layout: Layout) { 39,492 ( 0.00%) if layout.size() != 0 { . // SAFETY: . // * We have checked that `layout` is non-zero in size. . // * The caller is obligated to provide a layout that "fits", and in this case, . // "fit" always means a layout that is equal to the original, because our . // `allocate()`, `grow()`, and `shrink()` implementations never returns a larger . // allocation than requested. . // * Other conditions must be upheld by the caller, as per `Allocator::deallocate()`'s . // safety documentation. -- line 314 ---------------------------------------- 5,126 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/hygiene.rs -------------------------------------------------------------------------------- Ir -- line 45 ---------------------------------------- . use crate::edition::Edition; . use crate::source_map::SourceMap; . use crate::symbol::{Symbol, kw, sym}; . use crate::{DUMMY_SP, Span, SpanDecoder, SpanEncoder, with_session_globals}; . . /// A `SyntaxContext` represents a chain of pairs `(ExpnId, Transparency)` named "marks". . /// . /// See for more explanation. 72,813 ( 0.00%) #[derive(Clone, Copy, PartialEq, Eq, Hash)] . pub struct SyntaxContext(u32); . . // To ensure correctness of incremental compilation, . // `SyntaxContext` must not implement `Ord` or `PartialOrd`. . // See https://github.com/rust-lang/rust/issues/90317. . impl !Ord for SyntaxContext {} . impl !PartialOrd for SyntaxContext {} . -- line 61 ---------------------------------------- -- line 98 ---------------------------------------- . . rustc_index::newtype_index! { . /// A unique ID associated with a macro invocation and expansion. . #[orderable] . pub struct ExpnIndex {} . } . . /// A unique ID associated with a macro invocation and expansion. 1,525 ( 0.00%) #[derive(Clone, Copy, PartialEq, Eq, Hash)] . pub struct ExpnId { . pub krate: CrateNum, . pub local_id: ExpnIndex, . } . . impl fmt::Debug for ExpnId { . fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { . // Generate crate_::{{expn_}}. -- line 114 ---------------------------------------- -- line 286 ---------------------------------------- . #[inline] . #[track_caller] . pub fn expect_local(self) -> LocalExpnId { . self.as_local().unwrap() . } . . #[inline] . pub fn expn_data(self) -> ExpnData { 647 ( 0.00%) HygieneData::with(|data| data.expn_data(self).clone()) 9,705 ( 0.00%) => ???:::expn_data (647x) . } . . #[inline] . pub fn is_descendant_of(self, ancestor: ExpnId) -> bool { . // a few "fast path" cases to avoid locking HygieneData 118 ( 0.00%) if ancestor == ExpnId::root() || ancestor == self { . return true; . } . if ancestor.krate != self.krate { . return false; . } . HygieneData::with(|data| data.is_descendant_of(self, ancestor)) . } . -- line 308 ---------------------------------------- -- line 385 ---------------------------------------- . syntax_context_data: vec![root_ctxt_data], . syntax_context_map: iter::once((root_ctxt_data.key(), SyntaxContext(0))).collect(), . expn_data_disambiguators: UnhashMap::default(), . } . } . . #[inline] . fn with(f: impl FnOnce(&mut HygieneData) -> R) -> R { 2,848 ( 0.00%) with_session_globals(|session_globals| f(&mut session_globals.hygiene_data.borrow_mut())) . } . . #[inline] . fn expn_hash(&self, expn_id: ExpnId) -> ExpnHash { . match expn_id.as_local() { . Some(expn_id) => self.local_expn_hashes[expn_id], . None => self.foreign_expn_hashes[&expn_id], . } -- line 401 ---------------------------------------- -- line 441 ---------------------------------------- . #[inline] . fn normalize_to_macro_rules(&self, ctxt: SyntaxContext) -> SyntaxContext { . self.syntax_context_data[ctxt.0 as usize].opaque_and_semiopaque . } . . /// See [`SyntaxContextData::outer_expn`] . #[inline] . fn outer_expn(&self, ctxt: SyntaxContext) -> ExpnId { 2,412 ( 0.00%) self.syntax_context_data[ctxt.0 as usize].outer_expn . } . . /// The last macro expansion and its Transparency . #[inline] . fn outer_mark(&self, ctxt: SyntaxContext) -> (ExpnId, Transparency) { . let data = &self.syntax_context_data[ctxt.0 as usize]; . (data.outer_expn, data.outer_transparency) . } -- line 457 ---------------------------------------- -- line 698 ---------------------------------------- . impl SyntaxContext { . #[inline] . pub const fn root() -> Self { . SyntaxContext(0) . } . . #[inline] . pub const fn is_root(self) -> bool { 619,620 ( 0.03%) self.0 == SyntaxContext::root().as_u32() . } . . #[inline] . pub(crate) const fn as_u32(self) -> u32 { . self.0 . } . . #[inline] -- line 714 ---------------------------------------- -- line 904 ---------------------------------------- . pub fn outer_expn(self) -> ExpnId { . HygieneData::with(|data| data.outer_expn(self)) . } . . /// `ctxt.outer_expn_data()` is equivalent to but faster than . /// `ctxt.outer_expn().expn_data()`. . #[inline] . pub fn outer_expn_data(self) -> ExpnData { 211 ( 0.00%) HygieneData::with(|data| data.expn_data(data.outer_expn(self)).clone()) 3,165 ( 0.00%) => ???:::expn_data (211x) . } . . /// See [`HygieneData::outer_mark`] . #[inline] . fn outer_mark(self) -> (ExpnId, Transparency) { . HygieneData::with(|data| data.outer_mark(self)) . } . -- line 920 ---------------------------------------- -- line 975 ---------------------------------------- . }; . let expn_id = LocalExpnId::fresh(expn_data, hcx); . self.apply_mark(expn_id.to_expn_id(), Transparency::Transparent) . } . } . . /// A subset of properties from both macro definition and macro call available through global data. . /// Avoid using this if you have access to the original definition or call structures. 10,296 ( 0.00%) #[derive(Clone, Debug, Encodable, Decodable, StableHash)] . pub struct ExpnData { . // --- The part unique to each expansion. . pub kind: ExpnKind, . /// The expansion that contains the definition of the macro for this expansion. . pub parent: ExpnId, . /// The span of the macro call which produced this expansion. . /// . /// This span will typically have a different `ExpnData` and `call_site`. -- line 991 ---------------------------------------- -- line 1003 ---------------------------------------- . /// that have identical `ExpnData`s. This violates the contract of `StableHash` . /// - the two `ExpnId`s are not equal, but their `Fingerprint`s are equal . /// (since the numerical `ExpnId` value is not considered by the `StableHash` . /// implementation). . /// . /// The `disambiguator` field is set by `update_disambiguator` when two distinct . /// `ExpnId`s would end up with the same `Fingerprint`. Since `ExpnData` includes . /// a `krate` field, this value only needs to be unique within a single crate. 858 ( 0.00%) disambiguator: u32, . . // --- The part specific to the macro/desugaring definition. . // --- It may be reasonable to share this part between expansions with the same definition, . // --- but such sharing is known to bring some minor inconveniences without also bringing . // --- noticeable perf improvements (PR #62898). . /// The span of the macro definition (possibly dummy). . /// This span serves only informational purpose and is not used for resolution. . pub def_site: Span, -- line 1019 ---------------------------------------- -- line 1024 ---------------------------------------- . /// Edition of the crate in which the macro is defined. . pub edition: Edition, . /// The `DefId` of the macro being invoked, . /// if this `ExpnData` corresponds to a macro invocation . pub macro_def_id: Option, . /// The normal module (`mod`) in which the expanded macro was defined. . pub parent_module: Option, . /// Suppresses the `unsafe_code` lint for code produced by this macro. 858 ( 0.00%) pub(crate) allow_internal_unsafe: bool, . /// Enables the macro helper hack (`ident!(...)` -> `$crate::ident!(...)`) for this macro. . pub local_inner_macros: bool, . /// Should debuginfo for the macro be collapsed to the outermost expansion site (in other . /// words, was the macro definition annotated with `#[collapse_debuginfo]`)? . pub(crate) collapse_debuginfo: bool, . /// When true, we prevent diagnostics pointing into this macro, if it is one, and we do not . /// display the note telling people to use the `-Zmacro-backtrace` flag. . pub diagnostic_opaque: bool, -- line 1040 ---------------------------------------- -- line 1123 ---------------------------------------- . fn hash_expn(&self, hcx: &mut impl StableHashCtxt) -> Hash64 { . let mut hasher = StableHasher::new(); . self.stable_hash(hcx, &mut hasher); . hasher.finish() . } . } . . /// Expansion kind. 858 ( 0.00%) #[derive(Clone, Debug, PartialEq, Encodable, Decodable, StableHash)] . pub enum ExpnKind { . /// No expansion, aka root expansion. Only `ExpnId::root()` has this kind. . Root, . /// Expansion produced by a macro. . Macro(MacroKind, Symbol), . /// Transform done by the compiler on the AST. . AstPass(AstPass), . /// Desugaring done by the compiler during AST lowering. -- line 1139 ---------------------------------------- 1,377 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/permissions_set_readonly_false.rs -------------------------------------------------------------------------------- Ir -- line 27 ---------------------------------------- . "Checks for calls to `std::fs::Permissions.set_readonly` with argument `false`" . } . . declare_lint_pass!(PermissionsSetReadonlyFalse => [ . PERMISSIONS_SET_READONLY_FALSE, . ]); . . impl<'tcx> LateLintPass<'tcx> for PermissionsSetReadonlyFalse { 206,226 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 137,736 ( 0.01%) if let ExprKind::MethodCall(path, receiver, [arg], _) = &expr.kind 64 ( 0.00%) && let ExprKind::Lit(lit) = &arg.kind 21 ( 0.00%) && LitKind::Bool(false) == lit.node 15 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/ast.rs:::eq (3x) . && path.ident.name == sym::set_readonly . && cx . .typeck_results() . .expr_ty(receiver) . .is_diag_item(cx, sym::FsPermissions) . { . span_lint_and_then( . cx, -- line 46 ---------------------------------------- -- line 51 ---------------------------------------- . diag.note("on Unix platforms this results in the file being world writable"); . diag.help( . "you can set the desired permissions using `PermissionsExt`. For more information, see\n\ . https://doc.rust-lang.org/std/os/unix/fs/trait.PermissionsExt.html", . ); . }, . ); . } 274,968 ( 0.01%) } . } 3 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs -------------------------------------------------------------------------------- Ir -- line 16 ---------------------------------------- . pub struct Gated

{ . pub(crate) active: bool, . pub(crate) pass: P, . } . . impl Gated

{ . #[inline] . pub fn new bool>(is_active: &F, pass: P) -> Self { 70 ( 0.00%) let active = is_active(&pass.get_lints()); 368 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint_defs/src/lib.rs:::get_lints (1x) 361 ( 0.00%) Gated { active, pass } 90 ( 0.00%) => ???:0x0000000000173dc0 (3x) . } . } . . /// Run one field's `check_*`, if that field is active. . /// . /// Fully qualified through [`rustc_lint::LateLintPass`] since some passes impl . /// both `EarlyLintPass` and `LateLintPass` with like-named methods, which would . /// be ambiguous on the concrete field type. The args arrive as one `tt` and are . /// re-parsed here so the per-field and per-argument repetitions never share a . /// nesting level. . #[macro_export] . macro_rules! run_combined_late_lint_pass_field { . ($self:ident, $field:ident, $name:ident, ($($arg:expr),* $(,)?)) => { 32,233,056 ( 1.50%) if $self.$field.active { 28,748,786 ( 1.34%) rustc_lint::LateLintPass::$name(&mut $self.$field.pass, $($arg),*); 398 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/collections/btree/map.rs:::check_crate_post (1x) 102 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/useless_vec.rs:::check_crate_post (1x) 26 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/manual_non_exhaustive.rs:::check_crate_post (1x) . } . }; . } . . /// Forward one `check_*` method to every field of the combined pass. . #[macro_export] . macro_rules! expand_combined_late_lint_pass_method { . ([$($field:ident),*], $self:ident, $name:ident, $args:tt) => ({ -- line 48 ---------------------------------------- -- line 50 ---------------------------------------- . }) . } . . /// Generate the combined `LateLintPass` impl's `check_*` methods, one per method . /// in rustc's late-pass method list. . #[macro_export] . macro_rules! expand_combined_late_lint_pass_methods { . ($fields:tt, [$($(#[$attr:meta])* fn $name:ident($($param:ident: $arg:ty),*);)*]) => ( 1,804,190 ( 0.08%) $(#[inline(always)] fn $name(&mut self, cx: &rustc_lint::LateContext<'tcx>, $($param: $arg),*) { . $crate::expand_combined_late_lint_pass_method!($fields, self, $name, (cx, $($param),*)); 882,874 ( 0.04%) })* . ) . } . . /// Declare the combined struct (one [`Gated`] field per pass) plus its . /// `LintPass`/`LateLintPass` impls. The method list comes from . /// `rustc_lint::late_lint_methods!` so it can't drift from rustc's. . /// . /// Each entry is `Field: Type = constructor`; `new`'s params (`tcx`, `conf`, ...) -- line 68 ---------------------------------------- -- line 74 ---------------------------------------- . $methods:tt . ) => { . #[allow(non_snake_case)] . pub struct $name<'tcx> { . $($field: $crate::combined_late_pass::Gated<$fty>,)* . } . . impl<'tcx> $name<'tcx> { 17 ( 0.00%) pub fn new bool>($($pname: $pty,)* is_active: &F) -> Self { 55 ( 0.00%) Self { 9 ( 0.00%) $($field: $crate::combined_late_pass::Gated::new(is_active, $ctor),)* . } 8 ( 0.00%) } . } . . #[allow(rustc::lint_pass_impl_without_macro)] . impl<'tcx> rustc_lint::LintPass for $name<'tcx> { . fn name(&self) -> &'static str { . stringify!($name) . } 10 ( 0.00%) fn get_lints(&self) -> rustc_lint::LintVec { 1 ( 0.00%) => ???:std::exception::~exception() (1x) . // Reserve at least one slot per pass up front to skip the early reallocations. . let mut lints = Vec::with_capacity([$(stringify!($field)),*].len()); 3 ( 0.00%) $(lints.extend(self.$field.pass.get_lints());)* 725 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint_defs/src/lib.rs:::get_lints (1x) 3 ( 0.00%) lints 9 ( 0.00%) } . } . . impl<'tcx> rustc_lint::LateLintPass<'tcx> for $name<'tcx> { . $crate::expand_combined_late_lint_pass_methods!([$($field),*], $methods); . } . }; . } 482,514 ( 0.02%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/rc_clone_in_vec_init.rs -------------------------------------------------------------------------------- Ir -- line 44 ---------------------------------------- . pub RC_CLONE_IN_VEC_INIT, . suspicious, . "initializing reference-counted pointer in `vec![elem; len]`" . } . . declare_lint_pass!(RcCloneInVecInit => [RC_CLONE_IN_VEC_INIT]); . . impl LateLintPass<'_> for RcCloneInVecInit { 618,678 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { . let Some(macro_call) = root_macro_call_first_node(cx, expr) else { . return; . }; . let Some(VecArgs::Repeat(elem, len)) = VecArgs::hir(cx, expr) else { . return; . }; . let Some((symbol, func_span)) = ref_init(cx, elem) else { . return; . }; . . emit_lint(cx, symbol, macro_call.span, elem, len, func_span); 549,936 ( 0.03%) } . } . . fn loop_init_suggestion(elem: &str, len: &str, indent: &str) -> String { . format!( . r"{{ . {indent} let mut v = Vec::with_capacity({len}); . {indent} (0..{len}).for_each(|_| v.push({elem})); . {indent} v -- line 72 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/mod.rs -------------------------------------------------------------------------------- Ir -- line 621 ---------------------------------------- . /// assert!(ascii.is_ascii()); . /// assert!(!non_ascii.is_ascii()); . /// ``` . #[must_use] . #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] . #[rustc_const_stable(feature = "const_u8_is_ascii", since = "1.43.0")] . #[inline] . pub const fn is_ascii(&self) -> bool { 26,718 ( 0.00%) *self <= 127 . } . . /// If the value of this byte is within the ASCII range, returns it as an . /// [ASCII character](ascii::Char). Otherwise, returns `None`. . #[must_use] . #[unstable(feature = "ascii_char", issue = "110998")] . #[inline] . pub const fn as_ascii(&self) -> Option { -- line 637 ---------------------------------------- -- line 847 ---------------------------------------- . /// assert!(!lf.is_ascii_uppercase()); . /// assert!(!esc.is_ascii_uppercase()); . /// ``` . #[must_use] . #[stable(feature = "ascii_ctype_on_intrinsics", since = "1.24.0")] . #[rustc_const_stable(feature = "const_ascii_ctype_on_intrinsics", since = "1.47.0")] . #[inline] . pub const fn is_ascii_uppercase(&self) -> bool { 32 ( 0.00%) matches!(*self, b'A'..=b'Z') . } . . /// Checks if the value is an ASCII lowercase character: . /// U+0061 'a' ..= U+007A 'z'. . /// . /// # Examples . /// . /// ``` -- line 863 ---------------------------------------- -- line 952 ---------------------------------------- . /// assert!(!lf.is_ascii_digit()); . /// assert!(!esc.is_ascii_digit()); . /// ``` . #[must_use] . #[stable(feature = "ascii_ctype_on_intrinsics", since = "1.24.0")] . #[rustc_const_stable(feature = "const_ascii_ctype_on_intrinsics", since = "1.47.0")] . #[inline] . pub const fn is_ascii_digit(&self) -> bool { 144 ( 0.00%) matches!(*self, b'0'..=b'9') . } . . /// Checks if the value is an ASCII octal digit: . /// U+0030 '0' ..= U+0037 '7'. . /// . /// # Examples . /// . /// ``` -- line 968 ---------------------------------------- -- line 1218 ---------------------------------------- . #[inline] . pub fn escape_ascii(self) -> ascii::EscapeDefault { . ascii::escape_default(self) . } . . #[inline] . pub(crate) const fn is_utf8_char_boundary(self) -> bool { . // This is bit magic equivalent to: b < 128 || b >= 192 243,176 ( 0.01%) (self as i8) >= -0x40 . } . } . . impl u16 { . uint_impl! { . Self = u16, . ActualT = u16, . SignedT = i16, -- line 1234 ---------------------------------------- 14 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs -------------------------------------------------------------------------------- Ir -- line 382 ---------------------------------------- . /// let a = [1, 2, 3]; . /// assert_eq!(a.into_iter().nth(10), None); . /// ``` . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_non_const_trait_method] . fn nth(&mut self, n: usize) -> Option { . self.advance_by(n).ok()?; 36 ( 0.00%) self.next() 2,532 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/iter.rs:::next (18x) . } . . /// Creates an iterator starting at the same point, but stepping by . /// the given amount at each iteration. . /// . /// Note 1: The first element of the iterator will always be returned, . /// regardless of the step given. . /// -- line 398 ---------------------------------------- -- line 879 ---------------------------------------- . Self: Sized, . F: FnMut(Self::Item), . { . #[inline] . fn call(mut f: impl FnMut(T)) -> impl FnMut((), T) { . move |(), item| f(item) . } . 1,527 ( 0.00%) self.fold((), call(f)); 11,000 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/map.rs:>, clippy_lints::needless_maybe_sized::type_param_bounds::{closure#0}>>, ::check_generics::{closure#0}>, ::check_generics::{closure#1}> as core::iter::traits::iterator::Iterator>::fold::<(), core::iter::traits::iterator::Iterator::for_each::call<(rustc_span::def_id::DefId, clippy_lints::needless_maybe_sized::Bound), as core::iter::traits::collect::Extend<(rustc_span::def_id::DefId, clippy_lints::needless_maybe_sized::Bound)>>::extend>, clippy_lints::needless_maybe_sized::type_param_bounds::{closure#0}>>, ::check_generics::{closure#0}>, ::check_generics::{closure#1}>>::{closure#0}>::{closure#0}> (173x) . } . . /// Creates an iterator which uses a closure to determine if an element . /// should be yielded. . /// . /// Given an element the closure must return `true` or `false`. The returned . /// iterator will yield only the elements for which the closure returns . /// `true`. -- line 895 ---------------------------------------- -- line 2078 ---------------------------------------- . // accidentally noticed that some rustc iterators had malformed `size_hint`s, . // so this will help catch such things in debug-assertions-std runners, . // even if users won't actually ever see it. . if cfg!(debug_assertions) { . let hint = self.size_hint(); . assert!(hint.1.is_none_or(|high| high >= hint.0), "Malformed size_hint {hint:?}"); . } . 297 ( 0.00%) FromIterator::from_iter(self) 260,261 ( 0.01%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/collections/hash/map.rs:, rustc_hash::FxBuildHasher> as core::iter::traits::collect::FromIterator<(rustc_middle::ty::Ty, core::option::Option)>>::from_iter::), 2>, clippy_lints::format_args::make_ty_msrv_map::{closure#0}>> (1x) . } . . /// Fallibly transforms an iterator into a collection, short circuiting if . /// a failure is encountered. . /// . /// `try_collect()` is a variation of [`collect()`][`collect`] that allows fallible . /// conversions during collection. Its main use case is simplifying conversions from . /// iterators yielding [`Option`][`Option`] into `Option>`, or similarly for other [`Try`] -- line 2094 ---------------------------------------- -- line 2338 ---------------------------------------- . // These closure "factory" functions exist to avoid genericity in `Self`. . . #[inline] . fn is_false<'a, T>( . predicate: &'a mut impl FnMut(&T) -> bool, . true_count: &'a mut usize, . ) -> impl FnMut(&&mut T) -> bool + 'a { . move |x| { 9 ( 0.00%) let p = predicate(&**x); 5 ( 0.00%) *true_count += p as usize; . !p . } . } . . #[inline] . fn is_true(predicate: &mut impl FnMut(&T) -> bool) -> impl FnMut(&&mut T) -> bool + '_ { 7 ( 0.00%) move |x| predicate(&**x) . } . . // Repeatedly find the first `false` and swap it with the last `true`. . let mut true_count = 0; . while let Some(head) = self.find(is_false(predicate, &mut true_count)) { . if let Some(tail) = self.rfind(is_true(predicate)) { . crate::mem::swap(head, tail); 2 ( 0.00%) true_count += 1; . } else { . break; . } . } . true_count . } . . /// Checks if the elements of this iterator are partitioned according to the given predicate, -- line 2370 ---------------------------------------- -- line 2474 ---------------------------------------- . /// } else { . /// ControlFlow::Break(prev) . /// } . /// }); . /// assert_eq!(triangular, ControlFlow::Continue(435)); . /// ``` . #[inline] . #[stable(feature = "iterator_try_fold", since = "1.27.0")] 4,512 ( 0.00%) fn try_fold(&mut self, init: B, mut f: F) -> R . where . Self: Sized, . F: [const] FnMut(B, Self::Item) -> R + [const] Destruct, . R: [const] Try, . { . let mut accum = init; 2,294,342 ( 0.11%) while let Some(x) = self.next() { 850 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_type_ir/src/walk.rs: as core::iter::traits::iterator::Iterator>::next (5x) 199,645 ( 0.01%) accum = f(accum, x)?; . } . try { accum } 3,148 ( 0.00%) } . . /// An iterator method that applies a fallible function to each item in the . /// iterator, stopping at the first error and returning that error. . /// . /// This can also be thought of as the fallible form of [`for_each()`] . /// or as the stateless version of [`try_fold()`]. . /// . /// [`for_each()`]: Iterator::for_each -- line 2501 ---------------------------------------- -- line 2658 ---------------------------------------- . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . fn fold(mut self, init: B, mut f: F) -> B . where . Self: Sized + [const] Destruct, . F: [const] FnMut(B, Self::Item) -> B + [const] Destruct, . { . let mut accum = init; 3,530 ( 0.00%) while let Some(x) = self.next() { 14,022 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/iter.rs:::next (84x) 1,339 ( 0.00%) accum = f(accum, x); . } 1,031,850 ( 0.05%) accum . } . . /// Reduces the elements to a single one, by repeatedly applying a reducing . /// operation. . /// . /// If the iterator is empty, returns [`None`]; otherwise, returns the . /// result of the reduction. . /// -- line 2677 ---------------------------------------- -- line 2695 ---------------------------------------- . #[inline] . #[stable(feature = "iterator_fold_self", since = "1.51.0")] . fn reduce(mut self, f: F) -> Option . where . Self: Sized + [const] Destruct, . F: [const] FnMut(Self::Item, Self::Item) -> Self::Item + [const] Destruct, . { . let first = self.next()?; 198 ( 0.00%) Some(self.fold(first, f)) . } . . /// Reduces the elements to a single one by repeatedly applying a reducing operation. If the . /// closure returns a failure, the failure is propagated back to the caller immediately. . /// . /// The return type of this method depends on the return type of the closure. If the closure . /// returns `Result`, then this function will return `Result, . /// E>`. If the closure returns `Option`, then this function will return -- line 2711 ---------------------------------------- -- line 2955 ---------------------------------------- . fn find

(&mut self, predicate: P) -> Option . where . Self: Sized, . P: FnMut(&Self::Item) -> bool, . { . #[inline] . fn check(mut predicate: impl FnMut(&T) -> bool) -> impl FnMut((), T) -> ControlFlow { . move |(), x| { 130 ( 0.00%) if predicate(&x) { ControlFlow::Break(x) } else { ControlFlow::Continue(()) } . } . } . . self.try_fold((), check(predicate)).break_value() . } . . /// Applies function to the elements of iterator and returns . /// the first non-none result. -- line 2971 ---------------------------------------- -- line 2986 ---------------------------------------- . #[rustc_non_const_trait_method] . fn find_map(&mut self, f: F) -> Option . where . Self: Sized, . F: FnMut(Self::Item) -> Option, . { . #[inline] . fn check(mut f: impl FnMut(T) -> Option) -> impl FnMut((), T) -> ControlFlow { 773 ( 0.00%) move |(), x| match f(x) { . Some(x) => ControlFlow::Break(x), . None => ControlFlow::Continue(()), . } . } . 383 ( 0.00%) self.try_fold((), check(f)).break_value() 301 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/chain.rs:, core::iter::sources::from_fn::FromFn> as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::find_map::check<(rustc_span::hygiene::ExpnId, rustc_span::hygiene::ExpnData), rustc_span::def_id::DefId, clippy_utils::macros::expn_is_local::{closure#0}>::{closure#0}, core::ops::control_flow::ControlFlow> (7x) . } . . /// Applies function to the elements of iterator and returns . /// the first true result or the first error. . /// . /// The return type of this method depends on the return type of the closure. . /// If you return `Result` from the closure, you'll get a `Result, E>`. . /// If you return `Option` from the closure, you'll get an `Option>`. -- line 3008 ---------------------------------------- -- line 3468 ---------------------------------------- . /// . /// let (x, (y, z)): (Vec<_>, (Vec<_>, Vec<_>)) = a.into_iter().unzip(); . /// assert_eq!(x, [1, 4]); . /// assert_eq!(y, [2, 5]); . /// assert_eq!(z, [3, 6]); . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_non_const_trait_method] 144 ( 0.00%) fn unzip(self) -> (FromA, FromB) . where . FromA: Default + Extend, . FromB: Default + Extend, . Self: Sized + Iterator, . { . let mut unzipped: (FromA, FromB) = Default::default(); . unzipped.extend(self); 180 ( 0.00%) unzipped 162 ( 0.00%) } . . /// Creates an iterator which copies all of its elements. . /// . /// This is useful when you have an iterator over `&T`, but you need an . /// iterator over `T`. . /// . /// # Examples . /// -- line 3493 ---------------------------------------- -- line 3873 ---------------------------------------- . #[stable(feature = "iter_order", since = "1.5.0")] . #[rustc_non_const_trait_method] . fn eq(self, other: I) -> bool . where . I: IntoIterator, . Self::Item: PartialEq, . Self: Sized, . { 1 ( 0.00%) self.eq_by(other, |x, y| x == y) 77 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:::eq_by::::eq::{closure#0}> (1x) . } . . /// Determines if the elements of this [`Iterator`] are equal to those of . /// another with respect to the specified equality function. . /// . /// # Examples . /// . /// ``` -- line 3889 ---------------------------------------- -- line 3891 ---------------------------------------- . /// . /// let xs = [1, 2, 3, 4]; . /// let ys = [1, 4, 9, 16]; . /// . /// assert!(xs.iter().eq_by(ys, |x, y| x * x == y)); . /// ``` . #[unstable(feature = "iter_order_by", issue = "64295")] . #[rustc_non_const_trait_method] 1 ( 0.00%) fn eq_by(self, other: I, eq: F) -> bool . where . Self: Sized, . I: IntoIterator, . F: FnMut(Self::Item, I::Item) -> bool, . { . #[inline] . fn compare(mut eq: F) -> impl FnMut(X, Y) -> ControlFlow<()> . where -- line 3907 ---------------------------------------- -- line 3908 ---------------------------------------- . F: FnMut(X, Y) -> bool, . { . move |x, y| { . if eq(x, y) { ControlFlow::Continue(()) } else { ControlFlow::Break(()) } . } . } . . SpecIterEq::spec_iter_eq(self, other.into_iter(), compare(eq)) 1 ( 0.00%) } . . /// Determines if the elements of this [`Iterator`] are not equal to those of . /// another. . /// . /// # Examples . /// . /// ``` . /// assert_eq!([1].iter().ne([1].iter()), false); -- line 3924 ---------------------------------------- -- line 3927 ---------------------------------------- . #[stable(feature = "iter_order", since = "1.5.0")] . #[rustc_non_const_trait_method] . fn ne(self, other: I) -> bool . where . I: IntoIterator, . Self::Item: PartialEq, . Self: Sized, . { 1 ( 0.00%) !self.eq(other) . } . . /// Determines if the elements of this [`Iterator`] are [lexicographically](Ord#lexicographical-comparison) . /// less than those of another. . /// . /// # Examples . /// . /// ``` -- line 3943 ---------------------------------------- 768,552 ( 0.04%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/repeat_vec_with_capacity.rs -------------------------------------------------------------------------------- Ir -- line 72 ---------------------------------------- . diag.note(note); . diag.span_suggestion_verbose(span, sugg_msg, sugg, Applicability::MaybeIncorrect); . }, . ); . } . . /// Checks `vec![Vec::with_capacity(x); n]` . fn check_vec_macro(cx: &LateContext<'_>, expr: &Expr<'_>) { 206,226 ( 0.01%) if let Some(VecArgs::Repeat(repeat_expr, len_expr)) = VecArgs::hir(cx, expr) 1,183,578 ( 0.06%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (68,742x) . && matching_root_macro_call(cx, expr.span, sym::vec_macro).is_some() . && fn_def_id(cx, repeat_expr).is_some_and(|did| cx.tcx.is_diagnostic_item(sym::vec_with_capacity, did)) . && !len_expr.span.from_expansion() . && let Some(Constant::Int(2..)) = ConstEvalCtxt::new(cx).eval(expr_or_init(cx, len_expr)) . { . emit_lint( . cx, . expr.span.source_callsite(), -- line 88 ---------------------------------------- -- line 95 ---------------------------------------- . snippet(cx, repeat_expr.span, "..") . ), . ); . } . } . . /// Checks `iter::repeat(Vec::with_capacity(x))` . fn check_repeat_fn(cx: &LateContext<'_>, expr: &Expr<'_>, msrv: Msrv) { 137,484 ( 0.01%) if !expr.span.from_expansion() 207,552 ( 0.01%) && fn_def_id(cx, expr).is_some_and(|did| cx.tcx.is_diagnostic_item(sym::iter_repeat, did)) 2,422,324 ( 0.11%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::fn_def_id (68,504x) 18,102 ( 0.00%) => ???:::is_diagnostic_item (255x) . && let ExprKind::Call(_, [repeat_expr]) = expr.kind . && fn_def_id(cx, repeat_expr).is_some_and(|did| cx.tcx.is_diagnostic_item(sym::vec_with_capacity, did)) . && !repeat_expr.span.from_expansion() . && let Some(exec_context) = std_or_core(cx) . && msrv.meets(cx, msrvs::REPEAT_WITH) . { . emit_lint( . cx, -- line 112 ---------------------------------------- -- line 118 ---------------------------------------- . "{exec_context}::iter::repeat_with(|| {})", . snippet(cx, repeat_expr.span, "..") . ), . ); . } . } . . impl LateLintPass<'_> for RepeatVecWithCapacity { 756,162 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { . check_vec_macro(cx, expr); 68,742 ( 0.00%) check_repeat_fn(cx, expr, self.msrv); 549,936 ( 0.03%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs -------------------------------------------------------------------------------- Ir -- line 67 ---------------------------------------- . . #[derive(Default)] . pub struct SuspiciousOperationGroupings { . // Spans already linted. . linted_spans: FxHashSet, . } . . impl EarlyLintPass for SuspiciousOperationGroupings { 648,261 ( 0.03%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 144,058 ( 0.01%) if expr.span.from_expansion() { . return; . } . 215,772 ( 0.01%) if let Some(binops) = extract_related_binops(&expr.kind) { 18 ( 0.00%) check_binops(cx, &binops.iter().collect::>(), &mut self.linted_spans); 3,370 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::check_binops (6x) . . let mut op_types = Vec::with_capacity(binops.len()); . // We could use a hashmap, etc. to avoid being O(n*m) here, but . // we want the lints to be emitted in a consistent order. Besides, . // m, (the number of distinct `BinOpKind`s in `binops`) . // will often be small, and does have an upper limit. . binops.iter().map(|b| b.op).for_each(|op| { . if !op_types.contains(&op) { . op_types.push(op); . } . }); . 27 ( 0.00%) for op_type in op_types { . let ops: Vec<_> = binops.iter().filter(|b| b.op == op_type).collect(); . 27 ( 0.00%) check_binops(cx, &ops, &mut self.linted_spans); 1,791 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::check_binops (9x) . } . } 576,232 ( 0.03%) } . } . 135 ( 0.00%) fn check_binops(cx: &EarlyContext<'_>, binops: &[&BinaryOp<'_>], linted_spans: &mut FxHashSet) { . let binop_count = binops.len(); 30 ( 0.00%) if binop_count < 2 { . // Single binary operation expressions would likely be false . // positives. . return; . } . . let mut one_ident_difference_count = 0; . let mut no_difference_info = None; . let mut double_difference_info = None; . let mut expected_ident_loc = None; . . let mut paired_identifiers = FxHashSet::default(); . 13 ( 0.00%) for (i, BinaryOp { left, right, op, .. }) in binops.iter().enumerate() { 57 ( 0.00%) match ident_difference_expr(left, right) { . IdentDifference::NoDifference => { . if is_useless_with_eq_exprs(*op) { . // The `eq_op` lint should catch this in this case. . return; . } . . no_difference_info = Some(i); . }, . IdentDifference::Single(ident_loc) => { . one_ident_difference_count += 1; 12 ( 0.00%) if let Some(previous_expected) = expected_ident_loc { 2 ( 0.00%) if previous_expected != ident_loc { . // This expression doesn't match the form we're . // looking for. . return; . } . } else { . expected_ident_loc = Some(ident_loc); . } . . // If there was only a single difference, all other idents . // must have been the same, and thus were paired. 36 ( 0.00%) for id in skip_index(IdentIter::from(*left), ident_loc.index) { 840 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ast_utils/ident_iter.rs:>::from (6x) . paired_identifiers.insert(id); . } 6 ( 0.00%) }, . IdentDifference::Double(ident_loc1, ident_loc2) => { . double_difference_info = Some((i, ident_loc1, ident_loc2)); . }, . IdentDifference::Multiple | IdentDifference::NonIdent => { . // It's too hard to know whether this is a bug or not. . return; . }, . } . } . 2 ( 0.00%) let mut applicability = Applicability::MachineApplicable; . 6 ( 0.00%) if let Some(expected_loc) = expected_ident_loc { 12 ( 0.00%) match (no_difference_info, double_difference_info) { . (Some(i), None) => attempt_to_emit_no_difference_lint(cx, binops, i, expected_loc, linted_spans), . (None, Some((double_difference_index, ident_loc1, ident_loc2))) => { . if one_ident_difference_count == binop_count - 1 . && let Some(binop) = binops.get(double_difference_index) . { . let changed_loc = if ident_loc1 == expected_loc { . ident_loc2 . } else if ident_loc2 == expected_loc { -- line 167 ---------------------------------------- -- line 176 ---------------------------------------- . { . emit_suggestion(cx, binop.span, sugg, applicability, linted_spans); . } . } . }, . _ => {}, . } . } 120 ( 0.00%) } . . fn attempt_to_emit_no_difference_lint( . cx: &EarlyContext<'_>, . binops: &[&BinaryOp<'_>], . i: usize, . expected_loc: IdentLocation, . linted_spans: &mut FxHashSet, . ) { -- line 192 ---------------------------------------- -- line 346 ---------------------------------------- . fn new(op: BinOpKind, span: Span, (left, right): (&'exprs Expr, &'exprs Expr)) -> Self { . Self { op, span, left, right } . } . } . . fn strip_non_ident_wrappers(expr: &Expr) -> &Expr { . let mut output = expr; . loop { 135 ( 0.00%) output = match &output.kind { 1 ( 0.00%) ExprKind::Paren(inner) | ExprKind::Unary(_, inner) => inner, . _ => { . return output; . }, . }; . } . } . . fn extract_related_binops(kind: &ExprKind) -> Option>> { 215,760 ( 0.01%) append_opt_vecs(chained_binops(kind), if_statement_binops(kind)) 1,731,498 ( 0.08%) => site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::if_statement_binops (71,920x) 1,582,256 ( 0.07%) => site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::append_opt_vecs:: (71,920x) . } . 503,804 ( 0.02%) fn if_statement_binops(kind: &ExprKind) -> Option>> { 503,775 ( 0.02%) match kind { 68 ( 0.00%) ExprKind::If(condition, _, _) => chained_binops(&condition.kind), 13 ( 0.00%) ExprKind::Paren(e) => if_statement_binops(&e.kind), . ExprKind::Block(block, _) => { 32 ( 0.00%) let mut output = None; 32 ( 0.00%) for stmt in &block.stmts { 244 ( 0.00%) match &stmt.kind { . StmtKind::Expr(e) | StmtKind::Semi(e) => { 728 ( 0.00%) output = append_opt_vecs(output, if_statement_binops(&e.kind)); 1,424 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::if_statement_binops'2 (52x) 1,144 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::append_opt_vecs:: (52x) . }, . _ => {}, . } . } 224 ( 0.00%) output . }, . _ => None, . } 575,592 ( 0.03%) } . 503,804 ( 0.02%) fn append_opt_vecs(target_opt: Option>, source_opt: Option>) -> Option> { 359,860 ( 0.02%) match (target_opt, source_opt) { . (Some(mut target), Some(source)) => { . target.reserve(source.len()); . for op in source { . target.push(op); . } . Some(target) . }, 24 ( 0.00%) (Some(v), None) | (None, Some(v)) => Some(v), 143,932 ( 0.01%) (None, None) => None, . } 575,776 ( 0.03%) } . . fn chained_binops(kind: &ExprKind) -> Option>> { 503,743 ( 0.02%) match kind { 745 ( 0.00%) ExprKind::Binary(_, left_outer, right_outer) => chained_binops_helper(left_outer, right_outer), 3,264 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::chained_binops_helper (82x) 13 ( 0.00%) ExprKind::Paren(e) | ExprKind::Unary(_, e) => chained_binops(&e.kind), 71,838 ( 0.00%) _ => None, . } . } . 1,170 ( 0.00%) fn chained_binops_helper<'expr>(left_outer: &'expr Expr, right_outer: &'expr Expr) -> Option>> { 909 ( 0.00%) match (&left_outer.kind, &right_outer.kind) { . ( . ExprKind::Paren(left_e) | ExprKind::Unary(_, left_e), . ExprKind::Paren(right_e) | ExprKind::Unary(_, right_e), 4 ( 0.00%) ) => chained_binops_helper(left_e, right_e), . (ExprKind::Paren(left_e) | ExprKind::Unary(_, left_e), _) => chained_binops_helper(left_e, right_outer), 2 ( 0.00%) (_, ExprKind::Paren(right_e) | ExprKind::Unary(_, right_e)) => chained_binops_helper(left_outer, right_e), . ( . ExprKind::Binary(Spanned { node: left_op, .. }, left_left, left_right), . ExprKind::Binary(Spanned { node: right_op, .. }, right_left, right_right), 48 ( 0.00%) ) => match ( 42 ( 0.00%) chained_binops_helper(left_left, left_right), 198 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::chained_binops_helper'2 (6x) 36 ( 0.00%) chained_binops_helper(right_left, right_right), 200 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::chained_binops_helper'2 (6x) . ) { . (Some(mut left_ops), Some(right_ops)) => { . left_ops.reserve(right_ops.len()); . for op in right_ops { . left_ops.push(op); . } . Some(left_ops) . }, -- line 430 ---------------------------------------- -- line 431 ---------------------------------------- . (Some(mut left_ops), _) => { . left_ops.push(BinaryOp::new(*right_op, right_outer.span, (right_left, right_right))); . Some(left_ops) . }, . (_, Some(mut right_ops)) => { . right_ops.insert(0, BinaryOp::new(*left_op, left_outer.span, (left_left, left_right))); . Some(right_ops) . }, 66 ( 0.00%) (None, None) => Some(vec![ 12 ( 0.00%) BinaryOp::new(*left_op, left_outer.span, (left_left, left_right)), 12 ( 0.00%) BinaryOp::new(*right_op, right_outer.span, (right_left, right_right)), . ]), 6 ( 0.00%) }, 111 ( 0.00%) _ => None, . } 936 ( 0.00%) } . 2 ( 0.00%) #[derive(Clone, Copy, PartialEq, Eq, Default, Debug)] . struct IdentLocation { . index: usize, . } . . impl Add for IdentLocation { . type Output = IdentLocation; . . fn add(self, other: Self) -> Self::Output { -- line 456 ---------------------------------------- -- line 474 ---------------------------------------- . Multiple, . NonIdent, . } . . impl Add for IdentDifference { . type Output = IdentDifference; . . fn add(self, other: Self) -> Self::Output { 12 ( 0.00%) match (self, other) { . (Self::NoDifference, output) | (output, Self::NoDifference) => output, . (Self::Multiple, _) . | (_, Self::Multiple) . | (Self::Double(_, _), Self::Single(_)) . | (Self::Single(_) | Self::Double(_, _), Self::Double(_, _)) => Self::Multiple, . (Self::NonIdent, _) | (_, Self::NonIdent) => Self::NonIdent, . (Self::Single(il1), Self::Single(il2)) => Self::Double(il1, il2), . } -- line 490 ---------------------------------------- -- line 537 ---------------------------------------- . // . // If it turns out that problematic cases are more prevalent than we assume, . // then we should be able to change this function to do the correct traversal, . // without needing to change the rest of the code. . . #[allow(clippy::enum_glob_use)] . use ExprKind::*; . 124 ( 0.00%) match ( . &strip_non_ident_wrappers(left).kind, . &strip_non_ident_wrappers(right).kind, . ) { . (Yield(_), Yield(_)) . | (Try(_), Try(_)) . | (Paren(_), Paren(_)) . | (Repeat(_, _), Repeat(_, _)) . | (Struct(_), Struct(_)) -- line 553 ---------------------------------------- -- line 617 ---------------------------------------- . ) -> (IdentDifference, IdentLocation) { . // See the note in `ident_difference_expr_with_base_location` about `IdentIter` . let mut difference = IdentDifference::NoDifference; . . let mut left_iterator = left.into(); . let mut right_iterator = right.into(); . . loop { 102 ( 0.00%) match (left_iterator.next(), right_iterator.next()) { 204 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ast_utils/ident_iter.rs:::next (24x) . (Some(left_ident), Some(right_ident)) => { 6 ( 0.00%) if !eq_id(left_ident, right_ident) { . difference += IdentDifference::Single(base); . if difference.is_complete() { . return (difference, base); . } . } . }, . (Some(_), None) | (None, Some(_)) => { . return (IdentDifference::NonIdent, base); -- line 635 ---------------------------------------- -- line 667 ---------------------------------------- . }) . } . . fn skip_index(iter: Iter, index: usize) -> impl Iterator . where . Iter: Iterator, . { . iter.enumerate() 24 ( 0.00%) .filter_map(move |(i, a)| if i == index { None } else { Some(a) }) . } 432,618 ( 0.02%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/collections/hash/map.rs -------------------------------------------------------------------------------- Ir -- line 361 ---------------------------------------- . /// let mut map = HashMap::with_hasher(s); . /// map.insert(1, 2); . /// ``` . #[inline] . #[must_use] . #[stable(feature = "hashmap_build_hasher", since = "1.7.0")] . #[rustc_const_stable(feature = "const_collections_with_hasher", since = "1.85.0")] . pub const fn with_hasher(hash_builder: S) -> HashMap { 299,012 ( 0.01%) HashMap { base: base::HashMap::with_hasher(hash_builder) } . } . . /// Creates an empty `HashMap` with at least the specified capacity, using . /// `hasher` to hash the keys. . /// . /// The hash map will be able to hold at least `capacity` elements without . /// reallocating. This method is allowed to allocate for more elements than . /// `capacity`. If `capacity` is zero, the hash map will not allocate. -- line 377 ---------------------------------------- -- line 1006 ---------------------------------------- . /// assert_eq!(letters[&'s'], 2); . /// assert_eq!(letters[&'t'], 3); . /// assert_eq!(letters[&'u'], 1); . /// assert_eq!(letters.get(&'y'), None); . /// ``` . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . pub fn entry(&mut self, key: K) -> Entry<'_, K, V, A> { 233 ( 0.00%) map_entry(self.base.rustc_entry(key)) 14,284 ( 0.00%) => /rust/deps/hashbrown-0.17.1/src/rustc_entry.rs:>::rustc_entry (64x) . } . . /// Returns a reference to the value corresponding to the key. . /// . /// The key may be any borrowed form of the map's key type, but . /// [`Hash`] and [`Eq`] on the borrowed form *must* match those for . /// the key type. . /// -- line 1022 ---------------------------------------- -- line 1032 ---------------------------------------- . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[inline] . pub fn get(&self, k: &Q) -> Option<&V> . where . K: Borrow, . Q: Hash + Eq, . { 10 ( 0.00%) self.base.get(k) 20 ( 0.00%) => /rust/deps/hashbrown-0.17.1/src/raw.rs:>::get:: (5x) . } . . /// Returns the key-value pair corresponding to the supplied key. This is . /// potentially useful: . /// - for key types where non-identical keys can be considered equal; . /// - for getting the `&K` stored key value from a borrowed `&Q` lookup key; or . /// - for getting a reference to a key with the same lifetime as the collection. . /// -- line 1048 ---------------------------------------- -- line 1326 ---------------------------------------- . /// assert_eq!(map.insert(37, "c"), Some("b")); . /// assert_eq!(map[&37], "c"); . /// ``` . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_confusables("push", "append", "put")] . #[cfg_attr(not(test), rustc_diagnostic_item = "hashmap_insert")] . pub fn insert(&mut self, k: K, v: V) -> Option { 862 ( 0.00%) self.base.insert(k, v) 30,479 ( 0.00%) => /rust/deps/hashbrown-0.17.1/src/map.rs:>::insert (128x) . } . . /// Tries to insert a key-value pair into the map, and returns . /// a mutable reference to the value in the entry. . /// . /// If the map already had this key present, nothing is updated, and . /// an error containing the occupied entry, key, and the value is returned. . /// -- line 1342 ---------------------------------------- -- line 1388 ---------------------------------------- . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_confusables("delete", "take")] . pub fn remove(&mut self, k: &Q) -> Option . where . K: Borrow, . Q: Hash + Eq, . { 79 ( 0.00%) self.base.remove(k) . } . . /// Removes a key from the map, returning the stored key and value if the . /// key was previously in the map. . /// . /// The key may be any borrowed form of the map's key type, but . /// [`Hash`] and [`Eq`] on the borrowed form *must* match those for . /// the key type. -- line 1404 ---------------------------------------- -- line 1431 ---------------------------------------- . where . K: Clone, . V: Clone, . S: Clone, . A: Allocator + Clone, . { . #[inline] . fn clone(&self) -> Self { 14 ( 0.00%) Self { base: self.base.clone() } . } . . #[inline] . fn clone_from(&mut self, source: &Self) { . self.base.clone_from(&source.base); . } . } . -- line 1447 ---------------------------------------- -- line 3006 ---------------------------------------- . where . K: Eq + Hash, . S: BuildHasher + Default, . { . /// Constructs a `HashMap` from an iterator of key-value pairs. . /// . /// If the iterator produces any pairs with equal keys, . /// all but one of the corresponding values will be dropped. 113 ( 0.00%) fn from_iter>(iter: T) -> HashMap { . let mut map = HashMap::with_hasher(Default::default()); 587 ( 0.00%) map.extend(iter); 77 ( 0.00%) => ???:0x0000000000173dc0 (1x) 1,498 ( 0.00%) map 124 ( 0.00%) } . } . . /// Inserts all new key-values from the iterator and replaces values with existing . /// keys with new values returned from the iterator. . #[stable(feature = "rust1", since = "1.0.0")] . impl Extend<(K, V)> for HashMap . where . K: Eq + Hash, . S: BuildHasher, . A: Allocator, . { . #[inline] . fn extend>(&mut self, iter: T) { 4 ( 0.00%) self.base.extend(iter) 4,294 ( 0.00%) => /rust/deps/hashbrown-0.17.1/src/map.rs: as core::iter::traits::collect::Extend<(clippy_config::types::SourceItemOrderingModuleItemKind, alloc::string::String)>>::extend::<[(clippy_config::types::SourceItemOrderingModuleItemKind, alloc::string::String); 16]> (1x) 3,731 ( 0.00%) => /rust/deps/hashbrown-0.17.1/src/map.rs: as core::iter::traits::collect::Extend<(clippy_config::types::SourceItemOrderingModuleItemKind, usize)>>::extend::<[(clippy_config::types::SourceItemOrderingModuleItemKind, usize); 16]> (1x) . } . . #[inline] . fn extend_one(&mut self, (k, v): (K, V)) { . self.base.insert(k, v); . } . . #[inline] -- line 3040 ---------------------------------------- -- line 3066 ---------------------------------------- . Extend::<(K, V)>::extend_reserve(self, additional) . } . } . . #[inline] . fn map_entry<'a, K: 'a, V: 'a, A: Allocator>( . raw: base::RustcEntry<'a, K, V, A>, . ) -> Entry<'a, K, V, A> { 279 ( 0.00%) match raw { . base::RustcEntry::Occupied(base) => Entry::Occupied(OccupiedEntry { base }), 158 ( 0.00%) base::RustcEntry::Vacant(base) => Entry::Vacant(VacantEntry { base }), . } . } . . #[inline] . pub(super) fn map_try_reserve_error(err: hashbrown::TryReserveError) -> TryReserveError { . match err { . hashbrown::TryReserveError::CapacityOverflow => { . TryReserveErrorKind::CapacityOverflow.into() -- line 3084 ---------------------------------------- 3,793 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/suspicious_trait_impl.rs -------------------------------------------------------------------------------- Ir -- line 55 ---------------------------------------- . . declare_lint_pass!(SuspiciousImpl => [ . SUSPICIOUS_ARITHMETIC_IMPL, . SUSPICIOUS_OP_ASSIGN_IMPL, . ]); . . impl<'tcx> LateLintPass<'tcx> for SuspiciousImpl { . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) { 274,964 ( 0.01%) match expr.kind { 76 ( 0.00%) hir::ExprKind::Binary(op, _, _) => { 304 ( 0.00%) check_expr_inner(cx, expr, op.node, op.span); . }, 4 ( 0.00%) hir::ExprKind::AssignOp(op, _, _) => { 6 ( 0.00%) check_expr_inner(cx, expr, op.node.into(), op.span); . }, . _ => {}, . } . } . } . 546 ( 0.00%) fn check_expr_inner<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>, binop: hir::BinOpKind, span: Span) { . if let Some((binop_trait_lang, op_assign_trait_lang)) = binop_traits(binop) 336 ( 0.00%) && let Some(binop_trait_id) = cx.tcx.lang_items().get(binop_trait_lang) 1,440 ( 0.00%) => ???:::lang_items (48x) 192 ( 0.00%) && let Some(op_assign_trait_id) = cx.tcx.lang_items().get(op_assign_trait_lang) 1,440 ( 0.00%) => ???:::lang_items (48x) . . // Check for more than one binary operation in the implemented function . // Linting when multiple operations are involved can result in false positives 192 ( 0.00%) && let parent_fn = cx.tcx.hir_get_parent_item(expr.hir_id).def_id 912 ( 0.00%) => ???:::hir_get_parent_item (48x) 103 ( 0.00%) && let hir::Node::ImplItem(impl_item) = cx.tcx.hir_node_by_def_id(parent_fn) 28 ( 0.00%) && let hir::ImplItemKind::Fn(_, body_id) = impl_item.kind 14 ( 0.00%) && let body = cx.tcx.hir_body(body_id) 392 ( 0.00%) => ???:::hir_body (7x) 28 ( 0.00%) && let parent_fn = cx.tcx.hir_get_parent_item(expr.hir_id) 133 ( 0.00%) => ???:::hir_get_parent_item (7x) 28 ( 0.00%) && let Some(trait_ref) = trait_ref_of_method(cx, parent_fn) 1,323 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::trait_ref_of_method (7x) 8 ( 0.00%) && let trait_id = trait_ref.path.res.def_id() . && ![binop_trait_id, op_assign_trait_id].contains(&trait_id) . && let Some(&(_, lint)) = [ . (&BINOP_TRAITS, SUSPICIOUS_ARITHMETIC_IMPL), . (&OP_ASSIGN_TRAITS, SUSPICIOUS_OP_ASSIGN_IMPL), . ] . .iter() 176 ( 0.00%) .find(|&(ts, _)| ts.iter().any(|&t| Some(trait_id) == cx.tcx.lang_items().get(t))) 2,400 ( 0.00%) => ???:::lang_items (80x) . && count_binops(body.value) == 1 . { . span_lint( . cx, . lint, . span, . format!( . "suspicious use of `{}` in `{}` impl", . binop.as_str(), . cx.tcx.item_name(trait_id) . ), . ); . } 624 ( 0.00%) } . . fn count_binops(expr: &hir::Expr<'_>) -> u32 { . let mut count = 0u32; . let _: Option = for_each_expr_without_closures(expr, |e| { . if matches!( . e.kind, . hir::ExprKind::Binary(..) . | hir::ExprKind::Unary(hir::UnOp::Not | hir::UnOp::Neg, _) -- line 117 ---------------------------------------- 414 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/zero_repeat_side_effects.rs -------------------------------------------------------------------------------- Ir -- line 40 ---------------------------------------- . pub ZERO_REPEAT_SIDE_EFFECTS, . suspicious, . "usage of zero-sized initializations of arrays or vecs causing side effects" . } . . declare_lint_pass!(ZeroRepeatSideEffects => [ZERO_REPEAT_SIDE_EFFECTS]); . . impl LateLintPass<'_> for ZeroRepeatSideEffects { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 274,968 ( 0.01%) if let Some(args) = VecArgs::hir(cx, expr) 1,183,578 ( 0.06%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (68,742x) . && let VecArgs::Repeat(inner_expr, len) = args . && let ExprKind::Lit(l) = len.kind . && let LitKind::Int(Pu128(0), _) = l.node . { . inner_check(cx, expr, inner_expr, true); . } . // Lint only if the length is a literal zero, and not a path to any constants. . // NOTE(@y21): When reading `[f(); LEN]`, I intuitively expect that the function is called and it . // doesn't seem as confusing as `[f(); 0]`. It would also have false positives when eg. . // the const item depends on `#[cfg]s` and has different values in different compilation . // sessions). 137,484 ( 0.01%) else if let ExprKind::Repeat(inner_expr, const_arg) = expr.kind . && let ConstArgKind::Anon(anon_const) = const_arg.kind . && let length_expr = cx.tcx.hir_body(anon_const.body).value . && !length_expr.span.from_expansion() . && let ExprKind::Lit(literal) = length_expr.kind . && let LitKind::Int(Pu128(0), _) = literal.node . { . inner_check(cx, expr, inner_expr, false); . } 343,710 ( 0.02%) } . } . . fn inner_check(cx: &LateContext<'_>, expr: &'_ Expr<'_>, inner_expr: &'_ Expr<'_>, is_vec: bool) { . // check if expr is a call or has a call inside it . if inner_expr.can_have_side_effects() { . let parent_hir_node = cx.tcx.parent_hir_node(expr.hir_id); . let inner_expr_ty = cx.typeck_results().expr_ty(inner_expr); . let return_type = cx.typeck_results().expr_ty(expr); -- line 78 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/combined_early_pass.rs -------------------------------------------------------------------------------- Ir -- line 19 ---------------------------------------- . /// Run one field's `check_*`. . /// . /// Fully qualified through [`rustc_lint::EarlyLintPass`] since some passes impl . /// both `EarlyLintPass` and `LateLintPass` with like-named methods, which would . /// be ambiguous on the concrete field type. . #[macro_export] . macro_rules! run_combined_early_lint_pass_field { . ($self:ident, $field:ident, $name:ident, ($($arg:expr),* $(,)?)) => { 5,981,159 ( 0.28%) rustc_lint::EarlyLintPass::$name(&mut $self.$field, $($arg),*); 524 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/empty_line_after.rs:::check_crate (1x) 191 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/disallowed_script_idents.rs:::check_crate (1x) . }; . } . . /// Forward one `check_*` method to every field of the combined pass. . #[macro_export] . macro_rules! expand_combined_early_lint_pass_method { . ([$($field:ident),*], $self:ident, $name:ident, $args:tt) => ({ . $($crate::run_combined_early_lint_pass_field!($self, $field, $name, $args);)* -- line 35 ---------------------------------------- -- line 36 ---------------------------------------- . }) . } . . /// Generate the combined `EarlyLintPass` impl's `check_*` methods, one per method . /// in rustc's early-pass method list. . #[macro_export] . macro_rules! expand_combined_early_lint_pass_methods { . ($fields:tt, [$($(#[$attr:meta])* fn $name:ident($($param:ident: $arg:ty),*);)*]) => ( 2,014,512 ( 0.09%) $(#[inline(always)] fn $name(&mut self, cx: &rustc_lint::EarlyContext<'_>, $($param: $arg),*) { . $crate::expand_combined_early_lint_pass_method!($fields, self, $name, (cx, $($param),*)); 400,672 ( 0.02%) })* . ) . } . . /// Declare the combined struct (one field per pass) plus its . /// `LintPass`/`EarlyLintPass` impls. The method list comes from . /// `rustc_lint::early_lint_methods!` so it can't drift from rustc's. . /// . /// Each entry is `Field: Type = constructor`; `new`'s params (`conf`, ...) come -- line 54 ---------------------------------------- -- line 60 ---------------------------------------- . $methods:tt . ) => { . #[allow(non_snake_case)] . pub struct $name { . $($field: $fty,)* . } . . impl $name { 9 ( 0.00%) pub fn new($($pname: $pty,)*) -> Self { 81 ( 0.00%) Self { . $($field: $ctor,)* . } 9 ( 0.00%) } . } . . #[allow(rustc::lint_pass_impl_without_macro)] . impl rustc_lint::LintPass for $name { . fn name(&self) -> &'static str { . stringify!($name) . } . fn get_lints(&self) -> rustc_lint::LintVec { -- line 80 ---------------------------------------- 170 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/matches/collapsible_match.rs -------------------------------------------------------------------------------- Ir -- line 15 ---------------------------------------- . use rustc_lint::LateContext; . use rustc_middle::mir::FakeReadCause; . use rustc_middle::ty; . use rustc_span::{BytePos, Ident, Span, SyntaxContext}; . . use super::{COLLAPSIBLE_MATCH, pat_contains_disallowed_or}; . use crate::collapsible_if::{parens_around, peel_parens}; . 450 ( 0.00%) pub(super) fn check_match<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, arms: &'tcx [Arm<'_>], msrv: Msrv) { 77 ( 0.00%) if let Some(els_arm) = arms.iter().rfind(|arm| arm_is_wild_like(cx, arm)) { . let last_non_wildcard = arms.iter().rposition(|arm| !arm_is_wild_like(cx, arm)); . for (idx, arm) in arms.iter().enumerate() { . let only_wildcards_after = last_non_wildcard.is_none_or(|lnw| idx >= lnw); 14,610 ( 0.00%) check_arm( 80,843 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/matches/collapsible_match.rs:clippy_lints::matches::collapsible_match::check_arm (1,461x) . cx, 1,461 ( 0.00%) arm.span.ctxt(), . true, 1,461 ( 0.00%) arm.pat, . expr, 1,461 ( 0.00%) arm.body, . arm.guard, . Some(els_arm.body), . msrv, . only_wildcards_after, . ); . } . } 360 ( 0.00%) } . . pub(super) fn check_if_let<'tcx>( . cx: &LateContext<'tcx>, . ctxt: SyntaxContext, . pat: &'tcx Pat<'_>, . body: &'tcx Expr<'_>, . else_expr: Option<&'tcx Expr<'_>>, . let_expr: &'tcx Expr<'_>, . msrv: Msrv, . ) { 24 ( 0.00%) check_arm(cx, ctxt, false, pat, let_expr, body, None, else_expr, msrv, false); 199 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/matches/collapsible_match.rs:clippy_lints::matches::collapsible_match::check_arm (3x) . } . . #[expect(clippy::too_many_arguments, clippy::too_many_lines)] 21,960 ( 0.00%) fn check_arm<'tcx>( . cx: &LateContext<'tcx>, . ctxt: SyntaxContext, . outer_is_match: bool, . outer_pat: &'tcx Pat<'tcx>, . outer_cond: &'tcx Expr<'tcx>, . outer_then_body: &'tcx Expr<'tcx>, . outer_guard: Option<&'tcx Expr<'tcx>>, . outer_else_body: Option<&'tcx Expr<'tcx>>, . msrv: Msrv, . only_wildcards_after: bool, . ) { . let inner_expr = peel_blocks_with_stmt(outer_then_body); 5,860 ( 0.00%) if let Some(inner) = IfLetOrMatch::parse(cx, inner_expr) 30,740 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::parse (1,464x) 2 ( 0.00%) && let Some((inner_scrutinee, inner_then_pat, inner_else_body)) = match inner { . IfLetOrMatch::IfLet(scrutinee, pat, _, els, _) => Some((scrutinee, pat, els)), . IfLetOrMatch::Match(scrutinee, arms, ..) => { 2 ( 0.00%) if arms.len() == 2 && arms.iter().all(|a| a.guard.is_none()) . // if there are more than two arms, collapsing would be non-trivial . // one of the arms must be "wild-like" 1 ( 0.00%) && let Some(wild_idx) = arms.iter().rposition(|a| arm_is_wild_like(cx, a)) . { 3 ( 0.00%) let (then, els) = (&arms[1 - wild_idx], &arms[wild_idx]); 5 ( 0.00%) Some((scrutinee, then.pat, Some(els.body))) . } else { . None . } . }, . } 2 ( 0.00%) && outer_pat.span.eq_ctxt(inner_scrutinee.span) . // match expression must be a local binding . // match { .. } 4 ( 0.00%) && let Some(binding_id) = peel_ref_operators(cx, inner_scrutinee).res_local_id() 19 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::peel_ref_operators (1x) . && !pat_contains_disallowed_or(cx, inner_then_pat, msrv) . // the binding must come from the pattern of the containing match arm . // .... => match { .. } . && let (Some((binding_ident, binding_span)), is_innermost_parent_pat_struct) = . find_pat_binding_and_is_innermost_parent_pat_struct(outer_pat, binding_id) . // the "else" branches must be equal . && match (outer_else_body, inner_else_body) { . (None, None) => true, -- line 97 ---------------------------------------- -- line 135 ---------------------------------------- . let outer_cond_msg = format!("use: `{}{}`", snippet(cx, outer_cond.span, ".."), method); . help_span.push_span_label(outer_cond.span, outer_cond_msg); . } . diag.span_help( . help_span, . "the outer pattern can be modified to include the inner pattern", . ); . }); 2,928 ( 0.00%) } else if outer_is_match // Leave if-let to the `collapsible_if` lint . && only_wildcards_after // adding a guard allows fall-through; unsafe if other arms follow . && let Some(inner) = If::hir(inner_expr) . && outer_pat.span.eq_ctxt(inner.cond.span) . && match (outer_else_body, inner.r#else) { . (None, None) => true, . (None, Some(e)) | (Some(e), None) => is_unit_expr(e), . (Some(a), Some(b)) => SpanlessEq::new(cx).eq_expr(ctxt, a, b), . } -- line 151 ---------------------------------------- -- line 204 ---------------------------------------- . let else_inner_span = inner.then.span.shrink_to_hi().to(else_inner.span); . sugg.push((else_inner_span, String::new())); . } . . diag.multipart_suggestion("collapse nested if block", sugg, Applicability::MachineApplicable); . }, . ); . } 11,712 ( 0.00%) } . . /// A "wild-like" arm has a wild (`_`) or `None` pattern and no guard. Such arms can be "collapsed" . /// into a single wild arm without any significant loss in semantics or readability. . fn arm_is_wild_like(cx: &LateContext<'_>, arm: &Arm<'_>) -> bool { 141 ( 0.00%) if arm.guard.is_some() { . return false; . } 545 ( 0.00%) matches!(arm.pat.kind, PatKind::Binding(..) | PatKind::Wild) || is_none_pattern(cx, arm.pat) 198 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_none_pattern (1x) . } . . fn find_pat_binding_and_is_innermost_parent_pat_struct(pat: &Pat<'_>, hir_id: HirId) -> (Option<(Ident, Span)>, bool) { . let mut binding = None; . let mut is_innermost_parent_pat_struct = false; . pat.walk_short(|p| match p.kind { . // ignore OR patterns . PatKind::Or(_) => false, -- line 228 ---------------------------------------- 5,989 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/bool_assert_comparison.rs -------------------------------------------------------------------------------- Ir -- line 68 ---------------------------------------- . .tcx . .normalize_erasing_regions(cx.typing_env(), Unnormalized::new_wip(proj)); . . nty.is_bool() . }) . } . . impl<'tcx> LateLintPass<'tcx> for BoolAssertComparison { 618,678 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . let Some(macro_call) = root_macro_call_first_node(cx, expr) else { . return; . }; . let eq_macro = match cx.tcx.get_diagnostic_name(macro_call.def_id) { . Some(sym::assert_eq_macro | sym::debug_assert_eq_macro) => true, . Some(sym::assert_ne_macro | sym::debug_assert_ne_macro) => false, . _ => return, . }; -- line 84 ---------------------------------------- -- line 148 ---------------------------------------- . . diag.multipart_suggestion( . format!("replace it with `{non_eq_mac}!(..)`"), . suggestions, . applicability, . ); . }, . ); 549,936 ( 0.03%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/unit_types/unit_cmp.rs -------------------------------------------------------------------------------- Ir . use clippy_utils::diagnostics::span_lint; . use clippy_utils::macros::{find_assert_eq_args, root_macro_call_first_node}; . use clippy_utils::{is_unit_expr, sym}; . use rustc_hir::{BinOpKind, Expr, ExprKind}; . use rustc_lint::LateContext; . . use super::UNIT_CMP; . 618,678 ( 0.03%) pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>) { 137,484 ( 0.01%) if expr.span.from_expansion() { . if let Some(macro_call) = root_macro_call_first_node(cx, expr) . && let Some(diag_name) = cx.tcx.get_diagnostic_name(macro_call.def_id) . { . let result = match diag_name { . sym::assert_eq_macro | sym::debug_assert_eq_macro => "succeed", . sym::assert_ne_macro | sym::debug_assert_ne_macro => "fail", . _ => return, . }; -- line 18 ---------------------------------------- -- line 33 ---------------------------------------- . "`{}` of unit values detected. This will always {result}", . cx.tcx.item_name(macro_call.def_id) . ), . ); . } . return; . } . 137,008 ( 0.01%) if let ExprKind::Binary(ref cmp, left, _) = expr.kind { 75 ( 0.00%) let op = cmp.node; 26 ( 0.00%) if op.is_comparison() && cx.typeck_results().expr_ty(left).is_unit() { 1,040 ( 0.00%) => ???:::expr_ty (26x) . let result = match op { . BinOpKind::Eq | BinOpKind::Le | BinOpKind::Ge => "true", . _ => "false", . }; . span_lint( . cx, . UNIT_CMP, . expr.span, . format!( . "{}-comparison of unit values detected. This will always be {result}", . op.as_str() . ), . ); . } . } 549,936 ( 0.03%) } 26 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_float_methods.rs -------------------------------------------------------------------------------- Ir -- line 93 ---------------------------------------- . . impl ManualFloatMethods { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . fn is_not_const(tcx: TyCtxt<'_>, def_id: DefId) -> bool { 22 ( 0.00%) match tcx.def_kind(def_id) { . DefKind::Mod . | DefKind::Struct . | DefKind::Union . | DefKind::Enum . | DefKind::Variant . | DefKind::Trait . | DefKind::TyAlias . | DefKind::ForeignTy -- line 109 ---------------------------------------- -- line 128 ---------------------------------------- . | DefKind::Ctor(..) . | DefKind::AssocConst { .. } => false, . . DefKind::Fn | DefKind::AssocFn | DefKind::Closure => tcx.constness(def_id) == Constness::NotConst, . } . } . . impl<'tcx> LateLintPass<'tcx> for ManualFloatMethods { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 137,575 ( 0.01%) if let ExprKind::Binary(kind, lhs, rhs) = expr.kind 156 ( 0.00%) && let ExprKind::Binary(lhs_kind, lhs_lhs, lhs_rhs) = lhs.kind 38 ( 0.00%) && let ExprKind::Binary(rhs_kind, rhs_lhs, rhs_rhs) = rhs.kind . // Checking all possible scenarios using a function would be a hopeless task, as we have . // 16 possible alignments of constants/operands. For now, let's use `partition`. 12 ( 0.00%) && let mut exprs = [lhs_lhs, lhs_rhs, rhs_lhs, rhs_rhs] 10 ( 0.00%) && exprs.iter_mut().partition_in_place(|i| i.res_local_id().is_some()) == 2 8 ( 0.00%) && !expr.span.in_external_macro(cx.sess().source_map()) . && ( 12 ( 0.00%) is_not_const(cx.tcx, cx.tcx.hir_enclosing_body_owner(expr.hir_id).into()) 977 ( 0.00%) => ???:::hir_enclosing_body_owner (2x) . || self.msrv.meets(cx, msrvs::CONST_FLOAT_CLASSIFY) . ) 8 ( 0.00%) && let [first, second, const_1, const_2] = exprs 14 ( 0.00%) && let ecx = ConstEvalCtxt::new(cx) 112 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::new (2x) . && let ctxt = expr.span.ctxt() 15 ( 0.00%) && let Some(const_1) = ecx.eval_local(const_1, ctxt) 1,189 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval_local (2x) 8 ( 0.00%) && let Some(const_2) = ecx.eval_local(const_2, ctxt) 170 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval_local (1x) 1 ( 0.00%) && first.res_local_id().is_some_and(|f| second.res_local_id().is_some_and(|s| f == s)) . // The actual infinity check, we also allow `NEG_INFINITY` before` INFINITY` just in . // case somebody does that for some reason . && (const_1.is_pos_infinity() && const_2.is_neg_infinity() . || const_1.is_neg_infinity() && const_2.is_pos_infinity()) . && let Some(local_snippet) = first.span.get_text(cx) . { . let variant = match (kind.node, lhs_kind.node, rhs_kind.node) { . (BinOpKind::Or, BinOpKind::Eq, BinOpKind::Eq) => Variant::ManualIsInfinite, -- line 162 ---------------------------------------- -- line 196 ---------------------------------------- . expr.span, . "or, for conciseness", . format!("!{local_snippet}.is_infinite()"), . Applicability::MaybeIncorrect, . ); . }, . } . }); 2 ( 0.00%) } 50 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:core::ptr::drop_glue:: (2x) 549,936 ( 0.03%) } . } 25 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/mod.rs -------------------------------------------------------------------------------- Ir -- line 129 ---------------------------------------- . /// assert!(b.is_empty()); . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_slice_is_empty", since = "1.39.0")] . #[rustc_no_implicit_autorefs] . #[inline] . #[must_use] . pub const fn is_empty(&self) -> bool { 1,722 ( 0.00%) self.len() == 0 . } . . /// Returns the first element of the slice, or `None` if it is empty. . /// . /// # Examples . /// . /// ``` . /// let v = [10, 40, 30]; -- line 145 ---------------------------------------- -- line 148 ---------------------------------------- . /// let w: &[i32] = &[]; . /// assert_eq!(None, w.first()); . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_slice_first_last_not_mut", since = "1.56.0")] . #[inline] . #[must_use] . pub const fn first(&self) -> Option<&T> { 285,870 ( 0.01%) if let [first, ..] = self { Some(first) } else { None } . } . . /// Returns a mutable reference to the first element of the slice, or `None` if it is empty. . /// . /// # Examples . /// . /// ``` . /// let x = &mut [0, 1, 2]; -- line 164 ---------------------------------------- -- line 191 ---------------------------------------- . /// assert_eq!(elements, &[1, 2]); . /// } . /// ``` . #[stable(feature = "slice_splits", since = "1.5.0")] . #[rustc_const_stable(feature = "const_slice_first_last_not_mut", since = "1.56.0")] . #[inline] . #[must_use] . pub const fn split_first(&self) -> Option<(&T, &[T])> { 1,999 ( 0.00%) if let [first, tail @ ..] = self { Some((first, tail)) } else { None } . } . . /// Returns the first and all the rest of the elements of the slice, or `None` if it is empty. . /// . /// # Examples . /// . /// ``` . /// let x = &mut [0, 1, 2]; -- line 207 ---------------------------------------- -- line 233 ---------------------------------------- . /// assert_eq!(elements, &[0, 1]); . /// } . /// ``` . #[stable(feature = "slice_splits", since = "1.5.0")] . #[rustc_const_stable(feature = "const_slice_first_last_not_mut", since = "1.56.0")] . #[inline] . #[must_use] . pub const fn split_last(&self) -> Option<(&T, &[T])> { 197 ( 0.00%) if let [init @ .., last] = self { Some((last, init)) } else { None } . } . . /// Returns the last and all the rest of the elements of the slice, or `None` if it is empty. . /// . /// # Examples . /// . /// ``` . /// let x = &mut [0, 1, 2]; -- line 249 ---------------------------------------- -- line 274 ---------------------------------------- . /// let w: &[i32] = &[]; . /// assert_eq!(None, w.last()); . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_slice_first_last_not_mut", since = "1.56.0")] . #[inline] . #[must_use] . pub const fn last(&self) -> Option<&T> { 932,472 ( 0.04%) if let [.., last] = self { Some(last) } else { None } . } . . /// Returns a mutable reference to the last item in the slice, or `None` if it is empty. . /// . /// # Examples . /// . /// ``` . /// let x = &mut [0, 1, 2]; -- line 290 ---------------------------------------- -- line 297 ---------------------------------------- . /// let y: &mut [i32] = &mut []; . /// assert_eq!(None, y.last_mut()); . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_slice_first_last", since = "1.83.0")] . #[inline] . #[must_use] . pub const fn last_mut(&mut self) -> Option<&mut T> { 452 ( 0.00%) if let [.., last] = self { Some(last) } else { None } . } . . /// Returns an array reference to the first `N` items in the slice. . /// . /// If the slice is not at least `N` in length, this will return `None`. . /// . /// # Examples . /// -- line 313 ---------------------------------------- -- line 320 ---------------------------------------- . /// . /// let w: &[i32] = &[]; . /// assert_eq!(Some(&[]), w.first_chunk::<0>()); . /// ``` . #[inline] . #[stable(feature = "slice_first_last_chunk", since = "1.77.0")] . #[rustc_const_stable(feature = "slice_first_last_chunk", since = "1.77.0")] . pub const fn first_chunk(&self) -> Option<&[T; N]> { 3,018 ( 0.00%) if self.len() < N { . None . } else { . // SAFETY: We explicitly check for the correct number of elements, . // and do not let the reference outlive the slice. . Some(unsafe { &*(self.as_ptr().cast_array()) }) . } . } . -- line 336 ---------------------------------------- -- line 846 ---------------------------------------- . /// Gets a reference to the underlying array. . /// . /// If `N` is not exactly equal to the length of `self`, then this method returns `None`. . #[stable(feature = "core_slice_as_array", since = "1.93.0")] . #[rustc_const_stable(feature = "core_slice_as_array", since = "1.93.0")] . #[inline] . #[must_use] . pub const fn as_array(&self) -> Option<&[T; N]> { 52 ( 0.00%) if self.len() == N { . let ptr = self.as_ptr().cast_array(); . . // SAFETY: The underlying array of a slice can be reinterpreted as an actual array `[T; N]` if `N` is not greater than the slice's length. . let me = unsafe { &*ptr }; . Some(me) . } else { . None . } -- line 862 ---------------------------------------- -- line 970 ---------------------------------------- . /// let mut v = [1, 2, 3]; . /// v.reverse(); . /// assert!(v == [3, 2, 1]); . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_slice_reverse", since = "1.90.0")] . #[inline] . pub const fn reverse(&mut self) { 12 ( 0.00%) let half_len = self.len() / 2; . let Range { start, end } = self.as_mut_ptr_range(); . . // These slices will skip the middle item for an odd length, . // since that one doesn't need to move. . let (front_half, back_half) = . // SAFETY: Both are subparts of the original slice, so the memory . // range is valid, and they don't overlap because they're each only . // half (or less) of the original slice. -- line 986 ---------------------------------------- -- line 1005 ---------------------------------------- . // this check tells LLVM that the indexing below is . // in-bounds. Then after inlining -- once the actual . // lengths of the slices are known -- it's removed. . // FIXME(const_trait_impl) replace with let (a, b) = (&mut a[..n], &mut b[..n]); . let (a, _) = a.split_at_mut(n); . let (b, _) = b.split_at_mut(n); . . let mut i = 0; 6 ( 0.00%) while i < n { 7 ( 0.00%) mem::swap(&mut a[i], &mut b[n - 1 - i]); . i += 1; . } . } . } . . /// Returns an iterator over the slice. . /// . /// The iterator yields all items from start to end. -- line 1022 ---------------------------------------- -- line 2110 ---------------------------------------- . . // SAFETY: Caller has to check that `0 <= mid <= self.len()`. . // . // `[ptr; mid]` and `[mid; len]` are not overlapping, so returning a mutable reference . // is fine. . unsafe { . ( . from_raw_parts_mut(ptr, mid), 84 ( 0.00%) from_raw_parts_mut(ptr.add(mid), unchecked_sub(len, mid)), . ) . } . } . . /// Divides one slice into two at an index, returning `None` if the slice is . /// too short. . /// . /// If `mid ≤ len` returns a pair of slices where the first will contain all -- line 2126 ---------------------------------------- -- line 2155 ---------------------------------------- . /// . /// assert_eq!(None, v.split_at_checked(7)); . /// ``` . #[stable(feature = "split_at_checked", since = "1.80.0")] . #[rustc_const_stable(feature = "split_at_checked", since = "1.80.0")] . #[inline] . #[must_use] . pub const fn split_at_checked(&self, mid: usize) -> Option<(&[T], &[T])> { 73,150 ( 0.00%) if mid <= self.len() { . // SAFETY: `[ptr; mid]` and `[mid; len]` are inside `self`, which . // fulfills the requirements of `split_at_unchecked`. . Some(unsafe { self.split_at_unchecked(mid) }) . } else { . None . } . } . -- line 2171 ---------------------------------------- -- line 2194 ---------------------------------------- . /// . /// assert_eq!(None, v.split_at_mut_checked(7)); . /// ``` . #[stable(feature = "split_at_checked", since = "1.80.0")] . #[rustc_const_stable(feature = "const_slice_split_at_mut", since = "1.83.0")] . #[inline] . #[must_use] . pub const fn split_at_mut_checked(&mut self, mid: usize) -> Option<(&mut [T], &mut [T])> { 336 ( 0.00%) if mid <= self.len() { . // SAFETY: `[ptr; mid]` and `[mid; len]` are inside `self`, which . // fulfills the requirements of `split_at_unchecked`. . Some(unsafe { self.split_at_mut_unchecked(mid) }) . } else { . None . } . } . -- line 2210 ---------------------------------------- -- line 2627 ---------------------------------------- . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[must_use] . pub fn starts_with(&self, needle: &[T]) -> bool . where . T: PartialEq, . { . let n = needle.len(); 274,441 ( 0.01%) self.len() >= n && needle == &self[..n] . } . . /// Returns `true` if `needle` is a suffix of the slice or equal to the slice. . /// . /// # Examples . /// . /// ``` . /// let v = [10, 40, 30]; -- line 2643 ---------------------------------------- -- line 2658 ---------------------------------------- . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[must_use] . pub fn ends_with(&self, needle: &[T]) -> bool . where . T: PartialEq, . { . let (m, n) = (self.len(), needle.len()); 210,707 ( 0.01%) m >= n && needle == &self[m - n..] . } . . /// Returns a subslice with the prefix removed. . /// . /// If the slice starts with `prefix`, returns the subslice after the prefix, wrapped in `Some`. . /// If `prefix` is empty, simply returns the original slice. If `prefix` is equal to the . /// original slice, returns an empty slice. . /// -- line 2674 ---------------------------------------- 40,121 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/default.rs -------------------------------------------------------------------------------- Ir -- line 73 ---------------------------------------- . . #[derive(Default)] . pub struct Default { . // Spans linted by `field_reassign_with_default`. . reassigned_linted: FxHashSet, . } . . impl<'tcx> LateLintPass<'tcx> for Default { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 206,226 ( 0.01%) if !expr.span.from_expansion() . // Avoid cases already linted by `field_reassign_with_default` 68,820 ( 0.00%) && !self.reassigned_linted.contains(&expr.span) 5 ( 0.00%) && let ExprKind::Call(path, []) = expr.kind 55 ( 0.00%) && !in_automatically_derived(cx.tcx, expr.hir_id) 2,885 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::in_automatically_derived (5x) 15 ( 0.00%) && let ExprKind::Path(ref qpath) = path.kind 25 ( 0.00%) && let Some(def_id) = cx.qpath_res(qpath, path.hir_id).opt_def_id() 390 ( 0.00%) => ???:::qpath_res (5x) 25 ( 0.00%) && cx.tcx.is_diagnostic_item(sym::default_fn, def_id) 220 ( 0.00%) => ???:::is_diagnostic_item (5x) . && !is_update_syntax_base(cx, expr) . // Detect and ignore ::default() because these calls do explicitly name the type. . && let QPath::Resolved(None, _path) = qpath . && let expr_ty = cx.typeck_results().expr_ty(expr) . && let ty::Adt(def, ..) = expr_ty.kind() . && !is_from_proc_macro(cx, expr) . { . let replacement = with_forced_trimmed_paths!(format!("{}::default()", cx.tcx.def_path_str(def.did()))); -- line 97 ---------------------------------------- -- line 100 ---------------------------------------- . DEFAULT_TRAIT_ACCESS, . expr.span, . format!("calling `{replacement}` is more clear than this expression"), . "try", . replacement, . Applicability::Unspecified, // First resolve the TODO above . ); . } 549,936 ( 0.03%) } . . #[expect(clippy::too_many_lines)] 1,548 ( 0.00%) fn check_block(&mut self, cx: &LateContext<'tcx>, block: &Block<'tcx>) { . // start from the `let mut _ = _::default();` and look at all the following . // statements, see if they re-assign the fields of the binding . let stmts_head = match block.stmts { 688 ( 0.00%) [] | [_] => return, . // Skip the last statement since there cannot possibly be any following statements that re-assign fields. . [head @ .., _] => head, . }; . for (stmt_idx, stmt) in stmts_head.iter().enumerate() { . // find all binding statements like `let mut _ = T::default()` where `T::default()` is the . // `default` method of the `Default` trait, and store statement index in current block being . // checked and the name of the bound variable 163 ( 0.00%) let (local, variant, binding_name, binding_type, span) = if let StmtKind::Let(local) = stmt.kind . // only take `let ...` statements 63 ( 0.00%) && let Some(expr) = local.init 147 ( 0.00%) && !in_automatically_derived(cx.tcx, expr.hir_id) 9,197 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::in_automatically_derived (21x) 40 ( 0.00%) && !expr.span.from_expansion() . // only take bindings to identifiers 117 ( 0.00%) && let PatKind::Binding(_, binding_id, ident, _) = local.pat.kind . // only when assigning `... = Default::default()` 95 ( 0.00%) && is_expr_default(cx, expr) 229 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_expr_default (19x) . && let binding_type = cx.typeck_results().node_type(binding_id) . && let ty::Adt(adt, args) = *binding_type.kind() . && adt.is_struct() . && let variant = adt.non_enum_variant() . && !variant.field_list_has_applicable_non_exhaustive() . && let module_did = cx.tcx.parent_module(stmt.hir_id) . && variant . .fields -- line 139 ---------------------------------------- -- line 242 ---------------------------------------- . first_assign.unwrap().span, . "field assignment outside of initializer for an instance created with Default::default()", . Some(local.span), . format!("consider initializing the variable with `{sugg}` and removing relevant reassignments"), . ); . self.reassigned_linted.insert(span); . } . } 1,376 ( 0.00%) } . } . . /// Returns the reassigned field and the assigning expression (right-hand side of assign). . fn field_reassigned_by_stmt<'tcx>(this: &Stmt<'tcx>, binding_name: Symbol) -> Option<(Ident, &'tcx Expr<'tcx>)> { . if let StmtKind::Semi(later_expr) = this.kind . // only take assignments . && let ExprKind::Assign(assign_lhs, assign_rhs, _) = later_expr.kind . // only take assignments to fields where the left-hand side field is a field of -- line 258 ---------------------------------------- 433 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/disallowed_fields.rs -------------------------------------------------------------------------------- Ir -- line 59 ---------------------------------------- . impl_lint_pass!(DisallowedFields => [DISALLOWED_FIELDS]); . . pub struct DisallowedFields { . disallowed: DefIdMap<(&'static str, &'static DisallowedPath)>, . } . . impl DisallowedFields { . pub fn new(tcx: TyCtxt<'_>, conf: &'static Conf) -> Self { 8 ( 0.00%) let (disallowed, _) = create_disallowed_map( 38 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_config/src/types.rs:clippy_config::types::create_disallowed_map::::new::{closure#0}> (1x) . tcx, . &conf.disallowed_fields, . PathNS::Field, . |def_kind| matches!(def_kind, DefKind::Field), . "field", . false, . ); 4 ( 0.00%) Self { disallowed } . } . } . . impl<'tcx> LateLintPass<'tcx> for DisallowedFields { 549,936 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 339,590 ( 0.02%) let (id, span) = match &expr.kind { 21,514 ( 0.00%) ExprKind::Path(path) if let Res::Def(_, id) = cx.qpath_res(path, expr.hir_id) => (id, expr.span), 48,755 ( 0.00%) => ???:::qpath_res (2,060x) . ExprKind::Field(e, ident) => { . // Very round-about way to get the field `DefId` from the expr: first we get its . // parent `Ty`. Then we go through all its fields to find the one with the expected . // name and get the `DefId` from it. 404 ( 0.00%) if let Some(parent_ty) = cx.typeck_results().expr_ty_adjusted_opt(e) 4,961 ( 0.00%) => ???:::expr_ty_adjusted_opt (101x) 505 ( 0.00%) && let Some(field_def_id) = get_field_def_id_by_name(parent_ty, ident.name) 3,219 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::get_field_def_id_by_name (101x) . { 98 ( 0.00%) (field_def_id, ident.span) . } else { . return; . } . }, . _ => return, . }; . if let Some(&(path, disallowed_path)) = self.disallowed.get(&id) { . span_lint_and_then( . cx, . DISALLOWED_FIELDS, . span, . format!("use of a disallowed field `{path}`"), . disallowed_path.diag_amendment(span), . ); . } 412,452 ( 0.02%) } . 20,296 ( 0.00%) fn check_pat(&mut self, cx: &LateContext<'tcx>, pat: &'tcx Pat<'_>) { 5,162 ( 0.00%) let PatKind::Struct(struct_path, pat_fields, _) = pat.kind else { . return; . }; 374 ( 0.00%) match cx.typeck_results().qpath_res(&struct_path, pat.hir_id) { 330 ( 0.00%) => ???:::qpath_res (22x) . Res::Def(DefKind::Struct, struct_def_id) => { . let adt_def = cx.tcx.adt_def(struct_def_id); . for field in pat_fields { . if let Some(def_id) = adt_def.all_fields().find_map(|adt_field| { . if field.ident.name == adt_field.name { . Some(adt_field.did) . } else { . None -- line 120 ---------------------------------------- -- line 126 ---------------------------------------- . DISALLOWED_FIELDS, . field.span, . format!("use of a disallowed field `{path}`"), . disallowed_path.diag_amendment(field.span), . ); . } . } . }, 44 ( 0.00%) Res::Def(DefKind::Variant, variant_def_id) => { 66 ( 0.00%) let enum_def_id = cx.tcx.parent(variant_def_id); 88 ( 0.00%) let variant = cx.tcx.adt_def(enum_def_id).variant_with_id(variant_def_id); 319 ( 0.00%) => ???:::variant_with_id (22x) . . for field in pat_fields { . if let Some(def_id) = variant.fields.iter().find_map(|adt_field| { . if field.ident.name == adt_field.name { . Some(adt_field.did) . } else { . None . } -- line 144 ---------------------------------------- -- line 151 ---------------------------------------- . format!("use of a disallowed field `{path}`"), . disallowed_path.diag_amendment(field.span), . ); . } . } . }, . _ => {}, . } 20,296 ( 0.00%) } . } 88 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint/src/context.rs -------------------------------------------------------------------------------- Ir -- line 523 ---------------------------------------- . lint: &'static Lint, . span: Option, . decorate: impl for<'a> Diagnostic<'a, ()>, . ); . . /// Emit a lint at `span` from a lint struct (some type that implements `Diagnostic`, . /// typically generated by `#[derive(Diagnostic)]`). . #[track_caller] 30,495 ( 0.00%) fn emit_span_lint>( . &self, . lint: &'static Lint, . span: S, . decorator: impl for<'a> Diagnostic<'a, ()>, . ) { . self.opt_span_lint(lint, Some(span), decorator); 21,378 ( 0.00%) } . . /// This returns the lint level spec for the given lint at the current location. . fn get_lint_level_spec(&self, lint: &'static Lint) -> LevelSpec; . . /// This function can be used to manually fulfill an expectation. This can . /// be used for lints which contain several spans, and should be suppressed, . /// if either location was marked with an expectation. . /// -- line 546 ---------------------------------------- -- line 584 ---------------------------------------- . } . } . . impl<'tcx> LintContext for LateContext<'tcx> { . type LintExpectationId = StableLintExpectationId; . . /// Gets the overall compiler `Session` object. . fn sess(&self) -> &Session { 904,814 ( 0.04%) self.tcx.sess . } . . fn opt_span_lint>( . &self, . lint: &'static Lint, . span: Option, . decorate: impl for<'a> Diagnostic<'a, ()>, . ) { 90 ( 0.00%) let hir_id = self.last_node_with_lint_attrs; . 90 ( 0.00%) match span { 315 ( 0.00%) Some(s) => self.tcx.emit_node_span_lint(lint, hir_id, s, decorate), . None => self.tcx.emit_node_lint(lint, hir_id, decorate), . } . } . . fn get_lint_level_spec(&self, lint: &'static Lint) -> StableLevelSpec { . self.tcx.lint_level_spec_at_node(lint, self.last_node_with_lint_attrs) . } . } -- line 612 ---------------------------------------- -- line 660 ---------------------------------------- . } . . /// Gets the type-checking results for the current body. . /// As this will ICE if called outside bodies, only call when working with . /// `Expr` or `Pat` nodes (they are guaranteed to be found only in bodies). . #[inline] . #[track_caller] . pub fn typeck_results(&self) -> &'tcx ty::TypeckResults<'tcx> { 211,168 ( 0.01%) self.typeck_results.expect("`LateContext::typeck_results` called outside of body") . } . . /// Returns the final resolution of a `QPath`, or `Res::Err` if unavailable. . /// Unlike `.typeck_results().qpath_res(qpath, id)`, this can be used even outside . /// bodies (e.g. for paths in `hir::Ty`), without any risk of ICE-ing. . pub fn qpath_res(&self, qpath: &hir::QPath<'_>, id: hir::HirId) -> Res { . match *qpath { . hir::QPath::Resolved(_, path) => path.res, -- line 676 ---------------------------------------- -- line 949 ---------------------------------------- . fn data_layout(&self) -> &abi::TargetDataLayout { . &self.tcx.data_layout . } . } . . impl<'tcx> ty::layout::HasTyCtxt<'tcx> for LateContext<'tcx> { . #[inline] . fn tcx(&self) -> TyCtxt<'tcx> { 808 ( 0.00%) self.tcx . } . } . . impl<'tcx> ty::layout::HasTypingEnv<'tcx> for LateContext<'tcx> { . #[inline] . fn typing_env(&self) -> ty::TypingEnv<'tcx> { 10 ( 0.00%) self.typing_env() 162 ( 0.00%) => ???:::typing_env (6x) . } . } . . impl<'tcx> LayoutOfHelpers<'tcx> for LateContext<'tcx> { . type LayoutOfResult = Result, LayoutError<'tcx>>; . . #[inline] . fn handle_layout_err(&self, err: LayoutError<'tcx>, _: Span, _: Ty<'tcx>) -> LayoutError<'tcx> { -- line 972 ---------------------------------------- 71,165 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_rotate.rs -------------------------------------------------------------------------------- Ir -- line 52 ---------------------------------------- . f.write_str(match self { . Self::Left => "rotate_left", . Self::Right => "rotate_right", . }) . } . } . . fn parse_shift<'tcx>(expr: &'tcx Expr<'tcx>) -> Option<(ShiftDirection, &'tcx Expr<'tcx>, &'tcx Expr<'tcx>)> { 48 ( 0.00%) if let ExprKind::Binary(op, l, r) = expr.kind { 4 ( 0.00%) let dir = match op.node { . BinOpKind::Shl => ShiftDirection::Left, . BinOpKind::Shr => ShiftDirection::Right, . _ => return None, . }; . return Some((dir, l, r)); . } . None . } . . impl LateLintPass<'_> for ManualRotate { 481,194 ( 0.02%) fn check_expr<'tcx>(&mut self, cx: &LateContext<'tcx>, expr: &Expr<'tcx>) { 137,731 ( 0.01%) if let ExprKind::Binary(op, l, r) = expr.kind 226 ( 0.00%) && let BinOpKind::Add | BinOpKind::BitOr = op.node . && let Some((l_shift_dir, l_expr, l_amount)) = parse_shift(l) . && let Some((r_shift_dir, r_expr, r_amount)) = parse_shift(r) . && l_shift_dir != r_shift_dir . && let ctxt = expr.span.ctxt() . && clippy_utils::eq_expr_value(cx, ctxt, l_expr, r_expr) . && let Some(bit_width) = match cx.typeck_results().expr_ty(expr).kind() { . ty::Int(itype) => itype.bit_width(), . ty::Uint(itype) => itype.bit_width(), -- line 82 ---------------------------------------- -- line 130 ---------------------------------------- . expr.span, . "this expression can be rewritten as", . format!("{expr_sugg}.{shift_function}({amount})"), . applicability, . ); . }, . ); . } 549,936 ( 0.03%) } . } 1 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/box_default.rs -------------------------------------------------------------------------------- Ir -- line 31 ---------------------------------------- . pub BOX_DEFAULT, . style, . "Using Box::new(T::default()) instead of Box::default()" . } . . declare_lint_pass!(BoxDefault => [BOX_DEFAULT]); . . impl LateLintPass<'_> for BoxDefault { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { . // If the expression is a call (`Box::new(...)`) 138,048 ( 0.01%) if let ExprKind::Call(box_new, [arg]) = expr.kind . // And call is of the form `::something` . // Here, it would be `::new` 686 ( 0.00%) && let ExprKind::Path(QPath::TypeRelative(ty, seg)) = box_new.kind . // And that method is `new` 18 ( 0.00%) && seg.ident.name == sym::new . // And the call is that of a `Box` method 12 ( 0.00%) && ty.basic_res().is_lang_item(cx, LangItem::OwnedBox) . // And the single argument to the call is another function call . // This is the `T::default()` (or default equivalent) of `Box::new(T::default())` . && let ExprKind::Call(arg_path, _) = arg.kind . // And we are not in a foreign crate's macro . && !expr.span.in_external_macro(cx.sess().source_map()) . // And the argument expression has the same context as the outer call expression . // or that we are inside a `vec!` macro expansion . && (expr.span.eq_ctxt(arg.span) || is_local_vec_expn(cx, arg, expr)) -- line 56 ---------------------------------------- -- line 62 ---------------------------------------- . BOX_DEFAULT, . expr.span, . "`Box::new(_)` of default value", . "try", . "Box::default()".into(), . Applicability::MachineApplicable, . ); . } 549,936 ( 0.03%) } . } . . fn is_plain_default(cx: &LateContext<'_>, arg_path: &Expr<'_>) -> bool { . // we need to match the actual path so we don't match e.g. "u8::default" . if let ExprKind::Path(QPath::Resolved(None, path)) = &arg_path.kind . && let Res::Def(_, def_id) = path.res . { . // avoid generic parameters -- line 78 ---------------------------------------- 4 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint/src/passes.rs -------------------------------------------------------------------------------- Ir -- line 169 ---------------------------------------- . fn check_where_predicate_post(a: &rustc_ast::WherePredicate); . ]); . ) . } . . macro_rules! declare_early_lint_pass { . ([], [$(fn $name:ident($($param:ident: $arg:ty),*);)*]) => ( . pub trait EarlyLintPass: LintPass { 148,740 ( 0.01%) $(#[inline(always)] fn $name(&mut self, _: &EarlyContext<'_>, $(_: $arg),*) {})* . } . ) . } . . // Declare the `EarlyLintPass` trait, which contains empty default definitions . // for all the `check_*` methods. . early_lint_methods!(declare_early_lint_pass, []); . -- line 185 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/only_used_in_recursion.rs -------------------------------------------------------------------------------- Ir -- line 213 ---------------------------------------- . impl Usage { . fn new(span: Span, idx: usize) -> Self { . Self { span, idx } . } . } . . /// The parameters being checked by the lint, indexed by both the parameter's `HirId` and the . /// `DefId` of the function paired with the parameter's index. 2 ( 0.00%) #[derive(Default)] . #[expect(clippy::struct_field_names)] . struct Params { . params: Vec, . by_id: HirIdMap, . by_fn: FxHashMap<(DefId, usize), usize>, . } . impl Params { . fn insert(&mut self, param: Param, id: HirId) { -- line 229 ---------------------------------------- -- line 230 ---------------------------------------- . let idx = self.params.len(); . self.by_id.insert(id, idx); . self.by_fn.insert((param.fn_id, param.idx), idx); . self.params.push(param); . } . . fn remove_by_id(&mut self, id: HirId) { . if let Some(param) = self.get_by_id_mut(id) { 234 ( 0.00%) param.uses = Vec::new(); 312 ( 0.00%) let key = (param.fn_id, param.idx); . self.by_fn.remove(&key); . // FIXME(rust/#120456) - is `swap_remove` correct? 156 ( 0.00%) self.by_id.swap_remove(&id); 7,728 ( 0.00%) => /rust/deps/indexmap-2.14.0/src/map.rs:>::swap_remove:: (78x) . } . } . . fn get_by_id_mut(&mut self, id: HirId) -> Option<&mut Param> { 1,840 ( 0.00%) self.params.get_mut(*self.by_id.get(&id)?) 9,922 ( 0.00%) => /rust/deps/indexmap-2.14.0/src/map.rs:>::get:: (460x) . } . . fn get_by_fn(&self, id: DefId, idx: usize) -> Option<&Param> { . self.params.get(*self.by_fn.get(&(id, idx))?) . } . . fn clear(&mut self) { . self.params.clear(); -- line 255 ---------------------------------------- -- line 257 ---------------------------------------- . self.by_fn.clear(); . } . . /// Sets the `apply_lint` flag on each parameter. . fn flag_for_linting(&self) { . // Stores the list of parameters currently being resolved. Needed to avoid cycles. . let mut eval_stack = Vec::new(); . for param in &self.params { 234 ( 0.00%) self.try_disable_lint_for_param(param, &mut eval_stack); 546 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/only_used_in_recursion.rs:::try_disable_lint_for_param (78x) . } . } . . // Use by calling `flag_for_linting`. . fn try_disable_lint_for_param(&self, param: &Param, eval_stack: &mut Vec) -> bool { 156 ( 0.00%) if !param.apply_lint.get() { . true 78 ( 0.00%) } else if param.uses.is_empty() { . // Don't lint on unused parameters. . param.apply_lint.set(false); . true . } else if eval_stack.contains(¶m.idx) { . // Already on the evaluation stack. Returning false will continue to evaluate other dependencies. . false . } else { . eval_stack.push(param.idx); -- line 281 ---------------------------------------- -- line 290 ---------------------------------------- . param.apply_lint.set(false); . eval_stack.pop(); . return true; . } . } . eval_stack.pop(); . false . } 78 ( 0.00%) } . } . 11 ( 0.00%) #[derive(Default)] . pub struct OnlyUsedInRecursion { . /// Track the top-level body entered. Needed to delay reporting when entering nested bodies. . entered_body: Option, . params: Params, . } . . impl<'tcx> LateLintPass<'tcx> for OnlyUsedInRecursion { 1,128 ( 0.00%) fn check_body(&mut self, cx: &LateContext<'tcx>, body: &Body<'tcx>) { 423 ( 0.00%) if body.value.span.from_expansion() { . return; . } . // `skip_params` is either `0` or `1` to skip the `self` parameter in trait functions. . // It can't be renamed, and it can't be removed without removing it from multiple functions. 1,632 ( 0.00%) let (fn_id, fn_kind, skip_params) = match cx.tcx.parent_hir_node(body.value.hir_id) { 11,616 ( 0.00%) => ???:::parent_hir_node (132x) 162 ( 0.00%) Node::Item(i) => (i.owner_id.to_def_id(), FnKind::Fn, 0), . Node::TraitItem(&TraitItem { . kind: TraitItemKind::Fn(ref sig, _), . owner_id, . .. . }) => ( . owner_id.to_def_id(), . FnKind::TraitFn, . usize::from(sig.decl.implicit_self().has_implicit_self()), . ), . Node::ImplItem(&ImplItem { . kind: ImplItemKind::Fn(ref sig, _), 36 ( 0.00%) owner_id, 36 ( 0.00%) impl_kind, . .. . }) => { 117 ( 0.00%) if let ImplItemImplKind::Trait { trait_item_def_id, .. } = impl_kind . && let Ok(trait_item_id) = trait_item_def_id . { . let impl_id = cx.tcx.local_parent(owner_id.def_id); 54 ( 0.00%) let trait_ref = cx.tcx.impl_trait_ref(impl_id).instantiate_identity().skip_norm_wip(); 1,107 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/ty/mod.rs:::impl_trait_ref:: (27x) . ( . trait_item_id, . FnKind::ImplTraitFn( . std::ptr::from_ref(cx.tcx.erase_and_anonymize_regions(trait_ref.args)) as usize . ), . usize::from(sig.decl.implicit_self().has_implicit_self()), . ) . } else { . (owner_id.to_def_id(), FnKind::Fn, 0) . } . }, . _ => return, . }; 234 ( 0.00%) body.params . .iter() . .enumerate() . .skip(skip_params) 316 ( 0.00%) .filter_map(|(idx, p)| match p.pat.kind { 784 ( 0.00%) PatKind::Binding(_, id, ident, None) if !ident.as_str().starts_with('_') => { 2,528 ( 0.00%) => ???:::as_str (79x) . Some((id, Param::new(fn_id, fn_kind, idx, ident))) . }, . _ => None, . }) . .for_each(|(id, param)| self.params.insert(param, id)); 117 ( 0.00%) if self.entered_body.is_none() { 234 ( 0.00%) self.entered_body = Some(body.value.hir_id); . } 1,128 ( 0.00%) } . 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'tcx>) { . if let Some(id) = e.res_local_id() . && let Some(param) = self.params.get_by_id_mut(id) . { . let typeck = cx.typeck_results(); 78 ( 0.00%) let span = e.span; . let mut e = e; . loop { 658 ( 0.00%) match get_expr_use_or_unification_node(cx.tcx, e) { 19,832 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_expr_use_or_unification_node (103x) . None | Some((Node::Stmt(_), _)) => return, 1,116 ( 0.00%) Some((Node::Expr(parent), child_id)) => match parent.kind { . // Recursive call. Track which index the parameter is used in. . ExprKind::Call(callee, args) 286 ( 0.00%) if callee.res(cx).opt_def_id().is_some_and(|id| { 39 ( 0.00%) id == param.fn_id && has_matching_args(param.fn_kind, typeck.node_args(callee.hir_id)) 156 ( 0.00%) }) => . { . if let Some(idx) = args.iter().position(|arg| arg.hir_id == child_id) { . param.uses.push(Usage::new(span, idx)); . } . return; . }, . ExprKind::MethodCall(_, receiver, args, _) 273 ( 0.00%) if typeck.type_dependent_def_id(parent.hir_id).is_some_and(|id| { 1,071 ( 0.00%) => ???:::type_dependent_def_id (21x) . id == param.fn_id && has_matching_args(param.fn_kind, typeck.node_args(parent.hir_id)) . }) => . { . if let Some(idx) = iter::once(receiver).chain(args).position(|arg| arg.hir_id == child_id) { . param.uses.push(Usage::new(span, idx)); . } . return; . }, -- line 397 ---------------------------------------- -- line 402 ---------------------------------------- . // Parameter update e.g. `x = x + 1` . ExprKind::Assign(lhs, rhs, _) | ExprKind::AssignOp(_, lhs, rhs) . if rhs.hir_id == child_id && lhs.res_local_id() == Some(id) => . { . return; . }, . // Side-effect free expressions. Walk to the parent expression. . ExprKind::Binary(_, lhs, rhs) 120 ( 0.00%) if typeck.expr_ty(lhs).is_primitive() && typeck.expr_ty(rhs).is_primitive() => 1,200 ( 0.00%) => ???:::expr_ty (30x) . { . e = parent; . continue; . }, . ExprKind::Unary(_, arg) if typeck.expr_ty(arg).is_primitive() => { . e = parent; . continue; . }, -- line 418 ---------------------------------------- -- line 428 ---------------------------------------- . _ => (), . }, . _ => (), . } . self.params.remove_by_id(id); . return; . } . } 549,936 ( 0.03%) } . 987 ( 0.00%) fn check_body_post(&mut self, cx: &LateContext<'tcx>, body: &Body<'tcx>) { 130 ( 0.00%) if self.entered_body == Some(body.value.hir_id) { 117 ( 0.00%) self.entered_body = None; . self.params.flag_for_linting(); . for param in &self.params.params { 156 ( 0.00%) if param.apply_lint.get() { . if param.ident.name == kw::SelfLower { . span_lint_and_then( . cx, . SELF_ONLY_USED_IN_RECURSION, . param.ident.span, . "`self` is only used in recursion", . |diag| { . diag.span_note( -- line 451 ---------------------------------------- -- line 473 ---------------------------------------- . ); . }, . ); . } . } . } . self.params.clear(); . } 1,128 ( 0.00%) } . } . . fn has_matching_args(kind: FnKind, args: GenericArgsRef<'_>) -> bool { . match kind { . FnKind::Fn => true, . FnKind::TraitFn => args.iter().enumerate().all(|(idx, subst)| match subst.kind() { . GenericArgKind::Lifetime(_) => true, . GenericArgKind::Type(ty) => matches!(*ty.kind(), ty::Param(ty) if ty.index as usize == idx), -- line 489 ---------------------------------------- 1,669 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_utils/src/visitors.rs -------------------------------------------------------------------------------- Ir -- line 87 ---------------------------------------- . } . V::Result::output() . } . } . macro_rules! visitable_ref { . ($t:ident, $f:ident) => { . impl<'tcx> Visitable<'tcx> for &'tcx $t<'tcx> { . fn visit>(self, visitor: &mut V) -> V::Result { 340 ( 0.00%) visitor.$f(self) 7,564 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/visitors.rs:::{closure#0}> as rustc_hir::intravisit::Visitor>::visit_expr (20x) . } . } . }; . } . visitable_ref!(Arm, visit_arm); . visitable_ref!(Block, visit_block); . visitable_ref!(Body, visit_body); . visitable_ref!(Expr, visit_expr); . visitable_ref!(Stmt, visit_stmt); . . /// Calls the given function once for each expression contained. This does not enter any bodies or . /// nested items. 28 ( 0.00%) pub fn for_each_expr_without_closures<'tcx, B, C: Continue>( . node: impl Visitable<'tcx>, . f: impl FnMut(&'tcx Expr<'tcx>) -> ControlFlow, . ) -> Option { . struct V { . f: F, . } . impl<'tcx, B, C: Continue, F: FnMut(&'tcx Expr<'tcx>) -> ControlFlow> Visitor<'tcx> for V { . type Result = ControlFlow; . 3,374 ( 0.00%) fn visit_expr(&mut self, e: &'tcx Expr<'tcx>) -> Self::Result { 137,279 ( 0.01%) match (self.f)(e) { 229,680 ( 0.01%) ControlFlow::Continue(c) if c.descend() => walk_expr(self, e), 2,982,754 ( 0.14%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_expr::> (141x) . ControlFlow::Break(b) => ControlFlow::Break(b), . ControlFlow::Continue(_) => ControlFlow::Continue(()), . } 1,304 ( 0.00%) } . . // Avoid unnecessary `walk_*` calls. . fn visit_ty(&mut self, _: &'tcx hir::Ty<'tcx, AmbigArg>) -> Self::Result { . ControlFlow::Continue(()) . } . fn visit_pat(&mut self, _: &'tcx Pat<'tcx>) -> Self::Result { . ControlFlow::Continue(()) . } -- line 132 ---------------------------------------- -- line 133 ---------------------------------------- . fn visit_qpath(&mut self, _: &'tcx QPath<'tcx>, _: HirId, _: Span) -> Self::Result { . ControlFlow::Continue(()) . } . // Avoid monomorphising all `visit_*` functions. . fn visit_nested_item(&mut self, _: ItemId) -> Self::Result { . ControlFlow::Continue(()) . } . } 981 ( 0.00%) let mut v = V { f }; . node.visit(&mut v).break_value() 28 ( 0.00%) } . . /// Calls the given function once for each expression contained. This will enter bodies, but not . /// nested items. . pub fn for_each_expr<'tcx, B, C: Continue>( . tcx: TyCtxt<'tcx>, . node: impl Visitable<'tcx>, . f: impl FnMut(&'tcx Expr<'tcx>) -> ControlFlow, . ) -> Option { -- line 151 ---------------------------------------- -- line 156 ---------------------------------------- . impl<'tcx, B, C: Continue, F: FnMut(&'tcx Expr<'tcx>) -> ControlFlow> Visitor<'tcx> for V<'tcx, F> { . type NestedFilter = nested_filter::OnlyBodies; . type Result = ControlFlow; . . fn maybe_tcx(&mut self) -> Self::MaybeTyCtxt { . self.tcx . } . 2,295 ( 0.00%) fn visit_expr(&mut self, e: &'tcx Expr<'tcx>) -> Self::Result { 10 ( 0.00%) match (self.f)(e) { 766 ( 0.00%) ControlFlow::Continue(c) if c.descend() => walk_expr(self, e), 232,003 ( 0.01%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_expr::> (23x) . ControlFlow::Break(b) => ControlFlow::Break(b), . ControlFlow::Continue(_) => ControlFlow::Continue(()), . } 2,040 ( 0.00%) } . . // Only walk closures . fn visit_anon_const(&mut self, _: &'tcx AnonConst) -> Self::Result { . ControlFlow::Continue(()) . } . // Avoid unnecessary `walk_*` calls. . fn visit_ty(&mut self, _: &'tcx hir::Ty<'tcx, AmbigArg>) -> Self::Result { . ControlFlow::Continue(()) -- line 178 ---------------------------------------- -- line 183 ---------------------------------------- . fn visit_qpath(&mut self, _: &'tcx QPath<'tcx>, _: HirId, _: Span) -> Self::Result { . ControlFlow::Continue(()) . } . // Avoid monomorphising all `visit_*` functions. . fn visit_nested_item(&mut self, _: ItemId) -> Self::Result { . ControlFlow::Continue(()) . } . } 156 ( 0.00%) let mut v = V { tcx, f }; . node.visit(&mut v).break_value() . } . . /// returns `true` if expr contains match expr desugared from try . fn contains_try(expr: &Expr<'_>) -> bool { . for_each_expr_without_closures(expr, |e| { . if matches!(e.kind, ExprKind::Match(_, _, hir::MatchSource::TryDesugar(_))) { . ControlFlow::Break(()) -- line 199 ---------------------------------------- -- line 307 ---------------------------------------- . } . ControlFlow::Continue(()) . }) . .is_some() . } . . /// Checks if the given local is used. . pub fn is_local_used<'tcx>(cx: &LateContext<'tcx>, visitable: impl Visitable<'tcx>, id: HirId) -> bool { 2 ( 0.00%) for_each_expr(cx.tcx, visitable, |e| { . if e.res_local_id() == Some(id) { . ControlFlow::Break(()) . } else { . ControlFlow::Continue(()) . } . }) . .is_some() . } . . /// Returns whether the given expression can be evaluated as a constant assuming that all its sub . /// expressions can be evaluated as constants. 12 ( 0.00%) fn is_const_evaluatable_helper<'tcx>(tcx: TyCtxt<'tcx>, typeck: &'tcx TypeckResults<'tcx>, e: &'tcx Expr<'_>) -> bool { 37 ( 0.00%) match e.kind { . ExprKind::Call( . &Expr { 3 ( 0.00%) kind: ExprKind::Path(ref p), . hir_id, . .. . }, . _, 9 ( 0.00%) ) if typeck 12 ( 0.00%) .qpath_res(p, hir_id) 45 ( 0.00%) => ???:::qpath_res (3x) . .opt_def_id() 15 ( 0.00%) .is_some_and(|id| is_stable_const_fn_at(tcx, CRATE_HIR_ID, id, Msrv::default())) => 360 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/qualify_min_const_fn.rs:clippy_utils::qualify_min_const_fn::is_stable_const_fn_at (3x) . { . true . }, . ExprKind::MethodCall(..) . if typeck 5 ( 0.00%) .type_dependent_def_id(e.hir_id) 51 ( 0.00%) => ???:::type_dependent_def_id (1x) 9 ( 0.00%) .is_some_and(|id| is_stable_const_fn_at(tcx, CRATE_HIR_ID, id, Msrv::default())) => 1,452 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/qualify_min_const_fn.rs:clippy_utils::qualify_min_const_fn::is_stable_const_fn_at (1x) . { . true . }, . ExprKind::Binary(_, lhs, rhs) . if typeck.expr_ty(lhs).peel_refs().is_primitive_ty() . && typeck.expr_ty(rhs).peel_refs().is_primitive_ty() => . { . true -- line 354 ---------------------------------------- -- line 392 ---------------------------------------- . | ExprKind::Repeat(..) . | ExprKind::Struct(..) . | ExprKind::Tup(_) . | ExprKind::Type(..) . | ExprKind::UnsafeBinderCast(..) => true, . . _ => false, . } 15 ( 0.00%) } . . /// Checks if the given expression can be evaluated as a constant at the specified node 12 ( 0.00%) pub fn is_const_evaluatable<'tcx>(tcx: TyCtxt<'tcx>, typeck: &'tcx TypeckResults<'tcx>, e: &'tcx Expr<'_>) -> bool { . for_each_expr(tcx, e, move |e| { 28 ( 0.00%) if !is_const_evaluatable_helper(tcx, typeck, e) { 2,054 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/visitors.rs:clippy_utils::visitors::is_const_evaluatable_helper (4x) . ControlFlow::Break(()) . } else if matches!(e.kind, ExprKind::ConstBlock(_)) { . ControlFlow::Continue(Descend::No) . } else { . ControlFlow::Continue(Descend::Yes) . } . }) . .is_none() 12 ( 0.00%) } . . /// Checks if the given expression can be used as a const parameter. . /// . /// This is more strict than `is_const_evaluatable` as it requires that the expression does not . /// contain any type parameters or any operations on const parameters. . pub fn is_const_param_evaluatable<'tcx>( . tcx: TyCtxt<'tcx>, . typeck: &'tcx TypeckResults<'tcx>, -- line 422 ---------------------------------------- 3,200 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/operators/mod.rs -------------------------------------------------------------------------------- Ir -- line 1033 ---------------------------------------- . modulo_arithmetic_allow_comparison_to_zero: bool, . msrv: Msrv, . } . . impl Operators { . pub fn new(conf: &'static Conf) -> Self { . Self { . arithmetic_context: numeric_arithmetic::Context::default(), 2 ( 0.00%) verbose_bit_mask_threshold: conf.verbose_bit_mask_threshold, 1 ( 0.00%) modulo_arithmetic_allow_comparison_to_zero: conf.allow_comparison_to_zero, . msrv: conf.msrv.into(), . } . } . } . . impl<'tcx> LateLintPass<'tcx> for Operators { 687,420 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 206,226 ( 0.01%) eq_op::check_assert(cx, e); 6,534,028 ( 0.30%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/eq_op.rs:clippy_lints::operators::eq_op::check_assert (68,742x) 206,226 ( 0.01%) float_cmp::check_assert(cx, e); 4,196,800 ( 0.20%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/float_cmp.rs:clippy_lints::operators::float_cmp::check_assert (68,742x) 428,964 ( 0.02%) match e.kind { 228 ( 0.00%) ExprKind::Binary(op, lhs, rhs) => { 152 ( 0.00%) if !e.span.from_expansion() { 450 ( 0.00%) absurd_extreme_comparisons::check(cx, e, op.node, lhs, rhs); 31,232 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/absurd_extreme_comparisons.rs:clippy_lints::operators::absurd_extreme_comparisons::check (75x) . if !(macro_with_not_op(lhs) || macro_with_not_op(rhs)) { 450 ( 0.00%) eq_op::check(cx, e, op.node, lhs, rhs); 83,389 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/eq_op.rs:clippy_lints::operators::eq_op::check (75x) 450 ( 0.00%) op_ref::check(cx, e, op.node, lhs, rhs); 5,654 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/op_ref.rs:clippy_lints::operators::op_ref::check (75x) . } . erasing_op::check(cx, e, op.node, lhs, rhs); 450 ( 0.00%) identity_op::check(cx, e, op.node, lhs, rhs); 73,709 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/identity_op.rs:clippy_lints::operators::identity_op::check (75x) . invalid_upcast_comparisons::check(cx, op.node, lhs, rhs, e.span); 525 ( 0.00%) needless_bitwise_bool::check(cx, e, op.node, lhs, rhs); 1,585 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/needless_bitwise_bool.rs:clippy_lints::operators::needless_bitwise_bool::check (75x) 600 ( 0.00%) manual_midpoint::check(cx, e, op.node, lhs, rhs, self.msrv); 2,110 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/manual_midpoint.rs:clippy_lints::operators::manual_midpoint::check (75x) 525 ( 0.00%) manual_is_multiple_of::check(cx, e, op.node, lhs, rhs, self.msrv); 3,975 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/manual_is_multiple_of.rs:clippy_lints::operators::manual_is_multiple_of::check (75x) 525 ( 0.00%) manual_isolate_lowest_one::check(cx, e, op.node, lhs, rhs, self.msrv); 1,372 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/manual_isolate_lowest_one.rs:clippy_lints::operators::manual_isolate_lowest_one::check (75x) 375 ( 0.00%) decimal_bitwise_operands::check(cx, op.node, lhs, rhs); 1,492 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/decimal_bitwise_operands.rs:clippy_lints::operators::decimal_bitwise_operands::check (75x) . } 532 ( 0.00%) self.arithmetic_context.check_binary(cx, e, op.node, lhs, rhs); 6,264 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/numeric_arithmetic.rs:::check_binary (76x) 456 ( 0.00%) bit_mask::check(cx, e, op.node, lhs, rhs); 5,478 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/bit_mask.rs:clippy_lints::operators::bit_mask::check (76x) . verbose_bit_mask::check(cx, e, op.node, lhs, rhs, self.verbose_bit_mask_threshold); 532 ( 0.00%) double_comparison::check(cx, op.node, lhs, rhs, e.span); 8,632 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/double_comparison.rs:clippy_lints::operators::double_comparison::check (76x) 456 ( 0.00%) const_comparisons::check(cx, op, lhs, rhs, e.span); 8,520 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/const_comparisons.rs:clippy_lints::operators::const_comparisons::check (76x) 456 ( 0.00%) duration_subsec::check(cx, e, op.node, lhs, rhs); 1,296 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/duration_subsec.rs:clippy_lints::operators::duration_subsec::check (76x) 456 ( 0.00%) float_equality_without_abs::check(cx, e, op.node, lhs, rhs); 1,695 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/float_equality_without_abs.rs:clippy_lints::operators::float_equality_without_abs::check (76x) 456 ( 0.00%) integer_division::check(cx, e, op.node, lhs, rhs); 3,880 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/integer_division.rs:clippy_lints::operators::integer_division::check (76x) 456 ( 0.00%) integer_division_remainder_used::check(cx, op.node, lhs, rhs, e.span); 12,287 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/integer_division_remainder_used.rs:clippy_lints::operators::integer_division_remainder_used::check (76x) . cmp_owned::check(cx, e, op.node, lhs, rhs); 407 ( 0.00%) float_cmp::check(cx, e, op.node, lhs, rhs); 2,580 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/float_cmp.rs:clippy_lints::operators::float_cmp::check (76x) . modulo_one::check(cx, e, op.node, rhs); 456 ( 0.00%) modulo_arithmetic::check( 6,632 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/modulo_arithmetic.rs:clippy_lints::operators::modulo_arithmetic::check (76x) . cx, . e, . op.node, . lhs, . rhs, 76 ( 0.00%) self.modulo_arithmetic_allow_comparison_to_zero, . ); 1,064 ( 0.00%) manual_div_ceil::check(cx, e, op.node, lhs, rhs, self.msrv); 1,728 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/manual_div_ceil.rs:clippy_lints::operators::manual_div_ceil::check (76x) . }, 6 ( 0.00%) ExprKind::AssignOp(op, lhs, rhs) => { . let bin_op = op.node.into(); 4 ( 0.00%) if !e.span.from_expansion() { 10 ( 0.00%) decimal_bitwise_operands::check(cx, bin_op, lhs, rhs); 36 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/decimal_bitwise_operands.rs:clippy_lints::operators::decimal_bitwise_operands::check (2x) . } 16 ( 0.00%) self.arithmetic_context.check_binary(cx, e, bin_op, lhs, rhs); 266 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/numeric_arithmetic.rs:::check_binary (2x) 12 ( 0.00%) misrefactored_assign_op::check(cx, e, bin_op, lhs, rhs); 6 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/misrefactored_assign_op.rs:clippy_lints::operators::misrefactored_assign_op::check (2x) 28 ( 0.00%) modulo_arithmetic::check(cx, e, bin_op, lhs, rhs, false); 34 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/modulo_arithmetic.rs:clippy_lints::operators::modulo_arithmetic::check (2x) . }, 56 ( 0.00%) ExprKind::Assign(lhs, rhs, _) => { 168 ( 0.00%) assign_op_pattern::check(cx, e, lhs, rhs, self.msrv); 420 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/assign_op_pattern.rs:clippy_lints::operators::assign_op_pattern::check (28x) 336 ( 0.00%) self_assignment::check(cx, e, lhs, rhs); 21,274 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/self_assignment.rs:clippy_lints::operators::self_assignment::check (28x) . }, . ExprKind::Unary(op, arg) => . { . #[expect(clippy::collapsible_match)] . if op == UnOp::Neg { . self.arithmetic_context.check_negate(cx, e, arg); . } . }, . _ => (), . } 549,088 ( 0.03%) } . . fn check_expr_post(&mut self, _: &LateContext<'_>, e: &Expr<'_>) { . self.arithmetic_context.expr_post(e.hir_id); . } . . fn check_body(&mut self, cx: &LateContext<'tcx>, b: &Body<'_>) { . self.arithmetic_context.enter_body(cx, b); . } . . fn check_body_post(&mut self, cx: &LateContext<'tcx>, b: &Body<'_>) { . self.arithmetic_context.body_post(cx, b); . } . } . . fn macro_with_not_op(e: &Expr<'_>) -> bool { 300 ( 0.00%) if let ExprKind::Unary(_, e) = e.kind { . e.span.from_expansion() . } else { . false . } . } 51,639 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/else_if_without_else.rs -------------------------------------------------------------------------------- Ir -- line 42 ---------------------------------------- . restriction, . "`if` expression with an `else if`, but without a final `else` branch" . } . . declare_lint_pass!(ElseIfWithoutElse => [ELSE_IF_WITHOUT_ELSE]); . . impl EarlyLintPass for ElseIfWithoutElse { . fn check_expr(&mut self, cx: &EarlyContext<'_>, item: &Expr) { 144,142 ( 0.01%) if let ExprKind::If(_, _, Some(ref els)) = item.kind 18 ( 0.00%) && let ExprKind::If(_, _, None) = els.kind . && !item.span.in_external_macro(cx.sess().source_map()) . { . #[expect(clippy::collapsible_span_lint_calls, reason = "rust-clippy#7797")] . span_lint_and_then( . cx, . ELSE_IF_WITHOUT_ELSE, . els.span, . "`if` expression with an `else if`, but without a final `else`", -- line 59 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/returns/needless_return.rs -------------------------------------------------------------------------------- Ir -- line 55 ---------------------------------------- . } . } . . pub(super) fn check_fn<'tcx>(cx: &LateContext<'tcx>, kind: FnKind<'tcx>, body: &'tcx Body<'tcx>, sp: Span) { . if sp.from_expansion() { . return; . } . 190 ( 0.00%) match kind { . FnKind::Closure => { . // when returning without value in closure, replace this `return` . // with an empty block to prevent invalid suggestion (see #6501) 24 ( 0.00%) let replacement = if let ExprKind::Ret(None) = &body.value.kind { . RetReplacement::Block . } else { . RetReplacement::Empty . }; 24 ( 0.00%) check_final_expr(cx, body.value, vec![], replacement, None); 756 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/returns/needless_return.rs:clippy_lints::returns::needless_return::check_final_expr (12x) . }, . FnKind::ItemFn(..) | FnKind::Method(..) => { 249 ( 0.00%) check_block_return(cx, &body.value.kind, sp, vec![]); 138,510 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/returns/needless_return.rs:clippy_lints::returns::needless_return::check_block_return (83x) . }, . } . } . . // if `expr` is a block, check if there are needless returns in it 11,480 ( 0.00%) fn check_block_return<'tcx>(cx: &LateContext<'tcx>, expr_kind: &ExprKind<'tcx>, sp: Span, mut semi_spans: Vec) { 3,280 ( 0.00%) if let ExprKind::Block(block, _) = expr_kind { 396 ( 0.00%) if let Some(block_expr) = block.expr { 180 ( 0.00%) check_final_expr(cx, block_expr, semi_spans, RetReplacement::Empty, None); 18 ( 0.00%) } else if let Some(stmt) = block.stmts.last() { 45 ( 0.00%) if span_contains_cfg( 1,872 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/attrs.rs:clippy_utils::attrs::span_contains_cfg (4x) . cx, 27 ( 0.00%) Span::between( 428 ( 0.00%) => ???:::between (4x) 18 ( 0.00%) stmt.span, 18 ( 0.00%) cx.sess().source_map().end_point(block.span), // the closing brace of the block 1,500 ( 0.00%) => ???:::end_point (4x) . ), . ) { . return; . } 54 ( 0.00%) match stmt.kind { . StmtKind::Expr(expr) => { . check_final_expr(cx, expr, semi_spans, RetReplacement::Empty, None); . }, 9 ( 0.00%) StmtKind::Semi(semi_expr) => { . // Remove ending semicolons and any whitespace ' ' in between. . // Without `return`, the suggestion might not compile if the semicolon is retained 63 ( 0.00%) if let Some(semi_span) = stmt.span.trim_start(semi_expr.span) { 292 ( 0.00%) => ???:::trim_start (4x) . let semi_span_to_remove = 36 ( 0.00%) span_find_starting_semi(cx.sess().source_map(), semi_span.with_hi(sp.hi())); 2,182 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::span_find_starting_semi (4x) . semi_spans.push(semi_span_to_remove); . } 90 ( 0.00%) check_final_expr(cx, semi_expr, semi_spans, RetReplacement::Empty, None); . }, . _ => (), . } . } . } 13,048 ( 0.00%) } . 18,876 ( 0.00%) fn check_final_expr<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'tcx>, . semi_spans: Vec, /* containing all the places where we would need to remove semicolons if finding an . * needless return */ . replacement: RetReplacement<'tcx>, . match_ty_opt: Option>, . ) { . let peeled_drop_expr = expr.peel_drop_temps(); 32 ( 0.00%) match &peeled_drop_expr.kind { . // simple return is always "bad" . ExprKind::Ret(inner) => { . // check if expr return nothing . let ret_span = if inner.is_none() && replacement == RetReplacement::Empty { . extend_span_to_previous_non_ws(cx, peeled_drop_expr.span) . } else { . peeled_drop_expr.span . }; -- line 132 ---------------------------------------- -- line 205 ---------------------------------------- . peeled_drop_expr.span, . ret_span, . semi_spans, . &replacement, . expr.hir_id, . ); . }, . ExprKind::If(_, then, else_clause_opt) => { 36 ( 0.00%) check_block_return(cx, &then.kind, peeled_drop_expr.span, semi_spans.clone()); 4,137 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/returns/needless_return.rs:clippy_lints::returns::needless_return::check_block_return'2 (5x) 18 ( 0.00%) if let Some(else_clause) = else_clause_opt { . // The `RetReplacement` won't be used there as `else_clause` will be either a block or . // a `if` expression. 35 ( 0.00%) check_final_expr(cx, else_clause, semi_spans, RetReplacement::Empty, match_ty_opt); 4,334 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/returns/needless_return.rs:clippy_lints::returns::needless_return::check_final_expr'2 (5x) . } . }, . // a match expr, check all arms . // an if/if let expr, check both exprs . // note, if without else is going to be a type checking error anyways . // (except for unit type functions) so we don't match it . ExprKind::Match(_, arms, MatchSource::Normal) => { 32 ( 0.00%) let match_ty = cx.typeck_results().expr_ty(peeled_drop_expr); 640 ( 0.00%) => ???:::expr_ty (16x) 16 ( 0.00%) for arm in *arms { 10,199 ( 0.00%) check_final_expr(cx, arm.body, semi_spans.clone(), RetReplacement::Unit, Some(match_ty)); 92,075 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/returns/needless_return.rs:clippy_lints::returns::needless_return::check_final_expr'2 (1,457x) . } . }, . // if it's a whole block, check it 15,510 ( 0.00%) other_expr_kind => check_block_return(cx, other_expr_kind, peeled_drop_expr.span, semi_spans), 3,403 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/returns/needless_return.rs:clippy_lints::returns::needless_return::check_block_return'2 (62x) 240 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/returns/needless_return.rs:clippy_lints::returns::needless_return::check_block_return (12x) . } 12,584 ( 0.00%) } . . fn emit_return_lint( . cx: &LateContext<'_>, . lint_span: Span, . ret_span: Span, . semi_spans: Vec, . replacement: &RetReplacement<'_>, . at: HirId, -- line 241 ---------------------------------------- 2,397 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/matches/rest_pat_in_fully_bound_struct.rs -------------------------------------------------------------------------------- Ir . use clippy_utils::diagnostics::span_lint_and_then; . use rustc_hir::{Pat, PatKind, QPath}; . use rustc_lint::LateContext; . use rustc_middle::ty; . . use super::REST_PAT_IN_FULLY_BOUND_STRUCTS; . 17,759 ( 0.00%) pub(crate) fn check(cx: &LateContext<'_>, pat: &Pat<'_>) { 5,074 ( 0.00%) if !pat.span.from_expansion() 4,960 ( 0.00%) && let PatKind::Struct(QPath::Resolved(_, path), fields, Some(dotdot)) = pat.kind . && let Some(def_id) = path.res.opt_def_id() . && let ty = cx.tcx.type_of(def_id).instantiate_identity().skip_norm_wip() . && let ty::Adt(def, _) = ty.kind() . && (def.is_struct() || def.is_union()) . && fields.len() == def.non_enum_variant().fields.len() . && !def.non_enum_variant().is_field_list_non_exhaustive() . { . span_lint_and_then( -- line 18 ---------------------------------------- -- line 25 ---------------------------------------- . dotdot, . "consider removing `..` from this binding", . "", . rustc_errors::Applicability::MachineApplicable, . ); . }, . ); . } 20,296 ( 0.00%) } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/single_range_in_vec_init.rs -------------------------------------------------------------------------------- Ir -- line 65 ---------------------------------------- . } else { . write!(f, "an array") . } . } . } . . impl LateLintPass<'_> for SingleRangeInVecInit { . #[expect(clippy::too_many_lines)] 618,678 ( 0.03%) fn check_expr<'tcx>(&mut self, cx: &LateContext<'tcx>, expr: &Expr<'tcx>) { . // inner_expr: `vec![0..200]` or `[0..200]` . // ^^^^^^ ^^^^^^^ . // span: `vec![0..200]` or `[0..200]` . // ^^^^^^^^^^^^ ^^^^^^^^ . // suggested_type: What to print, "an array" or "a `Vec`" 137,518 ( 0.01%) let (inner_expr, span, suggested_type) = if let ExprKind::Array([inner_expr]) = expr.kind . && !expr.span.from_expansion() . { . (inner_expr, expr.span, SuggestedType::Array) . } else if let Some(macro_call) = root_macro_call_first_node(cx, expr) . && let Some(VecArgs::Vec([expr])) = VecArgs::hir(cx, expr) . { . (expr, macro_call.span, SuggestedType::Vec) . } else { -- line 87 ---------------------------------------- -- line 188 ---------------------------------------- . format!("if you wanted {suggested_type} of len {end_snippet}, try"), . format!("{start_snippet}; {end_snippet}"), . applicability, . ); . } . } . }, . ); 549,936 ( 0.03%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/char/methods.rs -------------------------------------------------------------------------------- Ir -- line 897 ---------------------------------------- . /// assert!(!CAPITAL_DELTA_IS_LOWERCASE); . /// ``` . #[must_use] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_unicode_case_lookup", since = "1.84.0")] . #[inline] . pub const fn is_lowercase(self) -> bool { . match self { 124 ( 0.00%) 'a'..='z' => true, . '\0'..='\u{A9}' => false, . _ => unicode::Lowercase(self), . } . } . . /// Returns `true` if this `char` is in the general category for titlecase letters. . /// Conceptually, these characters consist of an uppercase portion followed by a lowercase portion. . /// -- line 913 ---------------------------------------- -- line 973 ---------------------------------------- . /// assert!(CAPITAL_DELTA_IS_UPPERCASE); . /// ``` . #[must_use] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_unicode_case_lookup", since = "1.84.0")] . #[inline] . pub const fn is_uppercase(self) -> bool { . match self { 6,940 ( 0.00%) 'A'..='Z' => true, 4,404 ( 0.00%) '\0'..='\u{BF}' => false, . _ => unicode::Uppercase(self), . } . } . . /// Returns `true` if this `char` has one of the general categories for numbers. . /// . /// The general categories for numbers (`Nd` for decimal digits, `Nl` for letter-like numeric . /// characters, and `No` for other numeric characters) are [specified] in the Unicode Character -- line 990 ---------------------------------------- -- line 1080 ---------------------------------------- . /// . /// assert!(!'越'.is_whitespace()); . /// ``` . #[must_use] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_char_classify", since = "1.87.0")] . #[inline] . pub const fn is_whitespace(self) -> bool { 454,226 ( 0.02%) match self { . ' ' | '\x09'..='\x0d' => true, 103,892 ( 0.00%) '\0'..='\u{84}' => false, . _ => unicode::White_Space(self), . } . } . . /// Returns `true` if this `char` has the general category for control codes. . /// . /// Control codes (code points with the general category of `Cc`) are [described] in Chapter 23 . /// (Special Areas and Format Characters) of the Unicode Standard, and [specified] in the Unicode Character -- line 1098 ---------------------------------------- -- line 1414 ---------------------------------------- . /// holds across languages. . /// . /// [`SpecialCasing.txt`]: https://www.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt . #[must_use = "this returns the lowercased character as a new iterator, \ . without modifying the original"] . #[stable(feature = "rust1", since = "1.0.0")] . #[inline] . pub fn to_lowercase(self) -> ToLowercase { 15 ( 0.00%) ToLowercase(CaseMappingIter::new(conversions::to_lower(self))) 105 ( 0.00%) => ???:core::unicode::unicode_data::conversions::to_lower (5x) . } . . /// Returns an iterator that yields the titlecase mapping of this `char` as one or more . /// `char`s. . /// . /// This is usually, but not always, equivalent to the uppercase mapping . /// returned by [`to_uppercase()`]. Prefer this method when seeking to capitalize . /// Only The First Letter of a word, but use [`to_uppercase()`] for ALL CAPS. -- line 1430 ---------------------------------------- -- line 1703 ---------------------------------------- . /// holds across languages. . /// . /// [`to_titlecase()`]: Self::to_titlecase() . #[must_use = "this returns the uppercased character as a new iterator, \ . without modifying the original"] . #[stable(feature = "rust1", since = "1.0.0")] . #[inline] . pub fn to_uppercase(self) -> ToUppercase { 795 ( 0.00%) ToUppercase(CaseMappingIter::new(conversions::to_upper(self))) 5,830 ( 0.00%) => ???:core::unicode::unicode_data::conversions::to_upper (265x) . } . . /// Returns an iterator that yields the case folding of this `char` as one or more . /// `char`s. . /// . /// Case folding is meant to be used when performing case-insensitive string comparisons. . /// Case-folded strings should not usually be exposed directly to users. For most, . /// but not all, characters, the casefold mapping is identical to the lowercase one. -- line 1719 ---------------------------------------- -- line 2206 ---------------------------------------- . /// assert!(!lf.is_ascii_digit()); . /// assert!(!esc.is_ascii_digit()); . /// ``` . #[must_use] . #[stable(feature = "ascii_ctype_on_intrinsics", since = "1.24.0")] . #[rustc_const_stable(feature = "const_ascii_ctype_on_intrinsics", since = "1.47.0")] . #[inline] . pub const fn is_ascii_digit(&self) -> bool { 220,989 ( 0.01%) matches!(*self, '0'..='9') . } . . /// Checks if the value is an ASCII octal digit: . /// U+0030 '0' ..= U+0037 '7'. . /// . /// # Examples . /// . /// ``` -- line 2222 ---------------------------------------- -- line 2475 ---------------------------------------- . escape_double_quote: true, . }; . } . . #[inline] . #[must_use] . const fn len_utf8(code: u32) -> usize { . match code { 3,142 ( 0.00%) ..MAX_ONE_B => 1, . ..MAX_TWO_B => 2, . ..MAX_THREE_B => 3, . _ => 4, . } . } . . #[inline] . #[must_use] -- line 2491 ---------------------------------------- -- line 2547 ---------------------------------------- . #[doc(hidden)] . #[inline] . pub const unsafe fn encode_utf8_raw_unchecked(code: u32, dst: *mut u8) { . let len = len_utf8(code); . // SAFETY: The caller must guarantee that the buffer pointed to by `dst` . // is at least `len` bytes long. . unsafe { . if len == 1 { 3,016 ( 0.00%) *dst = code as u8; . return; . } . . let last1 = (code >> 0 & 0x3F) as u8 | TAG_CONT; . let last2 = (code >> 6 & 0x3F) as u8 | TAG_CONT; . let last3 = (code >> 12 & 0x3F) as u8 | TAG_CONT; . let last4 = (code >> 18 & 0x3F) as u8 | TAG_FOUR_B; . -- line 2563 ---------------------------------------- 1,596 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/cloned_ref_to_slice_refs.rs -------------------------------------------------------------------------------- Ir -- line 58 ---------------------------------------- . } . impl ClonedRefToSliceRefs { . pub fn new(conf: &Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl<'tcx> LateLintPass<'tcx> for ClonedRefToSliceRefs { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &Expr<'tcx>) { . // `&[foo.clone()]` expressions 137,572 ( 0.01%) if let ExprKind::AddrOf(_, mutability, arr) = &expr.kind . // mutable references would have a different meaning . && mutability.is_not() . . // check for single item arrays 142 ( 0.00%) && let ExprKind::Array([item]) = &arr.kind . . // check for clones . && let ExprKind::MethodCall(path, recv, _, _) = item.kind . . && self.msrv.meets(cx, { . if is_in_const_context(cx) { . msrvs::CONST_SLICE_FROM_REF . } else { -- line 81 ---------------------------------------- -- line 101 ---------------------------------------- . "unnecessary use of `{}` to create a slice from a reference", . path.ident.name . ), . "try", . format!("{builtin_crate}::slice::from_ref({adjustment}{sugg})"), . applicability, . ); . } 549,936 ( 0.03%) } . } . . /// Checks if a method call is a needless clone or equivalent. If so, returns the necessary . /// adjustments to use the method receiver directly without cloning. . /// For example, in the code below: . /// ```rust,no_run . /// use std::path::PathBuf; . /// -- line 117 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/format.rs -------------------------------------------------------------------------------- Ir -- line 47 ---------------------------------------- . . impl UselessFormat { . pub fn new(format_args: FormatArgsStorage) -> Self { . Self { format_args } . } . } . . impl<'tcx> LateLintPass<'tcx> for UselessFormat { 687,420 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . // Loosened from `root_macro_call_first_node` so the lint also fires when `format!` is . // the tail of a block emitted by another macro. The `!= macro_call.expn` check filters . // HIR nodes inside `format!`'s own expansion (its outer block's tail, its nested . // `format_args!`), which would otherwise also pass `first_node_in_macro` and cause the . // lint to fire multiple times per call. 343,710 ( 0.02%) if let Some(macro_call) = matching_root_macro_call(cx, expr.span, sym::format_macro) 4,663,930 ( 0.22%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::matching_root_macro_call (68,742x) . && first_node_in_macro(cx, expr).is_some_and(|p_expn| p_expn != macro_call.expn) . && let Some(format_args) = self.format_args.get(cx, expr, macro_call.expn) . { . let mut applicability = Applicability::MachineApplicable; . let call_site = macro_call.span; . . match (format_args.arguments.all_args(), &format_args.template[..]) { . ([], []) => span_useless_format_empty(cx, call_site, "String::new()".to_owned(), applicability), -- line 69 ---------------------------------------- -- line 101 ---------------------------------------- . format!("{}.to_string()", sugg.maybe_paren()) . }; . span_useless_format(cx, call_site, sugg, applicability); . } . }, . _ => {}, . } . } 549,936 ( 0.03%) } . } . . fn span_useless_format_empty(cx: &LateContext<'_>, span: Span, sugg: String, applicability: Applicability) { . span_lint_and_sugg( . cx, . USELESS_FORMAT, . span, . "useless use of `format!`", -- line 117 ---------------------------------------- 68,742 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_non_exhaustive.rs -------------------------------------------------------------------------------- Ir -- line 66 ---------------------------------------- . pub struct ManualNonExhaustive { . msrv: Msrv, . constructed_enum_variants: FxHashSet, . potential_enums: Vec<(LocalDefId, LocalDefId, Span, Span)>, . } . . impl ManualNonExhaustive { . pub fn new(conf: &'static Conf) -> Self { 8 ( 0.00%) Self { . msrv: conf.msrv.into(), . constructed_enum_variants: FxHashSet::default(), . potential_enums: Vec::new(), . } . } . } . . impl<'tcx> LateLintPass<'tcx> for ManualNonExhaustive { 2,343 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) { 1,977 ( 0.00%) if !cx.effective_visibilities.is_exported(item.owner_id.def_id) || !self.msrv.meets(cx, msrvs::NON_EXHAUSTIVE) { 12,739 ( 0.00%) => ???:::is_exported (213x) 2,187 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (81x) . return; . } . . match item.kind { . ItemKind::Enum(_, _, def) if def.variants.len() > 1 => { . let iter = def.variants.iter().filter_map(|v| { . (matches!(v.data, VariantData::Unit(_, _)) && is_doc_hidden(cx.tcx.hir_attrs(v.hir_id))) . .then_some((v.def_id, v.span)) -- line 92 ---------------------------------------- -- line 142 ---------------------------------------- . // ``` . diag.span_help(field.span, "remove this field"); . }, . ); . } . }, . _ => {}, . } 1,704 ( 0.00%) } . . fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 145,674 ( 0.01%) if let ExprKind::Path(QPath::Resolved(None, p)) = &e.kind 16,750 ( 0.00%) && let Res::Def(DefKind::Ctor(CtorOf::Variant, CtorKind::Const), ctor_id) = p.res . && let Some(local_ctor) = ctor_id.as_local() . { 4,197 ( 0.00%) let variant_id = cx.tcx.local_parent(local_ctor); 64,354 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/ty/mod.rs:::local_parent:: (1,399x) . self.constructed_enum_variants.insert(variant_id); . } . } . 8 ( 0.00%) fn check_crate_post(&mut self, cx: &LateContext<'tcx>) { . for (enum_id, _, enum_span, variant_span) in std::mem::take(&mut self.potential_enums) . .into_iter() . .filter(|(_, variant_id, _, _)| !self.constructed_enum_variants.contains(variant_id)) . { . let hir_id = cx.tcx.local_def_id_to_hir_id(enum_id); . span_lint_hir_and_then( . cx, . MANUAL_NON_EXHAUSTIVE, -- line 170 ---------------------------------------- -- line 180 ---------------------------------------- . Applicability::MaybeIncorrect, . ); . // FIXME: Ideally this would be a suggestion, but the span for that is annoying to get. . // See the comment above for examples. . diag.span_help(variant_span, "remove this variant"); . }, . ); . } 8 ( 0.00%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/format_impl.rs -------------------------------------------------------------------------------- Ir -- line 103 ---------------------------------------- . pub struct FormatImpl { . format_args: FormatArgsStorage, . // Whether we are inside Display or Debug trait impl - None for neither . format_trait_impl: Option, . } . . impl FormatImpl { . pub fn new(format_args: FormatArgsStorage) -> Self { 2 ( 0.00%) Self { . format_args, . format_trait_impl: None, . } . } . } . . impl<'tcx> LateLintPass<'tcx> for FormatImpl { . fn check_impl_item(&mut self, cx: &LateContext<'_>, impl_item: &ImplItem<'_>) { 245 ( 0.00%) self.format_trait_impl = is_format_trait_impl(cx, impl_item); 2,046 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/format_impl.rs:clippy_lints::format_impl::is_format_trait_impl (49x) . } . . fn check_impl_item_post(&mut self, cx: &LateContext<'_>, impl_item: &ImplItem<'_>) { . // Assume no nested Impl of Debug and Display within each other 196 ( 0.00%) if is_format_trait_impl(cx, impl_item).is_some() { 2,046 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/format_impl.rs:clippy_lints::format_impl::is_format_trait_impl (49x) 5 ( 0.00%) self.format_trait_impl = None; . } . } . 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 206,340 ( 0.01%) if let Some(format_trait_impl) = self.format_trait_impl { 684 ( 0.00%) let linter = FormatImplExpr { . cx, 114 ( 0.00%) format_args: &self.format_args, . expr, . format_trait_impl, . }; . linter.check_to_string_in_display(); . linter.check_self_in_format_args(); . linter.check_print_in_format_impl(); . } 549,936 ( 0.03%) } . } . . struct FormatImplExpr<'a, 'tcx> { . cx: &'a LateContext<'tcx>, . format_args: &'a FormatArgsStorage, . expr: &'tcx Expr<'tcx>, . format_trait_impl: FormatTraitNames, . } . . impl FormatImplExpr<'_, '_> { . fn check_to_string_in_display(&self) { 300 ( 0.00%) if self.format_trait_impl.name == sym::Display 3 ( 0.00%) && let ExprKind::MethodCall(path, self_arg, [], _) = self.expr.kind . // Get the hir_id of the object we are calling the method on . // Is the method to_string() ? 3 ( 0.00%) && path.ident.name == sym::to_string . // Is the method a part of the ToString trait? (i.e. not to_string() implemented . // separately) . && self . .cx . .typeck_results() . .type_dependent_def_id(self.expr.hir_id) . .opt_parent(self.cx) . .is_diag_item(self.cx, sym::ToString) -- line 166 ---------------------------------------- -- line 250 ---------------------------------------- . format!("{replacement}!(..)") . }, . Applicability::HasPlaceholders, . ); . } . } . } . 98 ( 0.00%) fn is_format_trait_impl(cx: &LateContext<'_>, impl_item: &ImplItem<'_>) -> Option { 98 ( 0.00%) if impl_item.ident.name == sym::fmt 40 ( 0.00%) && let ImplItemKind::Fn(_, body_id) = impl_item.kind 20 ( 0.00%) && let Some(Impl { . of_trait: Some(of_trait), . .. 50 ( 0.00%) }) = get_parent_as_impl(cx.tcx, impl_item.hir_id()) 1,760 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_as_impl (10x) 30 ( 0.00%) && let Some(did) = of_trait.trait_ref.trait_def_id() 130 ( 0.00%) => ???:::trait_def_id (10x) 50 ( 0.00%) && let Some(name) = cx.tcx.get_diagnostic_name(did) 770 ( 0.00%) => ???:::get_diagnostic_name (10x) . && matches!(name, sym::Debug | sym::Display) . { 40 ( 0.00%) let body = cx.tcx.hir_body(body_id); 520 ( 0.00%) => ???:::hir_body (10x) 10 ( 0.00%) let formatter_name = body . .params . .get(1) 10 ( 0.00%) .and_then(|param| param.pat.simple_ident()) . .map(|ident| ident.name); . . Some(FormatTraitNames { name, formatter_name }) . } else { . None . } 98 ( 0.00%) } 368 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_utils/src/lib.rs -------------------------------------------------------------------------------- Ir -- line 128 ---------------------------------------- . /// Methods on `Vec` that also exists on slices. . pub const VEC_METHODS_SHADOWING_SLICE_METHODS: [Symbol; 3] = [sym::as_ptr, sym::is_empty, sym::len]; . . #[macro_export] . macro_rules! extract_msrv_attr { . () => { . fn check_attributes(&mut self, cx: &rustc_lint::EarlyContext<'_>, attrs: &[rustc_ast::ast::Attribute]) { . let sess = rustc_lint::LintContext::sess(cx); 1,708,597 ( 0.08%) self.msrv.check_attributes(attrs); 913,848 ( 0.04%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_attributes (297,164x) . } . . fn check_attributes_post(&mut self, cx: &rustc_lint::EarlyContext<'_>, attrs: &[rustc_ast::ast::Attribute]) { . let sess = rustc_lint::LintContext::sess(cx); 1,634,306 ( 0.08%) self.msrv.check_attributes_post(attrs); 913,848 ( 0.04%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_attributes_post (297,164x) . } . }; . } . . /// If the given expression is a local binding, find the initializer expression. . /// If that initializer expression is another local binding, find its initializer again. . /// . /// This process repeats as long as possible (but usually no more than once). Initializer -- line 149 ---------------------------------------- -- line 160 ---------------------------------------- . /// . /// // or... . /// let abc = 1; . /// let def = abc + 2; . /// // ^^^^^^^ output . /// dbg!(def); . /// // ^^^ input . /// ``` 1,053 ( 0.00%) pub fn expr_or_init<'a, 'b, 'tcx: 'b>(cx: &LateContext<'tcx>, mut expr: &'a Expr<'b>) -> &'a Expr<'b> { . while let Some(init) = expr . .res_local_id() . .and_then(|id| find_binding_init(cx, id)) 9 ( 0.00%) .filter(|init| cx.typeck_results().expr_adjustments(init).is_empty()) 83 ( 0.00%) => ???:::expr_adjustments (3x) . { . expr = init; . } . expr 630 ( 0.00%) } . . /// Finds the initializer expression for a local binding. Returns `None` if the binding is mutable. . /// . /// By only considering immutable bindings, we guarantee that the returned expression represents the . /// value of the binding wherever it is referenced. . /// . /// Example: For `let x = 1`, if the `HirId` of `x` is provided, the `Expr` `1` is returned. . /// Note: If you have an expression that references a binding `x`, use `path_to_local` to get the . /// canonical binding `HirId`. . pub fn find_binding_init<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId) -> Option<&'tcx Expr<'tcx>> { 88 ( 0.00%) if let Node::Pat(pat) = cx.tcx.hir_node(hir_id) 572 ( 0.00%) => ???:::hir_node (11x) 66 ( 0.00%) && matches!(pat.kind, PatKind::Binding(BindingMode::NONE, ..)) 80 ( 0.00%) && let Node::LetStmt(local) = cx.tcx.parent_hir_node(hir_id) 968 ( 0.00%) => ???:::parent_hir_node (11x) . { 3 ( 0.00%) return local.init; . } . None . } . . /// Checks if the given local has an initializer or is from something other than a `let` statement . /// . /// e.g. returns true for `x` in `fn f(x: usize) { .. }` and `let x = 1;` but false for `let x;` . pub fn local_is_initialized(cx: &LateContext<'_>, local: HirId) -> bool { -- line 200 ---------------------------------------- -- line 216 ---------------------------------------- . /// `tcx.hir_is_inside_const_context(_)`. . /// . /// Do not call this unless the `LateContext` has an enclosing body. For release build this case . /// will safely return `false`, but debug builds will ICE. Note that `check_expr`, `check_block`, . /// `check_pat` and a few other entry points will always have an enclosing body. Some entry points . /// like `check_path` or `check_ty` may or may not have one. . pub fn is_in_const_context(cx: &LateContext<'_>) -> bool { . debug_assert!(cx.enclosing_body.is_some(), "`LateContext` has no enclosing body"); 2,290 ( 0.00%) cx.enclosing_body.is_some_and(|id| { 1,145 ( 0.00%) cx.tcx 5,725 ( 0.00%) .hir_body_const_context(cx.tcx.hir_body_owner_def_id(id)) 171,813 ( 0.01%) => ???:::hir_body_const_context (1,145x) 117,943 ( 0.01%) => ???:::hir_body_owner_def_id (1,145x) . .is_some() . }) 1,145 ( 0.00%) } . . /// Returns `true` if the given `HirId` is inside an always constant context. . /// . /// This context includes: . /// * const/static items . /// * const blocks (or inline consts) . /// * associated constants 510 ( 0.00%) pub fn is_inside_always_const_context(tcx: TyCtxt<'_>, hir_id: HirId) -> bool { . use rustc_hir::ConstContext::{Const, ConstFn, Static}; 2,040 ( 0.00%) let Some(ctx) = tcx.hir_body_const_context(tcx.hir_enclosing_body_owner(hir_id)) else { 102,035 ( 0.00%) => ???:::hir_enclosing_body_owner (255x) 38,796 ( 0.00%) => ???:::hir_body_const_context (255x) . return false; . }; . match ctx { . ConstFn => false, . Static(_) . | Const { . allow_const_fn_promotion: _, . } => true, . } 510 ( 0.00%) } . . /// Checks if `{ctor_call_id}(...)` is `{enum_item}::{variant_name}(...)`. . pub fn is_enum_variant_ctor( . cx: &LateContext<'_>, . enum_item: Symbol, . variant_name: Symbol, . ctor_call_id: DefId, . ) -> bool { -- line 257 ---------------------------------------- -- line 277 ---------------------------------------- . }, . _ => did, . }; . . cx.tcx.is_diagnostic_item(item, did) . } . . /// Checks if the `DefId` matches the given `LangItem` or it's constructor. 120 ( 0.00%) pub fn is_lang_item_or_ctor(cx: &LateContext<'_>, did: DefId, item: LangItem) -> bool { 84 ( 0.00%) let did = match cx.tcx.def_kind(did) { . DefKind::Ctor(..) => cx.tcx.parent(did), . // Constructors for types in external crates seem to have `DefKind::Variant` . DefKind::Variant => match cx.tcx.opt_parent(did) { . Some(did) if matches!(cx.tcx.def_kind(did), DefKind::Variant) => did, . _ => did, . }, . _ => did, . }; . 24 ( 0.00%) cx.tcx.lang_items().get(item) == Some(did) 360 ( 0.00%) => ???:::lang_items (12x) 96 ( 0.00%) } . . /// Checks is `expr` is `None` . pub fn is_none_expr(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { 9 ( 0.00%) expr.basic_res().ctor_parent(cx).is_lang_item(cx, OptionNone) 165 ( 0.00%) } . . /// If `expr` is `Some(inner)`, returns `inner` 6 ( 0.00%) pub fn as_some_expr<'tcx>(cx: &LateContext<'_>, expr: &'tcx Expr<'tcx>) -> Option<&'tcx Expr<'tcx>> { 30 ( 0.00%) if let ExprKind::Call(e, [arg]) = expr.kind 30 ( 0.00%) && e.basic_res().ctor_parent(cx).is_lang_item(cx, OptionSome) . { . Some(arg) . } else { . None . } 6 ( 0.00%) } . . /// Check if the given `Expr` is an empty block (i.e. `{}`) or not. . pub fn is_empty_block(expr: &Expr<'_>) -> bool { . matches!( . expr.kind, . ExprKind::Block( . Block { . stmts: [], -- line 321 ---------------------------------------- -- line 324 ---------------------------------------- . }, . _, . ) . ) . } . . /// Checks if `expr` is an empty block or an empty tuple. . pub fn is_unit_expr(expr: &Expr<'_>) -> bool { 57 ( 0.00%) matches!( 38 ( 0.00%) expr.kind, . ExprKind::Block( . Block { . stmts: [], . expr: None, . .. . }, . _ . ) | ExprKind::Tup([]) . ) . } . . /// Checks if given pattern is a wildcard (`_`) . pub fn is_wild(pat: &Pat<'_>) -> bool { 729 ( 0.00%) matches!(pat.kind, PatKind::Wild) . } . . /// If `pat` is: . /// - `Some(inner)`, returns `inner` . /// - it will _usually_ contain just one element, but could have two, given patterns like . /// `Some(inner, ..)` or `Some(.., inner)` . /// - `Some`, returns `[]` . /// - otherwise, returns `None` 18 ( 0.00%) pub fn as_some_pattern<'a, 'hir>(cx: &LateContext<'_>, pat: &'a Pat<'hir>) -> Option<&'a [Pat<'hir>]> { 15 ( 0.00%) if let PatKind::TupleStruct(ref qpath, inner, _) = pat.kind 6 ( 0.00%) && cx 15 ( 0.00%) .qpath_res(qpath, pat.hir_id) 69 ( 0.00%) => ???:::qpath_res (3x) 3 ( 0.00%) .ctor_parent(cx) . .is_lang_item(cx, OptionSome) . { . Some(inner) . } else { . None . } 24 ( 0.00%) } . . /// Checks if the `pat` is `None`. . pub fn is_none_pattern(cx: &LateContext<'_>, pat: &Pat<'_>) -> bool { 541 ( 0.00%) matches!(pat.kind, 74 ( 0.00%) PatKind::Expr(PatExpr { kind: PatExprKind::Path(qpath), .. }) 444 ( 0.00%) if cx.qpath_res(qpath, pat.hir_id).ctor_parent(cx).is_lang_item(cx, OptionNone)) 1,495 ( 0.00%) => ???:::qpath_res (65x) 138 ( 0.00%) } . . /// Checks if `arm` has the form `None => None`. 120 ( 0.00%) pub fn is_none_arm(cx: &LateContext<'_>, arm: &Arm<'_>) -> bool { 47 ( 0.00%) is_none_pattern(cx, arm.pat) . && matches!( 18 ( 0.00%) peel_blocks(arm.body).kind, 1 ( 0.00%) ExprKind::Path(qpath) 6 ( 0.00%) if cx.qpath_res(&qpath, arm.body.hir_id).ctor_parent(cx).is_lang_item(cx, OptionNone) 23 ( 0.00%) => ???:::qpath_res (1x) . ) 140 ( 0.00%) } . . /// Checks if the given `QPath` belongs to a type alias. . pub fn is_ty_alias(qpath: &QPath<'_>) -> bool { 308 ( 0.00%) match *qpath { 1,608 ( 0.00%) QPath::Resolved(_, path) => matches!(path.res, Res::Def(DefKind::TyAlias | DefKind::AssocTy, ..)), 162 ( 0.00%) QPath::TypeRelative(ty, _) if let TyKind::Path(qpath) = ty.kind => is_ty_alias(&qpath), 288 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_ty_alias'2 (18x) . QPath::TypeRelative(..) => false, . } 154 ( 0.00%) } . . /// Checks if the `def_id` belongs to a function that is part of a trait impl. . pub fn is_def_id_trait_method(cx: &LateContext<'_>, def_id: LocalDefId) -> bool { . if let Node::Item(item) = cx.tcx.parent_hir_node(cx.tcx.local_def_id_to_hir_id(def_id)) . && let ItemKind::Impl(imp) = item.kind . { . imp.of_trait.is_some() . } else { . false . } . } . . pub fn last_path_segment<'tcx>(path: &QPath<'tcx>) -> &'tcx PathSegment<'tcx> { 652 ( 0.00%) match *path { 652 ( 0.00%) QPath::Resolved(_, path) => path.segments.last().expect("A path must have at least one segment"), . QPath::TypeRelative(_, seg) => seg, . } 315 ( 0.00%) } . . pub fn qpath_generic_tys<'tcx>(qpath: &QPath<'tcx>) -> impl Iterator> { 11 ( 0.00%) last_path_segment(qpath) . .args . .map_or(&[][..], |a| a.args) . .iter() 33 ( 0.00%) .filter_map(|a| match a { . GenericArg::Type(ty) => Some(ty.as_unambig_ty()), . _ => None, . }) 11 ( 0.00%) } . . /// If the expression is a path to a local (with optional projections), . /// returns the canonical `HirId` of the local. . /// . /// For example, `x.field[0].field2` would return the `HirId` of `x`. . pub fn path_to_local_with_projections(expr: &Expr<'_>) -> Option { . match expr.kind { . ExprKind::Field(recv, _) | ExprKind::Index(recv, _, _) => path_to_local_with_projections(recv), -- line 430 ---------------------------------------- -- line 448 ---------------------------------------- . /// impl std::ops::Add for Point { . /// type Output = Self; . /// . /// fn add(self, other: Self) -> Self { . /// Point(0, 0) . /// } . /// } . /// ``` 1,272 ( 0.00%) pub fn trait_ref_of_method<'tcx>(cx: &LateContext<'tcx>, owner: OwnerId) -> Option<&'tcx TraitRef<'tcx>> { 1,113 ( 0.00%) if let Node::Item(item) = cx.tcx.hir_node(cx.tcx.hir_owner_parent(owner)) 8,268 ( 0.00%) => ???:::hir_node (159x) 318 ( 0.00%) && let ItemKind::Impl(impl_) = &item.kind 159 ( 0.00%) && let Some(of_trait) = impl_.of_trait . { . return Some(&of_trait.trait_ref); . } . None 1,272 ( 0.00%) } . . /// This method will return tuple of projection stack and root of the expression, . /// used in `can_mut_borrow_both`. . /// . /// For example, if `e` represents the `v[0].a.b[x]` . /// this method will return a tuple, composed of a `Vec` . /// containing the `Expr`s for `v[0], v[0].a, v[0].a.b, v[0].a.b[x]` . /// and an `Expr` for root of them, `v` -- line 472 ---------------------------------------- -- line 786 ---------------------------------------- . // TODO: check if the local has been partially moved. Assume it has for now. . false . }, . _ => true, . } . } . . /// How a local is captured by a closure 14 ( 0.00%) #[derive(Debug, Clone, Copy, PartialEq, Eq)] . pub enum CaptureKind { . Value, . Use, . Ref(Mutability), . } . impl CaptureKind { . pub fn is_imm_ref(self) -> bool { . self == Self::Ref(Mutability::Not) -- line 802 ---------------------------------------- -- line 820 ---------------------------------------- . } . } . . /// Given an expression referencing a local, determines how it would be captured in a closure. . /// . /// Note as this will walk up to parent expressions until the capture can be determined it should . /// only be used while making a closure somewhere a value is consumed. e.g. a block, match arm, or . /// function argument (other than a receiver). 27 ( 0.00%) pub fn capture_local_usage(cx: &LateContext<'_>, e: &Expr<'_>) -> CaptureKind { . fn pat_capture_kind(cx: &LateContext<'_>, pat: &Pat<'_>) -> CaptureKind { . let mut capture = CaptureKind::Ref(Mutability::Not); . pat.each_binding_or_first(&mut |_, id, span, _| match cx . .typeck_results() . .extract_binding_mode(cx.sess(), id, span) . .0 . { . ByRef::No if !is_copy(cx, cx.typeck_results().node_type(id)) => { -- line 836 ---------------------------------------- -- line 847 ---------------------------------------- . debug_assert!(matches!( . e.kind, . ExprKind::Path(QPath::Resolved(None, Path { res: Res::Local(_), .. })) . )); . . let mut capture = CaptureKind::Value; . let mut capture_expr_ty = e; . 33 ( 0.00%) for (parent, child_id) in hir_parent_with_src_iter(cx.tcx, e.hir_id) { 7 ( 0.00%) if let [ . Adjustment { . kind: Adjust::Deref(_) | Adjust::Borrow(AutoBorrow::Ref(..)), . target, . }, . ref adjust @ .., 5 ( 0.00%) ] = *cx . .typeck_results() . .adjustments() . .get(child_id) . .map_or(&[][..], |x| &**x) 4 ( 0.00%) && let rustc_ty::RawPtr(_, mutability) | rustc_ty::Ref(_, _, mutability) = 1 ( 0.00%) *adjust.last().map_or(target, |a| a.target).kind() . { . return CaptureKind::Ref(mutability); . } . 8 ( 0.00%) match parent { 28 ( 0.00%) Node::Expr(e) => match e.kind { . ExprKind::AddrOf(_, mutability, _) => return CaptureKind::Ref(mutability), . ExprKind::Index(..) | ExprKind::Unary(UnOp::Deref, _) => capture = CaptureKind::Ref(Mutability::Not), 4 ( 0.00%) ExprKind::Assign(lhs, ..) | ExprKind::AssignOp(_, lhs, _) if lhs.hir_id == child_id => { . return CaptureKind::Ref(Mutability::Mut); . }, . ExprKind::Field(..) => { . if capture == CaptureKind::Value { . capture_expr_ty = e; . } . }, . ExprKind::Let(let_expr) => { -- line 885 ---------------------------------------- -- line 905 ---------------------------------------- . Node::LetStmt(l) => match pat_capture_kind(cx, l.pat) { . CaptureKind::Value | CaptureKind::Use => break, . capture @ CaptureKind::Ref(_) => return capture, . }, . _ => break, . } . } . 12 ( 0.00%) if capture == CaptureKind::Value && is_copy(cx, cx.typeck_results().expr_ty(capture_expr_ty)) { 80 ( 0.00%) => ???:::expr_ty (2x) . // Copy types are never automatically captured by value. . CaptureKind::Ref(Mutability::Not) . } else { . capture . } 27 ( 0.00%) } . . /// Checks if the expression can be moved into a closure as is. This will return a list of captures . /// if so, otherwise, `None`. . pub fn can_move_expr_to_closure<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) -> Option> { . struct V<'cx, 'tcx> { . cx: &'cx LateContext<'tcx>, . // Stack of potential break targets contained in the expression. . loops: Vec, -- line 927 ---------------------------------------- -- line 1030 ---------------------------------------- . } . . /// Matches an `Expr` against a chain of methods, and return the matched `Expr`s. . /// . /// For example, if `expr` represents the `.baz()` in `foo.bar().baz()`, . /// `method_chain_args(expr, &[sym::bar, sym::baz])` will return a `Vec` . /// containing the `Expr`s for . /// `.bar()` and `.baz()` 5,166 ( 0.00%) pub fn method_chain_args<'a>(expr: &'a Expr<'_>, methods: &[Symbol]) -> Option, &'a [Expr<'a>])>> { . let mut current = expr; . let mut matched = Vec::with_capacity(methods.len()); . for method_name in methods.iter().rev() { . // method chains are stored last -> first 1,565 ( 0.00%) if let ExprKind::MethodCall(path, receiver, args, _) = current.kind { 89 ( 0.00%) if path.ident.name == *method_name { . if receiver.span.from_expansion() || args.iter().any(|e| e.span.from_expansion()) { . return None; . } . matched.push((receiver, args)); // build up `matched` backwards . current = receiver; // go to parent expression . } else { . return None; . } . } else { . return None; . } . } . // Reverse `matched` so that it is in the same order as `methods`. . matched.reverse(); . Some(matched) 6,642 ( 0.00%) } . . /// Returns `true` if the provided `def_id` is an entrypoint to a program. 504 ( 0.00%) pub fn is_entrypoint_fn(cx: &LateContext<'_>, def_id: DefId) -> bool { 56 ( 0.00%) cx.tcx . .entry_fn(()) . .is_some_and(|(entry_fn_def_id, _)| def_id == entry_fn_def_id) 448 ( 0.00%) } . . /// Returns `true` if the expression is in the program's `#[panic_handler]`. . pub fn is_in_panic_handler(cx: &LateContext<'_>, e: &Expr<'_>) -> bool { . let parent = cx.tcx.hir_get_parent_item(e.hir_id); . Some(parent.to_def_id()) == cx.tcx.lang_items().panic_impl() . } . . /// Gets the name of the item the expression is in, if available. -- line 1075 ---------------------------------------- -- line 1118 ---------------------------------------- . } else { . ControlFlow::Continue(()) . } . }) . .is_some() . } . . /// Gets the parent expression, if any –- this is useful to constrain a lint. 69,766 ( 0.00%) pub fn get_parent_expr<'tcx>(cx: &LateContext<'tcx>, e: &Expr<'_>) -> Option<&'tcx Expr<'tcx>> { 139,532 ( 0.01%) get_parent_expr_for_hir(cx, e.hir_id) 139,532 ( 0.01%) } . . /// This retrieves the parent for the given `HirId` if it's an expression. This is useful for . /// constraint lints 66 ( 0.00%) pub fn get_parent_expr_for_hir<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId) -> Option<&'tcx Expr<'tcx>> { 279,152 ( 0.01%) match cx.tcx.parent_hir_node(hir_id) { 6,139,408 ( 0.29%) => ???:::parent_hir_node (69,766x) . Node::Expr(parent) => Some(parent), . _ => None, . } 44 ( 0.00%) } . . /// Gets the enclosing block, if any. 18 ( 0.00%) pub fn get_enclosing_block<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId) -> Option<&'tcx Block<'tcx>> { 9 ( 0.00%) let enclosing_node = cx . .tcx 18 ( 0.00%) .hir_get_enclosing_scope(hir_id) 2,259 ( 0.00%) => ???:::hir_get_enclosing_scope (9x) 27 ( 0.00%) .map(|enclosing_id| cx.tcx.hir_node(enclosing_id)); 468 ( 0.00%) => ???:::hir_node (9x) 54 ( 0.00%) enclosing_node.and_then(|node| match node { . Node::Block(block) => Some(block), . Node::Item(&Item { . kind: ItemKind::Fn { body: eid, .. }, . .. . }) . | Node::ImplItem(&ImplItem { . kind: ImplItemKind::Fn(_, eid), . .. -- line 1153 ---------------------------------------- -- line 1156 ---------------------------------------- . kind: TraitItemKind::Fn(_, TraitFn::Provided(eid)), . .. . }) => match cx.tcx.hir_body(eid).value.kind { . ExprKind::Block(block, _) => Some(block), . _ => None, . }, . _ => None, . }) 27 ( 0.00%) } . . /// Returns the [`Closure`] enclosing `hir_id`, if any. . pub fn get_enclosing_closure<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId) -> Option<&'tcx Closure<'tcx>> { . cx.tcx.hir_parent_iter(hir_id).find_map(|(_, node)| { . if let Node::Expr(expr) = node . && let ExprKind::Closure(closure) = expr.kind . { . Some(closure) -- line 1172 ---------------------------------------- -- line 1203 ---------------------------------------- . Node::Stmt(_) | Node::Block(_) | Node::LetStmt(_) | Node::Arm(_) | Node::ExprField(_) => (), . _ => break, . } . } . None . } . . /// Gets the parent node if it's an impl block. 10 ( 0.00%) pub fn get_parent_as_impl(tcx: TyCtxt<'_>, id: HirId) -> Option<&Impl<'_>> { 70 ( 0.00%) match tcx.hir_parent_iter(id).next() { . Some(( . _, . Node::Item(Item { . kind: ItemKind::Impl(imp), . .. . }), . )) => Some(imp), . _ => None, . } 20 ( 0.00%) } . . /// Removes blocks around an expression, only if the block contains just one expression . /// and no statements. Unsafe blocks are not removed. . /// . /// Examples: . /// * `{}` -> `{}` . /// * `{ x }` -> `x` . /// * `{{ x }}` -> `x` . /// * `{ x; }` -> `{ x; }` . /// * `{ x; y }` -> `{ x; y }` . /// * `{ unsafe { x } }` -> `unsafe { x }` . pub fn peel_blocks<'a>(mut expr: &'a Expr<'a>) -> &'a Expr<'a> { 349 ( 0.00%) while let ExprKind::Block( . Block { 159 ( 0.00%) stmts: [], . expr: Some(inner), . rules: BlockCheckMode::DefaultBlock, . .. . }, . _, 261 ( 0.00%) ) = expr.kind . { . expr = inner; . } . expr . } . . /// Removes blocks around an expression, only if the block contains just one expression . /// or just one expression statement with a semicolon. Unsafe blocks are not removed. -- line 1251 ---------------------------------------- -- line 1252 ---------------------------------------- . /// . /// Examples: . /// * `{}` -> `{}` . /// * `{ x }` -> `x` . /// * `{ x; }` -> `x` . /// * `{{ x; }}` -> `x` . /// * `{ x; y }` -> `{ x; y }` . /// * `{ unsafe { x } }` -> `unsafe { x }` 3 ( 0.00%) pub fn peel_blocks_with_stmt<'a>(mut expr: &'a Expr<'a>) -> &'a Expr<'a> { 4,718 ( 0.00%) while let ExprKind::Block( . Block { 322 ( 0.00%) stmts: [], . expr: Some(inner), . rules: BlockCheckMode::DefaultBlock, . .. . } . | Block { . stmts: . [ . Stmt { 29 ( 0.00%) kind: StmtKind::Expr(inner) | StmtKind::Semi(inner), . .. . }, . ], . expr: None, . rules: BlockCheckMode::DefaultBlock, . .. . }, . _, 190 ( 0.00%) ) = expr.kind . { 38 ( 0.00%) expr = inner; . } . expr 3 ( 0.00%) } . . /// Checks if the given expression is the else clause of either an `if` or `if let` expression. 228 ( 0.00%) pub fn is_else_clause(tcx: TyCtxt<'_>, expr: &Expr<'_>) -> bool { 152 ( 0.00%) let mut iter = tcx.hir_parent_iter(expr.hir_id); 152 ( 0.00%) match iter.next() { . Some(( . _, . Node::Expr(Expr { . kind: ExprKind::If(_, _, Some(else_expr)), . .. . }), . )) => else_expr.hir_id == expr.hir_id, . _ => false, . } 304 ( 0.00%) } . . /// Checks if the given expression is a part of `let else` . /// returns `true` for both the `init` and the `else` part . pub fn is_inside_let_else(tcx: TyCtxt<'_>, expr: &Expr<'_>) -> bool { . hir_parent_with_src_iter(tcx, expr.hir_id).any(|(node, child_id)| { . matches!( . node, . Node::LetStmt(LetStmt { -- line 1309 ---------------------------------------- -- line 1343 ---------------------------------------- . }) . } else { . false . } . } . . /// Checks whether the given expression is a constant literal of the given value. . pub fn is_integer_literal(expr: &Expr<'_>, value: u128) -> bool { 77 ( 0.00%) if let ExprKind::Lit(spanned) = expr.kind 16 ( 0.00%) && let LitKind::Int(v, _) = spanned.node . { . return v == value; . } . false . } . . /// Checks whether the given expression is an untyped integer literal. . pub fn is_integer_literal_untyped(expr: &Expr<'_>) -> bool { -- line 1360 ---------------------------------------- -- line 1363 ---------------------------------------- . { . return suffix == LitIntType::Unsuffixed; . } . . false . } . . /// Checks whether the given expression is a constant literal of the given value. 36 ( 0.00%) pub fn is_float_literal(expr: &Expr<'_>, value: f64) -> bool { 24 ( 0.00%) if let ExprKind::Lit(spanned) = expr.kind . && let LitKind::Float(v, _) = spanned.node . { . v.as_str().parse() == Ok(value) . } else { . false . } 36 ( 0.00%) } . . /// Returns `true` if the given `Expr` has been coerced before. . /// . /// Examples of coercions can be found in the Nomicon at . /// . . /// . /// See `rustc_middle::ty::adjustment::Adjustment` and `rustc_hir_analysis::check::coercion` for . /// more information on adjustments and coercions. 33 ( 0.00%) pub fn is_adjusted(cx: &LateContext<'_>, e: &Expr<'_>) -> bool { 22 ( 0.00%) cx.typeck_results().adjustments().get(e.hir_id).is_some() 44 ( 0.00%) } . . /// Returns the pre-expansion span if this comes from an expansion of the . /// macro `name`. . /// See also [`is_direct_expn_of`]. . #[must_use] 12,699 ( 0.00%) pub fn is_expn_of(mut span: Span, name: Symbol) -> Option { . loop { . if span.from_expansion() { . let data = span.ctxt().outer_expn_data(); 369 ( 0.00%) let new_span = data.call_site; . 360 ( 0.00%) if let ExpnKind::Macro(MacroKind::Bang, mac_name) = data.kind . && mac_name == name . { . return Some(new_span); . } . . span = new_span; . } else { 1,494 ( 0.00%) return None; . } . } 6,723 ( 0.00%) } . . /// Returns the pre-expansion span if the span directly comes from an expansion . /// of the macro `name`. . /// The difference with [`is_expn_of`] is that in . /// ```no_run . /// # macro_rules! foo { ($name:tt!$args:tt) => { $name!$args } } . /// # macro_rules! bar { ($e:expr) => { $e } } . /// foo!(bar!(42)); . /// ``` . /// `42` is considered expanded from `foo!` and `bar!` by `is_expn_of` but only . /// from `bar!` by `is_direct_expn_of`. . #[must_use] 432 ( 0.00%) pub fn is_direct_expn_of(span: Span, name: Symbol) -> Option { . if span.from_expansion() { . let data = span.ctxt().outer_expn_data(); . let new_span = data.call_site; . 44 ( 0.00%) if let ExpnKind::Macro(MacroKind::Bang, mac_name) = data.kind . && mac_name == name . { . return Some(new_span); . } . } . 48 ( 0.00%) None 240 ( 0.00%) } . . /// Convenience function to get the return type of a function. 308 ( 0.00%) pub fn return_ty<'tcx>(cx: &LateContext<'tcx>, fn_def_id: OwnerId) -> Ty<'tcx> { 44 ( 0.00%) let ret_ty = cx.tcx.fn_sig(fn_def_id).instantiate_identity().skip_norm_wip().output(); 176 ( 0.00%) cx.tcx.instantiate_bound_regions_with_erased(ret_ty) 1,188 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/ty/fold.rs:::instantiate_bound_regions_with_erased:: (44x) 308 ( 0.00%) } . . /// Convenience function to get the nth argument type of a function. . pub fn nth_arg<'tcx>(cx: &LateContext<'tcx>, fn_def_id: OwnerId, nth: usize) -> Ty<'tcx> { . let arg = cx . .tcx . .fn_sig(fn_def_id) . .instantiate_identity() . .skip_norm_wip() -- line 1453 ---------------------------------------- -- line 1545 ---------------------------------------- . && let Res::SelfTyParam { .. } | Res::SelfTyAlias { .. } = path.res . { . return true; . } . false . } . . pub fn iter_input_pats<'tcx>(decl: &FnDecl<'_>, body: &'tcx Body<'_>) -> impl Iterator> { 538 ( 0.00%) (0..decl.inputs.len()).map(move |i| &body.params[i]) . } . . /// Checks if a given expression is a match expression expanded from the `?` . /// operator or the `try` macro. . pub fn is_try<'tcx>(cx: &LateContext<'_>, expr: &'tcx Expr<'tcx>) -> Option<&'tcx Expr<'tcx>> { . fn is_ok(cx: &LateContext<'_>, arm: &Arm<'_>) -> bool { . if let PatKind::TupleStruct(ref path, pat, ddpos) = arm.pat.kind . && ddpos.as_opt_usize().is_none() -- line 1561 ---------------------------------------- -- line 1628 ---------------------------------------- . . /// Returns `true` if the lint is allowed in the current context. This is useful for . /// skipping long running code when it's unnecessary . /// . /// This function should check the lint level for the same node, that the lint will . /// be emitted at. If the information is buffered to be emitted at a later point, please . /// make sure to use `span_lint_hir` functions to emit the lint. This ensures that . /// expectations at the checked nodes will be fulfilled. 2,240 ( 0.00%) pub fn is_lint_allowed(cx: &LateContext<'_>, lint: &'static Lint, id: HirId) -> bool { 1,120 ( 0.00%) cx.tcx.lint_level_spec_at_node(lint, id).is_allow() 400,782 ( 0.02%) => ???:::lint_level_spec_at_node (560x) 1,120 ( 0.00%) } . . pub fn strip_pat_refs<'hir>(mut pat: &'hir Pat<'hir>) -> &'hir Pat<'hir> { . while let PatKind::Ref(subpat, _, _) = pat.kind { . pat = subpat; . } . pat . } . -- line 1646 ---------------------------------------- -- line 1658 ---------------------------------------- . #[expect(clippy::cast_sign_loss)] . /// clip unused bytes . pub fn unsext(tcx: TyCtxt<'_>, u: i128, ity: IntTy) -> u128 { . let amt = 128 - int_bits(tcx, ity); . ((u as u128) << amt) >> amt . } . . /// clip unused bytes 16 ( 0.00%) pub fn clip(tcx: TyCtxt<'_>, u: u128, ity: UintTy) -> u128 { . let bits = Integer::from_uint_ty(&tcx, ity).size().bits(); . let amt = 128 - bits; 144 ( 0.00%) (u << amt) >> amt 48 ( 0.00%) } . . pub fn has_attr(attrs: &[hir::Attribute], symbol: Symbol) -> bool { . attrs.iter().any(|attr| attr.has_name(symbol)) . } . . pub fn has_repr_attr(cx: &LateContext<'_>, hir_id: HirId) -> bool { . find_attr!(cx.tcx, hir_id, Repr { .. }) . } -- line 1678 ---------------------------------------- -- line 1688 ---------------------------------------- . enclosing_node = tcx.hir_get_parent_item(enclosing_node).into(); . } . . false . } . . /// Checks if the given HIR node is inside an `impl` block with the `automatically_derived` . /// attribute. 479,710 ( 0.02%) pub fn in_automatically_derived(tcx: TyCtxt<'_>, id: HirId) -> bool { . tcx.hir_parent_owner_iter(id) 549,277 ( 0.03%) .filter(|(_, node)| matches!(node, OwnerNode::Item(item) if matches!(item.kind, ItemKind::Impl(_)))) 1,332 ( 0.00%) .any(|(id, _)| find_attr!(tcx, id.def_id, AutomaticallyDerived)) 47,890 ( 0.00%) => ???:>::get_attrs (665x) 479,710 ( 0.02%) } . . /// Checks if the given `DefId` matches the `libc` item. 1,140 ( 0.00%) pub fn match_libc_symbol(cx: &LateContext<'_>, did: DefId, name: Symbol) -> bool { . // libc is meant to be used as a flat list of names, but they're all actually defined in different . // modules based on the target platform. Ignore everything but crate name and the item name. 342 ( 0.00%) cx.tcx.crate_name(did.krate) == sym::libc && cx.tcx.def_path_str(did).ends_with(name.as_str()) 912 ( 0.00%) } . . /// Returns the list of condition expressions and the list of blocks in a . /// sequence of `if/else`. . /// E.g., this returns `([a, b], [c, d, e])` for the expression . /// `if a { c } else if b { d } else { e }`. 224 ( 0.00%) pub fn if_sequence<'tcx>(mut expr: &'tcx Expr<'tcx>) -> (Vec<&'tcx Expr<'tcx>>, Vec<&'tcx Block<'tcx>>) { . let mut conds = Vec::new(); . let mut blocks: Vec<&Block<'_>> = Vec::new(); . . while let Some(higher::IfOrIfLet { cond, then, r#else }) = higher::IfOrIfLet::hir(expr) { . conds.push(cond); 84 ( 0.00%) if let ExprKind::Block(block, _) = then.kind { . blocks.push(block); . } else { . panic!("ExprKind::If node is not an ExprKind::Block"); . } . 56 ( 0.00%) if let Some(else_expr) = r#else { . expr = else_expr; . } else { . break; . } . } . . // final `else {..}` 28 ( 0.00%) if !blocks.is_empty() 65 ( 0.00%) && let ExprKind::Block(block, _) = expr.kind . { . blocks.push(block); . } . 336 ( 0.00%) (conds, blocks) 252 ( 0.00%) } . . /// Peels away all the compiler generated code surrounding the body of an async closure. . pub fn get_async_closure_expr<'tcx>(tcx: TyCtxt<'tcx>, expr: &Expr<'_>) -> Option<&'tcx Expr<'tcx>> { . if let ExprKind::Closure(&Closure { . body, . kind: hir::ClosureKind::Coroutine(CoroutineKind::Desugared(CoroutineDesugaring::Async, _)), . .. . }) = expr.kind -- line 1748 ---------------------------------------- -- line 1796 ---------------------------------------- . /// * `|(x, y)| (x, y)` . /// * `|[x, y]| [x, y]` . /// * `|Foo(bar, baz)| Foo(bar, baz)` . /// * `|Foo { bar, baz }| Foo { bar, baz }` . /// * `|x| { let y = x; ...; let z = y; z }` . /// * `|x| { let y = x; ...; let z = y; return z }` . /// . /// Consider calling [`is_expr_untyped_identity_function`] or [`is_expr_identity_function`] instead. 21 ( 0.00%) fn is_body_identity_function<'hir>(cx: &LateContext<'_>, func: &Body<'hir>) -> bool { 9 ( 0.00%) let [param] = func.params else { . return false; . }; . 3 ( 0.00%) let mut param_pat = param.pat; . . // Given a sequence of `Stmt`s of the form `let p = e` where `e` is an expr identical to the . // current `param_pat`, advance the current `param_pat` to `p`. . // . // Note: This is similar to `clippy_utils::get_last_chain_binding_hir_id`, but it works . // directly over a `Pattern` rather than a `HirId`. And it checks for compatibility via . // `is_expr_identity_of_pat` rather than `HirId` equality . let mut advance_param_pat_over_stmts = |stmts: &[Stmt<'hir>]| { -- line 1817 ---------------------------------------- -- line 1824 ---------------------------------------- . } else { . return false; . } . } . . true . }; . 3 ( 0.00%) let mut expr = func.value; . loop { 15 ( 0.00%) match expr.kind { . ExprKind::Block( . &Block { . stmts: [], . expr: Some(e), . .. . }, . _, . ) -- line 1842 ---------------------------------------- -- line 1875 ---------------------------------------- . && let StmtKind::Semi(e) | StmtKind::Expr(e) = last_stmt.kind . && let ExprKind::Ret(Some(ret_val)) = e.kind . { . expr = ret_val; . } else { . return false; . } . }, 30 ( 0.00%) _ => return is_expr_identity_of_pat(cx, param_pat, expr, true), 258 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_expr_identity_of_pat (3x) . } . } . } . . /// Checks if the given expression is an identity representation of the given pattern: . /// * `x` is the identity representation of `x` . /// * `(x, y)` is the identity representation of `(x, y)` . /// * `[x, y]` is the identity representation of `[x, y]` . /// * `Foo(bar, baz)` is the identity representation of `Foo(bar, baz)` . /// * `Foo { bar, baz }` is the identity representation of `Foo { bar, baz }` . /// . /// Note that `by_hir` is used to determine bindings are checked by their `HirId` or by their name. . /// This can be useful when checking patterns in `let` bindings or `match` arms. 27 ( 0.00%) pub fn is_expr_identity_of_pat(cx: &LateContext<'_>, pat: &Pat<'_>, expr: &Expr<'_>, by_hir: bool) -> bool { . if cx . .typeck_results() . .pat_binding_modes() 6 ( 0.00%) .get(pat.hir_id) . .is_some_and(|mode| matches!(mode.0, ByRef::Yes(..))) . { . // If the parameter is `(x, y)` of type `&(T, T)`, or `[x, y]` of type `&[T; 2]`, then . // due to match ergonomics, the inner patterns become references. Don't consider this . // the identity function as that changes types. . return false; . } . . // NOTE: we're inside a (function) body, so this won't ICE . let qpath_res = |qpath, hir| cx.typeck_results().qpath_res(qpath, hir); . 54 ( 0.00%) match (pat.kind, expr.kind) { . (PatKind::Binding(_, id, _, _), _) if by_hir => { . expr.res_local_id() == Some(id) && cx.typeck_results().expr_adjustments(expr).is_empty() . }, . (PatKind::Binding(_, _, ident, _), ExprKind::Path(QPath::Resolved(_, path))) => { . matches!(path.segments, [ segment] if segment.ident.name == ident.name) . }, . (PatKind::Tuple(pats, dotdot), ExprKind::Tup(tup)) . if dotdot.as_opt_usize().is_none() && pats.len() == tup.len() => -- line 1921 ---------------------------------------- -- line 1946 ---------------------------------------- . qpath_res(&pat_ident, pat.hir_id) == qpath_res(ident, expr.hir_id) . // check fields . && unordered_over(field_pats, fields, |field_pat, field| { . field_pat.ident == field.ident && is_expr_identity_of_pat(cx, field_pat.pat, field.expr, by_hir) . }) . }, . _ => false, . } 24 ( 0.00%) } . . /// This is the same as [`is_expr_identity_function`], but does not consider closures . /// with type annotations for its bindings (or similar) as identity functions: . /// * `|x: u8| x` . /// * `std::convert::identity::` 3 ( 0.00%) pub fn is_expr_untyped_identity_function(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { 15 ( 0.00%) match expr.kind { 9 ( 0.00%) ExprKind::Closure(&Closure { body, fn_decl, .. }) 9 ( 0.00%) if fn_decl.inputs.iter().all(|ty| matches!(ty.kind, TyKind::Infer(()))) => . { 21 ( 0.00%) is_body_identity_function(cx, cx.tcx.hir_body(body)) 351 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_body_identity_function (3x) 198 ( 0.00%) => ???:::hir_body (3x) . }, . ExprKind::Path(QPath::Resolved(_, path)) . if path.segments.iter().all(|seg| seg.infer_args) . && let Some(did) = path.res.opt_def_id() => . { . cx.tcx.is_diagnostic_item(sym::convert_identity, did) . }, . _ => false, -- line 1973 ---------------------------------------- -- line 1986 ---------------------------------------- . match expr.kind { . ExprKind::Closure(&Closure { body, .. }) => is_body_identity_function(cx, cx.tcx.hir_body(body)), . _ => expr.basic_res().is_diag_item(cx, sym::convert_identity), . } . } . . /// Gets the node where an expression is either used, or it's type is unified with another branch. . /// Returns both the node and the `HirId` of the closest child node. 872 ( 0.00%) pub fn get_expr_use_or_unification_node<'tcx>(tcx: TyCtxt<'tcx>, expr: &Expr<'_>) -> Option<(Node<'tcx>, HirId)> { 981 ( 0.00%) for (node, child_id) in hir_parent_with_src_iter(tcx, expr.hir_id) { 314 ( 0.00%) match node { . Node::Block(_) => {}, . Node::Arm(arm) if arm.body.hir_id == child_id => {}, 498 ( 0.00%) Node::Expr(expr) => match expr.kind { . ExprKind::Block(..) | ExprKind::DropTemps(_) => {}, 12 ( 0.00%) ExprKind::Match(_, [arm], _) if arm.hir_id == child_id => {}, 8 ( 0.00%) ExprKind::If(_, then_expr, None) if then_expr.hir_id == child_id => return None, 99 ( 0.00%) _ => return Some((Node::Expr(expr), child_id)), . }, 20 ( 0.00%) node => return Some((node, child_id)), . } . } . None 872 ( 0.00%) } . . /// Checks if the result of an expression is used, or it's type is unified with another branch. . pub fn is_expr_used_or_unified(tcx: TyCtxt<'_>, expr: &Expr<'_>) -> bool { . !matches!( . get_expr_use_or_unification_node(tcx, expr), . None | Some(( . Node::Stmt(Stmt { . kind: StmtKind::Expr(_) -- line 2017 ---------------------------------------- -- line 2026 ---------------------------------------- . .. . }), . _ . )) . ) . } . . /// Checks if the expression is the final expression returned from a block. 58 ( 0.00%) pub fn is_expr_final_block_expr(tcx: TyCtxt<'_>, expr: &Expr<'_>) -> bool { 203 ( 0.00%) matches!(tcx.parent_hir_node(expr.hir_id), Node::Block(..)) 2,552 ( 0.00%) => ???:::parent_hir_node (29x) 58 ( 0.00%) } . . /// Checks if the expression is a temporary value. . // This logic is the same as the one used in rustc's `check_named_place_expr function`. . // https://github.com/rust-lang/rust/blob/3ed2a10d173d6c2e0232776af338ca7d080b1cd4/compiler/rustc_hir_typeck/src/expr.rs#L482-L499 . pub fn is_expr_temporary_value(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { . !expr.is_place_expr(|base| { . cx.typeck_results() . .adjustments() -- line 2044 ---------------------------------------- -- line 2052 ---------------------------------------- . None . } else if is_no_std_crate(cx) { . Some("core") . } else { . Some("std") . } . } . 1 ( 0.00%) pub fn is_no_std_crate(cx: &LateContext<'_>) -> bool { 191 ( 0.00%) find_attr!(cx.tcx, crate, NoStd) 45 ( 0.00%) => ???:::hir_krate_attrs (1x) 3 ( 0.00%) } . . pub fn is_no_core_crate(cx: &LateContext<'_>) -> bool { . find_attr!(cx.tcx, crate, NoCore) . } . . /// Check if parent of a hir node is a trait implementation block. . /// For example, `f` in . /// ```no_run . /// # struct S; . /// # trait Trait { fn f(); } . /// impl Trait for S { . /// fn f() {} . /// } . /// ``` 516 ( 0.00%) pub fn is_trait_impl_item(cx: &LateContext<'_>, hir_id: HirId) -> bool { 848 ( 0.00%) if let Node::Item(item) = cx.tcx.parent_hir_node(hir_id) { 24,416 ( 0.00%) => ???:::parent_hir_node (172x) 492 ( 0.00%) matches!(item.kind, ItemKind::Impl(Impl { of_trait: Some(_), .. })) . } else { . false . } 344 ( 0.00%) } . . /// Check if it's even possible to satisfy the `where` clause for the item. . /// . /// `trivial_bounds` feature allows functions with unsatisfiable bounds, for example: . /// . /// ```ignore . /// fn foo() where i32: Iterator { . /// for _ in 2i32 {} -- line 2091 ---------------------------------------- -- line 2098 ---------------------------------------- . .clauses_of(did) . .clauses . .iter() . .filter_map(|(p, _)| if p.is_global() { Some(*p) } else { None }); . traits::impossible_clauses(cx.tcx, traits::elaborate(cx.tcx, clauses).collect::>()) . } . . /// Returns the `DefId` of the callee if the given expression is a function or method call. 274,016 ( 0.01%) pub fn fn_def_id(cx: &LateContext<'_>, expr: &Expr<'_>) -> Option { 68,504 ( 0.00%) fn_def_id_with_node_args(cx, expr).map(|(did, _)| did) 1,805,788 ( 0.08%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::fn_def_id_with_node_args (68,504x) 137,008 ( 0.01%) } . . /// Returns the `DefId` of the callee if the given expression is a function or method call, . /// as well as its node args. 479,528 ( 0.02%) pub fn fn_def_id_with_node_args<'tcx>( . cx: &LateContext<'tcx>, . expr: &Expr<'_>, . ) -> Option<(DefId, GenericArgsRef<'tcx>)> { . let typeck = cx.typeck_results(); 342,678 ( 0.02%) match &expr.kind { 330 ( 0.00%) ExprKind::MethodCall(..) => Some(( 660 ( 0.00%) typeck.type_dependent_def_id(expr.hir_id)?, 5,610 ( 0.00%) => ???:::type_dependent_def_id (110x) 440 ( 0.00%) typeck.node_args(expr.hir_id), 4,075 ( 0.00%) => ???:::node_args (110x) 255 ( 0.00%) )), . ExprKind::Call( . Expr { 158 ( 0.00%) kind: ExprKind::Path(qpath), . hir_id: path_hir_id, . .. . }, . .., . ) => { . // Only return Fn-like DefIds, not the DefIds of statics/consts/etc that contain or . // deref to fn pointers, dyn Fn, impl Fn - #8850 751 ( 0.00%) if let Res::Def(DefKind::Fn | DefKind::Ctor(..) | DefKind::AssocFn, id) = 1,515 ( 0.00%) typeck.qpath_res(qpath, *path_hir_id) 3,566 ( 0.00%) => ???:::qpath_res (158x) . { 870 ( 0.00%) Some((id, typeck.node_args(*path_hir_id))) 5,531 ( 0.00%) => ???:::node_args (145x) . } else { . None . } . }, . _ => None, . } 616,536 ( 0.03%) } . . /// Returns `Option` where String is a textual representation of the type encapsulated in . /// the slice iff the given expression is a slice of primitives. . /// . /// (As defined in the `is_recursively_primitive_type` function.) Returns `None` otherwise. . pub fn is_slice_of_primitives(cx: &LateContext<'_>, expr: &Expr<'_>) -> Option { . let expr_type = cx.typeck_results().expr_ty_adjusted(expr); . let expr_kind = expr_type.kind(); -- line 2150 ---------------------------------------- -- line 2180 ---------------------------------------- . . /// Returns a list of groups where elements in each group are equal according to `eq` . /// . /// - Within each group the elements are sorted by the order they appear in `exprs` . /// - The groups themselves are sorted by their first element's appearence in `exprs` . /// . /// Given functions `eq` and `hash` such that `eq(a, b) == true` . /// implies `hash(a) == hash(b)` 588 ( 0.00%) pub fn search_same(exprs: &[T], mut hash: Hash, mut eq: Eq) -> Vec> . where . Hash: FnMut(&T) -> u64, . Eq: FnMut(&T, &T) -> bool, . { . match exprs { 140 ( 0.00%) [a, b] if eq(a, b) => return vec![vec![a, b]], 112 ( 0.00%) _ if exprs.len() <= 2 => return vec![], . _ => {}, . } . . let mut buckets: UnindexMap>> = UnindexMap::default(); . . for expr in exprs { . match buckets.entry(hash(expr)) { . indexmap::map::Entry::Occupied(mut o) => { -- line 2203 ---------------------------------------- -- line 2213 ---------------------------------------- . } . } . . buckets . .into_values() . .flatten() . .filter(|group| group.len() > 1) . .collect() 504 ( 0.00%) } . . /// Peels off all references on the pattern. Returns the underlying pattern and the number of . /// references removed. 27 ( 0.00%) pub fn peel_hir_pat_refs<'a>(pat: &'a Pat<'a>) -> (&'a Pat<'a>, usize) { . fn peel<'a>(pat: &'a Pat<'a>, count: usize) -> (&'a Pat<'a>, usize) { 54 ( 0.00%) if let PatKind::Ref(pat, _, _) = pat.kind { . peel(pat, count + 1) . } else { . (pat, count) . } . } . peel(pat, 0) 27 ( 0.00%) } . . /// Peels of expressions while the given closure returns `Some`. . pub fn peel_hir_expr_while<'tcx>( . mut expr: &'tcx Expr<'tcx>, . mut f: impl FnMut(&'tcx Expr<'tcx>) -> Option<&'tcx Expr<'tcx>>, . ) -> &'tcx Expr<'tcx> { 14 ( 0.00%) while let Some(e) = f(expr) { . expr = e; . } . expr . } . . /// Peels off up to the given number of references on the expression. Returns the underlying . /// expression and the number of references removed. . pub fn peel_n_hir_expr_refs<'a>(expr: &'a Expr<'a>, count: usize) -> (&'a Expr<'a>, usize) { -- line 2249 ---------------------------------------- -- line 2267 ---------------------------------------- . count = count.wrapping_add(1); . curr_expr = local_expr; . } . (curr_expr, count) . } . . /// Peels off all references on the expression. Returns the underlying expression and the number of . /// references removed. 138,114 ( 0.01%) pub fn peel_hir_expr_refs<'a>(expr: &'a Expr<'a>) -> (&'a Expr<'a>, usize) { . let mut count = 0; 138,294 ( 0.01%) let e = peel_hir_expr_while(expr, |e| match e.kind { 45 ( 0.00%) ExprKind::AddrOf(ast::BorrowKind::Ref, _, e) => { 45 ( 0.00%) count += 1; . Some(e) . }, . _ => None, . }); . (e, count) 69,057 ( 0.00%) } . . /// Peels off all references on the type. Returns the underlying type and the number of references . /// removed. . pub fn peel_hir_ty_refs<'a>(mut ty: &'a hir::Ty<'a>) -> (&'a hir::Ty<'a>, usize) { . let mut count = 0; . loop { . match &ty.kind { . TyKind::Ref(_, ref_ty) => { -- line 2293 ---------------------------------------- -- line 2304 ---------------------------------------- . match &ty.kind { . TyKind::Ptr(mut_ty) | TyKind::Ref(_, mut_ty) => peel_hir_ty_refs_and_ptrs(mut_ty.ty), . _ => ty, . } . } . . /// Removes `AddrOf` operators (`&`) or deref operators (`*`), but only if a reference type is . /// dereferenced. An overloaded deref such as `Vec` to slice would not be removed. 9 ( 0.00%) pub fn peel_ref_operators<'hir>(cx: &LateContext<'_>, mut expr: &'hir Expr<'hir>) -> &'hir Expr<'hir> { . loop { 4 ( 0.00%) match expr.kind { . ExprKind::AddrOf(_, _, e) => expr = e, 1 ( 0.00%) ExprKind::Unary(UnOp::Deref, e) if cx.typeck_results().expr_ty(e).is_ref() => expr = e, . _ => break, . } . } . expr 5 ( 0.00%) } . . /// Returns a `Vec` of `Expr`s containing `AddrOf` operators (`&`) or deref operators (`*`) of a . /// given expression. . pub fn get_ref_operators<'hir>(cx: &LateContext<'_>, expr: &'hir Expr<'hir>) -> Vec<&'hir Expr<'hir>> { . let mut operators = Vec::new(); . peel_hir_expr_while(expr, |expr| match expr.kind { . ExprKind::AddrOf(_, _, e) => { . operators.push(expr); -- line 2329 ---------------------------------------- -- line 2333 ---------------------------------------- . operators.push(expr); . Some(e) . }, . _ => None, . }); . operators . } . 20 ( 0.00%) pub fn is_hir_ty_cfg_dependant(cx: &LateContext<'_>, ty: &hir::Ty<'_>) -> bool { 100 ( 0.00%) if let TyKind::Path(QPath::Resolved(_, path)) = ty.kind 40 ( 0.00%) && let Res::Def(_, def_id) = path.res . { . return find_attr!(cx.tcx, def_id, CfgTrace(..) | CfgAttrTrace(..)); . } . false 20 ( 0.00%) } . . static TEST_ITEM_NAMES_CACHE: OnceLock>>> = OnceLock::new(); . . /// Returns the names of the test items in the given module. . /// The names are sorted using the default `Symbol` ordering. 310 ( 0.00%) fn test_item_names(tcx: TyCtxt<'_>, module: LocalModId) -> Vec { . let cache = TEST_ITEM_NAMES_CACHE.get_or_init(|| Mutex::new(FxHashMap::default())); . let mut map = cache.lock().unwrap(); . match map.entry(module) { . Entry::Occupied(entry) => entry.get().clone(), . Entry::Vacant(entry) => { . let mut names = Vec::new(); . for id in tcx.hir_module_free_items(module) { 282 ( 0.00%) if matches!(tcx.def_kind(id.owner_id), DefKind::Const { .. }) 96 ( 0.00%) && let item = tcx.hir_item(id) 1,696 ( 0.00%) => ???:::hir_item (32x) 96 ( 0.00%) && let ItemKind::Const(ident, _generics, ty, _body) = item.kind 106 ( 0.00%) && let TyKind::Path(QPath::Resolved(_, path)) = ty.kind . // We could also check for the type name `test::TestDescAndFn` 28 ( 0.00%) && let Res::Def(DefKind::Struct, _) = path.res . && find_attr!(tcx, item.hir_id(), RustcTestMarker(..)) . { . names.push(ident.name); . } . } . names.sort_unstable(); 32 ( 0.00%) entry.insert(names).clone() . }, . } 248 ( 0.00%) } . . /// Checks if the function containing the given `HirId` is a `#[test]` function . /// . /// Note: Add `//@compile-flags: --test` to UI tests with a `#[test]` function 217 ( 0.00%) pub fn is_in_test_function(tcx: TyCtxt<'_>, id: HirId) -> bool { 124 ( 0.00%) let names = test_item_names(tcx, tcx.parent_module(id)); 11,388 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::test_item_names (31x) 2,082 ( 0.00%) => ???:::parent_module (31x) . // Without `--test` there are no test items, so the parent walk can never match. 31 ( 0.00%) if names.is_empty() { . return false; . } . once((id, tcx.hir_node(id))) . .chain(tcx.hir_parent_iter(id)) . // Since you can nest functions we need to collect all until we leave . // function scope . .any(|(_id, node)| { . if let Node::Item(item) = node -- line 2393 ---------------------------------------- -- line 2394 ---------------------------------------- . && let ItemKind::Fn { ident, .. } = item.kind . { . // Note that we have sorted the item names in the visitor, . // so the binary_search gets the same as `contains`, but faster. . return names.binary_search(&ident.name).is_ok(); . } . false . }) 186 ( 0.00%) } . . /// Checks if `fn_def_id` has a `#[test]` attribute applied . /// . /// This only checks directly applied attributes. To see if a node has a parent function marked with . /// `#[test]` use [`is_in_test_function`]. . /// . /// Note: Add `//@compile-flags: --test` to UI tests with a `#[test]` function . pub fn is_test_function(tcx: TyCtxt<'_>, fn_def_id: LocalDefId) -> bool { -- line 2410 ---------------------------------------- -- line 2419 ---------------------------------------- . false . } . } . . /// Checks if `id` has a `#[cfg(test)]` attribute applied . /// . /// This only checks directly applied attributes, to see if a node is inside a `#[cfg(test)]` parent . /// use [`is_in_cfg_test`] 6 ( 0.00%) pub fn is_cfg_test(tcx: TyCtxt<'_>, id: HirId) -> bool { 2,224 ( 0.00%) if let Some(cfgs) = find_attr!(tcx, id, CfgTrace(cfgs) => cfgs) 3,333 ( 0.00%) => ???:>::get_attrs (66x) . && cfgs . .iter() . .any(|(cfg, _)| matches!(cfg, CfgEntry::NameValue { name: sym::test, .. })) . { . true . } else { . false . } 4 ( 0.00%) } . . /// Checks if any parent node of `HirId` has `#[cfg(test)]` attribute applied . pub fn is_in_cfg_test(tcx: TyCtxt<'_>, id: HirId) -> bool { . tcx.hir_parent_id_iter(id).any(|parent_id| is_cfg_test(tcx, parent_id)) . } . . /// Checks if the node is in a `#[test]` function or has any parent node marked `#[cfg(test)]` 310 ( 0.00%) pub fn is_in_test(tcx: TyCtxt<'_>, hir_id: HirId) -> bool { 155 ( 0.00%) is_in_test_function(tcx, hir_id) || is_in_cfg_test(tcx, hir_id) 14,245 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_test_function (31x) 248 ( 0.00%) } . . /// Checks if the item of any of its parents has `#[cfg(...)]` attribute applied. . pub fn inherits_cfg(tcx: TyCtxt<'_>, def_id: LocalDefId) -> bool { . find_attr!(tcx, def_id, CfgTrace(..)) . || find_attr!( . tcx.hir_parent_id_iter(tcx.local_def_id_to_hir_id(def_id)) . .flat_map(|parent_id| tcx.hir_attrs(parent_id)), . CfgTrace(..) -- line 2455 ---------------------------------------- -- line 2485 ---------------------------------------- . /// Whether the type must unify with another code path. . pub is_ty_unified: bool, . /// Whether the value will be moved before it's used. . pub moved_before_use: bool, . /// Whether the use site has the same `SyntaxContext` as the value. . pub same_ctxt: bool, . } . impl<'tcx> ExprUseSite<'tcx> { 42 ( 0.00%) pub fn use_node(&self, cx: &LateContext<'tcx>) -> ExprUseNode<'tcx> { 464 ( 0.00%) match self.node { . Node::LetStmt(l) => ExprUseNode::LetStmt(l), . Node::ExprField(field) => ExprUseNode::Field(field), . . Node::Item(&Item { . kind: ItemKind::Static(..) | ItemKind::Const(..), 68 ( 0.00%) owner_id, . .. . }) . | Node::TraitItem(&TraitItem { . kind: TraitItemKind::Const(..), . owner_id, . .. . }) . | Node::ImplItem(&ImplItem { . kind: ImplItemKind::Const(..), . owner_id, . .. 68 ( 0.00%) }) => ExprUseNode::ConstStatic(owner_id), . . Node::Item(&Item { . kind: ItemKind::Fn { .. }, . owner_id, . .. . }) . | Node::TraitItem(&TraitItem { . kind: TraitItemKind::Fn(..), -- line 2520 ---------------------------------------- -- line 2522 ---------------------------------------- . .. . }) . | Node::ImplItem(&ImplItem { . kind: ImplItemKind::Fn(..), . owner_id, . .. . }) => ExprUseNode::Return(owner_id), . 64 ( 0.00%) Node::Expr(use_expr) => match use_expr.kind { . ExprKind::Ret(_) => ExprUseNode::Return(OwnerId { . def_id: cx.tcx.hir_body_owner_def_id(cx.enclosing_body.unwrap()), . }), . 18 ( 0.00%) ExprKind::Closure(closure) => ExprUseNode::Return(OwnerId { def_id: closure.def_id }), . ExprKind::Call(func, args) => match args.iter().position(|arg| arg.hir_id == self.child_id) { . Some(i) => ExprUseNode::FnArg(func, i), . None => ExprUseNode::Callee, . }, . ExprKind::MethodCall(name, _, args, _) => ExprUseNode::MethodArg( . use_expr.hir_id, . name.args, . args.iter() -- line 2543 ---------------------------------------- -- line 2545 ---------------------------------------- . .map_or(0, |i| i + 1), . ), . ExprKind::Field(_, name) => ExprUseNode::FieldAccess(name), . ExprKind::AddrOf(kind, mutbl, _) => ExprUseNode::AddrOf(kind, mutbl), . _ => ExprUseNode::Other, . }, . _ => ExprUseNode::Other, . } 126 ( 0.00%) } . } . . /// The node which consumes a value. . pub enum ExprUseNode<'tcx> { . /// Assignment to, or initializer for, a local . LetStmt(&'tcx LetStmt<'tcx>), . /// Initializer for a const or static item. . ConstStatic(OwnerId), -- line 2561 ---------------------------------------- -- line 2573 ---------------------------------------- . FieldAccess(Ident), . /// Borrow expression. . AddrOf(ast::BorrowKind, Mutability), . Other, . } . impl<'tcx> ExprUseNode<'tcx> { . /// Checks if the value is returned from the function. . pub fn is_return(&self) -> bool { 85 ( 0.00%) matches!(self, Self::Return(_)) . } . . /// Checks if the value is used as a method call receiver. . pub fn is_recv(&self) -> bool { . matches!(self, Self::MethodArg(_, _, 0)) . } . . /// Gets the needed type as it's defined without any type inference. 294 ( 0.00%) pub fn defined_ty(&self, cx: &LateContext<'tcx>) -> Option> { 420 ( 0.00%) match *self { . Self::LetStmt(LetStmt { ty: Some(ty), .. }) => Some(DefinedTy::Hir(ty)), 238 ( 0.00%) Self::ConstStatic(id) => Some(DefinedTy::Mir { . def_site_def_id: Some(id.def_id.to_def_id()), 34 ( 0.00%) ty: Binder::dummy(cx.tcx.type_of(id).instantiate_identity().skip_norm_wip()), . }), 12 ( 0.00%) Self::Return(id) => { 30 ( 0.00%) if let Node::Expr(Expr { . kind: ExprKind::Closure(c), . .. 12 ( 0.00%) }) = cx.tcx.hir_node_by_def_id(id.def_id) . { 30 ( 0.00%) match c.fn_decl.output { . FnRetTy::DefaultReturn(_) => None, . FnRetTy::Return(ty) => Some(DefinedTy::Hir(ty)), . } . } else { . let ty = cx.tcx.fn_sig(id).instantiate_identity().skip_norm_wip().output(); . Some(DefinedTy::Mir { . def_site_def_id: Some(id.def_id.to_def_id()), . ty, -- line 2611 ---------------------------------------- -- line 2636 ---------------------------------------- . let (hir_ty, ty) = sig.input_with_hir(i)?; . Some(match hir_ty { . Some(hir_ty) => DefinedTy::Hir(hir_ty), . None => DefinedTy::Mir { . def_site_def_id: sig.predicates_id(), . ty, . }, . }) 34 ( 0.00%) }, . Self::MethodArg(id, _, i) => { . let id = cx.typeck_results().type_dependent_def_id(id)?; . let sig = cx.tcx.fn_sig(id).skip_binder(); . Some(DefinedTy::Mir { . def_site_def_id: Some(id), . ty: sig.input(i), . }) . }, . Self::LetStmt(_) | Self::FieldAccess(..) | Self::Callee | Self::Other | Self::AddrOf(..) => None, . } 378 ( 0.00%) } . } . . struct ReplacingFilterMap(I, F); . impl Iterator for ReplacingFilterMap . where . I: Iterator, . F: FnMut(&mut I, I::Item) -> Option, . { . type Item = U; . fn next(&mut self) -> Option { 84 ( 0.00%) while let Some(x) = self.0.next() { . if let Some(x) = (self.1)(&mut self.0, x) { . return Some(x); . } . } . None . } . } . -- line 2674 ---------------------------------------- -- line 2676 ---------------------------------------- . /// which simply moves a value. . #[expect(clippy::too_many_lines)] . pub fn expr_use_sites<'tcx>( . tcx: TyCtxt<'tcx>, . typeck: &'tcx TypeckResults<'tcx>, . mut ctxt: SyntaxContext, . e: &'tcx Expr<'tcx>, . ) -> impl Iterator> { 126 ( 0.00%) let mut adjustments: &[_] = typeck.expr_adjustments(e); 1,776 ( 0.00%) => ???:::expr_adjustments (42x) . let mut is_ty_unified = false; . let mut moved_before_use = false; . let mut same_ctxt = true; 588 ( 0.00%) ReplacingFilterMap( 84 ( 0.00%) hir_parent_with_src_iter(tcx, e.hir_id), . move |iter: &mut _, (parent, child_id)| { . let parent_ctxt; . let mut parent_adjustments: &[_] = &[]; 168 ( 0.00%) match parent { . Node::Expr(parent_expr) => { 8 ( 0.00%) parent_ctxt = parent_expr.span.ctxt(); 24 ( 0.00%) same_ctxt &= parent_ctxt == ctxt; 24 ( 0.00%) parent_adjustments = typeck.expr_adjustments(parent_expr); 288 ( 0.00%) => ???:::expr_adjustments (8x) 58 ( 0.00%) match parent_expr.kind { . ExprKind::Match(scrutinee, arms, _) if scrutinee.hir_id != child_id => { . is_ty_unified |= arms.len() != 1; . moved_before_use = true; . if adjustments.is_empty() { . adjustments = parent_adjustments; . } . return None; . }, -- line 2706 ---------------------------------------- -- line 2759 ---------------------------------------- . | Node::Field(&FieldDef { span, .. }) . | Node::ImplItem(&ImplItem { span, .. }) . | Node::Item(&Item { span, .. }) . | Node::LetStmt(&LetStmt { span, .. }) . | Node::Stmt(&Stmt { span, .. }) . | Node::TraitItem(&TraitItem { span, .. }) . | Node::Variant(&Variant { span, .. }) => { . parent_ctxt = span.ctxt(); 68 ( 0.00%) same_ctxt &= parent_ctxt == ctxt; . *iter = hir_parent_with_src_iter(tcx, CRATE_HIR_ID); . }, . Node::AssocItemConstraint(_) . | Node::ConstArgExprField(_) . | Node::Crate(_) . | Node::Ctor(_) . | Node::Err(_) . | Node::ForeignItem(_) -- line 2775 ---------------------------------------- -- line 2803 ---------------------------------------- . is_ty_unified: mem::replace(&mut is_ty_unified, false), . moved_before_use: mem::replace(&mut moved_before_use, false), . same_ctxt: mem::replace(&mut same_ctxt, true), . }) . }, . ) . } . 504 ( 0.00%) pub fn get_expr_use_site<'tcx>( . tcx: TyCtxt<'tcx>, . typeck: &'tcx TypeckResults<'tcx>, . ctxt: SyntaxContext, . e: &'tcx Expr<'tcx>, . ) -> ExprUseSite<'tcx> { . // The value in `unwrap_or` doesn't actually matter; an expression always . // has a use site. . expr_use_sites(tcx, typeck, ctxt, e).next().unwrap_or_else(|| { -- line 2819 ---------------------------------------- -- line 2822 ---------------------------------------- . node: Node::Synthetic, // The crate root would also work. . child_id: CRATE_HIR_ID, . adjustments: &[], . is_ty_unified: false, . moved_before_use: false, . same_ctxt: false, . } . }) 336 ( 0.00%) } . . /// Tokenizes the input while keeping the text associated with each token. . pub fn tokenize_with_text(s: &str) -> impl Iterator { . let mut pos = 0; . tokenize(s, FrontmatterAllowed::No).map(move |t| { 2,997 ( 0.00%) let end = pos + t.len; 1 ( 0.00%) let range = pos as usize..end as usize; . let inner = InnerSpan::new(range.start, range.end); 1,470 ( 0.00%) pos = end; 16 ( 0.00%) (t.kind, s.get(range).unwrap_or_default(), inner) . }) . } . . /// Checks whether a given span has any comment token . /// This checks for all types of comment: line "//", block "/**", doc "///" "//!" . pub fn span_contains_comment<'sm>(sm: impl HasSourceMap<'sm>, span: Span) -> bool { . span.check_text(sm, |snippet| { . tokenize(snippet, FrontmatterAllowed::No).any(|token| { 182,367 ( 0.01%) matches!( . token.kind, . TokenKind::BlockComment { .. } | TokenKind::LineComment { .. } . ) . }) . }) . } . . /// Checks whether a given span has any significant token. A significant token is a non-whitespace -- line 2857 ---------------------------------------- -- line 2884 ---------------------------------------- . .filter(|(t, ..)| matches!(t, TokenKind::BlockComment { .. } | TokenKind::LineComment { .. })) . .map(|(_, s, _)| s.to_string()) . .collect::>() . }) . .unwrap_or_default() . } . . pub fn span_find_starting_semi(sm: &SourceMap, span: Span) -> Span { 9 ( 0.00%) sm.span_take_while(span, |&ch| ch == ' ' || ch == ';') 4,901 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/source_map.rs:::span_take_while:: (9x) . } . . /// Returns whether the given let pattern and else body can be turned into the `?` operator . /// . /// For this example: . /// ```ignore . /// let FooBar { a, b } = if let Some(a) = ex { a } else { return None }; . /// ``` -- line 2900 ---------------------------------------- -- line 2942 ---------------------------------------- . /// Binary operation traits like `LangItem::Add` . pub static BINOP_TRAITS: &[LangItem] = &[$(LangItem::$name,)*]; . . /// Operator-Assign traits like `LangItem::AddAssign` . pub static OP_ASSIGN_TRAITS: &[LangItem] = &[$(LangItem::$assign,)*]; . . /// Converts `BinOpKind::Add` to `(LangItem::Add, LangItem::AddAssign)`, for example . pub fn binop_traits(kind: hir::BinOpKind) -> Option<(LangItem, LangItem)> { 552 ( 0.00%) match kind { . $(hir::BinOpKind::$name => Some((LangItem::$name, LangItem::$assign)),)* . _ => None, . } . } . }; . } . . op_utils! { -- line 2958 ---------------------------------------- -- line 3570 ---------------------------------------- . { . Some(into_future_arg) . } else { . None . } . } . . /// Checks if the given expression is a call to `Default::default()`. 19 ( 0.00%) pub fn is_expr_default<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) -> bool { 48 ( 0.00%) if let ExprKind::Call(fn_expr, []) = &expr.kind 4 ( 0.00%) && let ExprKind::Path(qpath) = &fn_expr.kind 9 ( 0.00%) && let Res::Def(_, def_id) = cx.qpath_res(qpath, fn_expr.hir_id) 78 ( 0.00%) => ???:::qpath_res (1x) . { 3 ( 0.00%) cx.tcx.is_diagnostic_item(sym::default_fn, def_id) 44 ( 0.00%) => ???:::is_diagnostic_item (1x) . } else { . false . } 19 ( 0.00%) } . . /// Checks if `expr` may be directly used as the return value of its enclosing body. . /// The following cases are covered: . /// - `expr` as the last expression of the body, or of a block that can be used as the return value . /// - `return expr` . /// - then or else part of a `if` in return position . /// - arm body of a `match` in a return position . /// - `break expr` or `break 'label expr` if the loop or block being exited is used as a return -- line 3595 ---------------------------------------- -- line 3671 ---------------------------------------- . )), . .. . }) . ) . } . . /// Checks if the chosen edition and `msrv` allows using `if let` chains. . pub fn can_use_if_let_chains(cx: &LateContext<'_>, msrv: Msrv) -> bool { 9 ( 0.00%) cx.tcx.sess.edition().at_least_rust_2024() && msrv.meets(cx, msrvs::LET_CHAINS) 3 ( 0.00%) } . . /// Returns an iterator over successive parent nodes paired with the ID of the node which . /// immediatly preceeded them. . #[inline] . pub fn hir_parent_with_src_iter(tcx: TyCtxt<'_>, mut id: HirId) -> impl Iterator, HirId)> { . tcx.hir_parent_id_iter(id) 1,229 ( 0.00%) .map(move |parent| (tcx.hir_node(parent), mem::replace(&mut id, parent))) 2,184 ( 0.00%) => ???:::hir_node (42x) . } 220,698 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/formatting.rs -------------------------------------------------------------------------------- Ir -- line 141 ---------------------------------------- . POSSIBLE_MISSING_COMMA, . POSSIBLE_MISSING_ELSE, . SUSPICIOUS_ASSIGNMENT_FORMATTING, . SUSPICIOUS_ELSE_FORMATTING, . SUSPICIOUS_UNARY_OP_FORMATTING, . ]); . . impl EarlyLintPass for Formatting { 1,296 ( 0.00%) fn check_block(&mut self, cx: &EarlyContext<'_>, block: &Block) { . for w in block.stmts.windows(2) { 314 ( 0.00%) if let (StmtKind::Expr(first), StmtKind::Expr(second) | StmtKind::Semi(second)) = (&w[0].kind, &w[1].kind) { 52 ( 0.00%) check_missing_else(cx, first, second); . } . } 1,296 ( 0.00%) } . 504,203 ( 0.02%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { . check_assign(cx, expr); . check_unop(cx, expr); . check_else(cx, expr); . check_array(cx, expr); 576,232 ( 0.03%) } . } . . /// Implementation of the `SUSPICIOUS_ASSIGNMENT_FORMATTING` lint. . fn check_assign(cx: &EarlyContext<'_>, expr: &Expr) { 216,087 ( 0.01%) if let ExprKind::Assign(ref lhs, ref rhs, _) = expr.kind 84 ( 0.00%) && !lhs.span.from_expansion() 84 ( 0.00%) && !rhs.span.from_expansion() . { 112 ( 0.00%) let eq_span = lhs.span.between(rhs.span); 2,996 ( 0.00%) => ???:::between (28x) 56 ( 0.00%) if let ExprKind::Unary(op, ref sub_rhs) = rhs.kind . && let Some(eq_snippet) = snippet_opt(cx, eq_span) . { . let op = op.as_str(); . let eqop_span = lhs.span.between(sub_rhs.span); . if eq_snippet.ends_with('=') { . span_lint_and_note( . cx, . SUSPICIOUS_ASSIGNMENT_FORMATTING, -- line 180 ---------------------------------------- -- line 188 ---------------------------------------- . ); . } . } . } . } . . /// Implementation of the `SUSPICIOUS_UNARY_OP_FORMATTING` lint. . fn check_unop(cx: &EarlyContext<'_>, expr: &Expr) { 144,002 ( 0.01%) if let ExprKind::Binary(ref binop, ref lhs, ref rhs) = expr.kind 453 ( 0.00%) && !lhs.span.from_expansion() && !rhs.span.from_expansion() . // span between BinOp LHS and RHS 300 ( 0.00%) && let binop_span = lhs.span.between(rhs.span) 8,025 ( 0.00%) => ???:::between (75x) . // if RHS is an UnOp 150 ( 0.00%) && let ExprKind::Unary(op, ref un_rhs) = rhs.kind . // from UnOp operator to UnOp operand . && let unop_operand_span = rhs.span.until(un_rhs.span) . && let Some(binop_snippet) = snippet_opt(cx, binop_span) . && let Some(unop_operand_snippet) = snippet_opt(cx, unop_operand_span) . && let binop_str = binop.node.as_str() . // no space after BinOp operator and space after UnOp operator . && binop_snippet.ends_with(binop_str) && unop_operand_snippet.ends_with(' ') . { -- line 209 ---------------------------------------- -- line 220 ---------------------------------------- . None, . format!("put a space between `{binop_str}` and `{unop_str}` and remove the space after `{unop_str}`"), . ); . } . } . . /// Implementation of the `SUSPICIOUS_ELSE_FORMATTING` lint for weird `else`. . fn check_else(cx: &EarlyContext<'_>, expr: &Expr) { 143,934 ( 0.01%) if let ExprKind::If(_, then, Some(else_)) = &expr.kind 9 ( 0.00%) && (is_block(else_) || is_if(else_)) 45 ( 0.00%) && !then.span.from_expansion() && !else_.span.from_expansion() 36 ( 0.00%) && !expr.span.in_external_macro(cx.sess().source_map()) . . // workaround for rust-lang/rust#43081 36 ( 0.00%) && expr.span.lo().0 != 0 && expr.span.hi().0 != 0 . . // this will be a span from the closing ‘}’ of the “then” block (excluding) to . // the “if” of the “else if” block (excluding) 36 ( 0.00%) && let else_span = then.span.between(else_.span) 963 ( 0.00%) => ???:::between (9x) . . // the snippet should look like " else \n " with maybe comments anywhere . // it’s bad when there is a ‘\n’ after the “else” 72 ( 0.00%) && let Some(else_snippet) = snippet_opt(cx, else_span) 3,502 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::snippet_opt::<&rustc_lint::context::EarlyContext> (9x) 72 ( 0.00%) && let Some((pre_else, post_else)) = else_snippet.split_once("else") 3,682 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/mod.rs:::split_once::<&str> (9x) 18 ( 0.00%) && !else_snippet.contains('/') 48 ( 0.00%) && let Some((_, post_else_post_eol)) = post_else.split_once('\n') 352 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/mod.rs:::split_once:: (8x) . { . // Allow allman style braces `} \n else \n {` . if is_block(else_) . && let Some((_, pre_else_post_eol)) = pre_else.split_once('\n') . // Exactly one eol before and after the else . && !pre_else_post_eol.contains('\n') . && !post_else_post_eol.contains('\n') . { -- line 253 ---------------------------------------- -- line 282 ---------------------------------------- . } . . fn indentation(cx: &EarlyContext<'_>, span: Span) -> usize { . cx.sess().source_map().lookup_char_pos(span.lo()).col.0 . } . . /// Implementation of the `POSSIBLE_MISSING_COMMA` lint for array . fn check_array(cx: &EarlyContext<'_>, expr: &Expr) { 143,794 ( 0.01%) if let ExprKind::Array(ref array) = expr.kind { . for element in array { 107,991 ( 0.01%) if let ExprKind::Binary(ref op, ref lhs, _) = element.kind . && has_unary_equivalent(op.node) . && lhs.span.eq_ctxt(op.span) . && let space_span = lhs.span.between(op.span) . && let Some(space_snippet) = snippet_opt(cx, space_span) . && let lint_span = lhs.span.with_lo(lhs.span.hi()) . && space_snippet.contains('\n') . && indentation(cx, op.span) <= indentation(cx, lhs.span) . { -- line 300 ---------------------------------------- -- line 307 ---------------------------------------- . "to remove this lint, add a comma or write the expr in a single line", . ); . } . } . } . } . . fn check_missing_else(cx: &EarlyContext<'_>, first: &Expr, second: &Expr) { 130 ( 0.00%) if !first.span.from_expansion() && !second.span.from_expansion() . && matches!(first.kind, ExprKind::If(..)) 48 ( 0.00%) && (is_block(second) || is_if(second)) . . // Proc-macros can give weird spans. Make sure this is actually an `if`. 18 ( 0.00%) && is_span_if(cx, first.span) . . // If there is a line break between the two expressions, don't lint. . // If there is a non-whitespace character, this span came from a proc-macro. 30 ( 0.00%) && let else_span = first.span.between(second.span) 642 ( 0.00%) => ???:::between (6x) 30 ( 0.00%) && let Some(else_snippet) = snippet_opt(cx, else_span) 24 ( 0.00%) && !else_snippet.chars().any(|c| c == '\n' || !c.is_whitespace()) . { . let (looks_like, next_thing) = if is_if(second) { . ("an `else if`", "the second `if`") . } else { . ("an `else {..}`", "the next block") . }; . . span_lint_and_note( -- line 334 ---------------------------------------- -- line 338 ---------------------------------------- . format!("this looks like {looks_like} but the `else` is missing"), . None, . format!("to remove this lint, add the missing `else` or add a new line before {next_thing}"), . ); . } . } . . fn is_block(expr: &Expr) -> bool { 50 ( 0.00%) matches!(expr.kind, ExprKind::Block(..)) . } . . /// Check if the expression is an `if` or `if let` . fn is_if(expr: &Expr) -> bool { . matches!(expr.kind, ExprKind::If(..)) . } 232 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lexer/src/lib.rs -------------------------------------------------------------------------------- Ir -- line 63 ---------------------------------------- . . impl Token { . fn new(kind: TokenKind, len: u32) -> Token { . Token { kind, len } . } . } . . /// Enum representing common lexeme types. 734,093 ( 0.03%) #[derive(Clone, Copy, Debug, PartialEq, Eq)] . pub enum TokenKind { . /// A line comment, e.g. `// comment`. . LineComment { . doc_style: Option, . }, . . /// A block comment, e.g. `/* block comment */`. . /// -- line 79 ---------------------------------------- -- line 325 ---------------------------------------- . /// . /// When tokenizing a slice of a document, be sure to disallow frontmatters with [`FrontmatterAllowed::No`] . pub fn tokenize( . input: &str, . frontmatter_allowed: FrontmatterAllowed, . ) -> impl Iterator { . let mut cursor = Cursor::new(input, frontmatter_allowed); . std::iter::from_fn(move || { 560,586 ( 0.03%) let token = cursor.advance_token(); 213 ( 0.00%) => ???:::advance_token (1x) 551,661 ( 0.03%) if token.kind != TokenKind::Eof { Some(token) } else { None } . }) . } . . /// True if `c` is considered a whitespace according to Rust language definition. . /// See [Rust language reference](https://doc.rust-lang.org/reference/whitespace.html) . /// for definitions of these classes. . pub fn is_whitespace(c: char) -> bool { . // This is Pattern_White_Space. . // . // Note that this set is stable (ie, it doesn't change with different . // Unicode versions), so it's ok to just hard-code the values. . 338 ( 0.00%) matches!( . c, . // End-of-line characters . | '\u{000A}' // line feed (\n) . | '\u{000B}' // vertical tab . | '\u{000C}' // form feed . | '\u{000D}' // carriage return (\r) . | '\u{0085}' // next line (from latin1) . | '\u{2028}' // LINE SEPARATOR -- line 355 ---------------------------------------- 258 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/legacy_numeric_constants.rs -------------------------------------------------------------------------------- Ir -- line 46 ---------------------------------------- . Self { msrv: conf.msrv.into() } . } . } . . impl<'tcx> LateLintPass<'tcx> for LegacyNumericConstants { . fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'tcx>) { . // Integer modules are "TBD" deprecated, and the contents are too, . // so lint on the `use` statement directly. 988 ( 0.00%) if let ItemKind::Use(path, kind @ (UseKind::Single(_) | UseKind::Glob)) = item.kind 268 ( 0.00%) && !item.span.in_external_macro(cx.sess().source_map()) . // use `present_items` because it could be in either type_ns or value_ns 889 ( 0.00%) && let Some(res) = path.res.present_items().next() 132 ( 0.00%) && let Some(def_id) = res.opt_def_id() 330 ( 0.00%) && self.msrv.meets(cx, msrvs::NUMERIC_ASSOCIATED_CONSTANTS) 1,782 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (66x) . { . let module = if is_integer_module(cx, def_id) { . true . } else if is_numeric_const(cx, def_id) { . false . } else { . return; . }; -- line 67 ---------------------------------------- -- line 96 ---------------------------------------- . } else if let [.., module_name, name] = &*def_path { . diag.help( . format!("remove this import and use the associated constant `{module_name}::{name}` from the primitive type instead") . ); . } . }, . ); . } 213 ( 0.00%) } . 687,420 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx rustc_hir::Expr<'tcx>) { . // `std::::` check 214,416 ( 0.01%) let (sugg, msg) = if let ExprKind::Path(qpath) = &expr.kind . && let QPath::Resolved(None, path) = qpath 2,035 ( 0.00%) && let Some(def_id) = path.res.opt_def_id() 11,571 ( 0.00%) && is_numeric_const(cx, def_id) 94,209 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/legacy_numeric_constants.rs:clippy_lints::legacy_numeric_constants::is_numeric_const (1,653x) . && let [.., mod_name, name] = &*cx.get_def_path(def_id) . // Skip linting if this usage looks identical to the associated constant, . // since this would only require removing a `use` import (which is already linted). . && !is_numeric_const_path_canonical(path, [*mod_name, *name]) . { . (format!("{mod_name}::{name}"), "usage of a legacy numeric constant") . // `::xxx_value` check 133,812 ( 0.01%) } else if let ExprKind::Call(func, []) = &expr.kind 10 ( 0.00%) && let ExprKind::Path(qpath) = &func.kind 10 ( 0.00%) && let QPath::TypeRelative(ty, last_segment) = qpath 25 ( 0.00%) && let Some(def_id) = cx.qpath_res(qpath, func.hir_id).opt_def_id() 390 ( 0.00%) => ???:::qpath_res (5x) 5 ( 0.00%) && is_integer_method(cx, def_id) . && let Some(mod_name) = ty.span.get_text(cx) . && ty.span.eq_ctxt(last_segment.ident.span) . { . let name = last_segment.ident.name.as_str()[..=2].to_ascii_uppercase(); . (format!("{mod_name}::{name}"), "usage of a legacy numeric method") . } else { . return; . }; -- line 131 ---------------------------------------- -- line 138 ---------------------------------------- . diag.span_suggestion_verbose( . expr.span, . "use the associated constant instead", . sugg, . Applicability::MaybeIncorrect, . ); . }); . } 549,936 ( 0.03%) } . } . . fn is_integer_module(cx: &LateContext<'_>, did: DefId) -> bool { . matches!( . cx.tcx.get_diagnostic_name(did), . Some( . sym::isize_legacy_mod . | sym::i128_legacy_mod -- line 154 ---------------------------------------- -- line 161 ---------------------------------------- . | sym::u64_legacy_mod . | sym::u32_legacy_mod . | sym::u16_legacy_mod . | sym::u8_legacy_mod . ) . ) . } . 1,653 ( 0.00%) fn is_numeric_const(cx: &LateContext<'_>, did: DefId) -> bool { 9,918 ( 0.00%) matches!( 4,959 ( 0.00%) cx.tcx.get_diagnostic_name(did), 74,373 ( 0.00%) => ???:::get_diagnostic_name (1,653x) . Some( . sym::isize_legacy_const_max . | sym::isize_legacy_const_min . | sym::i128_legacy_const_max . | sym::i128_legacy_const_min . | sym::i16_legacy_const_max . | sym::i16_legacy_const_min . | sym::i32_legacy_const_max -- line 179 ---------------------------------------- -- line 219 ---------------------------------------- . | sym::f64_legacy_const_min_10_exp . | sym::f64_legacy_const_min_exp . | sym::f64_legacy_const_min_positive . | sym::f64_legacy_const_nan . | sym::f64_legacy_const_neg_infinity . | sym::f64_legacy_const_radix . ) . ) 3,306 ( 0.00%) } . . // Whether path expression looks like `i32::MAX` . fn is_numeric_const_path_canonical(expr_path: &hir::Path<'_>, [mod_name, name]: [Symbol; 2]) -> bool { . let [ . hir::PathSegment { . ident: one, args: None, .. . }, . hir::PathSegment { -- line 235 ---------------------------------------- -- line 239 ---------------------------------------- . else { . return false; . }; . . one.name == mod_name && two.name == name . } . . fn is_integer_method(cx: &LateContext<'_>, did: DefId) -> bool { 15 ( 0.00%) matches!( 10 ( 0.00%) cx.tcx.get_diagnostic_name(did), 215 ( 0.00%) => ???:::get_diagnostic_name (5x) . Some( . sym::isize_legacy_fn_max_value . | sym::isize_legacy_fn_min_value . | sym::i128_legacy_fn_max_value . | sym::i128_legacy_fn_min_value . | sym::i16_legacy_fn_max_value . | sym::i16_legacy_fn_min_value . | sym::i32_legacy_fn_max_value -- line 256 ---------------------------------------- 69,827 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/string.rs -------------------------------------------------------------------------------- Ir -- line 439 ---------------------------------------- . /// let s = String::new(); . /// ``` . #[inline] . #[rustc_const_stable(feature = "const_string_new", since = "1.39.0")] . #[rustc_diagnostic_item = "string_new"] . #[stable(feature = "rust1", since = "1.0.0")] . #[must_use] . pub const fn new() -> String { 1,228 ( 0.00%) String { vec: Vec::new() } . } . . /// Creates a new empty `String` with at least the specified capacity. . /// . /// `String`s have an internal buffer to hold their data. The capacity is . /// the length of that buffer, and can be queried with the [`capacity`] . /// method. This method creates an empty `String`, but one with an initial . /// buffer that can hold at least `capacity` bytes. This is useful when you -- line 455 ---------------------------------------- -- line 486 ---------------------------------------- . /// // ...but this may make the string reallocate . /// s.push('a'); . /// ``` . #[cfg(not(no_global_oom_handling))] . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . #[must_use] . pub fn with_capacity(capacity: usize) -> String { 212,879 ( 0.01%) String { vec: Vec::with_capacity(capacity) } . } . . /// Creates a new empty `String` with at least the specified capacity. . /// . /// # Errors . /// . /// Returns [`Err`] if the capacity exceeds `isize::MAX` bytes, . /// or if the memory allocator reports failure. -- line 502 ---------------------------------------- -- line 1009 ---------------------------------------- . /// }; . /// . /// assert_eq!("💖", sparkle_heart); . /// ``` . #[inline] . #[must_use] . #[stable(feature = "rust1", since = "1.0.0")] . pub unsafe fn from_utf8_unchecked(bytes: Vec) -> String { 576 ( 0.00%) String { vec: bytes } . } . . /// Converts a `String` into a byte vector. . /// . /// This consumes the `String`, so we do not need to copy its contents. . /// . /// # Examples . /// -- line 1025 ---------------------------------------- -- line 1432 ---------------------------------------- . pub fn push(&mut self, ch: char) { . let len = self.len(); . let ch_len = ch.len_utf8(); . self.reserve(ch_len); . . // SAFETY: Just reserved capacity for at least the length needed to encode `ch`. . unsafe { . core::char::encode_utf8_raw_unchecked(ch as u32, self.vec.as_mut_ptr().add(len)); 1,553 ( 0.00%) self.vec.set_len(len + ch_len); . } . } . . /// Returns a byte slice of this `String`'s contents. . /// . /// The inverse of this method is [`from_utf8`]. . /// . /// [`from_utf8`]: String::from_utf8 -- line 1448 ---------------------------------------- -- line 1507 ---------------------------------------- . /// assert_eq!(s.pop(), Some('a')); . /// . /// assert_eq!(s.pop(), None); . /// ``` . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . pub fn pop(&mut self) -> Option { . let ch = self.chars().rev().next()?; 50 ( 0.00%) let newlen = self.len() - ch.len_utf8(); . unsafe { . self.vec.set_len(newlen); . } . Some(ch) . } . . /// Removes a [`char`] from this `String` at byte position `idx` and returns it. . /// -- line 1523 ---------------------------------------- -- line 1889 ---------------------------------------- . /// assert!(!v.is_empty()); . /// ``` . #[inline] . #[must_use] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_vec_string_slice", since = "1.87.0")] . #[rustc_no_implicit_autorefs] . pub const fn is_empty(&self) -> bool { 2 ( 0.00%) self.len() == 0 . } . . /// Splits the string into two at the given byte index. . /// . /// Returns a newly allocated `String`. `self` contains bytes `[0, at)`, and . /// the returned `String` contains bytes `[at, len)`. `at` must be on the . /// boundary of a UTF-8 code point. . /// -- line 1905 ---------------------------------------- -- line 2501 ---------------------------------------- . . #[cfg(not(no_global_oom_handling))] . #[stable(feature = "rust1", since = "1.0.0")] . impl Extend for String { . fn extend>(&mut self, iter: I) { . let iterator = iter.into_iter(); . let (lower_bound, _) = iterator.size_hint(); . self.reserve(lower_bound); 540 ( 0.00%) iterator.for_each(move |c| self.push(c)); . } . . #[inline] . fn extend_one(&mut self, c: char) { . self.push(c); . } . . #[inline] -- line 2517 ---------------------------------------- -- line 2740 ---------------------------------------- . fn default() -> String { . String::new() . } . } . . #[stable(feature = "rust1", since = "1.0.0")] . impl fmt::Display for String { . #[inline] 97 ( 0.00%) fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 194 ( 0.00%) fmt::Display::fmt(&**self, f) 12,360 ( 0.00%) => ???:::fmt (97x) . } . } . . #[stable(feature = "rust1", since = "1.0.0")] . impl fmt::Debug for String { . #[inline] . fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { . fmt::Debug::fmt(&**self, f) -- line 2757 ---------------------------------------- -- line 2806 ---------------------------------------- . #[cfg(not(no_global_oom_handling))] . #[stable(feature = "rust1", since = "1.0.0")] . impl Add<&str> for String { . type Output = String; . . #[inline] . fn add(mut self, other: &str) -> String { . self.push_str(other); 33 ( 0.00%) self . } . } . . /// Implements the `+=` operator for appending to a `String`. . /// . /// This has the same behavior as the [`push_str`][String::push_str] method. . #[cfg(not(no_global_oom_handling))] . #[stable(feature = "stringaddassign", since = "1.12.0")] -- line 2822 ---------------------------------------- -- line 2944 ---------------------------------------- . // See , the last attempt . // to try to remove it. . #[inline] . default fn spec_to_string(&self) -> String { . let mut buf = String::new(); . let mut formatter = . core::fmt::Formatter::new(&mut buf, core::fmt::FormattingOptions::new()); . // Bypass format_args!() to avoid write_str with zero-length strs 387 ( 0.00%) fmt::Display::fmt(self, &mut formatter) 36,880 ( 0.00%) => ???:::fmt (129x) . .expect("a Display implementation returned an error unexpectedly"); 387 ( 0.00%) buf . } . } . . #[cfg(not(no_global_oom_handling))] . impl SpecToString for core::ascii::Char { . #[inline] . fn spec_to_string(&self) -> String { . self.as_str().to_owned() -- line 2962 ---------------------------------------- -- line 3274 ---------------------------------------- . /// let s = "eggplant".to_string(); . /// let s2 = "eggplant".to_string(); . /// assert_eq!(Cow::from(s), Cow::<'static, str>::Owned(s2)); . /// ``` . /// . /// [`Owned`]: crate::borrow::Cow::Owned "borrow::Cow::Owned" . #[inline] . fn from(s: String) -> Cow<'a, str> { 36,627 ( 0.00%) Cow::Owned(s) . } . } . . #[cfg(not(no_global_oom_handling))] . #[stable(feature = "cow_from_string_ref", since = "1.28.0")] . impl<'a> From<&'a String> for Cow<'a, str> { . /// Converts a [`String`] reference into a [`Borrowed`] variant. . /// No heap allocation is performed, and the string -- line 3290 ---------------------------------------- -- line 3373 ---------------------------------------- . Self::from_utf8(bytes) . } . } . . #[cfg(not(no_global_oom_handling))] . #[stable(feature = "rust1", since = "1.0.0")] . impl fmt::Write for String { . #[inline] 1,057 ( 0.00%) fn write_str(&mut self, s: &str) -> fmt::Result { . self.push_str(s); . Ok(()) 1,057 ( 0.00%) } . . #[inline] . fn write_char(&mut self, c: char) -> fmt::Result { . self.push(c); . Ok(()) . } . } . -- line 3392 ---------------------------------------- 140 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_utils/src/res.rs -------------------------------------------------------------------------------- Ir -- line 41 ---------------------------------------- . /// only returned so logic errors can be handled by not emitting a lint on . /// release builds. . #[inline] . #[cfg_attr(debug_assertions, track_caller)] . fn ty_based_def(&self, node: impl HasHirId) -> Option { . #[inline] . #[cfg_attr(debug_assertions, track_caller)] . fn f(typeck: &TypeckResults<'_>, id: HirId) -> Option { 113 ( 0.00%) if typeck.hir_owner == id.owner { 421 ( 0.00%) let def = typeck.type_dependent_def(id); 2,915 ( 0.00%) => ???:::type_dependent_def (53x) . debug_assert!( . def.is_some(), . "attempted type-dependent lookup for a node with no definition\ . \n node `{id:?}`", . ); . def . } else { . debug_assert!( -- line 58 ---------------------------------------- -- line 99 ---------------------------------------- . /// use for type dependant lookup. . fn opt_qpath(self) -> Option>; . . /// If this is a path gets its resolution. Returns `Res::Err` otherwise. . #[inline] . #[cfg_attr(debug_assertions, track_caller)] . fn res<'tcx>(self, typeck: &impl MaybeTypeckRes<'tcx>) -> Res { . #[cfg_attr(debug_assertions, track_caller)] 393 ( 0.00%) fn f(qpath: &QPath<'_>, id: HirId, typeck: &TypeckResults<'_>) -> Res { 798 ( 0.00%) match *qpath { 1,701 ( 0.00%) QPath::Resolved(_, p) => p.res, 613 ( 0.00%) QPath::TypeRelative(..) if let Some((kind, id)) = typeck.ty_based_def(id) => Res::Def(kind, id), . QPath::TypeRelative(..) => Res::Err, . } 499 ( 0.00%) } . match self.opt_qpath() { 1,013 ( 0.00%) Some((qpath, id)) if let Some(typeck) = typeck.typeck_res() => f(qpath, id, typeck), 369 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/res.rs:clippy_utils::res::MaybeQPath::res::f (25x) 3 ( 0.00%) _ => Res::Err, . } . } . . /// If this is a path with the specified name as its final segment gets its . /// resolution. Returns `Res::Err` otherwise. . #[inline] . #[cfg_attr(debug_assertions, track_caller)] . fn res_if_named<'tcx>(self, typeck: &impl MaybeTypeckRes<'tcx>, name: Symbol) -> Res { -- line 124 ---------------------------------------- -- line 243 ---------------------------------------- . } . . /// If this is a type-relative path gets the definition it resolves to. . /// . /// Only inherent associated items require a type-relative path. . #[inline] . #[cfg_attr(debug_assertions, track_caller)] . fn ty_rel_def<'tcx>(self, typeck: &impl MaybeTypeckRes<'tcx>) -> Option { 11 ( 0.00%) match self.opt_qpath() { 1 ( 0.00%) Some((QPath::TypeRelative(..), id)) => typeck.ty_based_def(id), . _ => None, . } . } . . /// If this is a type-relative path to an item with the specified name gets . /// the definition it resolves to. . /// . /// Only inherent associated items require a type-relative path. . #[inline] . #[cfg_attr(debug_assertions, track_caller)] . fn ty_rel_def_if_named<'tcx>(self, typeck: &impl MaybeTypeckRes<'tcx>, name: Symbol) -> Option { 6 ( 0.00%) match self.opt_qpath() { . Some((&QPath::TypeRelative(_, seg), id)) if seg.ident.name == name => typeck.ty_based_def(id), . _ => None, . } . } . . /// If this is a type-relative path gets the definition it resolves to and . /// its final segment. . /// -- line 272 ---------------------------------------- -- line 285 ---------------------------------------- . #[inline] . fn opt_qpath(self) -> Option> { . Some((self.0, self.1)) . } . } . impl<'tcx> MaybeQPath<'tcx> for &'tcx Expr<'_> { . #[inline] . fn opt_qpath(self) -> Option> { 2,300 ( 0.00%) match &self.kind { 1,179 ( 0.00%) ExprKind::Path(qpath) => Some((qpath, self.hir_id)), . _ => None, . } . } . } . impl<'tcx> MaybeQPath<'tcx> for &'tcx PatExpr<'_> { . #[inline] . fn opt_qpath(self) -> Option> { . match &self.kind { -- line 302 ---------------------------------------- -- line 366 ---------------------------------------- . fn basic_res(self) -> &'a Res { . self.opt_res_path().1.map_or(&Res::Err, |p| &p.res) . } . . /// If this node is a path to a local gets the local's `HirId`. . #[inline] . fn res_local_id(self) -> Option { . if let (_, Some(p)) = self.opt_res_path() 14,686 ( 0.00%) && let Res::Local(id) = p.res . { . Some(id) . } else { . None . } . } . . /// If this node is a path to a local gets the local's `HirId` and identifier. -- line 382 ---------------------------------------- -- line 405 ---------------------------------------- . #[inline] . fn basic_res(self) -> &'a Res { . &self.res . } . } . impl<'a> MaybeResPath<'a> for &QPath<'a> { . #[inline] . fn opt_res_path(self) -> OptResPath<'a> { 699 ( 0.00%) match *self { 6,568 ( 0.00%) QPath::Resolved(ty, path) => (ty, Some(path)), . QPath::TypeRelative(..) => (None, None), . } . } . . #[inline] . fn opt_ty_rel_path(self) -> OptTyRelPath<'a> { . match *self { . QPath::TypeRelative(ty, seg) => Some((ty, seg)), . QPath::Resolved(..) => None, . } . } . } . impl<'a> MaybeResPath<'a> for &Expr<'a> { . #[inline] . fn opt_res_path(self) -> OptResPath<'a> { 835,556 ( 0.04%) match &self.kind { . ExprKind::Path(qpath) => qpath.opt_res_path(), . _ => (None, None), . } . } . . #[inline] . fn opt_ty_rel_path(self) -> OptTyRelPath<'a> { . match &self.kind { -- line 438 ---------------------------------------- -- line 456 ---------------------------------------- . PatExprKind::Path(qpath) => qpath.opt_ty_rel_path(), . PatExprKind::Lit { .. } => None, . } . } . } . impl<'a, AmbigArg> MaybeResPath<'a> for &hir::Ty<'a, AmbigArg> { . #[inline] . fn opt_res_path(self) -> OptResPath<'a> { 78 ( 0.00%) match &self.kind { . TyKind::Path(qpath) => qpath.opt_res_path(), . _ => (None, None), . } . } . . #[inline] . fn opt_ty_rel_path(self) -> OptTyRelPath<'a> { . match &self.kind { -- line 472 ---------------------------------------- -- line 518 ---------------------------------------- . . /// Gets this definition's id and kind. This will lookup the kind in the def . /// tree if needed. . fn opt_def<'tcx>(self, tcx: &impl HasTyCtxt<'tcx>) -> Option<(DefKind, DefId)>; . . /// Gets the diagnostic name of this definition if it has one. . #[inline] . fn opt_diag_name<'tcx>(self, tcx: &impl HasTyCtxt<'tcx>) -> Option { 438 ( 0.00%) self.opt_def_id().and_then(|id| tcx.tcx().get_diagnostic_name(id)) 301 ( 0.00%) => ???:::get_diagnostic_name (7x) . } . . /// Checks if this definition has the specified diagnostic name. . #[inline] . fn is_diag_item<'tcx>(self, tcx: &impl HasTyCtxt<'tcx>, name: Symbol) -> bool { . self.opt_def_id() 1,950 ( 0.00%) .is_some_and(|id| tcx.tcx().is_diagnostic_item(name, id)) 270 ( 0.00%) => ???:::is_diagnostic_item (3x) . } . . /// Checks if this definition is the specified `LangItem`. . #[inline] . fn is_lang_item<'tcx>(self, tcx: &impl HasTyCtxt<'tcx>, item: LangItem) -> bool { . self.opt_def_id() 194 ( 0.00%) .is_some_and(|id| tcx.tcx().lang_items().get(item) == Some(id)) 90 ( 0.00%) => ???:::lang_items (3x) . } . . /// If this definition is an impl block gets its type. . #[inline] 66 ( 0.00%) fn opt_impl_ty<'tcx>(self, tcx: &impl HasTyCtxt<'tcx>) -> Option>> { 42 ( 0.00%) match self.opt_def(tcx) { 330 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/res.rs:::opt_def:: (3x) 6 ( 0.00%) Some((DefKind::Impl { .. }, id)) => Some(tcx.tcx().type_of(id)), . _ => None, . } 63 ( 0.00%) } . . /// Gets the parent of this definition if it has one. . #[inline] 14 ( 0.00%) fn opt_parent<'tcx>(self, tcx: &impl HasTyCtxt<'tcx>) -> Option { . self.opt_def_id().and_then(|id| tcx.tcx().opt_parent(id)) 28 ( 0.00%) } . . /// Checks if this definition is an impl block. . #[inline] . fn is_impl<'tcx>(self, tcx: &impl HasTyCtxt<'tcx>) -> bool { 6 ( 0.00%) matches!(self.opt_def(tcx), Some((DefKind::Impl { .. }, _))) . } . . /// If this definition is a constructor gets the `DefId` of it's type or variant. . #[inline] . fn ctor_parent<'tcx>(self, tcx: &impl HasTyCtxt<'tcx>) -> Option { 182 ( 0.00%) match self.opt_def(tcx) { . Some((DefKind::Ctor(..), id)) => tcx.tcx().opt_parent(id), . _ => None, . } . } . . /// If this definition is an associated item of an impl or trait gets the . /// `DefId` of its parent. . #[inline] 9 ( 0.00%) fn assoc_parent<'tcx>(self, tcx: &impl HasTyCtxt<'tcx>) -> Option { . match self.opt_def(tcx) { . Some((DefKind::AssocConst { .. } | DefKind::AssocFn | DefKind::AssocTy, id)) => tcx.tcx().opt_parent(id), . _ => None, . } 12 ( 0.00%) } . . /// If this definition is an associated function of an impl or trait gets the . /// `DefId` of its parent. . #[inline] . fn assoc_fn_parent<'tcx>(self, tcx: &impl HasTyCtxt<'tcx>) -> Option { 6 ( 0.00%) match self.opt_def(tcx) { . Some((DefKind::AssocFn, id)) => tcx.tcx().opt_parent(id), . _ => None, . } . } . } . impl MaybeDef for DefId { . #[inline] . fn opt_def_id(self) -> Option { . Some(self) . } . . #[inline] 69 ( 0.00%) fn opt_def<'tcx>(self, tcx: &impl HasTyCtxt<'tcx>) -> Option<(DefKind, DefId)> { . self.opt_def_id().map(|id| (tcx.tcx().def_kind(id), id)) 48 ( 0.00%) } . } . impl MaybeDef for (DefKind, DefId) { . #[inline] . fn opt_def_id(self) -> Option { . Some(self.1) . } . . #[inline] . fn opt_def<'tcx>(self, _: &impl HasTyCtxt<'tcx>) -> Option<(DefKind, DefId)> { 3 ( 0.00%) Some(self) . } . } . impl MaybeDef for AdtDef<'_> { . #[inline] . fn opt_def_id(self) -> Option { . Some(self.did()) . } . -- line 620 ---------------------------------------- -- line 642 ---------------------------------------- . impl MaybeDef for Res { . #[inline] . fn opt_def_id(self) -> Option { . Res::opt_def_id(&self) . } . . #[inline] . fn opt_def<'tcx>(self, _: &impl HasTyCtxt<'tcx>) -> Option<(DefKind, DefId)> { 248 ( 0.00%) match self { 158 ( 0.00%) Res::Def(kind, id) => Some((kind, id)), . _ => None, . } . } . } . impl MaybeDef for Option { . #[inline] . fn opt_def_id(self) -> Option { . self.and_then(T::opt_def_id) . } . . #[inline] . fn opt_def<'tcx>(self, tcx: &impl HasTyCtxt<'tcx>) -> Option<(DefKind, DefId)> { 6 ( 0.00%) self.and_then(|x| T::opt_def(x, tcx)) 267 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/res.rs:::opt_def:: (3x) . } . } . impl MaybeDef for EarlyBinder<'_, T> { . #[inline] . fn opt_def_id(self) -> Option { . self.skip_binder().opt_def_id() . } . -- line 672 ---------------------------------------- 5,872 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/vec_init_then_push.rs -------------------------------------------------------------------------------- Ir -- line 147 ---------------------------------------- . s, . Applicability::HasPlaceholders, . ); . } . } . . impl<'tcx> LateLintPass<'tcx> for VecInitThenPush { . fn check_block(&mut self, _: &LateContext<'tcx>, _: &'tcx Block<'tcx>) { 172 ( 0.00%) self.searcher = None; . } . 259 ( 0.00%) fn check_local(&mut self, cx: &LateContext<'tcx>, local: &'tcx LetStmt<'tcx>) { 111 ( 0.00%) if let Some(init_expr) = local.init 259 ( 0.00%) && let PatKind::Binding(BindingMode::MUT, id, name, None) = local.pat.kind 12 ( 0.00%) && !local.span.in_external_macro(cx.sess().source_map()) 20 ( 0.00%) && let Some(init) = get_vec_init_kind(cx, init_expr) 191 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:clippy_utils::higher::get_vec_init_kind (4x) . && !matches!(init, VecInitKind::WithExprCapacity(_)) . { . self.searcher = Some(VecPushSearcher { . local_id: id, . init, . lhs_is_let: true, . let_ty_span: local.ty.map(|ty| ty.span), . name: name.name, . err_span: local.span, . found: 0, . last_push_expr: init_expr.hir_id, . }); . } 296 ( 0.00%) } . . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 206,226 ( 0.01%) if self.searcher.is_none() 28 ( 0.00%) && let ExprKind::Assign(left, right, _) = expr.kind 81 ( 0.00%) && let ExprKind::Path(QPath::Resolved(None, path)) = left.kind 10 ( 0.00%) && let [name] = &path.segments 15 ( 0.00%) && let Res::Local(id) = path.res 40 ( 0.00%) && !expr.span.in_external_macro(cx.sess().source_map()) 585 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/lib.rs:::in_external_macro (5x) 25 ( 0.00%) && let Some(init) = get_vec_init_kind(cx, right) 95 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:clippy_utils::higher::get_vec_init_kind (5x) . && !matches!(init, VecInitKind::WithExprCapacity(_)) . { . self.searcher = Some(VecPushSearcher { . local_id: id, . init, . lhs_is_let: false, . let_ty_span: None, . name: name.ident.name, . err_span: expr.span, . found: 0, . last_push_expr: expr.hir_id, . }); . } 68,742 ( 0.00%) } . . fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx Stmt<'_>) { 320 ( 0.00%) if let Some(searcher) = self.searcher.take() { . if let StmtKind::Expr(expr) | StmtKind::Semi(expr) = stmt.kind . && !stmt.span.from_expansion() . && let ExprKind::MethodCall(name, self_arg, [_], _) = expr.kind . && self_arg.res_local_id() == Some(searcher.local_id) . && name.ident.name == sym::push . { . self.searcher = Some(VecPushSearcher { . err_span: searcher.err_span.to(stmt.span), -- line 210 ---------------------------------------- -- line 211 ---------------------------------------- . found: searcher.found + 1, . last_push_expr: expr.hir_id, . ..searcher . }); . } else { . searcher.display_err(cx); . } . } 160 ( 0.00%) } . . fn check_block_post(&mut self, cx: &LateContext<'tcx>, _: &'tcx Block<'tcx>) { 344 ( 0.00%) if let Some(searcher) = self.searcher.take() { . searcher.display_err(cx); . } . } . } 429 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/string_patterns.rs -------------------------------------------------------------------------------- Ir -- line 222 ---------------------------------------- . ); . } . }, . ); . } . } . . impl<'tcx> LateLintPass<'tcx> for StringPatterns { 412,452 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 206,226 ( 0.01%) if !expr.span.from_expansion() 440 ( 0.00%) && let ExprKind::MethodCall(method, receiver, args, _) = expr.kind 110 ( 0.00%) && let method_name = method.ident.name . && let Some(&(_, pos)) = PATTERN_METHODS . .iter() . .find(|(array_method_name, _)| *array_method_name == method_name) . && let Some(arg) = args.get(pos) . && let ty::Ref(_, ty, _) = cx.typeck_results().expr_ty_adjusted(receiver).kind() . && ty.is_str() . { . check_single_char_pattern_lint(cx, arg); . . check_manual_pattern_char_comparison(cx, arg, self.msrv); . } 412,452 ( 0.02%) } . } 137,008 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/neg_multiply.rs -------------------------------------------------------------------------------- Ir -- line 43 ---------------------------------------- . } . } . . false . } . . impl<'tcx> LateLintPass<'tcx> for NegMultiply { . fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 68,742 ( 0.00%) if let ExprKind::Binary(ref op, left, right) = e.kind 76 ( 0.00%) && BinOpKind::Mul == op.node . { 25 ( 0.00%) match (&left.kind, &right.kind) { . (&ExprKind::Unary(..), &ExprKind::Unary(..)) => {}, . (&ExprKind::Unary(UnOp::Neg, lit), _) => check_mul(cx, e, lit, right), . (_, &ExprKind::Unary(UnOp::Neg, lit)) => check_mul(cx, e, lit, left), . _ => {}, . } . } . } . } -- line 62 ---------------------------------------- 10 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/size_of_ref.rs -------------------------------------------------------------------------------- Ir -- line 51 ---------------------------------------- . pub SIZE_OF_REF, . suspicious, . "Argument to `size_of_val()` is a double-reference, which is almost certainly unintended" . } . . declare_lint_pass!(SizeOfRef => [SIZE_OF_REF]); . . impl LateLintPass<'_> for SizeOfRef { 274,968 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &'_ Expr<'_>) { 138,048 ( 0.01%) if let ExprKind::Call(path, [arg]) = expr.kind 540 ( 0.00%) && path.basic_res().is_diag_item(cx, sym::mem_size_of_val) . && let arg_ty = cx.typeck_results().expr_ty(arg) . && peel_and_count_ty_refs(arg_ty).1 > 1 . { . span_lint_and_help( . cx, . SIZE_OF_REF, . expr.span, . "argument to `size_of_val()` is a reference to a reference", . None, . "dereference the argument to `size_of_val()` to get the size of the value instead of the size of the reference-type", . ); . } 343,710 ( 0.02%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/slow_vector_initialization.rs -------------------------------------------------------------------------------- Ir -- line 95 ---------------------------------------- . . /// Resize is a slow initialization with the form `vec.resize(.., 0)` . Resize(&'tcx Expr<'tcx>), . } . . impl<'tcx> LateLintPass<'tcx> for SlowVectorInit { . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . // Matches initialization on reassignments. For example: `vec = Vec::with_capacity(100)` 137,512 ( 0.01%) if let ExprKind::Assign(left, right, _) = expr.kind . && let Some(local_id) = left.res_local_id() 25 ( 0.00%) && let Some(size_expr) = Self::as_vec_initializer(cx, right) 180 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/slow_vector_initialization.rs:::as_vec_initializer (5x) . { . let vi = VecAllocation { . local_id, . allocation_expr: right, . size_expr, . }; . . Self::search_initialization(cx, vi, expr.hir_id); . } . } . . fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx Stmt<'_>) { . // Matches statements which initializes vectors. For example: `let mut vec = Vec::with_capacity(10)` . // or `Vec::new()` 357 ( 0.00%) if let StmtKind::Let(local) = stmt.kind 251 ( 0.00%) && let PatKind::Binding(BindingMode::MUT, local_id, _, None) = local.pat.kind 12 ( 0.00%) && let Some(init) = local.init 20 ( 0.00%) && let Some(size_expr) = Self::as_vec_initializer(cx, init) 266 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/slow_vector_initialization.rs:::as_vec_initializer (4x) . { . let vi = VecAllocation { . local_id, . allocation_expr: init, . size_expr, . }; . . Self::search_initialization(cx, vi, stmt.hir_id); -- line 131 ---------------------------------------- -- line 134 ---------------------------------------- . } . . impl SlowVectorInit { . /// Looks for `Vec::with_capacity(size)` or `Vec::new()` calls and returns the initialized size, . /// if any. More specifically, it returns: . /// - `Some(InitializedSize::Initialized(size))` for `Vec::with_capacity(size)` . /// - `Some(InitializedSize::Uninitialized)` for `Vec::new()` . /// - `None` for other, unrelated kinds of expressions 45 ( 0.00%) fn as_vec_initializer<'tcx>(cx: &LateContext<'_>, expr: &'tcx Expr<'tcx>) -> Option> { . // Generally don't warn if the vec initializer comes from an expansion, except for the vec! macro. . // This lets us still warn on `vec![]`, while ignoring other kinds of macros that may output an . // empty vec 18 ( 0.00%) if expr.span.from_expansion() && matching_root_macro_call(cx, expr.span, sym::vec_macro).is_none() { . return None; . } . 108 ( 0.00%) if let ExprKind::Call(func, [len_expr]) = expr.kind . && func.ty_rel_def(cx).is_diag_item(cx, sym::vec_with_capacity) . { . Some(InitializedSize::Initialized(len_expr)) 10 ( 0.00%) } else if let ExprKind::Call(func, []) = expr.kind 2 ( 0.00%) && func.ty_rel_def(cx).is_diag_item(cx, sym::vec_new) . { . Some(InitializedSize::Uninitialized) . } else { . None . } 45 ( 0.00%) } . . /// Search initialization for the given vector . fn search_initialization<'tcx>(cx: &LateContext<'tcx>, vec_alloc: VecAllocation<'tcx>, parent_node: HirId) { . let enclosing_body = get_enclosing_block(cx, parent_node); . . if enclosing_body.is_none() { . return; . } -- line 169 ---------------------------------------- 22 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_utils/src/numeric_literal.rs -------------------------------------------------------------------------------- Ir . use rustc_ast::ast::{LitFloatType, LitIntType, LitKind}; . use std::iter; . . /// Represents the base of a numeric literal, used for parsing and formatting. 133,902 ( 0.01%) #[derive(Debug, PartialEq, Eq, Copy, Clone)] . pub enum Radix { . /// A binary literal (e.g., `0b1010`) . Binary, . /// An octal literal (e.g., `0o670`) . Octal, . /// A decimal literal (e.g., `123`) . Decimal, . /// A hexadecimal literal (e.g., `0xFF`) -- line 13 ---------------------------------------- -- line 47 ---------------------------------------- . pub exponent: Option<(&'a str, &'a str)>, . . /// The type suffix, including preceding underscore if present. . pub suffix: Option<&'a str>, . } . . impl<'a> NumericLiteral<'a> { . /// Attempts to parse a `NumericLiteral` from the source string of an `ast::LitKind`. 428,355 ( 0.02%) pub fn from_lit_kind(src: &'a str, lit_kind: &LitKind) -> Option> { . let unsigned_src = src.strip_prefix('-').map_or(src, |s| s); . if lit_kind.is_numeric() . && unsigned_src . .trim_start() . .chars() . .next() . .is_some_and(|c| c.is_ascii_digit()) . { . let (unsuffixed, suffix) = split_suffix(src, lit_kind); 142,785 ( 0.01%) let float = matches!(lit_kind, LitKind::Float(..)); 190,380 ( 0.01%) Some(NumericLiteral::new(unsuffixed, suffix, float)) 3,378,718 ( 0.16%) => site/frontend/rust-clippy/clippy_utils/src/numeric_literal.rs:::new (47,595x) . } else { . None . } 380,760 ( 0.02%) } . . /// Parses a raw numeric literal string into its structured `NumericLiteral` parts. . #[must_use] 333,172 ( 0.02%) pub fn new(lit: &'a str, suffix: Option<&'a str>, float: bool) -> Self { . let unsigned_lit = lit.trim_start_matches('-'); . // Determine delimiter for radix prefix, if present, and radix. 47,532 ( 0.00%) let radix = if unsigned_lit.starts_with("0x") { . Radix::Hexadecimal 9 ( 0.00%) } else if unsigned_lit.starts_with("0b") { . Radix::Binary 9 ( 0.00%) } else if unsigned_lit.starts_with("0o") { . Radix::Octal . } else { . Radix::Decimal . }; . . // Grab part of the literal after prefix, if present. . let (prefix, mut sans_prefix) = if radix == Radix::Decimal { . (None, lit) . } else { . let (p, s) = lit.split_at(2); . (Some(p), s) . }; . 47,669 ( 0.00%) if suffix.is_some() && sans_prefix.ends_with('_') { . // The '_' before the suffix isn't part of the digits . sans_prefix = &sans_prefix[..sans_prefix.len() - 1]; . } . . let (integer, fraction, exponent) = Self::split_digit_parts(sans_prefix, float); . 713,940 ( 0.03%) Self { . radix, . prefix, . integer, . fraction, . exponent, . suffix, . } 428,364 ( 0.02%) } . . /// Checks if the literal's radix is `Radix::Decimal` . pub fn is_decimal(&self) -> bool { . self.radix == Radix::Decimal . } . . fn split_digit_parts(digits: &str, float: bool) -> (&str, Option<&str>, Option<(&str, &str)>) { . let mut integer = digits; . let mut fraction = None; . let mut exponent = None; . 95,192 ( 0.00%) if float { . for (i, c) in digits.char_indices() { . match c { . '.' => { . integer = &digits[..i]; . fraction = Some(&digits[i + 1..]); . }, . 'e' | 'E' => { . let exp_start = if digits[..i].ends_with('_') { i - 1 } else { i }; -- line 130 ---------------------------------------- -- line 235 ---------------------------------------- . .map_or((src, None), |split_pos| { . let (unsuffixed, suffix) = src.split_at(split_pos); . (unsuffixed, Some(suffix)) . }) . } . . fn lit_suffix_length(lit_kind: &LitKind) -> Option { . debug_assert!(lit_kind.is_numeric()); 95,190 ( 0.00%) let suffix = match lit_kind { 190,380 ( 0.01%) LitKind::Int(_, int_lit_kind) => match int_lit_kind { . LitIntType::Signed(int_ty) => Some(int_ty.name_str()), . LitIntType::Unsigned(uint_ty) => Some(uint_ty.name_str()), . LitIntType::Unsuffixed => None, . }, . LitKind::Float(_, float_lit_kind) => match float_lit_kind { . LitFloatType::Suffixed(float_ty) => Some(float_ty.name_str()), . LitFloatType::Unsuffixed => None, . }, -- line 252 ---------------------------------------- 190,392 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/size_of_in_element_count.rs -------------------------------------------------------------------------------- Ir -- line 71 ---------------------------------------- . sym::add, . sym::wrapping_add, . sym::sub, . sym::wrapping_sub, . sym::offset, . sym::wrapping_offset, . ]; . 344,281 ( 0.02%) if let ExprKind::Call(func, [.., count]) = expr.kind . // Find calls to ptr::{copy, copy_nonoverlapping} . // and ptr::swap_nonoverlapping, 582 ( 0.00%) && let ExprKind::Path(ref func_qpath) = func.kind 970 ( 0.00%) && let Some(def_id) = cx.qpath_res(func_qpath, func.hir_id).opt_def_id() 5,562 ( 0.00%) => ???:::qpath_res (194x) 2,353 ( 0.00%) && matches!(cx.tcx.get_diagnostic_name(def_id), Some( 10,645 ( 0.00%) => ???:::get_diagnostic_name (181x) . sym::ptr_copy . | sym::ptr_copy_nonoverlapping . | sym::ptr_slice_from_raw_parts . | sym::ptr_slice_from_raw_parts_mut . | sym::ptr_swap_nonoverlapping . | sym::slice_from_raw_parts . | sym::slice_from_raw_parts_mut . )) . . // Get the pointee type . && let Some(pointee_ty) = cx.typeck_results().node_args(func.hir_id).types().next() . { . return Some((pointee_ty, count)); . } 458 ( 0.00%) if let ExprKind::MethodCall(method_path, ptr_self, [.., count], _) = expr.kind . // Find calls to copy_{from,to}{,_nonoverlapping} 32 ( 0.00%) && let method_ident = method_path.ident.name . && METHODS.contains(&method_ident) . . // Get the pointee type 2 ( 0.00%) && let ty::RawPtr(pointee_ty, _) = 1 ( 0.00%) cx.typeck_results().expr_ty(ptr_self).kind() 40 ( 0.00%) => ???:::expr_ty (1x) . { . return Some((*pointee_ty, count)); . } . None . } . . impl<'tcx> LateLintPass<'tcx> for SizeOfInElementCount { 412,452 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . const HELP_MSG: &str = "use a count of elements instead of a count of bytes\ . , it already gets multiplied by the size of the type"; . . const LINT_MSG: &str = "found a count of bytes \ . instead of a count of elements of `T`"; . . if let Some((pointee_ty, count_expr)) = get_pointee_ty_and_count_expr(cx, expr) . // Using a number of bytes for a byte type isn't suspicious -- line 122 ---------------------------------------- -- line 126 ---------------------------------------- . . // Find a size_of call in the count parameter expression and . // check that it's the same type . && let Some(ty_used_for_size_of) = get_size_of_ty(cx, count_expr, false) . && pointee_ty == ty_used_for_size_of . { . span_lint_and_help(cx, SIZE_OF_IN_ELEMENT_COUNT, count_expr.span, LINT_MSG, None, HELP_MSG); . } 412,452 ( 0.02%) } . } 388 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/match_result_ok.rs -------------------------------------------------------------------------------- Ir -- line 39 ---------------------------------------- . pub MATCH_RESULT_OK, . style, . "usage of `ok()` in `let Some(pat)` statements is unnecessary, match on `Ok(pat)` instead" . } . . declare_lint_pass!(MatchResultOk => [MATCH_RESULT_OK]); . . impl<'tcx> LateLintPass<'tcx> for MatchResultOk { 687,420 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 6 ( 0.00%) let (let_pat, let_expr, ifwhile) = 274,971 ( 0.01%) if let Some(higher::IfLet { let_pat, let_expr, .. }) = higher::IfLet::hir(cx, expr) { 344,262 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (68,742x) . (let_pat, let_expr, "if") . } else if let Some(higher::WhileLet { let_pat, let_expr, .. }) = higher::WhileLet::hir(expr) { . (let_pat, let_expr, "while") . } else { . return; . }; . 9 ( 0.00%) if let ExprKind::MethodCall(ok_path, recv, [], ..) = let_expr.kind //check is expr.ok() has type Result.ok(, _) 1 ( 0.00%) && ok_path.ident.name == sym::ok . && cx.typeck_results().expr_ty(recv).is_diag_item(cx, sym::Result) . && let Some([ok_pat]) = as_some_pattern(cx, let_pat) //get operation . && let ctxt = expr.span.ctxt() . && let_expr.span.ctxt() == ctxt . && let_pat.span.ctxt() == ctxt . { . let mut applicability = Applicability::MachineApplicable; . let some_expr_string = snippet_with_context(cx, ok_pat.span, ctxt, "", &mut applicability).0; -- line 66 ---------------------------------------- -- line 74 ---------------------------------------- . MATCH_RESULT_OK, . expr.span.with_hi(let_expr.span.hi()), . "matching on `Some` with `ok()` is redundant", . format!("consider matching on `Ok({some_expr_string})` and removing the call to `ok` instead"), . sugg, . applicability, . ); . } 549,936 ( 0.03%) } . } 6 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/misc_early/redundant_pattern.rs -------------------------------------------------------------------------------- Ir . use clippy_utils::diagnostics::span_lint_and_sugg; . use rustc_ast::ast::{Pat, PatKind}; . use rustc_errors::Applicability; . use rustc_lint::{EarlyContext, LintContext as _}; . . use super::REDUNDANT_PATTERN; . 17,549 ( 0.00%) pub(super) fn check(cx: &EarlyContext<'_>, pat: &Pat) { 17,549 ( 0.00%) if let PatKind::Ident(ann, ident, Some(ref right)) = pat.kind . && let PatKind::Wild = right.kind . && !pat.span.in_external_macro(cx.sess().source_map()) . { . span_lint_and_sugg( . cx, . REDUNDANT_PATTERN, . pat.span, . format!( -- line 17 ---------------------------------------- -- line 18 ---------------------------------------- . "the `{} @ _` pattern can be written as just `{}`", . ident.name, ident.name, . ), . "try", . format!("{}{}", ann.prefix_str(), ident.name), . Applicability::MachineApplicable, . ); . } 20,056 ( 0.00%) } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/needless_else.rs -------------------------------------------------------------------------------- Ir -- line 32 ---------------------------------------- . style, . "empty else branch" . } . . declare_lint_pass!(NeedlessElse => [NEEDLESS_ELSE]); . . impl EarlyLintPass for NeedlessElse { . fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 144,142 ( 0.01%) if let ExprKind::If(_, then_block, Some(else_clause)) = &expr.kind 18 ( 0.00%) && let ExprKind::Block(block, _) = &else_clause.kind 18 ( 0.00%) && !expr.span.from_expansion() 18 ( 0.00%) && !else_clause.span.from_expansion() 18 ( 0.00%) && block.stmts.is_empty() . && let range = (then_block.span.hi()..expr.span.hi()).trim_start(cx) . && range.clone().check_text(cx, |src| { . // Ignore else blocks that contain comments or #[cfg]s . !src.contains(['/', '#']) . }) . { . span_lint_and_sugg( . cx, -- line 52 ---------------------------------------- -- line 53 ---------------------------------------- . NEEDLESS_ELSE, . range.with_ctxt(expr.span.ctxt()), . "this `else` branch is empty", . "you can remove it", . String::new(), . Applicability::MachineApplicable, . ); . } 72,029 ( 0.00%) } . } 126 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_ignore_case_cmp.rs -------------------------------------------------------------------------------- Ir -- line 41 ---------------------------------------- . . declare_lint_pass!(ManualIgnoreCaseCmp => [MANUAL_IGNORE_CASE_CMP]); . . enum MatchType<'a> { . ToAscii(bool, Ty<'a>), . Literal(LitKind), . } . 104 ( 0.00%) fn get_ascii_type<'a>(cx: &LateContext<'a>, kind: rustc_hir::ExprKind<'_>) -> Option<(Span, MatchType<'a>)> { 65 ( 0.00%) if let MethodCall(path, expr, _, _) = kind { . let is_lower = match path.ident.name { . sym::to_ascii_lowercase => true, . sym::to_ascii_uppercase => false, . _ => return None, . }; . let ty_raw = cx.typeck_results().expr_ty(expr); . let ty = ty_raw.peel_refs(); . if needs_ref_to_cmp(cx, ty) -- line 58 ---------------------------------------- -- line 61 ---------------------------------------- . || matches!(ty.opt_diag_name(cx), Some(sym::OsStr | sym::OsString)) . { . return Some((expr.span, ToAscii(is_lower, ty_raw))); . } . } else if let Lit(expr) = kind { . return Some((expr.span, Literal(expr.node))); . } . None 104 ( 0.00%) } . . /// Returns true if the type needs to be dereferenced to be compared . fn needs_ref_to_cmp(cx: &LateContext<'_>, ty: Ty<'_>) -> bool { . ty.is_char() . || *ty.kind() == ty::Uint(UintTy::U8) . || ty.is_diag_item(cx, sym::Vec) . || ty.is_lang_item(cx, LangItem::String) . } . . impl LateLintPass<'_> for ManualIgnoreCaseCmp { 549,936 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &'_ Expr<'_>) { . // check if expression represents a comparison of two strings . // using .to_ascii_lowercase() or .to_ascii_uppercase() methods, . // or one of the sides is a literal . // Offer to replace it with .eq_ignore_ascii_case() method 137,484 ( 0.01%) if let Binary(op, left, right) = &expr.kind 208 ( 0.00%) && (op.node == BinOpKind::Eq || op.node == BinOpKind::Ne) 221 ( 0.00%) && let Some((left_span, left_val)) = get_ascii_type(cx, left.kind) 299 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_ignore_case_cmp.rs:clippy_lints::manual_ignore_case_cmp::get_ascii_type (13x) . && let Some((right_span, right_val)) = get_ascii_type(cx, right.kind) . && match (&left_val, &right_val) { . (ToAscii(l_lower, ..), ToAscii(r_lower, ..)) if l_lower == r_lower => true, . (ToAscii(..), Literal(..)) | (Literal(..), ToAscii(..)) => true, . _ => false, . } . { . let deref = match right_val { -- line 95 ---------------------------------------- -- line 117 ---------------------------------------- . expr.span, . "consider using `.eq_ignore_ascii_case()` instead", . format!("{neg}{left_snip}.eq_ignore_ascii_case({deref}{right_snip})"), . app, . ); . }, . ); . } 549,936 ( 0.03%) } . } 115 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_take.rs -------------------------------------------------------------------------------- Ir -- line 48 ---------------------------------------- . . impl ManualTake { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl LateLintPass<'_> for ManualTake { 549,936 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 137,582 ( 0.01%) if let ExprKind::If(cond, then, Some(otherwise)) = expr.kind 20 ( 0.00%) && let ExprKind::Path(_) = cond.kind 2 ( 0.00%) && let ExprKind::Block( . Block { 3 ( 0.00%) stmts: [stmt], . expr: Some(then_expr), . .. . }, . .., . ) = then.kind . && let ExprKind::Block( . Block { . stmts: [], -- line 69 ---------------------------------------- -- line 98 ---------------------------------------- . expr.span, . "use", . format!("{negate}{std_or_core}::mem::take(&mut {taken})"), . app, . ); . }, . ); . } 549,936 ( 0.03%) } . } . . fn as_const_bool(e: &Expr<'_>) -> Option { . if let ExprKind::Lit(lit) = e.kind . && let LitKind::Bool(b) = lit.node . { . Some(b) . } else { -- line 114 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/redundant_slicing.rs -------------------------------------------------------------------------------- Ir -- line 67 ---------------------------------------- . } . . declare_lint_pass!(RedundantSlicing => [DEREF_BY_SLICING, REDUNDANT_SLICING]); . . static REDUNDANT_SLICING_LINT: (&Lint, &str) = (REDUNDANT_SLICING, "redundant slicing of the whole range"); . static DEREF_BY_SLICING_LINT: (&Lint, &str) = (DEREF_BY_SLICING, "slicing when dereferencing would work"); . . impl<'tcx> LateLintPass<'tcx> for RedundantSlicing { 549,936 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 137,484 ( 0.01%) if expr.span.from_expansion() { . return; . } . 68,504 ( 0.00%) let ctxt = expr.span.ctxt(); 137,113 ( 0.01%) if let ExprKind::AddrOf(BorrowKind::Ref, mutability, addressee) = expr.kind 42 ( 0.00%) && addressee.span.ctxt() == ctxt 48 ( 0.00%) && let ExprKind::Index(indexed, range, _) = addressee.kind 3 ( 0.00%) && cx . .typeck_results() 6 ( 0.00%) .expr_ty_adjusted(range) 207 ( 0.00%) => ???:::expr_ty_adjusted (3x) . .is_lang_item(cx, LangItem::RangeFull) . { . let (expr_ty, expr_ref_count, _) = peel_and_count_ty_refs(cx.typeck_results().expr_ty(expr)); . let (indexed_ty, indexed_ref_count, _) = peel_and_count_ty_refs(cx.typeck_results().expr_ty(indexed)); . let parent_expr = get_parent_expr(cx, expr); . let needs_parens_for_prefix = . parent_expr.is_some_and(|parent| cx.precedence(parent) > ExprPrecedence::Prefix); . -- line 94 ---------------------------------------- -- line 159 ---------------------------------------- . format!("(&{}{}*{snip})", mutability.prefix_str(), "*".repeat(indexed_ref_count)) . } else { . format!("&{}{}*{snip}", mutability.prefix_str(), "*".repeat(indexed_ref_count)) . }; . diag.span_suggestion(expr.span, "dereference the original value instead", sugg, app); . }); . } . } 549,936 ( 0.03%) } . } 274,106 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs -------------------------------------------------------------------------------- Ir -- line 243 ---------------------------------------- . // The is a separate function to avoid doing it in every generic version, but it . // looks small to the mir inliner (particularly in panic=abort) so leave it to . // the backend to decide whether pulling it in everywhere is worth doing. . #[rustc_no_mir_inline] . #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces . #[cfg(not(no_global_oom_handling))] . #[rustc_const_unstable(feature = "const_heap", issue = "79597")] . const fn box_new_uninit(layout: Layout) -> *mut u8 { 7,179 ( 0.00%) match Global.allocate(layout) { . Ok(ptr) => ptr.as_mut_ptr(), . Err(_) => handle_alloc_error(layout), . } . } . . /// Helper for `vec!`. . /// . /// This is unsafe, but has to be marked as safe or else we couldn't use it in `vec!`. -- line 259 ---------------------------------------- -- line 285 ---------------------------------------- . #[must_use] . #[rustc_diagnostic_item = "box_new"] . #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces . pub fn new(x: T) -> Self { . // This is `Box::new_uninit` but inlined to avoid build time regressions. . let ptr = box_new_uninit(::LAYOUT) as *mut T; . // Nothing below can panic so we do not have to worry about deallocating `ptr`. . // SAFETY: we just allocated the box to store `x`. 36,751 ( 0.00%) unsafe { core::intrinsics::write_via_move(ptr, x) }; 60 ( 0.00%) => ???:0x0000000000173dc0 (2x) . // SAFETY: we just initialized the memory `ptr` points to. . unsafe { mem::transmute(ptr) } . } . . /// Constructs a new box with uninitialized contents. . /// . /// # Examples . /// -- line 301 ---------------------------------------- -- line 578 ---------------------------------------- . #[must_use] . pub fn new_uninit_in(alloc: A) -> Box, A> . where . A: Allocator, . { . let layout = Layout::new::>(); . // NOTE: Prefer match over unwrap_or_else since closure sometimes not inlineable. . // That would make code size bigger. 4 ( 0.00%) match Box::try_new_uninit_in(alloc) { . Ok(m) => m, . Err(_) => handle_alloc_error(layout), . } . } . . /// Constructs a new box with uninitialized contents in the provided allocator, . /// returning an error if the allocation fails . /// -- line 594 ---------------------------------------- -- line 1990 ---------------------------------------- . #[inline] . fn drop(&mut self) { . // the T in the Box is dropped by the compiler before the destructor is run . . let ptr = self.0; . . unsafe { . let layout = Layout::for_value_raw(ptr.as_ptr()); 2 ( 0.00%) if layout.size() != 0 { . self.1.deallocate(From::from(ptr.cast()), layout); . } . } . } . } . . #[cfg(not(no_global_oom_handling))] . #[stable(feature = "rust1", since = "1.0.0")] -- line 2006 ---------------------------------------- -- line 2386 ---------------------------------------- . fn borrow_mut(&mut self) -> &mut T { . &mut **self . } . } . . #[stable(since = "1.5.0", feature = "smart_ptr_as_ref")] . impl AsRef for Box { . fn as_ref(&self) -> &T { 8 ( 0.00%) &**self . } . } . . #[stable(since = "1.5.0", feature = "smart_ptr_as_ref")] . impl AsMut for Box { . fn as_mut(&mut self) -> &mut T { . &mut **self . } -- line 2402 ---------------------------------------- 138 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/infinite_iter.rs -------------------------------------------------------------------------------- Ir -- line 48 ---------------------------------------- . pub MAYBE_INFINITE_ITER, . pedantic, . "possible infinite iteration" . } . . declare_lint_pass!(InfiniteIter => [INFINITE_ITER, MAYBE_INFINITE_ITER]); . . impl<'tcx> LateLintPass<'tcx> for InfiniteIter { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . let (lint, msg) = match complete_infinite_iter(cx, expr) { . Infinite => (INFINITE_ITER, "infinite iteration detected"), . MaybeInfinite => (MAYBE_INFINITE_ITER, "possible infinite iteration detected"), . Finite => { . return; . }, . }; . span_lint(cx, lint, expr.span, msg); 412,452 ( 0.02%) } . } . . #[derive(Copy, Clone, Debug, PartialEq, Eq)] . enum Finiteness { . Infinite, . MaybeInfinite, . Finite, . } . . use self::Finiteness::{Finite, Infinite, MaybeInfinite}; . . impl Finiteness { . #[must_use] . fn and(self, b: Self) -> Self { 54 ( 0.00%) match (self, b) { . (Finite, _) | (_, Finite) => Finite, . (MaybeInfinite, _) | (_, MaybeInfinite) => MaybeInfinite, . _ => Infinite, . } . } . . #[must_use] . fn or(self, b: Self) -> Self { -- line 88 ---------------------------------------- -- line 91 ---------------------------------------- . (MaybeInfinite, _) | (_, MaybeInfinite) => MaybeInfinite, . _ => Finite, . } . } . } . . impl From for Finiteness { . fn from(b: bool) -> Self { 3 ( 0.00%) if b { Infinite } else { Finite } . } . } . . /// This tells us what to look for to know if the iterator returned by . /// this method is infinite . #[derive(Copy, Clone)] . enum Heuristic { . /// infinite no matter what -- line 107 ---------------------------------------- -- line 138 ---------------------------------------- . (sym::filter, 1, First, Infinite), . (sym::filter_map, 1, First, Infinite), . (sym::flat_map, 1, First, Infinite), . (sym::unzip, 0, First, Infinite), . (sym::take_while, 1, First, MaybeInfinite), . (sym::scan, 2, First, MaybeInfinite), . ]; . 540 ( 0.00%) fn is_infinite(cx: &LateContext<'_>, expr: &Expr<'_>) -> Finiteness { 432 ( 0.00%) match expr.kind { . ExprKind::MethodCall(method, receiver, args, _) => { . for &(name, len, heuristic, cap) in &HEURISTICS { . if method.ident.name == name && args.len() == len { . return (match heuristic { . Always => Infinite, . First => is_infinite(cx, receiver), . Any => is_infinite(cx, receiver).or(is_infinite(cx, &args[0])), . All => is_infinite(cx, receiver).and(is_infinite(cx, &args[0])), -- line 155 ---------------------------------------- -- line 163 ---------------------------------------- . { . let body = cx.tcx.hir_body(body); . return is_infinite(cx, body.value); . } . Finite . }, . ExprKind::Block(block, _) => block.expr.as_ref().map_or(Finite, |e| is_infinite(cx, e)), . ExprKind::AddrOf(BorrowKind::Ref, _, e) => is_infinite(cx, e), 2 ( 0.00%) ExprKind::Call(path, _) => { 6 ( 0.00%) if let ExprKind::Path(ref qpath) = path.kind { 12 ( 0.00%) cx.qpath_res(qpath, path.hir_id) 46 ( 0.00%) => ???:::qpath_res (2x) . .opt_def_id() 3 ( 0.00%) .is_some_and(|id| cx.tcx.is_diagnostic_item(sym::iter_repeat, id)) 44 ( 0.00%) => ???:::is_diagnostic_item (1x) . .into() . } else { . Finite . } . }, . ExprKind::Struct(..) => higher::Range::hir(cx, expr).is_some_and(|r| r.end.is_none()).into(), . _ => Finite, . } 378 ( 0.00%) } . . /// the names and argument lengths of methods that *may* exhaust their . /// iterators . const POSSIBLY_COMPLETING_METHODS: [(Symbol, usize); 6] = [ . (sym::find, 1), . (sym::rfind, 1), . (sym::position, 1), . (sym::rposition, 1), -- line 192 ---------------------------------------- -- line 207 ---------------------------------------- . (sym::min, 0), . (sym::min_by, 1), . (sym::min_by_key, 1), . (sym::sum, 0), . (sym::product, 0), . ]; . . fn complete_infinite_iter(cx: &LateContext<'_>, expr: &Expr<'_>) -> Finiteness { 343,558 ( 0.02%) match expr.kind { 330 ( 0.00%) ExprKind::MethodCall(method, receiver, args, _) => { 110 ( 0.00%) let method_str = method.ident.name; . for &(name, len) in &COMPLETING_METHODS { 2,420 ( 0.00%) if method_str == name && args.len() == len { . return is_infinite(cx, receiver); . } . } . for &(name, len) in &POSSIBLY_COMPLETING_METHODS { 756 ( 0.00%) if method_str == name && args.len() == len { . return MaybeInfinite.and(is_infinite(cx, receiver)); . } . } 220 ( 0.00%) if method.ident.name == sym::last && args.is_empty() { . let not_double_ended = cx . .tcx . .get_diagnostic_item(sym::DoubleEndedIterator) . .is_some_and(|id| !implements_trait(cx, cx.typeck_results().expr_ty(receiver), id, &[])); . if not_double_ended { . return is_infinite(cx, receiver); . } 110 ( 0.00%) } else if method.ident.name == sym::collect { 2 ( 0.00%) let ty = cx.typeck_results().expr_ty(expr); 40 ( 0.00%) => ???:::expr_ty (1x) 5 ( 0.00%) if matches!( . ty.opt_diag_name(cx), . Some( . sym::BinaryHeap . | sym::BTreeMap . | sym::BTreeSet . | sym::HashMap . | sym::HashSet . | sym::LinkedList -- line 246 ---------------------------------------- -- line 247 ---------------------------------------- . | sym::Vec . | sym::VecDeque, . ) . ) { . return is_infinite(cx, receiver); . } . } . }, 54 ( 0.00%) ExprKind::Binary(op, l, r) if op.node.is_comparison() => { 162 ( 0.00%) return is_infinite(cx, l).and(is_infinite(cx, r)).and(MaybeInfinite); 1,474 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/infinite_iter.rs:clippy_lints::infinite_iter::is_infinite (54x) . }, // TODO: ExprKind::Loop + Match . _ => (), . } . Finite . } 994 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/approx_const.rs -------------------------------------------------------------------------------- Ir -- line 74 ---------------------------------------- . impl ApproxConstant { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl LateLintPass<'_> for ApproxConstant { . fn check_lit(&mut self, cx: &LateContext<'_>, _hir_id: HirId, lit: Lit, _is_negated_pat: bool) { 108,866 ( 0.01%) match lit.node { . LitKind::Float(s, LitFloatType::Suffixed(fty)) => match fty { . FloatTy::F16 => self.check_known_consts(cx, lit.span, s, "f16"), . FloatTy::F32 => self.check_known_consts(cx, lit.span, s, "f32"), . FloatTy::F64 => self.check_known_consts(cx, lit.span, s, "f64"), . FloatTy::F128 => self.check_known_consts(cx, lit.span, s, "f128"), . }, . // FIXME(f16_f128): add `f16` and `f128` when these types become stable. . LitKind::Float(s, LitFloatType::Unsuffixed) => self.check_known_consts(cx, lit.span, s, "f{32, 64}"), . _ => (), . } 54,433 ( 0.00%) } . } . . impl ApproxConstant { . fn check_known_consts(&self, cx: &LateContext<'_>, span: Span, s: symbol::Symbol, module: &str) { . let s = s.as_str(); . if let Ok(maybe_constant) = s.parse::() { . for &(constant, name, min_digits, msrv) in &KNOWN_CONSTS { . if is_approx_const(constant, s, maybe_constant, min_digits) -- line 101 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/init_numbered_fields.rs -------------------------------------------------------------------------------- Ir -- line 37 ---------------------------------------- . pub INIT_NUMBERED_FIELDS, . style, . "numbered fields in tuple struct initializer" . } . . declare_lint_pass!(NumberedFields => [INIT_NUMBERED_FIELDS]); . . impl<'tcx> LateLintPass<'tcx> for NumberedFields { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 137,652 ( 0.01%) if let ExprKind::Struct(path, fields @ [field, ..], StructTailExpr::None) = e.kind . // If the first character of any field is a digit it has to be a tuple. 48 ( 0.00%) && field.ident.as_str().as_bytes().first().is_some_and(u8::is_ascii_digit) 768 ( 0.00%) => ???:::as_str (24x) . // Type aliases can't be used as functions. . && !matches!( . cx.qpath_res(path, e.hir_id), . Res::Def(DefKind::TyAlias | DefKind::AssocTy, _) . ) . // This is the only syntax macros can use that works for all struct types. . && !e.span.from_expansion() . && let mut has_side_effects = false -- line 56 ---------------------------------------- -- line 89 ---------------------------------------- . .intersperse(Cow::Borrowed(", ")) . .collect::() . ), . app, . ); . }, . ); . } 481,194 ( 0.02%) } . } 48 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/len_zero.rs -------------------------------------------------------------------------------- Ir -- line 96 ---------------------------------------- . . impl LenZero { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl<'tcx> LateLintPass<'tcx> for LenZero { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 206,229 ( 0.01%) if let ExprKind::Let(lt) = expr.kind 27 ( 0.00%) && match lt.pat.kind { . PatKind::Slice([], None, []) => true, . PatKind::Expr(lit) . if let PatExprKind::Lit { lit, .. } = lit.kind . && let LitKind::Str(lit, _) = lit.node => . { . lit.as_str().is_empty() . }, . _ => false, -- line 114 ---------------------------------------- -- line 127 ---------------------------------------- . lt.span, . "comparison to empty slice using `if let`", . "using `is_empty` is clearer and more explicit", . format!("{lit_str}.is_empty()"), . applicability, . ); . } . 137,698 ( 0.01%) if let ExprKind::MethodCall(method, lhs_expr, [rhs_expr], _) = expr.kind 256 ( 0.00%) && cx.ty_based_def(expr).opt_parent(cx).is_diag_item(cx, sym::PartialEq) . && !expr.span.from_expansion() . { . self.check_empty_expr( . cx, . expr.span, . lhs_expr, . peel_ref_operators(cx, rhs_expr), . if method.ident.name == sym::ne { . "!" . } else { . Default::default() . }, . ); . } . 137,642 ( 0.01%) if let ExprKind::Binary(Spanned { node: cmp, .. }, left, right) = expr.kind 152 ( 0.00%) && !expr.span.from_expansion() . { . // expr.span might contains parenthesis, see issue #10529 75 ( 0.00%) let actual_span = span_without_enclosing_paren(cx, expr.span); 303 ( 0.00%) match cmp { . BinOpKind::Eq => { 99 ( 0.00%) self.check_cmp(cx, actual_span, left, right, "", 0); // len == 0 514 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/len_zero.rs:::check_cmp (9x) 72 ( 0.00%) self.check_cmp(cx, actual_span, right, left, "", 0); // 0 == len . }, . BinOpKind::Ne => { 39 ( 0.00%) self.check_cmp(cx, actual_span, left, right, "!", 0); // len != 0 174 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/len_zero.rs:::check_cmp (3x) 21 ( 0.00%) self.check_cmp(cx, actual_span, right, left, "!", 0); // 0 != len . }, . BinOpKind::Gt => { 55 ( 0.00%) self.check_cmp(cx, actual_span, left, right, "!", 0); // len > 0 284 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/len_zero.rs:::check_cmp (5x) 35 ( 0.00%) self.check_cmp(cx, actual_span, right, left, "", 1); // 1 > len . }, . BinOpKind::Lt => { 33 ( 0.00%) self.check_cmp(cx, actual_span, left, right, "", 1); // len < 1 172 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/len_zero.rs:::check_cmp (3x) 18 ( 0.00%) self.check_cmp(cx, actual_span, right, left, "!", 0); // 0 < len . }, 12 ( 0.00%) BinOpKind::Ge => self.check_cmp(cx, actual_span, left, right, "!", 1), // len >= 1 20 ( 0.00%) BinOpKind::Le => self.check_cmp(cx, actual_span, right, left, "!", 1), // 1 <= len . _ => (), . } . } 549,936 ( 0.03%) } . } . . impl LenZero { 414 ( 0.00%) fn check_cmp( . &self, . cx: &LateContext<'_>, . span: Span, . method: &Expr<'_>, . lit: &Expr<'_>, . op: &str, . compare_to: u32, . ) { 92 ( 0.00%) if method.span.from_expansion() { . return; . } . 92 ( 0.00%) if let (&ExprKind::MethodCall(method_path, receiver, [], _), ExprKind::Lit(lit)) = (&method.kind, &lit.kind) { . // check if we are in an is_empty() method . if parent_item_name(cx, method) == Some(sym::is_empty) { . return; . } . . self.check_len(cx, span, method_path.ident.name, receiver, &lit.node, op, compare_to); . } else { 368 ( 0.00%) self.check_empty_expr(cx, span, method, lit, op); 1,266 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/len_zero.rs:::check_empty_expr (46x) . } . } . . #[expect(clippy::too_many_arguments)] . fn check_len( . &self, . cx: &LateContext<'_>, . span: Span, -- line 212 ---------------------------------------- -- line 235 ---------------------------------------- . snippet_with_context(cx, receiver.span, span.ctxt(), "_", &mut applicability).0, . ), . applicability, . ); . } . } . } . 644 ( 0.00%) fn check_empty_expr(&self, cx: &LateContext<'_>, span: Span, lit1: &Expr<'_>, lit2: &Expr<'_>, op: &str) { . if (is_empty_array(lit2) || is_empty_string(lit2)) && has_is_empty(cx, lit1, self.msrv) { . let mut applicability = Applicability::MachineApplicable; . . let lit1 = peel_ref_operators(cx, lit1); . let lit_str = Sugg::hir_with_context(cx, lit1, span.ctxt(), "_", &mut applicability).maybe_paren(); . . span_lint_and_sugg( . cx, -- line 251 ---------------------------------------- -- line 252 ---------------------------------------- . COMPARISON_TO_EMPTY, . span, . "comparison to empty slice", . format!("using `{op}is_empty` is clearer and more explicit"), . format!("{op}{lit_str}.is_empty()"), . applicability, . ); . } 368 ( 0.00%) } . } . . fn span_without_enclosing_paren(cx: &LateContext<'_>, span: Span) -> Span { 525 ( 0.00%) let Some(snippet) = span.get_text(cx) else { . return span; . }; 225 ( 0.00%) if has_enclosing_paren(snippet) { 6,447 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/sugg.rs:clippy_utils::sugg::has_enclosing_paren:: (75x) 7 ( 0.00%) let source_map = cx.tcx.sess.source_map(); 28 ( 0.00%) let left_paren = source_map.start_point(span); 1,554 ( 0.00%) => ???:::start_point (7x) 21 ( 0.00%) let right_parent = source_map.end_point(span); 2,625 ( 0.00%) => ???:::end_point (7x) 14 ( 0.00%) left_paren.between(right_parent) 749 ( 0.00%) => ???:::between (7x) . } else { . span . } . } . . fn is_empty_string(expr: &Expr<'_>) -> bool { 116 ( 0.00%) if let ExprKind::Lit(lit) = expr.kind . && let LitKind::Str(lit, _) = lit.node . { . let lit = lit.as_str(); . return lit.is_empty(); . } . false . } . . fn is_empty_array(expr: &Expr<'_>) -> bool { 138 ( 0.00%) if let ExprKind::Array(arr) = expr.kind { . return arr.is_empty(); . } . false . } . . /// Checks if this type has an `is_empty` method. . fn has_is_empty(cx: &LateContext<'_>, expr: &Expr<'_>, msrv: Msrv) -> bool { . /// Gets an `AssocItem` and return true if it matches `is_empty(self)`. -- line 296 ---------------------------------------- 733 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_data_structures/src/packed.rs -------------------------------------------------------------------------------- Ir -- line 2 ---------------------------------------- . use std::fmt; . . use rustc_serialize::{Decodable, Decoder, Encodable, Encoder}; . . use crate::stable_hash::{StableHash, StableHashCtxt, StableHasher}; . . /// A packed 128-bit integer. Useful for reducing the size of structures in . /// some cases. 10 ( 0.00%) #[derive(Copy, Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)] . #[repr(packed(8))] . pub struct Pu128(pub u128); . . impl Pu128 { . #[inline] . pub fn get(self) -> u128 { . self.0 . } -- line 18 ---------------------------------------- -- line 30 ---------------------------------------- . fn from(value: u128) -> Self { . Self(value) . } . } . . impl PartialEq for Pu128 { . #[inline] . fn eq(&self, other: &u128) -> bool { 7 ( 0.00%) ({ self.0 }) == *other . } . } . . impl PartialOrd for Pu128 { . #[inline] . fn partial_cmp(&self, other: &u128) -> Option { 38,712 ( 0.00%) { self.0 }.partial_cmp(other) . } . } . . impl fmt::Display for Pu128 { . #[inline] . fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { . { self.0 }.fmt(f) . } . } . . impl fmt::UpperHex for Pu128 { . #[inline] 1 ( 0.00%) fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 4 ( 0.00%) { self.0 }.fmt(f) 660 ( 0.00%) => ???:::fmt (1x) 2 ( 0.00%) } . } . . impl StableHash for Pu128 { . #[inline] . fn stable_hash(&self, hcx: &mut Hcx, hasher: &mut StableHasher) { . { self.0 }.stable_hash(hcx, hasher) . } . } -- line 68 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/borrow.rs -------------------------------------------------------------------------------- Ir -- line 190 ---------------------------------------- . fn borrow(&self) -> &B { . &**self . } . } . . #[stable(feature = "rust1", since = "1.0.0")] . impl Clone for Cow<'_, B> { . fn clone(&self) -> Self { 22 ( 0.00%) match *self { 8 ( 0.00%) Borrowed(b) => Borrowed(b), . Owned(ref o) => { . let b: &B = o.borrow(); . Owned(b.to_owned()) . } . } . } . . fn clone_from(&mut self, source: &Self) { -- line 207 ---------------------------------------- -- line 324 ---------------------------------------- . /// . /// assert_eq!( . /// cow.into_owned(), . /// String::from(s) . /// ); . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . pub fn into_owned(self) -> ::Owned { 2 ( 0.00%) match self { . Borrowed(borrowed) => borrowed.to_owned(), . Owned(owned) => owned, . } . } . } . . // FIXME(inference): const bounds removed due to inference regressions found by crater; . // see https://github.com/rust-lang/rust/issues/147964 -- line 340 ---------------------------------------- -- line 342 ---------------------------------------- . #[stable(feature = "rust1", since = "1.0.0")] . impl Deref for Cow<'_, B> . // where . // B::Owned: [const] Borrow, . { . type Target = B; . . fn deref(&self) -> &B { 24,386 ( 0.00%) match *self { . Borrowed(borrowed) => borrowed, . Owned(ref owned) => owned.borrow(), . } . } . } . . // `Cow<'_, T>` can only implement `DerefPure` if `>` (and `BorrowMut`) is trusted. . // For now, we restrict `DerefPure for Cow` to `T: Sized` (`T as Borrow` is trusted), -- line 358 ---------------------------------------- -- line 417 ---------------------------------------- . } . } . . #[stable(feature = "rust1", since = "1.0.0")] . impl fmt::Display for Cow<'_, B> . where . B: fmt::Display + ToOwned, . { 48 ( 0.00%) fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 5,779 ( 0.00%) => ???:::fmt (24x) . match *self { . Borrowed(ref b) => fmt::Display::fmt(b, f), . Owned(ref o) => fmt::Display::fmt(o, f), . } . } . } . . #[stable(feature = "default", since = "1.11.0")] -- line 433 ---------------------------------------- 152 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/async_yields_async.rs -------------------------------------------------------------------------------- Ir -- line 43 ---------------------------------------- . pub ASYNC_YIELDS_ASYNC, . correctness, . "async blocks that return a type that can be awaited" . } . . declare_lint_pass!(AsyncYieldsAsync => [ASYNC_YIELDS_ASYNC]); . . impl<'tcx> LateLintPass<'tcx> for AsyncYieldsAsync { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 137,508 ( 0.01%) let ExprKind::Closure(Closure { . kind: ClosureKind::Coroutine(CoroutineKind::Desugared(CoroutineDesugaring::Async, kind)), . body: body_id, . .. 12 ( 0.00%) }) = expr.kind . else { . return; . }; . . let body_expr = match kind { . CoroutineSource::Fn => { . // For functions, with explicitly defined types, don't warn. . // XXXkhuey maybe we should? -- line 64 ---------------------------------------- -- line 118 ---------------------------------------- . return_expr_span, . "consider awaiting this value", . format!("{return_expr_snip}.await"), . applicability, . ); . }, . ); . } 549,936 ( 0.03%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_error_messages/src/lib.rs -------------------------------------------------------------------------------- Ir -- line 84 ---------------------------------------- . /// A collection of `Span`s. . /// . /// Spans have two orthogonal attributes: . /// . /// - They can be *primary spans*. In this case they are the locus of . /// the error, and would be rendered with `^^^`. . /// - They can have a *label*. In this case, the label is written next . /// to the mark in the snippet when we render. 21,378 ( 0.00%) #[derive(Clone, Debug, Hash, PartialEq, Eq, Encodable, Decodable, StableHash)] . pub struct MultiSpan { . primary_spans: Vec, 9,162 ( 0.00%) span_labels: Vec<(Span, DiagMessage)>, 64 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs: as core::clone::Clone>::clone (2x) . } . . impl MultiSpan { . #[inline] . pub fn new() -> MultiSpan { 8 ( 0.00%) MultiSpan { primary_spans: vec![], span_labels: vec![] } . } . . pub fn from_span(primary_span: Span) -> MultiSpan { . MultiSpan { primary_spans: vec![primary_span], span_labels: vec![] } . } . . pub fn from_spans(mut vec: Vec) -> MultiSpan { . vec.sort(); -- line 109 ---------------------------------------- 3,062 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/token.rs -------------------------------------------------------------------------------- Ir -- line 25 ---------------------------------------- . impl DocFragmentKind { . pub fn is_sugared(self) -> bool { . matches!(self, Self::Sugared(_)) . } . . /// If it is `Sugared`, it will return its associated `CommentKind`, otherwise it will return . /// `CommentKind::Line`. . pub fn comment_kind(self) -> CommentKind { 414 ( 0.00%) match self { . Self::Sugared(kind) => kind, . Self::Raw(_) => CommentKind::Line, . } . } . } . . #[derive(Clone, Copy, PartialEq, Eq, Hash, Encodable, Decodable, Debug, StableHash)] . pub enum CommentKind { -- line 41 ---------------------------------------- -- line 180 ---------------------------------------- . } . } . } . . // Note that the suffix is *not* considered when deciding the `LitKind` in this . // type. This means that float literals like `1f32` are classified by this type . // as `Int`. Only upon conversion to `ast::LitKind` will such a literal be . // given the `Float` kind. 108,866 ( 0.01%) #[derive(Clone, Copy, PartialEq, Eq, Hash, Encodable, Decodable, Debug, StableHash)] . pub enum LitKind { . Bool, // AST only, must never appear in a `Token` . Byte, . Char, . Integer, // e.g. `1`, `1u8`, `1f32` . Float, // e.g. `1.`, `1.0`, `1e3f32` . Str, . StrRaw(u8), // raw string delimited by `n` hash symbols -- line 196 ---------------------------------------- 154,848 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_checked_ops.rs -------------------------------------------------------------------------------- Ir -- line 41 ---------------------------------------- . . #[derive(Copy, Clone)] . enum NonZeroBranch { . Then, . Else, . } . . impl LateLintPass<'_> for ManualCheckedOps { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 137,571 ( 0.01%) if let ExprKind::If(cond, then, r#else) = expr.kind 58 ( 0.00%) && !expr.span.from_expansion() . && let Some((divisor, branch)) = divisor_from_condition(cond) . // This lint is intended for unsigned integers only. . // . // For signed integers, the most direct refactor to `checked_div` is often not . // semantically equivalent to the original guard. For example, `rhs > 0` deliberately . // excludes negative divisors, while `checked_div` would return `Some` for `rhs = -2`. . // Also, `checked_div` can return `None` for `MIN / -1`, which requires additional . // handling beyond the zero check. 6 ( 0.00%) && is_unsigned_integer(cx, divisor) . && let Some(block) = branch_block(then, r#else, branch) . { . let mut eq = SpanlessEq::new(cx).deny_side_effects().paths_by_resolution(); 28 ( 0.00%) if !eq.eq_expr(SyntaxContext::root(), divisor, divisor) { 3,024 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:::eq_expr (4x) . return; . } . . let mut division_spans = Vec::new(); 4 ( 0.00%) let mut first_use = None; . 44 ( 0.00%) let found_early_use = for_each_expr_without_closures(block, |e| { 10,900 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/visitors.rs:clippy_utils::visitors::for_each_expr_without_closures::<(), clippy_utils::visitors::Descend, &rustc_hir::hir::Block, ::check_expr::{closure#0}> (4x) 99 ( 0.00%) if let ExprKind::Binary(binop, lhs, rhs) = e.kind 1 ( 0.00%) && binop.node == BinOpKind::Div . && eq.eq_expr(SyntaxContext::root(), rhs, divisor) . && is_unsigned_integer(cx, lhs) . { . match first_use { . None => first_use = Some(UseKind::Division), . Some(UseKind::Other) => return ControlFlow::Break(()), . Some(UseKind::Division) => {}, . } -- line 81 ---------------------------------------- -- line 92 ---------------------------------------- . None => first_use = Some(UseKind::Division), . Some(UseKind::Other) => return ControlFlow::Break(()), . Some(UseKind::Division) => {}, . } . . division_spans.push(e.span); . . ControlFlow::<(), _>::Continue(Descend::No) 119 ( 0.00%) } else if eq.eq_expr(SyntaxContext::root(), e, divisor) { 1,028 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:::eq_expr (4x) 4 ( 0.00%) if first_use.is_none() { 4 ( 0.00%) first_use = Some(UseKind::Other); . return ControlFlow::Break(()); . } . ControlFlow::<(), _>::Continue(Descend::Yes) . } else { . ControlFlow::<(), _>::Continue(Descend::Yes) . } . }); . 8 ( 0.00%) if found_early_use.is_some() || first_use != Some(UseKind::Division) || division_spans.is_empty() { . return; . } . . span_lint_and_then(cx, MANUAL_CHECKED_OPS, cond.span, "manual checked division", |diag| { . diag.span_label(cond.span, "check performed here"); . if let Some((first, rest)) = division_spans.split_first() { . diag.span_label(*first, "division performed here"); . if !rest.is_empty() { . diag.span_labels(rest.to_vec(), "... and here"); . } . } . diag.help("consider using `checked_div`"); . }); 4 ( 0.00%) } 549,936 ( 0.03%) } . } . . #[derive(Copy, Clone, Eq, PartialEq)] . enum UseKind { . Division, . Other, . } . . fn divisor_from_condition<'tcx>(cond: &'tcx Expr<'tcx>) -> Option<(&'tcx Expr<'tcx>, NonZeroBranch)> { 75 ( 0.00%) let ExprKind::Binary(binop, lhs, rhs) = cond.kind else { . return None; . }; . 108 ( 0.00%) match binop.node { . BinOpKind::Ne | BinOpKind::Lt if is_zero(lhs) => Some((rhs, NonZeroBranch::Then)), 3 ( 0.00%) BinOpKind::Ne | BinOpKind::Gt if is_zero(rhs) => Some((lhs, NonZeroBranch::Then)), . BinOpKind::Eq if is_zero(lhs) => Some((rhs, NonZeroBranch::Else)), 3 ( 0.00%) BinOpKind::Eq if is_zero(rhs) => Some((lhs, NonZeroBranch::Else)), . _ => None, . } . } . . fn branch_block<'tcx>( . then: &'tcx Expr<'tcx>, . r#else: Option<&'tcx Expr<'tcx>>, . branch: NonZeroBranch, . ) -> Option<&'tcx Block<'tcx>> { 12 ( 0.00%) match branch { 6 ( 0.00%) NonZeroBranch::Then => match then.kind { . ExprKind::Block(block, _) => Some(block), . _ => None, . }, 3 ( 0.00%) NonZeroBranch::Else => match r#else?.kind { . ExprKind::Block(block, _) => Some(block), . _ => None, . }, . } . } . . fn is_zero(expr: &Expr<'_>) -> bool { . is_integer_literal(expr, 0) . } . . fn is_unsigned_integer(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { 30 ( 0.00%) matches!(cx.typeck_results().expr_ty(expr).peel_refs().kind(), ty::Uint(_)) 240 ( 0.00%) => ???:::expr_ty (6x) . } 82 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/unnecessary_mut_passed.rs -------------------------------------------------------------------------------- Ir -- line 34 ---------------------------------------- . pub UNNECESSARY_MUT_PASSED, . style, . "an argument passed as a mutable reference although the callee only demands an immutable reference" . } . . declare_lint_pass!(UnnecessaryMutPassed => [UNNECESSARY_MUT_PASSED]); . . impl<'tcx> LateLintPass<'tcx> for UnnecessaryMutPassed { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 137,484 ( 0.01%) if e.span.from_expansion() { . // Issue #11268 . return; . } . 342,204 ( 0.02%) match e.kind { 316 ( 0.00%) ExprKind::Call(fn_expr, arguments) => { 316 ( 0.00%) if let ExprKind::Path(ref path) = fn_expr.kind . && arguments.iter().any(is_mut_ref_arg) . { . check_arguments( . cx, . &mut arguments.iter(), . cx.typeck_results().expr_ty(fn_expr), . #[allow(trivial_casts)] . &|| { -- line 58 ---------------------------------------- -- line 61 ---------------------------------------- . path, . ) . }, . "function", . ); . } . }, . ExprKind::MethodCall(path, receiver, arguments, _) 330 ( 0.00%) if iter::once(receiver).chain(arguments.iter()).any(is_mut_ref_arg) . && let Some(def_id) = cx.typeck_results().type_dependent_def_id(e.hir_id) => . { . let args = cx.typeck_results().node_args(e.hir_id); . let method_type = cx.tcx.type_of(def_id).instantiate(cx.tcx, args).skip_norm_wip(); . check_arguments( . cx, . &mut iter::once(receiver).chain(arguments.iter()), . method_type, . &|| path.ident.as_str().to_owned(), . "method", . ); . }, . _ => (), . } 549,936 ( 0.03%) } . } . . /// Only `&mut ...` arguments can lint, so the type and path lookups run only after one is found. . fn is_mut_ref_arg(argument: &Expr<'_>) -> bool { 718 ( 0.00%) matches!(argument.kind, ExprKind::AddrOf(BorrowKind::Ref, Mutability::Mut, _)) . } . . fn check_arguments<'tcx>( . cx: &LateContext<'tcx>, . arguments: &mut dyn Iterator>, . type_definition: Ty<'tcx>, . name: &dyn Fn() -> String, . fn_kind: &str, -- line 97 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/memchr.rs -------------------------------------------------------------------------------- Ir -- line 19 ---------------------------------------- . x.wrapping_sub(LO_USIZE) & !x & HI_USIZE != 0 . } . . /// Returns the first index matching the byte `x` in `text`. . #[inline] . #[must_use] . pub const fn memchr(x: u8, text: &[u8]) -> Option { . // Fast path for small slices. 161,162 ( 0.01%) if text.len() < 2 * USIZE_BYTES { . return memchr_naive(x, text); . } . 11,608 ( 0.00%) memchr_aligned(x, text) 12,150 ( 0.00%) => ???:core::slice::memchr::memchr_aligned (106x) . } . . #[inline] . const fn memchr_naive(x: u8, text: &[u8]) -> Option { . let mut i = 0; . . // FIXME(const-hack): Replace with `text.iter().pos(|c| *c == x)`. 698,881 ( 0.03%) while i < text.len() { 543,930 ( 0.03%) if text[i] == x { . return Some(i); . } . 271,739 ( 0.01%) i += 1; . } . . None . } . . #[rustc_allow_const_fn_unstable(const_eval_select)] // fallback impl has same behavior . const fn memchr_aligned(x: u8, text: &[u8]) -> Option { . // The runtime version behaves the same as the compiletime version, it's -- line 52 ---------------------------------------- 349,004 ( 0.02%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/eta_reduction.rs -------------------------------------------------------------------------------- Ir -- line 67 ---------------------------------------- . . declare_lint_pass!(EtaReduction => [ . REDUNDANT_CLOSURE, . REDUNDANT_CLOSURE_FOR_METHOD_CALLS, . ]); . . impl<'tcx> LateLintPass<'tcx> for EtaReduction { . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &Expr<'tcx>) { 274,680 ( 0.01%) if let ExprKind::MethodCall(_method, receiver, args, _) = expr.kind { . for arg in args { 96 ( 0.00%) check_closure(cx, Some(receiver), arg); 4,569 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/eta_reduction.rs:clippy_lints::eta_reduction::check_closure (32x) . } . } 597 ( 0.00%) if let ExprKind::Call(func, args) = expr.kind { 597 ( 0.00%) check_closure(cx, None, func); 3,582 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/eta_reduction.rs:clippy_lints::eta_reduction::check_closure (199x) . for arg in args { 798 ( 0.00%) check_closure(cx, None, arg); 6,344 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/eta_reduction.rs:clippy_lints::eta_reduction::check_closure (266x) . } . } . } . } . . #[expect(clippy::too_many_lines)] 3,976 ( 0.00%) fn check_closure<'tcx>(cx: &LateContext<'tcx>, outer_receiver: Option<&Expr<'tcx>>, expr: &Expr<'tcx>) { 1,005 ( 0.00%) let body = if let ExprKind::Closure(c) = expr.kind 29 ( 0.00%) && c.fn_decl.inputs.iter().all(|ty| matches!(ty.kind, TyKind::Infer(()))) 22 ( 0.00%) && matches!(c.fn_decl.output, FnRetTy::DefaultReturn(_)) 22 ( 0.00%) && !expr.span.from_expansion() . { 66 ( 0.00%) cx.tcx.hir_body(c.body) 770 ( 0.00%) => ???:::hir_body (11x) . } else { . return; . }; . 33 ( 0.00%) if body.value.span.from_expansion() { . if body.params.is_empty() . && let Some(VecArgs::Vec(&[])) = VecArgs::hir(cx, body.value) . { . let vec_crate = if is_no_std_crate(cx) { "alloc" } else { "std" }; . // replace `|| vec![]` with `Vec::new` . span_lint_hir_and_then( . cx, . REDUNDANT_CLOSURE, -- line 109 ---------------------------------------- -- line 119 ---------------------------------------- . ); . }, . ); . } . // skip `foo(|| macro!())` . return; . } . 55 ( 0.00%) if is_adjusted(cx, body.value) { 439 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_adjusted (11x) . return; . } . . let typeck = cx.typeck_results(); 33 ( 0.00%) let closure = if let ty::Closure(_, closure_subs) = typeck.expr_ty(expr).kind() { 440 ( 0.00%) => ???:::expr_ty (11x) 11 ( 0.00%) closure_subs.as_closure() . } else { . return; . }; 66 ( 0.00%) let closure_sig = cx.tcx.signature_unclosure(closure.sig(), Safety::Safe).skip_binder(); 2,135 ( 0.00%) => ???:::signature_unclosure (11x) 550 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_type_ir/src/ty_kind/closure.rs:>::sig (11x) 58 ( 0.00%) match body.value.kind { 24 ( 0.00%) ExprKind::Call(callee, args) 6 ( 0.00%) if matches!( 3 ( 0.00%) callee.kind, . ExprKind::Path(QPath::Resolved(..) | QPath::TypeRelative(..)) . ) => . { 9 ( 0.00%) let callee_ty_raw = typeck.expr_ty(callee); 120 ( 0.00%) => ???:::expr_ty (3x) . let callee_ty = callee_ty_raw.peel_refs(); . if matches!(callee_ty.opt_diag_name(cx), Some(sym::Arc | sym::Rc)) 27 ( 0.00%) || !check_inputs(typeck, body.params, None, args) 66 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/eta_reduction.rs:clippy_lints::eta_reduction::check_inputs (3x) . { . return; . } . . let callee_ty_adjustments = typeck.expr_adjustments(callee); . let callee_ty_adjusted = callee_ty_adjustments.last().map_or(callee_ty, |a| a.target); . . let sig = match *callee_ty_adjusted.kind() { -- line 156 ---------------------------------------- -- line 257 ---------------------------------------- . snippet, . Applicability::MachineApplicable, . ); . } . }, . ); . } . }, 36 ( 0.00%) ExprKind::MethodCall(path, self_, args, _) if check_inputs(typeck, body.params, Some(self_), args) => { 88 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/eta_reduction.rs:clippy_lints::eta_reduction::check_inputs (4x) . if let Some(method_def_id) = typeck.type_dependent_def_id(body.value.hir_id) . && !find_attr!(cx.tcx, method_def_id, TrackCaller(..)) . && check_sig(closure_sig, cx.tcx.fn_sig(method_def_id).skip_binder().skip_binder()) . { . let mut app = Applicability::MachineApplicable; . let generic_args = match path.args.and_then(GenericArgs::span_ext) { . Some(span) => format!("::{}", snippet_with_applicability(cx, span, "<..>", &mut app)), . None => String::new(), -- line 273 ---------------------------------------- -- line 289 ---------------------------------------- . app, . ); . }, . ); . } . }, . _ => (), . } 3,976 ( 0.00%) } . 56 ( 0.00%) fn check_inputs( . typeck: &TypeckResults<'_>, . params: &[Param<'_>], . self_arg: Option<&Expr<'_>>, . args: &[Expr<'_>], . ) -> bool { 35 ( 0.00%) params.len() == self_arg.map_or(0, |_| 1) + args.len() . && params.iter().zip(self_arg.into_iter().chain(args)).all(|(p, arg)| { . matches!( . p.pat.kind, . PatKind::Binding(BindingMode::NONE, id, _, None) . if arg.res_local_id() == Some(id) . ) . // Only allow adjustments which change regions (i.e. re-borrowing). . && typeck . .expr_adjustments(arg) . .last() . .is_none_or(|a| a.target == typeck.expr_ty(arg)) . }) 56 ( 0.00%) } . . fn check_sig<'tcx>(closure_sig: FnSig<'tcx>, call_sig: FnSig<'tcx>) -> bool { . call_sig.safety().is_safe() && !has_late_bound_to_non_late_bound_regions(closure_sig, call_sig) . } . . /// This walks through both signatures and checks for any time a late-bound region is expected by an . /// `impl Fn` type, but the target signature does not have a late-bound region in the same position. . /// -- line 326 ---------------------------------------- 342 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/unit_return_expecting_ord.rs -------------------------------------------------------------------------------- Ir -- line 37 ---------------------------------------- . declare_lint_pass!(UnitReturnExpectingOrd => [UNIT_RETURN_EXPECTING_ORD]); . . fn get_trait_predicates_for_trait_ids<'tcx>( . cx: &LateContext<'tcx>, . generics: GenericClauses<'tcx>, . trait_ids: &[Option], // At least 2 ids . ) -> [Vec>; 3] { . debug_assert!(trait_ids.len() >= 2); 168 ( 0.00%) let mut preds = [Vec::new(), Vec::new(), Vec::new()]; . for (clause, _) in generics.clauses { 220 ( 0.00%) if let ClauseKind::Trait(poly_trait_pred) = clause.kind().skip_binder() { 616 ( 0.00%) => ???:::kind (44x) . let trait_pred = cx . .tcx 252 ( 0.00%) .instantiate_bound_regions_with_erased(clause.kind().rebind(poly_trait_pred)); 4,301 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/ty/fold.rs:::instantiate_bound_regions_with_erased::> (36x) 504 ( 0.00%) => ???:::kind (36x) . for (i, tid) in trait_ids.iter().enumerate() { 146 ( 0.00%) if let Some(tid) = tid . && *tid == trait_pred.trait_ref.def_id . { . preds[i].push(trait_pred); . } . } . } . } 294 ( 0.00%) preds . } . . fn get_projection_pred<'tcx>( . cx: &LateContext<'tcx>, . generics: GenericClauses<'tcx>, . trait_pred: TraitPredicate<'tcx>, . ) -> Option> { . generics.clauses.iter().find_map(|(clause, _)| { 24 ( 0.00%) if let ClauseKind::Projection(pred) = clause.kind().skip_binder() { 56 ( 0.00%) => ???:::kind (4x) 7 ( 0.00%) let projection_pred = cx.tcx.instantiate_bound_regions_with_erased(clause.kind().rebind(pred)); 1,522 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/ty/fold.rs:::instantiate_bound_regions_with_erased::> (1x) 14 ( 0.00%) => ???:::kind (1x) 1 ( 0.00%) if projection_pred.projection_term.args == trait_pred.trait_ref.args { 6 ( 0.00%) return Some(projection_pred); . } . } . None . }) . } . . fn get_args_to_check<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'tcx>, . args_len: usize, . fn_mut_trait: DefId, . ord_trait: Option, . partial_ord_trait: Option, . ) -> Vec<(usize, Symbol)> { . let mut args_to_check = Vec::new(); 105 ( 0.00%) if let Some(def_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id) { 1,071 ( 0.00%) => ???:::type_dependent_def_id (21x) . let fn_sig = cx.tcx.fn_sig(def_id).instantiate_identity().skip_norm_wip(); . let generics = cx.tcx.clauses_of(def_id); 273 ( 0.00%) let [fn_mut_preds, ord_preds, partial_ord_preds] = 21 ( 0.00%) get_trait_predicates_for_trait_ids(cx, generics, &[Some(fn_mut_trait), ord_trait, partial_ord_trait]); 21 ( 0.00%) if fn_mut_preds.is_empty() { . return vec![]; . } . . // Trying to call instantiate_bound_regions_with_erased on fn_sig.inputs() gives the following error . // The trait `rustc::ty::TypeFoldable<'_>` is not implemented for . // `&[rustc_middle::ty::Ty<'_>]` 2 ( 0.00%) let inputs_output = cx.tcx.instantiate_bound_regions_with_erased(fn_sig.inputs_and_output()); 1,341 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/ty/fold.rs:::instantiate_bound_regions_with_erased::<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::Ty>> (1x) . inputs_output . .iter() . .rev() . .skip(1) . .rev() . .enumerate() . .for_each(|(i, inp)| { . for trait_pred in &fn_mut_preds { 4 ( 0.00%) if trait_pred.self_ty() == inp 8 ( 0.00%) && let Some(return_ty_pred) = get_projection_pred(cx, generics, *trait_pred) . { . if ord_preds . .iter() 2 ( 0.00%) .any(|ord| Some(ord.self_ty()) == return_ty_pred.term.as_type()) 7 ( 0.00%) => ???:::as_type (1x) . { . args_to_check.push((i, sym::Ord)); . if args_to_check.len() == args_len - 1 { . break; . } . } else if partial_ord_preds . .iter() . .any(|pord| pord.self_ty() == return_ty_pred.term.expect_type()) -- line 122 ---------------------------------------- -- line 125 ---------------------------------------- . if args_to_check.len() == args_len - 1 { . break; . } . } . } . } . }); . } 5 ( 0.00%) args_to_check . } . . fn check_arg<'tcx>(cx: &LateContext<'tcx>, arg: &'tcx Expr<'tcx>) -> Option<(Span, Option)> { 6 ( 0.00%) if let ExprKind::Closure(&Closure { body, fn_decl_span, .. }) = arg.kind 6 ( 0.00%) && let ty::Closure(_def_id, args) = &cx.typeck_results().node_type(arg.hir_id).kind() 41 ( 0.00%) => ???:::node_type (1x) 1 ( 0.00%) && let ret_ty = args.as_closure().sig().output() 3 ( 0.00%) && let ty = cx.tcx.instantiate_bound_regions_with_erased(ret_ty) 27 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/ty/fold.rs:::instantiate_bound_regions_with_erased:: (1x) . && ty.is_unit() . { . let body = cx.tcx.hir_body(body); . if let ExprKind::Block(block, _) = body.value.kind . && block.expr.is_none() . && let Some(stmt) = block.stmts.last() . && let StmtKind::Semi(_) = stmt.kind . { -- line 148 ---------------------------------------- -- line 153 ---------------------------------------- . Some((fn_decl_span, None)) . } . } else { . None . } . } . . impl<'tcx> LateLintPass<'tcx> for UnitReturnExpectingOrd { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 137,594 ( 0.01%) if let ExprKind::MethodCall(_, receiver, args, _) = expr.kind 64 ( 0.00%) && args.iter().any(|arg| { . matches!( . arg.peel_blocks().peel_borrows().peel_drop_temps().kind, . ExprKind::Path(_) | ExprKind::Closure(_) . ) . }) 105 ( 0.00%) && let Some(fn_mut_trait) = cx.tcx.lang_items().fn_mut_trait() 630 ( 0.00%) => ???:::lang_items (21x) . { 84 ( 0.00%) let ord_trait = cx.tcx.get_diagnostic_item(sym::Ord); 1,512 ( 0.00%) => ???:::get_diagnostic_item (21x) 42 ( 0.00%) let partial_ord_trait = cx.tcx.lang_items().partial_ord_trait(); 630 ( 0.00%) => ???:::lang_items (21x) . if (ord_trait, partial_ord_trait) == (None, None) { . return; . } . . let args = std::iter::once(receiver).chain(args.iter()).collect::>(); 42 ( 0.00%) let arg_indices = get_args_to_check(cx, expr, args.len(), fn_mut_trait, ord_trait, partial_ord_trait); 1 ( 0.00%) for (i, trait_name) in arg_indices { 1 ( 0.00%) if let Some((span, last_semi)) = check_arg(cx, args[i]) { . span_lint_and_then( . cx, . UNIT_RETURN_EXPECTING_ORD, . span, . format!( . "this closure returns \ . the unit type which also implements {trait_name}" . ), -- line 188 ---------------------------------------- -- line 190 ---------------------------------------- . if let Some(last_semi) = last_semi { . diag.span_help(last_semi, "probably caused by this trailing semicolon"); . } . }, . ); . } . } . } 549,936 ( 0.03%) } . } 473 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_strip.rs -------------------------------------------------------------------------------- Ir -- line 63 ---------------------------------------- . . #[derive(Clone, Copy, Debug, Eq, PartialEq)] . enum StripKind { . Prefix, . Suffix, . } . . impl<'tcx> LateLintPass<'tcx> for ManualStrip { 549,936 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . if let Some(higher::If { cond, then, .. }) = higher::If::hir(expr) 56 ( 0.00%) && let ExprKind::MethodCall(_, target_arg, [pattern], _) = cond.kind . && let ExprKind::Path(target_path) = &target_arg.kind . && let Some(method_def_id) = cx.typeck_results().type_dependent_def_id(cond.hir_id) . { . let strip_kind = match cx.tcx.get_diagnostic_name(method_def_id) { . Some(sym::str_starts_with) => StripKind::Prefix, . Some(sym::str_ends_with) => StripKind::Suffix, . _ => return, . }; -- line 81 ---------------------------------------- -- line 144 ---------------------------------------- . ) . .collect(), . app, . ); . }, . ); . } . } 549,936 ( 0.03%) } . } . . // Returns `Some(arg)` if `expr` matches `arg.len()` and `None` otherwise. . fn len_arg<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) -> Option<&'tcx Expr<'tcx>> { . if let ExprKind::MethodCall(_, arg, [], _) = expr.kind . && let Some(method_def_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id) . && cx.tcx.is_diagnostic_item(sym::str_len, method_def_id) . { -- line 160 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/float_literal.rs -------------------------------------------------------------------------------- Ir -- line 71 ---------------------------------------- . pub fn new(conf: &'static Conf) -> Self { . Self { . const_literal_digits_threshold: conf.const_literal_digits_threshold, . } . } . } . . impl<'tcx> LateLintPass<'tcx> for FloatLiteral { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) { 137,484 ( 0.01%) if let hir::ExprKind::Lit(lit) = expr.kind 101,868 ( 0.00%) && let LitKind::Float(sym, lit_float_ty) = lit.node . && let ty::Float(fty) = *cx.typeck_results().expr_ty(expr).kind() . { . let sym_str = sym.as_str(); . let formatter = FloatFormat::new(sym_str); . // Try to bail out if the float is for sure fine. . // If its within the 2 decimal digits of being out of precision we . // check if the parsed representation is the same as the string . // since we'll need the truncated string anyway. -- line 89 ---------------------------------------- -- line 168 ---------------------------------------- . "consider changing the type or truncating it to", . numeric_literal::format(&float_str, type_suffix, true), . Applicability::MachineApplicable, . ); . }, . ); . } . } 549,936 ( 0.03%) } . } . . #[must_use] . fn max_digits(fty: FloatTy) -> u32 { . match fty { . FloatTy::F16 => f16::DIGITS, . FloatTy::F32 => f32::DIGITS, . FloatTy::F64 => f64::DIGITS, -- line 184 ---------------------------------------- 50,934 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/misc_early/mod.rs -------------------------------------------------------------------------------- Ir -- line 310 ---------------------------------------- . SEPARATED_LITERAL_SUFFIX, . UNNEEDED_FIELD_PATTERN, . UNNEEDED_WILDCARD_PATTERN, . UNSEPARATED_LITERAL_SUFFIX, . ZERO_PREFIXED_LITERAL, . ]); . . impl EarlyLintPass for MiscEarlyLints { 1,211 ( 0.00%) fn check_generics(&mut self, cx: &EarlyContext<'_>, generics: &Generics) { . for param in &generics.params { . builtin_type_shadow::check(cx, param); . } 1,384 ( 0.00%) } . 22,563 ( 0.00%) fn check_pat(&mut self, cx: &EarlyContext<'_>, pat: &Pat) { 7,521 ( 0.00%) unneeded_field_pattern::check(cx, pat); 45,126 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/misc_early/unneeded_field_pattern.rs:clippy_lints::misc_early::unneeded_field_pattern::check (2,507x) 7,521 ( 0.00%) redundant_pattern::check(cx, pat); 55,154 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/misc_early/redundant_pattern.rs:clippy_lints::misc_early::redundant_pattern::check (2,507x) 7,521 ( 0.00%) redundant_at_rest_pattern::check(cx, pat); 7,521 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/misc_early/redundant_at_rest_pattern.rs:clippy_lints::misc_early::redundant_at_rest_pattern::check (2,507x) . unneeded_wildcard_pattern::check(cx, pat); 20,056 ( 0.00%) } . 504,203 ( 0.02%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { . // `check_lit` only lints integer literals and suffixed float literals. 252,924 ( 0.01%) if let ExprKind::Lit(lit) = expr.kind 85,875 ( 0.00%) && match lit.kind { . token::LitKind::Integer => true, . token::LitKind::Float => lit.suffix.is_some(), . _ => false, . } 116,136 ( 0.01%) && !expr.span.in_external_macro(cx.sess().source_map()) . { . MiscEarlyLints::check_lit(cx, lit, expr.span); . } 576,232 ( 0.03%) } . } . . impl MiscEarlyLints { . fn check_lit(cx: &EarlyContext<'_>, lit: token::Lit, span: Span) { . // We test if first character in snippet is a number, because the snippet could be an expansion . // from a built-in macro like `line!()` or a proc-macro like `#[wasm_bindgen]`. . // Note that this check also covers special case that `line!()` is eagerly expanded by compiler. . // See for a regression. . // FIXME: Find a better way to detect those cases. 77,424 ( 0.00%) let lit_snip = match snippet_opt(cx, span) { 38,712 ( 0.00%) Some(snip) if snip.starts_with(|c: char| c.is_ascii_digit()) => snip, . _ => return, . }; . 38,712 ( 0.00%) let lit_kind = LitKind::from_token_lit(lit); 8,572,052 ( 0.40%) => ???:::from_token_lit (38,712x) 232,272 ( 0.01%) if let Ok(LitKind::Int(value, lit_int_type)) = lit_kind { 154,848 ( 0.01%) let suffix = match lit_int_type { . LitIntType::Signed(ty) => ty.name_str(), . LitIntType::Unsigned(ty) => ty.name_str(), . LitIntType::Unsuffixed => "", . }; 387,120 ( 0.02%) literal_suffix::check(cx, span, &lit_snip, suffix, "integer"); 1,046,304 ( 0.05%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/misc_early/literal_suffix.rs:clippy_lints::misc_early::literal_suffix::check (38,712x) 38,649 ( 0.00%) if lit_snip.starts_with("0x") { 309,120 ( 0.01%) mixed_case_hex_literals::check(cx, span, suffix, &lit_snip); 4,085,135 ( 0.19%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/misc_early/mixed_case_hex_literals.rs:clippy_lints::misc_early::mixed_case_hex_literals::check (38,640x) 297 ( 0.00%) } else if lit_snip.starts_with("0b") || lit_snip.starts_with("0o") { . // nothing to do 35 ( 0.00%) } else if value != 0 && lit_snip.starts_with('0') { . zero_prefixed_literal::check(cx, span, &lit_snip); . } . } else if let Ok(LitKind::Float(_, LitFloatType::Suffixed(float_ty))) = lit_kind { . let suffix = float_ty.name_str(); . literal_suffix::check(cx, span, &lit_snip, suffix, "float"); . } . } . } -- line 378 ---------------------------------------- 519,053 ( 0.02%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/needless_update.rs -------------------------------------------------------------------------------- Ir -- line 44 ---------------------------------------- . pub NEEDLESS_UPDATE, . complexity, . "using `Foo { ..base }` when there are no missing fields" . } . . declare_lint_pass!(NeedlessUpdate => [NEEDLESS_UPDATE]); . . impl<'tcx> LateLintPass<'tcx> for NeedlessUpdate { 343,710 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 137,532 ( 0.01%) if let ExprKind::Struct(_, fields, StructTailExpr::Base(base)) = expr.kind { . let ty = cx.typeck_results().expr_ty(expr); . if let ty::Adt(def, _) = ty.kind() . && fields.len() == def.non_enum_variant().fields.len() . && !def.variant(0_usize.into()).is_field_list_non_exhaustive() . { . span_lint( . cx, . NEEDLESS_UPDATE, . base.span, . "struct update has no effect, all the fields in the struct have already been specified", . ); . } . } 412,452 ( 0.02%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/casts/mod.rs -------------------------------------------------------------------------------- Ir -- line 883 ---------------------------------------- . . impl Casts { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl<'tcx> LateLintPass<'tcx> for Casts { 618,678 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 137,524 ( 0.01%) if let ExprKind::Cast(cast_from_expr, cast_to_hir) = expr.kind { 60 ( 0.00%) if expr.span.in_external_macro(cx.sess().source_map()) { . return; . } 100 ( 0.00%) if is_hir_ty_cfg_dependant(cx, cast_to_hir) { 240 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_hir_ty_cfg_dependant (20x) . return; . } . let (cast_from, cast_to) = ( 100 ( 0.00%) cx.typeck_results().expr_ty(cast_from_expr), 800 ( 0.00%) => ???:::expr_ty (20x) 80 ( 0.00%) cx.typeck_results().expr_ty(expr), 800 ( 0.00%) => ???:::expr_ty (20x) . ); . 160 ( 0.00%) if !expr.span.from_expansion() && unnecessary_cast::check(cx, expr, cast_from_expr, cast_from, cast_to) { 20,874 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/unnecessary_cast.rs:clippy_lints::casts::unnecessary_cast::check (20x) . return; . } 120 ( 0.00%) char_lit_as_u8::check(cx, expr, cast_from_expr, cast_to); 260 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/char_lit_as_u8.rs:clippy_lints::casts::char_lit_as_u8::check (20x) 140 ( 0.00%) cast_slice_from_raw_parts::check(cx, expr, cast_from_expr, cast_to, self.msrv); 360 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/cast_slice_from_raw_parts.rs:clippy_lints::casts::cast_slice_from_raw_parts::check (20x) . cast_ptr_alignment::check(cx, expr, cast_from, cast_to); 140 ( 0.00%) ptr_cast_constness::check(cx, expr, cast_from_expr, cast_from, cast_to, self.msrv); 340 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/ptr_cast_constness.rs:clippy_lints::casts::ptr_cast_constness::check (20x) 240 ( 0.00%) ptr_as_ptr::check(cx, expr, cast_from_expr, cast_from, cast_to_hir, cast_to, self.msrv); 340 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/ptr_as_ptr.rs:clippy_lints::casts::ptr_as_ptr::check (20x) . as_ptr_cast_mut::check(cx, expr, cast_from_expr, cast_to); 160 ( 0.00%) confusing_method_to_numeric_cast::check(cx, expr, cast_from_expr, cast_from, cast_to); 520 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/confusing_method_to_numeric_cast.rs:clippy_lints::casts::confusing_method_to_numeric_cast::check (20x) . zero_ptr::check(cx, expr, cast_from_expr, cast_to_hir, self.msrv); . 120 ( 0.00%) if self.msrv.meets(cx, msrvs::MANUAL_DANGLING_PTR) { 540 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (20x) . manual_dangling_ptr::check(cx, expr, cast_from_expr, cast_to_hir); . } . . if cast_to.is_numeric() { 140 ( 0.00%) cast_possible_truncation::check(cx, expr, cast_from_expr, cast_from, cast_to, cast_to_hir.span); 4,219 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/cast_possible_truncation.rs:clippy_lints::casts::cast_possible_truncation::check (20x) . if cast_from.is_numeric() { 96 ( 0.00%) cast_possible_wrap::check(cx, expr, cast_from_expr, cast_from, cast_to, self.msrv); 539 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/cast_possible_wrap.rs:clippy_lints::casts::cast_possible_wrap::check (12x) 108 ( 0.00%) cast_precision_loss::check(cx, expr, cast_from, cast_to); 303 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/cast_precision_loss.rs:clippy_lints::casts::cast_precision_loss::check (12x) . cast_sign_loss::check(cx, expr, cast_from_expr, cast_from, cast_to, self.msrv); 84 ( 0.00%) cast_abs_to_unsigned::check(cx, expr, cast_from_expr, cast_from, cast_to, self.msrv); 228 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/cast_abs_to_unsigned.rs:clippy_lints::casts::cast_abs_to_unsigned::check (12x) 72 ( 0.00%) cast_nan_to_int::check(cx, expr, cast_from_expr, cast_from, cast_to); 240 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/cast_nan_to_int.rs:clippy_lints::casts::cast_nan_to_int::check (12x) . } 200 ( 0.00%) cast_lossless::check(cx, expr, cast_from_expr, cast_from, cast_to, cast_to_hir, self.msrv); 12,673 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/cast_lossless.rs:clippy_lints::casts::cast_lossless::check (20x) . cast_enum_constructor::check(cx, expr, cast_from_expr, cast_from); 120 ( 0.00%) fn_to_numeric_cast_any::check(cx, expr, cast_from_expr, cast_from, cast_to); 400 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/fn_to_numeric_cast_any.rs:clippy_lints::casts::fn_to_numeric_cast_any::check (20x) 120 ( 0.00%) fn_to_numeric_cast::check(cx, expr, cast_from_expr, cast_from, cast_to); 582 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/fn_to_numeric_cast.rs:clippy_lints::casts::fn_to_numeric_cast::check (20x) 120 ( 0.00%) fn_to_numeric_cast_with_truncation::check(cx, expr, cast_from_expr, cast_from, cast_to); 585 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/fn_to_numeric_cast_with_truncation.rs:clippy_lints::casts::fn_to_numeric_cast_with_truncation::check (20x) . } . . as_underscore::check(cx, expr, cast_to_hir); 80 ( 0.00%) as_pointer_underscore::check(cx, cast_to, cast_to_hir); 200 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/as_pointer_underscore.rs:clippy_lints::casts::as_pointer_underscore::check (20x) . 140 ( 0.00%) let was_borrow_as_ptr_emitted = self.msrv.meets(cx, msrvs::BORROW_AS_PTR) 540 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (20x) . && borrow_as_ptr::check(cx, expr, cast_from_expr, cast_to_hir, self.msrv); 140 ( 0.00%) if !was_borrow_as_ptr_emitted && self.msrv.meets(cx, msrvs::PTR_FROM_REF) { 540 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (20x) . ref_as_ptr::check(cx, expr, cast_from_expr, cast_to_hir); . } . } . 481,194 ( 0.02%) if self.msrv.meets(cx, msrvs::RAW_REF_OP) { 1,856,034 ( 0.09%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (68,742x) . borrow_as_ptr::check_implicit_cast(cx, expr); . } 412,452 ( 0.02%) if self.msrv.meets(cx, msrvs::PTR_SLICE_RAW_PARTS) { 1,856,034 ( 0.09%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (68,742x) . cast_slice_from_raw_parts::check_implicit_cast(cx, expr); . } 206,226 ( 0.01%) cast_ptr_alignment::check_cast_method(cx, expr); 894,100 ( 0.04%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/cast_ptr_alignment.rs:clippy_lints::casts::cast_ptr_alignment::check_cast_method (68,742x) 274,968 ( 0.01%) cast_slice_different_sizes::check(cx, expr, self.msrv); 10,511,266 ( 0.49%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/cast_slice_different_sizes.rs:clippy_lints::casts::cast_slice_different_sizes::check (68,742x) 206,226 ( 0.01%) ptr_cast_constness::check_null_ptr_cast_method(cx, expr); 1,031,598 ( 0.05%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/ptr_cast_constness.rs:clippy_lints::casts::ptr_cast_constness::check_null_ptr_cast_method (68,742x) 549,936 ( 0.03%) } . . fn check_body(&mut self, cx: &LateContext<'tcx>, body: &rustc_hir::Body<'tcx>) { 423 ( 0.00%) needless_type_cast::check(cx, body); 2,996,817 ( 0.14%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/needless_type_cast.rs:clippy_lints::casts::needless_type_cast::check (141x) . } . } 192 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/panicking_overflow_checks.rs -------------------------------------------------------------------------------- Ir -- line 44 ---------------------------------------- . correctness, . "overflow checks which will panic in debug mode" . } . . declare_lint_pass!(PanickingOverflowChecks => [PANICKING_OVERFLOW_CHECKS]); . . impl<'tcx> LateLintPass<'tcx> for PanickingOverflowChecks { . // a + b < a, a > a + b, a < a - b, a - b > a 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 137,788 ( 0.01%) if let ExprKind::Binary(op, lhs, rhs) = expr.kind 222 ( 0.00%) && let (lt, gt) = match op.node { . BinOpKind::Lt => (lhs, rhs), . BinOpKind::Gt => (rhs, lhs), . _ => return, . } 8 ( 0.00%) && let ctxt = expr.span.ctxt() 32 ( 0.00%) && let (op_lhs, op_rhs, other, commutative) = match (<.kind, >.kind) { . (&ExprKind::Binary(op, lhs, rhs), _) if op.node == BinOpKind::Add && ctxt == lt.span.ctxt() => { . (lhs, rhs, gt, true) . }, 3 ( 0.00%) (_, &ExprKind::Binary(op, lhs, rhs)) if op.node == BinOpKind::Sub && ctxt == gt.span.ctxt() => { . (lhs, rhs, lt, false) . }, . _ => return, . } . && let typeck = cx.typeck_results() . && let ty = typeck.expr_ty(op_lhs) . && matches!(ty.kind(), ty::Uint(_)) . && ty == typeck.expr_ty(op_rhs) -- line 72 ---------------------------------------- -- line 76 ---------------------------------------- . { . span_lint( . cx, . PANICKING_OVERFLOW_CHECKS, . expr.span, . "you are trying to use classic C overflow conditions that will fail in Rust", . ); . } 549,936 ( 0.03%) } . } 48 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/ty/context.rs -------------------------------------------------------------------------------- Ir -- line 1081 ---------------------------------------- . Some(hir::CoroutineKind::Desugared(hir::CoroutineDesugaring::AsyncGen, _)) . ) . } . . pub fn features(self) -> &'tcx rustc_feature::Features { . self.features_query(()) . } . 12,174 ( 0.00%) pub fn def_key(self, id: impl IntoQueryKey) -> rustc_hir::definitions::DefKey { . let id = id.into_query_key(); . // Accessing the DefKey is ok, since it is part of DefPathHash. . if let Some(id) = id.as_local() { . self.definitions_untracked().def_key(id) . } else { 879 ( 0.00%) self.cstore_untracked().def_key(id) 21,479 ( 0.00%) => ???:::def_key (293x) . } 14,203 ( 0.00%) } . . /// Converts a `DefId` into its fully expanded `DefPath` (every . /// `DefId` is really just an interned `DefPath`). . /// . /// Note that if `id` is not local to this crate, the result will . /// be a non-local `DefPath`. . pub fn def_path(self, id: DefId) -> rustc_hir::definitions::DefPath { . // Accessing the DefPath is ok, since it is part of DefPathHash. -- line 1105 ---------------------------------------- -- line 2224 ---------------------------------------- . pub fn mk_ct_from_kind(self, kind: ty::ConstKind<'tcx>) -> Const<'tcx> { . self.interners.intern_const(kind) . } . . // Avoid this in favour of more specific `Ty::new_*` methods, where possible. . #[allow(rustc::usage_of_ty_tykind)] . #[inline] . pub fn mk_ty_from_kind(self, st: TyKind<'tcx>) -> Ty<'tcx> { 162 ( 0.00%) self.interners.intern_ty(st) 3,062 ( 0.00%) => ???:::intern_ty (29x) . } . . pub fn mk_param_from_def(self, param: &ty::GenericParamDef) -> GenericArg<'tcx> { . match param.kind { . GenericParamDefKind::Lifetime => { . ty::Region::new_early_param(self, param.to_early_bound_region_data()).into() . } . GenericParamDefKind::Type { .. } => Ty::new_param(self, param.index, param.name).into(), -- line 2240 ---------------------------------------- -- line 2436 ---------------------------------------- . T::collect_and_apply(iter, |xs| self.mk_type_list(xs)) . } . . pub fn mk_args_from_iter(self, iter: I) -> T::Output . where . I: Iterator, . T: CollectAndApply, ty::GenericArgsRef<'tcx>>, . { 189 ( 0.00%) T::collect_and_apply(iter, |xs| self.mk_args(xs)) 2,214 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_type_ir/src/interner.rs:>>::collect_and_apply::, alloc::vec::into_iter::IntoIter>, >::into>, ::mk_args_from_iter, alloc::vec::into_iter::IntoIter>, >::into>, rustc_middle::ty::generic_args::GenericArg>::{closure#0}> (18x) . } . . pub fn mk_canonical_var_infos_from_iter(self, iter: I) -> T::Output . where . I: Iterator, . T: CollectAndApply, &'tcx List>>, . { . T::collect_and_apply(iter, |xs| self.mk_canonical_var_kinds(xs)) -- line 2452 ---------------------------------------- -- line 2500 ---------------------------------------- . #[track_caller] . pub fn emit_node_span_lint( . self, . lint: &'static Lint, . hir_id: HirId, . span: impl Into, . decorator: impl for<'a> Diagnostic<'a, ()>, . ) { 138 ( 0.00%) let level_spec = self.lint_level_spec_at_node(lint, hir_id); 4,492 ( 0.00%) => ???:::lint_level_spec_at_node (6x) 233 ( 0.00%) emit_lint_base(self.sess, lint, level_spec, Some(span.into()), decorator) 232 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/lint.rs:rustc_middle::lint::emit_lint_base::::{closure#0}>::{closure#0}>, rustc_middle::lint::LevelSpec> (1x) . } . . /// Find the appropriate span where `use` and outer attributes can be inserted at. . pub fn crate_level_attribute_injection_span(self) -> Span { . let node = self.hir_node(hir::CRATE_HIR_ID); . let hir::Node::Crate(m) = node else { bug!() }; . m.spans.inject_use_span.shrink_to_lo() . } -- line 2517 ---------------------------------------- -- line 2680 ---------------------------------------- . let def_id = def_id.into_query_key(); . match self.def_kind(def_id) { . DefKind::Fn | DefKind::AssocFn => self.intrinsic_raw(def_id), . _ => None, . } . } . . pub fn next_trait_solver_globally(self) -> bool { 86 ( 0.00%) self.sess.opts.unstable_opts.next_solver.globally . } . . pub fn next_trait_solver_in_coherence(self) -> bool { . self.sess.opts.unstable_opts.next_solver.coherence . } . . pub fn disable_trait_solver_fast_paths(self) -> bool { . self.sess.opts.unstable_opts.disable_fast_paths -- line 2696 ---------------------------------------- 5,212 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/int_plus_one.rs -------------------------------------------------------------------------------- Ir -- line 48 ---------------------------------------- . enum LeOrGe { . Le, . Ge, . } . . impl TryFrom for LeOrGe { . type Error = (); . fn try_from(value: BinOpKind) -> Result { 220 ( 0.00%) match value { . BinOpKind::Le => Ok(Self::Le), . BinOpKind::Ge => Ok(Self::Ge), . _ => Err(()), . } . } . } . . impl IntPlusOne { -- line 64 ---------------------------------------- -- line 76 ---------------------------------------- . Self::is_one(expr) . } else { . false . } . } . . /// Checks whether `expr` is `x + 1` or `1 + x`, and if so, returns `x` . fn as_x_plus_one(expr: &Expr) -> Option<&Expr> { 12 ( 0.00%) if let ExprKind::Binary(op, lhs, rhs) = &expr.kind . && op.node == BinOpKind::Add . { . if Self::is_one(rhs) { . // x + 1 . return Some(lhs); . } else if Self::is_one(lhs) { . // 1 + x . return Some(rhs); . } . } . None . } . . /// Checks whether `expr` is `x - 1` or `-1 + x`, and if so, returns `x` . fn as_x_minus_one(expr: &Expr) -> Option<&Expr> { 12 ( 0.00%) if let ExprKind::Binary(op, lhs, rhs) = &expr.kind { . if op.node == BinOpKind::Sub && Self::is_one(rhs) { . // x - 1 . return Some(lhs); . } else if op.node == BinOpKind::Add && Self::is_neg_one(lhs) { . // -1 + x . return Some(rhs); . } . } -- line 108 ---------------------------------------- -- line 151 ---------------------------------------- . let rec = sugg::make_binop(new_binop, &new_lhs, &new_rhs); . diag.span_suggestion(expr.span, "change it to", rec, app); . }, . ); . } . } . . impl EarlyLintPass for IntPlusOne { 432,174 ( 0.02%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 144,058 ( 0.01%) if let ExprKind::Binary(binop, lhs, rhs) = &expr.kind 152 ( 0.00%) && let Ok(le_or_ge) = LeOrGe::try_from(binop.node) 12 ( 0.00%) && let Some((new_lhs, new_rhs)) = Self::check_binop(le_or_ge, lhs, rhs) . { . Self::emit_warning(cx, expr, new_lhs, le_or_ge, new_rhs); . } 504,203 ( 0.02%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/almost_complete_range.rs -------------------------------------------------------------------------------- Ir -- line 36 ---------------------------------------- . } . impl AlmostCompleteRange { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . impl EarlyLintPass for AlmostCompleteRange { . fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &Expr) { 144,123 ( 0.01%) if let ExprKind::Range(Some(start), Some(end), RangeLimits::HalfOpen) = &e.kind 28 ( 0.00%) && is_incomplete_range(start, end) 976 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/almost_complete_range.rs:clippy_lints::almost_complete_range::is_incomplete_range (4x) . && !e.span.in_external_macro(cx.sess().source_map()) . { . span_lint_and_then( . cx, . ALMOST_COMPLETE_RANGE, . e.span, . "almost complete ascii range", . |diag| { -- line 53 ---------------------------------------- -- line 61 ---------------------------------------- . "use an inclusive range", . "..=".to_owned(), . Applicability::MaybeIncorrect, . ); . } . }, . ); . } 72,029 ( 0.00%) } . 15,042 ( 0.00%) fn check_pat(&mut self, cx: &EarlyContext<'_>, p: &Pat) { 12,916 ( 0.00%) if let PatKind::Range(Some(start), Some(end), kind) = &p.kind 2,634 ( 0.00%) && matches!(kind.node, RangeEnd::Excluded) . && is_incomplete_range(start, end) . && !p.span.in_external_macro(cx.sess().source_map()) . { . span_lint_and_then( . cx, . ALMOST_COMPLETE_RANGE, . p.span, . "almost complete ascii range", -- line 81 ---------------------------------------- -- line 88 ---------------------------------------- . } else { . "...".to_owned() . }, . Applicability::MaybeIncorrect, . ); . }, . ); . } 17,549 ( 0.00%) } . . extract_msrv_attr!(); . } . 8 ( 0.00%) fn is_incomplete_range(start: &Expr, end: &Expr) -> bool { 16 ( 0.00%) match (&start.peel_parens().kind, &end.peel_parens().kind) { 24 ( 0.00%) (&ExprKind::Lit(start_lit), &ExprKind::Lit(end_lit)) => { 18 ( 0.00%) matches!( 30 ( 0.00%) (LitKind::from_token_lit(start_lit), LitKind::from_token_lit(end_lit),), 834 ( 0.00%) => ???:::from_token_lit (6x) . ( . Ok(LitKind::Byte(b'a') | LitKind::Char('a')), . Ok(LitKind::Byte(b'z') | LitKind::Char('z')) . ) | ( . Ok(LitKind::Byte(b'A') | LitKind::Char('A')), . Ok(LitKind::Byte(b'Z') | LitKind::Char('Z')), . ) | ( . Ok(LitKind::Byte(b'0') | LitKind::Char('0')), . Ok(LitKind::Byte(b'9') | LitKind::Char('9')), . ) . ) . }, . _ => false, . } 12 ( 0.00%) } 164 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/zero_div_zero.rs -------------------------------------------------------------------------------- Ir -- line 24 ---------------------------------------- . pub ZERO_DIVIDED_BY_ZERO, . complexity, . "usage of `0.0 / 0.0` to obtain NaN instead of `f32::NAN` or `f64::NAN`" . } . . declare_lint_pass!(ZeroDiv => [ZERO_DIVIDED_BY_ZERO]); . . impl<'tcx> LateLintPass<'tcx> for ZeroDiv { 412,452 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . // check for instances of 0.0/0.0 137,484 ( 0.01%) if let ExprKind::Binary(ref op, left, right) = expr.kind 76 ( 0.00%) && op.node == BinOpKind::Div . // TODO - constant_simple does not fold many operations involving floats. . // That's probably fine for this lint - it's pretty unlikely that someone would . // do something like 0.0/(2.0 - 2.0), but it would be nice to warn on that case too. 2 ( 0.00%) && let ecx = ConstEvalCtxt::new(cx) 112 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::new (2x) 2 ( 0.00%) && let ctxt = expr.span.ctxt() 10 ( 0.00%) && let Some(lhs_value) = ecx.eval_local(left, ctxt) 388 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval_local (2x) . && let Some(rhs_value) = ecx.eval_local(right, ctxt) . // FIXME(f16_f128): add these types when eq is available on all platforms . && (Constant::F32(0.0) == lhs_value || Constant::F64(0.0) == lhs_value) . && (Constant::F32(0.0) == rhs_value || Constant::F64(0.0) == rhs_value) . { . // since we're about to suggest a use of f32::NAN or f64::NAN, . // match the precision of the literals that are given. . let float_type = match (lhs_value, rhs_value) { -- line 49 ---------------------------------------- -- line 54 ---------------------------------------- . cx, . ZERO_DIVIDED_BY_ZERO, . expr.span, . "constant division of `0.0` with `0.0` will always result in NaN", . None, . format!("consider using `{float_type}::NAN` if you would like a constant representing NaN"), . ); . } 481,194 ( 0.02%) } . } 18 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/strlen_on_c_strings.rs -------------------------------------------------------------------------------- Ir -- line 45 ---------------------------------------- . . impl StrlenOnCStrings { . pub fn new(conf: &Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl<'tcx> LateLintPass<'tcx> for StrlenOnCStrings { 549,936 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 206,226 ( 0.01%) if !expr.span.from_expansion() 443 ( 0.00%) && let ExprKind::Call(func, [recv]) = expr.kind 381 ( 0.00%) && let ExprKind::Path(path) = &func.kind 635 ( 0.00%) && let Some(did) = cx.qpath_res(path, func.hir_id).opt_def_id() 3,911 ( 0.00%) => ???:::qpath_res (127x) 570 ( 0.00%) && match_libc_symbol(cx, did, sym::strlen) 4,902 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::match_libc_symbol (114x) . && let ExprKind::MethodCall(path, self_arg, [], _) = recv.kind . && !recv.span.from_expansion() . && path.ident.name == sym::as_ptr . && let typeck = cx.typeck_results() . && typeck . .expr_ty_adjusted(self_arg) . .peel_refs() . .is_lang_item(cx, LangItem::CStr) -- line 66 ---------------------------------------- -- line 100 ---------------------------------------- . } else { . format!("{val_name}.to_bytes().len()") . }; . . diag.span_suggestion(span, "use", suggestion, app); . }, . ); . } 549,936 ( 0.03%) } . } 137,389 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs -------------------------------------------------------------------------------- Ir -- line 378 ---------------------------------------- . /// . /// For more details, see the equivalent method on a raw pointer, [`pointer::map_addr`]. . /// . /// This is a [Strict Provenance][crate::ptr#strict-provenance] API. . #[must_use] . #[inline] . #[stable(feature = "strict_provenance", since = "1.84.0")] . pub fn map_addr(self, f: impl FnOnce(NonZero) -> NonZero) -> Self { 15 ( 0.00%) self.with_addr(f(self.addr())) . } . . /// Acquires the underlying `*mut` pointer. . /// . /// # Examples . /// . /// ``` . /// use std::ptr::NonNull; -- line 394 ---------------------------------------- -- line 446 ---------------------------------------- . #[stable(feature = "nonnull", since = "1.25.0")] . #[rustc_const_stable(feature = "const_nonnull_as_ref", since = "1.73.0")] . #[must_use] . #[inline(always)] . pub const unsafe fn as_ref<'a>(&self) -> &'a T { . // SAFETY: the caller must guarantee that `self` meets all the . // requirements for a reference. . // `cast_const` avoids a mutable raw pointer deref. 825,712 ( 0.04%) unsafe { &*self.as_ptr().cast_const() } . } . . /// Returns a unique reference to the value. If the value may be uninitialized, [`as_uninit_mut`] . /// must be used instead. . /// . /// For the shared counterpart see [`as_ref`]. . /// . /// [`as_uninit_mut`]: NonNull::as_uninit_mut -- line 462 ---------------------------------------- -- line 564 ---------------------------------------- . pub const unsafe fn offset(self, count: isize) -> Self . where . T: Sized, . { . // SAFETY: the caller must uphold the safety contract for `offset`. . // Additionally safety contract of `offset` guarantees that the resulting pointer is . // pointing to an allocation, there can't be an allocation at null, thus it's safe to . // construct `NonNull`. 10 ( 0.00%) unsafe { transmute(intrinsics::offset(self.as_ptr(), count)) } . } . . /// Calculates the offset from a pointer in bytes. . /// . /// `count` is in units of **bytes**. . /// . /// This is purely a convenience for casting to a `u8` pointer and . /// using [offset][pointer::offset] on it. See that method for documentation -- line 580 ---------------------------------------- -- line 619 ---------------------------------------- . pub const unsafe fn add(self, count: usize) -> Self . where . T: Sized, . { . // SAFETY: the caller must uphold the safety contract for `offset`. . // Additionally safety contract of `offset` guarantees that the resulting pointer is . // pointing to an allocation, there can't be an allocation at null, thus it's safe to . // construct `NonNull`. 102,280 ( 0.00%) unsafe { transmute(intrinsics::offset(self.as_ptr(), count)) } . } . . /// Calculates the offset from a pointer in bytes (convenience for `.byte_offset(count as isize)`). . /// . /// `count` is in units of bytes. . /// . /// This is purely a convenience for casting to a `u8` pointer and . /// using [`add`][NonNull::add] on it. See that method for documentation -- line 635 ---------------------------------------- -- line 1655 ---------------------------------------- . #[stable(feature = "nonnull", since = "1.25.0")] . impl Eq for NonNull {} . . #[stable(feature = "nonnull", since = "1.25.0")] . impl PartialEq for NonNull { . #[inline] . #[allow(ambiguous_wide_pointer_comparisons)] . fn eq(&self, other: &Self) -> bool { 2,738,582 ( 0.13%) self.as_ptr() == other.as_ptr() . } . } . . #[stable(feature = "nonnull", since = "1.25.0")] . impl Ord for NonNull { . #[inline] . #[allow(ambiguous_wide_pointer_comparisons)] . fn cmp(&self, other: &Self) -> Ordering { -- line 1671 ---------------------------------------- 10,515 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs -------------------------------------------------------------------------------- Ir -- line 73 ---------------------------------------- . derive_src: Option, . . // When a macro is disallowed in an early pass, it's stored . // and emitted during the late pass. This happens for attributes. . early_macro_cache: AttrStorage, . } . . impl DisallowedMacros { 6 ( 0.00%) pub fn new(tcx: TyCtxt<'_>, conf: &'static Conf, early_macro_cache: AttrStorage) -> Self { 12 ( 0.00%) let (disallowed, _) = create_disallowed_map( 38 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_config/src/types.rs:clippy_config::types::create_disallowed_map::::new::{closure#0}> (1x) . tcx, . &conf.disallowed_macros, . PathNS::Macro, . |def_kind| matches!(def_kind, DefKind::Macro(_)), . "macro", . false, . ); 6 ( 0.00%) Self { 4 ( 0.00%) disallowed, . seen: FxHashSet::default(), . derive_src: None, . early_macro_cache, . } 5 ( 0.00%) } . 605,288 ( 0.03%) fn check(&mut self, cx: &LateContext<'_>, span: Span, derive_src: Option) { 75,661 ( 0.00%) if self.disallowed.is_empty() { . return; . } . . for mac in macro_backtrace(span) { . if !self.seen.insert(mac.expn) { . return; . } . -- line 107 ---------------------------------------- -- line 119 ---------------------------------------- . msg, . add_note, . ); . } else { . span_lint_and_then(cx, DISALLOWED_MACROS, mac.span, msg, add_note); . } . } . } 605,288 ( 0.03%) } . } . . impl LateLintPass<'_> for DisallowedMacros { 6 ( 0.00%) fn check_crate(&mut self, cx: &LateContext<'_>) { . // once we check a crate in the late pass we can emit the early pass lints . if let Some(attr_spans) = self.early_macro_cache.clone().0.get() { . for span in attr_spans { 1,205 ( 0.00%) self.check(cx, *span, None); 4,338 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (241x) . } . } 7 ( 0.00%) } . . fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 343,710 ( 0.02%) self.check(cx, expr.span, None); 1,237,356 ( 0.06%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (68,742x) . // `$t + $t` can have the context of $t, check also the span of the binary operator 137,560 ( 0.01%) if let ExprKind::Binary(op, ..) = expr.kind { 304 ( 0.00%) self.check(cx, op.span, None); 1,368 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (76x) . } . } . . fn check_stmt(&mut self, cx: &LateContext<'_>, stmt: &Stmt<'_>) { 640 ( 0.00%) self.check(cx, stmt.span, None); 2,880 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (160x) . } . . fn check_ty(&mut self, cx: &LateContext<'_>, ty: &Ty<'_, AmbigArg>) { 2,492 ( 0.00%) self.check(cx, ty.span, None); 11,214 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (623x) . } . . fn check_pat(&mut self, cx: &LateContext<'_>, pat: &Pat<'_>) { 10,148 ( 0.00%) self.check(cx, pat.span, None); 45,666 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (2,537x) . } . 2,130 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) { 852 ( 0.00%) self.check(cx, item.span, self.derive_src); 3,834 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (213x) 1,065 ( 0.00%) self.check(cx, item.vis_span, None); 3,834 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (213x) . 639 ( 0.00%) if matches!( 213 ( 0.00%) item.kind, . ItemKind::Struct(..) | ItemKind::Enum(..) | ItemKind::Union(..) . ) && macro_backtrace(item.span).all(|m| !matches!(m.kind, MacroKind::Derive)) . { 16 ( 0.00%) self.derive_src = Some(item.owner_id); . } 1,704 ( 0.00%) } . . fn check_foreign_item(&mut self, cx: &LateContext<'_>, item: &ForeignItem<'_>) { . self.check(cx, item.span, None); . self.check(cx, item.vis_span, None); . } . . fn check_impl_item(&mut self, cx: &LateContext<'_>, item: &ImplItem<'_>) { 245 ( 0.00%) self.check(cx, item.span, None); 882 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (49x) 107 ( 0.00%) if let ImplItemImplKind::Inherent { vis_span, .. } = item.impl_kind { 36 ( 0.00%) self.check(cx, vis_span, None); 162 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (9x) . } . } . . fn check_trait_item(&mut self, cx: &LateContext<'_>, item: &TraitItem<'_>) { 24 ( 0.00%) self.check(cx, item.span, None); 108 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (6x) . } . . fn check_path(&mut self, cx: &LateContext<'_>, path: &Path<'_>, _: HirId) { 11,168 ( 0.00%) self.check(cx, path.span, None); 50,256 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (2,792x) . } . } 24 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/precedence.rs -------------------------------------------------------------------------------- Ir -- line 42 ---------------------------------------- . pub PRECEDENCE_BITS, . restriction, . "operations mixing bit shifting with bit combining/masking" . } . . declare_lint_pass!(Precedence => [PRECEDENCE, PRECEDENCE_BITS]); . . impl EarlyLintPass for Precedence { 504,203 ( 0.02%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 144,058 ( 0.01%) if expr.span.from_expansion() { . return; . } . 359,455 ( 0.02%) if let ExprKind::Binary(Spanned { node: op, .. }, ref left, ref right) = expr.kind { . let span_sugg = |lint: &'static Lint, expr: &Expr, sugg, appl| { 11 ( 0.00%) span_lint_and_sugg( 801 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_sugg:: (1x) . cx, . lint, 1 ( 0.00%) expr.span, . "operator precedence might not be obvious", . "consider parenthesizing your expression", . sugg, . appl, . ); . }; . . if !is_bit_op(op) { . return; . } 6 ( 0.00%) let mut applicability = Applicability::MachineApplicable; 17 ( 0.00%) match (op, get_bin_opt(left), get_bin_opt(right)) { . ( . BitAnd | BitOr | BitXor, . Some(left_op @ (Shl | Shr | Add | Div | Mul | Rem | Sub)), . Some(right_op @ (Shl | Shr | Add | Div | Mul | Rem | Sub)), . ) . | ( . Shl | Shr, . Some(left_op @ (Add | Div | Mul | Rem | Sub)), -- line 80 ---------------------------------------- -- line 85 ---------------------------------------- . snippet_with_applicability(cx, left.span, "..", &mut applicability), . op.as_str(), . snippet_with_applicability(cx, right.span, "..", &mut applicability) . ); . span_sugg(lint_for(&[op, left_op, right_op]), expr, sugg, applicability); . }, . (BitAnd | BitOr | BitXor, Some(side_op @ (Shl | Shr | Add | Div | Mul | Rem | Sub)), _) . | (Shl | Shr, Some(side_op @ (Add | Div | Mul | Rem | Sub)), _) => { 10 ( 0.00%) let sugg = format!( . "({}) {} {}", 1 ( 0.00%) snippet_with_applicability(cx, left.span, "..", &mut applicability), 4 ( 0.00%) op.as_str(), 6 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/ast.rs:::as_str (1x) 1 ( 0.00%) snippet_with_applicability(cx, right.span, "..", &mut applicability) . ); . span_sugg(lint_for(&[op, side_op]), expr, sugg, applicability); 1 ( 0.00%) }, . (BitAnd | BitOr | BitXor, _, Some(side_op @ (Shl | Shr | Add | Div | Mul | Rem | Sub))) . | (Shl | Shr, _, Some(side_op @ (Add | Div | Mul | Rem | Sub))) => { . let sugg = format!( . "{} {} ({})", . snippet_with_applicability(cx, left.span, "..", &mut applicability), . op.as_str(), . snippet_with_applicability(cx, right.span, "..", &mut applicability) . ); . span_sugg(lint_for(&[op, side_op]), expr, sugg, applicability); . }, . _ => (), . } . } else if let ExprKind::MethodCall(method_call) = &expr.kind 440 ( 0.00%) && let ExprKind::Closure(closure) = &method_call.receiver.kind . { . span_lint_and_then(cx, PRECEDENCE, expr.span, "precedence might not be obvious", |diag| { . diag.multipart_suggestion( . "consider parenthesizing the closure", . vec![ . (closure.fn_decl_span.shrink_to_lo(), String::from("(")), . (closure.body.span.shrink_to_hi(), String::from(")")), . ], . Applicability::MachineApplicable, . ); . }); . } 576,232 ( 0.03%) } . } . . fn get_bin_opt(expr: &Expr) -> Option { 24 ( 0.00%) match expr.kind { 1 ( 0.00%) ExprKind::Binary(Spanned { node: op, .. }, _, _) => Some(op), . _ => None, . } . } . . #[must_use] . fn is_bit_op(op: BinOpKind) -> bool { 229 ( 0.00%) matches!(op, BitXor | BitAnd | BitOr | Shl | Shr) . } . . fn lint_for(ops: &[BinOpKind]) -> &'static Lint { . if ops.iter().all(|op| is_bit_op(*op)) { . PRECEDENCE_BITS . } else { . PRECEDENCE . } -- line 147 ---------------------------------------- 12 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/indexing_slicing.rs -------------------------------------------------------------------------------- Ir -- line 104 ---------------------------------------- . Self { . allow_indexing_slicing_in_tests: conf.allow_indexing_slicing_in_tests, . suppress_restriction_lint_in_const: conf.suppress_restriction_lint_in_const, . } . } . } . . impl<'tcx> LateLintPass<'tcx> for IndexingSlicing { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 137,484 ( 0.01%) if let ExprKind::Index(array, index, _) = &expr.kind 26 ( 0.00%) && (!self.suppress_restriction_lint_in_const || !cx.tcx.hir_is_inside_const_context(expr.hir_id)) 65 ( 0.00%) && let expr_ty = cx.typeck_results().expr_ty(array) 520 ( 0.00%) => ???:::expr_ty (13x) . && let mut deref = deref_chain(cx, expr_ty) . && deref.any(|l| { . l.peel_refs().is_slice() . || l.peel_refs().is_array() . || ty_has_applicable_get_function(cx, l.peel_refs(), expr_ty, expr) . }) 26 ( 0.00%) && !is_from_proc_macro(cx, expr) . { 65 ( 0.00%) let note = "the suggestion might not be applicable in constant blocks"; 26 ( 0.00%) let ty = cx.typeck_results().expr_ty(array).peel_refs(); 520 ( 0.00%) => ???:::expr_ty (13x) 26 ( 0.00%) let allowed_in_tests = self.allow_indexing_slicing_in_tests && is_in_test(cx.tcx, expr.hir_id); 92 ( 0.00%) if let Some(range) = higher::Range::hir(cx, index) { 3,343 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (13x) . // Ranged indexes, i.e., &x[n..m], &x[n..], &x[..n] and &x[..] 14 ( 0.00%) if let ty::Array(_, s) = ty.kind() { . let size: u128 = if let Some(size) = s.try_to_target_usize(cx.tcx) { . size.into() . } else { . return; . }; . . let const_range = to_const_range(cx, range, size); . -- line 137 ---------------------------------------- -- line 161 ---------------------------------------- . . if let (Some(_), Some(_)) = const_range { . // early return because both start and end are constants . // and we have proven above that they are in bounds . return; . } . } . 38 ( 0.00%) let help_msg = match (range.start, range.end) { 12 ( 0.00%) (None, Some(_)) => "consider using `.get(..n)`or `.get_mut(..n)` instead", 12 ( 0.00%) (Some(_), None) => "consider using `.get(n..)` or .get_mut(n..)` instead", . (Some(_), Some(_)) => "consider using `.get(n..m)` or `.get_mut(n..m)` instead", . (None, None) => return, // [..] is ok. . }; . 14 ( 0.00%) if allowed_in_tests { . return; . } . 91 ( 0.00%) span_lint_and_then(cx, INDEXING_SLICING, expr.span, "slicing may panic", |diag| { 8,252 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then::::check_expr::{closure#3}> (7x) . diag.help(help_msg); . . if cx.tcx.hir_is_inside_const_context(expr.hir_id) { . diag.note(note); . } . }); . } else { . // Catchall non-range index, i.e., [n] or [n << m] 12 ( 0.00%) if let ty::Array(..) = ty.kind() { . // Index is a const block. . if let ExprKind::ConstBlock(..) = index.kind { . return; . } . // Index is a constant uint. . if let Some(constant) = ConstEvalCtxt::new(cx).eval(index) { . // only `usize` index is legal in rust array index . // leave other type to rustc -- line 197 ---------------------------------------- -- line 210 ---------------------------------------- . span_lint(cx, OUT_OF_BOUNDS_INDEXING, expr.span, "index is out of bounds"); . } . } . // Let rustc's `const_err` lint handle constant `usize` indexing on arrays. . return; . } . } . 12 ( 0.00%) if allowed_in_tests { . return; . } . 84 ( 0.00%) span_lint_and_then(cx, INDEXING_SLICING, expr.span, "indexing may panic", |diag| { 8,066 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then::::check_expr::{closure#4}> (6x) . diag.help("consider using `.get(n)` or `.get_mut(n)` instead"); . . if cx.tcx.hir_is_inside_const_context(expr.hir_id) { . diag.note(note); . } . }); . } . } 549,936 ( 0.03%) } . } . . /// Returns a tuple of options with the start and end (exclusive) values of . /// the range. If the start or end is not constant, None is returned. . fn to_const_range(cx: &LateContext<'_>, range: higher::Range<'_>, array_size: u128) -> (Option, Option) { . let ecx = ConstEvalCtxt::new(cx); . let s = range.start.map(|expr| ecx.eval(expr)); . let start = match s { -- line 239 ---------------------------------------- -- line 261 ---------------------------------------- . /// Checks if the output Ty of the `get` method on this Ty (if any) matches the Ty returned by the . /// indexing operation (if any). . fn ty_has_applicable_get_function<'tcx>( . cx: &LateContext<'tcx>, . ty: Ty<'tcx>, . array_ty: Ty<'tcx>, . index_expr: &Expr<'_>, . ) -> bool { 10 ( 0.00%) if let ty::Adt(_, _) = array_ty.kind() 20 ( 0.00%) && let Some(get_output_ty) = get_adt_inherent_method(cx, ty, sym::get).map(|m| { 2,890 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::get_adt_inherent_method (5x) . cx.tcx . .fn_sig(m.def_id) . .skip_binder() . .output() . .skip_binder() . }) . && let ty::Adt(def, args) = get_output_ty.kind() . && cx.tcx.is_diagnostic_item(sym::Option, def.0.did) -- line 278 ---------------------------------------- 249 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/useless_conversion.rs -------------------------------------------------------------------------------- Ir -- line 75 ---------------------------------------- . /// assert_eq!(i.len(), 3); . /// } . /// . /// pub fn bar() { . /// foo([1, 2, 3].into_iter()); . /// ^^^^^^^^^^^^ ... here, because `[i32; 3]` is not `ExactSizeIterator` . /// } . /// ``` 72 ( 0.00%) fn into_iter_bound<'tcx>( . cx: &LateContext<'tcx>, . fn_did: DefId, . into_iter_did: DefId, . into_iter_receiver: Ty<'tcx>, . param_index: u32, . node_args: GenericArgsRef<'tcx>, . ) -> Option { 12 ( 0.00%) let mut into_iter_span = None; . 6 ( 0.00%) for (clause, span) in cx.tcx.explicit_clauses_of(fn_did).clauses { 10 ( 0.00%) if let ty::ClauseKind::Trait(tr) = clause.kind().skip_binder() 28 ( 0.00%) => ???:::kind (2x) 2 ( 0.00%) && tr.self_ty().is_param(param_index) . { . if tr.def_id() == into_iter_did { 14 ( 0.00%) into_iter_span = Some(*span); . } else { . let tr = cx.tcx.erase_and_anonymize_regions(tr); . if tr.has_escaping_bound_vars() { . return None; . } . . // Substitute generics in the predicate and replace the IntoIterator type parameter with the . // `.into_iter()` receiver to see if the bound also holds for that type. 2 ( 0.00%) let args = cx.tcx.mk_args_from_iter(node_args.iter().enumerate().map(|(i, arg)| { 6 ( 0.00%) if i == param_index as usize { 2 ( 0.00%) GenericArg::from(into_iter_receiver) . } else { . arg . } . })); . . let predicate = EarlyBinder::bind(cx.tcx, tr).instantiate(cx.tcx, args).skip_norm_wip(); . let obligation = Obligation::new(cx.tcx, ObligationCause::dummy(), cx.param_env, predicate); 4 ( 0.00%) if !cx . .tcx . .infer_ctxt() 14 ( 0.00%) .build(cx.typing_mode()) 204 ( 0.00%) => ???:::build (2x) 30 ( 0.00%) => ???:::typing_mode (2x) 7 ( 0.00%) .predicate_must_hold_modulo_regions(&obligation) 3,071 ( 0.00%) => ???:::predicate_must_hold_modulo_regions (2x) 500 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:core::ptr::drop_glue:: (2x) . { 1 ( 0.00%) return None; . } . } . } . } . . into_iter_span 48 ( 0.00%) } . . /// Extracts the receiver of a `.into_iter()` method call. 6 ( 0.00%) fn into_iter_call<'hir>(cx: &LateContext<'_>, expr: &'hir Expr<'hir>) -> Option<&'hir Expr<'hir>> { 12 ( 0.00%) if let ExprKind::MethodCall(name, recv, [], _) = expr.kind 78 ( 0.00%) && name.ident.name == sym::into_iter 36 ( 0.00%) && cx.ty_based_def(expr).opt_parent(cx).is_diag_item(cx, sym::IntoIterator) . { . Some(recv) . } else { . None . } 6 ( 0.00%) } . . /// Same as [`into_iter_call`], but tries to look for the innermost `.into_iter()` call, e.g.: . /// `foo.into_iter().into_iter()` . /// ^^^ we want this expression . fn into_iter_deep_call<'hir>(cx: &LateContext<'_>, mut expr: &'hir Expr<'hir>) -> (&'hir Expr<'hir>, usize) { . let mut depth = 0; . while let Some(recv) = into_iter_call(cx, expr) { . expr = recv; . depth += 1; . } . (expr, depth) . } . . #[expect(clippy::too_many_lines)] . impl<'tcx> LateLintPass<'tcx> for UselessConversion { 549,936 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 137,484 ( 0.01%) if e.span.from_expansion() { 714 ( 0.00%) if e.span.desugaring_kind().is_none() { 23,664 ( 0.00%) => ???:::desugaring_kind (238x) 118 ( 0.00%) self.expn_depth += 1; . } . return; . } . 9 ( 0.00%) if Some(&e.hir_id) == self.try_desugar_arm.last() { . return; . } . 479,250 ( 0.02%) match e.kind { 3 ( 0.00%) ExprKind::Match(_, arms, MatchSource::TryDesugar(_)) => { 36 ( 0.00%) let (ExprKind::Ret(Some(e)) | ExprKind::Break(_, Some(e))) = arms[0].body.kind else { . return; . }; 18 ( 0.00%) if let ExprKind::Call(_, [arg, ..]) = e.kind { 3 ( 0.00%) self.try_desugar_arm.push(arg.hir_id); . } . }, . 490 ( 0.00%) ExprKind::MethodCall(path, recv, [arg], _) => { . if matches!( 32 ( 0.00%) path.ident.name, 192 ( 0.00%) sym::map | sym::map_err | sym::map_break | sym::map_continue 12 ( 0.00%) ) && has_eligible_receiver(cx, recv, e) . && matches!( 6 ( 0.00%) arg.res(cx).assoc_parent(cx).opt_diag_name(cx), 27 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/res.rs:::assoc_parent:: (3x) . Some(sym::Into | sym::From) . ) . && let ty::FnDef(_, args) = cx.typeck_results().expr_ty(arg).kind() . && let &[from_ty, to_ty] = args.no_bound_vars().unwrap().into_type_list(cx.tcx).as_slice() . && same_type_modulo_regions(from_ty, to_ty) . { . span_lint_and_then( . cx, -- line 194 ---------------------------------------- -- line 202 ---------------------------------------- . "consider removing", . Applicability::MachineApplicable, . ); . }, . ); . } . }, . 156 ( 0.00%) ExprKind::MethodCall(name, recv, [], _) => { 162 ( 0.00%) if name.ident.name == sym::into && cx.ty_based_def(e).opt_parent(cx).is_diag_item(cx, sym::Into) { 696 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/res.rs: as clippy_utils::res::MaybeDef>::opt_parent:: (6x) 30 ( 0.00%) let a = cx.typeck_results().expr_ty(e); 240 ( 0.00%) => ???:::expr_ty (6x) 24 ( 0.00%) let b = cx.typeck_results().expr_ty(recv); 240 ( 0.00%) => ???:::expr_ty (6x) 30 ( 0.00%) if same_type_modulo_regions(a, b) { 120 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::same_type_modulo_regions (6x) . let mut app = Applicability::MachineApplicable; . let sugg = snippet_with_context(cx, recv.span, e.span.ctxt(), "", &mut app).0; . span_lint_and_sugg( . cx, . USELESS_CONVERSION, . e.span, . format!("useless conversion to the same type: `{b}`"), . "consider removing `.into()`", . sugg.into_owned(), . app, . ); . } . } 216 ( 0.00%) if let Some(into_iter_recv) = into_iter_call(cx, e) . // Make sure that there is no parent expression, or if there is, make sure it's not a `.into_iter()` call. . // The reason for that is that we only want to lint once (the outermost call) . // in cases like `foo.into_iter().into_iter()` 42 ( 0.00%) && get_parent_expr(cx, e) 594 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (6x) 24 ( 0.00%) .and_then(|parent| into_iter_call(cx, parent)) 24 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/useless_conversion.rs:clippy_lints::useless_conversion::into_iter_call (6x) . .is_none() . { 36 ( 0.00%) if let Some(parent) = get_parent_expr(cx, e) { 594 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (6x) 30 ( 0.00%) let parent_fn = match parent.kind { 24 ( 0.00%) ExprKind::Call(recv, args) 24 ( 0.00%) if let ExprKind::Path(ref qpath) = recv.kind 30 ( 0.00%) && let Some(did) = cx.qpath_res(qpath, recv.hir_id).opt_def_id() 413 ( 0.00%) => ???:::qpath_res (6x) . // make sure that the path indeed points to a fn-like item, so that . // `fn_sig` does not ICE. (see #11065) . && cx.tcx.def_kind(did).is_fn_like() => . { . Some(( . did, . args, 18 ( 0.00%) cx.typeck_results().node_args(recv.hir_id), 234 ( 0.00%) => ???:::node_args (6x) . MethodOrFunction::Function, . )) . }, . ExprKind::MethodCall(.., args, _) => { . cx.typeck_results().type_dependent_def_id(parent.hir_id).map(|did| { . ( . did, . args, -- line 256 ---------------------------------------- -- line 258 ---------------------------------------- . MethodOrFunction::Method, . ) . }) . }, . _ => None, . }; . . if let Some((parent_fn_did, args, node_args, kind)) = parent_fn 42 ( 0.00%) && let Some(into_iter_did) = cx.tcx.get_diagnostic_item(sym::IntoIterator) 432 ( 0.00%) => ???:::get_diagnostic_item (6x) . && let sig = cx.tcx.fn_sig(parent_fn_did).skip_binder().skip_binder() . && let Some(arg_pos) = args.iter().position(|x| x.hir_id == e.hir_id) 6 ( 0.00%) && let Some(&into_iter_param) = sig.inputs().get(kind.param_pos(arg_pos)) 12 ( 0.00%) && let ty::Param(param) = into_iter_param.kind() 48 ( 0.00%) && let Some(span) = into_iter_bound( 5,551 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/useless_conversion.rs:clippy_lints::useless_conversion::into_iter_bound (6x) . cx, . parent_fn_did, . into_iter_did, 12 ( 0.00%) cx.typeck_results().expr_ty(into_iter_recv), 240 ( 0.00%) => ???:::expr_ty (6x) 6 ( 0.00%) param.index, . node_args, . ) . && self.expn_depth == 0 . { . // Get the "innermost" `.into_iter()` call, e.g. given this expression: . // `foo.into_iter().into_iter()` . // ^^^ . let (into_iter_recv, depth) = into_iter_deep_call(cx, into_iter_recv); -- line 284 ---------------------------------------- -- line 317 ---------------------------------------- . && let PatKind::Binding(ann, ..) = pat.kind . && ann != BindingMode::MUT . { . // Do not remove .into_iter() applied to a non-mutable local variable used in . // a larger expression context as it would differ in mutability. . return; . } . 30 ( 0.00%) let iter_ty = cx.typeck_results().expr_ty(e); 240 ( 0.00%) => ???:::expr_ty (6x) 30 ( 0.00%) let into_iter_ty = cx.typeck_results().expr_ty(recv); 240 ( 0.00%) => ???:::expr_ty (6x) . . // If the types are identical then .into_iter() can be removed, unless the type . // implements Copy, in which case .into_iter() returns a copy of the receiver and . // cannot be safely omitted. 30 ( 0.00%) if same_type_modulo_regions(iter_ty, into_iter_ty) && !is_copy(cx, into_iter_ty) { 156 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::same_type_modulo_regions (6x) . // Below we check if the parent method call meets the following conditions: . // 1. First parameter is `&mut self` (requires mutable reference) . // 2. Second parameter implements the `FnMut` trait (e.g., Iterator::any) . // For methods satisfying these conditions (like any), .into_iter() must be preserved. . if let Some(parent) = get_parent_expr(cx, e) . && let ExprKind::MethodCall(_, recv, _, _) = parent.kind . && recv.hir_id == e.hir_id . && let Some(def_id) = cx.typeck_results().type_dependent_def_id(parent.hir_id) -- line 339 ---------------------------------------- -- line 388 ---------------------------------------- . e.span, . format!("useless conversion to the same type: `{into_iter_ty}`"), . "consider removing `.into_iter()`", . sugg, . applicability, . ); . } . } 78 ( 0.00%) if name.ident.name == sym::try_into . && cx.ty_based_def(e).opt_parent(cx).is_diag_item(cx, sym::TryInto) . && let a = cx.typeck_results().expr_ty(e) . && let b = cx.typeck_results().expr_ty(recv) . && a.is_diag_item(cx, sym::Result) . && let ty::Adt(_, args) = a.kind() . && let Some(a_type) = args.types().next() . && same_type_modulo_regions(a_type, b) . { -- line 404 ---------------------------------------- -- line 408 ---------------------------------------- . e.span, . format!("useless conversion to the same type: `{b}`"), . None, . "consider removing `.try_into()`", . ); . } . }, . 443 ( 0.00%) ExprKind::Call(path, [arg]) => { 381 ( 0.00%) if let ExprKind::Path(ref qpath) = path.kind 762 ( 0.00%) && !is_ty_alias(qpath) 2,167 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_ty_alias (127x) 635 ( 0.00%) && let Some(def_id) = cx.qpath_res(qpath, path.hir_id).opt_def_id() 3,911 ( 0.00%) => ???:::qpath_res (127x) 684 ( 0.00%) && let Some(name) = cx.tcx.get_diagnostic_name(def_id) 6,711 ( 0.00%) => ???:::get_diagnostic_name (114x) . { . let a = cx.typeck_results().expr_ty(e); . let b = cx.typeck_results().expr_ty(arg); . if name == sym::try_from_fn . && a.is_diag_item(cx, sym::Result) . && let ty::Adt(_, args) = a.kind() . && let Some(a_type) = args.types().next() . && same_type_modulo_regions(a_type, b) -- line 428 ---------------------------------------- -- line 450 ---------------------------------------- . app, . ); . } . } . }, . . _ => {}, . } 549,936 ( 0.03%) } . . fn check_expr_post(&mut self, _: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 21 ( 0.00%) if Some(&e.hir_id) == self.try_desugar_arm.last() { . self.try_desugar_arm.pop(); . } 138,198 ( 0.01%) if e.span.from_expansion() && e.span.desugaring_kind().is_none() { 23,664 ( 0.00%) => ???:::desugaring_kind (238x) 118 ( 0.00%) self.expn_depth -= 1; . } . } . } . . fn has_eligible_receiver(cx: &LateContext<'_>, recv: &Expr<'_>, expr: &Expr<'_>) -> bool { 9 ( 0.00%) if cx.ty_based_def(expr).opt_parent(cx).is_impl(cx) { 12 ( 0.00%) matches!( 9 ( 0.00%) cx.typeck_results().expr_ty(recv).opt_diag_name(cx), 120 ( 0.00%) => ???:::expr_ty (3x) . Some(sym::Option | sym::Result | sym::ControlFlow) . ) . } else { . cx.ty_based_def(expr).opt_parent(cx).is_diag_item(cx, sym::Iterator) . } . } . . fn adjustments(cx: &LateContext<'_>, expr: &Expr<'_>) -> String { -- line 481 ---------------------------------------- 531 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/octal_escapes.rs -------------------------------------------------------------------------------- Ir -- line 45 ---------------------------------------- . pub OCTAL_ESCAPES, . suspicious, . "string escape sequences looking like octal characters" . } . . declare_lint_pass!(OctalEscapes => [OCTAL_ESCAPES]); . . impl EarlyLintPass for OctalEscapes { 504,203 ( 0.02%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 144,058 ( 0.01%) if let ExprKind::Lit(lit) = &expr.kind . // The number of bytes from the start of the token to the start of literal's text. 381,003 ( 0.02%) && let start_offset = BytePos::from_u32(match lit.kind { . LitKind::Str => 1, . LitKind::ByteStr | LitKind::CStr => 2, . _ => return, . }) 21 ( 0.00%) && !expr.span.in_external_macro(cx.sess().source_map()) . { . let s = lit.symbol.as_str(); . let mut iter = s.as_bytes().iter(); . while let Some(&c) = iter.next() { . if c == b'\\' . // Always move the iterator to read the escape char. . && let Some(b'0') = iter.next() . { -- line 69 ---------------------------------------- -- line 107 ---------------------------------------- . ); . }); . } else { . break; . } . } . } . } 576,232 ( 0.03%) } . } 108,873 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/const_ptr.rs -------------------------------------------------------------------------------- Ir -- line 30 ---------------------------------------- . match (ptr).guaranteed_eq(null_mut()) { . Some(res) => res, . // To remain maximally conservative, we stop execution when we don't . // know whether the pointer is null or not. . // We can *not* return `false` here, that would be unsound in `NonNull::new`! . None => panic!("null-ness of this pointer cannot be determined in const context"), . } . } else { 10,540 ( 0.00%) ptr.addr() == 0 . } . ) . } . . /// Casts to a pointer of another type. . #[stable(feature = "ptr_cast", since = "1.38.0")] . #[rustc_const_stable(feature = "const_ptr_cast", since = "1.38.0")] . #[rustc_diagnostic_item = "const_ptr_cast"] -- line 46 ---------------------------------------- -- line 262 ---------------------------------------- . /// [`as_uninit_ref`]: #method.as_uninit_ref . /// [`as_ref_unchecked`]: #method.as_ref_unchecked . #[stable(feature = "ptr_as_ref", since = "1.9.0")] . #[rustc_const_stable(feature = "const_ptr_is_null", since = "1.84.0")] . #[inline] . pub const unsafe fn as_ref<'a>(self) -> Option<&'a T> { . // SAFETY: the caller must guarantee that `self` is valid . // for a reference if it isn't null. 3,431 ( 0.00%) if self.is_null() { None } else { unsafe { Some(&*self) } } . } . . /// Returns a shared reference to the value behind the pointer. . /// If the pointer may be null or the value may be uninitialized, [`as_uninit_ref`] must be used instead. . /// If the pointer may be null, but the value is known to have been initialized, [`as_ref`] must be used instead. . /// . /// [`as_ref`]: #method.as_ref . /// [`as_uninit_ref`]: #method.as_uninit_ref -- line 278 ---------------------------------------- -- line 381 ---------------------------------------- . ( . this: *const () = self as *const (), . count: isize = count, . size: usize = size_of::(), . ) => runtime_offset_nowrap(this, count, size) . ); . . // SAFETY: the caller must uphold the safety contract for `offset`. 85 ( 0.00%) unsafe { intrinsics::offset(self, count) } . } . . /// Adds a signed offset in bytes to a pointer. . /// . /// `count` is in units of **bytes**. . /// . /// This is purely a convenience for casting to a `u8` pointer and . /// using [offset][pointer::offset] on it. See that method for documentation -- line 397 ---------------------------------------- -- line 615 ---------------------------------------- . #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces . pub const unsafe fn offset_from(self, origin: *const T) -> isize . where . T: Sized, . { . let pointee_size = size_of::(); . assert!(0 < pointee_size && pointee_size <= isize::MAX as usize); . // SAFETY: the caller must uphold the safety contract for `ptr_offset_from`. 682 ( 0.00%) unsafe { intrinsics::ptr_offset_from(self, origin) } . } . . /// Calculates the distance between two pointers within the same allocation. The returned value is in . /// units of **bytes**. . /// . /// This is purely a convenience for casting to a `u8` pointer and . /// using [`offset_from`][pointer::offset_from] on it. See that method for . /// documentation and safety requirements. -- line 631 ---------------------------------------- -- line 725 ---------------------------------------- . this: *const () = self as *const (), . origin: *const () = origin as *const (), . ) => runtime_ptr_ge(this, origin) . ); . . let pointee_size = size_of::(); . assert!(0 < pointee_size && pointee_size <= isize::MAX as usize); . // SAFETY: the caller must uphold the safety contract for `ptr_offset_from_unsigned`. 3,539 ( 0.00%) unsafe { intrinsics::ptr_offset_from_unsigned(self, origin) } . } . . /// Calculates the distance between two pointers within the same allocation, *where it's known that . /// `self` is equal to or greater than `origin`*. The returned value is in . /// units of **bytes**. . /// . /// This is purely a convenience for casting to a `u8` pointer and . /// using [`offset_from_unsigned`][pointer::offset_from_unsigned] on it. -- line 741 ---------------------------------------- -- line 863 ---------------------------------------- . ( . this: *const () = self as *const (), . count: usize = count, . size: usize = size_of::(), . ) => runtime_add_nowrap(this, count, size) . ); . . // SAFETY: the caller must uphold the safety contract for `offset`. 213,748 ( 0.01%) unsafe { intrinsics::offset(self, count) } . } . . /// Adds an unsigned offset in bytes to a pointer. . /// . /// `count` is in units of bytes. . /// . /// This is purely a convenience for casting to a `u8` pointer and . /// using [add][pointer::add] on it. See that method for documentation -- line 879 ---------------------------------------- -- line 1590 ---------------------------------------- . #[diagnostic::on_const( . message = "pointers cannot be reliably compared during const eval", . note = "see issue #53020 for more information" . )] . impl PartialEq for *const T { . #[inline] . #[allow(ambiguous_wide_pointer_comparisons)] . fn eq(&self, other: &*const T) -> bool { 71,056 ( 0.00%) *self == *other . } . } . . /// Pointer equality is an equivalence relation. . #[stable(feature = "rust1", since = "1.0.0")] . #[diagnostic::on_const( . message = "pointers cannot be reliably compared during const eval", . note = "see issue #53020 for more information" -- line 1606 ---------------------------------------- 78,561 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/functions/too_many_lines.rs -------------------------------------------------------------------------------- Ir -- line 13 ---------------------------------------- . kind: FnKind<'_>, . body: &hir::Body<'_>, . span: Span, . def_id: LocalDefId, . too_many_lines_threshold: u64, . ) { . // Closures must be contained in a parent body, which will be checked for `too_many_lines`. . // Don't check closures for `too_many_lines` to avoid duplicated lints. 226 ( 0.00%) if matches!(kind, FnKind::Closure) || (span.from_expansion() && span.in_external_macro(cx.sess().source_map())) { . return; . } . 166 ( 0.00%) let mut line_count: u64 = 0; 83 ( 0.00%) let too_many = body.value.span.check_text(cx, |src| { . let mut in_comment = false; . let mut code_in_line; . 249 ( 0.00%) let function_lines = if matches!(body.value.kind, hir::ExprKind::Block(..)) 83 ( 0.00%) && src.as_bytes().first().copied() == Some(b'{') 83 ( 0.00%) && src.as_bytes().last().copied() == Some(b'}') . { . // Removing the braces from the enclosing block . &src[1..src.len() - 1] . } else { . src . } . .trim() // Remove leading and trailing blank lines . .lines(); . . for mut line in function_lines { . code_in_line = false; . loop { . line = line.trim_start(); 2,716 ( 0.00%) if line.is_empty() { . break; . } 5,400 ( 0.00%) if in_comment { . if let Some(i) = line.find("*/") { . line = &line[i + 2..]; . in_comment = false; . continue; . } . } else { . let multi_idx = line.find("/*").unwrap_or(line.len()); . let single_idx = line.find("//").unwrap_or(line.len()); 16,200 ( 0.00%) code_in_line |= multi_idx > 0 && single_idx > 0; . // Implies multi_idx is below line.len() 5,400 ( 0.00%) if multi_idx < single_idx { . line = &line[multi_idx + 2..]; . in_comment = true; . continue; . } . } . break; . } 5,400 ( 0.00%) if code_in_line { 10,568 ( 0.00%) line_count += 1; . } . } 332 ( 0.00%) line_count > too_many_lines_threshold . }); . . if too_many { . span_lint( . cx, . TOO_MANY_LINES, . cx.tcx.def_span(def_id), 30 ( 0.00%) format!("this function has too many lines ({line_count}/{too_many_lines_threshold})"), . ); . } . } 29,695 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/sync/atomic.rs -------------------------------------------------------------------------------- Ir -- line 754 ---------------------------------------- . /// ``` . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_atomic", issue = "160078")] . #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces . pub const fn load(&self, order: Ordering) -> bool { . // SAFETY: any data races are prevented by atomic intrinsics and the raw . // pointer passed in is valid because we got it from a reference. 140,282 ( 0.01%) unsafe { atomic_load(self.v.get().cast::(), order) != 0 } . } . . /// Stores a value into the bool. . /// . /// `store` takes an [`Ordering`] argument which describes the memory ordering . /// of this operation. Possible values are [`SeqCst`], [`Release`] and [`Relaxed`]. . /// . /// # Panics -- line 770 ---------------------------------------- -- line 3970 ---------------------------------------- . . #[inline] . #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces . #[rustc_const_unstable(feature = "const_atomic", issue = "160078")] . const unsafe fn atomic_store(dst: *mut T, val: T, order: Ordering) { . // SAFETY: the caller must uphold the safety contract for `atomic_store`. . unsafe { . match order { 2 ( 0.00%) Relaxed => intrinsics::atomic_store::(dst, val), . Release => intrinsics::atomic_store::(dst, val), . SeqCst => intrinsics::atomic_store::(dst, val), . Acquire => panic!("there is no such thing as an acquire store"), . AcqRel => panic!("there is no such thing as an acquire-release store"), . } . } . } . . #[inline] . #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces . #[rustc_const_unstable(feature = "const_atomic", issue = "160078")] . const unsafe fn atomic_load(dst: *const T, order: Ordering) -> T { . // SAFETY: the caller must uphold the safety contract for `atomic_load`. . unsafe { . match order { 138,686 ( 0.01%) Relaxed => intrinsics::atomic_load::(dst), 8,267 ( 0.00%) Acquire => intrinsics::atomic_load::(dst), . SeqCst => intrinsics::atomic_load::(dst), . Release => panic!("there is no such thing as a release load"), . AcqRel => panic!("there is no such thing as an acquire-release load"), . } . } . } . . #[inline] -- line 4003 ---------------------------------------- -- line 4005 ---------------------------------------- . #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces . #[rustc_const_unstable(feature = "const_atomic", issue = "160078")] . const unsafe fn atomic_swap(dst: *mut T, val: T, order: Ordering) -> T { . // SAFETY: the caller must uphold the safety contract for `atomic_swap`. . unsafe { . match order { . Relaxed => intrinsics::atomic_xchg::(dst, val), . Acquire => intrinsics::atomic_xchg::(dst, val), 62 ( 0.00%) Release => intrinsics::atomic_xchg::(dst, val), . AcqRel => intrinsics::atomic_xchg::(dst, val), . SeqCst => intrinsics::atomic_xchg::(dst, val), . } . } . } . . /// Returns the previous value (like __sync_fetch_and_add). . #[inline] . #[cfg(target_has_atomic)] . #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces . #[rustc_const_unstable(feature = "const_atomic", issue = "160078")] . const unsafe fn atomic_add(dst: *mut T, val: U, order: Ordering) -> T { . // SAFETY: the caller must uphold the safety contract for `atomic_add`. . unsafe { . match order { 537 ( 0.00%) Relaxed => intrinsics::atomic_xadd::(dst, val), . Acquire => intrinsics::atomic_xadd::(dst, val), . Release => intrinsics::atomic_xadd::(dst, val), . AcqRel => intrinsics::atomic_xadd::(dst, val), . SeqCst => intrinsics::atomic_xadd::(dst, val), . } . } . } . -- line 4037 ---------------------------------------- -- line 4041 ---------------------------------------- . #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces . #[rustc_const_unstable(feature = "const_atomic", issue = "160078")] . const unsafe fn atomic_sub(dst: *mut T, val: U, order: Ordering) -> T { . // SAFETY: the caller must uphold the safety contract for `atomic_sub`. . unsafe { . match order { . Relaxed => intrinsics::atomic_xsub::(dst, val), . Acquire => intrinsics::atomic_xsub::(dst, val), 97,453 ( 0.00%) Release => intrinsics::atomic_xsub::(dst, val), . AcqRel => intrinsics::atomic_xsub::(dst, val), . SeqCst => intrinsics::atomic_xsub::(dst, val), . } . } . } . . /// Publicly exposed for stdarch; nobody else should use this. . #[inline] -- line 4057 ---------------------------------------- -- line 4075 ---------------------------------------- . } . (Relaxed, Acquire) => { . intrinsics::atomic_cxchg::(dst, old, new) . } . (Relaxed, SeqCst) => { . intrinsics::atomic_cxchg::(dst, old, new) . } . (Acquire, Relaxed) => { 93 ( 0.00%) intrinsics::atomic_cxchg::(dst, old, new) . } . (Acquire, Acquire) => { . intrinsics::atomic_cxchg::(dst, old, new) . } . (Acquire, SeqCst) => { . intrinsics::atomic_cxchg::(dst, old, new) . } . (Release, Relaxed) => { -- line 4091 ---------------------------------------- 92 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/strings.rs -------------------------------------------------------------------------------- Ir -- line 278 ---------------------------------------- . } . } . } . . // Max length a b"foo" string can take . const MAX_LENGTH_BYTE_STRING_LIT: usize = 32; . . impl<'tcx> LateLintPass<'tcx> for StringLitAsBytes { 618,678 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { . use rustc_ast::LitKind; . 550,102 ( 0.03%) if let ExprKind::Call(fun, [bytes_arg]) = e.kind . // Find `std::str::converts::from_utf8` or `std::primitive::str::from_utf8` 459 ( 0.00%) && let Some(sym::str_from_utf8 | sym::str_inherent_from_utf8) = 166 ( 0.00%) fun.res(cx).opt_diag_name(cx) . . // Find string::as_bytes . && let ExprKind::AddrOf(BorrowKind::Ref, _, args) = bytes_arg.kind . && let ExprKind::Index(left, right, _) = args.kind . && let (method_names, expressions, _) = method_calls(left, 1) . && method_names == [sym::as_bytes] . && expressions.len() == 1 . && expressions[0].1.is_empty() -- line 300 ---------------------------------------- -- line 315 ---------------------------------------- . e.span, . "calling a slice of `as_bytes()` with `from_utf8` should be not necessary", . "try", . format!("Some(&{snippet_app}[{right_snip}])"), . applicability, . ); . } . 137,704 ( 0.01%) if !e.span.in_external_macro(cx.sess().source_map()) . && let ExprKind::MethodCall(path, receiver, ..) = &e.kind 220 ( 0.00%) && path.ident.name == sym::as_bytes . && let ExprKind::Lit(lit) = &receiver.kind . && let LitKind::Str(lit_content, _) = &lit.node . { . let callsite = snippet(cx, receiver.span.source_callsite(), r#""foo""#); . let mut applicability = Applicability::MachineApplicable; . if callsite.starts_with("include_str!") { . span_lint_and_sugg( . cx, -- line 333 ---------------------------------------- -- line 362 ---------------------------------------- . snippet_with_applicability(cx, receiver.span, r#""foo""#, &mut applicability) . ), . applicability, . ); . } . } . } . 68,962 ( 0.00%) if let ExprKind::MethodCall(path, recv, [], _) = &e.kind 156 ( 0.00%) && path.ident.name == sym::into_bytes . && let ExprKind::MethodCall(path, recv, [], _) = &recv.kind . && matches!(path.ident.name, sym::to_owned | sym::to_string) . && let ExprKind::Lit(lit) = &recv.kind . && let LitKind::Str(lit_content, _) = &lit.node . && lit_content.as_str().is_ascii() . && lit_content.as_str().len() <= MAX_LENGTH_BYTE_STRING_LIT . && !recv.span.from_expansion() . { -- line 379 ---------------------------------------- -- line 387 ---------------------------------------- . "consider using a byte string literal instead", . format!( . "b{}.to_vec()", . snippet_with_applicability(cx, recv.span, r#""..""#, &mut applicability) . ), . applicability, . ); . } 549,936 ( 0.03%) } . } . . impl<'tcx> LateLintPass<'tcx> for StrToString { . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &Expr<'_>) { . if expr.span.from_expansion() { . return; . } . -- line 403 ---------------------------------------- -- line 438 ---------------------------------------- . "str::to_owned".to_string(), . Applicability::MachineApplicable, . ); . } . } . } . . impl<'tcx> LateLintPass<'tcx> for TrimSplitWhitespace { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &Expr<'_>) { . let tyckres = cx.typeck_results(); 137,782 ( 0.01%) if let ExprKind::MethodCall(path, split_recv, [], split_ws_span) = expr.kind 78 ( 0.00%) && path.ident.name == sym::split_whitespace . && let Some(split_ws_def_id) = tyckres.type_dependent_def_id(expr.hir_id) . && cx.tcx.is_diagnostic_item(sym::str_split_whitespace, split_ws_def_id) . && let ExprKind::MethodCall(path, _trim_recv, [], trim_span) = split_recv.kind . && let trim_fn_name @ (sym::trim | sym::trim_start | sym::trim_end) = path.ident.name . && let Some(trim_def_id) = tyckres.type_dependent_def_id(split_recv.hir_id) . && is_one_of_trim_diagnostic_items(cx, trim_def_id) . { . span_lint_and_sugg( -- line 457 ---------------------------------------- -- line 459 ---------------------------------------- . TRIM_SPLIT_WHITESPACE, . trim_span.with_hi(split_ws_span.lo()), . format!("found call to `str::{trim_fn_name}` before `str::split_whitespace`"), . format!("remove `{trim_fn_name}()`"), . String::new(), . Applicability::MachineApplicable, . ); . } 549,936 ( 0.03%) } . } . . fn is_one_of_trim_diagnostic_items(cx: &LateContext<'_>, trim_def_id: DefId) -> bool { . matches!( . cx.tcx.get_diagnostic_name(trim_def_id), . Some(sym::str_trim | sym::str_trim_start | sym::str_trim_end) . ) . } -- line 475 ---------------------------------------- 68,908 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_utils/src/consts.rs -------------------------------------------------------------------------------- Ir -- line 75 ---------------------------------------- . fn ensure_fits(self, val: Self::Output) -> Option { . let (min, max) = self.min_max()?; . (min <= val && val <= max).then_some(val) . } . } . impl IntTypeBounds for UintTy { . type Output = u128; . fn min_max(self) -> Option<(Self::Output, Self::Output)> { 32 ( 0.00%) Some(match self { . UintTy::U8 => (u8::MIN.into(), u8::MAX.into()), . UintTy::U16 => (u16::MIN.into(), u16::MAX.into()), . UintTy::U32 => (u32::MIN.into(), u32::MAX.into()), . UintTy::U64 => (u64::MIN.into(), u64::MAX.into()), . UintTy::U128 => (u128::MIN, u128::MAX), . UintTy::Usize => (usize::MIN.try_into().ok()?, usize::MAX.try_into().ok()?), . }) . } . fn bits(self) -> Self::Output { 32 ( 0.00%) match self { . UintTy::U8 => 8, . UintTy::U16 => 16, . UintTy::U32 => 32, . UintTy::U64 => 64, . UintTy::U128 => 128, . UintTy::Usize => usize::BITS.into(), . } . } -- line 101 ---------------------------------------- -- line 120 ---------------------------------------- . IntTy::I64 => 64, . IntTy::I128 => 128, . IntTy::Isize => isize::BITS.into(), . } . } . } . . impl PartialEq for Constant { 72 ( 0.00%) fn eq(&self, other: &Self) -> bool { 90 ( 0.00%) match (self, other) { . (Self::Str(ls), Self::Str(rs)) => ls == rs, . (Self::Binary(l), Self::Binary(r)) => l == r, . (&Self::Char(l), &Self::Char(r)) => l == r, 24 ( 0.00%) (&Self::Int(l), &Self::Int(r)) => l == r, . (&Self::F64(l), &Self::F64(r)) => { . // `to_bits` is required to catch non-matching `0.0` and `-0.0`. . l.to_bits() == r.to_bits() && !l.is_nan() . }, . (&Self::F32(l), &Self::F32(r)) => { . // `to_bits` is required to catch non-matching `0.0` and `-0.0`. . l.to_bits() == r.to_bits() && !l.is_nan() . }, . (&Self::Bool(l), &Self::Bool(r)) => l == r, . (&Self::Vec(ref l), &Self::Vec(ref r)) | (&Self::Tuple(ref l), &Self::Tuple(ref r)) => l == r, . (Self::Repeat(lv, ls), Self::Repeat(rv, rs)) => ls == rs && lv == rv, . (Self::Ref(lb), Self::Ref(rb)) => *lb == *rb, . // TODO: are there inter-type equalities? . _ => false, . } 36 ( 0.00%) } . } . . impl Hash for Constant { 50 ( 0.00%) fn hash(&self, state: &mut H) . where . H: Hasher, . { . std::mem::discriminant(self).hash(state); 25 ( 0.00%) match *self { . Self::Adt(ref elem) => { . elem.hash(state); . }, . Self::Str(ref s) => { . s.hash(state); . }, . Self::Binary(ref b) => { . b.hash(state); -- line 166 ---------------------------------------- -- line 197 ---------------------------------------- . Self::RawPtr(u) => { . u.hash(state); . }, . Self::Ref(ref r) => { . r.hash(state); . }, . Self::Err => {}, . } 30 ( 0.00%) } . } . . impl Constant { 48 ( 0.00%) pub fn partial_cmp(tcx: TyCtxt<'_>, cmp_type: Ty<'_>, left: &Self, right: &Self) -> Option { 68 ( 0.00%) match (left, right) { . (Self::Str(ls), Self::Str(rs)) => Some(ls.cmp(rs)), . (Self::Char(l), Self::Char(r)) => Some(l.cmp(r)), 36 ( 0.00%) (&Self::Int(l), &Self::Int(r)) => match *cmp_type.kind() { . ty::Int(int_ty) => Some(sext(tcx, l, int_ty).cmp(&sext(tcx, r, int_ty))), . ty::Uint(_) => Some(l.cmp(&r)), . _ => bug!("Not an int type"), . }, . (&Self::F64(l), &Self::F64(r)) => l.partial_cmp(&r), . (&Self::F32(l), &Self::F32(r)) => l.partial_cmp(&r), . (Self::Bool(l), Self::Bool(r)) => Some(l.cmp(r)), . (Self::Tuple(l), Self::Tuple(r)) if l.len() == r.len() => match *cmp_type.kind() { -- line 221 ---------------------------------------- -- line 256 ---------------------------------------- . _ => return None, . }, . lb, . rb, . ), . // TODO: are there any useful inter-type orderings? . _ => None, . } 36 ( 0.00%) } . . /// Returns the integer value or `None` if `self` or `val_type` is not integer type. . pub fn int_value(&self, tcx: TyCtxt<'_>, val_type: Ty<'_>) -> Option { 8 ( 0.00%) if let Constant::Int(const_int) = *self { 20 ( 0.00%) match *val_type.kind() { . ty::Int(ity) => Some(FullInt::S(sext(tcx, const_int, ity))), 20 ( 0.00%) ty::Uint(_) => Some(FullInt::U(const_int)), . _ => None, . } . } else { . None . } . } . . #[must_use] 96 ( 0.00%) pub fn peel_refs(mut self) -> Self { 36 ( 0.00%) while let Constant::Ref(r) = self { . self = *r; . } 48 ( 0.00%) self 84 ( 0.00%) } . . fn parse_f16(s: &str) -> Self { . let f: Half = s.parse().unwrap(); . Self::F16(f.to_bits().try_into().unwrap()) . } . . fn parse_f128(s: &str) -> Self { . let f: Quad = s.parse().unwrap(); -- line 293 ---------------------------------------- -- line 410 ---------------------------------------- . Constant::F32(x) => x == f32::NEG_INFINITY, . Constant::F64(x) => x == f64::NEG_INFINITY, . _ => false, . } . } . } . . /// Parses a `LitKind` to a `Constant`. 672 ( 0.00%) pub fn lit_to_mir_constant(lit: &LitKind, ty: Option>) -> Constant { 480 ( 0.00%) match *lit { . LitKind::Str(ref is, _) => Constant::Str(is.to_string()), . LitKind::Byte(b) => Constant::Int(u128::from(b)), . LitKind::ByteStr(ref s, _) | LitKind::CStr(ref s, _) => Constant::Binary(s.as_byte_str().to_vec()), 110 ( 0.00%) LitKind::Char(c) => Constant::Char(c), 148 ( 0.00%) LitKind::Int(n, _) => Constant::Int(n.get()), . LitKind::Float(ref is, LitFloatType::Suffixed(fty)) => match fty { . // FIXME(f16_f128): just use `parse()` directly when available for `f16`/`f128` . FloatTy::F16 => Constant::parse_f16(is.as_str()), . FloatTy::F32 => Constant::F32(is.as_str().parse().unwrap()), . FloatTy::F64 => Constant::F64(is.as_str().parse().unwrap()), . FloatTy::F128 => Constant::parse_f128(is.as_str()), . }, . LitKind::Float(ref is, LitFloatType::Unsuffixed) => match ty.expect("type of float is known").kind() { -- line 432 ---------------------------------------- -- line 434 ---------------------------------------- . ty::Float(FloatTy::F32) => Constant::F32(is.as_str().parse().unwrap()), . ty::Float(FloatTy::F64) => Constant::F64(is.as_str().parse().unwrap()), . ty::Float(FloatTy::F128) => Constant::parse_f128(is.as_str()), . _ => bug!(), . }, . LitKind::Bool(b) => Constant::Bool(b), . LitKind::Err(_) => Constant::Err, . } 768 ( 0.00%) } . . /// The source of a constant value. . #[derive(Clone, Copy)] . pub enum ConstantSource { . /// The value is determined solely from the expression. . Local, . /// The value is dependent on another definition that may change independently from the local . /// expression. -- line 450 ---------------------------------------- -- line 493 ---------------------------------------- . (U(s), U(o)) => s.cmp(&o), . (S(s), U(o)) => cmp_s_u(s, o), . (U(s), S(o)) => cmp_s_u(o, s).reverse(), . } . } . } . . /// Evaluates an expression if it's a builtin integer type. 40 ( 0.00%) pub fn eval_int(cx: &LateContext<'_>, e: &Expr<'_>) -> Option { 20 ( 0.00%) match e.kind { . ExprKind::Lit(lit) if let LitKind::Int(val, _) = lit.node => Some(FullInt::U(val.0)), . ExprKind::Unary(UnOp::Neg, e) . if let ExprKind::Lit(lit) = e.kind . && let LitKind::Int(val, _) = lit.node => . { . Some(FullInt::S(val.0.cast_signed().wrapping_neg())) . }, 12 ( 0.00%) _ if let ty = cx.typeck_results().expr_ty(e) 160 ( 0.00%) => ???:::expr_ty (4x) 16 ( 0.00%) && let ty::Int(_) | ty::Uint(_) = *ty.kind() => . { 4 ( 0.00%) ConstEvalCtxt::new(cx).eval(e).and_then(|x| x.int_value(cx.tcx, ty)) 100 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:core::ptr::drop_glue:: (4x) . }, . _ => None, . } 36 ( 0.00%) } . . /// The context required to evaluate a constant expression. . /// . /// This is currently limited to constant folding and reading the value of named constants. . /// . /// See the module level documentation for some context. . pub struct ConstEvalCtxt<'tcx> { . pub tcx: TyCtxt<'tcx>, -- line 525 ---------------------------------------- -- line 527 ---------------------------------------- . pub typeck: &'tcx TypeckResults<'tcx>, . source: Cell, . ctxt: Cell, . } . . impl<'tcx> ConstEvalCtxt<'tcx> { . /// Creates the evaluation context from the lint context. This requires the lint context to be . /// in a body (i.e. `cx.enclosing_body.is_some()`). 1,116 ( 0.00%) pub fn new(cx: &LateContext<'tcx>) -> Self { 1,526 ( 0.00%) Self { 390 ( 0.00%) tcx: cx.tcx, 207 ( 0.00%) typing_env: cx.typing_env(), 120 ( 0.00%) => ???:::typing_env (4x) . typeck: cx.typeck_results(), . source: Cell::new(ConstantSource::Local), . ctxt: Cell::new(SyntaxContext::root()), . } 1,116 ( 0.00%) } . . /// Creates an evaluation context. . pub fn with_env(tcx: TyCtxt<'tcx>, typing_env: ty::TypingEnv<'tcx>, typeck: &'tcx TypeckResults<'tcx>) -> Self { 2,992 ( 0.00%) Self { . tcx, . typing_env, . typeck, . source: Cell::new(ConstantSource::Local), . ctxt: Cell::new(SyntaxContext::root()), . } . } . . /// Attempts to evaluate the expression and returns both the value and whether it's dependant on . /// other items. . pub fn eval_with_source(&self, e: &Expr<'_>, ctxt: SyntaxContext) -> Option<(Constant, ConstantSource)> { . self.source.set(ConstantSource::Local); . self.ctxt.set(ctxt); 1,137 ( 0.00%) self.expr(e).map(|c| (c, self.source.get())) 1,412 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:::expr (19x) . } . . /// Attempts to evaluate the expression. . pub fn eval(&self, e: &Expr<'_>) -> Option { 95 ( 0.00%) self.expr(e) 22,123 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:::expr (83x) . } . . /// Attempts to evaluate the expression without accessing other items. . /// . /// The context argument is the context used to view the evaluated expression. e.g. when . /// evaluating the argument in `f(m!(1))` the context of the call expression should be used. . /// This is need so the const evaluator can see the `m` macro and marke the evaluation as . /// non-local independant of what the macro expands to. 545 ( 0.00%) pub fn eval_local(&self, e: &Expr<'_>, ctxt: SyntaxContext) -> Option { 801 ( 0.00%) match self.eval_with_source(e, ctxt) { 297 ( 0.00%) Some((x, ConstantSource::Local)) => Some(x), 297 ( 0.00%) _ => None, 602 ( 0.00%) } 475 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:core::ptr::drop_glue:: (19x) 545 ( 0.00%) } . . /// Attempts to evaluate the expression as an integer without accessing other items. . /// . /// The context argument is the context used to view the evaluated expression. e.g. when . /// evaluating the argument in `f(m!(1))` the context of the call expression should be used. . /// This is need so the const evaluator can see the `m` macro and marke the evaluation as . /// non-local independant of what the macro expands to. 80 ( 0.00%) pub fn eval_full_int(&self, e: &Expr<'_>, ctxt: SyntaxContext) -> Option { 28 ( 0.00%) match self.eval_with_source(e, ctxt) { . Some((x, ConstantSource::Local)) => x.int_value(self.tcx, self.typeck.expr_ty(e)), 16 ( 0.00%) _ => None, 8 ( 0.00%) } 72 ( 0.00%) } . . pub fn eval_pat_expr(&self, pat_expr: &PatExpr<'_>) -> Option { . match &pat_expr.kind { . PatExprKind::Lit { lit, negated } => { . let ty = self.typeck.node_type_opt(pat_expr.hir_id); . let val = lit_to_mir_constant(&lit.node, ty); . if *negated { . self.constant_negate(&val, ty?) -- line 601 ---------------------------------------- -- line 603 ---------------------------------------- . Some(val) . } . }, . PatExprKind::Path(qpath) => self.qpath(qpath, pat_expr.hir_id), . } . } . . fn check_ctxt(&self, ctxt: SyntaxContext) { 1,023 ( 0.00%) if self.ctxt.get() != ctxt { . self.source.set(ConstantSource::NonLocal); . } . } . 4,100 ( 0.00%) fn qpath(&self, qpath: &QPath<'_>, hir_id: HirId) -> Option { . self.fetch_path(qpath, hir_id) 850 ( 0.00%) .and_then(|c| mir_to_const(self.tcx, c, self.typeck.node_type(hir_id))) 3,633 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:clippy_utils::consts::mir_to_const (85x) 3,485 ( 0.00%) => ???:::node_type (85x) 3,280 ( 0.00%) } . . /// Simple constant folding: Insert an expression, get a constant or none. 12,082 ( 0.00%) fn expr(&self, e: &Expr<'_>) -> Option { 863 ( 0.00%) self.check_ctxt(e.span.ctxt()); 5,178 ( 0.00%) match e.kind { . ExprKind::ConstBlock(ConstBlock { body, .. }) => self.expr(self.tcx.hir_body(body).value), . ExprKind::DropTemps(e) => self.expr(e), 2,870 ( 0.00%) ExprKind::Path(ref qpath) => self.qpath(qpath, e.hir_id), 119,356 ( 0.01%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:::qpath (319x) . ExprKind::Block(block, _) => { . self.check_ctxt(block.span.ctxt()); . self.block(block) . }, 384 ( 0.00%) ExprKind::Lit(lit) => { 96 ( 0.00%) self.check_ctxt(lit.span.ctxt()); 672 ( 0.00%) Some(lit_to_mir_constant(&lit.node, self.typeck.expr_ty_opt(e))) 3,744 ( 0.00%) => ???:::expr_ty_opt (96x) 2,422 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:clippy_utils::consts::lit_to_mir_constant (96x) . }, . ExprKind::Array(vec) => self.multi(vec).map(Constant::Vec), 2 ( 0.00%) ExprKind::Tup(tup) => self.multi(tup).map(Constant::Tuple), . ExprKind::Repeat(value, _) => { . let n = match self.typeck.expr_ty(e).kind() { . ty::Array(_, n) => n.try_to_target_usize(self.tcx)?, . _ => span_bug!(e.span, "typeck error"), . }; . self.expr(value).map(|v| Constant::Repeat(Box::new(v), n)) . }, . ExprKind::Unary(op, operand) => self.expr(operand).and_then(|o| match op { . UnOp::Not => self.constant_not(&o, self.typeck.expr_ty(e)), . UnOp::Neg => self.constant_negate(&o, self.typeck.expr_ty(e)), . UnOp::Deref => Some(if let Constant::Ref(r) = o { *r } else { o }), . }), . ExprKind::If(cond, then, ref otherwise) => self.ifthenelse(cond, then, *otherwise), 192 ( 0.00%) ExprKind::Binary(op, left, right) => { . self.check_ctxt(e.span.ctxt()); . self.binop(op.node, left, right) . }, 116 ( 0.00%) ExprKind::Call(callee, []) => { . // We only handle a few const functions for now. . if let ExprKind::Path(qpath) = &callee.kind . && let Some(did) = self.typeck.qpath_res(qpath, callee.hir_id).opt_def_id() . { . match self.tcx.get_diagnostic_name(did) { . Some(sym::i8_legacy_fn_max_value) => Some(Constant::Int(i8::MAX as u128)), . Some(sym::i16_legacy_fn_max_value) => Some(Constant::Int(i16::MAX as u128)), . Some(sym::i32_legacy_fn_max_value) => Some(Constant::Int(i32::MAX as u128)), -- line 663 ---------------------------------------- -- line 664 ---------------------------------------- . Some(sym::i64_legacy_fn_max_value) => Some(Constant::Int(i64::MAX as u128)), . Some(sym::i128_legacy_fn_max_value) => Some(Constant::Int(i128::MAX as u128)), . _ => None, . } . } else { . None . } . }, 24 ( 0.00%) ExprKind::Index(arr, index, _) => self.index(arr, index), . ExprKind::AddrOf(_, _, inner) => self.expr(inner).map(|r| Constant::Ref(Box::new(r))), . ExprKind::Field(base, ref field) 936 ( 0.00%) if let base_ty = self.typeck.expr_ty(base) 4,680 ( 0.00%) => ???:::expr_ty (117x) 729 ( 0.00%) && match self.typeck.expr_adjustments(base) { 4,707 ( 0.00%) => ???:::expr_adjustments (117x) 312 ( 0.00%) [] => true, . [.., a] => a.target == base_ty, . } 255 ( 0.00%) && let Some(Constant::Adt(constant)) = self.expr(base) 7,156 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:::expr'2 (50x) . && let ty::Adt(adt_def, _) = *base_ty.kind() . && adt_def.is_struct() . && let Some((desired_field, ty)) = . field_of_struct(adt_def, self.tcx, constant, base_ty, field.name) => . { . self.check_ctxt(field.span.ctxt()); . mir_to_const(self.tcx, desired_field, ty) . }, . _ => None, . } 7,937 ( 0.00%) } . . /// Simple constant folding to determine if an expression is an empty slice, str, array, … . /// `None` will be returned if the constness cannot be determined, or if the resolution . /// leaves the local crate. 11 ( 0.00%) pub fn eval_is_empty(&self, e: &Expr<'_>) -> Option { 6 ( 0.00%) match e.kind { . ExprKind::ConstBlock(ConstBlock { body, .. }) => self.eval_is_empty(self.tcx.hir_body(body).value), . ExprKind::DropTemps(e) => self.eval_is_empty(e), . ExprKind::Lit(lit) => { . if is_direct_expn_of(e.span, sym::cfg).is_some() { . None . } else { . match &lit.node { . LitKind::Str(is, _) => Some(is.is_empty()), -- line 705 ---------------------------------------- -- line 713 ---------------------------------------- . if let ty::Array(_, n) = self.typeck.expr_ty(e).kind() { . Some(n.try_to_target_usize(self.tcx)? == 0) . } else { . span_bug!(e.span, "typeck error"); . } . }, . _ => None, . } 7 ( 0.00%) } . . #[expect(clippy::cast_possible_wrap)] . fn constant_not(&self, o: &Constant, ty: Ty<'_>) -> Option { . use self::Constant::{Bool, Int}; . match *o { . Bool(b) => Some(Bool(!b)), . Int(value) => { . let value = !value; -- line 729 ---------------------------------------- -- line 759 ---------------------------------------- . F64(f) => Some(F64(-f)), . _ => None, . } . } . . /// Create `Some(Vec![..])` of all constants, unless there is any . /// non-constant part. . fn multi(&self, vec: &[Expr<'_>]) -> Option> { 4 ( 0.00%) vec.iter().map(|elem| self.expr(elem)).collect::>() 144 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:::expr'2 (1x) . } . . /// Lookup a possibly constant expression from an `ExprKind::Path` and apply a function on it. . #[expect(clippy::too_many_lines)] . fn fetch_path(&self, qpath: &QPath<'_>, id: HirId) -> Option { . // Resolve the path to a constant and check if that constant is known to . // not change based on the target. . // . // This should be replaced with an attribute at some point. 1,640 ( 0.00%) let did = match *qpath { . QPath::Resolved(None, path) 1,230 ( 0.00%) if path.span.ctxt() == self.ctxt.get() 410 ( 0.00%) && path.segments.iter().all(|s| self.ctxt.get() == s.ident.span.ctxt()) 1,228 ( 0.00%) && let Res::Def(DefKind::Const { .. }, did) = path.res 510 ( 0.00%) && (matches!( 340 ( 0.00%) self.tcx.get_diagnostic_name(did), 3,655 ( 0.00%) => ???:::get_diagnostic_name (85x) . Some( . sym::f32_legacy_const_digits . | sym::f32_legacy_const_epsilon . | sym::f32_legacy_const_infinity . | sym::f32_legacy_const_mantissa_dig . | sym::f32_legacy_const_max . | sym::f32_legacy_const_max_10_exp . | sym::f32_legacy_const_max_exp -- line 791 ---------------------------------------- -- line 827 ---------------------------------------- . | sym::i64_legacy_const_min . | sym::i128_legacy_const_min . | sym::i8_legacy_const_max . | sym::i16_legacy_const_max . | sym::i32_legacy_const_max . | sym::i64_legacy_const_max . | sym::i128_legacy_const_max . ) 85 ( 0.00%) ) || self.tcx.opt_parent(did).is_some_and(|parent| { 255 ( 0.00%) matches!( . parent.opt_diag_name(&self.tcx), . Some( . sym::f16_consts_mod | sym::f32_consts_mod | sym::f64_consts_mod | sym::f128_consts_mod . ) . ) . })) => . { . did -- line 844 ---------------------------------------- -- line 869 ---------------------------------------- . && let Some((DefKind::AssocConst { .. }, did)) = self.typeck.type_dependent_def(id) . && self.tcx.inherent_impl_of_assoc(did).is_some() => . { . did . }, . // TODO: revisit when feature `min_generic_const_args` is stabilized. In the meantime, . // `TyCtxt::const_eval_resolve()` will trigger an ICE when evaluating the body of the . // `type const` definition. 1,330 ( 0.00%) _ if let Res::Def( . DefKind::Const { is_type_const: false } | DefKind::AssocConst { is_type_const: false }, 170 ( 0.00%) did, 3,055 ( 0.00%) ) = self.typeck.qpath_res(qpath, id) => 6,150 ( 0.00%) => ???:::qpath_res (410x) . { . self.source.set(ConstantSource::NonLocal); . did . }, . _ => return None, . }; . 510 ( 0.00%) let args = self.typeck.node_args(id); 1,814 ( 0.00%) => ???:::node_args (85x) . 170 ( 0.00%) if !args.is_empty() { . let owner_def_id = self.typeck.hir_owner.def_id.to_def_id(); . let identity_args = ty::GenericArgs::identity_for_item(self.tcx, owner_def_id); . // Don't try to fully evaluate consts inside code whose bounds can't be satisfied. . if self . .tcx . .instantiate_and_check_impossible_clauses((owner_def_id, identity_args)) . { . return None; . } . } . 85 ( 0.00%) self.tcx 680 ( 0.00%) .const_eval_resolve(self.typing_env, mir::UnevaluatedConst::new(did, args), qpath.span()) 79,868 ( 0.00%) => ???:::const_eval_resolve (85x) 425 ( 0.00%) => ???:::span (85x) . .ok() . } . . fn index(&self, lhs: &'_ Expr<'_>, index: &'_ Expr<'_>) -> Option { 36 ( 0.00%) let lhs = self.expr(lhs); 1,704 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:::expr'2 (12x) 36 ( 0.00%) let index = self.expr(index); 2,304 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:::expr'2 (12x) . 156 ( 0.00%) match (lhs, index) { . (Some(Constant::Vec(vec)), Some(Constant::Int(index))) => match vec.get(index as usize) { . Some(Constant::F16(x)) => Some(Constant::F16(*x)), . Some(Constant::F32(x)) => Some(Constant::F32(*x)), . Some(Constant::F64(x)) => Some(Constant::F64(*x)), . Some(Constant::F128(x)) => Some(Constant::F128(*x)), . _ => None, . }, . (Some(Constant::Vec(vec)), _) => { -- line 919 ---------------------------------------- -- line 924 ---------------------------------------- . Some(Constant::F64(x)) => Some(Constant::F64(*x)), . Some(Constant::F128(x)) => Some(Constant::F128(*x)), . _ => None, . } . } else { . None . } . }, 12 ( 0.00%) _ => None, . } . } . . /// A block can only yield a constant if it has exactly one constant expression. . fn block(&self, block: &Block<'_>) -> Option { . if block.stmts.is_empty() . && let Some(expr) = block.expr . { -- line 940 ---------------------------------------- -- line 976 ---------------------------------------- . } . } else { . None . } . } . . #[expect(clippy::too_many_lines)] . fn binop(&self, op: BinOpKind, left: &Expr<'_>, right: &Expr<'_>) -> Option { 320 ( 0.00%) let l = self.expr(left)?; 18,399 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:::expr'2 (51x) 27 ( 0.00%) let r = self.expr(right); 8,328 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:::expr'2 (9x) 213 ( 0.00%) match (l, r) { 104 ( 0.00%) (Constant::Int(l), Some(Constant::Int(r))) => match *self.typeck.expr_ty_opt(left)?.kind() { 312 ( 0.00%) => ???:::expr_ty_opt (8x) . ty::Int(ity) => { . let (ty_min_value, _) = ity.min_max()?; . let bits = ity.bits(); . let l = sext(self.tcx, l, ity); . let r = sext(self.tcx, r, ity); . . // Using / or %, where the left-hand argument is the smallest integer of a signed integer type and . // the right-hand argument is -1 always panics, even with overflow-checks disabled -- line 995 ---------------------------------------- -- line 1021 ---------------------------------------- . BinOpKind::Ne => Some(Constant::Bool(l != r)), . BinOpKind::Lt => Some(Constant::Bool(l < r)), . BinOpKind::Le => Some(Constant::Bool(l <= r)), . BinOpKind::Ge => Some(Constant::Bool(l >= r)), . BinOpKind::Gt => Some(Constant::Bool(l > r)), . _ => None, . } . }, 8 ( 0.00%) ty::Uint(ity) => { . let bits = ity.bits(); 72 ( 0.00%) let mask = !0u128 >> (128 - bits); . 40 ( 0.00%) match op { . BinOpKind::Add => l.checked_add(r).and_then(|n| ity.ensure_fits(n)).map(Constant::Int), . BinOpKind::Sub => l.checked_sub(r).and_then(|n| ity.ensure_fits(n)).map(Constant::Int), . BinOpKind::Mul => l.checked_mul(r).and_then(|n| ity.ensure_fits(n)).map(Constant::Int), . BinOpKind::Div => l.checked_div(r).map(Constant::Int), . BinOpKind::Rem => l.checked_rem(r).map(Constant::Int), . BinOpKind::Shr if r < bits => { . l.checked_shr(r.try_into().ok()?).map(|x| Constant::Int(x & mask)) . }, -- line 1041 ---------------------------------------- -- line 1080 ---------------------------------------- . BinOpKind::Eq => Some(Constant::Bool(l == r)), . BinOpKind::Ne => Some(Constant::Bool(l != r)), . BinOpKind::Lt => Some(Constant::Bool(l < r)), . BinOpKind::Le => Some(Constant::Bool(l <= r)), . BinOpKind::Ge => Some(Constant::Bool(l >= r)), . BinOpKind::Gt => Some(Constant::Bool(l > r)), . _ => None, . }, 13 ( 0.00%) (l, r) => match (op, l, r) { . (BinOpKind::And, Constant::Bool(false), _) => Some(Constant::Bool(false)), . (BinOpKind::Or, Constant::Bool(true), _) => Some(Constant::Bool(true)), . (BinOpKind::And, Constant::Bool(true), Some(r)) | (BinOpKind::Or, Constant::Bool(false), Some(r)) => { . Some(r) . }, . (BinOpKind::BitXor, Constant::Bool(l), Some(Constant::Bool(r))) => Some(Constant::Bool(l ^ r)), . (BinOpKind::BitAnd, Constant::Bool(l), Some(Constant::Bool(r))) => Some(Constant::Bool(l & r)), . (BinOpKind::BitOr, Constant::Bool(l), Some(Constant::Bool(r))) => Some(Constant::Bool(l | r)), 1 ( 0.00%) _ => None, 3 ( 0.00%) }, 25 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:core::ptr::drop_glue:: (1x) 16 ( 0.00%) } 200 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mod.rs:core::ptr::drop_glue:: (8x) . } . } . 765 ( 0.00%) pub fn mir_to_const<'tcx>(tcx: TyCtxt<'tcx>, val: ConstValue, ty: Ty<'tcx>) -> Option { 684 ( 0.00%) match (val, ty.kind()) { . (_, &ty::Adt(adt_def, _)) if adt_def.is_struct() => Some(Constant::Adt(val)), 415 ( 0.00%) (ConstValue::Scalar(Scalar::Int(int)), _) => match ty.kind() { . ty::Bool => Some(Constant::Bool(int == ScalarInt::TRUE)), 332 ( 0.00%) ty::Uint(_) | ty::Int(_) => Some(Constant::Int(int.to_bits(int.size()))), . ty::Float(FloatTy::F16) => Some(Constant::F16(int.into())), . ty::Float(FloatTy::F32) => Some(Constant::F32(f32::from_bits(int.into()))), . ty::Float(FloatTy::F64) => Some(Constant::F64(f64::from_bits(int.into()))), . ty::Float(FloatTy::F128) => Some(Constant::F128(int.into())), . ty::RawPtr(_, _) => Some(Constant::RawPtr(int.to_bits(int.size()))), . _ => None, . }, 6 ( 0.00%) (_, ty::Ref(_, inner_ty, _)) if matches!(inner_ty.kind(), ty::Str) => { . let data = val.try_get_slice_bytes_for_diagnostics(tcx)?; . String::from_utf8(data.to_owned()).ok().map(Constant::Str) . }, . (ConstValue::Indirect { alloc_id, offset }, ty::Array(sub_type, len)) => { . let alloc = tcx.global_alloc(alloc_id).unwrap_memory().inner(); . let len = len.try_to_target_usize(tcx)?; . let ty::Float(flt) = sub_type.kind() else { . return None; -- line 1124 ---------------------------------------- -- line 1134 ---------------------------------------- . FloatTy::F64 => Constant::F64(f64::from_bits(val.to_u64().discard_err()?)), . FloatTy::F128 => Constant::F128(val.to_u128().discard_err()?), . }); . } . Some(Constant::Vec(res)) . }, . _ => None, . } 765 ( 0.00%) } . . fn field_of_struct<'tcx>( . adt_def: ty::AdtDef<'tcx>, . tcx: TyCtxt<'tcx>, . value: ConstValue, . ty: Ty<'tcx>, . field: Symbol, . ) -> Option<(ConstValue, Ty<'tcx>)> { -- line 1150 ---------------------------------------- -- line 1160 ---------------------------------------- . } . . /// If `expr` evaluates to an integer constant, return its value. . /// . /// The context argument is the context used to view the evaluated expression. e.g. when evaluating . /// the argument in `f(m!(1))` the context of the call expression should be used. This is need so . /// the const evaluator can see the `m` macro and marke the evaluation as non-local independant of . /// what the macro expands to. 10 ( 0.00%) pub fn integer_const(cx: &LateContext<'_>, expr: &Expr<'_>, ctxt: SyntaxContext) -> Option { 7 ( 0.00%) if let Some(Constant::Int(value)) = ConstEvalCtxt::new(cx).eval_local(expr, ctxt) { 3 ( 0.00%) Some(value) . } else { . None . } 8 ( 0.00%) } . . /// Check if `expr` evaluates to an integer constant of 0. . /// . /// The context argument is the context used to view the evaluated expression. e.g. when evaluating . /// the argument in `f(m!(1))` the context of the call expression should be used. This is need so . /// the const evaluator can see the `m` macro and marke the evaluation as non-local independant of . /// what the macro expands to. . #[inline] . pub fn is_zero_integer_const(cx: &LateContext<'_>, expr: &Expr<'_>, ctxt: SyntaxContext) -> bool { 3 ( 0.00%) integer_const(cx, expr, ctxt) == Some(0) 259 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:clippy_utils::consts::integer_const (1x) . } . . pub fn const_item_rhs_to_expr<'tcx>(tcx: TyCtxt<'tcx>, ct_rhs: ConstItemRhs<'tcx>) -> Option<&'tcx Expr<'tcx>> { . match ct_rhs { . ConstItemRhs::Body(body_id) => Some(tcx.hir_body(body_id).value), . ConstItemRhs::TypeConst(const_arg) => match const_arg.kind { . ConstArgKind::Anon(anon) => Some(tcx.hir_body(anon.body).value), . ConstArgKind::Struct(..) -- line 1192 ---------------------------------------- 8,693 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_clamp.rs -------------------------------------------------------------------------------- Ir -- line 134 ---------------------------------------- . struct InputMinMax<'tcx> { . input: &'tcx Expr<'tcx>, . min: &'tcx Expr<'tcx>, . max: &'tcx Expr<'tcx>, . is_float: bool, . } . . impl<'tcx> LateLintPass<'tcx> for ManualClamp { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { . // Cheap kind check before the costlier const context query. 68,742 ( 0.00%) if matches!( 137,484 ( 0.01%) expr.kind, . ExprKind::If(..) | ExprKind::Match(..) | ExprKind::MethodCall(..) | ExprKind::Call(..) 772 ( 0.00%) ) && !expr.span.from_expansion() 1,300 ( 0.00%) && !is_in_const_context(cx) 87,442 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_const_context (325x) . { . let suggestion = is_if_elseif_else_pattern(cx, expr) 612 ( 0.00%) .or_else(|| is_max_min_pattern(cx, expr)) . .or_else(|| is_call_max_min_pattern(cx, expr)) . .or_else(|| is_match_pattern(cx, expr)) . .or_else(|| is_if_elseif_pattern(cx, expr)); . if let Some(suggestion) = suggestion . && self.msrv.meets(cx, msrvs::CLAMP) . { . maybe_emit_suggestion(cx, &suggestion); . } . } 549,936 ( 0.03%) } . 1,204 ( 0.00%) fn check_block(&mut self, cx: &LateContext<'tcx>, block: &'tcx Block<'tcx>) { . // Cheap `if`-statement check before the costlier const context query. 172 ( 0.00%) if !block . .stmts . .iter() 310 ( 0.00%) .any(|stmt| matches!(stmt.kind, StmtKind::Expr(e) if matches!(e.kind, ExprKind::If(..)))) . { . return; . } . 121 ( 0.00%) if is_in_const_context(cx) || !self.msrv.meets(cx, msrvs::CLAMP) { 2,951 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_const_context (11x) 297 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (11x) . return; . } . for suggestion in is_two_if_pattern(cx, block) { . maybe_emit_suggestion(cx, &suggestion); . } 1,376 ( 0.00%) } . } . . fn maybe_emit_suggestion<'tcx>(cx: &LateContext<'tcx>, suggestion: &ClampSuggestion<'tcx>) { . if !suggestion.min_less_than_max(cx) { . return; . } . let ClampSuggestion { . params: InputMinMax { -- line 187 ---------------------------------------- -- line 302 ---------------------------------------- . /// . /// ```no_run . /// # let (input, min_value, max_value) = (0, -3, 12); . /// . /// input.max(min_value).min(max_value) . /// # ; . /// ``` . fn is_max_min_pattern<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) -> Option> { 864 ( 0.00%) if let ExprKind::MethodCall(seg_second, receiver, [arg_second], _) = expr.kind 81 ( 0.00%) && let ExprKind::MethodCall(seg_first, input, [arg_first], _) = &receiver.kind . // Match method names before the costlier type queries. 3 ( 0.00%) && let Some((min, max)) = match (seg_first.ident.name, seg_second.ident.name) { 4 ( 0.00%) (sym::min, sym::max) => Some((arg_second, arg_first)), . (sym::max, sym::min) => Some((arg_first, arg_second)), . _ => None, . } . && (cx.typeck_results().expr_ty_adjusted(receiver).is_floating_point() . || cx.ty_based_def(expr).assoc_fn_parent(cx).is_diag_item(cx, sym::Ord)) . && (cx.typeck_results().expr_ty_adjusted(input).is_floating_point() . || cx.ty_based_def(receiver).assoc_fn_parent(cx).is_diag_item(cx, sym::Ord)) . { -- line 322 ---------------------------------------- -- line 367 ---------------------------------------- . } . . enum FunctionType<'tcx> { . CmpMin, . CmpMax, . OrdOrFloat(&'tcx PathSegment<'tcx>), . } . 162 ( 0.00%) fn check<'tcx>( . cx: &LateContext<'tcx>, . outer_fn: &'tcx Expr<'tcx>, . inner_call: &'tcx Expr<'tcx>, . outer_arg: &'tcx Expr<'tcx>, . span: Span, . ) -> Option> { 36 ( 0.00%) if let ExprKind::Call(inner_fn, [first, second]) = &inner_call.kind . && let Some(inner_seg) = segment(cx, inner_fn) . && let Some(outer_seg) = segment(cx, outer_fn) . { . let typeck = cx.typeck_results(); . let (input, inner_arg) = match ( . is_const_evaluatable(cx.tcx, typeck, first), . is_const_evaluatable(cx.tcx, typeck, second), . ) { -- line 390 ---------------------------------------- -- line 412 ---------------------------------------- . max, . is_float, . }, . span, . make_assignment: None, . hir_with_ignore_attr: None, . }) . } else { 18 ( 0.00%) None . } 144 ( 0.00%) } . 2,210 ( 0.00%) if let ExprKind::Call(outer_fn, [first, second]) = &expr.kind { 171 ( 0.00%) check(cx, outer_fn, first, second, expr.span).or_else(|| check(cx, outer_fn, second, first, expr.span)) 360 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_clamp.rs:clippy_lints::manual_clamp::is_call_max_min_pattern::check (18x) . } else { . None . } . } . . /// Targets patterns like . /// . /// ```no_run -- line 433 ---------------------------------------- -- line 436 ---------------------------------------- . /// match input { . /// input if input > max => max, . /// input if input < min => min, . /// input => input, . /// } . /// # ; . /// ``` . fn is_match_pattern<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) -> Option> { 618 ( 0.00%) if let ExprKind::Match(value, [first_arm, second_arm, last_arm], rustc_hir::MatchSource::Normal) = &expr.kind { . // Find possible min/max branches . let minmax_values = |a: &'tcx Arm<'tcx>| { 30 ( 0.00%) if let PatKind::Binding(_, var_hir_id, _, None) = &a.pat.kind . && let Some(e) = a.guard . { . Some((e, var_hir_id, a.body)) . } else { . None . } . }; . let (first, first_hir_id, first_expr) = minmax_values(first_arm)?; -- line 455 ---------------------------------------- 199,897 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs -------------------------------------------------------------------------------- Ir -- line 11 ---------------------------------------- . use rustc_errors::{Applicability, Diag, DiagCtxtHandle, DiagMessage, Diagnostic, Level, MultiSpan}; . #[cfg(debug_assertions)] . use rustc_errors::{EmissionGuarantee, SubstitutionPart, Suggestions}; . use rustc_hir::HirId; . use rustc_lint::{LateContext, Lint, LintContext}; . use rustc_span::Span; . use std::env; . 5 ( 0.00%) fn docs_link(diag: &mut Diag<'_, ()>, lint: &'static Lint) { 2 ( 0.00%) if env::var("CLIPPY_DISABLE_DOCS_LINKS").is_err() 4 ( 0.00%) && let Some(lint) = lint.name_lower().strip_prefix("clippy::") 114 ( 0.00%) => ???:::name_lower (1x) . { 6 ( 0.00%) diag.help(format!( . "for further information visit https://rust-lang.github.io/rust-clippy/{}/index.html#{lint}", . match option_env!("CFG_RELEASE_CHANNEL") { . // Clippy version is 0.1.xx . // . // Always use .0 because we do not generate separate lint doc pages for rust patch releases . Some("stable") => concat!("rust-1.", env!("CARGO_PKG_VERSION_PATCH"), ".0"), . Some("beta") => "beta", 3 ( 0.00%) _ => "main", . } . )); . } 4 ( 0.00%) } . . /// Makes sure that a diagnostic is well formed. . /// . /// rustc debug asserts a few properties about spans, . /// but the clippy repo uses a distributed rustc build with debug assertions disabled, . /// so this has historically led to problems during subtree syncs where those debug assertions . /// only started triggered there. . /// -- line 43 ---------------------------------------- -- line 99 ---------------------------------------- . /// error: usage of mem::forget on Drop type . /// --> tests/ui/mem_forget.rs:17:5 . /// | . /// 17 | std::mem::forget(seven); . /// | ^^^^^^^^^^^^^^^^^^^^^^^ . /// ``` . #[track_caller] . pub fn span_lint(cx: &T, lint: &'static Lint, sp: impl Into, msg: impl Into) { 78 ( 0.00%) span_lint_and_then(cx, lint, sp, msg, |_| {}); 7,627 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then::::{closure#0}> (6x) . } . . /// Same as [`span_lint`] but with an extra `help` message. . /// . /// Use this if you want to provide some general help but . /// can't provide a specific machine applicable suggestion. . /// . /// The `help` message can be optionally attached to a `Span`. -- line 115 ---------------------------------------- -- line 228 ---------------------------------------- . /// `LintPass::check_*` function, consider using [`span_lint_hir_and_then`] instead. . /// This is needed for `#[allow]` and `#[expect]` attributes to work on the node . /// highlighted in the displayed warning. . /// . /// If you're unsure which function you should use, you can test if the `#[expect]` attribute works . /// where you would expect it to. . /// If it doesn't, you likely need to use [`span_lint_hir_and_then`] instead. . #[track_caller] 42,659 ( 0.00%) pub fn span_lint_and_then(cx: &C, lint: &'static Lint, sp: S, msg: M, f: F) . where . C: LintContext, . S: Into, . M: Into, . F: FnOnce(&mut Diag<'_, ()>), . { . struct ClippyDiag)>(F); . . impl<'a, F: FnOnce(&mut Diag<'_, ()>)> Diagnostic<'a, ()> for ClippyDiag { 13 ( 0.00%) fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, ()> { . let mut lint = Diag::new(dcx, level, ""); . (self.0)(&mut lint); 4 ( 0.00%) lint 9 ( 0.00%) } . } . . let sp = sp.into(); . #[expect(clippy::disallowed_methods)] 3,113 ( 0.00%) cx.emit_span_lint( 2,012 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint/src/context.rs:::emit_span_lint::::{closure#0}>> (2x) . lint, . sp.clone(), 61,104 ( 0.00%) ClippyDiag(|diag: &mut Diag<'_, ()>| { 2 ( 0.00%) diag.primary_message(msg); 2 ( 0.00%) diag.span(sp); 43 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_errors/src/diagnostic.rs:>::span:: (1x) 4 ( 0.00%) f(diag); 4 ( 0.00%) docs_link(diag, lint); 2,790 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::docs_link (1x) . . #[cfg(debug_assertions)] . validate_diag(diag); . }), . ); 24,384 ( 0.00%) } . . /// Like [`span_lint`], but emits the lint at the node identified by the given `HirId`. . /// . /// This is in contrast to [`span_lint`], which always emits the lint at the node that was last . /// passed to the `LintPass::check_*` function. . /// . /// The `HirId` is used for checking lint level attributes and to fulfill lint expectations defined . /// via the `#[expect]` attribute. -- line 276 ---------------------------------------- -- line 288 ---------------------------------------- . /// will not work! . /// Even though that is where the warning points at, which would be confusing to users. . /// . /// Instead, use this function and also pass the `HirId` of ``, which will let . /// the compiler check lint level attributes at the place of the expression and . /// the `#[allow]` will work. . #[track_caller] . pub fn span_lint_hir(cx: &LateContext<'_>, lint: &'static Lint, hir_id: HirId, sp: Span, msg: impl Into) { 1 ( 0.00%) span_lint_hir_and_then(cx, lint, hir_id, sp, msg, |_| {}); . } . . /// Like [`span_lint_and_then`], but emits the lint at the node identified by the given `HirId`. . /// . /// This is in contrast to [`span_lint_and_then`], which always emits the lint at the node that was . /// last passed to the `LintPass::check_*` function. . /// . /// The `HirId` is used for checking lint level attributes and to fulfill lint expectations defined -- line 304 ---------------------------------------- -- line 329 ---------------------------------------- . msg: impl Into, . f: impl FnOnce(&mut Diag<'_, ()>), . ) { . #[expect(clippy::disallowed_methods)] . cx.tcx.emit_node_span_lint( . lint, . hir_id, . sp, 5 ( 0.00%) rustc_errors::DiagDecorator(|diag| { . diag.primary_message(msg); . f(diag); . docs_link(diag, lint); . . #[cfg(debug_assertions)] . validate_diag(diag); . }), . ); -- line 345 ---------------------------------------- -- line 374 ---------------------------------------- . /// --> tests/ui/methods.rs:390:13 . /// | . /// 390 | let _ = (0..3).fold(false, |acc, x| acc || x > 2); . /// | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ help: try: `.any(|x| x > 2)` . /// | . /// = note: `-D fold-any` implied by `-D warnings` . /// ``` . #[track_caller] 42 ( 0.00%) pub fn span_lint_and_sugg( . cx: &T, . lint: &'static Lint, . sp: Span, . msg: impl Into, . help: impl Into, . sugg: String, . applicability: Applicability, . ) { 15 ( 0.00%) span_lint_and_then(cx, lint, sp, msg.into(), |diag| { . diag.span_suggestion(sp, help.into(), sugg, applicability); . . // This dummy construct is here to prevent the internal `clippy::collapsible_span_lint_calls` . // lint from triggering. We don't want to allow/expect it as internal lints might or might . // not be activated when linting, and we don't want an unknown lint warning either. . std::hint::black_box(()); . }); 24 ( 0.00%) } 3,272 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs -------------------------------------------------------------------------------- Ir -- line 151 ---------------------------------------- . } . . // Tiny Vecs are dumb. Skip to: . // - 8 if the element size is 1, because any heap allocator is likely . // to round up a request of less than 8 bytes to at least 8 bytes. . // - 4 if elements are moderate-sized (<= 1 KiB). . // - 1 otherwise, to avoid wasting too much space for very short Vecs. . const fn min_non_zero_cap(size: usize) -> usize { 3,031 ( 0.00%) if size == 1 { . 8 . } else if size <= 1024 { . 4 . } else { . 1 . } . } . -- line 167 ---------------------------------------- -- line 178 ---------------------------------------- . _marker: PhantomData, . } . } . . /// A specialized version of `self.reserve(len, 1)` which requires the . /// caller to ensure `len == self.capacity()`. . #[cfg(not(no_global_oom_handling))] . #[inline(never)] 624 ( 0.00%) pub(crate) fn grow_one(&mut self) { . // SAFETY: All calls on self.inner pass T::LAYOUT as the elem_layout . unsafe { self.inner.grow_one(T::LAYOUT) } 624 ( 0.00%) } . } . . impl RawVec { . #[cfg(not(no_global_oom_handling))] . pub(crate) const MIN_NON_ZERO_CAP: usize = min_non_zero_cap(size_of::()); . . /// Like `new`, but parameterized over the choice of allocator for . /// the returned `RawVec`. -- line 197 ---------------------------------------- -- line 376 ---------------------------------------- . . /// The same as `reserve_exact`, but returns on errors instead of panicking or aborting. . pub(crate) fn try_reserve_exact( . &mut self, . len: usize, . additional: usize, . ) -> Result<(), TryReserveError> { . // SAFETY: All calls on self.inner pass T::LAYOUT as the elem_layout 10 ( 0.00%) unsafe { self.inner.try_reserve_exact(len, additional, T::LAYOUT) } 112 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:::try_reserve_exact (1x) . } . . /// Shrinks the buffer down to the specified capacity. If the given amount . /// is 0, actually completely deallocates. . /// . /// # Panics . /// . /// Panics if the given amount is *larger* than the current capacity. -- line 392 ---------------------------------------- -- line 417 ---------------------------------------- . } . } . . #[rustc_const_unstable(feature = "const_heap", issue = "79597")] . const unsafe impl<#[may_dangle] T, A: [const] Allocator + [const] Destruct> Drop for RawVec { . /// Frees the memory owned by the `RawVec` *without* trying to drop its contents. . fn drop(&mut self) { . // SAFETY: We are in a Drop impl, self.inner will not be used again. 321,861 ( 0.01%) unsafe { self.inner.deallocate(T::LAYOUT) } . } . } . . #[rustc_const_unstable(feature = "const_heap", issue = "79597")] . #[rustfmt::skip] // FIXME(fee1-dead): temporary measure before rustfmt is bumped . const impl RawVecInner { . #[cfg(not(no_global_oom_handling))] . #[inline] -- line 433 ---------------------------------------- -- line 453 ---------------------------------------- . // We avoid `unwrap_or_else` here because it bloats the amount of . // LLVM IR generated. . let layout = match layout_array(capacity, elem_layout) { . Ok(layout) => layout, . Err(_) => return Err(CapacityOverflow.into()), . }; . . // Don't allocate here because `Drop` will not deallocate when `capacity` is 0. 16,455 ( 0.00%) if layout.size() == 0 { . return Ok(Self::new_in(alloc, elem_layout.alignment())); . } . . let result = match init { . AllocInit::Uninitialized => alloc.allocate(layout), . #[cfg(not(no_global_oom_handling))] . AllocInit::Zeroed => alloc.allocate_zeroed(layout), . }; 87,701 ( 0.00%) let ptr = match result { . Ok(ptr) => ptr, . Err(_) => return Err(AllocError { layout, non_exhaustive: () }.into()), . }; . . // Allocators currently return a `NonNull<[u8]>` whose length . // matches the size requested. If that ever changes, the capacity . // here should change to `ptr.len() / size_of::()`. . Ok(Self { -- line 478 ---------------------------------------- -- line 485 ---------------------------------------- . /// # Safety . /// - `elem_layout` must be valid for `self`, i.e. it must be the same `elem_layout` used to . /// initially construct `self` . /// - `elem_layout`'s size must be a multiple of its alignment . #[cfg(not(no_global_oom_handling))] . #[inline] . unsafe fn grow_one(&mut self, elem_layout: Layout) { . // SAFETY: Precondition passed to caller 156 ( 0.00%) if let Err(err) = unsafe { self.grow_amortized(self.cap.as_inner(), 1, elem_layout) } { . handle_error(err); . } . } . . /// # Safety . /// - `elem_layout` must be valid for `self`, i.e. it must be the same `elem_layout` used to . /// initially construct `self` . /// - `elem_layout`'s size must be a multiple of its alignment -- line 501 ---------------------------------------- -- line 504 ---------------------------------------- . &mut self, . len: usize, . additional: usize, . elem_layout: Layout, . ) -> Result<(), TryReserveError> { . // This is ensured by the calling contexts. . debug_assert!(additional > 0); . 866 ( 0.00%) if elem_layout.size() == 0 { . // Since we return a capacity of `usize::MAX` when `elem_size` is . // 0, getting to here necessarily means the `RawVec` is overfull. . return Err(CapacityOverflow.into()); . } . . // Nothing we can really do about these checks, sadly. . let required_cap = len.checked_add(additional).ok_or(CapacityOverflow)?; . . // This guarantees exponential growth. The doubling cannot overflow . // because `cap <= isize::MAX` and the type of `cap` is `usize`. 1,024 ( 0.00%) let cap = cmp::max(self.cap.as_inner() * 2, required_cap); . let cap = cmp::max(min_non_zero_cap(elem_layout.size()), cap); . . // SAFETY: . // - cap >= len + additional . // - other preconditions passed to caller 2,239 ( 0.00%) let ptr = unsafe { self.finish_grow(cap, elem_layout)? }; 76 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:::finish_grow (1x) . . // SAFETY: `finish_grow` would have failed if `cap > isize::MAX` . unsafe { self.set_ptr_and_cap(ptr, cap) }; . Ok(()) . } . . /// # Safety . /// - `elem_layout` must be valid for `self`, i.e. it must be the same `elem_layout` used to . /// initially construct `self` . /// - `elem_layout`'s size must be a multiple of its alignment . /// - `cap` must be greater than the current capacity . // not marked inline(never) since we want optimizers to be able to observe the specifics of this . // function, see tests/codegen-llvm/vec-reserve-extend.rs. . #[cold] 5,412 ( 0.00%) unsafe fn finish_grow( . &self, . cap: usize, . elem_layout: Layout, . ) -> Result, TryReserveError> { . let new_layout = layout_array(cap, elem_layout)?; . . let memory = if let Some((ptr, old_layout)) = unsafe { self.current_memory(elem_layout) } { . // FIXME(const-hack): switch to `debug_assert_eq` -- line 552 ---------------------------------------- -- line 556 ---------------------------------------- . hint::assert_unchecked(old_layout.align() == new_layout.align()); . self.alloc.grow(ptr, old_layout, new_layout) . } . } else { . self.alloc.allocate(new_layout) . }; . . memory.map_err(const |_| AllocError { layout: new_layout, non_exhaustive: () }.into()) 4,060 ( 0.00%) } . } . . impl RawVecInner { . #[inline] . const fn new_in(alloc: A, align: Alignment) -> Self { . let ptr = Unique::from_non_null(NonNull::without_provenance(align.as_nonzero_usize())); . // `cap: 0` means "unallocated". zero-sized types are ignored. . Self { ptr, cap: ZERO_CAP, alloc } -- line 572 ---------------------------------------- -- line 603 ---------------------------------------- . . #[inline] . const fn ptr(&self) -> *mut T { . self.non_null::().as_ptr() . } . . #[inline] . const fn non_null(&self) -> NonNull { 163,333 ( 0.01%) self.ptr.cast().as_non_null_ptr() . } . . #[inline] . const fn capacity(&self, elem_size: usize) -> usize { 752 ( 0.00%) if elem_size == 0 { usize::MAX } else { self.cap.as_inner() } . } . . #[inline] . const fn allocator(&self) -> &A { . &self.alloc . } . . /// # Safety . /// - `elem_layout` must be valid for `self`, i.e. it must be the same `elem_layout` used to . /// initially construct `self` . /// - `elem_layout`'s size must be a multiple of its alignment . #[inline] . #[rustc_const_unstable(feature = "const_heap", issue = "79597")] . const unsafe fn current_memory(&self, elem_layout: Layout) -> Option<(NonNull, Layout)> { 319,505 ( 0.01%) if elem_layout.size() == 0 || self.cap.as_inner() == 0 { . None . } else { . // We could use Layout::array here which ensures the absence of isize and usize overflows . // and could hypothetically handle differences between stride and size, but this memory . // has already been allocated so we know it can't overflow and currently Rust does not . // support such types. So we can do better by skipping some checks and avoid an unwrap. . unsafe { . let alloc_size = elem_layout.size().unchecked_mul(self.cap.as_inner()); -- line 639 ---------------------------------------- -- line 650 ---------------------------------------- . #[cfg(not(no_global_oom_handling))] . #[inline] . unsafe fn reserve(&mut self, len: usize, additional: usize, elem_layout: Layout) { . // Callers expect this function to be very cheap when there is already sufficient capacity. . // Therefore, we move all the resizing and error-handling logic from grow_amortized and . // handle_reserve behind a call, while making sure that this function is likely to be . // inlined as just a comparison and a call if the comparison fails. . #[cold] 1,735 ( 0.00%) unsafe fn do_reserve_and_handle( . slf: &mut RawVecInner, . len: usize, . additional: usize, . elem_layout: Layout, . ) { . // SAFETY: Precondition passed to caller . if let Err(err) = unsafe { slf.grow_amortized(len, additional, elem_layout) } { . handle_error(err); . } 1,736 ( 0.00%) } . 2,186 ( 0.00%) if self.needs_to_grow(len, additional, elem_layout) { . unsafe { 2,834 ( 0.00%) do_reserve_and_handle(self, len, additional, elem_layout); 336 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:>::reserve::do_reserve_and_handle:: (3x) . } . } . } . . /// # Safety . /// - `elem_layout` must be valid for `self`, i.e. it must be the same `elem_layout` used to . /// initially construct `self` . /// - `elem_layout`'s size must be a multiple of its alignment -- line 680 ---------------------------------------- -- line 708 ---------------------------------------- . handle_error(err); . } . } . . /// # Safety . /// - `elem_layout` must be valid for `self`, i.e. it must be the same `elem_layout` used to . /// initially construct `self` . /// - `elem_layout`'s size must be a multiple of its alignment 3 ( 0.00%) unsafe fn try_reserve_exact( . &mut self, . len: usize, . additional: usize, . elem_layout: Layout, . ) -> Result<(), TryReserveError> { 1 ( 0.00%) if self.needs_to_grow(len, additional, elem_layout) { . // SAFETY: Precondition passed to caller . unsafe { . self.grow_exact(len, additional, elem_layout)?; . } . } . unsafe { . // Inform the optimizer that the reservation has succeeded or wasn't needed . hint::assert_unchecked(!self.needs_to_grow(len, additional, elem_layout)); . } . Ok(()) 1 ( 0.00%) } . . /// # Safety . /// - `elem_layout` must be valid for `self`, i.e. it must be the same `elem_layout` used to . /// initially construct `self` . /// - `elem_layout`'s size must be a multiple of its alignment . /// - `cap` must be less than or equal to `self.capacity(elem_layout.size())` . #[cfg(not(no_global_oom_handling))] . #[inline] -- line 741 ---------------------------------------- -- line 756 ---------------------------------------- . cap: usize, . elem_layout: Layout, . ) -> Result<(), TryReserveError> { . unsafe { self.shrink(cap, elem_layout) } . } . . #[inline] . const fn needs_to_grow(&self, len: usize, additional: usize, elem_layout: Layout) -> bool { 2,775 ( 0.00%) additional > self.capacity(elem_layout.size()).wrapping_sub(len) . } . . #[inline] . #[rustc_const_unstable(feature = "const_heap", issue = "79597")] . const unsafe fn set_ptr_and_cap(&mut self, ptr: NonNull<[u8]>, cap: usize) { . // Allocators currently return a `NonNull<[u8]>` whose length matches . // the size requested. If that ever changes, the capacity here should . // change to `ptr.len() / size_of::()`. 593 ( 0.00%) self.ptr = Unique::from(ptr.cast()); 591 ( 0.00%) self.cap = unsafe { Cap::new_unchecked(cap) }; . } . . /// # Safety . /// - `elem_layout` must be valid for `self`, i.e. it must be the same `elem_layout` used to . /// initially construct `self` . /// - `elem_layout`'s size must be a multiple of its alignment . /// - The sum of `len` and `additional` must be greater than the current capacity . unsafe fn grow_exact( . &mut self, . len: usize, . additional: usize, . elem_layout: Layout, . ) -> Result<(), TryReserveError> { 1 ( 0.00%) if elem_layout.size() == 0 { . // Since we return a capacity of `usize::MAX` when the type size is . // 0, getting to here necessarily means the `RawVec` is overfull. . return Err(CapacityOverflow.into()); . } . . let cap = len.checked_add(additional).ok_or(CapacityOverflow)?; . . // SAFETY: preconditions passed to caller 534 ( 0.00%) let ptr = unsafe { self.finish_grow(cap, elem_layout)? }; 1,976 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:::finish_grow (26x) . . // SAFETY: `finish_grow` would have failed if `cap > isize::MAX` . unsafe { self.set_ptr_and_cap(ptr, cap) }; . Ok(()) . } . . /// # Safety . /// - `elem_layout` must be valid for `self`, i.e. it must be the same `elem_layout` used to -- line 805 ---------------------------------------- -- line 824 ---------------------------------------- . /// # Safety . /// `cap <= self.capacity()` . unsafe fn shrink_unchecked( . &mut self, . cap: usize, . elem_layout: Layout, . ) -> Result<(), TryReserveError> { . // SAFETY: Precondition passed to caller 95 ( 0.00%) let Some((ptr, layout)) = (unsafe { self.current_memory(elem_layout) }) else { . return Ok(()); . }; . . // If shrinking to 0, deallocate the buffer. We don't reach this point . // for the T::IS_ZST case since current_memory() will have returned . // None. 190 ( 0.00%) if cap == 0 { . unsafe { self.alloc.deallocate(ptr, layout) }; . self.ptr = . unsafe { Unique::new_unchecked(ptr::without_provenance_mut(elem_layout.align())) }; . self.cap = ZERO_CAP; . } else { . let ptr = unsafe { . // Layout cannot overflow here because it would have . // overflowed earlier when capacity was larger. -- line 847 ---------------------------------------- 982,381 ( 0.05%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/ast.rs -------------------------------------------------------------------------------- Ir -- line 98 ---------------------------------------- . /// Global paths begin with `kw::PathRoot`. . pub segments: ThinVec, . } . . // Succeeds if the path has a single segment that is arg-free and matches the given symbol. . impl PartialEq for Path { . #[inline] . fn eq(&self, name: &Symbol) -> bool { 112 ( 0.00%) if let [segment] = self.segments.as_ref() . && segment == name . { . true . } else { . false . } . } . } -- line 114 ---------------------------------------- -- line 223 ---------------------------------------- . /// `Box` is used as a size optimization for the common case with no parameters. . pub args: Option>, . } . . // Succeeds if the path segment is arg-free and matches the given symbol. . impl PartialEq for PathSegment { . #[inline] . fn eq(&self, name: &Symbol) -> bool { 28 ( 0.00%) self.args.is_none() && self.ident.name == *name . } . } . . impl PathSegment { . pub fn from_ident(ident: Ident) -> Self { . PathSegment { ident, id: DUMMY_NODE_ID, args: None } . } . -- line 239 ---------------------------------------- -- line 247 ---------------------------------------- . None => self.ident.span, . } . } . } . . /// The generic arguments and associated item constraints of a path segment. . /// . /// E.g., `` as in `Foo` or `(A, B)` as in `Foo(A, B)`. 23 ( 0.00%) #[derive(Clone, Encodable, Decodable, Debug, Walkable)] . pub enum GenericArgs { . /// The `<'a, A, B, C>` in `foo::bar::baz::<'a, A, B, C>`. . AngleBracketed(AngleBracketedArgs), . /// The `(A, B)` and `C` in `Foo(A, B) -> C`. . Parenthesized(ParenthesizedArgs), . /// `(..)` in return type notation. . ParenthesizedElided(Span), . } -- line 263 ---------------------------------------- -- line 272 ---------------------------------------- . AngleBracketed(data) => data.span, . Parenthesized(data) => data.span, . ParenthesizedElided(span) => *span, . } . } . } . . /// Concrete argument in the sequence of generic args. 5 ( 0.00%) #[derive(Clone, Encodable, Decodable, Debug, Walkable)] . pub enum GenericArg { . /// `'a` in `Foo<'a>`. . Lifetime(#[visitable(extra = LifetimeCtxt::GenericArg)] Lifetime), . /// `Bar` in `Foo`. . Type(Box), . /// `1` in `Foo<1>`. . Const(AnonConst), . } -- line 288 ---------------------------------------- -- line 302 ---------------------------------------- . pub struct AngleBracketedArgs { . /// The overall span. . pub span: Span, . /// The comma separated parts in the `<...>`. . pub args: ThinVec, . } . . /// Either an argument for a generic parameter or a constraint on an associated item. 6 ( 0.00%) #[derive(Clone, Encodable, Decodable, Debug, Walkable)] 97 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/ast.rs:>::walk_ref (1x) . pub enum AngleBracketedArg { . /// A generic argument for a generic parameter. . Arg(GenericArg), . /// A constraint on an associated item. . Constraint(AssocItemConstraint), . } . . impl AngleBracketedArg { -- line 318 ---------------------------------------- -- line 393 ---------------------------------------- . Trait(PolyTraitRef), . Outlives(#[visitable(extra = LifetimeCtxt::Bound)] Lifetime), . /// Precise capturing syntax: `impl Sized + use<'a>` . Use(ThinVec, Span), . } . . impl GenericBound { . pub fn span(&self) -> Span { 24 ( 0.00%) match self { . GenericBound::Trait(t, ..) => t.span, . GenericBound::Outlives(l) => l.ident.span, . GenericBound::Use(_, span) => *span, . } . } . } . . pub type GenericBounds = ThinVec; -- line 409 ---------------------------------------- -- line 616 ---------------------------------------- . /// Distinguishes between `unsafe { ... }` and `{ ... }`. . pub rules: BlockCheckMode, . pub span: Span, . } . . /// A match pattern. . /// . /// Patterns appear in match statements and some other contexts, such as `let` and `if let`. 13,652 ( 0.00%) #[derive(Clone, Encodable, Decodable, Debug, Walkable)] . pub struct Pat { . pub id: NodeId, . pub kind: PatKind, . pub span: Span, . } . . impl Pat { . /// Attempt reparsing the pattern as a type. -- line 632 ---------------------------------------- -- line 712 ---------------------------------------- . while let PatKind::Ref(inner, _, _) = ¤t.kind { . current = inner; . } . current . } . . /// Is this a `..` pattern? . pub fn is_rest(&self) -> bool { 106 ( 0.00%) matches!(self.kind, PatKind::Rest) . } . . /// Whether this could be a never pattern, taking into account that a macro invocation can . /// return a never pattern. Used to inform errors during parsing. . pub fn could_be_never_pattern(&self) -> bool { . let mut could_be_never_pattern = false; . self.walk(&mut |pat| match &pat.kind { . PatKind::Never | PatKind::MacCall(_) => { -- line 728 ---------------------------------------- -- line 863 ---------------------------------------- . DotDotDot, . /// `..=` . DotDotEq, . } . . /// All the different flavors of pattern that Rust recognizes. . // . // Adding a new variant? Please update `test_pat` in `tests/ui/macros/stringify.rs`. 24,308 ( 0.00%) #[derive(Clone, Encodable, Decodable, Debug, Walkable)] 43,152 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/visit.rs:>::walk_ref (1,392x) . pub enum PatKind { . /// A missing pattern, e.g. for an anonymous param in a bare fn like `fn f(u32)`. . Missing, . . /// Represents a wildcard pattern (`_`). . Wild, . . /// A `PatKind::Ident` may either be a new bound variable (`ref mut binding @ OPT_SUBPATTERN`), -- line 879 ---------------------------------------- -- line 974 ---------------------------------------- . /// where `T = typeof($expr)`. . Raw, . /// A pinned borrow, `&pin const $expr` or `&pin mut $expr`. . /// The resulting type is either `Pin<&'a T>` or `Pin<&'a mut T>` . /// where `T = typeof($expr)` and `'a` is some lifetime. . Pin, . } . 1,365 ( 0.00%) #[derive(Clone, Copy, Debug, PartialEq, Encodable, Decodable, StableHash, Walkable)] . pub enum BinOpKind { . /// The `+` operator (addition) . Add, . /// The `-` operator (subtraction) . Sub, . /// The `*` operator (multiplication) . Mul, . /// The `/` operator (division) -- line 990 ---------------------------------------- -- line 1017 ---------------------------------------- . Ge, . /// The `>` operator (greater than) . Gt, . } . . impl BinOpKind { . pub fn as_str(&self) -> &'static str { . use BinOpKind::*; 35 ( 0.00%) match self { . Add => "+", . Sub => "-", . Mul => "*", . Div => "/", . Rem => "%", . And => "&&", . Or => "||", . BitXor => "^", -- line 1033 ---------------------------------------- -- line 1037 ---------------------------------------- . Shr => ">>", . Eq => "==", . Lt => "<", . Le => "<=", . Ne => "!=", . Ge => ">=", . Gt => ">", . } 1 ( 0.00%) } . . pub fn is_lazy(&self) -> bool { . matches!(self, BinOpKind::And | BinOpKind::Or) . } . . pub fn precedence(&self) -> ExprPrecedence { . use BinOpKind::*; . match *self { -- line 1053 ---------------------------------------- -- line 1070 ---------------------------------------- . Add | Sub | Mul | Div | Rem | And | Or | BitXor | BitAnd | BitOr | Shl | Shr => { . Fixity::Left . } . } . } . . pub fn is_comparison(self) -> bool { . use BinOpKind::*; 454 ( 0.00%) match self { . Eq | Ne | Lt | Le | Gt | Ge => true, . Add | Sub | Mul | Div | Rem | And | Or | BitXor | BitAnd | BitOr | Shl | Shr => false, . } . } . . /// Returns `true` if the binary operator takes its arguments by value. . pub fn is_by_value(self) -> bool { . !self.is_comparison() -- line 1086 ---------------------------------------- -- line 1089 ---------------------------------------- . . pub type BinOp = Spanned; . . // Sometimes `BinOpKind` and `AssignOpKind` need the same treatment. The . // operations covered by `AssignOpKind` are a subset of those covered by . // `BinOpKind`, so it makes sense to convert `AssignOpKind` to `BinOpKind`. . impl From for BinOpKind { . fn from(op: AssignOpKind) -> BinOpKind { 4 ( 0.00%) match op { . AssignOpKind::AddAssign => BinOpKind::Add, . AssignOpKind::SubAssign => BinOpKind::Sub, . AssignOpKind::MulAssign => BinOpKind::Mul, . AssignOpKind::DivAssign => BinOpKind::Div, . AssignOpKind::RemAssign => BinOpKind::Rem, . AssignOpKind::BitXorAssign => BinOpKind::BitXor, . AssignOpKind::BitAndAssign => BinOpKind::BitAnd, . AssignOpKind::BitOrAssign => BinOpKind::BitOr, . AssignOpKind::ShlAssign => BinOpKind::Shl, . AssignOpKind::ShrAssign => BinOpKind::Shr, . } . } . } . 1 ( 0.00%) #[derive(Clone, Copy, Debug, PartialEq, Encodable, Decodable, StableHash, Walkable)] . pub enum AssignOpKind { . /// The `+=` operator (addition) . AddAssign, . /// The `-=` operator (subtraction) . SubAssign, . /// The `*=` operator (multiplication) . MulAssign, . /// The `/=` operator (division) -- line 1120 ---------------------------------------- -- line 1318 ---------------------------------------- . pub fn init(&self) -> Option<&Expr> { . match self { . Self::Decl => None, . Self::Init(i) | Self::InitElse(i, _) => Some(i), . } . } . . pub fn init_else_opt(&self) -> Option<(&Expr, Option<&Block>)> { 175 ( 0.00%) match self { . Self::Decl => None, 35 ( 0.00%) Self::Init(init) => Some((init, None)), . Self::InitElse(init, els) => Some((init, Some(els))), . } . } . } . . /// An arm of a 'match'. . /// . /// E.g., `0..=10 => { println!("match!") }` as in -- line 1336 ---------------------------------------- -- line 1474 ---------------------------------------- . Parens::No, . ))), . _ => None, . } . } . . pub fn peel_parens(&self) -> &Expr { . let mut expr = self; 24 ( 0.00%) while let ExprKind::Paren(inner) = &expr.kind { . expr = inner; . } . expr . } . . pub fn peel_parens_and_refs(&self) -> &Expr { . let mut expr = self; . while let ExprKind::Paren(inner) | ExprKind::AddrOf(BorrowKind::Ref, _, inner) = &expr.kind -- line 1490 ---------------------------------------- -- line 1712 ---------------------------------------- . pub receiver: Box, . /// The arguments, e.g. `a, b, c`. . pub args: ThinVec>, . /// The span of the function, without the dot and receiver e.g. `foo::(a, b, c)`. . pub span: Span, . } . 20 ( 0.00%) #[derive(Clone, Encodable, Decodable, Debug, Walkable)] . pub enum StructRest { . /// `..x`. . Base(Box), . /// `..`. . Rest(Span), . /// No trailing `..` or expression. . None, . /// No trailing `..` or expression, and also, a parse error occurred inside the struct braces. -- line 1728 ---------------------------------------- -- line 2011 ---------------------------------------- . /// of `x` and treat `x.use` as either a copy/clone/move as appropriate. . Use { . /// The span of the `use` keyword. . use_kw: Span, . }, . } . . /// Closure lifetime binder, `for<'a, 'b>` in `for<'a, 'b> |_: &'a (), _: &'b ()|`. 36 ( 0.00%) #[derive(Clone, Encodable, Decodable, Debug, Walkable)] . pub enum ClosureBinder { . /// The binder is not present, all closure lifetimes are inferred. . NotPresent, . /// The binder is present. . For { . /// Span of the whole `for<>` clause . /// . /// ```text -- line 2027 ---------------------------------------- -- line 2244 ---------------------------------------- . } . . /// This type is used within both `ast::MetaItemLit` and `hir::Lit`. . /// . /// Note that the entire literal (including the suffix) is considered when . /// deciding the `LitKind`. This means that float literals like `1f32` are . /// classified by this type as `Float`. This is different to `token::LitKind` . /// which does *not* consider the suffix. 28 ( 0.00%) #[derive(Clone, Copy, Encodable, Decodable, Debug, Hash, Eq, PartialEq, StableHash)] . pub enum LitKind { . /// A string literal (`"foo"`). The symbol is unescaped, and so may differ . /// from the original token's symbol. . Str(Symbol, StrStyle), . /// A byte string (`b"foo"`). The symbol is unescaped, and so may differ . /// from the original token's symbol. . ByteStr(ByteSymbol, StrStyle), . /// A C String (`c"foo"`). Guaranteed to only have `\0` at the end. The -- line 2260 ---------------------------------------- -- line 2261 ---------------------------------------- . /// symbol is unescaped, and so may differ from the original token's . /// symbol. . CStr(ByteSymbol, StrStyle), . /// A byte char (`b'f'`). . Byte(u8), . /// A character literal (`'a'`). . Char(char), . /// An integer literal (`1`). 2 ( 0.00%) Int(Pu128, LitIntType), . /// A float literal (`1.0`, `1f64` or `1E10f64`). The pre-suffix part is . /// stored as a symbol rather than `f64` so that `LitKind` can impl `Eq` . /// and `Hash`. . Float(Symbol, LitFloatType), . /// A boolean literal (`true`, `false`). . Bool(bool), . /// Placeholder for a literal that wasn't well-formed in some way. . Err(ErrorGuaranteed), -- line 2277 ---------------------------------------- -- line 2292 ---------------------------------------- . . /// Returns `true` if this literal is byte literal string. . pub fn is_bytestr(&self) -> bool { . matches!(self, LitKind::ByteStr(..)) . } . . /// Returns `true` if this is a numeric literal. . pub fn is_numeric(&self) -> bool { 190,380 ( 0.01%) matches!(self, LitKind::Int(..) | LitKind::Float(..)) . } . . /// Returns `true` if this literal has no suffix. . /// Note: this will return true for literals with prefixes such as raw strings and byte strings. . pub fn is_unsuffixed(&self) -> bool { . !self.is_suffixed() . } . -- line 2308 ---------------------------------------- -- line 2433 ---------------------------------------- . Equality { term: Term }, . /// A bound on an associated type (e.g., `AssocTy: Bound` in `Trait`). . Bound { . #[visitable(extra = BoundKind::Bound)] . bounds: GenericBounds, . }, . } . 473 ( 0.00%) #[derive(Encodable, Decodable, Debug, Walkable)] . pub struct Ty { . pub id: NodeId, . pub kind: TyKind, . pub span: Span, . } . . impl Clone for Ty { . fn clone(&self) -> Self { -- line 2449 ---------------------------------------- -- line 2501 ---------------------------------------- . pub struct UnsafeBinderTy { . pub generic_params: ThinVec, . pub inner_ty: Box, . } . . /// The various kinds of type recognized by the compiler. . // . // Adding a new variant? Please update `test_ty` in `tests/ui/macros/stringify.rs`. 161 ( 0.00%) #[derive(Clone, Encodable, Decodable, Debug, Walkable)] 28 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/visit.rs:>::walk_ref'2 (1x) . pub enum TyKind { . /// A variable-length slice (`[T]`). . Slice(Box), . /// A fixed length array (`[T; n]`). . Array(Box, AnonConst), . /// A raw pointer (`*const T` or `*mut T`). . Ptr(MutTy), . /// A reference (`&'a T` or `&'a mut T`). -- line 2517 ---------------------------------------- -- line 2911 ---------------------------------------- . #[visitable(ignore)] . pub options: InlineAsmOptions, . pub line_spans: Vec, . } . . /// A parameter in a function header. . /// . /// E.g., `bar: usize` as in `fn foo(bar: usize)`. 72 ( 0.00%) #[derive(Clone, Encodable, Decodable, Debug, Walkable)] . pub struct Param { . pub attrs: AttrVec, . pub ty: Box, . pub pat: Box, . pub id: NodeId, . pub span: Span, . pub is_placeholder: bool, . } -- line 2927 ---------------------------------------- -- line 2979 ---------------------------------------- . }; . } . } . None . } . . /// Returns `true` if parameter is `self`. . pub fn is_self(&self) -> bool { 396 ( 0.00%) if let PatKind::Ident(_, ident, _) = self.pat.kind { . ident.name == kw::SelfLower . } else { . false . } . } . . /// Builds a `Param` object from `ExplicitSelf`. . pub fn from_self(attrs: AttrVec, eself: ExplicitSelf, eself_ident: Ident) -> Param { -- line 2995 ---------------------------------------- -- line 3187 ---------------------------------------- . match *self { . ImplPolarity::Positive => "positive".fmt(f), . ImplPolarity::Negative(_) => "negative".fmt(f), . } . } . } . . /// The polarity of a trait bound. 40 ( 0.00%) #[derive(Copy, Clone, PartialEq, Eq, Encodable, Decodable, Debug, Hash)] . #[derive(StableHash, Walkable)] . pub enum BoundPolarity { . /// `Type: Trait` . Positive, . /// `Type: !Trait` . Negative(Span), . /// `Type: ?Trait` . Maybe(Span), -- line 3203 ---------------------------------------- -- line 3209 ---------------------------------------- . Self::Positive => "", . Self::Negative(_) => "!", . Self::Maybe(_) => "?", . } . } . } . . /// The constness of a trait bound. 40 ( 0.00%) #[derive(Copy, Clone, PartialEq, Eq, Encodable, Decodable, Debug, Hash)] . #[derive(StableHash, Walkable)] . pub enum BoundConstness { . /// `Type: Trait` . Never, . /// `Type: const Trait` . Always(Span), . /// `Type: [const] Trait` . Maybe(Span), -- line 3225 ---------------------------------------- -- line 3249 ---------------------------------------- . pub fn as_str(self) -> &'static str { . match self { . Self::Normal => "", . Self::Async(_) => "async", . } . } . } . 24 ( 0.00%) #[derive(Clone, Encodable, Decodable, Debug, Walkable)] . pub enum FnRetTy { . /// Returns type is not specified. . /// . /// Functions default to `()` and closures default to inference. . /// Span points to where return type would be inserted. . Default(Span), . /// Everything else. . Ty(Box), -- line 3265 ---------------------------------------- -- line 3615 ---------------------------------------- . pub enum VisibilityKind { . Public, . Restricted { path: Box, id: NodeId, shorthand: bool }, . Inherited, . } . . impl VisibilityKind { . pub fn is_pub(&self) -> bool { 22 ( 0.00%) matches!(self, VisibilityKind::Public) . } . } . . #[derive(Clone, Encodable, Decodable, Debug, Walkable)] . pub struct ImplRestriction { . pub kind: RestrictionKind, . pub span: Span, . } -- line 3631 ---------------------------------------- -- line 4197 ---------------------------------------- . Delegation(Box), . /// A list or glob delegation item (`reuse prefix::{a, b, c}`, `reuse prefix::*`). . /// Treated similarly to a macro call and expanded early. . DelegationMac(Box), . } . . impl ItemKind { . pub fn ident(&self) -> Option { 955 ( 0.00%) match *self { 3 ( 0.00%) ItemKind::ExternCrate(_, ident) . | ItemKind::Static(StaticItem { ident, .. }) 68 ( 0.00%) | ItemKind::Const(ConstItem { ident, .. }) 94 ( 0.00%) | ItemKind::Fn(Fn { ident, .. }) . | ItemKind::Mod(_, ident, _) . | ItemKind::TyAlias(TyAlias { ident, .. }) . | ItemKind::Enum(ident, ..) . | ItemKind::Struct(ident, ..) . | ItemKind::Union(ident, ..) . | ItemKind::Trait(Trait { ident, .. }) . | ItemKind::TraitAlias(TraitAlias { ident, .. }) . | ItemKind::MacroDef(ident, _) -- line 4217 ---------------------------------------- -- line 4316 ---------------------------------------- . /// An associated delegation item. . Delegation(Box), . /// An associated list or glob delegation item. . DelegationMac(Box), . } . . impl AssocItemKind { . pub fn ident(&self) -> Option { 55 ( 0.00%) match *self { . AssocItemKind::Const(ConstItem { ident, .. }) 153 ( 0.00%) | AssocItemKind::Fn(Fn { ident, .. }) 12 ( 0.00%) | AssocItemKind::Type(TyAlias { ident, .. }) . | AssocItemKind::Delegation(Delegation { ident, .. }) => Some(ident), . . AssocItemKind::MacCall(_) | AssocItemKind::DelegationMac(_) => None, . } . } . . pub fn defaultness(&self) -> Defaultness { . match *self { -- line 4335 ---------------------------------------- 2,156 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_abs_diff.rs -------------------------------------------------------------------------------- Ir -- line 49 ---------------------------------------- . . impl ManualAbsDiff { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl<'tcx> LateLintPass<'tcx> for ManualAbsDiff { 549,936 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 137,484 ( 0.01%) if !expr.span.from_expansion() . && let Some(if_expr) = If::hir(expr) . && let Some(r#else) = if_expr.r#else 39 ( 0.00%) && let ExprKind::Binary(op, rhs, lhs) = if_expr.cond.kind 42 ( 0.00%) && let (BinOpKind::Gt | BinOpKind::Ge, mut a, mut b) | (BinOpKind::Lt | BinOpKind::Le, mut b, mut a) = . (op.node, rhs, lhs) . && let Some((ty, b_n_refs)) = self.are_ty_eligible(cx, a, b) . && is_sub_expr(cx, if_expr.then, a, b, ty) . && is_sub_expr(cx, r#else, b, a, ty) . { . span_lint_and_then( . cx, . MANUAL_ABS_DIFF, -- line 70 ---------------------------------------- -- line 86 ---------------------------------------- . Sugg::hir(cx, a, "..").maybe_paren(), . "*".repeat(b_n_refs), . Sugg::hir(cx, b, "..") . ); . diag.span_suggestion(expr.span, "replace with `abs_diff`", sugg, applicability); . }, . ); . } 549,936 ( 0.03%) } . } . . impl ManualAbsDiff { . /// Returns a type if `a` and `b` are both of it, and this lint can be applied to that . /// type (currently, any primitive int, or a `Duration`) . fn are_ty_eligible<'tcx>(&self, cx: &LateContext<'tcx>, a: &Expr<'_>, b: &Expr<'_>) -> Option<(Ty<'tcx>, usize)> { 9 ( 0.00%) let is_int = |ty: Ty<'_>| matches!(ty.kind(), ty::Uint(_) | ty::Int(_)) && self.msrv.meets(cx, msrvs::ABS_DIFF); 27 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (1x) . let is_duration = . |ty: Ty<'_>| ty.is_diag_item(cx, sym::Duration) && self.msrv.meets(cx, msrvs::DURATION_ABS_DIFF); . 4 ( 0.00%) let a_ty = cx.typeck_results().expr_ty(a).peel_refs(); 40 ( 0.00%) => ???:::expr_ty (1x) 6 ( 0.00%) let (b_ty, b_n_refs, _) = peel_and_count_ty_refs(cx.typeck_results().expr_ty(b)); 40 ( 0.00%) => ???:::expr_ty (1x) 9 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::peel_and_count_ty_refs (1x) . 4 ( 0.00%) (a_ty == b_ty && (is_int(a_ty) || is_duration(a_ty))).then_some((a_ty, b_n_refs)) . } . } . . /// Checks if the given expression is a subtraction operation between two expected expressions, . /// i.e. if `expr` is `{expected_a} - {expected_b}`. . /// . /// If `expected_ty` is a signed primitive integer, this function will only return `Some` if the . /// subtraction expr is wrapped in a cast to the equivalent unsigned int. -- line 116 ---------------------------------------- 10 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/nonnull_unchecked_on_box_ptr.rs -------------------------------------------------------------------------------- Ir -- line 43 ---------------------------------------- . . impl NonnullUncheckedOnBoxPtr { . pub fn new(conf: &Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl<'tcx> LateLintPass<'tcx> for NonnullUncheckedOnBoxPtr { 549,936 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 206,226 ( 0.01%) if !expr.span.from_expansion() 443 ( 0.00%) && let ExprKind::Call(nonnull_new_unchecked, [arg]) = expr.kind 266 ( 0.00%) && let ExprKind::Call(box_into_raw, [arg]) = arg.kind . && nonnull_new_unchecked 3 ( 0.00%) .ty_rel_def_if_named(cx, sym::new_unchecked) . .opt_parent(cx) 15 ( 0.00%) .opt_impl_ty(cx) 48 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/res.rs: as clippy_utils::res::MaybeDef>::opt_impl_ty:: (3x) . .is_diag_item(cx, sym::NonNull) . && box_into_raw . .ty_rel_def_if_named(cx, sym::into_raw) . .opt_parent(cx) . .opt_impl_ty(cx) . .is_lang_item(cx, LangItem::OwnedBox) . && self.msrv.meets(cx, msrvs::BOX_LEAK) . { -- line 66 ---------------------------------------- -- line 89 ---------------------------------------- . } else { . format!("NonNull::from(Box::leak({arg_name}))") . }; . . diag.span_suggestion(span, "try", sugg, app); . }, . ); . } 549,936 ( 0.03%) } . } 137,020 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/unconditional_recursion.rs -------------------------------------------------------------------------------- Ir -- line 88 ---------------------------------------- . "function cannot return without recursing", . |diag| { . diag.span_note(expr.span, "recursive call site"); . }, . ); . } . . fn get_hir_ty_def_id<'tcx>(tcx: TyCtxt<'tcx>, hir_ty: rustc_hir::Ty<'tcx>) -> Option { 15 ( 0.00%) let TyKind::Path(qpath) = hir_ty.kind else { return None }; 10 ( 0.00%) match qpath { . QPath::Resolved(_, path) => path.res.opt_def_id(), . QPath::TypeRelative(_, _) => { . let ty = lower_ty(tcx, &hir_ty); . . match ty.kind() { . ty::Alias( . _, . proj @ ty::AliasTy { -- line 105 ---------------------------------------- -- line 111 ---------------------------------------- . } . }, . } . } . . fn get_return_calls_in_body<'tcx>(body: &'tcx Body<'tcx>) -> Vec<&'tcx Expr<'tcx>> { . let mut visitor = ReturnsVisitor::default(); . 90 ( 0.00%) visitor.visit_body(body); 25,451 ( 0.00%) => ???:::visit_body (45x) 135 ( 0.00%) visitor.returns . } . . fn has_conditional_return(body: &Body<'_>, expr: &Expr<'_>) -> bool { . match get_return_calls_in_body(body).as_slice() { 170 ( 0.00%) [] => false, 32 ( 0.00%) [return_expr] => return_expr.hir_id != expr.hir_id, . _ => true, . } . } . 54 ( 0.00%) fn get_impl_trait_def_id(cx: &LateContext<'_>, method_def_id: LocalDefId) -> Option { . let hir_id = cx.tcx.local_def_id_to_hir_id(method_def_id); 24 ( 0.00%) if let Some(( . _, . Node::Item(Item { . kind: ItemKind::Impl(impl_), . owner_id, . .. . }), 6 ( 0.00%) )) = cx.tcx.hir_parent_iter(hir_id).next() . // We exclude `impl` blocks generated from rustc's proc macros. 36 ( 0.00%) && !cx.tcx.is_automatically_derived(owner_id.to_def_id()) 545 ( 0.00%) => ???:::is_automatically_derived (6x) . // It is a implementation of a trait. 15 ( 0.00%) && let Some(of_trait) = impl_.of_trait . { . of_trait.trait_ref.trait_def_id() . } else { . None . } 54 ( 0.00%) } . . /// When we have `x == y` where `x = &T` and `y = &T`, then that resolves to . /// `<&T as PartialEq<&T>>::eq`, which is not the same as `>::eq`, . /// however we still would want to treat it the same, because we know that it's a blanket impl . /// that simply delegates to the `PartialEq` impl with one reference removed. . /// . /// Still, we can't just do `lty.peel_refs() == rty.peel_refs()` because when we have `x = &T` and . /// `y = &&T`, this is not necessarily the same as `>::eq` -- line 158 ---------------------------------------- -- line 174 ---------------------------------------- . } . false . } . . fn check_partial_eq(cx: &LateContext<'_>, method_span: Span, method_def_id: LocalDefId, name: Ident, expr: &Expr<'_>) { . let Some(sig) = cx . .typeck_results() . .liberated_fn_sigs() 1 ( 0.00%) .get(cx.tcx.local_def_id_to_hir_id(method_def_id)) . else { . return; . }; . . // That has two arguments. 3 ( 0.00%) if let [self_arg, other_arg] = sig.inputs() 3 ( 0.00%) && let &ty::Ref(_, self_arg, _) = self_arg.kind() 4 ( 0.00%) && let &ty::Ref(_, other_arg, _) = other_arg.kind() . // The two arguments are of the same type. 4 ( 0.00%) && let Some(trait_def_id) = get_impl_trait_def_id(cx, method_def_id) 329 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unconditional_recursion.rs:clippy_lints::unconditional_recursion::get_impl_trait_def_id (1x) . // The trait is `PartialEq`. . && cx.tcx.is_diagnostic_item(sym::PartialEq, trait_def_id) . { . let to_check_op = if name.name == sym::eq { . BinOpKind::Eq . } else { . BinOpKind::Ne . }; -- line 200 ---------------------------------------- -- line 327 ---------------------------------------- . span_error(self.cx, self.method_span, expr); . return ControlFlow::Break(()); . } . ControlFlow::Continue(()) . } . } . . impl UnconditionalRecursion { 40 ( 0.00%) fn init_default_impl_for_type_if_needed(&mut self, cx: &LateContext<'_>) { 5 ( 0.00%) if self.default_impl_for_type.is_empty() 25 ( 0.00%) && let Some(default_trait_id) = cx.tcx.get_diagnostic_item(sym::Default) 360 ( 0.00%) => ???:::get_diagnostic_item (5x) . { . let impls = cx.tcx.trait_impls_of(default_trait_id); . for (ty, impl_def_ids) in impls.non_blanket_impls() { 3,120 ( 0.00%) let Some(self_def_id) = ty.def() else { continue }; 2,990 ( 0.00%) for &impl_def_id in impl_def_ids { 8,970 ( 0.00%) if !cx.tcx.is_automatically_derived(impl_def_id) && 861,899 ( 0.04%) => ???:::is_automatically_derived (1,495x) . let Some(assoc_item) = cx . .tcx . .associated_items(impl_def_id) . .in_definition_order() . // We're not interested in foreign implementations of the `Default` trait. . .find(|item| { 4,825 ( 0.00%) item.is_fn() && item.def_id.is_local() && item.name() == kw::Default . }) . && let Some(body_node) = cx.tcx.hir_get_if_local(assoc_item.def_id) . && let Some(body_id) = body_node.body_id() . && let body = cx.tcx.hir_body(body_id) . // We don't want to keep it if it has conditional return. . && let [return_expr] = get_return_calls_in_body(body).as_slice() . && let ExprKind::Call(call_expr, _) = return_expr.kind . // We need to use typeck here to infer the actual function being called. -- line 358 ---------------------------------------- -- line 361 ---------------------------------------- . && let typeck = cx.tcx.typeck_body(body_owner.id()) . && let Some(call_def_id) = typeck.type_dependent_def_id(call_expr.hir_id) . { . self.default_impl_for_type.insert(self_def_id, call_def_id); . } . } . } . } 40 ( 0.00%) } . . fn check_default_new<'tcx>( . &mut self, . cx: &LateContext<'tcx>, . decl: &FnDecl<'tcx>, . body: &'tcx Body<'tcx>, . method_span: Span, . method_def_id: LocalDefId, . ) { . // We're only interested into static methods. 74 ( 0.00%) if decl.implicit_self().has_implicit_self() { 296 ( 0.00%) => ???:::implicit_self (37x) . return; . } . // We don't check trait implementations. 25 ( 0.00%) if get_impl_trait_def_id(cx, method_def_id).is_some() { 1,575 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unconditional_recursion.rs:clippy_lints::unconditional_recursion::get_impl_trait_def_id (5x) . return; . } . . let hir_id = cx.tcx.local_def_id_to_hir_id(method_def_id); 20 ( 0.00%) if let Some(( . _, . Node::Item(Item { . kind: ItemKind::Impl(impl_), . .. . }), 5 ( 0.00%) )) = cx.tcx.hir_parent_iter(hir_id).next() 50 ( 0.00%) && let Some(implemented_ty_id) = get_hir_ty_def_id(cx.tcx, *impl_.self_ty) . && { 15 ( 0.00%) self.init_default_impl_for_type_if_needed(cx); 1,575,637 ( 0.07%) => site/frontend/rust-clippy/clippy_lints/src/unconditional_recursion.rs:::init_default_impl_for_type_if_needed (5x) . true . } 10 ( 0.00%) && let Some(return_def_id) = self.default_impl_for_type.get(&implemented_ty_id) . && method_def_id.to_def_id() == *return_def_id . { . let mut c = CheckCalls { . cx, . implemented_ty_id, . method_span, . }; . let _ = walk_body(&mut c, body); -- line 409 ---------------------------------------- -- line 435 ---------------------------------------- . && s1 == sig.inputs()[0] . && s2 == sig.output() . { . span_error(cx, method_span, expr); . } . } . . impl<'tcx> LateLintPass<'tcx> for UnconditionalRecursion { 832 ( 0.00%) fn check_fn( . &mut self, . cx: &LateContext<'tcx>, . kind: FnKind<'tcx>, . decl: &'tcx FnDecl<'tcx>, . body: &'tcx Body<'tcx>, . method_span: Span, . method_def_id: LocalDefId, . ) { . // If the function is a method... 253 ( 0.00%) if let FnKind::Method(name, _) = kind 222 ( 0.00%) && let expr = expr_or_init(cx, body.value).peel_blocks() 1,170 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::expr_or_init (45x) . // Doesn't have a conditional return. 122 ( 0.00%) && !has_conditional_return(body, expr) . { . match name.name { 257 ( 0.00%) sym::eq | sym::ne => check_partial_eq(cx, method_span, method_def_id, name, expr), . sym::to_string => check_to_string(cx, method_span, method_def_id, name, expr), . sym::from => check_from(cx, method_span, method_def_id, expr), . _ => {}, . } . self.check_default_new(cx, decl, body, method_span, method_def_id); . } 832 ( 0.00%) } . } 5,219 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/loops/mod.rs -------------------------------------------------------------------------------- Ir -- line 852 ---------------------------------------- . Self { . msrv: conf.msrv.into(), . enforce_iter_loop_reborrow: conf.enforce_iter_loop_reborrow, . } . } . } . . impl<'tcx> LateLintPass<'tcx> for Loops { 756,162 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 137,484 ( 0.01%) let for_loop = higher::ForLoop::hir(expr); 1,032,434 ( 0.05%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (68,742x) 68,742 ( 0.00%) if let Some(higher::ForLoop { 8 ( 0.00%) pat, 8 ( 0.00%) arg, 8 ( 0.00%) body, 8 ( 0.00%) loop_id, 8 ( 0.00%) span, 32 ( 0.00%) label, 137,484 ( 0.01%) }) = for_loop . { . // we don't want to check expanded macros . // this check is not at the top of the function . // since higher::for_loop expressions are marked as expansions 16 ( 0.00%) if body.span.from_expansion() { . return; . } 24 ( 0.00%) self.check_for_loop(cx, pat, arg, body, expr, span, label); 24 ( 0.00%) if let ExprKind::Block(block, _) = body.kind { 16 ( 0.00%) never_loop::check(cx, block, loop_id, span, for_loop.as_ref()); 14,424 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::check (8x) . } . } . . // we don't want to check expanded macros 137,484 ( 0.01%) if expr.span.from_expansion() { . return; . } . . // check for never_loop 205,514 ( 0.01%) if let ExprKind::Loop(block, ..) = expr.kind { 20 ( 0.00%) never_loop::check(cx, block, expr.hir_id, expr.span, None); 46,808 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::check (2x) . } . . // check for `loop { if let {} else break }` that could be `while let` . // (also matches an explicit "match" instead of "if let") . // (even if the "match" or "if let" is used for declaration) . // (also matches on `let {} else break`) 10 ( 0.00%) if let ExprKind::Loop(block, label, LoopSource::Loop, _) = expr.kind { . // also check for empty `loop {}` statements, skipping those in #[panic_handler] 3 ( 0.00%) empty_loop::check(cx, expr, block); 5 ( 0.00%) while_let_loop::check(cx, expr, block); 49 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/loops/while_let_loop.rs:clippy_lints::loops::while_let_loop::check (1x) 4 ( 0.00%) infinite_loop::check(cx, expr, block, label); 663 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/loops/infinite_loop.rs:clippy_lints::loops::infinite_loop::check (1x) . } . 137,010 ( 0.01%) while_let_on_iterator::check(cx, expr); 1,164,585 ( 0.05%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/loops/while_let_on_iterator.rs:clippy_lints::loops::while_let_on_iterator::check (68,504x) . 1 ( 0.00%) if let Some(higher::While { . condition, body, span, .. 1 ( 0.00%) }) = higher::While::hir(expr) . { 4 ( 0.00%) while_immutable_condition::check(cx, condition, body); 51,882 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/loops/while_immutable_condition.rs:clippy_lints::loops::while_immutable_condition::check (1x) 3 ( 0.00%) while_float::check(cx, condition); 67 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/loops/while_float.rs:clippy_lints::loops::while_float::check (1x) . missing_spin_loop::check(cx, condition, body); 4 ( 0.00%) manual_while_let_some::check(cx, condition, body, span); 15 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/loops/manual_while_let_some.rs:clippy_lints::loops::manual_while_let_some::check (1x) . } . 137,444 ( 0.01%) if let ExprKind::MethodCall(path, recv, args, _) = expr.kind { 110 ( 0.00%) let name = path.ident.name; . 9 ( 0.00%) let is_iterator_method = || { 6 ( 0.00%) cx.ty_based_def(expr) . .assoc_fn_parent(cx) . .is_diag_item(cx, sym::Iterator) 12 ( 0.00%) }; . . // is_iterator_method is a bit expensive, so we call it last in each match arm . match (name, args) { 716 ( 0.00%) (sym::for_each | sym::all | sym::any, [arg]) => { . if let ExprKind::Closure(closure) = arg.kind . && is_iterator_method() . { . unused_enumerate_index::check_method(cx, recv, arg, closure); . never_loop::check_iterator_reduction(cx, expr, recv, closure); . } . }, . . (sym::filter_map | sym::find_map | sym::flat_map | sym::map, [arg]) => { 9 ( 0.00%) if let ExprKind::Closure(closure) = arg.kind 18 ( 0.00%) && is_iterator_method() 837 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/loops/mod.rs:::check_expr::{closure#0} (3x) . { . unused_enumerate_index::check_method(cx, recv, arg, closure); . } . }, . . (sym::try_for_each | sym::reduce, [arg]) | (sym::fold | sym::try_fold, [_, arg]) => { 1 ( 0.00%) if let ExprKind::Closure(closure) = arg.kind . && is_iterator_method() . { . never_loop::check_iterator_reduction(cx, expr, recv, closure); . } . }, . . _ => {}, . } . } 549,936 ( 0.03%) } . } . . impl Loops { . #[expect(clippy::too_many_arguments)] . fn check_for_loop<'tcx>( . &self, . cx: &LateContext<'tcx>, . pat: &'tcx Pat<'_>, . arg: &'tcx Expr<'_>, . body: &'tcx Expr<'_>, . expr: &'tcx Expr<'_>, . span: Span, . label: Option

(&mut self, predicate: P) -> Option . where . P: FnMut(&Self::Item) -> bool, -- line 111 ---------------------------------------- -- line 395 ---------------------------------------- . /// However, we must still be prepared for the possibility that it was already cleared! . #[doc(hidden)] . impl FuseImpl for Fuse . where . I: FusedIterator, . { . #[inline] . fn next(&mut self) -> Option<::Item> { 379 ( 0.00%) self.iter.as_mut()?.next() . } . . #[inline] . fn advance_by(&mut self, n: usize) -> Result<(), NonZero> { . match &mut self.iter { . Some(iter) => iter.advance_by(n), . None => match NonZero::new(n) { . Some(n) => Err(n), -- line 411 ---------------------------------------- -- line 421 ---------------------------------------- . . #[inline] . fn try_fold(&mut self, mut acc: Acc, fold: Fold) -> R . where . Self: Sized, . Fold: FnMut(Acc, Self::Item) -> R, . R: Try, . { 137,487 ( 0.01%) if let Some(ref mut iter) = self.iter { 68,742 ( 0.00%) acc = iter.try_fold(acc, fold)?; 1,649,808 ( 0.08%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/map.rs:, clippy_utils::macros::first_node_macro_backtrace::{closure#0}> as core::iter::traits::iterator::Iterator>::try_fold::<(), >::iter_try_fold::flatten, clippy_utils::macros::macro_backtrace::{closure#0}>, clippy_utils::macros::first_node_macro_backtrace::{closure#0}::{closure#0}>, (), core::ops::control_flow::ControlFlow, as core::iter::traits::iterator::Iterator>::try_fold::flatten, clippy_utils::macros::macro_backtrace::{closure#0}>, clippy_utils::macros::first_node_macro_backtrace::{closure#0}::{closure#0}>, (), core::ops::control_flow::ControlFlow, core::iter::traits::iterator::Iterator::find::check::{closure#0}>::{closure#0}>::{closure#0}, core::ops::control_flow::ControlFlow> (68,742x) . } . try { acc } . } . . #[inline] . fn find

(&mut self, predicate: P) -> Option . where . P: FnMut(&Self::Item) -> bool, -- line 438 ---------------------------------------- 5 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint/src/levels.rs -------------------------------------------------------------------------------- Ir -- line 482 ---------------------------------------- . } . } . . impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> . where . LevelSpec: Into, . { . pub(crate) fn sess(&self) -> &Session { 265,590 ( 0.01%) self.sess . } . . pub(crate) fn features(&self) -> &Features { . self.features . } . . fn add_command_line(&mut self) { . for &(ref lint_name, level) in &self.sess.opts.lint_opts { -- line 498 ---------------------------------------- -- line 996 ---------------------------------------- . ); . } . . false . } . . /// Find the lint level for a lint. . pub fn lint_level_spec(&self, lint: &'static Lint) -> LevelSpec { 19,129 ( 0.00%) self.provider.get_lint_level_spec(lint, self.sess) 167 ( 0.00%) => ???:::get_lint_level_spec (1x) . } . . /// Used to emit a lint-related diagnostic based on the current state of . /// this lint context. . #[track_caller] . pub(crate) fn opt_span_lint( . &self, . lint: &'static Lint, . span: Option, . decorator: impl for<'a> Diagnostic<'a, ()>, . ) { . let level_spec = self.lint_level_spec(lint); 3,009 ( 0.00%) emit_lint_base(self.sess, lint, level_spec, span, decorator) . } . . #[track_caller] . pub fn emit_span_lint( . &self, . lint: &'static Lint, . span: MultiSpan, . decorator: impl for<'a> Diagnostic<'a, ()>, -- line 1025 ---------------------------------------- 7,040 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/unneeded_struct_pattern.rs -------------------------------------------------------------------------------- Ir -- line 36 ---------------------------------------- . pub UNNEEDED_STRUCT_PATTERN, . style, . "using struct pattern to match against unit variant" . } . . declare_lint_pass!(UnneededStructPattern => [UNNEEDED_STRUCT_PATTERN]); . . impl LateLintPass<'_> for UnneededStructPattern { 17,759 ( 0.00%) fn check_pat(&mut self, cx: &LateContext<'_>, pat: &Pat<'_>) { 5,074 ( 0.00%) if !pat.span.from_expansion() 7,440 ( 0.00%) && let PatKind::Struct(path, [], _) = &pat.kind . && let QPath::Resolved(_, path) = path . && let Res::Def(DefKind::Variant, did) = path.res . { . let enum_did = cx.tcx.parent(did); . let variant = cx.tcx.adt_def(enum_did).variant_with_id(did); . . let has_only_fields_brackets = variant.ctor.is_some() && variant.fields.is_empty(); . let non_exhaustive_activated = variant.field_list_has_applicable_non_exhaustive(); -- line 54 ---------------------------------------- -- line 67 ---------------------------------------- . brackets_span, . "struct pattern is not needed for a unit variant", . "remove the struct pattern", . String::new(), . Applicability::MachineApplicable, . ); . } . } 20,296 ( 0.00%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/filter_map.rs -------------------------------------------------------------------------------- Ir -- line 16 ---------------------------------------- . #[stable(feature = "rust1", since = "1.0.0")] . #[derive(Clone)] . pub struct FilterMap { . iter: I, . f: F, . } . impl FilterMap { . pub(in crate::iter) const fn new(iter: I, f: F) -> FilterMap { 2,390 ( 0.00%) FilterMap { iter, f } . } . } . . #[stable(feature = "core_impl_debug", since = "1.9.0")] . impl fmt::Debug for FilterMap { . fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { . f.debug_struct("FilterMap").field("iter", &self.iter).finish() . } . } . . fn filter_map_fold( . mut f: impl FnMut(T) -> Option, . mut fold: impl FnMut(Acc, B) -> Acc, . ) -> impl FnMut(Acc, T) -> Acc { 667 ( 0.00%) move |acc, item| match f(item) { . Some(x) => fold(acc, x), 952 ( 0.00%) None => acc, . } . } . . fn filter_map_try_fold<'a, T, B, Acc, R: Try>( . f: &'a mut impl FnMut(T) -> Option, . mut fold: impl FnMut(Acc, B) -> R + 'a, . ) -> impl FnMut(Acc, T) -> R + 'a { 8 ( 0.00%) move |acc, item| match f(item) { . Some(x) => fold(acc, x), . None => try { acc }, . } . } . . #[stable(feature = "rust1", since = "1.0.0")] . impl Iterator for FilterMap . where -- line 57 ---------------------------------------- -- line 130 ---------------------------------------- . . #[inline] . fn try_fold(&mut self, init: Acc, fold: Fold) -> R . where . Self: Sized, . Fold: FnMut(Acc, Self::Item) -> R, . R: Try, . { 56 ( 0.00%) self.iter.try_fold(init, filter_map_try_fold(&mut self.f, fold)) . } . . #[inline] . fn fold(self, init: Acc, fold: Fold) -> Acc . where . Fold: FnMut(Acc, Self::Item) -> Acc, . { 448 ( 0.00%) self.iter.fold(init, filter_map_fold(self.f, fold)) . } . } . . #[stable(feature = "rust1", since = "1.0.0")] . impl DoubleEndedIterator for FilterMap . where . F: FnMut(I::Item) -> Option, . { -- line 154 ---------------------------------------- 70,201 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_resolve/src/rustdoc.rs -------------------------------------------------------------------------------- Ir -- line 199 ---------------------------------------- . . pub fn attrs_to_doc_fragments<'a, A: AttributeExt + Clone + 'a>( . attrs: impl Iterator)>, . doc_only: bool, . ) -> (Vec, ThinVec) { . let (min_size, max_size) = attrs.size_hint(); . let size_hint = max_size.unwrap_or(min_size); . let mut doc_fragments = Vec::with_capacity(size_hint); 142,112 ( 0.01%) let mut other_attrs = ThinVec::::with_capacity(if doc_only { 0 } else { size_hint }); . for (attr, item_id) in attrs { . if let Some((doc_str, fragment_kind)) = attr.doc_str_and_fragment_kind() { 414 ( 0.00%) let doc = beautify_doc_string(doc_str, fragment_kind.comment_kind()); 18,033 ( 0.00%) => ???:rustc_ast::util::comments::beautify_doc_string (138x) 552 ( 0.00%) let attr_span = attr.span(); 276 ( 0.00%) let (span, from_expansion) = match fragment_kind { . DocFragmentKind::Sugared(_) => (attr_span, attr_span.from_expansion()), . DocFragmentKind::Raw(value_span) => { . (value_span.with_ctxt(attr_span.ctxt()), value_span.from_expansion()) . } . }; . let fragment = . DocFragment { span, doc, kind: fragment_kind, item_id, indent: 0, from_expansion }; . doc_fragments.push(fragment); -- line 220 ---------------------------------------- -- line 221 ---------------------------------------- . } else if !doc_only { . other_attrs.push(attr.clone()); . } . } . . doc_fragments.shrink_to_fit(); . other_attrs.shrink_to_fit(); . 70,938 ( 0.00%) unindent_doc_fragments(&mut doc_fragments); 1,593,569 ( 0.07%) => ???:rustc_resolve::rustdoc::unindent_doc_fragments (70,938x) . 425,628 ( 0.02%) (doc_fragments, other_attrs) . } . . /// Return the doc-comments on this item, grouped by the module they came from. . /// The module can be different if this is a re-export with added documentation. . /// . /// The last newline is not trimmed so the produced strings are reusable between . /// early and late doc link resolution regardless of their position. . pub fn prepare_to_doc_link_resolution( -- line 239 ---------------------------------------- 512 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/misc_early/unneeded_field_pattern.rs -------------------------------------------------------------------------------- Ir . use clippy_utils::diagnostics::{span_lint, span_lint_and_then}; . use clippy_utils::source::SpanExt as _; . use itertools::Itertools as _; . use rustc_ast::ast::{Pat, PatKind}; . use rustc_lint::{EarlyContext, LintContext as _}; . . use super::UNNEEDED_FIELD_PATTERN; . 20,056 ( 0.00%) pub(super) fn check(cx: &EarlyContext<'_>, pat: &Pat) { 5,014 ( 0.00%) if let PatKind::Struct(_, ref npat, ref pfields, _) = pat.kind { . let mut wilds = 0; . let type_name = npat . .segments . .last() . .expect("A path must have at least one segment") . .ident . .name; . -- line 18 ---------------------------------------- -- line 69 ---------------------------------------- . )); . }, . ); . } . } . } . } . } 20,056 ( 0.00%) } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/from_str_radix_10.rs -------------------------------------------------------------------------------- Ir -- line 38 ---------------------------------------- . pub FROM_STR_RADIX_10, . style, . "from_str_radix with radix 10" . } . . declare_lint_pass!(FromStrRadix10 => [FROM_STR_RADIX_10]); . . impl<'tcx> LateLintPass<'tcx> for FromStrRadix10 { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, exp: &Expr<'tcx>) { 137,882 ( 0.01%) if let ExprKind::Call(maybe_path, [src, radix]) = &exp.kind 50 ( 0.00%) && let ExprKind::Path(QPath::TypeRelative(ty, pathseg)) = &maybe_path.kind . . // check if the second argument is a primitive `10` . && is_integer_literal(radix, 10) . . // check if the second part of the path indeed calls the associated . // function `from_str_radix` . && pathseg.ident.name == sym::from_str_radix . -- line 56 ---------------------------------------- -- line 79 ---------------------------------------- . FROM_STR_RADIX_10, . exp.span, . "this call to `from_str_radix` can be replaced with a call to `str::parse`", . "try", . format!("{sugg}.parse::<{}>()", prim_ty.name_str()), . Applicability::MaybeIncorrect, . ); . } 549,936 ( 0.03%) } . } . . /// Checks if a Ty is `String` or `&str` . fn is_ty_stringish(cx: &LateContext<'_>, ty: Ty<'_>) -> bool { . ty.is_lang_item(cx, LangItem::String) || ty.peel_refs().is_str() . } 1 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/useless_vec.rs -------------------------------------------------------------------------------- Ir -- line 43 ---------------------------------------- . /// work, we get a false positive warning on the `$v.push(3)` which really requires `$v` to . /// be a vector. . span_to_state: BTreeMap, . allow_in_test: bool, . } . . impl UselessVec { . pub fn new(conf: &'static Conf) -> Self { 5 ( 0.00%) Self { . too_large_for_stack: conf.too_large_for_stack, . msrv: conf.msrv.into(), . span_to_state: BTreeMap::new(), 2 ( 0.00%) allow_in_test: conf.allow_useless_vec_in_tests, . } . } . } . . declare_clippy_lint! { . /// ### What it does . /// Checks for usage of `vec![..]` when using `[..]` would . /// be possible. -- line 63 ---------------------------------------- -- line 166 ---------------------------------------- . VecToArray::Impossible . } . }, . } . } . } . . impl<'tcx> LateLintPass<'tcx> for UselessVec { 618,678 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 274,968 ( 0.01%) if let Some(vec_args) = higher::VecArgs::hir(cx, expr.peel_borrows()) 1,183,578 ( 0.06%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (68,742x) . // The `vec![]` or `&vec![]` invocation span. . && let vec_span = expr.span.parent_callsite().unwrap_or(expr.span) . && !vec_span.from_expansion() . { . if self.allow_in_test && is_in_test(cx.tcx, expr.hir_id) { . return; . } . -- line 183 ---------------------------------------- -- line 232 ---------------------------------------- . }); . } . }, . VecToArray::Impossible => { . self.span_to_state.insert(vec_span, VecState::NoChange); . }, . } . } 549,936 ( 0.03%) } . 8 ( 0.00%) fn check_crate_post(&mut self, cx: &LateContext<'tcx>) { 10 ( 0.00%) for (span, state) in mem::take(&mut self.span_to_state) { . if let VecState::Change { . suggest_ty, . vec_snippet, . expr_hir_id, . } = state . { . span_lint_hir_and_then(cx, USELESS_VEC, expr_hir_id, span, "useless use of `vec!`", |diag| { . let help_msg = format!("you can use {} directly", suggest_ty.desc()); -- line 251 ---------------------------------------- -- line 255 ---------------------------------------- . Applicability::Unspecified . } else { . Applicability::MachineApplicable . }; . diag.span_suggestion(span, help_msg, vec_snippet, applicability); . }); . } . } 8 ( 0.00%) } . } . . #[derive(Copy, Clone)] . pub(crate) enum SuggestedType { . /// Suggest using a slice `&[..]` / `&mut [..]` . SliceRef(Mutability), . /// Suggest using an array: `[..]` . Array, -- line 271 ---------------------------------------- 1 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/ifs/mod.rs -------------------------------------------------------------------------------- Ir -- line 174 ---------------------------------------- . . pub struct CopyAndPaste<'tcx> { . interior_mut: InteriorMut<'tcx>, . } . . impl<'tcx> CopyAndPaste<'tcx> { . pub fn new(tcx: TyCtxt<'tcx>, conf: &'static Conf) -> Self { . Self { 4 ( 0.00%) interior_mut: InteriorMut::new(tcx, &conf.ignore_interior_mutability), 14,013 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:::new (1x) . } . } . } . . impl<'tcx> LateLintPass<'tcx> for CopyAndPaste<'tcx> { 618,678 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 137,484 ( 0.01%) if expr.span.from_expansion() { . return; . } 342,632 ( 0.02%) if matches!(expr.kind, ExprKind::If(..)) && !is_else_clause(cx.tcx, expr) { 3,976 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_else_clause (28x) 252 ( 0.00%) let (conds, blocks) = if_sequence(expr); 6,253 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::if_sequence (28x) 168 ( 0.00%) ifs_same_cond::check(cx, &conds, &mut self.interior_mut); 2,016 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/ifs/ifs_same_cond.rs:clippy_lints::ifs::ifs_same_cond::check (28x) 112 ( 0.00%) same_functions_in_if_cond::check(cx, &conds); 1,988 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/ifs/same_functions_in_if_cond.rs:clippy_lints::ifs::same_functions_in_if_cond::check (28x) . let all_same = 364 ( 0.00%) !is_lint_allowed(cx, IF_SAME_THEN_ELSE, expr.hir_id) && if_same_then_else::check(cx, &conds, &blocks); 38,553 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_lint_allowed (28x) 6,717 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/ifs/if_same_then_else.rs:clippy_lints::ifs::if_same_then_else::check (28x) 74 ( 0.00%) if !all_same && conds.len() != blocks.len() { 63 ( 0.00%) branches_sharing_code::check(cx, &conds, &blocks, expr); 33,580 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/ifs/branches_sharing_code.rs:clippy_lints::ifs::branches_sharing_code::check (9x) . } 58 ( 0.00%) } else if let ExprKind::Match(_, arms, _) = expr.kind { 319 ( 0.00%) branches_sharing_code::check_match(cx, expr, arms); 11,961 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/ifs/branches_sharing_code.rs:clippy_lints::ifs::branches_sharing_code::check_match (29x) . } 549,480 ( 0.03%) } . } 84 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/implicit_saturating_add.rs -------------------------------------------------------------------------------- Ir -- line 35 ---------------------------------------- . pub IMPLICIT_SATURATING_ADD, . style, . "Perform saturating addition instead of implicitly checking max bound of data type" . } . . declare_lint_pass!(ImplicitSaturatingAdd => [IMPLICIT_SATURATING_ADD]); . . impl<'tcx> LateLintPass<'tcx> for ImplicitSaturatingAdd { 481,194 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 137,561 ( 0.01%) if let ExprKind::If(cond, then, None) = expr.kind 4 ( 0.00%) && let Some((c, op_node, l)) = get_const(cx, cond) 20 ( 0.00%) && let BinOpKind::Ne | BinOpKind::Lt = op_node 5 ( 0.00%) && let ExprKind::Block(block, None) = then.kind 3 ( 0.00%) && let Block { . stmts: 5 ( 0.00%) [ . Stmt { 1 ( 0.00%) kind: StmtKind::Expr(ex) | StmtKind::Semi(ex), . .. . }, . ], . expr: None, . .. . } . | Block { . stmts: [], . expr: Some(ex), . .. 3 ( 0.00%) } = block 3 ( 0.00%) && let ExprKind::AssignOp(op1, target, value) = ex.kind . && let ty = cx.typeck_results().expr_ty(target) . && Some(c) == get_int_max(ty) . && let ctxt = expr.span.ctxt() . && ex.span.ctxt() == ctxt . && cond.span.ctxt() == ctxt . && clippy_utils::SpanlessEq::new(cx).eq_expr(ctxt, l, target) . && AssignOpKind::AddAssign == op1.node . && let ExprKind::Lit(lit) = value.kind -- line 72 ---------------------------------------- -- line 88 ---------------------------------------- . IMPLICIT_SATURATING_ADD, . expr.span, . "manual saturating add detected", . "use instead", . sugg, . app, . ); . } 549,936 ( 0.03%) } . } . . fn get_int_max(ty: Ty<'_>) -> Option { . use rustc_middle::ty::{Int, Uint}; . match ty.peel_refs().kind() { . Int(IntTy::I8) => i8::MAX.try_into().ok(), . Int(IntTy::I16) => i16::MAX.try_into().ok(), . Int(IntTy::I32) => i32::MAX.try_into().ok(), -- line 104 ---------------------------------------- -- line 111 ---------------------------------------- . Uint(UintTy::U64) => Some(u64::MAX.into()), . Uint(UintTy::U128) => Some(u128::MAX), . Uint(UintTy::Usize) => usize::MAX.try_into().ok(), . _ => None, . } . } . . fn get_const<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'tcx>) -> Option<(u128, BinOpKind, &'tcx Expr<'tcx>)> { 74 ( 0.00%) if let ExprKind::Binary(op, l, r) = expr.kind { 12 ( 0.00%) let ecx = ConstEvalCtxt::new(cx); 672 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::new (12x) 12 ( 0.00%) let ctxt = expr.span.ctxt(); 96 ( 0.00%) if let Some(Constant::Int(c)) = ecx.eval_local(r, ctxt) { 6,416 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval_local (12x) . return Some((c, op.node, l)); . } 40 ( 0.00%) if let Some(Constant::Int(c)) = ecx.eval_local(l, ctxt) { 1,486 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval_local (8x) . return Some((c, invert_op(op.node)?, r)); . } . } . None . } . . fn invert_op(op: BinOpKind) -> Option { . use rustc_hir::BinOpKind::{Ge, Gt, Le, Lt, Ne}; -- line 133 ---------------------------------------- 121 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/disallowed_methods.rs -------------------------------------------------------------------------------- Ir -- line 64 ---------------------------------------- . impl_lint_pass!(DisallowedMethods => [DISALLOWED_METHODS]); . . pub struct DisallowedMethods { . disallowed: DefIdMap<(&'static str, &'static DisallowedPath)>, . } . . impl DisallowedMethods { . pub fn new(tcx: TyCtxt<'_>, conf: &'static Conf) -> Self { 10 ( 0.00%) let (disallowed, _) = create_disallowed_map( 38 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_config/src/types.rs:clippy_config::types::create_disallowed_map::::new::{closure#0}> (1x) . tcx, . &conf.disallowed_methods, . PathNS::Value, . |def_kind| { . matches!( . def_kind, . DefKind::Fn | DefKind::Ctor(_, CtorKind::Fn) | DefKind::AssocFn . ) . }, . "function", . false, 1 ( 0.00%) ); 4 ( 0.00%) Self { disallowed } . } . } . . impl<'tcx> LateLintPass<'tcx> for DisallowedMethods { 343,710 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 68,742 ( 0.00%) if self.disallowed.is_empty() { . return; . } . if expr.span.desugaring_kind().is_some() { . return; . } . let (id, span) = match &expr.kind { . ExprKind::Path(path) if let Res::Def(_, id) = cx.qpath_res(path, expr.hir_id) => (id, expr.span), . ExprKind::MethodCall(name, ..) if let Some(id) = cx.typeck_results().type_dependent_def_id(expr.hir_id) => { -- line 99 ---------------------------------------- -- line 105 ---------------------------------------- . span_lint_and_then( . cx, . DISALLOWED_METHODS, . span, . format!("use of a disallowed method `{path}`"), . disallowed_path.diag_amendment(span), . ); . } 412,452 ( 0.02%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/mut_ptr.rs -------------------------------------------------------------------------------- Ir -- line 467 ---------------------------------------- . #[must_use = "returns a new pointer rather than modifying its argument"] . #[rustc_const_stable(feature = "const_ptr_offset", since = "1.61.0")] . #[inline(always)] . pub const fn wrapping_offset(self, count: isize) -> *mut T . where . T: Sized, . { . // SAFETY: the `arith_offset` intrinsic has no prerequisites to be called. 7 ( 0.00%) unsafe { intrinsics::arith_offset(self, count) as *mut T } . } . . /// Adds a signed offset in bytes to a pointer using wrapping arithmetic. . /// . /// `count` is in units of **bytes**. . /// . /// This is purely a convenience for casting to a `u8` pointer and . /// using [wrapping_offset][pointer::wrapping_offset] on it. See that method -- line 483 ---------------------------------------- -- line 963 ---------------------------------------- . ( . this: *const () = self as *const (), . count: usize = count, . size: usize = size_of::(), . ) => runtime_add_nowrap(this, count, size) . ); . . // SAFETY: the caller must uphold the safety contract for `offset`. 377,211 ( 0.02%) unsafe { intrinsics::offset(self, count) } . } . . /// Adds an unsigned offset in bytes to a pointer. . /// . /// `count` is in units of bytes. . /// . /// This is purely a convenience for casting to a `u8` pointer and . /// using [add][pointer::add] on it. See that method for documentation -- line 979 ---------------------------------------- -- line 1047 ---------------------------------------- . . if T::IS_ZST { . // Pointer arithmetic does nothing when the pointee is a ZST. . self . } else { . // SAFETY: the caller must uphold the safety contract for `offset`. . // Because the pointee is *not* a ZST, that means that `count` is . // at most `isize::MAX`, and thus the negation cannot overflow. 14,807 ( 0.00%) unsafe { intrinsics::offset(self, intrinsics::unchecked_sub(0, count as isize)) } . } . } . . /// Subtracts an unsigned offset in bytes from a pointer. . /// . /// `count` is in units of bytes. . /// . /// This is purely a convenience for casting to a `u8` pointer and -- line 1063 ---------------------------------------- 81,324 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/utils/author.rs -------------------------------------------------------------------------------- Ir -- line 96 ---------------------------------------- . } else { . println!(" && {}", format_args!($($t)*)); . } . } . } . . impl<'tcx> LateLintPass<'tcx> for Author { . fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>) { 426 ( 0.00%) check_item(cx, item.hir_id()); 34,812 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/utils/author.rs:clippy_lints::utils::author::check_item (213x) . } . . fn check_impl_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::ImplItem<'_>) { 98 ( 0.00%) check_item(cx, item.hir_id()); 11,320 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/utils/author.rs:clippy_lints::utils::author::check_item (49x) . } . . fn check_trait_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::TraitItem<'_>) { 12 ( 0.00%) check_item(cx, item.hir_id()); 726 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/utils/author.rs:clippy_lints::utils::author::check_item (6x) . } . 13,662 ( 0.00%) fn check_arm(&mut self, cx: &LateContext<'tcx>, arm: &'tcx hir::Arm<'_>) { 3,036 ( 0.00%) check_node(cx, arm.hir_id, |v| { . v.arm(&v.bind("arm", arm)); . }); 12,144 ( 0.00%) } . 618,678 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) { 137,484 ( 0.01%) check_node(cx, expr.hir_id, |v| { . v.expr(&v.bind("expr", expr)); . }); 549,936 ( 0.03%) } . 1,440 ( 0.00%) fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx hir::Stmt<'_>) { 884 ( 0.00%) match stmt.kind { 488 ( 0.00%) StmtKind::Expr(e) | StmtKind::Semi(e) if has_attr(cx, e.hir_id) => return, . _ => {}, . } 320 ( 0.00%) check_node(cx, stmt.hir_id, |v| { . v.stmt(&v.bind("stmt", stmt)); . }); 1,280 ( 0.00%) } . } . 2,412 ( 0.00%) fn check_item(cx: &LateContext<'_>, hir_id: HirId) { 1,340 ( 0.00%) if let Some(body) = cx.tcx.hir_maybe_body_owned_by(hir_id.expect_owner().def_id) { 30,855 ( 0.00%) => ???:::hir_maybe_body_owned_by (268x) . check_node_with_body( . cx, . hir_id, 126 ( 0.00%) |v| { . v.expr(&v.bind("expr", body.value)); . }, . Some(body), . ); . } 2,144 ( 0.00%) } . . fn check_node(cx: &LateContext<'_>, hir_id: HirId, f: impl Fn(&PrintVisitor<'_, '_>)) { . check_node_with_body(cx, hir_id, f, None); . } . . /// Check the node at `hir_id`, in the context of `body` or the default from `cx` if none is given. . fn check_node_with_body( . cx: &LateContext<'_>, . hir_id: HirId, . f: impl Fn(&PrintVisitor<'_, '_>), . body: Option<&Body<'_>>, . ) { 70,383 ( 0.00%) if has_attr(cx, hir_id) { . let typeck_results = body.map_or_else(|| cx.typeck_results(), |body| cx.tcx.typeck_body(body.id())); . f(&PrintVisitor::new(cx, typeck_results)); . println!("{{"); . println!(" // report your lint here"); . println!("}}"); . } . } . -- line 170 ---------------------------------------- -- line 875 ---------------------------------------- . kind!("Semi({e})"); . self.expr(e); . }, . } . } . } . . fn has_attr(cx: &LateContext<'_>, hir_id: HirId) -> bool { 71,328 ( 0.00%) let attrs = cx.tcx.hir_attrs(hir_id); 6,139 ( 0.00%) => ???:::hir_attrs (126x) 334 ( 0.00%) get_builtin_attr(attrs, sym::author).count() > 0 . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/functions/result.rs -------------------------------------------------------------------------------- Ir -- line 10 ---------------------------------------- . use clippy_utils::diagnostics::{span_lint_and_help, span_lint_and_then}; . use clippy_utils::ty::{AdtVariantInfo, approx_ty_size}; . use clippy_utils::{is_no_std_crate, trait_ref_of_method}; . . use super::{RESULT_LARGE_ERR, RESULT_UNIT_ERR}; . . /// The type of the `Err`-variant in a `std::result::Result` returned by the . /// given `FnDecl` 1,078 ( 0.00%) fn result_err_ty<'tcx>( . cx: &LateContext<'tcx>, . decl: &hir::FnDecl<'tcx>, . id: hir::def_id::LocalDefId, . item_span: Span, . ) -> Option<(&'tcx hir::Ty<'tcx>, Ty<'tcx>)> { 392 ( 0.00%) if !item_span.in_external_macro(cx.sess().source_map()) . && let hir::FnRetTy::Return(hir_ty) = decl.output . { . let mut ty = cx . .tcx 400 ( 0.00%) .instantiate_bound_regions_with_erased(cx.tcx.fn_sig(id).instantiate_identity().skip_norm_wip().output()); 2,160 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/ty/fold.rs:::instantiate_bound_regions_with_erased:: (80x) . . // for async functions, peel through `impl Future` to get `T` 400 ( 0.00%) if cx.tcx.ty_is_opaque_future(ty) 1,440 ( 0.00%) => ???:::ty_is_opaque_future (80x) . && let Some(future_output_ty) = cx.tcx.get_impl_future_output_ty(ty) . { . ty = future_output_ty; . } . 160 ( 0.00%) if let ty::Adt(adt_def, args) = ty.kind() 348 ( 0.00%) && cx.tcx.is_diagnostic_item(sym::Result, adt_def.did()) 3,279 ( 0.00%) => ???:::is_diagnostic_item (58x) . { 3 ( 0.00%) let err_ty = args.type_at(1); . return Some((hir_ty, err_ty)); . } . } . None 882 ( 0.00%) } . 1,917 ( 0.00%) pub(super) fn check_item<'tcx>( . cx: &LateContext<'tcx>, . item: &hir::Item<'tcx>, . large_err_threshold: u64, . large_err_ignored: &DefIdSet, . msrv: Msrv, . ) { 426 ( 0.00%) if let hir::ItemKind::Fn { ref sig, .. } = item.kind 564 ( 0.00%) && let Some((hir_ty, err_ty)) = result_err_ty(cx, sig.decl, item.owner_id.def_id, item.span) 11,863 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::result_err_ty (47x) . { . if cx.effective_visibilities.is_exported(item.owner_id.def_id) { . let fn_header_span = item.span.with_hi(sig.decl.output.span().hi()); . check_result_unit_err(cx, err_ty, fn_header_span, msrv); . } . check_result_large_err(cx, err_ty, hir_ty.span, large_err_threshold, large_err_ignored, false); . } 1,704 ( 0.00%) } . 441 ( 0.00%) pub(super) fn check_impl_item<'tcx>( . cx: &LateContext<'tcx>, . item: &hir::ImplItem<'tcx>, . large_err_threshold: u64, . large_err_ignored: &DefIdSet, . msrv: Msrv, . ) { . // Don't lint if method is a trait's implementation, we can't do anything about those 98 ( 0.00%) if let hir::ImplItemKind::Fn(ref sig, _) = item.kind 540 ( 0.00%) && let Some((hir_ty, err_ty)) = result_err_ty(cx, sig.decl, item.owner_id.def_id, item.span) 11,127 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::result_err_ty (45x) 12 ( 0.00%) && trait_ref_of_method(cx, item.owner_id).is_none() 567 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::trait_ref_of_method (3x) . { . if cx.effective_visibilities.is_exported(item.owner_id.def_id) { . let fn_header_span = item.span.with_hi(sig.decl.output.span().hi()); . check_result_unit_err(cx, err_ty, fn_header_span, msrv); . } . check_result_large_err(cx, err_ty, hir_ty.span, large_err_threshold, large_err_ignored, false); . } 392 ( 0.00%) } . 60 ( 0.00%) pub(super) fn check_trait_item<'tcx>( . cx: &LateContext<'tcx>, . item: &hir::TraitItem<'tcx>, . large_err_threshold: u64, . large_err_ignored: &DefIdSet, . msrv: Msrv, . ) { 12 ( 0.00%) if let hir::TraitItemKind::Fn(ref sig, _) = item.kind { 12 ( 0.00%) let fn_header_span = item.span.with_hi(sig.decl.output.span().hi()); 66 ( 0.00%) if let Some((hir_ty, err_ty)) = result_err_ty(cx, sig.decl, item.owner_id.def_id, item.span) { 1,686 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::result_err_ty (6x) . if cx.effective_visibilities.is_exported(item.owner_id.def_id) { . check_result_unit_err(cx, err_ty, fn_header_span, msrv); . } . check_result_large_err(cx, err_ty, hir_ty.span, large_err_threshold, large_err_ignored, false); . } . } 48 ( 0.00%) } . . fn check_result_unit_err(cx: &LateContext<'_>, err_ty: Ty<'_>, fn_header_span: Span, msrv: Msrv) { . if err_ty.is_unit() && (!is_no_std_crate(cx) || msrv.meets(cx, msrvs::ERROR_IN_CORE)) { . span_lint_and_help( . cx, . RESULT_UNIT_ERR, . fn_header_span, . "this returns a `Result<_, ()>`", -- line 110 ---------------------------------------- -- line 178 ---------------------------------------- . diag.span_label(hir_ty_span, format!("the `Err`-variant is at least {ty_size} bytes")); . diag.help(format!("try reducing the size of `{err_ty}`, for example by boxing large elements or replacing it with `Box<{err_ty}>`")); . }, . ); . } . } . } . 481,194 ( 0.02%) pub(super) fn check_expr<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx hir::Expr<'tcx>, . large_err_threshold: u64, . large_err_ignored: &DefIdSet, . ) { 137,484 ( 0.01%) if let hir::ExprKind::Closure(closure) = expr.kind 36 ( 0.00%) && let ty::Closure(_, args) = cx.typeck_results().expr_ty(expr).kind() 480 ( 0.00%) => ???:::expr_ty (12x) 12 ( 0.00%) && let closure_sig = args.as_closure().sig() . && let Ok(err_binder) = closure_sig.output().try_map_bound(|output_ty| { 24 ( 0.00%) if let ty::Adt(adt, args) = output_ty.kind() 15 ( 0.00%) && let [_, err_arg] = args.as_slice() . && let Some(err_ty) = err_arg.as_type() . && adt.is_diag_item(cx, sym::Result) . { . return Ok(err_ty); . } . . Err(()) . }) -- line 205 ---------------------------------------- -- line 206 ---------------------------------------- . { . let err_ty = cx.tcx.instantiate_bound_regions_with_erased(err_binder); . let hir_ty_span = match closure.fn_decl.output { . hir::FnRetTy::Return(hir_ty) => hir_ty.span, . hir::FnRetTy::DefaultReturn(_) => expr.span, . }; . check_result_large_err(cx, err_ty, hir_ty_span, large_err_threshold, large_err_ignored, true); . } 549,936 ( 0.03%) } 223 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/needless_borrowed_ref.rs -------------------------------------------------------------------------------- Ir -- line 31 ---------------------------------------- . pub NEEDLESS_BORROWED_REFERENCE, . complexity, . "destructuring a reference and borrowing the inner value" . } . . declare_lint_pass!(NeedlessBorrowedRef => [NEEDLESS_BORROWED_REFERENCE]); . . impl<'tcx> LateLintPass<'tcx> for NeedlessBorrowedRef { 17,759 ( 0.00%) fn check_pat(&mut self, cx: &LateContext<'tcx>, ref_pat: &'tcx Pat<'_>) { 5,094 ( 0.00%) if let PatKind::Ref(pat, Pinnedness::Not, Mutability::Not) = ref_pat.kind 8 ( 0.00%) && !ref_pat.span.from_expansion() 4 ( 0.00%) && cx . .tcx 4 ( 0.00%) .hir_parent_iter(ref_pat.hir_id) 6 ( 0.00%) .map_while(|(_, parent)| if let Node::Pat(pat) = parent { Some(pat) } else { None }) . // Do not lint patterns that are part of an OR `|` pattern, the binding mode must match in all arms 2 ( 0.00%) .all(|pat| !matches!(pat.kind, PatKind::Or(_))) . { 46 ( 0.00%) match pat.kind { . // Check sub_pat got a `ref` keyword (excluding `ref mut`). . PatKind::Binding(BindingMode::REF, _, ident, None) => { . span_lint_and_then( . cx, . NEEDLESS_BORROWED_REFERENCE, . ref_pat.span, . "this pattern takes a reference on something that is being dereferenced", . |diag| { -- line 57 ---------------------------------------- -- line 100 ---------------------------------------- . ref_pat, . pat, . fields.iter().map(|field| field.pat), . ); . }, . _ => {}, . } . } 20,296 ( 0.00%) } . } . . fn check_subpatterns<'tcx>( . cx: &LateContext<'tcx>, . message: &'static str, . ref_pat: &Pat<'_>, . pat: &Pat<'_>, . subpatterns: impl IntoIterator>, -- line 116 ---------------------------------------- 12 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/macro_metavars_in_unsafe.rs -------------------------------------------------------------------------------- Ir -- line 106 ---------------------------------------- . /// } . /// } . /// ``` . metavar_expns: BTreeMap, . } . . impl ExprMetavarsInUnsafe { . pub fn new(conf: &'static Conf) -> Self { 3 ( 0.00%) Self { . warn_unsafe_macro_metavars_in_private_macros: conf.warn_unsafe_macro_metavars_in_private_macros, . metavar_expns: BTreeMap::new(), . } . } . } . . struct BodyVisitor<'a, 'tcx> { . /// Stack of unsafe blocks -- the top item always represents the last seen unsafe block from -- line 122 ---------------------------------------- -- line 147 ---------------------------------------- . . fn is_public_macro(cx: &LateContext<'_>, def_id: LocalDefId) -> bool { . (cx.effective_visibilities.is_exported(def_id) || find_attr!(cx.tcx, def_id, MacroExport { .. })) . && !cx.tcx.is_doc_hidden(def_id) . } . . impl<'tcx> Visitor<'tcx> for BodyVisitor<'_, 'tcx> { . fn visit_stmt(&mut self, s: &'tcx Stmt<'tcx>) { 224 ( 0.00%) let from_expn = s.span.from_expansion(); . if from_expn { 11 ( 0.00%) self.expn_depth += 1; . } . walk_stmt(self, s); . if from_expn { 11 ( 0.00%) self.expn_depth -= 1; . } . } . 547,888 ( 0.03%) fn visit_expr(&mut self, e: &'tcx Expr<'tcx>) { 68,486 ( 0.00%) let ctxt = e.span.ctxt(); . 136,972 ( 0.01%) if let ExprKind::Block(block, _) = e.kind 165 ( 0.00%) && let BlockCheckMode::UnsafeBlock(UnsafeSource::UserProvided) = block.rules . && !ctxt.is_root() . && let Some(macro_def_id) = ctxt.outer_expn_data().macro_def_id . && let Some(macro_def_id) = macro_def_id.as_local() . && (self.lint.warn_unsafe_macro_metavars_in_private_macros || is_public_macro(self.cx, macro_def_id)) . { . self.macro_unsafe_blocks.push(block.hir_id); . self.expn_depth += 1; . walk_block(self, block); . self.expn_depth -= 1; . self.macro_unsafe_blocks.pop(); 273,504 ( 0.01%) } else if ctxt.is_root() && self.expn_depth > 0 { . let unsafe_block = self.macro_unsafe_blocks.last().copied(); . 16 ( 0.00%) match (self.lint.metavar_expns.entry(e.span), unsafe_block) { 40 ( 0.00%) (Entry::Vacant(e), None) => { 8 ( 0.00%) e.insert(MetavarState::ReferencedInSafe); . }, . (Entry::Vacant(e), Some(unsafe_block)) => { . e.insert(MetavarState::ReferencedInUnsafe { . unsafe_blocks: vec![unsafe_block], . }); . }, . (Entry::Occupied(mut e), None) => { . if let MetavarState::ReferencedInUnsafe { .. } = *e.get() { -- line 193 ---------------------------------------- -- line 201 ---------------------------------------- . unsafe_blocks.push(unsafe_block); . } . }, . } . . // NB: No need to visit descendant nodes. They're guaranteed to represent the same . // metavariable . } else { 205,434 ( 0.01%) walk_expr(self, e); 4,817,267 ( 0.22%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_expr:: (141x) . } 547,888 ( 0.03%) } . } . . impl<'tcx> LateLintPass<'tcx> for ExprMetavarsInUnsafe { 1,269 ( 0.00%) fn check_body(&mut self, cx: &LateContext<'tcx>, body: &rustc_hir::Body<'tcx>) { 1,128 ( 0.00%) if is_lint_allowed(cx, MACRO_METAVARS_IN_UNSAFE, body.value.hir_id) { 130,244 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_lint_allowed (141x) . return; . } . . // This BodyVisitor is separate and not part of the lint pass because there is no . // `check_stmt_post` on `(Late)LintPass`, which we'd need to detect when we're leaving a macro span . 846 ( 0.00%) let mut vis = BodyVisitor { . macro_unsafe_blocks: Vec::new(), . #[expect(clippy::bool_to_int_with_if)] // obfuscates the meaning 282 ( 0.00%) expn_depth: if body.value.span.from_expansion() { 1 } else { 0 }, . cx, . lint: self . }; . vis.visit_body(body); 987 ( 0.00%) } . . fn check_crate_post(&mut self, cx: &LateContext<'tcx>) { . // Aggregate all unsafe blocks from all spans: . // ``` . // macro_rules! x { . // ($w:expr, $x:expr, $y:expr) => { $w; unsafe { $w; $x; }; unsafe { $x; $y; }; } . // } . // $w: [] (unsafe#0 is never added because it was referenced in a safe context) . // $x: [unsafe#0, unsafe#1] . // $y: [unsafe#1] . // ``` . // We want to lint unsafe blocks #0 and #1 . let bad_unsafe_blocks = self . .metavar_expns . .values() 8 ( 0.00%) .filter_map(|state| match state { . MetavarState::ReferencedInUnsafe { unsafe_blocks } => Some(unsafe_blocks.as_slice()), . MetavarState::ReferencedInSafe => None, . }) . .flatten() . .copied() . .inspect(|&unsafe_block| { . let level_spec = cx.tcx.lint_level_spec_at_node(MACRO_METAVARS_IN_UNSAFE, unsafe_block); . if level_spec.is_expect() { -- line 255 ---------------------------------------- -- line 266 ---------------------------------------- . // The invocation doesn't matter. Also we want to dedupe by the unsafe block and not by anything . // related to the callsite. . let span = cx.tcx.hir_span(id); . . (id, Span::new(span.lo(), span.hi(), SyntaxContext::root(), None)) . }) . .dedup_by(|&(_, a), &(_, b)| a == b); . 20 ( 0.00%) for (id, span) in bad_unsafe_blocks { 354 ( 0.00%) => /home/moon/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/itertools-0.15.0/src/adaptors/coalesce.rs:, ::check_crate_post::{closure#0}>>>, ::check_crate_post::{closure#1}>, ::check_crate_post::{closure#2}>, itertools::adaptors::coalesce::DedupPred2CoalescePred<::check_crate_post::{closure#3}>, itertools::adaptors::coalesce::NoCount> as core::iter::traits::iterator::Iterator>::next (1x) . span_lint_hir_and_then( . cx, . MACRO_METAVARS_IN_UNSAFE, . id, . span, . "this macro expands metavariables in an unsafe block", . |diag| { . diag.note("this allows the user of the macro to write unsafe code outside of an unsafe block"); -- line 282 ---------------------------------------- -- line 284 ---------------------------------------- . "consider expanding any metavariables outside of this block, e.g. by storing them in a variable", . ); . diag.help( . "... or also expand referenced metavariables in a safe context to require an unsafe block at callsite", . ); . }, . ); . } 8 ( 0.00%) } . } 274,151 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/needless_nonzero_get.rs -------------------------------------------------------------------------------- Ir -- line 59 ---------------------------------------- . . impl NeedlessNonzeroGet { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl<'tcx> LateLintPass<'tcx> for NeedlessNonzeroGet { 549,936 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &Expr<'tcx>) { 480,602 ( 0.02%) match expr.kind { . // `.get().()` 220 ( 0.00%) ExprKind::MethodCall(method, get_call, [], _) 936 ( 0.00%) if let Some((recv, nz_ty, nonzero_did, get_span)) = nonzero_get(cx, get_call) 1,216 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/needless_nonzero_get.rs:clippy_lints::needless_nonzero_get::nonzero_get (78x) . // The outer call must resolve to an inherent method. A trait method of the same . // name could resolve differently once the receiver becomes a `NonZero`. . && let Some(method_did) = cx.typeck_results().type_dependent_def_id(expr.hir_id) . && cx.tcx.trait_of_assoc(method_did).is_none() . // Dropping `get` must leave the expression's type unchanged. Methods whose . // `NonZero` version returns a `NonZero` deliberately do not match. . && let ret_ty = cx.typeck_results().expr_ty(expr) . && has_matching_method(cx, nonzero_did, nz_ty, method.ident.name, ret_ty, self.msrv) => . { . emit_unnecessary_get(cx, expr, get_call, recv, get_span, method.ident.name.as_str()); . }, . . // ` / .get()` and ` % .get()` . ExprKind::Binary(op, lhs, get_call) 304 ( 0.00%) if matches!(op.node, BinOpKind::Div | BinOpKind::Rem) 60 ( 0.00%) && let Some((recv, nz_ty, _, get_span)) = nonzero_get(cx, get_call) 90 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/needless_nonzero_get.rs:clippy_lints::needless_nonzero_get::nonzero_get (6x) . && let Some((trait_lang_item, _)) = binop_traits(op.node) . && let Some(trait_id) = cx.tcx.lang_items().get(trait_lang_item) . && has_nonzero_operator(cx, lhs, recv, nz_ty, trait_id, self.msrv) => . { . emit_unnecessary_get(cx, expr, get_call, recv, get_span, op.node.as_str()); . }, . . // ` /= .get()` and ` %= .get()` . ExprKind::AssignOp(op, lhs, get_call) 8 ( 0.00%) if matches!(op.node, AssignOpKind::DivAssign | AssignOpKind::RemAssign) . && let Some((recv, nz_ty, _, get_span)) = nonzero_get(cx, get_call) . && let Some((_, trait_lang_item)) = binop_traits(op.node.into()) . && let Some(trait_id) = cx.tcx.lang_items().get(trait_lang_item) . && has_nonzero_operator(cx, lhs, recv, nz_ty, trait_id, self.msrv) => . { . emit_unnecessary_get(cx, expr, get_call, recv, get_span, op.node.as_str()); . }, . . _ => {}, . } 549,936 ( 0.03%) } . } . . /// Returns the receiver, its `NonZero` type and definition, and the `get` identifier span when . /// `expr` is an inherent `NonZero::get()` call. 420 ( 0.00%) fn nonzero_get<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'tcx>, . ) -> Option<(&'tcx Expr<'tcx>, Ty<'tcx>, DefId, Span)> { 198 ( 0.00%) let ExprKind::MethodCall(get, recv, [], get_span) = expr.kind else { . return None; . }; 8 ( 0.00%) if get.ident.name != sym::get { . return None; . } . let get_did = cx.typeck_results().type_dependent_def_id(expr.hir_id)?; . if cx.tcx.trait_of_assoc(get_did).is_some() { . return None; . } . let nz_ty = cx.typeck_results().expr_ty_adjusted(recv); . let ty::Adt(adt, _) = nz_ty.kind() else { . return None; . }; . if !cx.tcx.is_diagnostic_item(sym::NonZero, adt.did()) { . return None; . } . . Some((recv, nz_ty, adt.did(), get_span)) 504 ( 0.00%) } . . fn emit_unnecessary_get<'tcx>( . cx: &LateContext<'tcx>, . expr: &Expr<'tcx>, . get_call: &Expr<'tcx>, . recv: &Expr<'tcx>, . get_span: Span, . operation: &str, -- line 144 ---------------------------------------- 252 ( 0.00%) -------------------------------------------------------------------------------- The following files chosen for auto-annotation could not be found: -------------------------------------------------------------------------------- /rust/deps/hashbrown-0.17.1/src/map.rs /rust/deps/hashbrown-0.17.1/src/raw.rs /rust/deps/smallvec-1.15.1/src/lib.rs /rust/deps/thin-vec-0.2.19/src/lib.rs /rustc/84b36a78a28a63f134171c670be1932ffa2485f8/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/build/tikv-jemalloc-sys/80122c672fbe49ef/out/build/src/eset.c /rustc/84b36a78a28a63f134171c670be1932ffa2485f8/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/build/tikv-jemalloc-sys/80122c672fbe49ef/out/build/src/extent.c /rustc/84b36a78a28a63f134171c670be1932ffa2485f8/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/build/tikv-jemalloc-sys/80122c672fbe49ef/out/build/src/jemalloc.c /rustc/84b36a78a28a63f134171c670be1932ffa2485f8/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/build/tikv-jemalloc-sys/80122c672fbe49ef/out/build/src/large.c /rustc/84b36a78a28a63f134171c670be1932ffa2485f8/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/build/tikv-jemalloc-sys/80122c672fbe49ef/out/build/src/pa.c /rustc/84b36a78a28a63f134171c670be1932ffa2485f8/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/build/tikv-jemalloc-sys/80122c672fbe49ef/out/build/src/tcache.c include/jemalloc/internal/arena_inlines_b.h include/jemalloc/internal/atomic.h include/jemalloc/internal/bit_util.h include/jemalloc/internal/bitmap.h include/jemalloc/internal/cache_bin.h include/jemalloc/internal/div.h include/jemalloc/internal/edata.h include/jemalloc/internal/emap.h include/jemalloc/internal/extent.h include/jemalloc/internal/fb.h include/jemalloc/internal/jemalloc_internal_inlines_a.h include/jemalloc/internal/jemalloc_internal_inlines_b.h include/jemalloc/internal/jemalloc_internal_inlines_c.h include/jemalloc/internal/mutex.h include/jemalloc/internal/pai.h include/jemalloc/internal/ph.h include/jemalloc/internal/rtree.h include/jemalloc/internal/sz.h include/jemalloc/internal/tcache_inlines.h include/jemalloc/internal/thread_event.h include/jemalloc/internal/ticker.h include/jemalloc/internal/tsd.h include/jemalloc/internal/tsd_tls.h include/jemalloc/internal/util.h src/arena.c src/base.c src/bitmap.c src/decay.c src/emap.c src/eset.c src/extent.c src/extent_dss.c src/hook.c src/pa.c src/pac.c src/sz.c src/tcache.c src/thread_event.c -------------------------------------------------------------------------------- Ir -------------------------------------------------------------------------------- 415,022,892 (19.31%) events annotated