-------------------------------------------------------------------------------- Profile data file 'results/clgout-nightly-2026-08-15-cranelift-codegen-0.119.0-Clippy-IncrPatched0-Threads1' (creator: callgrind-3.25.1) -------------------------------------------------------------------------------- I1 cache: D1 cache: LL cache: Timerange: Basic block 0 - 2357202943 Trigger: Program termination Profiled target: /home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver --crate-name cranelift_codegen --edition=2021 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 --allow=clippy::all --warn=unused_import_braces --warn=unused_extern_crates --warn=unused-macro-rules --warn=unused-lifetimes --warn=unstable_features --warn=unsafe-attr-outside-unsafe --warn=clippy::unnecessary_to_owned --warn=clippy::unnecessary_mut_passed --warn=clippy::unnecessary_fallible_conversions --warn=clippy::unnecessary_cast --warn=clippy::uninlined_format_args --warn=unexpected_cfgs --warn=trivial_numeric_casts --warn=rust-2024-prelude-collisions --warn=rust-2024-incompatible-pat --warn=rust-2024-guarded-string-incompatible-syntax --warn=missing-unsafe-on-extern --warn=clippy::map_clone --warn=clippy::manual_strip --warn=keyword_idents_2024 --warn=impl-trait-overcaptures --warn=deprecated-safe-2024 --warn=clippy::clone_on_copy --warn=clippy::allow_attributes_without_reason --check-cfg cfg(pulley_tail_calls) --check-cfg cfg(pulley_assume_llvm_makes_tail_calls) --cfg feature="default" --cfg feature="gimli" --cfg feature="host-arch" --cfg feature="std" --cfg feature="timing" --cfg feature="unwind" --check-cfg cfg(docsrs,test) --check-cfg cfg(feature, values("all-arch", "all-native-arch", "anyhow", "arm64", "capstone", "core", "default", "disas", "enable-serde", "gimli", "host-arch", "incremental-cache", "isle-errors", "postcard", "pulley", "riscv64", "s390x", "serde", "serde_derive", "sha2", "souper-harvest", "souper-ir", "std", "timing", "trace-log", "unwind", "x86")) -C metadata=c9aff753ab68b4e7 -C extra-filename=-7fae94872cce255e --out-dir /tmp/.tmpNU8d4p/target/debug/deps -L dependency=/tmp/.tmpNU8d4p/target/debug/deps --extern bumpalo=/tmp/.tmpNU8d4p/target/debug/deps/libbumpalo-af7e4c8194bed52e.rmeta --extern cranelift_assembler_x64=/tmp/.tmpNU8d4p/target/debug/deps/libcranelift_assembler_x64-8a4da9181ed714f6.rmeta --extern cranelift_bforest=/tmp/.tmpNU8d4p/target/debug/deps/libcranelift_bforest-e1bbd92fd225349c.rmeta --extern cranelift_bitset=/tmp/.tmpNU8d4p/target/debug/deps/libcranelift_bitset-3fd74b4877c5c1a5.rmeta --extern cranelift_codegen_shared=/tmp/.tmpNU8d4p/target/debug/deps/libcranelift_codegen_shared-9d5622b1f87c1818.rmeta --extern cranelift_control=/tmp/.tmpNU8d4p/target/debug/deps/libcranelift_control-e8838e41b4e6d274.rmeta --extern cranelift_entity=/tmp/.tmpNU8d4p/target/debug/deps/libcranelift_entity-3a46b6f8ac1dd6bb.rmeta --extern gimli=/tmp/.tmpNU8d4p/target/debug/deps/libgimli-2749299c064e6472.rmeta --extern hashbrown=/tmp/.tmpNU8d4p/target/debug/deps/libhashbrown-7023f9819154fc93.rmeta --extern log=/tmp/.tmpNU8d4p/target/debug/deps/liblog-85566cea2dca7568.rmeta --extern regalloc2=/tmp/.tmpNU8d4p/target/debug/deps/libregalloc2-36d99015dad82b79.rmeta --extern rustc_hash=/tmp/.tmpNU8d4p/target/debug/deps/librustc_hash-ff6b1ce532e43589.rmeta --extern smallvec=/tmp/.tmpNU8d4p/target/debug/deps/libsmallvec-557da1fdae5fb6de.rmeta --extern target_lexicon=/tmp/.tmpNU8d4p/target/debug/deps/libtarget_lexicon-8b85d142326212f0.rmeta -C incremental=/tmp/.tmpNU8d4p/incremental-state -Wclippy::all --cfg feature="x86" -Zthreads=1 -Adeprecated -Aunknown-lints -Zincremental-verify-ich (PID 239333, part 1) Events recorded: Ir Events shown: Ir Event sort order: Ir Thresholds: 99 Include dirs: User annotated: Auto-annotation: on -------------------------------------------------------------------------------- Ir -------------------------------------------------------------------------------- 12,040,798,348 (100.0%) PROGRAM TOTALS -------------------------------------------------------------------------------- Ir file:function -------------------------------------------------------------------------------- 837,390,668 ( 6.95%) ???:annotate_snippets::renderer::render::render'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 294,370,478 ( 2.44%) ???:::try_mark_previous_green'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 209,284,992 ( 1.74%) 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] 196,747,791 ( 1.63%) ???:::render [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 187,412,536 ( 1.56%) ???:::advance_token [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 173,779,641 ( 1.44%) ???:<&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] 172,428,348 ( 1.43%) ???:::traits_in_scope [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 171,317,813 ( 1.42%) ???:0x0000000000173dc0 [/usr/lib/libc.so.6] 162,742,504 ( 1.35%) ???:core::fmt::write [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 154,613,310 ( 1.28%) ???:::try_mark_previous_green [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 145,089,675 ( 1.20%) ???:)>>::call_once [???] 129,627,116 ( 1.08%) ???:>::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] 124,404,835 ( 1.03%) ???:::resolve_ident_in_scope_set_inner [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 121,550,917 ( 1.01%) ???:::putc [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 120,377,877 ( 1.00%) ???:::lookup_char_pos [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 114,765,009 ( 0.95%) ???:::next_token_from_cursor [???] 114,292,504 ( 0.95%) ???:::lower_qpath [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 112,671,184 ( 0.94%) ???:::lint_level_spec_at_node'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 103,443,650 ( 0.86%) ???:::resolve_path [???] 101,737,790 ( 0.84%) ???:::short_write_process_buffer::<8> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 100,120,251 ( 0.83%) ???: as core::io::write::Write>::write_all [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 97,822,479 ( 0.81%) ???:::parent_hir_node [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 96,418,416 ( 0.80%) ???:::next [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 77,239,826 ( 0.64%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 76,997,395 ( 0.64%) ???:::stable_hash_span [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 76,816,017 ( 0.64%) ???:annotate_snippets::renderer::render::normalize_whitespace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 75,610,198 ( 0.63%) ???:::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 71,138,416 ( 0.59%) ???:::to [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 68,017,756 ( 0.56%) ???:::lint_level_spec_at_node [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 64,699,934 ( 0.54%) ???: 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] 62,577,138 ( 0.52%) ???:::get_line [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 61,942,936 ( 0.51%) ???:::write_char [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 60,788,539 ( 0.50%) ???:::smart_resolve_path_fragment [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 60,668,505 ( 0.50%) ???:::stable_hash::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 60,415,570 ( 0.50%) ???:::encode_def_ids'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 58,933,100 ( 0.49%) ???:md5::compress::soft::compress [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 58,791,692 ( 0.49%) ???:::lower_expr_mut'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 56,261,768 ( 0.47%) ???:>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 55,077,704 ( 0.46%) include/jemalloc/internal/rtree.h:free 54,611,915 ( 0.45%) 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] 54,190,499 ( 0.45%) ???:::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] 51,040,969 ( 0.42%) ???:::call_once_force::<>>>::initialize<>>>::get_or_init<::fingerprint_map::{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] 50,024,840 ( 0.42%) ???: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] 48,431,503 ( 0.40%) ???:::fully_expand_fragment [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 46,675,420 ( 0.39%) ???:annotate_snippets::renderer::render::char_width [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 44,544,127 ( 0.37%) ???:::hir_attrs [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 41,580,919 ( 0.35%) ???:::ensure_lines [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 40,151,545 ( 0.33%) ???:rustc_middle::dep_graph::read_deps::<::read_index::{closure#0}>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 39,295,568 ( 0.33%) ???:>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 39,099,564 ( 0.32%) ???:::in_external_macro [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 38,597,480 ( 0.32%) ???:rustc_query_impl::execution::try_execute_query::>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 38,506,503 ( 0.32%) ???:::lex_token_trees'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 38,345,090 ( 0.32%) ???:::hir_node [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 36,063,862 ( 0.30%) ???:::is_imported [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 35,686,185 ( 0.30%) ???:::hir_body_const_context [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 34,482,399 ( 0.29%) ???:::take [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 34,323,159 ( 0.29%) ???:rustc_query_impl::plumbing::encode_query_values_inner::, rustc_middle::dep_graph::graph::DepNodeIndex>, &rustc_middle::ty::typeck_results::TypeckResults>::{closure#0} [???] 33,769,952 ( 0.28%) ???:>::push [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 33,696,388 ( 0.28%) ???: as rustc_ast::visit::Visitor>::visit_expr'2 [???] 33,638,259 ( 0.28%) ???:::next'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 32,740,250 ( 0.27%) ???:::desugaring_kind [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 32,272,597 ( 0.27%) /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 32,216,221 ( 0.27%) include/jemalloc/internal/jemalloc_internal_inlines_c.h:malloc [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 32,005,255 ( 0.27%) ???:::parse_path_segment [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 31,088,196 ( 0.26%) ???:::resolve_pattern_inner::{closure#0} [???] 31,014,872 ( 0.26%) ???:::parse_item_kind'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 30,638,443 ( 0.25%) ???:::bump_minimal [???] 30,347,358 ( 0.25%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,900,612 ( 0.25%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 29,119,274 ( 0.24%) ???:::span_to_locations'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 28,965,335 ( 0.24%) ???: as rustc_ast::visit::Visitor>::visit_id [???] 28,372,065 ( 0.24%) ???:>::decode'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 27,055,324 ( 0.22%) ???:::make_owner_info [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 26,938,800 ( 0.22%) ???:::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] 26,833,335 ( 0.22%) ???:::create_def [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 26,349,200 ( 0.22%) ???:::next'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 24,421,628 ( 0.20%) ???:::short_write_process_buffer::<4> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 24,366,687 ( 0.20%) ???:::encode_crate_root'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 24,285,750 ( 0.20%) include/jemalloc/internal/rtree.h:tcache_bin_flush_small 23,608,992 ( 0.20%) ???:::check_expr [???] 23,540,036 ( 0.20%) ???:::parse_path_inner [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 23,533,852 ( 0.20%) ???:::mark_live_symbols'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 23,344,780 ( 0.19%) ???:core::str::count::do_count_chars [???] 23,139,199 ( 0.19%) ???:0x00000000001747c0 [/usr/lib/libc.so.6] 23,101,922 ( 0.19%) ???: 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] 22,737,837 ( 0.19%) include/jemalloc/internal/cache_bin.h:malloc 22,316,546 ( 0.19%) ???:::exec_cache_promotions'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 22,268,146 ( 0.18%) ???:rustc_query_impl::execution::try_execute_query::>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 22,052,324 ( 0.18%) ???:::intern_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 21,284,420 ( 0.18%) ???:::slice_write_process_buffer [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 21,201,671 ( 0.18%) 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] 20,939,743 ( 0.17%) ???:::fmt_to [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 20,884,058 ( 0.17%) ???:annotate_snippets::renderer::render::draw_line'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 20,872,627 ( 0.17%) ???:::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 20,734,614 ( 0.17%) /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] 20,436,325 ( 0.17%) ???:::resolve_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 20,383,464 ( 0.17%) ???:::hir_body_owner_def_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 19,880,950 ( 0.17%) ???:::encode_span [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 19,790,282 ( 0.16%) /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] 19,550,792 ( 0.16%) ???:::hir_enclosing_body_owner [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 19,390,337 ( 0.16%) ???:::parse_stmt_without_recovery'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 19,329,624 ( 0.16%) include/jemalloc/internal/cache_bin.h:free 19,234,374 ( 0.16%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 18,984,836 ( 0.16%) ???:::alloc_and_color_node [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 18,940,900 ( 0.16%) ???: as rustc_hir::intravisit::Visitor>::visit_expr'2 [???] 18,913,235 ( 0.16%) ???:::hir_attrs'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 18,383,576 ( 0.15%) include/jemalloc/internal/sz.h:realloc 18,287,572 ( 0.15%) ???:, serde_json::ser::CompactFormatter> as serde_core::ser::SerializeStruct>::serialize_field:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 18,243,296 ( 0.15%) ???:<&char as core::fmt::Display>::fmt [???] 18,188,894 ( 0.15%) ???:core::ptr::drop_glue::> [???] 18,088,082 ( 0.15%) ???:::encode_span [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 17,913,198 ( 0.15%) ???:> 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] 17,810,088 ( 0.15%) ???:rustc_query_impl::execution::try_execute_query::>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 17,801,773 ( 0.15%) ???:::decode_def_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 17,643,405 ( 0.15%) ???:::span_to_locations [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 17,296,280 ( 0.14%) ???:rustc_query_impl::execution::try_execute_query::>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 17,152,694 ( 0.14%) /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:: 17,134,713 ( 0.14%) ???:::finish128_inner [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 17,015,631 ( 0.14%) ???:::write_str [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 16,972,888 ( 0.14%) ???:::short_write_process_buffer::<1> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 16,794,670 ( 0.14%) ???: as rustc_serialize::serialize::Decodable>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 16,738,528 ( 0.14%) ???:::span_to_snippet [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 16,602,777 ( 0.14%) ???:rustc_interface::callbacks::track_span_parent [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 16,505,797 ( 0.14%) ???:::render'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 16,228,484 ( 0.13%) ???: as rustc_hir::intravisit::Visitor>::visit_expr::{closure#0}::{closure#0}'2 [???] 16,224,139 ( 0.13%) ???:::append [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 16,107,955 ( 0.13%) include/jemalloc/internal/sz.h:malloc 15,579,179 ( 0.13%) 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] 15,511,960 ( 0.13%) ???:::qpath_res [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 15,168,404 ( 0.13%) ???:::expr_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 14,751,478 ( 0.12%) ???:::hash_owner_nodes::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 14,630,424 ( 0.12%) ???:::lower_pat_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 14,601,388 ( 0.12%) ???:rustc_hir::intravisit::walk_expr::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 14,327,206 ( 0.12%) ???:rustc_middle::dep_graph::graph::hash_result:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 14,003,651 ( 0.12%) ???:annotate_snippets::renderer::render::draw_line [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 13,833,699 ( 0.11%) ???:::hash_expn:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 13,664,374 ( 0.11%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 13,633,079 ( 0.11%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 13,591,163 ( 0.11%) ???:::next [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 13,165,901 ( 0.11%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 12,840,977 ( 0.11%) src/arena.c:realloc 12,745,605 ( 0.11%) src/arena.c:malloc_default 12,695,682 ( 0.11%) /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] 12,695,192 ( 0.11%) ???:<[(rustc_middle::dep_graph::serialized::SerializedDepNodeIndex, rustc_middle::query::on_disk_cache::AbsoluteBytePos)] as rustc_serialize::serialize::Encodable>::encode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 12,525,082 ( 0.10%) ???: as core::iter::traits::collect::FromIterator<(rustc_middle::dep_graph::serialized::SerializedDepNodeIndex, rustc_middle::query::on_disk_cache::AbsoluteBytePos)>>::from_iter::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 12,360,133 ( 0.10%) ???:rustc_query_impl::execution::try_execute_query::>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 12,268,073 ( 0.10%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::dep_graph::graph::DepNodeIndex>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 12,266,449 ( 0.10%) ???:rustc_ast_lowering::lower_to_hir [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 12,151,508 ( 0.10%) ???:core::slice::memchr::memchr_aligned [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 12,123,564 ( 0.10%) 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] 11,964,772 ( 0.10%) ???:0x0000000000173660 [/usr/lib/libc.so.6] 11,863,312 ( 0.10%) ???:::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] 11,850,792 ( 0.10%) ???:::lower [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 11,809,266 ( 0.10%) ???:>>::walk_ref'2 [???] 11,794,589 ( 0.10%) ???:::span_data_to_lines_and_cols [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 11,705,982 ( 0.10%) 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] 11,560,531 ( 0.10%) ???:>::get_attrs [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 11,545,168 ( 0.10%) ???:::decode_span [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 11,517,004 ( 0.10%) ???:>::walk_mut'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 11,466,735 ( 0.10%) ???:>>::walk_ref [???] 11,290,464 ( 0.09%) ???:stacker::remaining_stack [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 11,277,802 ( 0.09%) ???:thin_vec::drop_non_singleton:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 11,274,368 ( 0.09%) ???:::lookup_byte_offset [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 11,218,597 ( 0.09%) ???:::resolve_path_with_ribs [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 11,123,800 ( 0.09%) ???:::stable_hash::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 11,096,089 ( 0.09%) ???:::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 11,085,888 ( 0.09%) ???:::is_diagnostic_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 10,962,996 ( 0.09%) /rust/deps/scoped-tls-1.0.1/src/lib.rs:>::with::<::with::expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 10,916,794 ( 0.09%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 10,761,182 ( 0.09%) /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> 10,748,884 ( 0.09%) ???:::get_diagnostic_name [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 10,710,581 ( 0.09%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::dep_graph::graph::DepNodeIndex>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 10,601,055 ( 0.09%) /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 10,485,300 ( 0.09%) ???:::expn_data [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 10,273,925 ( 0.09%) ???:>::walk_mut'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 10,252,943 ( 0.09%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 10,178,649 ( 0.08%) 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] 10,136,504 ( 0.08%) ???:::get_str [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 10,052,375 ( 0.08%) include/jemalloc/internal/emap.h:tcache_bin_flush_small 9,960,456 ( 0.08%) ???:::resolve_macro_invocation [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 9,953,751 ( 0.08%) ???:::serialize::<&mut serde_json::ser::Serializer<&mut alloc::boxed::Box>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 9,908,862 ( 0.08%) ???:rustc_resolve::rustdoc::unindent_doc_fragments [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 9,879,924 ( 0.08%) 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] 9,874,113 ( 0.08%) ???:::expect_hir_owner_nodes [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 9,759,254 ( 0.08%) ???:::next [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 9,717,463 ( 0.08%) 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] 9,716,630 ( 0.08%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::dep_graph::graph::DepNodeIndex>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 9,716,265 ( 0.08%) ???:::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] 9,690,103 ( 0.08%) ???:::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] 9,613,549 ( 0.08%) include/jemalloc/internal/thread_event.h:malloc 9,492,772 ( 0.08%) ???:::parse_token_tree [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 9,364,894 ( 0.08%) 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] 9,320,250 ( 0.08%) include/jemalloc/internal/edata.h:tcache_bin_flush_small 9,316,081 ( 0.08%) ???:::parse_pat_with_range_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 9,283,899 ( 0.08%) /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 9,197,965 ( 0.08%) ???:::insert [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 9,157,248 ( 0.08%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 9,125,052 ( 0.08%) ???:::next [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 8,995,145 ( 0.07%) ???:::lower_path_segment [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 8,969,724 ( 0.07%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/hygiene.rs:>::with::<::with::expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> 8,968,074 ( 0.07%) ???:::puts [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 8,846,142 ( 0.07%) ???:::check_def_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 8,832,462 ( 0.07%) ???:> 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] 8,791,664 ( 0.07%) /rust/deps/scoped-tls-1.0.1/src/lib.rs:>::with::<::with::outer_expn::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnId> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 8,752,945 ( 0.07%) ???:>::walk_mut'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 8,750,963 ( 0.07%) ???:rustc_hir::intravisit::walk_ty:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 8,706,104 ( 0.07%) ???:std::path::compare_components [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 8,656,500 ( 0.07%) ???:::is_desugaring [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 8,594,545 ( 0.07%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 8,580,779 ( 0.07%) include/jemalloc/internal/rtree.h:realloc 8,393,893 ( 0.07%) ???:::lower_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 8,360,400 ( 0.07%) 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] 8,276,904 ( 0.07%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::dep_graph::graph::DepNodeIndex>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 8,256,571 ( 0.07%) ???:rustc_middle::dep_graph::graph::hash_result:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 8,231,517 ( 0.07%) ???:::lower_stmts'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 8,130,198 ( 0.07%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs: as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::find_map::check<(rustc_span::hygiene::ExpnId, rustc_span::hygiene::ExpnData), clippy_utils::macros::MacroCall, &mut clippy_utils::macros::macro_backtrace::{closure#0}>::{closure#0}, core::ops::control_flow::ControlFlow> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 8,128,459 ( 0.07%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 8,032,107 ( 0.07%) site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 8,022,624 ( 0.07%) 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] 8,010,843 ( 0.07%) ???: as rustc_hir::intravisit::Visitor>::visit_path [???] 7,988,977 ( 0.07%) 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] 7,947,780 ( 0.07%) ???:::range_span [???] 7,923,010 ( 0.07%) ???:::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] 7,915,341 ( 0.07%) 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] 7,849,942 ( 0.07%) ???:::intern [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 7,818,043 ( 0.06%) 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] 7,794,565 ( 0.06%) 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] 7,723,003 ( 0.06%) ???:::parse_expr_assoc_with'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 7,673,626 ( 0.06%) ???:::update_decl_chain [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 7,656,295 ( 0.06%) ???: 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] 7,636,059 ( 0.06%) 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] 7,483,794 ( 0.06%) ???:::parse_expr_paren_seq [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 7,382,761 ( 0.06%) ???:::def_key [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 7,324,373 ( 0.06%) ???:::is_diagnostic_item'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 7,271,772 ( 0.06%) ???: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] 7,226,306 ( 0.06%) ???:::pad [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 7,214,502 ( 0.06%) ???:::decode_span [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 7,191,461 ( 0.06%) 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] 7,189,198 ( 0.06%) ???:::parse_fn_params [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 7,154,182 ( 0.06%) ???:::get_extern_module_with_lock [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 7,143,605 ( 0.06%) 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] 7,074,903 ( 0.06%) ???:::candidate_from_obligation_no_cache [???] 7,074,108 ( 0.06%) /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> 7,071,534 ( 0.06%) 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] 7,022,845 ( 0.06%) ???:>>::drop_slow'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 7,012,413 ( 0.06%) ???:> 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] 6,963,997 ( 0.06%) ???:pthread_mutex_unlock [/usr/lib/libc.so.6] 6,962,021 ( 0.06%) ???:::visit_fn [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,848,730 ( 0.06%) ???:>::new'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,846,495 ( 0.06%) ???:::stable_hash::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,840,270 ( 0.06%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,835,109 ( 0.06%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,835,109 ( 0.06%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,835,109 ( 0.06%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,775,944 ( 0.06%) 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] 6,775,737 ( 0.06%) 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] 6,737,088 ( 0.06%) 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] 6,710,094 ( 0.06%) ???:>::get_attrs [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,699,427 ( 0.06%) 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] 6,697,382 ( 0.06%) ???:rustc_query_impl::execution::try_execute_query::>, true>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,684,456 ( 0.06%) 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] 6,654,392 ( 0.06%) ???:rustc_span::normalize_src [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,591,242 ( 0.05%) 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] 6,580,862 ( 0.05%) ???:::lower_attrs_vec [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,546,198 ( 0.05%) ???:rustc_query_impl::execution::try_execute_query::>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,480,846 ( 0.05%) ???:::record_use [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,474,944 ( 0.05%) include/jemalloc/internal/sz.h:free 6,448,432 ( 0.05%) /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] 6,406,046 ( 0.05%) ???:::parse_stmt_without_recovery [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,378,830 ( 0.05%) ???:::parse_item_common'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,356,158 ( 0.05%) 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] 6,355,774 ( 0.05%) 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] 6,352,349 ( 0.05%) include/jemalloc/internal/arena_inlines_b.h:tcache_bin_flush_small 6,339,786 ( 0.05%) ???: 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] 6,333,317 ( 0.05%) 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] 6,305,210 ( 0.05%) ???:::get_lint_level_spec [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,290,741 ( 0.05%) ???:rustc_query_impl::execution::try_execute_query::>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,278,834 ( 0.05%) ???:::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,277,394 ( 0.05%) ???:::parse_ty_common [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,267,366 ( 0.05%) /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] 6,265,969 ( 0.05%) ???:::parse_block_common'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,247,448 ( 0.05%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,243,340 ( 0.05%) ???:memchr::arch::x86_64::memchr::count_raw::find_avx2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,176,670 ( 0.05%) ???:core::ptr::drop_glue::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,171,530 ( 0.05%) ???:> 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] 6,163,634 ( 0.05%) /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] 6,149,160 ( 0.05%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:::check_attributes 6,146,699 ( 0.05%) ???:alloc::fmt::format::format_inner [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,145,482 ( 0.05%) site/frontend/rust-clippy/clippy_utils/src/macros.rs: as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::find_map::check<(rustc_span::hygiene::ExpnId, rustc_span::hygiene::ExpnData), clippy_utils::macros::MacroCall, &mut clippy_utils::macros::macro_backtrace::{closure#0}>::{closure#0}, core::ops::control_flow::ControlFlow> 6,098,685 ( 0.05%) ???:::bump [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,075,313 ( 0.05%) 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] 6,071,921 ( 0.05%) 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] 6,037,865 ( 0.05%) ???:::visit_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,035,588 ( 0.05%) ???:pthread_mutex_trylock [/usr/lib/libc.so.6] 6,021,124 ( 0.05%) 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] 6,021,124 ( 0.05%) 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] 5,990,459 ( 0.05%) ???:::from_token_lit [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,984,523 ( 0.05%) /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] 5,931,352 ( 0.05%) ???:::def_id_partial_cmp [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,919,586 ( 0.05%) 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] 5,891,186 ( 0.05%) ???:<&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] 5,873,260 ( 0.05%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,850,629 ( 0.05%) 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] 5,841,702 ( 0.05%) 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] 5,841,702 ( 0.05%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:::check_attributes_post 5,827,654 ( 0.05%) 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] 5,820,466 ( 0.05%) 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] 5,813,472 ( 0.05%) 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] 5,806,825 ( 0.05%) ???: 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] 5,790,657 ( 0.05%) ???:::trait_of_assoc [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,785,862 ( 0.05%) ???:::parse_expr_prefix'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,785,476 ( 0.05%) ???:::lower_expr_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,776,502 ( 0.05%) /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 5,707,520 ( 0.05%) ???:<[rustc_ast::tokenstream::TokenTree] 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] 5,693,573 ( 0.05%) ???:::get_diagnostic_name'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,685,072 ( 0.05%) /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] 5,685,072 ( 0.05%) 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] 5,661,222 ( 0.05%) 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] 5,632,410 ( 0.05%) ???:::parse_local [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,614,305 ( 0.05%) 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] 5,596,009 ( 0.05%) 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] 5,586,257 ( 0.05%) 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] 5,586,053 ( 0.05%) 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] 5,568,231 ( 0.05%) ???:::from_span [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,561,839 ( 0.05%) 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] 5,560,962 ( 0.05%) 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] 5,554,689 ( 0.05%) 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] 5,541,678 ( 0.05%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,461,107 ( 0.05%) 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] 5,458,044 ( 0.05%) 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] 5,427,383 ( 0.05%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,384,328 ( 0.04%) ???:::splice_lines::push_trailing [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,375,408 ( 0.04%) 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] 5,346,034 ( 0.04%) 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] 5,343,722 ( 0.04%) ???:>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,289,580 ( 0.04%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,281,308 ( 0.04%) ???:>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,273,243 ( 0.04%) 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] 5,259,281 ( 0.04%) include/jemalloc/internal/thread_event.h:realloc 5,258,108 ( 0.04%) ???:::extract_def_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,242,710 ( 0.04%) ???:::opt_associated_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,236,202 ( 0.04%) ???:::qpath_res [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,234,983 ( 0.04%) ???:::is_conditionally_const:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,219,328 ( 0.04%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,156,374 ( 0.04%) ???:::flat_map_stmt'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,127,545 ( 0.04%) 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] 5,114,985 ( 0.04%) ???:>::call_once'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,098,556 ( 0.04%) 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] 5,097,339 ( 0.04%) 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] 5,090,836 ( 0.04%) 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] 5,090,836 ( 0.04%) 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] 5,088,457 ( 0.04%) 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] 5,069,293 ( 0.04%) ???:::resolve_ident_in_lexical_scope [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,041,106 ( 0.04%) ???:::is_imported'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,026,671 ( 0.04%) 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] 4,995,793 ( 0.04%) 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] 4,981,921 ( 0.04%) 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] 4,975,488 ( 0.04%) include/jemalloc/internal/arena_inlines_b.h:realloc 4,972,200 ( 0.04%) 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] 4,959,515 ( 0.04%) ???:::write_str [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,949,914 ( 0.04%) ???:::parse_pat_ident [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,934,606 ( 0.04%) 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] 4,920,418 ( 0.04%) 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] 4,917,381 ( 0.04%) ???:::fmt [???] 4,884,873 ( 0.04%) ???:::visit_expr::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,872,931 ( 0.04%) 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] 4,868,079 ( 0.04%) ???:::resolve_crate::{closure#0}'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,859,151 ( 0.04%) 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] 4,835,024 ( 0.04%) include/jemalloc/internal/bitmap.h:tcache_bin_flush_small 4,829,772 ( 0.04%) ???:::span_to_lines [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,815,669 ( 0.04%) 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] 4,787,234 ( 0.04%) 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] 4,765,365 ( 0.04%) 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] 4,693,874 ( 0.04%) ???:::parse_block [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,646,545 ( 0.04%) ???:annotate_snippets::renderer::render::style_substitution_highlights [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,623,699 ( 0.04%) 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] 4,611,870 ( 0.04%) 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,605,740 ( 0.04%) 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] 4,594,726 ( 0.04%) 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] 4,591,180 ( 0.04%) 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] 4,589,730 ( 0.04%) 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] 4,567,502 ( 0.04%) 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] 4,554,570 ( 0.04%) include/jemalloc/internal/tcache_inlines.h:realloc 4,553,698 ( 0.04%) ???:::parse_line [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,550,636 ( 0.04%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,543,428 ( 0.04%) 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] 4,539,648 ( 0.04%) ???:>>,)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,535,985 ( 0.04%) 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] 4,534,231 ( 0.04%) ???:::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,531,283 ( 0.04%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,495,762 ( 0.04%) /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 4,495,132 ( 0.04%) 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] 4,477,805 ( 0.04%) /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] 4,474,066 ( 0.04%) 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] 4,456,967 ( 0.04%) 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] 4,450,616 ( 0.04%) ???:, 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] 4,436,592 ( 0.04%) 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] 4,433,760 ( 0.04%) 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] 4,421,939 ( 0.04%) ???:::typeck_body [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,414,842 ( 0.04%) 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] 4,413,119 ( 0.04%) 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] 4,410,485 ( 0.04%) ???:core::str::converts::from_utf8 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,408,536 ( 0.04%) 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] 4,404,408 ( 0.04%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,394,339 ( 0.04%) 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] 4,394,104 ( 0.04%) ???:rustc_data_structures::unord::hash_iter_order_independent::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,390,653 ( 0.04%) 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] 4,390,447 ( 0.04%) site/frontend/rust-clippy/clippy_lints/src/casts/cast_slice_from_raw_parts.rs:clippy_lints::casts::cast_slice_from_raw_parts::check_implicit_cast [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 4,384,632 ( 0.04%) 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] 4,380,047 ( 0.04%) 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] 4,377,905 ( 0.04%) ???: as rustc_hir::intravisit::Visitor>::visit_block'2 [???] 4,377,352 ( 0.04%) 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] 4,371,750 ( 0.04%) /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] 4,369,131 ( 0.04%) ???:::lang_items [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,365,019 ( 0.04%) 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] 4,363,868 ( 0.04%) 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] 4,361,483 ( 0.04%) 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] 4,360,953 ( 0.04%) 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] 4,360,305 ( 0.04%) 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] 4,352,997 ( 0.04%) ???:::check_def_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,351,409 ( 0.04%) ???:rustc_hir::hir::is_range_literal [???] 4,350,860 ( 0.04%) /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] 4,349,151 ( 0.04%) ???:>::reserve_rehash::>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,334,738 ( 0.04%) 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] 4,333,248 ( 0.04%) ???:::intern_str [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,322,899 ( 0.04%) 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] 4,315,164 ( 0.04%) 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] 4,308,946 ( 0.04%) ???:rustc_query_impl::plumbing::promote_from_disk_inner::>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,298,952 ( 0.04%) ???:::is_path_start_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,264,790 ( 0.04%) 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] 4,260,715 ( 0.04%) 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] 4,252,288 ( 0.04%) 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] 4,240,279 ( 0.04%) 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] 4,239,978 ( 0.04%) 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] 4,238,033 ( 0.04%) 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] 4,230,518 ( 0.04%) ???:::hir_span_with_body [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,224,675 ( 0.04%) 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] 4,224,165 ( 0.04%) 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] 4,215,406 ( 0.04%) 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] 4,213,617 ( 0.03%) 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] 4,208,652 ( 0.03%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 4,201,102 ( 0.03%) ???:<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::Ty> 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] 4,195,899 ( 0.03%) 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] 4,186,381 ( 0.03%) 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] 4,182,428 ( 0.03%) ???:rustc_passes::reachable::reachable_set'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,176,229 ( 0.03%) 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] 4,172,520 ( 0.03%) 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] 4,167,916 ( 0.03%) 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] 4,165,036 ( 0.03%) 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] 4,162,182 ( 0.03%) 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] 4,161,918 ( 0.03%) 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] 4,160,201 ( 0.03%) 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] 4,159,832 ( 0.03%) 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] 4,156,996 ( 0.03%) 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] 4,156,643 ( 0.03%) 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] 4,134,181 ( 0.03%) 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] 4,133,225 ( 0.03%) 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] 4,128,198 ( 0.03%) 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] 4,125,679 ( 0.03%) 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] 4,124,645 ( 0.03%) 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] 4,123,939 ( 0.03%) 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] 4,123,141 ( 0.03%) 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] 4,122,787 ( 0.03%) ???:::lookup_source_file [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,121,046 ( 0.03%) 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] 4,118,725 ( 0.03%) 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] 4,117,980 ( 0.03%) 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] 4,116,708 ( 0.03%) ???:::stable_hash::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,096,047 ( 0.03%) ???:::visit_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,063,820 ( 0.03%) /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> 4,046,383 ( 0.03%) ???:annotate_snippets::renderer::render::render [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,028,275 ( 0.03%) include/jemalloc/internal/cache_bin.h:realloc 4,022,145 ( 0.03%) ???:::hir_span [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,007,131 ( 0.03%) ???:::decode_symbol [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,004,539 ( 0.03%) ???:::resolve_block'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,996,954 ( 0.03%) 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] 3,986,544 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_data_structures/src/sync/lock.rs:>::with::<::with::expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> 3,976,931 ( 0.03%) ???:<[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] 3,972,419 ( 0.03%) ???:::parse_item_kind [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,969,280 ( 0.03%) ???:rustc_resolve::rustdoc::span_of_fragments [???] 3,966,953 ( 0.03%) 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] 3,958,791 ( 0.03%) include/jemalloc/internal/ph.h:pa_alloc 3,949,718 ( 0.03%) ???:>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,939,949 ( 0.03%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,925,823 ( 0.03%) /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] 3,924,473 ( 0.03%) 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] 3,920,978 ( 0.03%) ???:::check_ident [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,908,036 ( 0.03%) 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] 3,899,776 ( 0.03%) 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] 3,890,000 ( 0.03%) 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] 3,885,490 ( 0.03%) 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] 3,871,764 ( 0.03%) ???:>::add_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,868,671 ( 0.03%) ???:::parse_block_common [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,868,172 ( 0.03%) ???:rustc_middle::lint::emit_lint_base::emit_lint_base_impl'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,868,027 ( 0.03%) ???:>::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] 3,857,213 ( 0.03%) 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] 3,855,852 ( 0.03%) 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] 3,844,473 ( 0.03%) ???:::resolve_crate_root [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,803,562 ( 0.03%) 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] 3,798,205 ( 0.03%) ???:::visit_assoc_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,793,339 ( 0.03%) 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,792,958 ( 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] 3,773,084 ( 0.03%) ???:::parse_outer_attributes [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,764,503 ( 0.03%) ???:::lower_stmts [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,762,040 ( 0.03%) 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] 3,740,997 ( 0.03%) ???:>::decode'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,738,581 ( 0.03%) ???:::lower_node_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,726,700 ( 0.03%) include/jemalloc/internal/rtree.h:pa_alloc 3,725,843 ( 0.03%) 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] 3,721,232 ( 0.03%) ???:::lower_method_sig [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,719,698 ( 0.03%) include/jemalloc/internal/bit_util.h:malloc_default 3,685,054 ( 0.03%) 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] 3,653,751 ( 0.03%) 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,648,042 ( 0.03%) ???:::type_dependent_def_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,640,681 ( 0.03%) 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] 3,635,829 ( 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] 3,631,186 ( 0.03%) ???:::mk_type_list [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,629,311 ( 0.03%) 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] 3,626,268 ( 0.03%) include/jemalloc/internal/div.h:tcache_bin_flush_small 3,612,663 ( 0.03%) ???:::candidate_from_obligation [???] 3,611,907 ( 0.03%) 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] 3,606,428 ( 0.03%) ???:::encode_def_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,601,271 ( 0.03%) ???: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] 3,593,570 ( 0.03%) ???:rustc_query_impl::plumbing::promote_from_disk_inner::>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,586,333 ( 0.03%) ???:rustc_ty_utils::ty::param_env [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,584,176 ( 0.03%) 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] 3,577,383 ( 0.03%) ???:>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,566,075 ( 0.03%) 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] 3,545,161 ( 0.03%) 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] 3,539,024 ( 0.03%) ???:::trim_matches::<::is_whitespace> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,534,276 ( 0.03%) ???:>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,529,719 ( 0.03%) ???:rustc_ast::mut_visit::walk_fn:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,529,396 ( 0.03%) ???:::visit_ast_fragment_with_placeholders [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,523,126 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/validations.rs:::visit_pat 3,520,365 ( 0.03%) ???:rustc_errors::annotate_snippet_emitter_writer::collect_annotations [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,501,268 ( 0.03%) ???:, 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] 3,498,454 ( 0.03%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_expn_of [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 3,488,226 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:>::with::<::with::expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> 3,478,095 ( 0.03%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,461,795 ( 0.03%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,441,799 ( 0.03%) ???:getenv [/usr/lib/libc.so.6] 3,441,488 ( 0.03%) ???:0x000000000000fb40 [/usr/lib/ld-linux-x86-64.so.2] 3,436,934 ( 0.03%) ???:::fn_sig'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,435,061 ( 0.03%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,432,131 ( 0.03%) ???:::is_exported [???] 3,413,358 ( 0.03%) ???:, 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] 3,403,513 ( 0.03%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,402,420 ( 0.03%) ???:>::reserve_rehash::>::{closure#0}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,398,753 ( 0.03%) ???:rustc_middle::verify_ich::incremental_verify_ich::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,387,034 ( 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:::trim_start_matches::<::is_whitespace> 3,377,932 ( 0.03%) ???: 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] 3,344,160 ( 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 3,302,702 ( 0.03%) ???:::flat_map_stmt [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,296,874 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_data_structures/src/sync/lock.rs:>::with::<::with::outer_expn::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnId> 3,294,317 ( 0.03%) ???:::cmp [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,291,641 ( 0.03%) ???:::lint_level_spec_at_node [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,264,688 ( 0.03%) site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs:::check_stmt [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 3,260,490 ( 0.03%) ???:rustc_query_impl::plumbing::encode_query_values_inner::>, &rustc_middle::ty::generics::Generics>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,247,765 ( 0.03%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,242,753 ( 0.03%) ???:>>::walk_ref [???] 3,240,015 ( 0.03%) include/jemalloc/internal/tsd_tls.h:free [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 3,240,014 ( 0.03%) include/jemalloc/internal/atomic.h:free 3,228,828 ( 0.03%) ???:::lower_ty'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,213,558 ( 0.03%) /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 3,209,355 ( 0.03%) ???:::emit_messages_default'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,199,201 ( 0.03%) ???:::visit_generic_params [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,196,485 ( 0.03%) ???: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] 3,191,914 ( 0.03%) 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] 3,172,480 ( 0.03%) ???:rustc_ast::visit::visit_stmts::>'2 [???] 3,170,885 ( 0.03%) ???:rustc_query_impl::query_impl::def_ident_span::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,170,367 ( 0.03%) /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 3,169,041 ( 0.03%) ???:>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,167,964 ( 0.03%) ???:::intern_predicate [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,164,332 ( 0.03%) ???:> 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] 3,162,322 ( 0.03%) ???:rust_psm_stack_pointer [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,155,627 ( 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 3,153,430 ( 0.03%) 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] 3,151,726 ( 0.03%) 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] 3,150,966 ( 0.03%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,148,351 ( 0.03%) site/frontend/rust-clippy/clippy_lints/src/casts/borrow_as_ptr.rs:clippy_lints::casts::borrow_as_ptr::check_implicit_cast [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 3,137,071 ( 0.03%) ???:::{closure#1} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::dep_graph::dep_node::DepNode, rustc_middle::dep_graph::serialized::SerializedDepNodeIndex, rustc_middle::dep_graph::graph::DepNodeIndex)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,134,106 ( 0.03%) ???:::evaluate_trait_predicate_recursively'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,112,245 ( 0.03%) ???:::next'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,105,592 ( 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 3,089,024 ( 0.03%) ???:::node [???] 3,077,810 ( 0.03%) ???:::alloc_ctxt [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,076,767 ( 0.03%) ???:::hir_body [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,075,381 ( 0.03%) 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] 3,065,592 ( 0.03%) ???:::{closure#1} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::dep_graph::dep_node::DepNode, rustc_middle::dep_graph::serialized::SerializedDepNodeIndex, rustc_middle::dep_graph::graph::DepNodeIndex)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,054,661 ( 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] 3,032,967 ( 0.03%) ???:::intern_region [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,021,767 ( 0.03%) ???:::lower_param [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,018,142 ( 0.03%) ???:annotate_snippets::renderer::render::render_title [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,011,421 ( 0.03%) ???:::parse_fn [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,009,744 ( 0.02%) 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] 3,006,979 ( 0.02%) ???:::try_plant_decl_into_local_module [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,993,207 ( 0.02%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,990,988 ( 0.02%) include/jemalloc/internal/ph.h:tcache_bin_flush_small 2,966,500 ( 0.02%) ???:>::encode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,957,307 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/dep_graph/mod.rs:rustc_middle::dep_graph::read_deps::<::read_index::{closure#0}>::{closure#0} [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,953,918 ( 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_qpath:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,931,549 ( 0.02%) 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] 2,930,404 ( 0.02%) ???:::{closure#1} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::dep_graph::dep_node::DepNode, rustc_middle::dep_graph::serialized::SerializedDepNodeIndex, rustc_middle::dep_graph::graph::DepNodeIndex)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,925,812 ( 0.02%) ???:::record_use'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,912,783 ( 0.02%) ???:::prepend [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,906,736 ( 0.02%) 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] 2,905,920 ( 0.02%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,888,113 ( 0.02%) ???:> 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] 2,885,395 ( 0.02%) ???:::new'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,863,148 ( 0.02%) include/jemalloc/internal/edata.h:pa_alloc 2,853,624 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir_id/src/lib.rs:clippy_utils::macros::first_node_in_macro:: 2,838,525 ( 0.02%) ???:> 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] 2,831,485 ( 0.02%) ???: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,820,506 ( 0.02%) include/jemalloc/internal/sz.h:pa_alloc 2,813,233 ( 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 2,800,159 ( 0.02%) ???:::parse_pat_with_range_pat'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,795,129 ( 0.02%) ???:::lower_item_kind [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,794,138 ( 0.02%) ???:rustc_query_impl::execution::try_execute_query::>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,786,261 ( 0.02%) ???:core::slice::sort::unstable::quicksort::quicksort::<(rustc_span::def_id::DefPathHash, rustc_span::span_encoding::Span), <[(rustc_span::def_id::DefPathHash, rustc_span::span_encoding::Span)]>::sort_unstable_by_key::{closure#0}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,759,598 ( 0.02%) 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] 2,759,278 ( 0.02%) ???:::parse_param_general::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,759,228 ( 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] 2,747,451 ( 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::'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,747,395 ( 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:>::with::<::with::outer_expn::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnId> 2,744,919 ( 0.02%) ???: 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] 2,737,648 ( 0.02%) 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] 2,728,997 ( 0.02%) ???:::flat_map_stmt'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,710,998 ( 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:::visit_pat 2,707,164 ( 0.02%) ???:::fallible_with_capacity:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,693,379 ( 0.02%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,682,639 ( 0.02%) ???:::lifetime_res_to_generic_param [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,664,913 ( 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::eq_op::check_assert 2,664,508 ( 0.02%) 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] 2,662,151 ( 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:::visit_qpath [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,661,461 ( 0.02%) ???: as rustc_ast::visit::Visitor>::visit_stmt::{closure#0}'2 [???] 2,651,179 ( 0.02%) ???:rustc_hir::intravisit::walk_qpath::> [???] 2,643,907 ( 0.02%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::dep_graph::graph::DepNodeIndex>, true>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,626,511 ( 0.02%) ???:::{closure#1} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::dep_graph::dep_node::DepNode, rustc_middle::dep_graph::serialized::SerializedDepNodeIndex, rustc_middle::dep_graph::graph::DepNodeIndex)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,614,404 ( 0.02%) ???:rustc_privacy::effective_visibilities'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,610,639 ( 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_qpath:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,602,370 ( 0.02%) ???:::{closure#1} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::dep_graph::dep_node::DepNode, rustc_middle::dep_graph::serialized::SerializedDepNodeIndex, rustc_middle::dep_graph::graph::DepNodeIndex)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,598,671 ( 0.02%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,597,658 ( 0.02%) ???: as rustc_ast::visit::Visitor>::visit_expr [???] 2,596,673 ( 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 2,584,734 ( 0.02%) site/frontend/rust-clippy/clippy_utils/src/res.rs:::check_expr 2,584,681 ( 0.02%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,583,944 ( 0.02%) ???:::hir_span'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,579,249 ( 0.02%) ???:::confirm_auto_impl_candidate::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,575,166 ( 0.02%) ???:>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,574,104 ( 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::'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,566,012 ( 0.02%) ???:::visit_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,531,994 ( 0.02%) ???:>::walk_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,509,527 ( 0.02%) ???:::alloc_and_color_node'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,508,341 ( 0.02%) ???:::visit_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,496,282 ( 0.02%) ???:0x0000000000177c20 [/usr/lib/libc.so.6] 2,487,576 ( 0.02%) ???:rustc_middle::dep_graph::graph::hash_result:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,480,214 ( 0.02%) site/frontend/rust-clippy/clippy_lints/src/unit_types/let_unit_value.rs:::visit_expr'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,478,194 ( 0.02%) ???:::handle_res [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,472,073 ( 0.02%) 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] 2,460,538 ( 0.02%) 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] 2,458,467 ( 0.02%) 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] 2,435,346 ( 0.02%) ???:__rustc::__rust_alloc [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,418,383 ( 0.02%) ???: 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] 2,417,512 ( 0.02%) include/jemalloc/internal/util.h:tcache_bin_flush_small 2,411,280 ( 0.02%) ???:::visit_fn [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,400,710 ( 0.02%) src/base.c:pa_alloc 2,393,154 ( 0.02%) ???: as rustc_hir::intravisit::Visitor>::visit_nested_item'2 [???] 2,390,359 ( 0.02%) ???:::annotated_lines'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,377,600 ( 0.02%) ???:::parse_ty_common'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,376,431 ( 0.02%) ???:::hir_span_with_body'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,348,574 ( 0.02%) ???: 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] 2,347,393 ( 0.02%) ???:::resolve_doc_links [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,347,170 ( 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 2,347,170 ( 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 2,345,199 ( 0.02%) 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] 2,343,111 ( 0.02%) site/frontend/rust-clippy/clippy_lints/src/mixed_read_write_in_expression.rs:::maybe_walk_expr'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,329,256 ( 0.02%) ???:, 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] 2,329,054 ( 0.02%) ???:::parse_item_impl [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,324,780 ( 0.02%) site/frontend/rust-clippy/clippy_lints/src/mixed_read_write_in_expression.rs:::visit_expr'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,321,858 ( 0.02%) ???:::expect_hir_owner_nodes'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,320,088 ( 0.02%) src/eset.c:pa_alloc 2,315,478 ( 0.02%) ???:<[rustc_ast::tokenstream::TokenTree] as rustc_serialize::serialize::Encodable>::encode'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,312,415 ( 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] 2,307,364 ( 0.02%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::dep_graph::graph::DepNodeIndex>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,306,968 ( 0.02%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,294,579 ( 0.02%) ???:rustc_query_impl::execution::ensure_can_skip_execution::, rustc_middle::dep_graph::graph::DepNodeIndex>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,290,917 ( 0.02%) ???:::lower_qpath'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,288,440 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/hygiene.rs:>::with::<::with::outer_expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> 2,283,674 ( 0.02%) ???:>::with_lint_attrs::< as rustc_ast::visit::Visitor>::visit_local::{closure#0}>::{closure#0} [???] 2,282,590 ( 0.02%) 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] 2,276,227 ( 0.02%) ???:::def_path_hash [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,267,925 ( 0.02%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,259,278 ( 0.02%) include/jemalloc/internal/tsd.h:realloc 2,257,360 ( 0.02%) ???:::parse_item_common [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,251,668 ( 0.02%) ???:::parse_constness_ [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,246,093 ( 0.02%) ???:::visit_pat'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,226,581 ( 0.02%) 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] 2,220,137 ( 0.02%) ???: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] 2,216,004 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/thread_local/native/mod.rs:clippy_utils::macros::first_node_in_macro:: 2,202,956 ( 0.02%) ???:::visit_expr'2 [???] 2,201,885 ( 0.02%) ???:rustc_span::hygiene::decode_syntax_context::::decode_syntax_context::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,197,916 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/hygiene.rs:>::with::<::with::outer_expn::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnId> 2,194,184 ( 0.02%) ???:::from_span_full::::macro_backtrace::{closure#0}>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,172,768 ( 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] 2,171,347 ( 0.02%) ???:::mk_bound_variable_kinds [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,156,444 ( 0.02%) ???: as rustc_ast::visit::Visitor>::visit_pat [???] 2,156,088 ( 0.02%) ???: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] 2,148,908 ( 0.02%) ???:::encode_info_for_mod [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,136,408 ( 0.02%) ???:::create_def [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,135,843 ( 0.02%) ???:::new_named_lifetime [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,127,458 ( 0.02%) ???:rustc_query_impl::plumbing::encode_query_values_inner::>, &rustc_middle::middle::codegen_fn_attrs::CodegenFnAttrs>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,118,820 ( 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_qpath:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,118,309 ( 0.02%) ???:<&rustc_middle::ty::list::RawList 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] 2,116,863 ( 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:clippy_utils::macros::root_macro_call 2,106,560 ( 0.02%) /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::macros::root_macro_call 2,097,424 ( 0.02%) ???:::resolve_anonymous_lifetime [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,097,320 ( 0.02%) ???:::type_dependent_def [???] 2,097,035 ( 0.02%) ???: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] 2,089,241 ( 0.02%) ???:::resolve_imports'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,085,460 ( 0.02%) ???:::feed_visibility [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,068,638 ( 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_qpath:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,064,942 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/lib.rs: as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::find_map::check<(rustc_span::hygiene::ExpnId, rustc_span::hygiene::ExpnData), clippy_utils::macros::MacroCall, &mut clippy_utils::macros::macro_backtrace::{closure#0}>::{closure#0}, core::ops::control_flow::ControlFlow> 2,061,024 ( 0.02%) ???: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] 2,059,546 ( 0.02%) ???:::is_impl_trait_in_trait [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,047,730 ( 0.02%) ???:::lex_token_trees [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,047,435 ( 0.02%) ???:::path_all [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,043,923 ( 0.02%) ???:, 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] 2,043,611 ( 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::>'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,037,906 ( 0.02%) ???:::visit_nested_item'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,018,527 ( 0.02%) ???:::visit_assoc_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,017,284 ( 0.02%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,004,888 ( 0.02%) /rust/deps/thin-vec-0.2.19/src/lib.rs:::check_attributes 2,003,008 ( 0.02%) site/frontend/rust-clippy/clippy_lints/src/cognitive_complexity.rs:rustc_hir::intravisit::walk_expr::::check::{closure#0}>>'2 1,994,004 ( 0.02%) ???:::lookup_line [???] 1,993,298 ( 0.02%) ???: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] 1,992,642 ( 0.02%) ???:::annotated_lines [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,984,560 ( 0.02%) ???:::fmt [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,984,423 ( 0.02%) ???:::const_eval_resolve [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,983,565 ( 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] 1,983,072 ( 0.02%) site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs:::check_block [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,980,979 ( 0.02%) /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 1,974,958 ( 0.02%) ???:::confirm_candidate [???] 1,970,404 ( 0.02%) site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::check_attributes 1,970,404 ( 0.02%) site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::check_attributes_post 1,962,458 ( 0.02%) ???:::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] 1,961,040 ( 0.02%) ???:::pat_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,955,975 ( 0.02%) ???:::typeck_body'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,955,749 ( 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 1,945,795 ( 0.02%) ???:>::reserve [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,945,174 ( 0.02%) /rust/deps/scoped-tls-1.0.1/src/lib.rs:>::with::<::with::outer_expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,936,857 ( 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:clippy_lints::doc::doc_suspicious_footnotes::check 1,935,526 ( 0.02%) ???: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] 1,932,023 ( 0.02%) ???:::lower_pat_mut'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,928,873 ( 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::::{closure#0}>>'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,928,501 ( 0.02%) ???:::serialize::{closure#0}'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,927,574 ( 0.02%) site/frontend/rust-clippy/clippy_lints/src/functions/too_many_lines.rs:::check_fn 1,919,418 ( 0.02%) /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,916,538 ( 0.02%) ???:rustc_expand::mbe::quoted::parse'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,915,836 ( 0.02%) ???:>::encode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,913,887 ( 0.02%) ???:::finish_grow [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,910,326 ( 0.02%) ???:::hir_maybe_body_owned_by [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,908,068 ( 0.02%) ???:::visit_ty'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,906,784 ( 0.02%) ???:::lower_fn_decl [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,905,992 ( 0.02%) ???:rustc_query_impl::query_impl::def_span::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,905,267 ( 0.02%) ???:rustc_query_impl::query_impl::explicit_clauses_of::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,894,882 ( 0.02%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,892,828 ( 0.02%) ???: as rustc_serialize::serialize::Encodable>::encode [???] 1,892,404 ( 0.02%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,891,535 ( 0.02%) ???:::mark_span_with_reason [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,890,556 ( 0.02%) ???:rustc_query_impl::query_impl::lookup_deprecation_entry::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,886,646 ( 0.02%) ???:::evaluate_trait_predicate_recursively [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,884,537 ( 0.02%) ???:rustc_ast::visit::visit_stmts::> [???] 1,883,664 ( 0.02%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,863,960 ( 0.02%) ???:::{closure#1} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::dep_graph::dep_node::DepNode, rustc_middle::dep_graph::serialized::SerializedDepNodeIndex, rustc_middle::dep_graph::graph::DepNodeIndex)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,862,649 ( 0.02%) src/hook.c:realloc 1,858,657 ( 0.02%) ???:>>::walk_ref [???] 1,852,192 ( 0.02%) ???:rustc_query_impl::query_impl::inferred_outlives_of::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,851,701 ( 0.02%) ???: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] 1,842,361 ( 0.02%) ???: as rustc_hir::intravisit::Visitor>::visit_ty [???] 1,829,063 ( 0.02%) 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] 1,820,980 ( 0.02%) ???:::par_hir_body_owners::::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,817,062 ( 0.02%) ???:::lower_format_args'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,813,809 ( 0.02%) ???:::resolve_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,812,198 ( 0.02%) site/frontend/rust-clippy/clippy_utils/src/consts.rs:::expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,810,599 ( 0.02%) 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] 1,805,809 ( 0.01%) ???:::resolve_block [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,801,430 ( 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 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,801,430 ( 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 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,792,182 ( 0.01%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,789,017 ( 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_post 1,787,815 ( 0.01%) /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 1,787,224 ( 0.01%) ???:rustc_ty_utils::layout::layout_of_uncached'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,786,315 ( 0.01%) ???:>>::walk_ref [???] 1,779,046 ( 0.01%) ???:, serde_json::ser::CompactFormatter> as serde_core::ser::SerializeStruct>::serialize_field:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,776,347 ( 0.01%) ???:rustc_hir::intravisit::walk_pat::> [???] 1,770,223 ( 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_start_matches::<::is_whitespace> 1,760,531 ( 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_fn 1,752,609 ( 0.01%) ???:> 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] 1,751,784 ( 0.01%) ???:::visit_item'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,745,280 ( 0.01%) ???:core::ptr::drop_glue::> [???] 1,744,961 ( 0.01%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,740,595 ( 0.01%) ???:::parse_dot_suffix_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,739,736 ( 0.01%) ???:::in_external_macro'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,737,119 ( 0.01%) ???:::parse_expr_force_collect [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,737,002 ( 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] 1,736,057 ( 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> 1,733,365 ( 0.01%) ???:rustc_query_impl::query_impl::generics_of::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,729,276 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check_expr 1,725,944 ( 0.01%) ???:rustc_ty_utils::layout::layout_of_uncached [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,722,356 ( 0.01%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,721,755 ( 0.01%) ???:>::walk_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,720,797 ( 0.01%) ???:rustc_query_impl::query_impl::hir_owner::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,713,551 ( 0.01%) include/jemalloc/internal/cache_bin.h:malloc_default 1,708,284 ( 0.01%) ???:>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,704,254 ( 0.01%) ???:::resolve_crate::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,700,464 ( 0.01%) ???:::visit_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,699,461 ( 0.01%) ???:rustc_middle::hir::map::crate_hash'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,697,396 ( 0.01%) include/jemalloc/internal/fb.h:pa_alloc 1,696,934 ( 0.01%) ???: as rustc_hir::intravisit::Visitor>::visit_block [???] 1,695,596 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/regex.rs:::check_expr_post 1,690,576 ( 0.01%) ???:0x000000000000ba80 [/usr/lib/ld-linux-x86-64.so.2] 1,689,908 ( 0.01%) ???:>::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] 1,684,635 ( 0.01%) ???:::expr_ident_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,682,709 ( 0.01%) ???:::check_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,676,784 ( 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:::visit_pat 1,676,596 ( 0.01%) ???: 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] 1,674,805 ( 0.01%) ???:::visit_node:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,672,080 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/attrs.rs:::check_attributes 1,669,568 ( 0.01%) ???:annotate_snippets::renderer::render::style_substitution_highlights'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,667,994 ( 0.01%) ???:::visit_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,666,501 ( 0.01%) ???:>::instantiate_supertrait [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,659,676 ( 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 1,654,225 ( 0.01%) ???:<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::generic_args::GenericArg> 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] 1,651,021 ( 0.01%) /rust/deps/pulldown-cmark-0.11.3/src/parse.rs: as core::iter::traits::iterator::Iterator>::next [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,648,437 ( 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:>::with::<::with::outer_expn::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnId> 1,648,437 ( 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:>::with::<::with::outer_expn::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnId> 1,648,437 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:>::with::<::with::outer_expn::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnId> 1,647,173 ( 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] 1,643,598 ( 0.01%) ???:::def_path_hash [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,643,001 ( 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 1,637,389 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/swap.rs:::check_block [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,629,569 ( 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 1,629,072 ( 0.01%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,628,929 ( 0.01%) include/jemalloc/internal/atomic.h:tcache_bin_flush_small 1,625,912 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/unnested_or_patterns.rs:::check_expr 1,625,200 ( 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 1,625,080 ( 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 1,624,998 ( 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 1,624,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 1,624,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 1,624,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 1,624,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 1,624,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 1,624,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 1,624,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 1,624,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 1,624,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 1,624,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 1,624,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:clippy_lints::unit_types::unit_arg::check 1,624,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:clippy_lints::unit_types::unit_cmp::check 1,621,767 ( 0.01%) ???:>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,617,969 ( 0.01%) ???:>::walk_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,617,788 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::never_loop_block'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,614,895 ( 0.01%) /rust/deps/hashbrown-0.17.1/src/raw.rs:::check_expr 1,614,611 ( 0.01%) ???: as rustc_ast::visit::Visitor>::visit_stmt::{closure#0} [???] 1,614,197 ( 0.01%) ???:>::reserve::do_reserve_and_handle:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,608,634 ( 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 1,608,182 ( 0.01%) ???:::clone [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,606,776 ( 0.01%) ???:rustc_ast::visit::visit_stmts::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,602,442 ( 0.01%) ???:>, 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] 1,601,348 ( 0.01%) ???:>::get_attrs [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,599,279 ( 0.01%) ???:std::exception::~exception() [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,598,911 ( 0.01%) ???:::fn_sig [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,598,210 ( 0.01%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,590,605 ( 0.01%) ???:::visit_block'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,586,987 ( 0.01%) ???:::check_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,584,695 ( 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] 1,580,905 ( 0.01%) ???:>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,577,011 ( 0.01%) ???:::parse_expr_dot_or_call_with::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,563,989 ( 0.01%) ???:>::walk_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,561,626 ( 0.01%) ???:rustc_query_impl::execution::try_execute_query::>, true>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,561,241 ( 0.01%) ???:::collect_tokens::, ::collect_tokens_for_expr<::parse_expr_prefix::{closure#8}>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,555,746 ( 0.01%) ???:>>::collect_and_apply::, <&rustc_middle::ty::list::RawList<(), rustc_middle::ty::generic_args::GenericArg> as rustc_serialize::serialize::Decodable>::decode::{closure#0}>, ::mk_args_from_iter, <&rustc_middle::ty::list::RawList<(), rustc_middle::ty::generic_args::GenericArg> as rustc_serialize::serialize::Decodable>::decode::{closure#0}>, rustc_middle::ty::generic_args::GenericArg>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,549,678 ( 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 1,549,208 ( 0.01%) ???:::create_def [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,545,113 ( 0.01%) 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] 1,538,352 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/eta_reduction.rs:clippy_lints::eta_reduction::check_closure [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,528,369 ( 0.01%) ???: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,522,893 ( 0.01%) ???:::try_plant_decl_into_local_module'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,516,341 ( 0.01%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,505,025 ( 0.01%) include/jemalloc/internal/atomic.h:realloc 1,504,366 ( 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] 1,499,861 ( 0.01%) ???:rustc_query_impl::query_impl::type_of::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,498,293 ( 0.01%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,497,516 ( 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 1,496,232 ( 0.01%) /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 1,496,232 ( 0.01%) /rust/deps/smallvec-1.15.1/src/lib.rs:::meets [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,496,232 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets 1,494,954 ( 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:>::with::<::with::expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> 1,494,954 ( 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:>::with::<::with::expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> 1,494,954 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:>::with::<::with::expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> 1,494,471 ( 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 1,493,300 ( 0.01%) include/jemalloc/internal/jemalloc_internal_inlines_a.h:realloc 1,488,137 ( 0.01%) ???:::brg_visit_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,478,736 ( 0.01%) ???:::node_args [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,477,973 ( 0.01%) ???:::hir_get_parent_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,477,336 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:clippy_utils::macros::first_node_in_macro:: 1,470,089 ( 0.01%) include/jemalloc/internal/rtree.h:ecache_evict 1,469,336 ( 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: as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::find_map::check<(rustc_span::hygiene::ExpnId, rustc_span::hygiene::ExpnData), clippy_utils::macros::MacroCall, &mut clippy_utils::macros::macro_backtrace::{closure#0}>::{closure#0}, core::ops::control_flow::ControlFlow> 1,469,009 ( 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 1,464,734 ( 0.01%) 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] 1,464,542 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs:::check_local [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,461,348 ( 0.01%) ???:::visit_item'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,460,975 ( 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 1,460,330 ( 0.01%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,453,368 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/unit_types/mod.rs:::check_expr 1,450,237 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/res.rs:::check_expr 1,448,885 ( 0.01%) ???:rustc_resolve::rustdoc::add_doc_fragment [???] 1,448,049 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/types/mod.rs:::check_ty [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,446,888 ( 0.01%) ???:, serde_json::ser::CompactFormatter> as serde_core::ser::SerializeStruct>::serialize_field::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,445,177 ( 0.01%) ???:::visit_assoc_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,440,686 ( 0.01%) 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] 1,439,454 ( 0.01%) ???:::from_errors_diagnostic [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,438,219 ( 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:::visit_qpath [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,436,644 ( 0.01%) ???:>::with_lint_attrs::< as rustc_ast::visit::Visitor>::visit_param::{closure#0}>::{closure#0} [???] 1,434,262 ( 0.01%) ???:::prepare_to_combine [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,431,652 ( 0.01%) ???:::visit_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,428,815 ( 0.01%) ???:::parse_expr_assoc_with [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,427,281 ( 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_pat:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,419,805 ( 0.01%) ???:>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,414,095 ( 0.01%) ???:::visit_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,413,061 ( 0.01%) ???:::visit_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,412,988 ( 0.01%) ???:>::with::::data::{closure#0}>::{closure#0}, rustc_span::SpanData> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,409,154 ( 0.01%) ???:::flat_map_stmt [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,403,498 ( 0.01%) ???:core::str::count::char_count_general_case [???] 1,401,900 ( 0.01%) ???:::check_stmt [???] 1,401,359 ( 0.01%) ???:::parse_visibility [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,398,732 ( 0.01%) ???:::visit_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,397,520 ( 0.01%) ???: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] 1,392,252 ( 0.01%) ???:::expr_adjustments [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,390,293 ( 0.01%) ???:::expn_def_scope [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,386,416 ( 0.01%) ???: 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] 1,384,074 ( 0.01%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,382,767 ( 0.01%) 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] 1,375,161 ( 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 1,373,734 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::method_chain_args [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,362,591 ( 0.01%) ???:::flat_map_item'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,356,947 ( 0.01%) ???:rustc_hir::intravisit::walk_qpath:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,351,225 ( 0.01%) ???:>>::drop_slow [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,346,709 ( 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_utils::method_chain_args 1,345,682 ( 0.01%) ???:rustc_ast::util::comments::beautify_doc_string [???] 1,344,961 ( 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_pat:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,342,672 ( 0.01%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,339,871 ( 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:::visit_expr'2 1,339,830 ( 0.01%) /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_from_raw_parts::check_implicit_cast 1,337,664 ( 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 1,337,664 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/attrs.rs:::check_attributes_post 1,336,955 ( 0.01%) /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 1,334,582 ( 0.01%) ???: as rustc_hir::intravisit::Visitor>::visit_nested_body [???] 1,333,738 ( 0.01%) ???:::check_for_ambiguity::, rustc_expand::mbe::macro_rules::NoopTracker> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,331,788 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/consts.rs:::qpath [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,331,027 ( 0.01%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,330,585 ( 0.01%) ???:>::univariant::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,329,718 ( 0.01%) ???:::filter_map_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,322,313 ( 0.01%) ???:>::encode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,322,114 ( 0.01%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,322,080 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/eta_reduction.rs:::check_expr 1,318,412 ( 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_utils::macros::first_node_in_macro:: 1,317,996 ( 0.01%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,314,723 ( 0.01%) 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] 1,309,724 ( 0.01%) ???:>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,309,255 ( 0.01%) ???:::make [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,307,574 ( 0.01%) /rust/deps/indexmap-2.14.0/src/map.rs:>::swap_remove:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,301,372 ( 0.01%) ???:::trait_impl_of_assoc'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,298,438 ( 0.01%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,296,954 ( 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 1,295,787 ( 0.01%) ???:rustc_query_impl::query_impl::hir_owner_parent_q::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,291,005 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_const_context [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,289,715 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::span_matches_pat [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,285,694 ( 0.01%) ???:>>::walk_ref'2 [???] 1,281,546 ( 0.01%) /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,281,045 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:::check_methods [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,280,725 ( 0.01%) src/extent.c:pa_alloc 1,272,011 ( 0.01%) ???:rustc_query_impl::execution::ensure_can_skip_execution::, rustc_middle::dep_graph::graph::DepNodeIndex>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,270,880 ( 0.01%) ???:>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,268,565 ( 0.01%) /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 1,266,601 ( 0.01%) ???:>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,260,139 ( 0.01%) ???:::match_impl::{closure#0} [???] 1,259,526 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/manual_non_exhaustive.rs:::check_expr 1,257,844 ( 0.01%) ???:rustc_interface::passes::emit_delayed_lints [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,252,929 ( 0.01%) /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] 1,248,093 ( 0.01%) ???:>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,241,516 ( 0.01%) ???:::trait_impl_of_assoc [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,241,112 ( 0.01%) ???:> as rustc_middle::ty::codec::RefDecodable>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,240,645 ( 0.01%) ???:>::eval_rvalue_into_place [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,239,882 ( 0.01%) ???:::walk::<::resolve_pattern_inner::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,236,781 ( 0.01%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,235,190 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs:::check_fn [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,234,837 ( 0.01%) /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 1,234,183 ( 0.01%) ???:::is_valid_span [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,232,959 ( 0.01%) ???:::emit_diagnostic::{closure#3} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,231,051 ( 0.01%) ???:::handle_res'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,229,832 ( 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 1,229,832 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/attrs/mod.rs:::check_attributes_post 1,228,019 ( 0.01%) ???:>::encode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,227,285 ( 0.01%) ???:rustc_middle::dep_graph::graph::hash_result::<&rustc_data_structures::unord::UnordSet> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,227,061 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:clippy_utils::higher::has_let_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,226,901 ( 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 1,219,066 ( 0.01%) 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] 1,217,029 ( 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 1,214,968 ( 0.01%) include/jemalloc/internal/arena_inlines_b.h:malloc_default 1,213,041 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/needless_parens_on_range_literals.rs:::check_expr 1,211,140 ( 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 1,211,140 ( 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 1,211,140 ( 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 1,211,140 ( 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 1,211,140 ( 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 1,211,140 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/functions/mod.rs:::check_expr 1,205,894 ( 0.01%) ???:::visit_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,205,368 ( 0.01%) ???: 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] 1,205,100 ( 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> 1,204,471 ( 0.01%) 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] 1,202,520 ( 0.01%) ???:rustc_query_impl::plumbing::encode_query_values_inner::>, rustc_type_ir::binder::EarlyBinder>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,199,590 ( 0.01%) ???:rustc_query_impl::plumbing::try_load_from_disk:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,198,922 ( 0.01%) ???:thin_vec::drop_non_singleton::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,198,620 ( 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_pat:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,196,999 ( 0.01%) 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] 1,194,697 ( 0.01%) ???:::expect [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,194,278 ( 0.01%) ???:::add_import::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,192,096 ( 0.01%) ???:::stable_hash::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,184,824 ( 0.01%) ???:::flat_map_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,180,161 ( 0.01%) ???:>::with::::new::{closure#0}::{closure#0}>::{closure#0}, u32> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,179,946 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:::check_stmt [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,179,583 ( 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:malloc_default [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,176,797 ( 0.01%) ???:>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,171,373 ( 0.01%) ???:::clone [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,168,842 ( 0.01%) ???:<[rustc_middle::ty::generic_args::GenericArg] as rustc_serialize::serialize::Encodable>::encode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,167,341 ( 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 1,166,131 ( 0.01%) ???:::span_labels [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,166,115 ( 0.01%) ???:rustc_errors::annotate_snippet_emitter_writer::shrink_file [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,160,083 ( 0.01%) ???:::visit_item'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,158,322 ( 0.01%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,154,363 ( 0.01%) ???:::alloc_ctxt'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,153,484 ( 0.01%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,153,484 ( 0.01%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,153,484 ( 0.01%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,153,355 ( 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::doc::doc_suspicious_footnotes::check 1,152,544 ( 0.01%) ???: as rustc_ast::visit::Visitor>::visit_pat'2 [???] 1,151,885 ( 0.01%) 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] 1,151,434 ( 0.01%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,149,173 ( 0.01%) ???:>, ::emit_messages_default::{closure#8}> 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] 1,148,040 ( 0.01%) ???:>::with::::is_dummy::{closure#0}>::{closure#0}, rustc_span::SpanData> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,147,998 ( 0.01%) ???:rustc_const_eval::const_eval::fn_queries::constness [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,145,866 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/incompatible_msrv.rs:::check_ty 1,145,243 ( 0.01%) ???:::lower_attrs_with_extra [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,143,271 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/ty/structural_impls.rs:>::super_fold_with::> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,140,813 ( 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 1,139,972 ( 0.01%) ???:>::grow [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,139,720 ( 0.01%) ???:>::reserve_rehash::>>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,139,503 ( 0.01%) 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] 1,139,098 ( 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 1,137,608 ( 0.01%) ???:rustc_query_impl::query_impl::clauses_of::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,137,309 ( 0.01%) ???:::visit_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,133,930 ( 0.01%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,132,933 ( 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 1,132,933 ( 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 1,132,933 ( 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 1,132,933 ( 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 1,132,597 ( 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_lints::casts::borrow_as_ptr::check_implicit_cast 1,131,581 ( 0.01%) ???:::walk::<::check_consistent_bindings::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,130,296 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/res.rs:::check_expr 1,126,663 ( 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] 1,125,248 ( 0.01%) ???:::parse_expr_prefix [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,119,993 ( 0.01%) include/jemalloc/internal/tsd_tls.h:realloc 1,116,936 ( 0.01%) ???:::lower_pat_mut::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,115,967 ( 0.01%) ???:rustc_ast::visit::visit_items::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,115,338 ( 0.01%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,112,370 ( 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:::visit_pat 1,112,228 ( 0.01%) ???:>::decode'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,104,499 ( 0.01%) ???:rustc_passes::dead::has_allow_dead_code_or_lang_attr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,100,790 ( 0.01%) ???:::add_annotation_to_file'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,099,388 ( 0.01%) ???:rustc_query_impl::query_impl::evaluate_obligation::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,098,971 ( 0.01%) ???:rustc_query_impl::query_impl::hir_attr_map::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,097,447 ( 0.01%) ???:rustc_query_impl::query_impl::shallow_lint_levels_on::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,094,752 ( 0.01%) ???:::next [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,092,442 ( 0.01%) 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] 1,090,291 ( 0.01%) ???:::lower_block_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,090,277 ( 0.01%) ???:::parent_module_from_def_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,089,849 ( 0.01%) ???:::get_diagnostic_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,089,591 ( 0.01%) ???:rustc_ast::visit::visit_assoc_items::> [???] 1,087,789 ( 0.01%) ???:0x000000000000aec0 [/usr/lib/ld-linux-x86-64.so.2] 1,087,283 ( 0.01%) 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] 1,085,161 ( 0.01%) ???:::to_attr_token_stream [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,084,928 ( 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::is_expn_of 1,083,784 ( 0.01%) ???:<(&rustc_span::def_id::DefId, &rustc_span::def_id::DefId) 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] 1,082,223 ( 0.01%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,076,453 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/mixed_read_write_in_expression.rs:::visit_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,075,448 ( 0.01%) ???:::edition [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,075,031 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/no_effect.rs:::check_stmt [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,072,708 ( 0.01%) /rust/deps/smallvec-1.15.1/src/lib.rs:<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::Ty> as rustc_type_ir::fold::TypeFoldable>::fold_with::> 1,071,782 ( 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 1,070,966 ( 0.01%) ???:::visit_pat'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,070,888 ( 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 1,070,888 ( 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 1,068,538 ( 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_qpath:: 1,067,173 ( 0.01%) ???:::parent_hir_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,060,082 ( 0.01%) ???:::visit_stmt'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,057,802 ( 0.01%) /rust/deps/hashbrown-0.17.0/src/raw.rs:>::insert::, rustc_type_ir::sty::Region>::{closure#0}> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,056,006 ( 0.01%) 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] 1,054,896 ( 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_qpath:: 1,053,641 ( 0.01%) 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] 1,053,612 ( 0.01%) 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,053,257 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/unnested_or_patterns.rs:clippy_lints::unnested_or_patterns::lint_unnested_or_patterns [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,052,418 ( 0.01%) ???:core::ptr::drop_glue::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,052,352 ( 0.01%) ???:::end_point [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,049,848 ( 0.01%) ???:rustc_builtin_macros::format::make_format_args [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,047,761 ( 0.01%) ???:::check_expr_post [???] 1,045,852 ( 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] 1,042,383 ( 0.01%) ???:::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] 1,035,760 ( 0.01%) ???:<&rustc_middle::ty::list::RawList<(), rustc_type_ir::canonical::CanonicalVarKind> 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] 1,025,722 ( 0.01%) ???:rustc_query_impl::execution::try_execute_query::>, rustc_middle::query::erase::ErasedData<[u8; 2]>>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,021,395 ( 0.01%) ???:core::ptr::drop_glue::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,016,814 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/suspicious_trait_impl.rs:::check_expr 1,014,153 ( 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_fn 1,014,123 ( 0.01%) ???:::hash_expn::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,014,122 ( 0.01%) ???:rustc_data_structures::unord::hash_iter_order_independent::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,005,857 ( 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 1,005,695 ( 0.01%) ???:::eq [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,004,820 ( 0.01%) ???:::write_import_resolutions::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,003,248 ( 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 1,003,248 ( 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 1,003,248 ( 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 1,002,727 ( 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 1,000,357 ( 0.01%) ???:::walk_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 999,079 ( 0.01%) ???:::parse_arm::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 999,006 ( 0.01%) ???:rustc_query_impl::plumbing::promote_from_disk_inner::, rustc_middle::dep_graph::graph::DepNodeIndex>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 996,988 ( 0.01%) ???:::from_tokens [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 996,864 ( 0.01%) /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_in_macro:: 996,841 ( 0.01%) /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 993,654 ( 0.01%) ???:::visit_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 993,123 ( 0.01%) ???:::mut_visit_with:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 993,048 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/uninit_vec.rs:::check_block [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 984,518 ( 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: as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::find_map::check<(rustc_span::hygiene::ExpnId, rustc_span::hygiene::ExpnData), clippy_utils::macros::MacroCall, &mut clippy_utils::macros::macro_backtrace::{closure#0}>::{closure#0}, core::ops::control_flow::ControlFlow> 983,468 ( 0.01%) ???:rustc_query_impl::query_impl::param_env::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 981,925 ( 0.01%) ???:::instantiate_identity_into [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 981,667 ( 0.01%) ???:rustc_hir::intravisit::walk_ty::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 981,074 ( 0.01%) ???:rustc_query_impl::query_impl::codegen_fn_attrs::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 980,140 ( 0.01%) ???:::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] 979,830 ( 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 978,796 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/vec_init_then_push.rs:::check_expr 975,643 ( 0.01%) /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::> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 975,459 ( 0.01%) ???:rustc_mir_transform::mir_keys'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 967,358 ( 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] 966,095 ( 0.01%) ???:rustc_hir::intravisit::walk_expr::>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 965,786 ( 0.01%) ???: as rustc_serialize::serialize::Decodable>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 962,701 ( 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] 960,309 ( 0.01%) ???:::check_block [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 958,079 ( 0.01%) ???:::lower_maybe_coroutine_body [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 955,219 ( 0.01%) ???:rustc_middle::dep_graph::graph::hash_result::<&[rustc_span::def_id::DefId]> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 953,842 ( 0.01%) /rust/deps/indexmap-2.14.0/src/map.rs:>::get:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 953,147 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/default.rs:::check_block [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 950,697 ( 0.01%) ???:::visit_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 949,463 ( 0.01%) ???:::expand_ext [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 945,109 ( 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_qpath:: 943,936 ( 0.01%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 941,832 ( 0.01%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 941,832 ( 0.01%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 940,477 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/utils/author.rs:::check_stmt [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 938,784 ( 0.01%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 937,056 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs:::check_block_post [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 935,285 ( 0.01%) ???:::mk_canonical_var_kinds [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 934,714 ( 0.01%) ???:::ensure_source_file_source_present [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 924,440 ( 0.01%) ???:::path_matches [???] 924,003 ( 0.01%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 923,062 ( 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] 920,580 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:>::with::<::with::expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> 920,376 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/utils/dump_hir.rs:::check_stmt [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 916,896 ( 0.01%) include/jemalloc/internal/tcache_inlines.h:malloc_default 915,376 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_data_structures/src/sync/lock.rs:>::with::<::with::outer_expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> 913,364 ( 0.01%) ???:::finalize_import::{closure#2} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 912,689 ( 0.01%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 911,994 ( 0.01%) ???:::walk_::<::necessary_variants::{closure#0}> [???] 910,419 ( 0.01%) ???:::lower_expr_if'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 908,360 ( 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:::visit_pat 903,630 ( 0.01%) ???:::parse_ident_common [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 901,570 ( 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] 899,192 ( 0.01%) ???:rustc_query_impl::plumbing::encode_query_values_inner::>, rustc_middle::ty::assoc::AssocItem>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 898,023 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cmp.rs:clippy_utils::macros::first_node_in_macro:: 897,789 ( 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:::emit_lint_if_under_msrv 897,215 ( 0.01%) ???:::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] 895,922 ( 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_pat:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 894,417 ( 0.01%) ???:::clone'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 892,000 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/casts/needless_type_cast.rs:rustc_hir::intravisit::walk_expr::>'2 891,899 ( 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> 888,239 ( 0.01%) /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] 886,926 ( 0.01%) ???:pulldown_cmark::parse::item_to_event [???] 886,242 ( 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] 884,715 ( 0.01%) ???:::string [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 882,785 ( 0.01%) ???:rustc_hir_analysis::check_crate [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 878,606 ( 0.01%) include/jemalloc/internal/edata.h:ecache_evict 878,544 ( 0.01%) ???:::visit_item'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 877,660 ( 0.01%) ???:::resolve_arm [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 873,963 ( 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_ty:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 872,521 ( 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:::finish_grow [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 869,147 ( 0.01%) ???:rustc_ast::visit::walk_fn::> [???] 866,538 ( 0.01%) ???: as rustc_serialize::serialize::Decodable>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 865,897 ( 0.01%) ???:::parse_struct_fields [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 862,383 ( 0.01%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 862,200 ( 0.01%) ???:, serde_json::ser::CompactFormatter> as serde_core::ser::SerializeStruct>::serialize_field::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 861,080 ( 0.01%) include/jemalloc/internal/cache_bin.h:tcache_bin_flush_small 860,670 ( 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::is_in_const_context 858,960 ( 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] 858,246 ( 0.01%) ???:::rollback_to [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 857,689 ( 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:>::walk_ref'2 856,380 ( 0.01%) ???:::annotated_snippet [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 855,979 ( 0.01%) ???:rustc_expand::mbe::macro_check::check_nested_occurrences'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 854,542 ( 0.01%) ???:::visit_block'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 853,896 ( 0.01%) ???:::resolve_imports [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 853,466 ( 0.01%) ???:::flat_map_item'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 852,624 ( 0.01%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 851,898 ( 0.01%) ???:::set_bindings_effective_visibilities [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 850,746 ( 0.01%) ???:rustc_query_impl::plumbing::promote_from_disk_inner::>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 849,688 ( 0.01%) ???:>>::walk_ref [???] 848,066 ( 0.01%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 847,948 ( 0.01%) ???:::parse_limited_sym [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 847,439 ( 0.01%) ???:>>::walk_ref [???] 838,947 ( 0.01%) ???:>::walk_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 838,427 ( 0.01%) ???:::visit_item'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 836,587 ( 0.01%) ???:> as rustc_serialize::serialize::Encodable>::encode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 832,898 ( 0.01%) ???:::exec_cache_promotions [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 831,475 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 831,392 ( 0.01%) ???:::as_str [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 831,189 ( 0.01%) 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] 831,165 ( 0.01%) 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] 830,431 ( 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_qpath:: 826,960 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/unused_io_amount.rs:::check_block [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 824,886 ( 0.01%) ???:::brg_visit_item'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 824,738 ( 0.01%) ???:::is_descendant_of [???] 823,965 ( 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] 822,952 ( 0.01%) ???:>, ())>>::reserve_rehash::>, (), rustc_hash::FxBuildHasher>::{closure#0}> [???] 821,091 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/visitors.rs:rustc_hir::intravisit::walk_expr::>'2 820,783 ( 0.01%) ???:rustc_lint::expect::lint_expectations [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 820,557 ( 0.01%) ???:core::iter::adapters::map::map_fold::::definitions::{closure#0}, core::iter::adapters::map::map_fold>::extend_trusted, core::iter::adapters::map::Map, ::owners::{closure#0}>>, core::iter::adapters::map::Map, ::owners::{closure#1}>>, core::iter::adapters::map::Map, ::owners::{closure#2}>>, core::iter::adapters::map::Map, ::owners::{closure#3}>>, ::definitions::{closure#0}>, rustc_middle::hir::map::crate_hash::{closure#2}::{closure#0}>>::{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] 819,262 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/redundant_locals.rs:::check_local [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 816,543 ( 0.01%) ???:::expr_ty_adjusted [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 814,006 ( 0.01%) ???:::parse_self_param [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 812,891 ( 0.01%) ???:core::ptr::drop_glue::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 812,327 ( 0.01%) ???:rustc_ast::visit::walk_item_inner::> [???] 811,684 ( 0.01%) ???:annotate_snippets::renderer::render::maybe_anonymized'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 811,484 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/matches/needless_match.rs:clippy_lints::matches::needless_match::expr_ty_matches_p_ty'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 810,412 ( 0.01%) ???:rustc_query_impl::query_impl::asyncness::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] 810,396 ( 0.01%) ???:::break_and_eat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 807,663 ( 0.01%) ???:::evaluate_predicate_recursively'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 807,315 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::combine_branches [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 806,362 ( 0.01%) ???:::pat_ident_binding_mode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 805,122 ( 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_pat:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 804,457 ( 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 803,388 ( 0.01%) ???:rustc_ast::visit::visit_stmts::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 803,388 ( 0.01%) ???:rustc_ast::visit::visit_stmts::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 803,388 ( 0.01%) ???:rustc_ast::visit::visit_stmts::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 802,724 ( 0.01%) ???:rustc_ast::visit::visit_stmts::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 802,471 ( 0.01%) ???:::try_mark_green [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 802,402 ( 0.01%) ???:rustc_ast::visit::visit_stmts::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 800,954 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:>::with::<::with::outer_expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> 800,094 ( 0.01%) ???:::visit_item'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 799,350 ( 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 799,344 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/x86/sse2.rs:::check_expr 796,944 ( 0.01%) ???:rustc_query_impl::query_impl::typeck_root::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 793,006 ( 0.01%) ???:>::decode'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 791,528 ( 0.01%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 788,443 ( 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] 788,042 ( 0.01%) ???:::parse_expr_field::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 783,879 ( 0.01%) ???:>::encode [???] 781,182 ( 0.01%) ???:::typing_mode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 779,588 ( 0.01%) ???:::visit_ty'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 774,887 ( 0.01%) ???:rustc_ast::visit::walk_item_inner::>'2 [???] 774,289 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/useless_conversion.rs:::check_expr_post 773,910 ( 0.01%) ???:::typing_env [???] 773,127 ( 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_lints::loops::never_loop::never_loop_expr'2 772,938 ( 0.01%) ???:>::fold_clauses [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 772,873 ( 0.01%) /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: as rustc_type_ir::fold::TypeFolder>::fold_ty [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 772,831 ( 0.01%) ???:::visit_node::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 772,525 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:::eq_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 769,998 ( 0.01%) ???:::visit_stmt [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 767,015 ( 0.01%) ???:::hir_owner_parent [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 765,318 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_expr_use_site [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 762,888 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cmp.rs:::visit_pat 761,695 ( 0.01%) ???:::parse_generic_bounds_common [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 757,989 ( 0.01%) ???:>::copy_op_no_validate:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 757,058 ( 0.01%) ???:::grow_amortized [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 754,384 ( 0.01%) ???:>>>>::encode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 753,690 ( 0.01%) ???:::lower_arm [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 753,019 ( 0.01%) ???:annotate_snippets::renderer::render::maybe_anonymized [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 748,319 ( 0.01%) ???:rustc_query_impl::query_impl::coroutine_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] 748,170 ( 0.01%) ???:rustc_ast::visit::visit_stmts:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 748,116 ( 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 747,523 ( 0.01%) ???:::pad'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 746,848 ( 0.01%) ???: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] 746,476 ( 0.01%) ???:::check_lint_name [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 746,343 ( 0.01%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 746,111 ( 0.01%) ???:>::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] 746,076 ( 0.01%) include/jemalloc/internal/sz.h:malloc_default 745,696 ( 0.01%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 745,296 ( 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:::trim_matches::<::is_whitespace> 745,286 ( 0.01%) ???:::lower_expr_field [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 742,938 ( 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> 741,352 ( 0.01%) include/jemalloc/internal/mutex.h:pa_alloc 740,360 ( 0.01%) /rust/deps/indexmap-2.14.0/src/map.rs:>::get_mut:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 738,668 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cell.rs:clippy_utils::macros::first_node_in_macro:: 738,234 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/disallowed_types.rs:::check_res_emit [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 737,940 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:::check_expr 737,940 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:::check_expr 737,940 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:::check_expr 737,940 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:::check_expr 737,940 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:::check_expr 737,865 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:::check_expr 736,545 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::expr_search_pat::expr_search_pat_inner'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 734,200 ( 0.01%) ???:rustc_middle::query::inner::query_feed::>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 732,572 ( 0.01%) ???:rustc_mir_transform::cross_crate_inline::cross_crate_inlinable [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 731,054 ( 0.01%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 730,882 ( 0.01%) ???:::fully_expand_fragment'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 730,750 ( 0.01%) /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:::opt_item_name:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 730,365 ( 0.01%) 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] 729,458 ( 0.01%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 729,458 ( 0.01%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 729,348 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/methods/unnecessary_fallible_conversions.rs:clippy_lints::methods::unnecessary_fallible_conversions::check_function [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 727,483 ( 0.01%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 727,256 ( 0.01%) ???:::visit_qpath [???] 726,684 ( 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 726,684 ( 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 724,185 ( 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:::visit_qpath 722,370 ( 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] 720,654 ( 0.01%) ???: as rustc_ast::visit::Visitor>::visit_item'2 [???] 720,460 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/methods/clone_on_copy.rs:clippy_lints::methods::clone_on_copy::check_function [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 718,115 ( 0.01%) ???:rustc_middle::verify_ich::incremental_verify_ich::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 715,904 ( 0.01%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 714,710 ( 0.01%) ???:<&rustc_middle::ty::list::RawList<(), rustc_type_ir::binder::BoundVariableKind> 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] 712,202 ( 0.01%) ???:rustc_query_impl::query_impl::hir_attr_map::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] 711,805 ( 0.01%) ???:rustc_lint::levels::skippable_lints'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 711,513 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_lint_allowed [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 711,070 ( 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_local:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 710,886 ( 0.01%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 709,719 ( 0.01%) ???:::emit_diagnostic::{closure#3}::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 708,989 ( 0.01%) ???:::visit_poly_trait_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 708,603 ( 0.01%) include/jemalloc/internal/ph.h:eset_remove 708,566 ( 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] 707,871 ( 0.01%) ???:::hash::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 707,154 ( 0.01%) include/jemalloc/internal/cache_bin.h:tcache_bin_flush_stashed 707,126 ( 0.01%) ???:::check_assoc_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 706,782 ( 0.01%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 706,658 ( 0.01%) ???:::flat_map_assoc_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 705,727 ( 0.01%) ???:>::reserve_rehash::>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 705,710 ( 0.01%) ???:rustc_hir::intravisit::walk_pat::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 705,093 ( 0.01%) ???:::visit_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 703,485 ( 0.01%) ???:::handle_missing_lit::::mk_meta_item_lit_char>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 703,140 ( 0.01%) ???:::update_field [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 702,741 ( 0.01%) ???:<&rustc_middle::ty::list::RawList<(), rustc_type_ir::canonical::CanonicalVarKind> as rustc_serialize::serialize::Decodable>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 702,055 ( 0.01%) ???:::parse_pat_struct [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 701,349 ( 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 700,232 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/methods/unnecessary_to_owned.rs:clippy_lints::methods::unnecessary_to_owned::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 699,326 ( 0.01%) ???:, serde_json::ser::CompactFormatter> as serde_core::ser::SerializeStruct>::serialize_field::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 696,637 ( 0.01%) ???:>::walk_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 696,620 ( 0.01%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 695,766 ( 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_path::> 695,121 ( 0.01%) ???:::check_crate'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 695,094 ( 0.01%) ???:rustc_errors::formatting::format_diag_messages [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 694,526 ( 0.01%) include/jemalloc/internal/bit_util.h:pa_alloc 692,441 ( 0.01%) ???:::check_tokens'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 691,965 ( 0.01%) ???:::filter_map_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 689,436 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/toplevel_ref_arg.rs:::check_stmt [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 688,314 ( 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: as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::find_map::check<(rustc_span::hygiene::ExpnId, rustc_span::hygiene::ExpnData), clippy_utils::macros::MacroCall, &mut clippy_utils::macros::macro_backtrace::{closure#0}>::{closure#0}, core::ops::control_flow::ControlFlow> 687,423 ( 0.01%) ???:::emit_diagnostic [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 685,979 ( 0.01%) ???:::mk_type_list_from_iter::, as rustc_middle::ty::codec::RefDecodable>::decode::{closure#0}>, rustc_middle::ty::Ty> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 685,083 ( 0.01%) ???:::clone [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 684,393 ( 0.01%) ???:>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 682,790 ( 0.01%) ???:::hash::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 682,698 ( 0.01%) ???:rustc_query_impl::execution::try_execute_query::>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 682,439 ( 0.01%) ???:rustc_query_impl::query_impl::has_ffi_unwind_calls::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 682,118 ( 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_block::'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 681,061 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/symbol.rs:::visit_pat 680,915 ( 0.01%) src/sz.c:pa_alloc 680,634 ( 0.01%) ???:::visit_item'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 680,404 ( 0.01%) ???:::intern_const [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 679,707 ( 0.01%) ???:::typeck_root_def_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 679,100 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/mut_key.rs:::check_ty_ [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 678,238 ( 0.01%) /rust/deps/indexmap-2.14.0/src/inner/entry.rs:, rustc_type_ir::sty::Region>>::new [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 678,228 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:::get::{closure#0}> as rustc_hir::intravisit::Visitor>::visit_expr'2 677,247 ( 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] 677,040 ( 0.01%) ???:rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::module_children'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 676,935 ( 0.01%) ???:::insert'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 676,555 ( 0.01%) ???:, rustc_middle::dep_graph::graph::DepNodeIndex> 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] 676,293 ( 0.01%) ???:rustc_middle::dep_graph::graph::hash_result::<&rustc_middle::hir::ModuleItems> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 675,997 ( 0.01%) /rust/deps/indexmap-2.14.0/src/inner.rs:, rustc_type_ir::sty::Region>>::insert_unique [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 674,605 ( 0.01%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 674,334 ( 0.01%) ???:::parse_pat_fields::{closure#3} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 674,234 ( 0.01%) ???:::mk_args [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 672,276 ( 0.01%) ???:rustc_hir::intravisit::walk_item:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 671,454 ( 0.01%) ???:<::from_errors_diagnostic::BufWriter as core::io::write::Write>::write [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 671,003 ( 0.01%) ???:::encode_symbol [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 669,397 ( 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:>::retain:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 668,832 ( 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 668,302 ( 0.01%) ???:::update [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 667,245 ( 0.01%) ???:dladdr [/usr/lib/libc.so.6] 665,931 ( 0.01%) ???:::expr_ty_adjusted_opt [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 665,165 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/mixed_read_write_in_expression.rs:::maybe_walk_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 662,078 ( 0.01%) ???:rustc_query_impl::query_impl::implementations_of_trait::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 661,636 ( 0.01%) include/jemalloc/internal/sz.h:tcache_bin_flush_small 658,742 ( 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:::visit_pat 654,354 ( 0.01%) ???:rustc_ast::util::literal::escape_string_symbol [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 653,171 ( 0.01%) ???:> as rustc_data_structures::flat_map_in_place::FlatMapInPlace>>::flat_map_in_place::::{closure#0}, core::option::Option>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 651,684 ( 0.01%) ???:::lower_generic_param [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 651,352 ( 0.01%) ???: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] 651,130 ( 0.01%) ???:::flat_map_arm [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 650,363 ( 0.01%) ???:>::init_stack_frame [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 649,890 ( 0.01%) ???:::parse_path_inner'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 646,275 ( 0.01%) ???:::hir_body [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 645,117 ( 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 643,578 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/doc/doc_suspicious_footnotes.rs:clippy_lints::doc::doc_suspicious_footnotes::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 642,816 ( 0.01%) ???:::parse_generic_params [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 642,104 ( 0.01%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 642,003 ( 0.01%) ???:::parse_arm::{closure#0}'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 641,730 ( 0.01%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 641,298 ( 0.01%) /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}> 639,781 ( 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] 639,455 ( 0.01%) ???:rustc_query_impl::execution::try_execute_query::>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 639,156 ( 0.01%) include/jemalloc/internal/ph.h:ecache_evict 638,785 ( 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:::with_source_text::::{closure#0}> 636,147 ( 0.01%) ???: as rustc_data_structures::flat_map_in_place::FlatMapInPlace>::flat_map_in_place::::{closure#0}, smallvec::SmallVec<[rustc_ast::ast::Param; 1]>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 635,657 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/map_unit_fn.rs:::check_stmt [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 634,565 ( 0.01%) ???:::evaluate_root_obligation [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 632,252 ( 0.01%) ???:::cmp [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 631,968 ( 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::macros::root_macro_call 630,464 ( 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 628,410 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/disallowed_types.rs:::check_ty 627,213 ( 0.01%) ???:::mk_layout [???] 623,797 ( 0.01%) include/jemalloc/internal/rtree.h:pa_dalloc 623,608 ( 0.01%) ???:::check_case [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 622,400 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check_path 622,007 ( 0.01%) ???:rustc_ast::mut_visit::walk_fn:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 619,389 ( 0.01%) ???:pulldown_cmark::firstpass::run_first_pass [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 618,566 ( 0.01%) ???:, serde_json::ser::CompactFormatter> as serde_core::ser::SerializeStruct>::serialize_field::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 616,233 ( 0.01%) ???:::lower_use_tree [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 615,300 ( 0.01%) ???:<[rustc_ast::tokenstream::TokenTree] 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] 614,916 ( 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 614,389 ( 0.01%) ???:::lookup_line [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 611,200 ( 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] 611,130 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/lifetimes.rs:clippy_lints::lifetimes::could_use_elision [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 611,045 ( 0.01%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 609,200 ( 0.01%) ???:rustc_attr_parsing::validate_attr::check_attr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 608,568 ( 0.01%) ???:rustc_ast::visit::visit_arms::> [???] 608,322 ( 0.01%) ???:>::tys [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 607,243 ( 0.01%) ???:::visit_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 606,072 ( 0.01%) ???: 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] 605,904 ( 0.01%) ???:::process_obligation [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 604,084 ( 0.01%) ???:::render_multispans_macro_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 603,730 ( 0.01%) ???:rustc_query_impl::query_impl::coroutine_kind::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 603,303 ( 0.01%) ???:::resolve_and_cache_rustdoc_path [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 602,924 ( 0.01%) ???:::eq [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 601,804 ( 0.00%) ???:core::ptr::drop_glue::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 601,799 ( 0.00%) ???:rustc_query_impl::query_impl::fn_sig::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 600,431 ( 0.00%) ???:rustc_expand::mbe::transcribe::lockstep_iter_size'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 599,986 ( 0.00%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 599,662 ( 0.00%) ???:::pat_lang_item_variant [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 599,550 ( 0.00%) ???:rustc_query_impl::query_impl::variances_of::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 598,475 ( 0.00%) ???:rustc_lint::builtin::warn_if_doc [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 597,707 ( 0.00%) ???:>::encode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 597,250 ( 0.00%) ???:rustc_query_impl::plumbing::promote_from_disk_inner::>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 596,900 ( 0.00%) ???: 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] 596,285 ( 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_stmt::'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 596,281 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 596,066 ( 0.00%) ???:::lower_expr_if [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 595,224 ( 0.00%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 594,892 ( 0.00%) ???:rustc_query_impl::plumbing::try_load_from_disk::<&[rustc_span::def_id::DefId]> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 594,203 ( 0.00%) ???:::look_ahead::::parse_self_param::{closure#2}::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 593,896 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/disallowed_names.rs:::check_pat [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 593,208 ( 0.00%) ???:::visit_body [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 592,168 ( 0.00%) ???:::visit_variant [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 589,143 ( 0.00%) ???:rustc_ast::visit::walk_fn:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 589,143 ( 0.00%) ???:rustc_ast::visit::walk_fn:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 587,473 ( 0.00%) ???:::clone [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 586,862 ( 0.00%) ???:rustc_query_impl::plumbing::encode_query_values_inner::, rustc_middle::dep_graph::graph::DepNodeIndex>, &rustc_data_structures::unord::UnordSet>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 586,790 ( 0.00%) include/jemalloc/internal/edata.h:malloc_default 584,548 ( 0.00%) ???:rustc_query_impl::plumbing::encode_query_values_inner::>, rustc_type_ir::binder::EarlyBinder>>>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 584,518 ( 0.00%) ???:rustc_ast_pretty::pprust::path_to_string [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 584,339 ( 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 583,704 ( 0.00%) include/jemalloc/internal/atomic.h:pa_alloc 581,753 ( 0.00%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 581,172 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/map.rs:::check 580,443 ( 0.00%) ???:::pad_integral [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 580,194 ( 0.00%) ???:rustc_ty_utils::assoc::associated_types_for_impl_traits_in_trait_or_impl [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 579,212 ( 0.00%) ???:::expr_lang_item_path [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 579,036 ( 0.00%) ???:::visit_fn'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 578,691 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 577,718 ( 0.00%) ???:>::dying_next [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 577,116 ( 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::first_node_in_macro:: 575,328 ( 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:>::walk_ref'2 575,265 ( 0.00%) ???:::make_lang_item_path [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 575,168 ( 0.00%) ???:::next [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 575,062 ( 0.00%) ???:::visit_generics [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 572,110 ( 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:>::with::<::with::outer_expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> 571,470 ( 0.00%) ???:::is_const_fn:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 570,863 ( 0.00%) ???:>::tys'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 568,476 ( 0.00%) ???:<[rustc_span::def_id::LocalDefId] 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] 567,569 ( 0.00%) ???:>::reserve_rehash::>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 567,106 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 566,713 ( 0.00%) ???:>::visit_clauses [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 566,645 ( 0.00%) ???:::parse_path_segment'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 566,445 ( 0.00%) ???:>::encode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 565,026 ( 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 562,206 ( 0.00%) ???:rustc_query_impl::query_impl::constness::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 559,254 ( 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_lints::loops::never_loop::never_loop_block'2 557,959 ( 0.00%) ???: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] 557,514 ( 0.00%) ???:::parse_pat_tuple_struct [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 557,240 ( 0.00%) /rust/deps/pulldown-cmark-0.11.3/src/parse.rs:>::make_code_span [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 557,100 ( 0.00%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 556,887 ( 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:::trim_matches::<::is_whitespace> 556,383 ( 0.00%) ???:::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 556,010 ( 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] 555,062 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/consts.rs:::expr'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 554,662 ( 0.00%) ???:rustc_borrowck::borrowck_check_region_constraints [???] 554,575 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 554,225 ( 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] 553,535 ( 0.00%) ???:::visit_pat'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 552,572 ( 0.00%) ???:::def_path_hash [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 551,947 ( 0.00%) include/jemalloc/internal/sz.h:eset_remove 551,924 ( 0.00%) ???:::emit_diagnostic::{closure#3}'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 551,610 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/misc_early/unneeded_wildcard_pattern.rs:::check_pat 550,984 ( 0.00%) ???:::source_callsite [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 550,203 ( 0.00%) include/jemalloc/internal/ph.h:malloc_default 549,901 ( 0.00%) ???:::flat_map_item'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 549,090 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/dep_graph/graph.rs:rustc_middle::dep_graph::read_deps::<::read_index::{closure#0}>::{closure#0} 548,284 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 547,261 ( 0.00%) ???:rustc_query_impl::query_impl::associated_item::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 547,158 ( 0.00%) /rust/deps/thin-vec-0.2.19/src/lib.rs:>::walk_ref'2 547,141 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 546,946 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 546,839 ( 0.00%) ???:core::ptr::drop_glue::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 543,937 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/needless_ifs.rs:::check_stmt [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 543,458 ( 0.00%) include/jemalloc/internal/edata.h:eset_remove 543,385 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:clippy_utils::higher::has_let_expr'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 543,242 ( 0.00%) ???:::create_derived_impl [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 543,161 ( 0.00%) ???:rustc_query_impl::query_impl::trivial_const::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 543,074 ( 0.00%) ???:::hash::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 542,936 ( 0.00%) ???: as rustc_ast::visit::Visitor>::visit_fn [???] 542,396 ( 0.00%) ???:::generics [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 541,984 ( 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] 540,397 ( 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::has_non_exhaustive_attr 539,062 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/reserve_after_initialization.rs:::check_stmt [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 538,894 ( 0.00%) ???:>::reserve_rehash::>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 536,899 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/memchr.rs:::check_fn 536,579 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 535,518 ( 0.00%) ???:<::find_lifetime_for_self::FindReferenceVisitor as rustc_ast::visit::Visitor>::visit_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 533,990 ( 0.00%) ???:rustc_ast::visit::walk_fn:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 533,642 ( 0.00%) ???:::visit_qpath [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 532,963 ( 0.00%) ???:::from_multispan [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 531,711 ( 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::> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 530,538 ( 0.00%) ???:::visit_pat'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 530,064 ( 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::first_node_in_macro:: 528,347 ( 0.00%) ???:::node_type [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 526,771 ( 0.00%) ???:core::ptr::drop_glue::<[rustc_expand::mbe::macro_parser::NamedMatch]> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 526,602 ( 0.00%) ???:::macro_backtrace::{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] 521,136 ( 0.00%) ???:::hir_body_owner [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 520,791 ( 0.00%) ???:::into_outputs [???] 519,760 ( 0.00%) ???:>>::walk_ref [???] 519,009 ( 0.00%) ???:::send_new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 518,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: 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 517,344 ( 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_utils::fn_def_id_with_node_args 515,445 ( 0.00%) ???:::resolve_pattern_inner::{closure#0}'2 [???] 514,920 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/vec_init_then_push.rs:::check_local [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 514,821 ( 0.00%) ???:::fmt [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 514,293 ( 0.00%) ???:::visit_block [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 513,648 ( 0.00%) ???:::visit_method_receiver_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 510,312 ( 0.00%) ???:>::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] 510,015 ( 0.00%) ???:::visit_item'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 509,663 ( 0.00%) ???:::smart_resolve_path [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 506,419 ( 0.00%) /rust/deps/hashbrown-0.17.0/src/raw.rs:, rustc_type_ir::sty::Region>>::new 506,229 ( 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 506,225 ( 0.00%) ???:::assemble_candidates_from_auto_impls::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 505,782 ( 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<&rustc_hir::hir::Expr, core::iter::adapters::filter::Filter, core::slice::iter::Iter>, clippy_lints::unit_types::unit_arg::check::{closure#0}>>>::from_iter [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 505,305 ( 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 504,311 ( 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::> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 503,981 ( 0.00%) include/jemalloc/internal/edata.h:pa_dalloc 503,206 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/needless_question_mark.rs:::check_expr 502,775 ( 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] 502,440 ( 0.00%) ???:annotate_snippets::renderer::render::draw_code_line [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 502,113 ( 0.00%) /rust/deps/smallvec-1.15.1/src/lib.rs:>::insert_from_slice [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 501,098 ( 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] 499,695 ( 0.00%) ???: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] 499,396 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/unused_io_amount.rs:clippy_lints::unused_io_amount::should_lint [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 498,744 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cmp.rs:::meets 498,318 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/edition.rs:>::with::<::with::expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> 498,318 ( 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:>::with::<::with::expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> 498,270 ( 0.00%) ???:>::drop_slow [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 496,847 ( 0.00%) ???:::check_arm [???] 496,236 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/redundant_closure_call.rs:::check_block [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 495,659 ( 0.00%) ???:::visit_method_receiver_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 495,651 ( 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 495,633 ( 0.00%) ???: as rustc_hir::intravisit::Visitor>::visit_generics [???] 494,300 ( 0.00%) ???:::from_self [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 492,485 ( 0.00%) ???:::eat_token_lit [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 491,722 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/temporary_assignment.rs:::check_expr 491,681 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/doc/missing_headers.rs: as rustc_hir::intravisit::Visitor>::visit_expr'2 491,468 ( 0.00%) ???:>>::walk_ref [???] 491,292 ( 0.00%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 490,822 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/option_env_unwrap.rs:::check_expr 490,458 ( 0.00%) ???:>::insert [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 489,970 ( 0.00%) /rust/deps/scoped-tls-1.0.1/src/lib.rs:>::with::<::as_str::{closure#0}, &str> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 489,663 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 489,450 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::dep_graph::graph::DepNodeIndex>, true>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 488,763 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 488,639 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 488,473 ( 0.00%) ???:::with_def_site_ctxt [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 488,213 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/raw.rs:>::reserve_rehash::::{closure#0}> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 487,555 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 487,495 ( 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 487,450 ( 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] 487,085 ( 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::in_automatically_derived 486,583 ( 0.00%) ???:rustc_query_impl::query_impl::defaultness::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 485,880 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:::check_expr_post 485,525 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/slow_vector_initialization.rs:::check_expr 485,522 ( 0.00%) ???:::visit_pat [???] 485,019 ( 0.00%) ???:::advance_left [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 484,972 ( 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 484,668 ( 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::::{closure#0}>>'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 484,512 ( 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 484,456 ( 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 484,456 ( 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 484,456 ( 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::float_cmp::check_assert 484,456 ( 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:clippy_lints::operators::float_cmp::check_assert 484,456 ( 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 484,456 ( 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 484,456 ( 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 484,456 ( 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_post 484,456 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/pointers_in_nomem_asm_block.rs:::check_expr 484,456 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_lints::operators::eq_op::check_assert 484,456 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_lints::operators::float_cmp::check_assert 484,406 ( 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 484,359 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::expr_search_pat::expr_search_pat_inner [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 483,685 ( 0.00%) ???:::build_reduced_graph_for_use_tree [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 483,075 ( 0.00%) ???:rustc_query_impl::query_impl::fn_arg_idents::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 483,047 ( 0.00%) ???:::lower_pat_tuple [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 481,800 ( 0.00%) ???:rustc_query_impl::query_impl::intrinsic_raw::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 481,665 ( 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::check_proc_macro::span_matches_pat 481,143 ( 0.00%) ???:>::fold_predicate [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 479,610 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/control/tag.rs:::check_expr 479,607 ( 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 479,194 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/reserve_after_initialization.rs:::check_local [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 478,963 ( 0.00%) ???:>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 478,468 ( 0.00%) include/jemalloc/internal/thread_event.h:malloc_default 477,530 ( 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}> [???] 476,920 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/needless_bool.rs:::check_block [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 476,417 ( 0.00%) ???:::parse_where_clause_common [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 474,595 ( 0.00%) ???:::apply_mark [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 474,337 ( 0.00%) ???:rustc_hir::intravisit::walk_pat::>'2 [???] 473,705 ( 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:::finish_grow 473,668 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/returns/let_and_return.rs:clippy_lints::returns::let_and_return::check_block [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 472,941 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/manual_hash_one.rs:::check_local [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 472,177 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/methods/wrong_self_convention.rs:::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 471,542 ( 0.00%) /rust/deps/scoped-tls-1.0.1/src/lib.rs:>::with::::data::{closure#0}>::{closure#0}, rustc_span::SpanData> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 470,569 ( 0.00%) ???: as rustc_hir::intravisit::Visitor>::visit_fn [???] 470,076 ( 0.00%) ???:>::reserve_rehash::, ()>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 468,612 ( 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] 468,520 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 468,323 ( 0.00%) ???:core::slice::sort::stable::drift::sort::<(&rustc_span::symbol::Symbol, &rustc_span::span_encoding::Span), <[(&rustc_span::symbol::Symbol, &rustc_span::span_encoding::Span)]>::sort_by_key<&rustc_span::span_encoding::Span, ::check_crate::{closure#0}>::{closure#0}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 468,195 ( 0.00%) ???:::hir_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 468,168 ( 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] 467,589 ( 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] 465,321 ( 0.00%) ???:::visit_variant_data [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 463,078 ( 0.00%) ???:rustc_middle::verify_ich::incremental_verify_ich::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 462,640 ( 0.00%) ???: as rustc_hir::intravisit::Visitor>::visit_expr [???] 462,492 ( 0.00%) include/jemalloc/internal/mutex.h:tcache_bin_flush_small 460,636 ( 0.00%) ???:::path_ident [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 460,501 ( 0.00%) ???:::resolve_arm'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 460,415 ( 0.00%) /rust/deps/scoped-tls-1.0.1/src/lib.rs:::visit_pat 460,140 ( 0.00%) ???:::serialize::<&mut serde_json::ser::Serializer<&mut alloc::boxed::Box>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 459,193 ( 0.00%) ???:::hir_impl_item [???] 458,966 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 458,454 ( 0.00%) src/tcache.c:free_default 456,334 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/attrs.rs:clippy_utils::attrs::has_non_exhaustive_attr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 456,054 ( 0.00%) ???:::map_ctxt::<::with_ctxt::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 455,670 ( 0.00%) ???:::lower_generic_bound_predicate [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 455,616 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 455,018 ( 0.00%) include/jemalloc/internal/jemalloc_internal_inlines_b.h:malloc_default 454,981 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/combined_early_pass.rs:::check_ident [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 453,348 ( 0.00%) ???:rustc_ast::attr::mk_attr_word [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 453,193 ( 0.00%) ???:rustc_query_impl::query_impl::asyncness::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 452,460 ( 0.00%) ???:::check_target [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 451,845 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 451,421 ( 0.00%) ???:::next_match [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 451,420 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 450,969 ( 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] 450,818 ( 0.00%) ???:core::ptr::drop_glue::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 449,545 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs:::check_impl_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 449,077 ( 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:clippy_utils::method_chain_args 448,913 ( 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:: 448,731 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:clippy_utils::method_chain_args 448,277 ( 0.00%) ???:::argument [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 446,918 ( 0.00%) ???:>::drop_slow [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 445,892 ( 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:>::super_fold_with::> 445,410 ( 0.00%) ???:::lower_expr_try [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 445,171 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 444,454 ( 0.00%) ???:>::super_fold_with:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 444,412 ( 0.00%) include/jemalloc/internal/ph.h:pa_dalloc 442,853 ( 0.00%) ???:::visit_pat'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 440,639 ( 0.00%) ???: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] 440,200 ( 0.00%) ???:rustc_query_impl::query_impl::used_trait_imports::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 440,039 ( 0.00%) src/tcache.c:malloc_default 438,635 ( 0.00%) ???:rustc_ast::visit::visit_generic_params::> [???] 438,115 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/functions/mod.rs:::check_fn [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 437,783 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/matches/infallible_destructuring_match.rs:clippy_lints::matches::infallible_destructuring_match::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 436,246 ( 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 435,609 ( 0.00%) ???:0x00000000000947c0 [/usr/lib/libc.so.6] 435,547 ( 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_lints::doc::doc_suspicious_footnotes::check 435,411 ( 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] 435,081 ( 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::is_expn_of 433,103 ( 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> 432,892 ( 0.00%) ???:::check_tokens'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 432,587 ( 0.00%) ???:> as rustc_serialize::serialize::Decodable>::decode'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 431,875 ( 0.00%) ???:::visit_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 431,811 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/methods/manual_c_str_literals.rs:clippy_lints::methods::manual_c_str_literals::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 431,272 ( 0.00%) ???:::variant_with_id [???] 430,771 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::is_assert_arg [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 430,726 ( 0.00%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 429,725 ( 0.00%) ???:::fix_multispan_in_extern_macros [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 427,050 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/hir/map.rs:clippy_utils::macros::first_node_in_macro:: 427,014 ( 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] 426,916 ( 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> 426,133 ( 0.00%) ???:rustc_mir_transform::mir_keys [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 426,015 ( 0.00%) ???:>>::walk_ref [???] 425,979 ( 0.00%) src/emap.c:pa_alloc 425,790 ( 0.00%) ???:, rustc_middle::query::erase::ErasedData<[u8; 16]>> 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] 425,688 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/else_if_without_else.rs:::check_expr 425,219 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/methods/swap_with_temporary.rs:clippy_lints::methods::swap_with_temporary::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 424,514 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/unused_io_amount.rs:clippy_lints::unused_io_amount::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 424,146 ( 0.00%) ???:>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 423,048 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/let_underscore.rs:::check_local [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 422,765 ( 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_stmt 422,761 ( 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::> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 422,560 ( 0.00%) include/jemalloc/internal/rtree.h:free_default 422,440 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/visitors.rs: as rustc_hir::intravisit::Visitor>::visit_expr'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 422,295 ( 0.00%) ???:::visit_generic_arg [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 422,234 ( 0.00%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 422,101 ( 0.00%) ???:::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 422,036 ( 0.00%) ???: as rustc_ast::visit::Visitor>::visit_arm::{closure#0} [???] 422,028 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:::visit_pat 421,893 ( 0.00%) ???:>::walk_mut'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 421,705 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/methods/unwrap_expect_used.rs:clippy_lints::methods::unwrap_expect_used::check_call [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 421,680 ( 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:rustc_hir::intravisit::walk_qpath:: 421,139 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:::defined_ty [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 419,964 ( 0.00%) ???:::desugar_doc_comments::desugar_inner [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 419,455 ( 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] 418,966 ( 0.00%) include/jemalloc/internal/bit_util.h:realloc 418,959 ( 0.00%) ???:>::process_obligations:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 418,743 ( 0.00%) ???:::expr_lang_item_type_relative [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 418,058 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/manual_clamp.rs:::check_block [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 417,528 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/collections/btree/search.rs:::visit_expr'2 417,286 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/attrs/mod.rs:::check_attribute [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 417,118 ( 0.00%) ???:::parse_borrowed_pointee [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 416,622 ( 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_fn 414,734 ( 0.00%) ???:::ancestors [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 412,767 ( 0.00%) src/extent.c:tcache_bin_flush_small 412,652 ( 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:clippy_lints::non_expressive_names::levenstein_not_1 412,584 ( 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:::check_fn 411,049 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/res.rs:clippy_utils::res::MaybeQPath::res::f [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 410,680 ( 0.00%) ???:::from_span_label [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 410,376 ( 0.00%) ???:annotate_snippets::renderer::render::render_origin [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 410,143 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/combined_early_pass.rs:::check_attribute [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 409,969 ( 0.00%) ???:::walk_::<::necessary_variants::{closure#0}>'2 [???] 409,231 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/lifetimes.rs:::visit_ty [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 409,058 ( 0.00%) ???:::instantiate_identity_into'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 408,922 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 408,817 ( 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] 407,828 ( 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] 407,732 ( 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 407,120 ( 0.00%) ???:::hir_item [???] 407,119 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:::finish_grow 406,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/span_encoding.rs:::check_pat 406,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/span_encoding.rs:clippy_lints::matches::rest_pat_in_fully_bound_struct::check 406,690 ( 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::>'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 406,463 ( 0.00%) ???:::parse_expr_paren_seq'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 406,249 ( 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 405,401 ( 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] 405,151 ( 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] 405,116 ( 0.00%) ???:::evaluate_predicate_recursively [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 404,650 ( 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::loops::never_loop::never_loop_expr'2 404,384 ( 0.00%) ???:annotate_snippets::renderer::render::draw_code_line'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 404,235 ( 0.00%) include/jemalloc/internal/mutex.h:malloc_default 404,175 ( 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] 403,849 ( 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/generic_args.rs:<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::Ty> as rustc_type_ir::fold::TypeFoldable>::fold_with::> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 403,007 ( 0.00%) ???:core::slice::sort::unstable::quicksort::quicksort::<(rustc_span::def_id::DefPathHash, rustc_span::span_encoding::Span), <[(rustc_span::def_id::DefPathHash, rustc_span::span_encoding::Span)]>::sort_unstable_by_key::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 402,804 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/needless_late_init.rs:::check_local [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 402,051 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 401,027 ( 0.00%) ???:::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 399,639 ( 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_fn 399,389 ( 0.00%) ???:rustc_hir_analysis::collect::resolve_bound_vars::object_lifetime_default [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 398,592 ( 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] 398,244 ( 0.00%) ???:::parse_field_def::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 397,430 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 396,642 ( 0.00%) ???:>::sub:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 396,535 ( 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 396,318 ( 0.00%) ???:::symbol_path [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 395,700 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/def.rs:::check_expr 395,539 ( 0.00%) ???:>::insert [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 394,996 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 393,750 ( 0.00%) ???:, serde_json::ser::CompactFormatter> as serde_core::ser::SerializeStruct>::serialize_field::>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 393,624 ( 0.00%) ???:::flat_map_expr_field [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 392,256 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/needless_late_init.rs:::check_block_post [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 391,202 ( 0.00%) ???:::defaultness [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 390,285 ( 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] 390,021 ( 0.00%) ???: as rustc_serialize::serialize::Encodable>::encode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 388,930 ( 0.00%) /rust/deps/pulldown-cmark-0.11.3/src/parse.rs:>::handle_inline_pass1 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 388,821 ( 0.00%) ???:::build_reduced_graph_for_use_tree'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 387,678 ( 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/jemalloc.c:free_default [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 387,561 ( 0.00%) ???:rustc_builtin_macros::format::expand_format_args_impl [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 387,410 ( 0.00%) ???:::list_from_tokens [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 386,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] 385,828 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/types/type_complexity.rs:::visit_ty [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 385,704 ( 0.00%) ???:::resolve_trait_item::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 385,656 ( 0.00%) ???:pulldown_cmark::firstpass::scan_paragraph_interrupt_no_table [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 384,840 ( 0.00%) ???:::ensure_lines'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 384,583 ( 0.00%) ???:>>::walk_ref [???] 384,482 ( 0.00%) ???:::visit_generic_params'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 384,110 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 383,537 ( 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 383,192 ( 0.00%) ???:std::sys::env::unix::getenv [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 383,191 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/nonstandard_macro_braces.rs:::check_mac_def::check_ts'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 382,076 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::trait_ref_of_method [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 381,595 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 381,159 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/unit_types/mod.rs:::check_local [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 381,087 ( 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::>'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 380,585 ( 0.00%) ???:>, core::iter::adapters::map::Map, ::fix_multispan_in_extern_macros::{closure#1}>>, ::fix_multispan_in_extern_macros::{closure#2}> 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] 380,493 ( 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] 380,067 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/manual_let_else.rs:::check_stmt 379,873 ( 0.00%) ???:::hir_expect_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 379,196 ( 0.00%) ???:::visit_generics [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 379,140 ( 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:clippy_utils::macros::first_node_in_macro:: 378,554 ( 0.00%) ???:::poly_select::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 378,538 ( 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 378,100 ( 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] 377,601 ( 0.00%) ???:::next [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 377,488 ( 0.00%) ???:::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 376,992 ( 0.00%) ???:rustc_middle::dep_graph::graph::hash_result::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 376,542 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/asm_syntax.rs:::check_expr 376,108 ( 0.00%) ???:rustc_query_impl::plumbing::encode_query_values_inner::>, &[rustc_span::def_id::DefId]>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 376,073 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/methods/ip_constant.rs:clippy_lints::methods::ip_constant::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 375,541 ( 0.00%) ???:rustc_ast::visit::visit_stmts:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 375,095 ( 0.00%) ???:::decode_symbol [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 374,910 ( 0.00%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 374,859 ( 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.rs: as core::cmp::PartialEq>::eq 374,349 ( 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_utils::method_chain_args 374,085 ( 0.00%) ???:rustc_ast::visit::visit_stmts:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 374,085 ( 0.00%) ???:rustc_ast::visit::visit_stmts:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 374,085 ( 0.00%) ???:rustc_ast::visit::visit_stmts:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 373,609 ( 0.00%) ???:rustc_ast::visit::visit_stmts:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 373,348 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 373,103 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 372,612 ( 0.00%) ???:rustc_ast::visit::walk_item_inner::> [???] 372,598 ( 0.00%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 372,562 ( 0.00%) ???:core::ptr::drop_glue::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 372,265 ( 0.00%) ???:::evaluate_obligation [???] 372,240 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs:::check_body [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 372,079 ( 0.00%) ???:::visit_pat'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 371,294 ( 0.00%) ???:::create_method [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 370,310 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 370,310 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 370,064 ( 0.00%) ???:::{closure#1} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::dep_graph::dep_node::DepNode, rustc_middle::dep_graph::serialized::SerializedDepNodeIndex, rustc_middle::dep_graph::graph::DepNodeIndex)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 369,089 ( 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] 368,358 ( 0.00%) src/arena.c:tcache_bin_flush_small 367,913 ( 0.00%) ???: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] 367,591 ( 0.00%) ???:<&rustc_middle::ty::list::RawList<(), rustc_type_ir::canonical::CanonicalVarKind> as rustc_serialize::serialize::Decodable>::decode::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 367,471 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/consts.rs:::new [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 366,988 ( 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> 366,929 ( 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 366,649 ( 0.00%) ???:0x0000000000029600 [/usr/lib/ld-linux-x86-64.so.2] 366,645 ( 0.00%) ???:::is_multiline [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 366,563 ( 0.00%) ???:::span_to_location_info [???] 366,204 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::last_path_segment [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 366,021 ( 0.00%) ???:::parse_expr_array_or_repeat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 365,844 ( 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:clippy_utils::last_path_segment 365,588 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 365,160 ( 0.00%) ???:::is_from_async_await [???] 364,677 ( 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::'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 364,483 ( 0.00%) ???: as rustc_data_structures::flat_map_in_place::FlatMapInPlace>::flat_map_in_place::::{closure#0}, smallvec::SmallVec<[rustc_ast::ast::Arm; 1]>>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 364,220 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/combined_early_pass.rs:::check_block [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 363,891 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/mixed_read_write_in_expression.rs:::check_stmt 363,658 ( 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:::visit_pat 363,426 ( 0.00%) ???: as rustc_ast::visit::Visitor>::visit_item [???] 363,017 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::query::erase::ErasedData<[u8; 1]>>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 362,922 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/visitors.rs: as rustc_hir::intravisit::Visitor>::visit_expr'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 362,198 ( 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 362,128 ( 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> 362,128 ( 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> 362,128 ( 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> 360,649 ( 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] 359,854 ( 0.00%) ???:::parse_if_after_cond [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 359,632 ( 0.00%) ???:::parse_if_after_cond'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 358,214 ( 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::::instantiate_bound_regions_with_erased::{closure#0}>::{closure#0} [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 357,660 ( 0.00%) ???:::lower_arm'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 357,037 ( 0.00%) ???:::insert [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 356,313 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_expr_use_or_unification_node [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 355,629 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/formatting.rs:::check_block [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 355,338 ( 0.00%) ???:> as rustc_ast::visit::Visitable>>::visit [???] 355,061 ( 0.00%) ???:memchr::arch::x86_64::memchr::count_raw::find_avx2'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 354,960 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/methods/chars_cmp_with_unwrap.rs:clippy_lints::methods::chars_cmp_with_unwrap::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 354,921 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/unwrap.rs:clippy_lints::unwrap::extract_local [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 354,864 ( 0.00%) ???:::parse_safety [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 354,708 ( 0.00%) ???:> as rustc_data_structures::flat_map_in_place::FlatMapInPlace>>::flat_map_in_place::::{closure#0}, smallvec::SmallVec<[alloc::boxed::Box; 1]>>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 354,635 ( 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:, ::check_item_kind::{closure#0}>, ::check_item_kind::{closure#1}>, core::option::Option> as core::iter::traits::iterator::Iterator>::next [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 354,266 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:>::retain:: 354,080 ( 0.00%) ???:::missing_semi_from_binop [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 354,077 ( 0.00%) ???:::lower_poly_trait_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 353,780 ( 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::has_non_exhaustive_attr 353,391 ( 0.00%) ???:core::slice::sort::shared::smallsort::insert_tail::::sort_by_key<(core::cmp::Reverse, u128, u64), >::univariant_biased>::{closure#5}>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 351,885 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/uninit_vec.rs:clippy_lints::uninit_vec::handle_uninit_vec_pair [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 350,872 ( 0.00%) ???:::stable_hash::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 350,702 ( 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 350,702 ( 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> 350,082 ( 0.00%) ???:::body_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 349,608 ( 0.00%) ???:>::encode'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 349,008 ( 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:::visit_qpath 348,860 ( 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::::check::{closure#0}>>'2 348,598 ( 0.00%) ???:> as rustc_ast::visit::Visitable>>::visit [???] 348,118 ( 0.00%) ???:::to_token_trees [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 347,848 ( 0.00%) ???:::encode_symbol [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 347,748 ( 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] 347,311 ( 0.00%) ???:core::ptr::drop_glue::>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 347,053 ( 0.00%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 346,709 ( 0.00%) ???:::parse_match_block [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 346,371 ( 0.00%) ???: as rustc_hir::intravisit::Visitor>::visit_expr::{closure#0}::{closure#0} [???] 346,362 ( 0.00%) ???:::name_lower [???] 346,153 ( 0.00%) ???:::visit_ty_common [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 344,116 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 344,078 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::query::erase::ErasedData<[u8; 16]>>, true>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 343,578 ( 0.00%) ???:>::types_may_unify_inner [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 343,445 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/large_include_file.rs:::check_attribute [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 343,266 ( 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:>::with::<::with::outer_expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> 343,266 ( 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:>::with::<::with::outer_expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> 343,266 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:>::with::<::with::outer_expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> 343,223 ( 0.00%) ???:rustc_hir_analysis::check_unused::check_unused_traits'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 342,684 ( 0.00%) ???:__rustc::__rust_realloc [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 342,577 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/macros.rs: 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} 342,577 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/macros.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> 342,152 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/res.rs:rustc_hir::intravisit::walk_expr::::{closure#0}>>'2 341,937 ( 0.00%) ???:, core::iter::adapters::map::Map, ::fix_multispans_in_extern_macros_and_render_macro_backtrace::{closure#0}>>, &[rustc_span::span_encoding::Span], ::fix_multispans_in_extern_macros_and_render_macro_backtrace::{closure#1}>, core::iter::sources::from_fn::FromFn<::macro_backtrace::{closure#0}>, ::fix_multispans_in_extern_macros_and_render_macro_backtrace::{closure#2}>, ::fix_multispans_in_extern_macros_and_render_macro_backtrace::{closure#3}> 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] 341,529 ( 0.00%) ???:::lower_use_path [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 341,154 ( 0.00%) ???:::visit_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 340,531 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:::finish_grow 340,326 ( 0.00%) ???:ioctl [/usr/lib/libc.so.6] 340,101 ( 0.00%) /rust/deps/scoped-tls-1.0.1/src/lib.rs:>::with::<::with::is_descendant_of::{closure#0}>::{closure#0}, bool> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 339,949 ( 0.00%) ???:rustc_query_impl::query_impl::layout_of::execute_query_incr::__rust_end_short_backtrace'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 339,473 ( 0.00%) include/jemalloc/internal/ticker.h:malloc_default 339,159 ( 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:::visit_qpath 339,066 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::visit_local [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 338,717 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 338,416 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/methods/useless_nonzero_new_unchecked.rs:clippy_lints::methods::useless_nonzero_new_unchecked::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 337,561 ( 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 336,965 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:clippy_lints::loops::while_let_on_iterator::check 335,707 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::never_loop_expr::{closure#2}'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 335,356 ( 0.00%) src/emap.c:ecache_evict 335,182 ( 0.00%) ???:::is_path_start [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 335,015 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs:::check_body_post [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 334,727 ( 0.00%) ???:::deref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 334,416 ( 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 334,416 ( 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 334,416 ( 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 333,812 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 333,689 ( 0.00%) ???:::ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 333,580 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 333,302 ( 0.00%) ???:::try_mark_green [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 332,919 ( 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] 332,406 ( 0.00%) ???:::to_string_lossy [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 332,365 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 332,351 ( 0.00%) ???:>::flush_buf [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 331,772 ( 0.00%) ???:::glob_adjust [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 331,701 ( 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] 330,839 ( 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_mut'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 330,480 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/methods/chars_cmp.rs:clippy_lints::methods::chars_cmp::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 330,273 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/control/bitmask.rs:::check_expr 330,194 ( 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] 330,132 ( 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:::qpath 329,110 ( 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_utils::fn_def_id 328,916 ( 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 328,910 ( 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 328,857 ( 0.00%) ???:::parse_expr_force_collect'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 328,712 ( 0.00%) ???:::expand_struct_def [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 328,418 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs: as alloc::vec::spec_from_iter_nested::SpecFromIterNested<&rustc_hir::hir::Expr, core::iter::adapters::filter::Filter, core::slice::iter::Iter>, clippy_lints::unit_types::unit_arg::check::{closure#0}>>>::from_iter 328,059 ( 0.00%) ???:rustc_query_impl::query_impl::shallow_lint_levels_on::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] 327,987 ( 0.00%) ???:::from_utf8_lossy [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 327,902 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/loops/utils.rs:::visit_expr'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 327,296 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/only_used_in_recursion.rs:::check_body [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 327,256 ( 0.00%) ???:::requires_monomorphization [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 326,880 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/no_effect.rs:::check_block_post [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 326,831 ( 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:::check_attributes 326,019 ( 0.00%) ???:::decode_span'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 325,857 ( 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] 325,578 ( 0.00%) ???:rustc_errors::emitter::is_different [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 325,557 ( 0.00%) ???:::check_tokens [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 325,494 ( 0.00%) ???:>>>::set [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 325,409 ( 0.00%) ???:::fill_well_known'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 325,182 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 324,295 ( 0.00%) ???:::with_normalized [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 324,261 ( 0.00%) ???:::prepare_to_combine'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 324,137 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 322,926 ( 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 322,892 ( 0.00%) ???:>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 322,751 ( 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 322,751 ( 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 322,675 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/casts/needless_type_cast.rs:clippy_lints::casts::needless_type_cast::collect_binding_from_local [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 321,888 ( 0.00%) ???:::ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 321,563 ( 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] 321,452 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_test [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 321,399 ( 0.00%) ???:::trait_def_id [???] 321,106 ( 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:clippy_utils::check_proc_macro::span_matches_pat 320,516 ( 0.00%) ???:>>::walk_ref [???] 319,740 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/hash/mod.rs:::check_expr 319,695 ( 0.00%) ???:::{closure#1} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::dep_graph::dep_node::DepNode, rustc_middle::dep_graph::serialized::SerializedDepNodeIndex, rustc_middle::dep_graph::graph::DepNodeIndex)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 319,626 ( 0.00%) ???:::flat_map_arm'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 319,040 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/let_with_type_underscore.rs:::check_local [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 317,864 ( 0.00%) ???:>::encode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 317,588 ( 0.00%) ???:::source_callee [???] 317,067 ( 0.00%) ???:::visit_block [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 316,740 ( 0.00%) ???: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] 316,493 ( 0.00%) ???:::def_key:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 315,744 ( 0.00%) ???:::replace_region [???] 315,298 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/cognitive_complexity.rs:::check_fn [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 314,930 ( 0.00%) ???:::flat_map_pat_field [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 314,672 ( 0.00%) ???:::walk [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 314,130 ( 0.00%) ???:::intern_valtree [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 313,366 ( 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: as rustc_type_ir::fold::TypeFolder>::fold_ty'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 313,306 ( 0.00%) /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_generics 312,740 ( 0.00%) ???:::imported_source_file [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 312,341 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/visitors.rs:rustc_hir::intravisit::walk_expr::::check::{closure#0}>>'2 311,700 ( 0.00%) ???:::expr_ty_opt [???] 311,667 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/types/mod.rs:::check_fn [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 311,365 ( 0.00%) ???:::add_annotation_to_file [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 311,124 ( 0.00%) ???:<[rustc_middle::ty::generic_args::GenericArg] as rustc_serialize::serialize::Encodable>::encode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 310,335 ( 0.00%) ???:>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 309,966 ( 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 core::iter::traits::iterator::Iterator>::next 309,636 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 309,540 ( 0.00%) include/jemalloc/internal/rtree.h:extent_try_coalesce_impl.llvm.9305427869391012685 308,024 ( 0.00%) ???: as rustc_hir::intravisit::Visitor>::visit_generic_param [???] 307,458 ( 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:: 307,216 ( 0.00%) ???:::build_with_typing_env [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 306,988 ( 0.00%) ???:::is_conditionally_const::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 306,929 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 306,860 ( 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:>::with::<::with::expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> 306,281 ( 0.00%) ???:, rustc_hash::FxBuildHasher>>::insert_full [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 306,248 ( 0.00%) ???:::parse_coroutine_kind [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 305,301 ( 0.00%) ???:::name [???] 305,167 ( 0.00%) ???:::collect_invocations [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 305,060 ( 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] 305,052 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 304,745 ( 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] 304,539 ( 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 304,385 ( 0.00%) ???:rustc_ast::visit::visit_arms::>'2 [???] 303,690 ( 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] 303,508 ( 0.00%) ???:::span [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 303,333 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/unit_types/let_unit_value.rs:::check_local 302,075 ( 0.00%) ???:::impl_or_trait_obligations [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 302,032 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 301,794 ( 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] 301,669 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/functions/duplicate_underscore_argument.rs:clippy_lints::functions::duplicate_underscore_argument::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 301,584 ( 0.00%) ???:rustc_query_impl::query_impl::expn_that_defined::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] 301,294 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 301,162 ( 0.00%) ???:::to_path [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 301,047 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/infinite_iter.rs:clippy_lints::infinite_iter::is_infinite [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 301,023 ( 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/vec_cache.rs:::check_expr 300,456 ( 0.00%) ???:rustc_data_structures::unord::hash_iter_order_independent::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 300,073 ( 0.00%) ???: as rustc_data_structures::flat_map_in_place::FlatMapInPlace>::flat_map_in_place::::{closure#0}, smallvec::SmallVec<[rustc_ast::ast::Stmt; 1]>>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 299,993 ( 0.00%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 299,993 ( 0.00%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 299,993 ( 0.00%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 299,949 ( 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/sync/freeze.rs:::def_key:: 299,154 ( 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:clippy_utils::method_chain_args 298,563 ( 0.00%) ???:>::reserve_rehash::>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 298,556 ( 0.00%) ???:::fix_multispan_in_extern_macros::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 298,159 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:::eq_expr'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 297,770 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/empty_line_after.rs:::new [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 297,138 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/bit_mask.rs:clippy_lints::operators::bit_mask::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 296,608 ( 0.00%) ???:::between [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 296,307 ( 0.00%) ???:::is_freeze [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 295,908 ( 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 295,544 ( 0.00%) ???:::assemble_candidates_from_impls [???] 295,538 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/tabs_in_doc_comments.rs:::check_attribute [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 295,168 ( 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] 295,155 ( 0.00%) ???:::parse_pat_no_top_guard_inner'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 294,802 ( 0.00%) ???:>>::drop_slow [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 294,588 ( 0.00%) ???:::check_item [???] 294,288 ( 0.00%) ???: as rustc_hir::intravisit::Visitor>::visit_fn_decl [???] 294,078 ( 0.00%) ???:rustc_metadata::foreign_modules::collect [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 294,048 ( 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] 294,014 ( 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:clippy_utils::str_utils::to_camel_case 293,982 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/symbol.rs:>::with::<::as_str::{closure#0}, &str> 293,982 ( 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:>::with::<::as_str::{closure#0}, &str> 293,982 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:>::with::<::as_str::{closure#0}, &str> 293,951 ( 0.00%) ???:__rustc::__rdl_dealloc [???] 293,802 ( 0.00%) ???:::visit_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 293,560 ( 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_pat 293,253 ( 0.00%) ???:rustc_hir::intravisit::walk_qpath::>'2 [???] 293,129 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/utils/author.rs:clippy_lints::utils::author::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 292,075 ( 0.00%) ???: as rustc_data_structures::flat_map_in_place::FlatMapInPlace>::flat_map_in_place::::{closure#0}, smallvec::SmallVec<[rustc_ast::ast::Stmt; 1]>>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 291,376 ( 0.00%) ???:::check_block [???] 290,990 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/empty_line_after.rs:::check_item_kind [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 290,572 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/no_effect.rs:::check_expr 290,261 ( 0.00%) ???:rustc_middle::ty::trait_def::traits_provider [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 288,709 ( 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 288,366 ( 0.00%) ???:::from_sub_diagnostic [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 288,183 ( 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:::qpath 287,882 ( 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::loops::never_loop::never_loop_block'2 287,453 ( 0.00%) ???:::insert_field_idents [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 287,235 ( 0.00%) ???:rustc_middle::ty::util::intrinsic_raw [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 286,796 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 286,527 ( 0.00%) ???: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] 286,311 ( 0.00%) ???:::walk::<::could_be_never_pattern::{closure#0}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 286,043 ( 0.00%) /rust/deps/rustc-hash-2.1.1/src/lib.rs:>::insert 285,657 ( 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_block 285,621 ( 0.00%) src/thread_event.c:free_default 285,498 ( 0.00%) 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] 285,498 ( 0.00%) 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] 284,750 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/combined_early_pass.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 284,477 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/raw.rs:::check_pat 283,662 ( 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:::check_fn 283,652 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/peekable.rs:clippy_lints::doc::check_doc::> 283,244 ( 0.00%) ???:<&std::io::stdio::Stderr as core::io::write::Write>::write [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 282,938 ( 0.00%) ???:::visit_fn [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 282,609 ( 0.00%) ???:::check_pat'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 282,600 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/types/redundant_allocation.rs:clippy_lints::types::redundant_allocation::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 282,235 ( 0.00%) ???:rustc_ast_lowering::index_ast [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 281,633 ( 0.00%) ???:::guess_print_mode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 281,605 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/cmp_owned.rs:clippy_lints::operators::cmp_owned::check_op [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 280,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/ast.rs:>::walk_mut'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 280,454 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/manual_clamp.rs:clippy_lints::manual_clamp::is_call_max_min_pattern::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 280,374 ( 0.00%) ???:core::slice::memchr::memrchr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 280,127 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/legacy_numeric_constants.rs:clippy_lints::legacy_numeric_constants::is_numeric_const [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 279,360 ( 0.00%) ???:, rustc_middle::dep_graph::graph::DepNodeIndex> 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] 279,355 ( 0.00%) ???:rustc_hir::intravisit::walk_fn:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 279,056 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/four_forward_slashes.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 278,780 ( 0.00%) ???:::find_lints [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 278,536 ( 0.00%) src/emap.c:tcache_bin_flush_small 278,392 ( 0.00%) ???:rustc_ast::visit::walk_fn:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 278,152 ( 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:clippy_lints::doc::doc_suspicious_footnotes::check 278,138 ( 0.00%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 277,778 ( 0.00%) ???:rustc_borrowck::get_flow_results [???] 277,761 ( 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] 277,411 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::parse [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 277,325 ( 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] 275,697 ( 0.00%) ???:rustc_span::hygiene::walk_chain [???] 275,506 ( 0.00%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 275,460 ( 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 275,179 ( 0.00%) ???:::recover_vcs_conflict_marker [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 275,158 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 274,684 ( 0.00%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 274,288 ( 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_block 274,200 ( 0.00%) ???:rustc_query_impl::query_impl::source_span::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 273,766 ( 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:clippy_utils::check_proc_macro::span_matches_pat 273,735 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/visitors.rs: as rustc_hir::intravisit::Visitor>::visit_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 273,174 ( 0.00%) ???:rustc_ast_lowering::lower_to_hir'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 272,978 ( 0.00%) include/jemalloc/internal/atomic.h:ecache_evict 272,971 ( 0.00%) ???:>>::walk_ref [???] 272,604 ( 0.00%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 272,246 ( 0.00%) ???:::lower_use_tree'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 271,789 ( 0.00%) ???:::from_def_id [???] 271,614 ( 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::::check::{closure#0}>>'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 271,454 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/needless_maybe_sized.rs:::check_generics [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 271,072 ( 0.00%) ???: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] 270,334 ( 0.00%) ???:>::call_once'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 269,858 ( 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] 269,203 ( 0.00%) ???:rustc_query_impl::query_impl::lower_to_hir::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] 269,203 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/visitors.rs:::get::{closure#0}> as rustc_hir::intravisit::Visitor>::visit_expr'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 269,028 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_inside_always_const_context [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 268,908 ( 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] 268,207 ( 0.00%) ???: as rustc_ast::visit::Visitor>::visit_field_def::{closure#0} [???] 267,941 ( 0.00%) ???:::parse_enum_variant::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 267,550 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 267,454 ( 0.00%) ???:::single_pat_field [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 267,393 ( 0.00%) ???:rustc_hir_analysis::coherence::inherent_impls::crate_inherent_impls [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 267,333 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 267,330 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 267,076 ( 0.00%) /rust/deps/smallvec-1.15.1/src/lib.rs: as core::iter::traits::collect::Extend>::extend::>> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 266,807 ( 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 266,742 ( 0.00%) ???:::from_errors_diagnostic::BufWriter> as core::fmt::Write>::write_str [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 266,469 ( 0.00%) ???:::maybe_recover_trailing_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 266,114 ( 0.00%) ???:rustc_query_impl::query_impl::check_liveness::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 265,035 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/combined_early_pass.rs:::check_local [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 265,008 ( 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] 264,927 ( 0.00%) ???:::lower_mod [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 264,870 ( 0.00%) ???:::visit_expr [???] 264,616 ( 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::::check::{closure#0}>> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 264,049 ( 0.00%) ???:>>::walk_ref'2 [???] 263,690 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/raw.rs:>::insert 263,374 ( 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] 263,298 ( 0.00%) src/thread_event.c:malloc_default 263,073 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/returns/needless_return_with_question_mark.rs:clippy_lints::returns::needless_return_with_question_mark::check_stmt [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 262,857 ( 0.00%) ???:::clone [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 262,472 ( 0.00%) ???:::parse_pat_tuple_or_parens [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 261,974 ( 0.00%) ???:>::eval_callee_and_args [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 261,634 ( 0.00%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 261,195 ( 0.00%) ???:::{closure#1} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::dep_graph::dep_node::DepNode, rustc_middle::dep_graph::serialized::SerializedDepNodeIndex, rustc_middle::dep_graph::graph::DepNodeIndex)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 261,040 ( 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/binder.rs:::instantiate_bound_regions::::instantiate_bound_regions_with_erased::{closure#0}>::{closure#0} 261,022 ( 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] 260,775 ( 0.00%) include/jemalloc/internal/tsd.h:pa_alloc 260,545 ( 0.00%) ???:rustc_privacy::effective_visibilities [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 260,357 ( 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] 259,950 ( 0.00%) ???:::fmt [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 259,647 ( 0.00%) ???:::walk::<::check_consistent_bindings::{closure#0}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 259,377 ( 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] 258,576 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/unused_unit.rs:::check_block [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 258,397 ( 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_back [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 258,245 ( 0.00%) ???:::parse_item_enum [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 258,160 ( 0.00%) ???:rustc_query_impl::query_impl::cross_crate_inlinable::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 258,133 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/unnested_or_patterns.rs:::visit_pat'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 257,988 ( 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:rustc_hir::intravisit::walk_expr::::check::{closure#0}>>'2 257,616 ( 0.00%) ???:::hir_get_parent_item'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 257,610 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 257,387 ( 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] 257,171 ( 0.00%) ???:::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 257,027 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/lifetimes.rs:::check_impl_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 256,859 ( 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::'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 256,519 ( 0.00%) ???:rustc_ty_utils::assoc::associated_types_for_impl_traits_in_trait_or_impl'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 256,436 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/unconditional_recursion.rs:::check_fn [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 256,433 ( 0.00%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 256,402 ( 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_ty:: 256,119 ( 0.00%) ???:::collect_fn_info [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 256,110 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/map.rs:>::insert [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 255,818 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:clippy_lints::non_expressive_names::levenstein_not_1 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 255,631 ( 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] 255,588 ( 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_utils::is_expn_of 255,449 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 255,429 ( 0.00%) ???:::collect_bang [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 255,428 ( 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:rustc_hir::intravisit::walk_expr::'2 254,329 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/escape.rs:::check_fn [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 254,144 ( 0.00%) ???:::apply_pattern_bindings [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 253,710 ( 0.00%) ???:::local_def_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 253,542 ( 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::> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 253,118 ( 0.00%) 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] 253,077 ( 0.00%) ???: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] 253,009 ( 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:extent_try_coalesce_impl.llvm.9305427869391012685 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 252,973 ( 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] 252,790 ( 0.00%) ???:::resolve_macro_or_delegation_path [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 252,679 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 252,621 ( 0.00%) ???:>::for_item::<>::identity_for_item::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 252,132 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 250,589 ( 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] 250,519 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/empty_line_after.rs:, ::check_item_kind::{closure#0}>, ::check_item_kind::{closure#1}>, core::option::Option> as core::iter::traits::iterator::Iterator>::next 249,936 ( 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::::{closure#0}>>'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 249,821 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:clippy_utils::higher::get_vec_init_kind [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 249,620 ( 0.00%) ???:::type_is_copy_modulo_regions [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 249,372 ( 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 249,314 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/neg_multiply.rs:::check_expr 249,312 ( 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 249,289 ( 0.00%) ???:<&usize as core::fmt::Display>::fmt [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 248,888 ( 0.00%) ???: as rustc_data_structures::flat_map_in_place::FlatMapInPlace>::flat_map_in_place::::{closure#0}, smallvec::SmallVec<[rustc_ast::ast::FieldDef; 1]>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 247,539 ( 0.00%) include/jemalloc/internal/tsd.h:malloc_default 247,500 ( 0.00%) ???:rustc_query_impl::query_impl::expn_that_defined::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 247,271 ( 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::::get::{closure#0}>>'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 247,249 ( 0.00%) ???:::clone [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 247,042 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/attrs.rs:clippy_utils::attrs::check_clippy_attr:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 246,936 ( 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 246,717 ( 0.00%) include/jemalloc/internal/tcache_inlines.h:free_default 246,521 ( 0.00%) ???:::new_local_module [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 245,957 ( 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_local 245,833 ( 0.00%) ???:::parse_footnote [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 245,710 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/lifetimes.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 245,583 ( 0.00%) ???:rustc_interface::callbacks::track_diagnostic::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 245,280 ( 0.00%) ???:::adjust [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 245,264 ( 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 245,118 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 245,062 ( 0.00%) ???:rustc_middle::verify_ich::incremental_verify_ich::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 244,835 ( 0.00%) ???:::std_path [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 244,677 ( 0.00%) ???:::visit_generic_args [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 244,575 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_lints::unit_types::unit_cmp::check 244,508 ( 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:::clone [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 244,278 ( 0.00%) ???:::check_expr [???] 244,191 ( 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 243,844 ( 0.00%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 243,678 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/methods/wrong_self_convention.rs:clippy_lints::methods::wrong_self_convention::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 243,596 ( 0.00%) ???:::walk:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 242,984 ( 0.00%) ???:core::ptr::drop_glue::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 242,798 ( 0.00%) ???:>::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,390 ( 0.00%) include/jemalloc/internal/thread_event.h:free_default 242,231 ( 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 242,228 ( 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 242,228 ( 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 242,228 ( 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 242,228 ( 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 242,228 ( 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 242,228 ( 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] 242,228 ( 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 242,228 ( 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 242,228 ( 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 242,228 ( 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 242,228 ( 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 242,228 ( 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 242,228 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/map.rs:::check_expr 242,098 ( 0.00%) ???:::define_local [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 242,016 ( 0.00%) ???:::span_labels'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 241,785 ( 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:::expr 241,722 ( 0.00%) ???:<[rustc_span::def_id::DefId] 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] 241,579 ( 0.00%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 241,387 ( 0.00%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 241,186 ( 0.00%) ???:::visit_fn [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 241,031 ( 0.00%) ???:>::insert [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 240,877 ( 0.00%) ???:rustc_expand::mbe::transcribe::lockstep_iter_size [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 240,737 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 240,386 ( 0.00%) ???:core::ptr::drop_glue::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 240,225 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:::check_impl_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 239,699 ( 0.00%) ???:rustc_query_impl::plumbing::encode_query_values_inner::>, rustc_middle::ty::ImplTraitHeader>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 239,551 ( 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_stmt:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 239,009 ( 0.00%) ???:::pad_integral::write_prefix [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 238,695 ( 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 238,614 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:::use_node [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 238,350 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 238,294 ( 0.00%) ???:rustc_borrowck::type_check::liveness::generate [???] 238,238 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/no_effect.rs:clippy_lints::no_effect::reduce_expression [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 238,222 ( 0.00%) ???:thin_vec::drop_non_singleton::>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 238,207 ( 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: as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::find_map::check<(rustc_span::hygiene::ExpnId, rustc_span::hygiene::ExpnData), clippy_utils::macros::MacroCall, &mut clippy_utils::macros::macro_backtrace::{closure#0}>::{closure#0}, core::ops::control_flow::ControlFlow> 236,819 ( 0.00%) ???:rustc_query_impl::query_impl::check_unsafety::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 236,529 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:clippy_utils::hir_utils::eq_expr_value [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 236,490 ( 0.00%) ???:rustc_query_impl::query_impl::mir_borrowck::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 236,448 ( 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:clippy_utils::check_proc_macro::span_matches_pat 236,390 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/def.rs:::check_expr 236,386 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/incompatible_msrv.rs:::get_def_id_availability [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 236,326 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/functions/ref_option.rs:clippy_lints::functions::ref_option::check_fn [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 236,004 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::result_err_ty [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 235,944 ( 0.00%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 235,622 ( 0.00%) ???:__cxa_finalize [/usr/lib/libc.so.6] 235,266 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/slow_vector_initialization.rs:::check_stmt 234,766 ( 0.00%) ???:::walk_flat_map [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 233,816 ( 0.00%) /rust/deps/indexmap-2.14.0/src/map.rs:::instantiate_bound_regions_with_erased::> 233,772 ( 0.00%) ???:>>::walk_ref'2 [???] 233,688 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check_pat 233,598 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/functions/must_use.rs:clippy_lints::functions::must_use::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 232,680 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/types/rc_buffer.rs:clippy_lints::types::rc_buffer::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 232,621 ( 0.00%) ???:thin_vec::drop_non_singleton::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 232,515 ( 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:::finish_grow 232,386 ( 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] 232,192 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::chained_binops_helper [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 231,958 ( 0.00%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 231,814 ( 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::<::is_whitespace> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 230,999 ( 0.00%) ???:::schedule_expn_data_for_encoding [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 230,540 ( 0.00%) ???:>::compress::<>::process_obligations::{closure#1}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 229,965 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/cognitive_complexity.rs:rustc_hir::intravisit::walk_local::::check::{closure#0}>> 229,950 ( 0.00%) ???:termize::platform::unix::dimensions [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 229,402 ( 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 228,953 ( 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::is_in_test 228,498 ( 0.00%) ???:::parse_assoc_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 227,906 ( 0.00%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 227,760 ( 0.00%) ???:rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::is_doc_hidden [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 227,622 ( 0.00%) ???:>::tys::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 227,074 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/unnested_or_patterns.rs:::visit_pat [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 227,014 ( 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_block 226,982 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/string.rs:::write_str [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 226,889 ( 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] 226,720 ( 0.00%) ???:rustc_query_impl::query_impl::source_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] 226,608 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs:::check_generics [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 226,278 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/ptr/mod.rs:::check_body [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 226,132 ( 0.00%) ???:::with_parent [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 225,968 ( 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 225,946 ( 0.00%) ???:::check_use_tree [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 225,738 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/types/vec_box.rs:clippy_lints::types::vec_box::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 225,540 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/types/option_option.rs:clippy_lints::types::option_option::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 225,378 ( 0.00%) ???:::parse_attr_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 225,343 ( 0.00%) ???:::visit_invoc_in_module [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 225,086 ( 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::method_chain_args 224,956 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/item_name_repetitions.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 224,493 ( 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:clippy_utils::method_chain_args 224,429 ( 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_mac_def::check_ts'2 224,053 ( 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:clippy_lints::loops::never_loop::never_loop_expr'2 223,362 ( 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/sync/lock.rs:>::with::::data::{closure#0}>::{closure#0}, rustc_span::SpanData> 223,344 ( 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::check_proc_macro::span_matches_pat 223,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] 222,927 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 222,566 ( 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 222,067 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/functions/must_use.rs:clippy_lints::functions::must_use::check_impl_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 221,772 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 221,644 ( 0.00%) ???:::check_pat_post [???] 221,570 ( 0.00%) ???:>), rustc_middle::traits::cache::WithDepNode)>>::reserve_rehash::>), rustc_middle::traits::cache::WithDepNode, rustc_hash::FxBuildHasher>::{closure#0}> [???] 221,382 ( 0.00%) ???:::alloc_from_iter::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 219,978 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/combined_early_pass.rs:::check_fn [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 218,866 ( 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] 218,426 ( 0.00%) ???:rustc_ast::visit::visit_field_defs::> [???] 218,069 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/inline_trait_bounds.rs:::check_fn [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 218,022 ( 0.00%) ???:::find_ancestor_inside [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 217,930 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/reserve_after_initialization.rs:::check_block_post [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 217,783 ( 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}> [???] 217,035 ( 0.00%) ???:>::from [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 217,032 ( 0.00%) ???:::visit_generics [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 216,184 ( 0.00%) /rust/deps/indexmap-2.14.0/src/map.rs:, rustc_hash::FxBuildHasher> as core::iter::traits::collect::FromIterator<(rustc_span::def_id::LocalDefId, alloc::vec::Vec)>>::from_iter::, >::new::{closure#0}>> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 216,025 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:::check_ctxt [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 215,975 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::eq 215,528 ( 0.00%) ???:> as rustc_data_structures::flat_map_in_place::FlatMapInPlace>>::flat_map_in_place::::{closure#0}, smallvec::SmallVec<[alloc::boxed::Box; 1]>>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 215,495 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/str_utils.rs:clippy_utils::str_utils::to_camel_case [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 215,478 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/casts/needless_type_cast.rs:clippy_lints::casts::needless_type_cast::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 215,396 ( 0.00%) ???:::data_untracked [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 215,280 ( 0.00%) ???:::without_first_quote [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 215,268 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:::hash_expr'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 214,295 ( 0.00%) ???:<[rustc_hir::hir::FieldDef] 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] 214,283 ( 0.00%) ???:::register_lints [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 213,939 ( 0.00%) ???:rustc_query_impl::query_impl::check_transmutes::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 213,916 ( 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:rustc_hir::intravisit::walk_expr::'2 213,680 ( 0.00%) src/pac.c:tcache_bin_flush_small 213,449 ( 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] 213,252 ( 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:::trim_matches::<::is_whitespace> 213,210 ( 0.00%) 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] 213,080 ( 0.00%) ???:::clone'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 213,000 ( 0.00%) include/jemalloc/internal/rtree.h:emap_merge_prepare 212,830 ( 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 212,716 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:::with_source_text::::{closure#0}> 212,670 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/raw.rs:>::remove_entry::::{closure#0}> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 212,604 ( 0.00%) ???:::from_bytes_with_nul [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 211,896 ( 0.00%) ???:::lower_field_def [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 211,822 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 211,574 ( 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_hir::hir::Expr, core::iter::adapters::filter::Filter, core::slice::iter::Iter>, clippy_lints::unit_types::unit_arg::check::{closure#0}>>>::from_iter 210,786 ( 0.00%) ???:::visit_def_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 210,614 ( 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] 210,585 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/combined_early_pass.rs:::check_param [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 210,448 ( 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:::visit_pat 210,227 ( 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] 210,156 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check_ty 209,325 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/types/owned_cow.rs:clippy_lints::types::owned_cow::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 209,280 ( 0.00%) ???: as rustc_ast::visit::Visitor>::visit_arm::{closure#0}'2 [???] 209,097 ( 0.00%) ???: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] 208,714 ( 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:::get::{closure#0}> as rustc_hir::intravisit::Visitor>::visit_expr'2 208,248 ( 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] 208,095 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::qpath_search_pat [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 208,053 ( 0.00%) 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] 207,834 ( 0.00%) include/jemalloc/internal/bit_util.h:tcache_bin_flush_small 207,822 ( 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:>::insert 207,224 ( 0.00%) ???:::parse_match_block'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 206,324 ( 0.00%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 206,209 ( 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 206,208 ( 0.00%) ???:core::ptr::drop_glue::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 206,029 ( 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_attributes 205,875 ( 0.00%) include/jemalloc/internal/edata.h:realloc 205,681 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::visit_pat'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 205,404 ( 0.00%) ???:::visit_fn [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 204,765 ( 0.00%) include/jemalloc/internal/cache_bin.h:free_default 204,600 ( 0.00%) ???:__tls_get_addr [/usr/lib/ld-linux-x86-64.so.2] 204,469 ( 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/jemalloc.c:calloc [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 204,373 ( 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_middle::ty::list::RawList<(), rustc_middle::ty::Ty> as rustc_type_ir::fold::TypeFoldable>::fold_with::> 204,311 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_else_clause [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 204,251 ( 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 204,085 ( 0.00%) ???:core::ptr::drop_glue::>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 204,036 ( 0.00%) src/pac.c:pa_alloc 203,773 ( 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] 203,686 ( 0.00%) ???:::expect_one_of [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 203,280 ( 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::check_proc_macro::span_matches_pat 203,112 ( 0.00%) ???:::hir_owner_parent'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 202,953 ( 0.00%) ???:rustc_errors::emitter::detect_confusion_type [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 202,822 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 202,699 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/identity_op.rs:clippy_lints::operators::identity_op::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 202,676 ( 0.00%) ???:>>::or_default [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 202,327 ( 0.00%) ???:::check_expr_post [???] 202,283 ( 0.00%) src/emap.c:extent_try_coalesce_impl.llvm.9305427869391012685 201,779 ( 0.00%) ???:rustc_resolve::rustdoc::prepare_to_doc_link_resolution [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 201,564 ( 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:::get::{closure#0}> as rustc_hir::intravisit::Visitor>::visit_expr'2 201,288 ( 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/util.rs:::check_ty_ 201,195 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/no_effect.rs:clippy_lints::no_effect::has_no_effect [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 201,187 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 200,819 ( 0.00%) ???:::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] 200,812 ( 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:::into_range 200,791 ( 0.00%) src/decay.c:tcache_bin_flush_small 200,679 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/macro_metavars_in_unsafe.rs:::check_body [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 200,410 ( 0.00%) ???:::flat_map_pat_field [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 200,243 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/memchr.rs:clippy_lints::doc::check_doc::> 199,476 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/types/box_collection.rs:clippy_lints::types::box_collection::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 199,401 ( 0.00%) ???:::open_c [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 199,238 ( 0.00%) ???:, serde_json::ser::CompactFormatter> as serde_core::ser::SerializeStruct>::serialize_field::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 199,189 ( 0.00%) ???:rustc_query_impl::plumbing::encode_query_values_inner::>, &rustc_middle::hir::ModuleItems>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 199,054 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/macro_metavars_in_unsafe.rs:::visit_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 198,617 ( 0.00%) ???:::cancel [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 198,500 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/doc/missing_headers.rs:clippy_lints::doc::missing_headers::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 198,427 ( 0.00%) src/tcache.c:realloc 198,374 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 198,282 ( 0.00%) /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::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}> 198,125 ( 0.00%) ???:>::tys::{closure#0}'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 197,880 ( 0.00%) ???:0x00000000000a07c0 [/usr/lib/libc.so.6] 197,733 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/mut_key.rs:::check_local 197,253 ( 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:, rustc_type_ir::sty::Region>>::insert_unique 197,030 ( 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, ::check_item_kind::{closure#0}>, ::check_item_kind::{closure#1}>, core::option::Option>>>::from_iter [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 196,813 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 196,750 ( 0.00%) ???:rustc_query_impl::query_impl::object_lifetime_default::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 196,693 ( 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:clippy_lints::unit_types::unit_arg::check 196,621 ( 0.00%) include/jemalloc/internal/arena_inlines_b.h:free_default 196,320 ( 0.00%) ???:::meta [???] 196,148 ( 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] 195,974 ( 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_fn 195,912 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:>::with::<::with::outer_expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> 195,807 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/empty_line_after.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 195,748 ( 0.00%) ???:::flat_map_variant [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 195,075 ( 0.00%) ???:rustc_query_impl::query_impl::associated_item_def_ids::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 194,445 ( 0.00%) ???:rustc_query_impl::query_impl::associated_items::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 194,191 ( 0.00%) ???:>>>, ())>>::reserve_rehash::>>>, (), rustc_type_ir::binder::Binder>>::{closure#1}> [???] 193,956 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/control/tag.rs:>::insert 193,202 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/derive/mod.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 192,895 ( 0.00%) ???:::from_inner [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 192,131 ( 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_qpath:: 192,055 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/res.rs:::check_expr 191,960 ( 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] 191,942 ( 0.00%) ???:0x000000000000ad20 [/usr/lib/ld-linux-x86-64.so.2] 191,854 ( 0.00%) include/jemalloc/internal/edata.h:pac_decay_to_limit.llvm.9344053299937794623 191,635 ( 0.00%) ???:rustc_query_impl::query_impl::constness::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] 191,461 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 191,455 ( 0.00%) ???:rustc_span::hygiene::decode_syntax_context::::decode_syntax_context::{closure#0}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 191,281 ( 0.00%) ???:>, ::create_struct_patterns::{closure#0}::{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] 191,130 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/types/rc_mutex.rs:clippy_lints::types::rc_mutex::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 191,088 ( 0.00%) ???:::until [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 190,667 ( 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] 190,634 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/attrs/mixed_attributes_style.rs:clippy_lints::attrs::mixed_attributes_style::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 190,476 ( 0.00%) ???:::features [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 190,332 ( 0.00%) /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] 190,102 ( 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_utils::check_proc_macro::span_matches_pat 189,494 ( 0.00%) ???:::hash_one::<&std::path::PathBuf> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 189,134 ( 0.00%) ???: as rustc_ast::visit::Visitor>::visit_generic_param::{closure#0} [???] 188,832 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:clippy_lints::question_mark::check_if_try_match [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 188,721 ( 0.00%) include/jemalloc/internal/sz.h:pa_dalloc 188,522 ( 0.00%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 188,336 ( 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::>'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 188,160 ( 0.00%) ???:rustc_hir::intravisit::walk_generic_args:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 188,126 ( 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/tls.rs:::check_expr 188,005 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/absurd_extreme_comparisons.rs:clippy_lints::operators::absurd_extreme_comparisons::detect_extreme_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 187,903 ( 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_utils::get_expr_use_site 187,575 ( 0.00%) ???:::emit_diagnostic [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 187,529 ( 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] 187,478 ( 0.00%) src/thread_event.c:realloc 186,575 ( 0.00%) ???:>>::drop_slow'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 186,322 ( 0.00%) ???:>>::walk_ref [???] 186,319 ( 0.00%) ???:::resolve_visibility [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 186,303 ( 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::never_loop::never_loop_expr'2 186,246 ( 0.00%) include/jemalloc/internal/tsd_tls.h:malloc_default 186,184 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/hir/map.rs:::hir_body_owner_kind:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 186,121 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/needless_arbitrary_self_type.rs:::check_param [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 186,121 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/types/type_complexity.rs:::visit_ty'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 185,963 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 185,715 ( 0.00%) ???:::parent_module [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 185,578 ( 0.00%) ???:rustc_builtin_macros::source_util::expand_mod [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 185,574 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/float_cmp.rs:clippy_lints::operators::float_cmp::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 185,462 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/lifetimes.rs:::visit_ty'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 184,617 ( 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] 184,580 ( 0.00%) ???:::alloc_from_iter::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 184,399 ( 0.00%) ???:<&rustc_middle::ty::list::RawList<(), rustc_span::def_id::LocalDefId> 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] 184,151 ( 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_stmt 184,035 ( 0.00%) ???:::lower_variant_data [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 183,855 ( 0.00%) ???:rustc_query_impl::execution::ensure_can_skip_execution::, rustc_middle::dep_graph::graph::DepNodeIndex>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 183,676 ( 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 183,622 ( 0.00%) ???:::flat_map_field_def [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 183,400 ( 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] 183,146 ( 0.00%) ???:::walk_::<::is_never_pattern::{closure#0}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 182,860 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs: as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::find_map::check<(rustc_span::hygiene::ExpnId, rustc_span::hygiene::ExpnData), clippy_utils::macros::MacroCall, &mut clippy_utils::macros::macro_backtrace::{closure#0}>::{closure#0}, core::ops::control_flow::ControlFlow> 182,836 ( 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:rustc_hir::intravisit::walk_expr::'2 182,728 ( 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:::instantiate_bound_regions::::instantiate_bound_regions_with_erased::{closure#0}>::{closure#0} 182,716 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/empty_line_after.rs:::check_impl_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 182,706 ( 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_lints::functions::must_use::check_impl_item 182,686 ( 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:: 182,641 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/methods/io_other_error.rs:clippy_lints::methods::io_other_error::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 182,433 ( 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:::emit_lint_if_under_msrv 182,336 ( 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/data_structures/delayed_map.rs: as rustc_type_ir::fold::TypeFolder>::fold_ty 181,844 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::query::erase::ErasedData<[u8; 1]>>, true>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 181,792 ( 0.00%) ???:::stmt_super_let_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 181,674 ( 0.00%) ???:>::append_text [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 181,340 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::>, true>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 181,260 ( 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] 181,237 ( 0.00%) ???:::is_keyword_ahead [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 180,609 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/returns/needless_return.rs:clippy_lints::returns::needless_return::check_final_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 180,478 ( 0.00%) ???:>::drop_slow [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 180,455 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/op_ref.rs:clippy_lints::operators::op_ref::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 180,449 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/manual_non_exhaustive.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 180,427 ( 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:::visit_pat'2 179,986 ( 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:rustc_hir::intravisit::walk_qpath:: 179,702 ( 0.00%) ???:rustc_hir_analysis::check_crate'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 179,677 ( 0.00%) ???:::require_lang_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 179,319 ( 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] 178,830 ( 0.00%) ???:::{closure#1} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::dep_graph::dep_node::DepNode, rustc_middle::dep_graph::serialized::SerializedDepNodeIndex, rustc_middle::dep_graph::graph::DepNodeIndex)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 178,742 ( 0.00%) ???:::record_lifetime_use [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 178,685 ( 0.00%) ???:>::super_fold_with:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 178,663 ( 0.00%) /home/moon/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memchr-2.8.2/src/arch/generic/memchr.rs:memchr::arch::x86_64::memchr::memchr_raw::find_avx2 178,581 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/functions/ref_option.rs:clippy_lints::functions::ref_option::check_ty [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 178,549 ( 0.00%) ???:>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 178,454 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:::visit_expr'2 177,617 ( 0.00%) ???:>::try_fold_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 177,602 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::visit_expr'2 177,585 ( 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 177,405 ( 0.00%) /rust/deps/smallvec-1.15.1/src/lib.rs:::check_attributes 177,405 ( 0.00%) /rust/deps/smallvec-1.15.1/src/lib.rs:::check_attributes_post 177,244 ( 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_lint_if_under_msrv 177,162 ( 0.00%) /rust/deps/smallvec-1.15.1/src/lib.rs: as rustc_data_structures::flat_map_in_place::FlatMapInPlace>::flat_map_in_place::::{closure#0}, smallvec::SmallVec<[rustc_ast::ast::PatField; 1]>> 177,052 ( 0.00%) ???:::leak_check [???] 177,038 ( 0.00%) ???:rustc_hir::intravisit::walk_generics:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 177,006 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/misc.rs:::check_stmt [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 176,990 ( 0.00%) ???:>::reserve [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 176,858 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/numeric_arithmetic.rs:::check_binary [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 176,852 ( 0.00%) ???:::hash_owner_nodes::{closure#0}'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 176,852 ( 0.00%) ???:::typeck_root_def_id_local [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 176,824 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/mut_visit.rs:rustc_ast::mut_visit::walk_flat_map_pat_field:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 176,816 ( 0.00%) ???: as rustc_data_structures::flat_map_in_place::FlatMapInPlace>::flat_map_in_place::::{closure#0}, smallvec::SmallVec<[rustc_ast::ast::GenericParam; 1]>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 176,792 ( 0.00%) ???:rustc_query_impl::query_impl::impl_trait_header::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 176,779 ( 0.00%) ???:core::ptr::drop_glue::>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 176,703 ( 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:::write_str 176,688 ( 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:clippy_utils::macros::first_node_in_macro:: 176,564 ( 0.00%) ???:::flat_map_assoc_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 176,419 ( 0.00%) ???:::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] 176,204 ( 0.00%) include/jemalloc/internal/sz.h:ecache_evict 176,158 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/absurd_extreme_comparisons.rs:clippy_lints::operators::absurd_extreme_comparisons::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 175,864 ( 0.00%) ???:::normalize_and_prove_instantiated_clauses [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 175,460 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/mut_key.rs:::check_sig [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 175,274 ( 0.00%) ???:::in_derive_expansion [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 175,266 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/matches/mod.rs:::check_pat 175,183 ( 0.00%) ???:>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 175,163 ( 0.00%) ???:>::univariant_biased::>::{closure#5} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 175,029 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cmp.rs:>::retain:: 174,915 ( 0.00%) ???:::overlaps [???] 174,846 ( 0.00%) ???:core::ptr::drop_glue::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 174,616 ( 0.00%) ???:::expr_call [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 174,240 ( 0.00%) ???:<[rustc_middle::ty::generic_args::GenericArg] as rustc_serialize::serialize::Encodable>::encode'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 174,217 ( 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:, rustc_type_ir::sty::Region>>::insert_unique 173,834 ( 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::is_in_test 173,803 ( 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] 173,478 ( 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] 173,135 ( 0.00%) ???:::visit_node_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 173,100 ( 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:>::retain:: 173,083 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/def_id.rs:>::retain:: 173,051 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/upper_case_acronyms.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 172,851 ( 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:::visit_expr'2 171,929 ( 0.00%) ???:<[core::option::Option] 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] 171,918 ( 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_lints::operators::cmp_owned::check_op 171,814 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/dep_graph/graph.rs:::check_expr 171,643 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 171,557 ( 0.00%) ???:::check_def_id'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 171,550 ( 0.00%) ???:0x000000000d99a2f0 [???] 171,135 ( 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::iter::traits::iterator::Iterator>::next 171,094 ( 0.00%) ???:::hir_impl_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 171,084 ( 0.00%) src/eset.c:tcache_bin_flush_small 171,004 ( 0.00%) ???:::visit_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 170,919 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/ptr/ptr_arg.rs:clippy_lints::ptr::ptr_arg::check_body [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 170,907 ( 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] 170,829 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 170,820 ( 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_utils::macros::first_node_in_macro:: 170,650 ( 0.00%) /rust/deps/pulldown-cmark-0.11.3/src/parse.rs:::check_attributes 170,620 ( 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 170,613 ( 0.00%) ???:::parse_next_component_back [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 170,481 ( 0.00%) ???:annotate_snippets::renderer::source_map::as_substr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 170,442 ( 0.00%) include/jemalloc/internal/ph.h:edata_cache_put 170,400 ( 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:clippy_utils::check_proc_macro::span_matches_pat 170,163 ( 0.00%) ???:::parse_mod [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 170,105 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/unwrap.rs:clippy_lints::unwrap::collect_unwrap_info::inner [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 169,441 ( 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] 169,064 ( 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/flat_map_in_place.rs: as rustc_data_structures::flat_map_in_place::FlatMapInPlace>::flat_map_in_place::::{closure#0}, smallvec::SmallVec<[rustc_ast::ast::PatField; 1]>> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 168,857 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::if_sequence [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 168,796 ( 0.00%) ???:rustc_query_impl::query_impl::is_copy_raw::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 168,778 ( 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] 168,748 ( 0.00%) ???:::eq_ctxt [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 168,610 ( 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] 168,290 ( 0.00%) ???:rustc_mir_transform::ffi_unwind_calls::required_panic_strategy [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 168,193 ( 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:::get::{closure#0}> as rustc_hir::intravisit::Visitor>::visit_expr'2 168,185 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/collections/btree/node.rs:, alloc::collections::btree::node::marker::Edge>>::insert_recursing::>::insert_entry::{closure#0}> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 168,164 ( 0.00%) ???: as core::iter::traits::collect::FromIterator>::from_iter::, ::lower_generic_params_mut::{closure#0}>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 168,156 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::query::erase::ErasedData<[u8; 24]>>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 167,851 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cmp.rs:::next_match 167,763 ( 0.00%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 167,753 ( 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: as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::find_map::check<(rustc_span::hygiene::ExpnId, rustc_span::hygiene::ExpnData), clippy_utils::macros::MacroCall, &mut clippy_utils::macros::macro_backtrace::{closure#0}>::{closure#0}, core::ops::control_flow::ControlFlow> 167,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] 167,452 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:::check_pat 167,284 ( 0.00%) ???:::expr_call_lang_item_fn [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 167,127 ( 0.00%) ???:core::ptr::drop_glue::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 167,065 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 167,031 ( 0.00%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 166,778 ( 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] 166,734 ( 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 166,692 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/bit_mask.rs:clippy_lints::operators::bit_mask::check::{closure#0} [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 166,500 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/misc_early/redundant_at_rest_pattern.rs:clippy_lints::misc_early::redundant_at_rest_pattern::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 166,353 ( 0.00%) ???:rustc_query_impl::query_impl::is_doc_hidden::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 166,327 ( 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 166,015 ( 0.00%) ???:<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::Ty> as rustc_type_ir::inherent::Tys>::output [???] 165,962 ( 0.00%) ???:::clone [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 165,789 ( 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::loops::never_loop::never_loop_expr::{closure#2}'2 165,660 ( 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] 165,647 ( 0.00%) include/jemalloc/internal/edata.h:extent_try_coalesce_impl.llvm.9305427869391012685 165,119 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_trait_impl_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 165,075 ( 0.00%) ???:rustc_query_impl::query_impl::associated_types_for_impl_traits_in_trait_or_impl::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 165,066 ( 0.00%) /rust/deps/hashbrown-0.17.0/src/raw.rs:>::get:: 164,955 ( 0.00%) ???:::has_trivial_sizedness [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 164,660 ( 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 164,632 ( 0.00%) 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] 164,612 ( 0.00%) ???: as rustc_hir::intravisit::Visitor>::visit_variant_data [???] 164,455 ( 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 164,455 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/map.rs:::check_expr 164,454 ( 0.00%) ???:::parse_meta_seq_top [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 164,379 ( 0.00%) /rust/deps/indexmap-2.14.0/src/inner.rs:>::insert_full 164,101 ( 0.00%) ???:rustc_query_impl::query_impl::intrinsic_raw::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] 163,615 ( 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 163,522 ( 0.00%) src/sz.c:tcache_bin_flush_small 163,458 ( 0.00%) /rust/deps/indexmap-2.14.0/src/inner.rs:>::insert_full 163,291 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/extra_unused_type_parameters.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 163,124 ( 0.00%) ???:<[rustc_hir::hir::GenericBound] 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] 163,109 ( 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] 163,037 ( 0.00%) /rust/deps/hashbrown-0.17.0/src/raw.rs:>::swap_remove:: 163,034 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:::parse [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 162,881 ( 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_lints::lifetimes::could_use_elision 162,434 ( 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 162,112 ( 0.00%) ???:::intern [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 162,063 ( 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::check_proc_macro::expr_search_pat::expr_search_pat_inner'2 162,039 ( 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] 161,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:clippy_lints::unit_types::unit_cmp::check 161,232 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/map.rs:>::insert [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 161,139 ( 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] 161,012 ( 0.00%) ???: as rustc_hir::intravisit::Visitor>::visit_ty'2 [???] 160,846 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:clippy_lints::non_expressive_names::do_check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 160,688 ( 0.00%) ???:<(&rustc_hir_id::ItemLocalId, &alloc::vec::Vec) 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] 160,566 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/flatten.rs: 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} 160,528 ( 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}> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 160,491 ( 0.00%) ???:::insert [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 160,482 ( 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:::deref 160,458 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/toplevel_ref_arg.rs:::check_fn [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 160,292 ( 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] 160,131 ( 0.00%) ???: as rustc_hir::intravisit::Visitor>::visit_path'2 [???] 160,028 ( 0.00%) ???:::lower_pat_mut::{closure#0}'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 159,974 ( 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 159,875 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:::search_pat [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 159,390 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/methods/or_fun_call.rs:clippy_lints::methods::or_fun_call::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 159,325 ( 0.00%) src/emap.c:pa_dalloc 159,010 ( 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/flat_map_in_place.rs: as rustc_data_structures::flat_map_in_place::FlatMapInPlace>::flat_map_in_place::::{closure#0}, smallvec::SmallVec<[rustc_ast::ast::PatField; 1]>> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 158,897 ( 0.00%) ???:::parse_meta_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 158,690 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/suspicious_trait_impl.rs:clippy_lints::suspicious_trait_impl::check_expr_inner [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 158,594 ( 0.00%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 158,548 ( 0.00%) ???:0x0000000000094850 [/usr/lib/libc.so.6] 158,385 ( 0.00%) ???:::split_at [???] 158,330 ( 0.00%) ???:::parse_record_struct_body [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 158,295 ( 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] 158,114 ( 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:clippy_utils::is_lint_allowed 157,702 ( 0.00%) ???:::resolve_pattern_top [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 157,643 ( 0.00%) ???:::encode_query_value::<&rustc_data_structures::unord::UnordSet> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 157,635 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/x86/sse2.rs:::check_pat 157,392 ( 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] 157,212 ( 0.00%) include/jemalloc/internal/edata.h:extent_record 157,085 ( 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_mut [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 157,032 ( 0.00%) include/jemalloc/internal/bit_util.h:eset_remove 156,980 ( 0.00%) /rust/deps/indexmap-2.14.0/src/map.rs:>::swap_remove:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 156,780 ( 0.00%) ???:::with_span_pos [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 156,398 ( 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::> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 156,368 ( 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:::visit_qpath 156,366 ( 0.00%) ???:rustc_errors::annotate_snippet_emitter_writer::emit_to_destination [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 156,294 ( 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 156,182 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eq_expr 156,059 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::visit_block'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 155,894 ( 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 155,844 ( 0.00%) ???:::parse_expr_struct [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 155,708 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter.rs:::check_block 155,674 ( 0.00%) ???:rustc_ast::visit::walk_item_inner::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 155,658 ( 0.00%) ???:>>::walk_ref [???] 155,585 ( 0.00%) ???:rustc_mir_transform::simplify::simplify_cfg [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 154,994 ( 0.00%) ???:>>::walk_ref'2 [???] 154,918 ( 0.00%) ???:::visit_nested_body [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 154,797 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::check_single_char_names [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 154,671 ( 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::'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 154,644 ( 0.00%) ???:::cmp [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 154,615 ( 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:rustc_hir::intravisit::walk_expr::'2 154,614 ( 0.00%) ???: as rustc_hir::intravisit::Visitor>::visit_generic_args [???] 154,480 ( 0.00%) ???:)>>::call_once'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 154,411 ( 0.00%) ???:, rustc_borrowck::handle_placeholders::SccAnnotations>>::construct [???] 153,609 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/attrs/mod.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 153,569 ( 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: 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} 153,474 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/raw.rs:clippy_lints::functions::duplicate_underscore_argument::check 153,316 ( 0.00%) ???:::break_two_token_op [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 153,238 ( 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] 152,997 ( 0.00%) ???:::{closure#0}> as core::iter::traits::iterator::Iterator>::next [???] 152,975 ( 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] 152,946 ( 0.00%) ???:::word [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 152,931 ( 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::> 152,901 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 152,654 ( 0.00%) ???:::visit_param_bound [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 152,522 ( 0.00%) ???:::new_import_decl [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 152,427 ( 0.00%) /rust/deps/indexmap-2.14.0/src/map.rs:::instantiate_bound_regions_with_erased:: 152,334 ( 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] 152,248 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/visitors.rs:rustc_hir::intravisit::walk_local::> 152,192 ( 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:extent_record [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 151,904 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/def.rs:::check_ty 151,796 ( 0.00%) /rust/deps/indexmap-2.14.0/src/map/entry.rs:::instantiate_bound_regions::::instantiate_bound_regions_with_erased::{closure#0}>::{closure#0} 151,661 ( 0.00%) ???:::add_early_lint [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 151,658 ( 0.00%) ???:rustc_hir::intravisit::walk_qpath::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 151,565 ( 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 alloc::vec::spec_from_iter_nested::SpecFromIterNested<&rustc_middle::ty::VariantDef, core::iter::adapters::filter::Filter, clippy_lints::matches::match_wild_enum::check::{closure#1}>>>::from_iter 151,383 ( 0.00%) ???:::visit_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 151,051 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::expr_sig [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 150,870 ( 0.00%) ???:>::reserve_rehash::>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 150,794 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/types/mod.rs:::check_ty'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 150,636 ( 0.00%) ???:::new_imported_source_file [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 150,529 ( 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_ty:: 150,388 ( 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] 150,345 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/visitors.rs: as rustc_hir::intravisit::Visitor>::visit_expr'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 150,317 ( 0.00%) ???:::parse_meta_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 150,298 ( 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_block 150,113 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/consts.rs:clippy_utils::consts::mir_to_const [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 150,042 ( 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] 150,020 ( 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> 149,641 ( 0.00%) ???:>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 149,635 ( 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_ty 149,529 ( 0.00%) ???:rustc_builtin_macros::format::make_format_args::{closure#3} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 149,400 ( 0.00%) include/jemalloc/internal/ph.h:extent_record 149,365 ( 0.00%) ???:rustc_builtin_macros::deriving::debug::expand_deriving_debug::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 149,322 ( 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:rustc_hir::intravisit::walk_qpath:: 149,314 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/matches/match_wild_enum.rs:clippy_lints::matches::match_wild_enum::check::{closure#2} [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 149,253 ( 0.00%) ???:rustc_arena::outline::<::alloc_from_iter, ::lower_angle_bracketed_parameter_data::{closure#2}>>::{closure#0}, &mut [rustc_hir::hir::AssocItemConstraint]> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 149,051 ( 0.00%) ???:>::binary_op [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 148,898 ( 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_attributes 148,882 ( 0.00%) ???:>::super_fold_with::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 148,808 ( 0.00%) ???:::short_write_process_buffer::<2> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 148,775 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/float_equality_without_abs.rs:clippy_lints::operators::float_equality_without_abs::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 148,648 ( 0.00%) ???:::find_mir_or_eval_fn [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 148,323 ( 0.00%) src/bitmap.c:malloc_default 148,267 ( 0.00%) src/extent.c:pa_dalloc 148,110 ( 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_ty:: 148,089 ( 0.00%) ???:::visit_body [???] 147,935 ( 0.00%) ???:::visit_ty'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 147,856 ( 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::methods::clone_on_copy::check_function 147,554 ( 0.00%) ???:realpath [/usr/lib/libc.so.6] 147,543 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 147,395 ( 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_item 147,286 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 147,273 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 147,222 ( 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_block'2 146,850 ( 0.00%) ???:::add [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 146,832 ( 0.00%) ???:::fmt [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 146,663 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/res.rs:::check_expr 146,653 ( 0.00%) ???:>::walk_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 146,649 ( 0.00%) ???:::desugar_doc_comments::desugar_inner'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 146,574 ( 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 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 146,564 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 146,076 ( 0.00%) ???: as rustc_data_structures::flat_map_in_place::FlatMapInPlace>::flat_map_in_place::::{closure#0}, smallvec::SmallVec<[rustc_ast::ast::WherePredicate; 1]>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 145,374 ( 0.00%) ???:::visit_item_id_use_tree [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 145,286 ( 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:>::swap_remove:: 145,252 ( 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_local 145,118 ( 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:::def_key:: 145,115 ( 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:: 144,954 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/functions/misnamed_getters.rs:clippy_lints::functions::misnamed_getters::check_fn [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 144,942 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/visitors.rs: as rustc_hir::intravisit::Visitor>::visit_expr'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 144,644 ( 0.00%) ???:rustc_attr_parsing::attributes::cfg::parse_name_value [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 144,606 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 144,542 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/visitors.rs:rustc_hir::intravisit::walk_expr::::{closure#0}>>'2 144,086 ( 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::'2 144,069 ( 0.00%) ???:::parse_item_enum::{closure#1} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 143,846 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/returns/needless_return.rs:clippy_lints::returns::needless_return::check_block_return [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 143,810 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/impl_hash_with_borrow_str_and_bytes.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 143,476 ( 0.00%) ???:>::walk_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 143,460 ( 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:, rustc_type_ir::sty::Region>>::insert_unique 143,376 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:::instantiate_bound_regions_with_erased::> 143,010 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/extra_unused_type_parameters.rs:::check_impl_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 143,004 ( 0.00%) ???:::select [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 142,939 ( 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:::visit_pat'2 142,870 ( 0.00%) /rust/deps/hashbrown-0.17.0/src/table.rs:>::entry::::{closure#0}, indexmap::inner::get_hash::{closure#0}> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 142,720 ( 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_body 142,690 ( 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] 142,498 ( 0.00%) ???: as rustc_data_structures::flat_map_in_place::FlatMapInPlace>::flat_map_in_place::::{closure#0}, smallvec::SmallVec<[rustc_ast::ast::FieldDef; 1]>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 142,269 ( 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/vec_cache.rs:::check_fn 142,213 ( 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_fn_decl:: 141,956 ( 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: as rustc_hir::intravisit::Visitor>::visit_expr'2 141,863 ( 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:rustc_hir::intravisit::walk_qpath:: 141,791 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/missing_const_for_thread_local.rs:::check_fn [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 141,708 ( 0.00%) ???:::visit_generic_args [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 141,686 ( 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_utils::check_proc_macro::span_matches_pat 141,630 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/misc_early/mod.rs:::check_generics [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 141,574 ( 0.00%) ???:::visit_lifetime [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 141,495 ( 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] 141,478 ( 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::> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 141,443 ( 0.00%) ???:::visit_generic_param [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 141,402 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/functions/must_use.rs:clippy_lints::functions::must_use::is_mutable_ty [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 141,361 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr_for_hir [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 141,319 ( 0.00%) ???:, ::create_struct_patterns::{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] 141,128 ( 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_lints::matches::infallible_destructuring_match::check 140,722 ( 0.00%) ???:rustc_passes::reachable::reachable_set [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 140,675 ( 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] 140,589 ( 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 140,472 ( 0.00%) ???:<::find_lifetime_for_self::SelfVisitor as rustc_ast::visit::Visitor>::visit_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 140,464 ( 0.00%) ???:::walk::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 140,274 ( 0.00%) ???:::parent_module'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 140,103 ( 0.00%) ???:::serialize::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 140,100 ( 0.00%) ???:::visit_assoc_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 140,096 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 140,006 ( 0.00%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 139,955 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/manual_noop_waker.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 139,841 ( 0.00%) ???:::maybe_report_lifetime_uses [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 139,738 ( 0.00%) src/sz.c:eset_remove 139,614 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 139,236 ( 0.00%) include/jemalloc/internal/extent.h:ecache_evict 139,217 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/only_used_in_recursion.rs:::check_body_post [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 139,151 ( 0.00%) ???:>::reserve_rehash::, rustc_middle::middle::privacy::EffectiveVisibility>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 138,565 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/infallible_try_from.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 138,444 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/double_comparison.rs:clippy_lints::operators::double_comparison::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 138,439 ( 0.00%) ???:<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::Ty> as rustc_type_ir::inherent::Tys>::inputs [???] 138,305 ( 0.00%) ???:::visit_ty'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 138,076 ( 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] 137,952 ( 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:::new 137,842 ( 0.00%) ???:rustc_query_impl::plumbing::encode_query_values_inner::, rustc_middle::dep_graph::graph::DepNodeIndex>, rustc_span::span_encoding::Span>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 137,815 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/attrs/duplicated_attributes.rs:::check_attributes 137,791 ( 0.00%) ???:::requires_monomorphization'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 137,528 ( 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_fn 137,372 ( 0.00%) ???:>::insert [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 137,280 ( 0.00%) ???:>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 137,216 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/len_zero.rs:::check_empty_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 137,065 ( 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/vec_cache.rs:clippy_utils::trait_ref_of_method 136,944 ( 0.00%) /rust/deps/smallvec-1.15.1/src/lib.rs: as core::ops::drop::Drop>::drop [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 136,832 ( 0.00%) ???:>::eval_operand [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 136,800 ( 0.00%) ???:::parse_pat_ident_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 136,675 ( 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::> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 136,592 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/derivable_impls.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 136,574 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs:::check_item_post [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 136,408 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 136,302 ( 0.00%) ???:>::walk_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 136,302 ( 0.00%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 136,302 ( 0.00%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 136,080 ( 0.00%) ???:::check_args_compatible_inner [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 136,024 ( 0.00%) ???:>::walk_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 135,834 ( 0.00%) ???:::check_stack [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 135,786 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/raw.rs:::get_def_id_availability 135,751 ( 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_mut [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 135,740 ( 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_methods 135,717 ( 0.00%) /rust/deps/indexmap-2.14.0/src/map.rs:>::insert_full [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 135,681 ( 0.00%) ???:rustc_query_impl::query_impl::impl_is_fully_generic_for_reflection::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 135,680 ( 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_utils::is_else_clause 135,620 ( 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:::visit_pat'2 135,611 ( 0.00%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 135,561 ( 0.00%) ???:::decode_syntax_context [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 135,474 ( 0.00%) ???:::clone [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 135,463 ( 0.00%) ???:::confirm [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 135,186 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::check_impl_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 135,148 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/casts/needless_type_cast.rs: as rustc_hir::intravisit::Visitor>::visit_expr'2 135,108 ( 0.00%) ???:::fmt [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 135,074 ( 0.00%) ???:::visit_path_segment [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 134,941 ( 0.00%) ???:::check_attributes [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 134,930 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/identity_op.rs:clippy_lints::operators::identity_op::is_assoc_fn_without_type_instance [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 134,888 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 134,757 ( 0.00%) ???:::resolve_derives [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 134,485 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/visitors.rs:rustc_hir::intravisit::walk_block::>'2 134,252 ( 0.00%) ???:::parse_full_stmt [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 133,974 ( 0.00%) ???: as core::clone::Clone>::clone::clone_non_singleton::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 133,839 ( 0.00%) ???:::extract_arg_details [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 133,809 ( 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/sty.rs:clippy_lints::loops::never_loop::never_loop_expr'2 133,516 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/casts/needless_type_cast.rs:rustc_hir::intravisit::walk_local::> 133,483 ( 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] 133,371 ( 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] 133,359 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/consts.rs:clippy_utils::consts::lit_to_mir_constant [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 133,253 ( 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] 133,200 ( 0.00%) ???:pulldown_cmark::firstpass::delim_run_can_open [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 132,863 ( 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 132,768 ( 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:::as_str 132,756 ( 0.00%) ???:>::reserve_rehash::>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 132,731 ( 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_mac_def::check_ts'2 132,609 ( 0.00%) ???:::check_stmt [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 132,573 ( 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] 132,540 ( 0.00%) ???:::{closure#1} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::dep_graph::dep_node::DepNode, rustc_middle::dep_graph::serialized::SerializedDepNodeIndex, rustc_middle::dep_graph::graph::DepNodeIndex)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 132,450 ( 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] 132,175 ( 0.00%) ???:::clone [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 132,148 ( 0.00%) ???:>::insert [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 132,030 ( 0.00%) ???:::next_node_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 131,718 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 131,552 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/functions/mod.rs:::check_impl_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 131,535 ( 0.00%) ???:::has_typeck_results'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 131,430 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::expr_or_init [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 131,381 ( 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] 131,376 ( 0.00%) ???:::implicit_self [???] 131,302 ( 0.00%) ???:::ty_path [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 131,090 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/new_without_default.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 130,899 ( 0.00%) ???:::parse_pat_allow_top_guard [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 130,862 ( 0.00%) ???:rustc_hir::intravisit::walk_stmt:: [???] 130,859 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 130,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:rustc_hir::intravisit::walk_impl_item::> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 130,785 ( 0.00%) ???:::{closure#1} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::dep_graph::dep_node::DepNode, rustc_middle::dep_graph::serialized::SerializedDepNodeIndex, rustc_middle::dep_graph::graph::DepNodeIndex)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 130,754 ( 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_block 130,752 ( 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_block_post 130,683 ( 0.00%) ???:::requires_caller_location [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 130,611 ( 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}>>'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 130,520 ( 0.00%) /rust/deps/indexmap-2.14.0/src/map.rs:::instantiate_bound_regions::::instantiate_bound_regions_with_erased::{closure#0}>::{closure#0} 130,513 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/non_canonical_impls.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 130,378 ( 0.00%) ???:::emit_diagnostic [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 130,200 ( 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_ty::> 130,151 ( 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_block 130,147 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/enum_clike.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 130,004 ( 0.00%) ???: as rustc_data_structures::flat_map_in_place::FlatMapInPlace>::flat_map_in_place::::{closure#0}, smallvec::SmallVec<[rustc_ast::ast::FieldDef; 1]>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 129,845 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/count.rs:::visit_pat 129,691 ( 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:>::handle_inline_pass1 129,528 ( 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:clippy_utils::str_utils::to_camel_case 129,495 ( 0.00%) ???:::stable_hash::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 129,239 ( 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:clippy_lints::lifetimes::could_use_elision 129,017 ( 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_lints::lifetimes::could_use_elision 128,949 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/partialeq_ne_impl.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 128,928 ( 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:rustc_hir::intravisit::walk_expr::'2 128,734 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/integer_division_remainder_used.rs:clippy_lints::operators::integer_division_remainder_used::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 128,624 ( 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_block 128,616 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::query::erase::ErasedData<[u8; 16]>>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 128,474 ( 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] 128,458 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/attrs/mod.rs:::check_attribute [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 128,030 ( 0.00%) ???:> as rustc_ast::visit::Visitable>>::visit [???] 128,026 ( 0.00%) ???:::visit_block'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 127,968 ( 0.00%) ???:::collect_invocations'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 127,947 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/missing_enforced_import_rename.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 127,923 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/multiple_bound_locations.rs:::check_fn [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 127,775 ( 0.00%) /rust/deps/hashbrown-0.17.0/src/table.rs:>::entry::::{closure#0}, indexmap::inner::get_hash::{closure#0}> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 127,657 ( 0.00%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 127,536 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/utils/dump_hir.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 127,518 ( 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_item 127,420 ( 0.00%) ???:::parse_inner_attributes [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 127,348 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::fn_kind_pat [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 127,345 ( 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] 127,288 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/ifs/same_functions_in_if_cond.rs:clippy_lints::ifs::same_functions_in_if_cond::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 127,082 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter.rs:::check_block 127,043 ( 0.00%) ???:::stable_hash::::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 126,976 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::parse 126,784 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check_stmt 126,609 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/functions/must_use.rs: as rustc_hir::intravisit::Visitor>::visit_expr'2 126,608 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 126,526 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/x86/sse2.rs:, rustc_type_ir::sty::Region>>::new 126,469 ( 0.00%) ???:::meta_kind [???] 126,466 ( 0.00%) ???:::new_with_messages [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 126,453 ( 0.00%) ???:::trim_start [???] 126,451 ( 0.00%) ???:::visit_variant [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 126,351 ( 0.00%) ???:::check_param [???] 126,234 ( 0.00%) ???:rustc_builtin_macros::cfg::expand_cfg [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 126,117 ( 0.00%) ???:::visit_generic_args [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 125,688 ( 0.00%) ???:::instantiate_into [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 125,630 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cell.rs:::qpath 125,474 ( 0.00%) ???:__cxa_atexit [/usr/lib/libc.so.6] 125,395 ( 0.00%) ???:::has_typeck_results [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 125,322 ( 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 125,304 ( 0.00%) ???:>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 125,280 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/string.rs:clippy_lints::functions::duplicate_underscore_argument::check 125,117 ( 0.00%) ???:>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 125,094 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/ptr/ptr_arg.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 124,974 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::if_statement_binops'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 124,594 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::>, true>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 124,432 ( 0.00%) ???:rustc_query_impl::query_impl::hir_owner_parent_q::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] 124,393 ( 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] 124,359 ( 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] 124,284 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/needless_nonzero_get.rs:clippy_lints::needless_nonzero_get::nonzero_get [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 124,243 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/range.rs:::next_match 124,179 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 124,134 ( 0.00%) /rust/deps/indexmap-2.14.0/src/map.rs:clippy_lints::lifetimes::could_use_elision 124,020 ( 0.00%) ???:::block_all [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 123,964 ( 0.00%) ???:core::ptr::drop_glue::>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 123,898 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:::input_with_hir [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 123,804 ( 0.00%) /rust/deps/hashbrown-0.17.0/src/raw.rs:, rustc_middle::dep_graph::graph::DepNodeIndex))>>>::get:: 123,708 ( 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:clippy_utils::get_expr_use_site 123,683 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/unnested_or_patterns.rs:::check_local 123,536 ( 0.00%) ???:>::call_once'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 123,403 ( 0.00%) ???:core::ptr::drop_glue::, rustc_ast::ast::AstOwner)>>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 123,144 ( 0.00%) ???:> as rustc_ast::visit::Visitable>>::visit [???] 123,116 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 122,875 ( 0.00%) ???:::parse_seq_to_before_end::::parse_meta_item::{closure#3}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 122,818 ( 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_pat:: 122,756 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/functions/not_unsafe_ptr_arg_deref.rs:clippy_lints::functions::not_unsafe_ptr_arg_deref::check_raw_ptr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 122,742 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/ifs/ifs_same_cond.rs:clippy_lints::ifs::ifs_same_cond::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 122,722 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:::check_block 122,722 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:::check_block_post 122,706 ( 0.00%) ???:::check_arm [???] 122,640 ( 0.00%) ???:<::from_errors_diagnostic::BufWriter as core::io::write::Write>::write_fmt [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 122,584 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/manual_async_fn.rs:::check_fn [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 122,370 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/attrs/deprecated_cfg_attr.rs:clippy_lints::attrs::deprecated_cfg_attr::check_clippy [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 122,344 ( 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_attributes 122,314 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/cognitive_complexity.rs:rustc_hir::intravisit::walk_block::::check::{closure#0}>>'2 122,269 ( 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::methods::unwrap_expect_used::check_call 122,233 ( 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:>::sub:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 122,067 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/manual_div_ceil.rs:clippy_lints::operators::manual_div_ceil::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 121,909 ( 0.00%) ???:core::ptr::drop_glue::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 121,801 ( 0.00%) ???:::visit_method_receiver_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 121,360 ( 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_block 121,355 ( 0.00%) /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 121,353 ( 0.00%) ???:::parse_use_tree_glob_or_nested [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 121,219 ( 0.00%) ???:::is_automatically_derived [???] 121,072 ( 0.00%) ???:::parse_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 120,994 ( 0.00%) ???:>::next [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 120,853 ( 0.00%) ???:::descent_to_ambiguity [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 120,596 ( 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_item_kind 120,531 ( 0.00%) ???:::maybe_resolve_crate'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 120,444 ( 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:::trim_end_matches::<::is_whitespace> 120,152 ( 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/vec_cache.rs:::check_fn 120,043 ( 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:::visit_pat 120,013 ( 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] 119,865 ( 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::{closure#0}> as rustc_hir::intravisit::Visitor>::visit_expr'2 119,613 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/legacy_numeric_constants.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 119,551 ( 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::str_utils::to_camel_case 119,513 ( 0.00%) ???:::record_partial_res [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 119,376 ( 0.00%) ???:::visit_method_receiver_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 119,371 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/ptr/mut_from_ref.rs:clippy_lints::ptr::mut_from_ref::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 119,089 ( 0.00%) /rust/deps/rustc-hash-2.1.1/src/lib.rs:>::insert 119,071 ( 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/vec_cache.rs:::check_fn 118,959 ( 0.00%) ???:::parse_literal_maybe_minus [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 118,913 ( 0.00%) ???:>::fill_item::<>::identity_for_item::{closure#0}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 118,852 ( 0.00%) ???:::clone'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 118,825 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/const_comparisons.rs:clippy_lints::operators::const_comparisons::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 118,764 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/lifetimes.rs:clippy_lints::lifetimes::report_extra_lifetimes [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 118,664 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/matches/needless_match.rs:clippy_lints::matches::needless_match::expr_ty_matches_p_ty [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 118,635 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 118,592 ( 0.00%) ???:::expr_call_global [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 118,359 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/accum.rs:::visit_pat 118,296 ( 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/sync/lock.rs:>::with::<::with::is_descendant_of::{closure#0}>::{closure#0}, bool> 118,290 ( 0.00%) 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] 118,286 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/functions/renamed_function_params.rs:clippy_lints::functions::renamed_function_params::check_impl_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 118,206 ( 0.00%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 118,202 ( 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_stmt 118,188 ( 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 118,158 ( 0.00%) ???:std::sys::env::unix::getenv::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 118,130 ( 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: 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} 118,130 ( 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::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> 118,070 ( 0.00%) include/jemalloc/internal/rtree.h:extent_record 117,935 ( 0.00%) ???:pulldown_cmark::firstpass::delim_run_can_close [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 117,751 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/raw.rs:::check_body 117,745 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/ptr/ptr_eq.rs:clippy_lints::ptr::ptr_eq::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 117,741 ( 0.00%) ???: as core::cmp::PartialEq>::eq [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 117,734 ( 0.00%) ???:>::insert_full [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 117,492 ( 0.00%) ???:::visit_path_segment [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 117,438 ( 0.00%) ???:::lower_fn_params_to_idents [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 117,421 ( 0.00%) ???:>::visit_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 117,216 ( 0.00%) ???:rustc_ast::attr::mk_attr_nested_word [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 117,139 ( 0.00%) ???:>, ::create_struct_patterns::{closure#0}::{closure#0}>, ::create_struct_patterns::{closure#0}::{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] 117,023 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/serde_api.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 116,957 ( 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] 116,353 ( 0.00%) ???:::do_mir_borrowck [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 116,340 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/types/linked_list.rs:clippy_lints::types::linked_list::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 116,284 ( 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] 116,283 ( 0.00%) ???:::item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 116,200 ( 0.00%) ???:::parse_use_tree'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 116,000 ( 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] 115,979 ( 0.00%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 115,979 ( 0.00%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 115,949 ( 0.00%) ???:::parse_expr_lit [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 115,893 ( 0.00%) ???:::lower_expr_mut::{closure#0}::{closure#1}'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 115,893 ( 0.00%) ???:rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::fn_sig [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 115,768 ( 0.00%) ???:rustc_hir::intravisit::walk_pat_expr::> [???] 115,740 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cmp.rs:>::reserve::do_reserve_and_handle:: 115,691 ( 0.00%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 115,300 ( 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] 115,233 ( 0.00%) ???:rustc_resolve::rustdoc::preprocess_link [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 115,065 ( 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] 114,868 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:::search_pat [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 114,765 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/definition_in_module_root.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 114,757 ( 0.00%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 114,536 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/attrs/deprecated_cfg_attr.rs:clippy_lints::attrs::deprecated_cfg_attr::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 114,432 ( 0.00%) ???:rustc_ast::attr::mk_doc_comment [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 114,422 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/edition.rs:>::with::<::with::outer_expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> 114,422 ( 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:>::with::<::with::outer_expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> 114,422 ( 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:>::with::<::with::outer_expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> 114,422 ( 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:>::with::<::with::outer_expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> 114,385 ( 0.00%) ???:::start_point [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 114,366 ( 0.00%) include/jemalloc/internal/mutex.h:ecache_evict 114,352 ( 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/generic_args.rs:<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::generic_args::GenericArg> as rustc_type_ir::fold::TypeFoldable>::fold_with::> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 114,324 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/raw.rs:>::remove_entry::::{closure#0}> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 114,320 ( 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:::get_all_attrs:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 114,276 ( 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] 114,080 ( 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 rustc_data_structures::flat_map_in_place::FlatMapInPlace>::flat_map_in_place::::{closure#0}, smallvec::SmallVec<[rustc_ast::ast::PatField; 1]>> 114,028 ( 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:::check_ty 113,972 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::search_same::<&rustc_hir::hir::Expr, clippy_lints::ifs::ifs_same_cond::check::{closure#0}, clippy_lints::ifs::ifs_same_cond::check::{closure#1}> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 113,748 ( 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] 113,691 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::)>, rustc_middle::query::erase::ErasedData<[u8; 32]>>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 113,689 ( 0.00%) include/jemalloc/internal/atomic.h:pa_dalloc 113,508 ( 0.00%) ???:::emit [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 113,464 ( 0.00%) ???:::visit_ty'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 113,397 ( 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] 113,338 ( 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/sty.rs:::check_expr 113,292 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/invalid_upcast_comparisons.rs:clippy_lints::operators::invalid_upcast_comparisons::numeric_cast_precast_bounds [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 113,229 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/ptr/cmp_null.rs:clippy_lints::ptr::cmp_null::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 113,210 ( 0.00%) ???:::alias_attrs [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 113,181 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/functions/ref_option.rs:clippy_lints::functions::ref_option::check_fn_sig [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 113,135 ( 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] 112,500 ( 0.00%) ???:core::ptr::drop_glue::>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 111,979 ( 0.00%) ???:::span_until_non_whitespace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 111,955 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/matches/match_wild_enum.rs:clippy_lints::matches::match_wild_enum::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 111,945 ( 0.00%) ???:::{closure#1} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::dep_graph::dep_node::DepNode, rustc_middle::dep_graph::serialized::SerializedDepNodeIndex, rustc_middle::dep_graph::graph::DepNodeIndex)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 111,942 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:rustc_hir::intravisit::walk_expr::::{closure#0}>>'2 111,918 ( 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] 111,864 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/types/borrowed_box.rs:clippy_lints::types::borrowed_box::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 111,463 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/matches/redundant_pattern_match.rs:clippy_lints::matches::redundant_pattern_match::find_method_sugg_for_if_let [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 111,248 ( 0.00%) ???:core::ptr::drop_glue::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 111,209 ( 0.00%) ???:::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 111,153 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/large_enum_variant.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 110,899 ( 0.00%) ???: as rustc_hir::intravisit::Visitor>::visit_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 110,776 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/modulo_arithmetic.rs:clippy_lints::operators::modulo_arithmetic::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 110,636 ( 0.00%) ???:, ::expand::{closure#0}::{closure#0}>, ::expand::{closure#0}::{closure#1}>, ::expand::{closure#0}::{closure#2}> 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] 110,582 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/def.rs:clippy_lints::minmax::min_max 110,517 ( 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::> 110,112 ( 0.00%) ???: as core::iter::traits::collect::Extend>::extend::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 110,098 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/lifetimes.rs:clippy_lints::lifetimes::has_where_lifetimes [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 109,963 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/collections/hash/map.rs:clippy_lints::functions::duplicate_underscore_argument::check 109,958 ( 0.00%) ???:::collect_field [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 109,910 ( 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_pat 109,868 ( 0.00%) ???:core::unicode::unicode_data::conversions::to_upper [???] 109,863 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::>>>, rustc_middle::query::erase::ErasedData<[u8; 8]>>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 109,854 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs:::check_trait_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 109,824 ( 0.00%) ???:::eq [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 109,768 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 109,667 ( 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 109,592 ( 0.00%) ???:::is_positional [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 109,553 ( 0.00%) ???:rustc_expand::placeholders::placeholder::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 109,520 ( 0.00%) include/jemalloc/internal/extent.h:tcache_bin_flush_small 109,496 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 109,494 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::search_same::<&rustc_hir::hir::Expr, clippy_lints::ifs::same_functions_in_if_cond::check::{closure#1}, &dyn for<'a, 'b, 'c, 'd, 'e, 'f> core::ops::function::Fn<(&'a &'b rustc_hir::hir::Expr<'c>, &'d &'e rustc_hir::hir::Expr<'f>), Output = bool>> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 109,486 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 109,236 ( 0.00%) ???:::try_resolve [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 109,220 ( 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/structural_impls.rs:<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::Ty> as rustc_type_ir::fold::TypeFoldable>::fold_with::> 109,152 ( 0.00%) ???:rustc_ty_utils::common_traits::is_trait_raw [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 109,091 ( 0.00%) ???:rustc_query_impl::query_impl::fn_arg_idents::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] 108,967 ( 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_block 108,960 ( 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_block_post 108,840 ( 0.00%) ???:rustc_interface::callbacks::track_diagnostic::>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 108,817 ( 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_hir::hir::Expr, core::iter::adapters::filter::Filter, core::slice::iter::Iter>, clippy_lints::unit_types::unit_arg::check::{closure#0}>>>::from_iter 108,809 ( 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:>::push_suggestion [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 108,780 ( 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, clippy_lints::lifetimes::could_use_elision::{closure#2}>>>::from_iter [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 108,730 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/len_zero.rs:::check_cmp [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 108,619 ( 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:::visit_pat 108,604 ( 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/tls.rs:::check_fn 108,376 ( 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 rustc_data_structures::flat_map_in_place::FlatMapInPlace>::flat_map_in_place::::{closure#0}, smallvec::SmallVec<[rustc_ast::ast::PatField; 1]>> 108,333 ( 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_item 108,123 ( 0.00%) ???: as core::iter::traits::collect::Extend>::extend::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 108,066 ( 0.00%) ???:::with_ctxt_from_mark [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 108,064 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/integer_division.rs:clippy_lints::operators::integer_division::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 108,013 ( 0.00%) ???:core::ptr::drop_glue::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 108,012 ( 0.00%) ???:::descent_to_ambiguity'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 107,959 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/dereference.rs:::for_defined_ty [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 107,868 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/duration_subsec.rs:clippy_lints::operators::duration_subsec::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 107,642 ( 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 107,640 ( 0.00%) ???: as alloc::vec::spec_from_iter_nested::SpecFromIterNested::macro_backtrace::{closure#0}>>>::from_iter [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 107,629 ( 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_utils::check_proc_macro::qpath_search_pat 107,310 ( 0.00%) ???:<::from_errors_diagnostic::BufWriter as core::io::write::Write>::flush [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 107,261 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/def.rs:::check_ty 107,173 ( 0.00%) ???:rustc_ast::visit::walk_item_inner::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 106,863 ( 0.00%) ???:::parse_unsuffixed_meta_item_lit [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 106,839 ( 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_utils::str_utils::to_camel_case 106,803 ( 0.00%) /rust/deps/indexmap-2.14.0/src/map.rs: as core::iter::traits::collect::FromIterator<(rustc_hir_id::HirId, usize)>>::from_iter::>, clippy_lints::ptr::ptr_arg::check_ptr_arg_usage::{closure#1}>> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 106,798 ( 0.00%) ???: as rustc_serialize::serialize::Encodable>::encode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 106,657 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 106,579 ( 0.00%) ???:> as rustc_data_structures::flat_map_in_place::FlatMapInPlace>>::flat_map_in_place::::{closure#0}, smallvec::SmallVec<[alloc::boxed::Box; 1]>>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 106,495 ( 0.00%) /home/moon/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memchr-2.8.2/src/arch/x86_64/avx2/memchr.rs:memchr::arch::x86_64::memchr::memchr_raw::find_avx2 106,234 ( 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] 106,101 ( 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 106,071 ( 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] 106,068 ( 0.00%) include/jemalloc/internal/sz.h:extent_record 105,936 ( 0.00%) ???:::new_uninitialized:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 105,918 ( 0.00%) ???:::print_expr_outer_attr_style'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 105,827 ( 0.00%) ???:rustc_query_impl::query_impl::lower_to_hir::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 105,734 ( 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<(rustc_hir_id::HirId, clippy_lints::casts::needless_type_cast::BindingInfo), std::collections::hash::map::IntoIter>>::from_iter [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 105,620 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/eq_op.rs:clippy_lints::operators::eq_op::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 105,537 ( 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::macros::root_macro_call 105,537 ( 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::macros::root_macro_call 105,508 ( 0.00%) ???:::make_canonicalized_query_response:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 105,402 ( 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] 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,292 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/self_named_constructors.rs:::check_impl_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 105,280 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cmp.rs: as core::cmp::PartialEq>::eq 105,222 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/unwrap.rs:::check_fn [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 105,158 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/implied_bounds_in_impls.rs:::check_ty 105,096 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_lang_item_or_ctor [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 105,095 ( 0.00%) ???:::meta [???] 105,020 ( 0.00%) ???:rustc_privacy::check_mod_privacy [???] 104,981 ( 0.00%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 104,916 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/module_style.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 104,916 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/module_style.rs:::check_item_post [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 104,916 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/single_component_path_imports.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 104,887 ( 0.00%) ???:rustc_query_impl::query_impl::type_of::invoke_provider_fn::__rust_begin_short_backtrace'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 104,800 ( 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:::check_body 104,692 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 104,493 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 104,441 ( 0.00%) ???:rustc_query_impl::query_impl::def_kind::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 104,412 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/res.rs:clippy_lints::unwrap::extract_local 104,360 ( 0.00%) ???:>::types_may_unify_inner'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 104,312 ( 0.00%) ???:<&std::io::stdio::Stderr as core::io::write::Write>::flush [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 104,240 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/non_copy_const.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 104,215 ( 0.00%) ???:::visit_trait_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 104,192 ( 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:>::super_fold_with::> 104,190 ( 0.00%) ???:::parse_expr_dot_or_call_with [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 104,102 ( 0.00%) ???:rustc_ast::mut_visit::walk_flat_map_assoc_item:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 104,020 ( 0.00%) ???:::fmt [???] 103,995 ( 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/sty.rs: as alloc::vec::spec_from_iter_nested::SpecFromIterNested<&rustc_hir::hir::Expr, core::iter::adapters::filter::Filter, core::slice::iter::Iter>, clippy_lints::unit_types::unit_arg::check::{closure#0}>>>::from_iter 103,995 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/unit_types/unit_arg.rs: as alloc::vec::spec_from_iter_nested::SpecFromIterNested<&rustc_hir::hir::Expr, core::iter::adapters::filter::Filter, core::slice::iter::Iter>, clippy_lints::unit_types::unit_arg::check::{closure#0}>>>::from_iter 103,947 ( 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::check_doc::> 103,797 ( 0.00%) ???: as rustc_ast::visit::Visitor>::visit_use_tree [???] 103,585 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 103,514 ( 0.00%) ???:>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 103,365 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval_local [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 103,299 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/attrs/duplicated_attributes.rs:clippy_lints::attrs::duplicated_attributes::check_duplicated_attr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 103,270 ( 0.00%) ???:::check_attributes [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 103,246 ( 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::> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 103,213 ( 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_methods 103,193 ( 0.00%) ???:>)>>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 103,176 ( 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_block 103,144 ( 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/entry.rs:>::insert_entry [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 103,137 ( 0.00%) ???:>::walk_mut'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 103,136 ( 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:::visit_expr'2 103,109 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:::eq_path [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 103,045 ( 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] 102,999 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/large_const_arrays.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 102,851 ( 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::> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 102,749 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/manual_midpoint.rs:clippy_lints::operators::manual_midpoint::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 102,710 ( 0.00%) ???:::source_callsite'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 102,708 ( 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::> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 102,692 ( 0.00%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 102,596 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/manual_is_multiple_of.rs:clippy_lints::operators::manual_is_multiple_of::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 102,509 ( 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:rustc_hir::intravisit::walk_expr:: 102,498 ( 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:>::reserve_rehash::::{closure#0}> 102,484 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::query::erase::ErasedData<[u8; 8]>>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 102,432 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/doc/suspicious_doc_comments.rs:<&mut clippy_lints::doc::suspicious_doc_comments::collect_doc_replacements::{closure#0} as core::ops::function::FnMut<(&rustc_hir::hir::Attribute,)>>::call_mut 102,410 ( 0.00%) ???:core::ptr::drop_glue::>>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 102,402 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/sugg.rs:clippy_utils::sugg::has_enclosing_paren:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 102,350 ( 0.00%) ???:::scan_begin [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 102,336 ( 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_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> 102,295 ( 0.00%) src/bitmap.c:realloc 102,274 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/def.rs:::check_expr 102,256 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 102,185 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 102,080 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 101,979 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/invalid_upcast_comparisons.rs:clippy_lints::operators::invalid_upcast_comparisons::upcast_comparison_bounds_err [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 101,929 ( 0.00%) ???:rustc_query_impl::plumbing::promote_from_disk_inner::>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 101,925 ( 0.00%) ???:core::ptr::drop_glue::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 101,725 ( 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:::eq_expr 101,718 ( 0.00%) ???:::visit_block [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 101,684 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/len_without_is_empty.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 101,664 ( 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<&rustc_ast::ast::GenericParam, core::iter::adapters::filter::Filter, clippy_lints::inline_trait_bounds::lint_fn::{closure#0}>>>::from_iter [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 101,247 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 101,201 ( 0.00%) ???:::build_reduced_graph_for_block [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 101,040 ( 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 100,980 ( 0.00%) ???:::symbol_path'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 100,886 ( 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_ty:: 100,863 ( 0.00%) ???:::parse_use_tree [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 100,652 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 100,595 ( 0.00%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 100,409 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/unwrap.rs:::visit_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 100,361 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir_id/src/lib.rs:::check_expr 100,344 ( 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_utils::source::get_source_range 100,303 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/matches/mod.rs:::check_local 100,249 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/res.rs:::check_expr 100,060 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/unused_unit.rs:::check_fn [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 100,042 ( 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:clippy_utils::check_proc_macro::span_matches_pat 100,026 ( 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 100,016 ( 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:::check_expr 99,792 ( 0.00%) ???:rustc_builtin_macros::util::expr_to_spanned_string [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 99,739 ( 0.00%) ???:::find_library_crate [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 99,645 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/bool.rs:::opt_item_name:: 99,542 ( 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] 99,506 ( 0.00%) ???:::expr_into_dest'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 99,482 ( 0.00%) ???:, (rustc_middle::query::erase::ErasedData<[u8; 16]>, rustc_middle::dep_graph::graph::DepNodeIndex))>>::reserve_rehash::<, (rustc_middle::query::erase::ErasedData<[u8; 16]>, rustc_middle::dep_graph::graph::DepNodeIndex))>>>::insert_unique::{closure#0}> [???] 99,230 ( 0.00%) ???:0x0000000000067b30 [/usr/lib/libc.so.6] 99,222 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 99,126 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 99,057 ( 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/tls.rs:clippy_utils::trait_ref_of_method 98,950 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/lifetimes.rs:::check_trait_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 98,848 ( 0.00%) /rust/deps/indexmap-2.14.0/src/map.rs:>::insert_full [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 98,794 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 98,718 ( 0.00%) ???:::filter_by_name_unhygienic [???] 98,640 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:::check_expr 98,578 ( 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] 98,477 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/inherent_to_string.rs:::check_impl_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 98,273 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/unnested_or_patterns.rs:::check_param 98,255 ( 0.00%) ???: as rustc_data_structures::flat_map_in_place::FlatMapInPlace>::flat_map_in_place::::{closure#0}, smallvec::SmallVec<[rustc_ast::ast::GenericParam; 1]>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 98,143 ( 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_lints::non_expressive_names::do_check 98,077 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/functions/not_unsafe_ptr_arg_deref.rs:::check_fn 97,826 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/raw.rs:>::insert 97,569 ( 0.00%) ???:::clone::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 97,551 ( 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: as core::iter::traits::iterator::Iterator>::next 97,550 ( 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_utils::if_sequence 97,545 ( 0.00%) ???:::{closure#1} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::dep_graph::dep_node::DepNode, rustc_middle::dep_graph::serialized::SerializedDepNodeIndex, rustc_middle::dep_graph::graph::DepNodeIndex)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 97,507 ( 0.00%) ???:>::encode [???] 97,474 ( 0.00%) ???:0x0000000000040520 [/usr/lib/libc.so.6] 97,374 ( 0.00%) ???:>::deallocate_ptr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 97,217 ( 0.00%) ???:0x0000000000176b40 [/usr/lib/libc.so.6] 97,189 ( 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:::write_str 97,154 ( 0.00%) ???:::expand::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 97,153 ( 0.00%) ???:::decode_alloc_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 97,151 ( 0.00%) ???:<[rustc_hir::hir::AssocItemConstraint] 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] 96,978 ( 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:>::insert 96,968 ( 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_mut [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 96,936 ( 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:::instantiate_bound_regions_with_erased::> 96,853 ( 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:::visit_local 96,815 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/attrs/inline_always.rs:clippy_lints::attrs::inline_always::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 96,754 ( 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_methods 96,706 ( 0.00%) ???:core::ptr::drop_glue::>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 96,532 ( 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_block 96,378 ( 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:clippy_lints::lifetimes::could_use_elision 96,228 ( 0.00%) /rust/deps/indexmap-2.14.0/src/map.rs: as core::iter::traits::collect::FromIterator<(rustc_hir_id::HirId, ())>>::from_iter::, clippy_utils::iter_input_pats::{closure#0}>, clippy_lints::functions::not_unsafe_ptr_arg_deref::check_raw_ptr::{closure#0}>, as core::iter::traits::collect::FromIterator>::from_iter, clippy_utils::iter_input_pats::{closure#0}>, clippy_lints::functions::not_unsafe_ptr_arg_deref::check_raw_ptr::{closure#0}>>::{closure#0}>> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 96,135 ( 0.00%) /rust/deps/indexmap-2.14.0/src/inner/entry.rs:>::new [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 96,078 ( 0.00%) /rust/deps/hashbrown-0.17.0/src/raw.rs:>::entry::::{closure#0}, indexmap::inner::get_hash::{closure#0}> 96,044 ( 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}>> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 96,036 ( 0.00%) ???:>>::upcast_from [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 95,885 ( 0.00%) include/jemalloc/internal/mutex.h:realloc 95,766 ( 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] 95,704 ( 0.00%) ???:<() as rustc_errors::diagnostic::EmissionGuarantee>::emit_producing_guarantee [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 95,700 ( 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 alloc::vec::spec_from_iter::SpecFromIter, ::check_item_kind::{closure#0}>, ::check_item_kind::{closure#1}>, core::option::Option>>>::from_iter 95,671 ( 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_pat 95,637 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/ranges.rs:clippy_lints::ranges::check_possible_range_contains [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 95,552 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/vec_init_then_push.rs:::check_stmt 95,548 ( 0.00%) ???:::check_unused_parens_pat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 95,420 ( 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:, rustc_type_ir::sty::Region>>::insert_unique 95,358 ( 0.00%) ???:::mk_const_alloc [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 95,263 ( 0.00%) ???:>::call_once'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 95,257 ( 0.00%) ???:, 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] 95,217 ( 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 95,164 ( 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] 95,142 ( 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_item_kind::{closure#0}>, ::check_item_kind::{closure#1}>, core::option::Option> as core::iter::traits::iterator::Iterator>::next 95,088 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/returns/mod.rs:::check_stmt 95,079 ( 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] 94,948 ( 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_pat 94,918 ( 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] 94,872 ( 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::check_proc_macro::span_matches_pat 94,813 ( 0.00%) ???:open [/usr/lib/libc.so.6] 94,782 ( 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] 94,760 ( 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:>::insert::, rustc_type_ir::sty::Region>::{closure#0}> 94,730 ( 0.00%) ???:core::ptr::drop_glue::<[rustc_expand::mbe::macro_parser::NamedMatch]>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 94,630 ( 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_lints::non_expressive_names::levenstein_not_1 94,608 ( 0.00%) ???:pulldown_cmark::linklabel::scan_link_label_rest [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 94,581 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/control/tag.rs:::check_pat 94,367 ( 0.00%) ???:::contains [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 94,269 ( 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:::def_key:: 94,248 ( 0.00%) ???:rustc_query_impl::plumbing::try_load_from_disk::, rustc_middle::ty::util::AlwaysRequiresDrop>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 94,198 ( 0.00%) ???:core::ptr::drop_glue::, rustc_error_messages::DiagArgValue>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 94,162 ( 0.00%) ???:>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 94,098 ( 0.00%) include/jemalloc/internal/sz.h:calloc 94,035 ( 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::loops::never_loop::never_loop_block'2 93,928 ( 0.00%) ???:::visit_attribute [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 93,926 ( 0.00%) ???:::flat_map_generic_param [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 93,895 ( 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::non_expressive_names::levenstein_not_1 93,708 ( 0.00%) include/jemalloc/internal/extent.h:pa_dalloc 93,680 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/index_range.rs:::check_expr 93,662 ( 0.00%) ???:::mk_param_from_def [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 93,496 ( 0.00%) ???:rustc_ty_utils::needs_drop::drop_tys_helper::::{closure#0}::{closure#0} [???] 93,401 ( 0.00%) ???:>, ::emit_messages_default::{closure#8}> as core::iter::traits::iterator::Iterator>::next'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 93,361 ( 0.00%) ???:>::destroy [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 93,216 ( 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<&rustc_hir::hir::Expr, core::iter::adapters::chain::Chain, core::slice::iter::Iter>>>::from_iter [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 93,102 ( 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/vec_cache.rs:::check_expr 93,098 ( 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] 93,092 ( 0.00%) ???:core::ptr::drop_glue::>; 1]>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 93,077 ( 0.00%) ???:::scan_string [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 93,072 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/ranges.rs:clippy_lints::ranges::check_range_bounds [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 93,060 ( 0.00%) ???:::{closure#1} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::dep_graph::dep_node::DepNode, rustc_middle::dep_graph::serialized::SerializedDepNodeIndex, rustc_middle::dep_graph::graph::DepNodeIndex)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 93,060 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/dereference.rs:::check_body_post [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 93,060 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/needless_borrows_for_generic_args.rs:::check_body_post [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 92,936 ( 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::casts::cast_slice_from_raw_parts::check_implicit_cast 92,859 ( 0.00%) /rust/deps/hashbrown-0.17.0/src/control/tag.rs:>::entry::::{closure#0}, indexmap::inner::get_hash::{closure#0}> 92,774 ( 0.00%) ???:>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 92,772 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/utils/dump_hir.rs:::check_impl_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 92,764 ( 0.00%) ???:::kind [???] 92,651 ( 0.00%) ???:::decode_expn_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 92,336 ( 0.00%) ???:rustc_expand::mbe::macro_check::check_nested_occurrences [/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] 92,074 ( 0.00%) ???:::parse_unspanned_seq::, ::parse_ty_tuple_or_parens::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 91,968 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/source.rs:::new [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 91,761 ( 0.00%) ???:::clone [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 91,727 ( 0.00%) ???:::emit_diagnostic'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 91,715 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:::get::{closure#0}> as rustc_hir::intravisit::Visitor>::visit_expr 91,639 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/duplicate_mod.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 91,625 ( 0.00%) ???:>::reserve [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 91,524 ( 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::check_proc_macro::span_matches_pat 91,505 ( 0.00%) ???:::coerce [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 91,461 ( 0.00%) include/jemalloc/internal/thread_event.h:calloc 91,295 ( 0.00%) ???:::check_stability_allow_unstable [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 91,198 ( 0.00%) ???:rustc_ty_utils::representability::params_in_repr_ty'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 91,193 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/cognitive_complexity.rs:rustc_hir::intravisit::walk_stmt::::check::{closure#0}>>'2 91,117 ( 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_lints::methods::io_other_error::check 91,053 ( 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/profiling.rs:::check_expr 90,834 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/macros.rs: as rustc_hir::intravisit::Visitor>::visit_expr'2 90,752 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/unwrap.rs:::visit_branch [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 90,541 ( 0.00%) ???:::def_key [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 90,385 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/ptr/mod.rs:::check_expr 90,356 ( 0.00%) ???:rustc_query_impl::query_impl::cross_crate_inlinable::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] 90,209 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/crate_in_macro_def.rs:clippy_lints::crate_in_macro_def::contains_unhygienic_crate_reference'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 90,087 ( 0.00%) ???:::visit_qpath'2 [???] 90,002 ( 0.00%) ???:rustc_query_impl::query_impl::layout_of::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 89,975 ( 0.00%) ???:::ty_is_opaque_future [???] 89,835 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/ifs/if_same_then_else.rs:clippy_lints::ifs::if_same_then_else::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 89,680 ( 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:>::retain:: 89,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:clippy_lints::doc::missing_headers::check 89,512 ( 0.00%) /rust/deps/hashbrown-0.17.0/src/raw.rs:, rustc_type_ir::sty::Region>>::insert_unique 89,498 ( 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 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 89,474 ( 0.00%) ???:::collect_tokens::::parse_stmt_without_recovery::{closure#4}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 89,377 ( 0.00%) ???:rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::adt_def [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 89,370 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/res.rs:::check_expr 89,330 ( 0.00%) ???:rustc_query_impl::plumbing::try_load_from_disk::<&rustc_middle::mir::Body> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 89,275 ( 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 89,245 ( 0.00%) ???:>::eval_place [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 89,138 ( 0.00%) ???:rustc_resolve::rustdoc::source_span_for_markdown_range_inner [???] 89,127 ( 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_block::'2 89,092 ( 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:clippy_utils::check_proc_macro::span_matches_pat 89,080 ( 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::check_proc_macro::expr_search_pat::expr_search_pat_inner 89,054 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::snippet_with_context_sm [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 89,043 ( 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] 88,980 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:::search_pat [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 88,957 ( 0.00%) ???:::check_ident [???] 88,900 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/methods/unnecessary_to_owned.rs:clippy_lints::methods::unnecessary_to_owned::is_cow_into_owned [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 88,816 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::docs_link [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 88,755 ( 0.00%) ???:::{closure#1} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::dep_graph::dep_node::DepNode, rustc_middle::dep_graph::serialized::SerializedDepNodeIndex, rustc_middle::dep_graph::graph::DepNodeIndex)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 88,483 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:clippy_lints::loops::never_loop::never_loop_block'2 88,340 ( 0.00%) ???:rustc_ast::visit::visit_field_defs:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 88,283 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/visitors.rs:rustc_hir::intravisit::walk_stmt::>'2 88,153 ( 0.00%) ???:rustc_query_impl::query_impl::associated_items::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] 88,119 ( 0.00%) ???:>::visit_ty'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 88,072 ( 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:>::retain::<>::multipart_suggestion_with_style<&str>::{closure#0}> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 88,041 ( 0.00%) ???:>::write_all_cold [???] 88,034 ( 0.00%) ???:, (rustc_middle::query::erase::ErasedData<[u8; 1]>, rustc_middle::dep_graph::graph::DepNodeIndex))>>::reserve_rehash::<, (rustc_middle::query::erase::ErasedData<[u8; 1]>, rustc_middle::dep_graph::graph::DepNodeIndex))>>>::insert_unique::{closure#0}> [???] 88,011 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::match_libc_symbol [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 87,925 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::never_loop_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 87,815 ( 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:clippy_utils::macros::is_assert_arg 87,768 ( 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/util.rs:<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::Ty> as rustc_type_ir::fold::TypeFoldable>::fold_with::> 87,521 ( 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_block::::check::{closure#0}>>'2 87,481 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/float_cmp.rs: 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} 87,419 ( 0.00%) ???:>>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 87,380 ( 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::SpecFromIter, ::check_item_kind::{closure#0}>, ::check_item_kind::{closure#1}>, core::option::Option>>>::from_iter 87,357 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/def.rs:::hir 87,226 ( 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:clippy_lints::doc::missing_headers::check 87,188 ( 0.00%) include/jemalloc/internal/pai.h:pa_alloc 87,142 ( 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:>::retain::<>::multipart_suggestion_with_style<&str>::{closure#0}>::{closure#0} [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 87,024 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/unnecessary_self_imports.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 87,007 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/partial_pub_fields.rs:::check_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 86,893 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/res.rs:::visit_expr'2 86,832 ( 0.00%) ???:::visit_use_tree [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 86,827 ( 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::methods::unnecessary_to_owned::check 86,809 ( 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] 86,795 ( 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] 86,759 ( 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] 86,736 ( 0.00%) ???:>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 86,718 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/numeric_arithmetic.rs:::check_body 86,697 ( 0.00%) ???:rustc_expand::mbe::macro_check::check_ops_is_prefix [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 86,666 ( 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] 86,570 ( 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::manual_clamp::is_two_if_pattern::{closure#0} as core::ops::function::FnMut<((clippy_lints::manual_clamp::MaybeBorrowedStmtKind, clippy_lints::manual_clamp::MaybeBorrowedStmtKind),)>>::call_mut [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 86,472 ( 0.00%) ???:::as_path [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 86,351 ( 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::in_automatically_derived 86,240 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/source.rs:::check_fn 86,197 ( 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] 86,143 ( 0.00%) ???:::const_eval_poly [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 85,922 ( 0.00%) ???:::eat_path_sep [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 85,848 ( 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_item 85,810 ( 0.00%) ???:rustc_query_impl::plumbing::encode_query_values_inner::>, core::result::Result<&rustc_middle::traits::specialization_graph::Graph, rustc_span::ErrorGuaranteed>>::{closure#0}'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 85,740 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/dep_graph/graph.rs:::check_fn 85,740 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 85,712 ( 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:>::multipart_suggestion_with_style::<&str> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 85,503 ( 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_ty:: 85,232 ( 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_lints::attrs::mixed_attributes_style::check 85,148 ( 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::::{closure#0}>>'2 84,961 ( 0.00%) ???:rustc_ty_utils::layout::layout_of'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 84,951 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/eq_op.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> 84,893 ( 0.00%) /rust/deps/indexmap-2.14.0/src/map.rs:, rustc_hash::FxBuildHasher>>::get_mut:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 84,817 ( 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] 84,736 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs: as rustc_hir::intravisit::Visitor>::visit_expr'2 84,650 ( 0.00%) ???:::mirror_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 84,590 ( 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::get_expr_use_site 84,514 ( 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:::hir 84,511 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/needless_bitwise_bool.rs:clippy_lints::operators::needless_bitwise_bool::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 84,445 ( 0.00%) ???:rustc_attr_parsing::attributes::cfg::parse_cfg_entry [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 84,369 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/functions/must_use.rs:clippy_lints::functions::must_use::check_must_use_candidate [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 84,345 ( 0.00%) ???:::walk::<::compute_and_check_binding_map::{closure#0}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 84,340 ( 0.00%) ???:rustc_hir::intravisit::walk_stmt::'2 [???] 84,308 ( 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:rustc_hir::intravisit::walk_block::'2 84,297 ( 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_lints::unit_types::unit_arg::check 84,297 ( 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 alloc::vec::spec_from_iter_nested::SpecFromIterNested<&rustc_hir::hir::Expr, core::iter::adapters::filter::Filter, core::slice::iter::Iter>, clippy_lints::unit_types::unit_arg::check::{closure#0}>>>::from_iter 84,296 ( 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 84,198 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/mut_visit.rs:>::walk_mut'2 84,162 ( 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, ::len>>>::from_iter [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 84,104 ( 0.00%) ???:::visit_assoc_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 84,072 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::current [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 83,936 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/zip.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 83,930 ( 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] 83,842 ( 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] 83,601 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 83,600 ( 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/vec_cache.rs:::hir_body_owner_kind:: 83,588 ( 0.00%) ???:>>::collect_and_apply::, <&rustc_middle::ty::list::RawList<(), rustc_middle::ty::generic_args::GenericArg> as rustc_serialize::serialize::Decodable>::decode::{closure#0}>, ::mk_args_from_iter, <&rustc_middle::ty::list::RawList<(), rustc_middle::ty::generic_args::GenericArg> as rustc_serialize::serialize::Decodable>::decode::{closure#0}>, rustc_middle::ty::generic_args::GenericArg>::{closure#0}>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 83,466 ( 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 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 83,202 ( 0.00%) ???:> as rustc_middle::ty::codec::RefDecodable>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 83,187 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/x86/sse2.rs:>::insert 83,094 ( 0.00%) ???:std::env::var::inner [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 83,064 ( 0.00%) include/jemalloc/internal/tsd_tls.h:free_default 82,850 ( 0.00%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 82,839 ( 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:>::next_back 82,782 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 82,705 ( 0.00%) ???:::recover_after_dot [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 82,634 ( 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_ty 82,594 ( 0.00%) ???:::allows_unstable [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 82,458 ( 0.00%) ???:>::fold_ty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 82,445 ( 0.00%) ???:>::union [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 82,426 ( 0.00%) include/jemalloc/internal/extent.h:extent_try_coalesce_impl.llvm.9305427869391012685 82,426 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/functions/impl_trait_in_params.rs:::check_impl_item 82,418 ( 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:<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::Ty> as rustc_type_ir::fold::TypeFoldable>::fold_with::> 82,155 ( 0.00%) ???:<&str as core::fmt::Display>::fmt [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 82,122 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/casts/needless_type_cast.rs: as rustc_hir::intravisit::Visitor>::visit_expr 81,795 ( 0.00%) /home/moon/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/itertools-0.15.0/src/tuple_impl.rs:, clippy_lints::manual_clamp::block_stmt_with_last::{closure#0}>, core::option::IntoIter>, (clippy_lints::manual_clamp::MaybeBorrowedStmtKind, clippy_lints::manual_clamp::MaybeBorrowedStmtKind)> as core::iter::traits::iterator::Iterator>::next [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 81,739 ( 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:>::insert_from_slice 81,666 ( 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_lints::loops::never_loop::never_loop_block'2 81,650 ( 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/emap.c:emap_merge_prepare [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 81,589 ( 0.00%) ???:::span [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 81,588 ( 0.00%) ???:::qpath_lang_item [???] 81,497 ( 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_impl_item 81,495 ( 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/tls.rs:::check_fn 81,466 ( 0.00%) ???:>::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] 81,446 ( 0.00%) ???:::fully_perform_op::>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 81,321 ( 0.00%) ???:::parse_generics [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 81,303 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/decimal_bitwise_operands.rs:clippy_lints::operators::decimal_bitwise_operands::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 81,246 ( 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:>::walk_ref 81,210 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:clippy_utils::hir_utils::reduce_exprkind [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 81,202 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/visitors.rs:rustc_hir::intravisit::walk_block::::{closure#0}>>'2 81,100 ( 0.00%) ???:>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 81,082 ( 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/tls.rs:::check_fn 81,068 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cmp.rs:::visit_expr'2 81,017 ( 0.00%) /rust/deps/hashbrown-0.17.0/src/raw.rs:>::insert::::{closure#0}> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 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,877 ( 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] 80,819 ( 0.00%) ???:>::walk_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 80,758 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/nonstandard_macro_braces.rs:::check_stmt [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 80,563 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 80,545 ( 0.00%) ???:core::slice::sort::stable::drift::sort::::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] 80,373 ( 0.00%) ???:rustc_resolve::rustdoc::parse_links [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 80,370 ( 0.00%) ???:::stable_hash::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 80,330 ( 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::is_assert_arg 80,316 ( 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:::check_local 80,314 ( 0.00%) /rust/deps/hashbrown-0.17.0/src/control/tag.rs:>::entry::::{closure#0}, indexmap::inner::get_hash::{closure#0}> 80,314 ( 0.00%) ???:::instantiate_into'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 80,177 ( 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 80,120 ( 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:::trim_end_matches::<::is_whitespace> 79,979 ( 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:>::cat_expr_unadjusted [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 79,970 ( 0.00%) ???:rustc_builtin_macros::deriving::clone::expand_deriving_clone::{closure#2} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 79,936 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/raw.rs:)>>::remove_entry::>::{closure#0}> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 79,888 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/lifetimes.rs:::visit_poly_trait_ref [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 79,855 ( 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:>::get:: 79,725 ( 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:>::reserve_rehash::::{closure#0}> 79,660 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::dep_graph::graph::DepNodeIndex>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 79,655 ( 0.00%) include/jemalloc/internal/tsd.h:free_default 79,616 ( 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_block 79,439 ( 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:: 79,439 ( 0.00%) ???:rustc_hir::intravisit::walk_block::'2 [???] 79,406 ( 0.00%) ???:<[rustc_errors::SubstitutionPart]>::sort_by_key::::emit_messages_default::{closure#6}::{closure#0}>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 79,392 ( 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::lifetimes::could_use_elision 79,372 ( 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] 79,286 ( 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:::check_expr 79,189 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:clippy_lints::question_mark::is_early_return [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 79,177 ( 0.00%) ???:>>::drop_slow [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 79,163 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_expr_default [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 79,127 ( 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:::get::{closure#0}> as rustc_hir::intravisit::Visitor>::visit_expr'2 79,038 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/mut_visit.rs:>::walk_mut'2 78,957 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_lints::matches::collapsible_match::check_arm 78,914 ( 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:clippy_utils::is_in_test 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,870 ( 0.00%) ???:>::insert [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 78,868 ( 0.00%) ???:>>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 78,858 ( 0.00%) ???:>>::from [???] 78,830 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::all_spans_after_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 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,768 ( 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: as rustc_hir::intravisit::Visitor>::visit_expr'2 78,734 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lexer/src/lib.rs:::check_expr::{closure#0} 78,604 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:clippy_lints::lifetimes::could_use_elision 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,545 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_ty_alias [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 78,412 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::eq_expr 78,338 ( 0.00%) ???:::lower_expr_mut::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 78,207 ( 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 78,207 ( 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 78,207 ( 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 78,207 ( 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 78,207 ( 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 78,207 ( 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 78,123 ( 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_lints::casts::borrow_as_ptr::check_implicit_cast 78,022 ( 0.00%) include/jemalloc/internal/ph.h:realloc 77,969 ( 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:clippy_lints::doc::check_doc::> 77,858 ( 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_item_kind 77,837 ( 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] 77,760 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/char/mod.rs:::fold::<(), core::iter::traits::iterator::Iterator::for_each::call>::extend::{closure#0}>::{closure#0}> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 77,658 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/derive/derive_ord_xor_partial_ord.rs:clippy_lints::derive::derive_ord_xor_partial_ord::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 77,643 ( 0.00%) ???:::candidate_from_obligation_no_cache'2 [???] 77,490 ( 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::::{closure#0}>>'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 77,216 ( 0.00%) /rust/deps/hashbrown-0.17.0/src/raw.rs:>::reserve_rehash::::{closure#0}> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 77,179 ( 0.00%) ???:::res:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 77,088 ( 0.00%) ???:write [/usr/lib/libc.so.6] 76,968 ( 0.00%) ???:::visit_assoc_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 76,950 ( 0.00%) ???:rustc_query_impl::query_impl::attrs_for_def::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 76,881 ( 0.00%) ???:>::relate:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 76,780 ( 0.00%) ???:>)>>, ::encode_impls::{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] 76,774 ( 0.00%) ???:::meta_item_list [???] 76,706 ( 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> 76,706 ( 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> 76,577 ( 0.00%) ???:::hir_get_fn_output [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 76,549 ( 0.00%) ???:thin_vec::drop_non_singleton::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 76,408 ( 0.00%) ???:::visit_pat'2 [???] 76,375 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::implements_trait [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 76,360 ( 0.00%) ???:rustc_builtin_macros::edition_panic::expand [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 76,325 ( 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.rs:::instantiate_bound_regions_with_erased::> 76,316 ( 0.00%) include/jemalloc/internal/pai.h:tcache_bin_flush_small 76,316 ( 0.00%) src/pa.c:tcache_bin_flush_small 76,228 ( 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] 76,075 ( 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_local 75,963 ( 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_attribute 75,963 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check_crate [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 75,790 ( 0.00%) ???: 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] 75,694 ( 0.00%) ???:<[rustc_errors::SubstitutionPart]>::sort_by_key::::emit_messages_default::{closure#6}::{closure#0}>::{closure#0}'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 75,631 ( 0.00%) ???:::lower_expr_mut::{closure#0}'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 75,516 ( 0.00%) src/extent_dss.c:ecache_evict 75,503 ( 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::never_loop::never_loop_block'2 75,478 ( 0.00%) ???:::check_item_post [???] 75,406 ( 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, clippy_lints::loops::never_loop::all_spans_after_expr::{closure#0}>, clippy_lints::loops::never_loop::stmt_source_span>, core::option::IntoIter>>>::from_iter [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 75,403 ( 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_ty:: 75,132 ( 0.00%) /rust/deps/hashbrown-0.17.0/src/raw.rs:::find_insert_index [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 75,126 ( 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_lints::functions::must_use::check_impl_item 75,116 ( 0.00%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 75,074 ( 0.00%) ???:pulldown_cmark::parse::body_to_tag_end [???] 75,059 ( 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::method_chain_args 74,944 ( 0.00%) include/jemalloc/internal/ehooks.h:pa_alloc 74,940 ( 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_item 74,940 ( 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_item_post 74,908 ( 0.00%) ???:>::walk_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 74,900 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:::search_pat [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 74,804 ( 0.00%) ???:::visit_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 74,789 ( 0.00%) ???:::visit_param_bound [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 74,789 ( 0.00%) ???:::visit_param_bound [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 74,789 ( 0.00%) ???:::visit_param_bound [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 74,785 ( 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/vec_cache.rs:::check_impl_item 74,722 ( 0.00%) ???:::print_ident [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 74,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: as core::iter::traits::collect::Extend>::extend::>> 74,470 ( 0.00%) ???:::parse_meta_item'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 74,454 ( 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:>::with::::data::{closure#0}>::{closure#0}, rustc_span::SpanData> 74,454 ( 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:>::with::::data::{closure#0}>::{closure#0}, rustc_span::SpanData> 74,454 ( 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:>::with::::data::{closure#0}>::{closure#0}, rustc_span::SpanData> 74,454 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:>::with::::data::{closure#0}>::{closure#0}, rustc_span::SpanData> 74,448 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/raw.rs:clippy_lints::casts::needless_type_cast::check 74,248 ( 0.00%) ???:rustc_builtin_macros::assert::expand_assert [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 74,178 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/mut_visit.rs:>::walk_mut 74,107 ( 0.00%) ???: as rustc_ast::visit::Visitor>::visit_use_tree'2 [???] 74,096 ( 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:::clone [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 74,088 ( 0.00%) ???:::integer [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 74,076 ( 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] 74,036 ( 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:>::get_mut:: 74,036 ( 0.00%) /rust/deps/hashbrown-0.17.0/src/raw.rs:>::get_mut:: 73,998 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/combined_early_pass.rs:::check_impl_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 73,948 ( 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_lints::lifetimes::could_use_elision 73,939 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::hash_expr'2 73,846 ( 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:::qpath 73,833 ( 0.00%) ???:rustc_query_impl::query_impl::resolve_instance_raw::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 73,723 ( 0.00%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 73,710 ( 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:>::retain::<>::multipart_suggestion_with_style<&str>::{closure#0}>::{closure#0} 73,664 ( 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] 73,601 ( 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_item_kind::{closure#0}>, ::check_item_kind::{closure#1}>, core::option::Option> as core::iter::traits::iterator::Iterator>::next 73,584 ( 0.00%) ???:::emit_messages_default [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 73,540 ( 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] 73,531 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:clippy_lints::functions::duplicate_underscore_argument::check 73,440 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/methods/chars_last_cmp.rs:::check_expr 73,336 ( 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:>::make_code_span 73,204 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/lifetimes.rs:clippy_lints::lifetimes::non_elidable_self_type [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 73,167 ( 0.00%) ???:::pop [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 73,161 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 73,139 ( 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 73,124 ( 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] 73,042 ( 0.00%) /rust/deps/hashbrown-0.17.0/src/raw.rs:::instantiate_bound_regions_with_erased::> 73,023 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/res.rs:clippy_utils::is_none_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 73,007 ( 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:rustc_hir::intravisit::walk_expr::>'2 72,814 ( 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::> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 72,814 ( 0.00%) ???:rustc_query_impl::query_impl::try_normalize_generic_arg_after_erasing_regions::execute_query_incr::__rust_end_short_backtrace [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 72,792 ( 0.00%) ???:)>>::reserve_rehash::, core::hash::BuildHasherDefault>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 72,736 ( 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 72,715 ( 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::::get::{closure#0}>> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 72,695 ( 0.00%) ???:::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] 72,643 ( 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 72,643 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:>::swap_remove:: 72,590 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/collect.rs:::check_item_kind 72,583 ( 0.00%) ???:::encode_alloc_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 72,559 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/bool.rs:::def_key:: 72,559 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cmp.rs:::def_key:: 72,395 ( 0.00%) ???:>::insert_full [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 72,383 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/types/type_complexity.rs:::check_ty 72,381 ( 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:::check_ty 72,374 ( 0.00%) include/jemalloc/internal/ticker.h:tcache_bin_flush_small 72,248 ( 0.00%) include/jemalloc/internal/cache_bin.h:calloc 72,247 ( 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_lints::functions::duplicate_underscore_argument::check 72,190 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 72,180 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/unnested_or_patterns.rs:::check_arm 72,152 ( 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 72,132 ( 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 72,110 ( 0.00%) ???:::fresh_empty [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 72,096 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 71,949 ( 0.00%) ???:::visit_attribute [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 71,896 ( 0.00%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 71,832 ( 0.00%) ???:>::reserve_rehash::>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 71,817 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/res.rs:::check_expr 71,790 ( 0.00%) ???:>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 71,737 ( 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}>> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 71,729 ( 0.00%) ???:, rustc_resolve::Used)>>::reserve_rehash::, rustc_resolve::Used, rustc_hash::FxBuildHasher>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 71,728 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/res.rs:clippy_lints::methods::io_other_error::check 71,721 ( 0.00%) ???:rustc_attr_parsing::attributes::cfg::eval_config_entry [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 71,680 ( 0.00%) ???:::opt_span_lint:: [???] 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,638 ( 0.00%) ???:rustc_builtin_macros::deriving::clone::cs_clone::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 71,597 ( 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 71,596 ( 0.00%) ???:::opt_item_name [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 71,564 ( 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 71,564 ( 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] 71,547 ( 0.00%) ???:core::ptr::drop_glue::>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 71,525 ( 0.00%) ???:::start_point'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 71,450 ( 0.00%) /rust/deps/hashbrown-0.17.0/src/raw.rs:>::insert_full 71,413 ( 0.00%) include/jemalloc/internal/jemalloc_internal_inlines_b.h:tcache_bin_flush_small 71,383 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/types/mod.rs:::check_impl_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 71,361 ( 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'2 71,360 ( 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_body 71,329 ( 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::ty::get_field_def_id_by_name 71,315 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/non_copy_const.rs:::check_impl_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 71,076 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::visit_pat 71,027 ( 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] 71,023 ( 0.00%) ???:rustc_hir_analysis::coherence::inherent_impls::crate_inherent_impls'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 70,997 ( 0.00%) ???:std::sys::fs::metadata [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 70,973 ( 0.00%) include/jemalloc/internal/mutex.h:pa_dalloc 70,950 ( 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] 70,897 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ops/control_flow.rs: 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} 70,846 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/attrs/mod.rs:::check_impl_item 70,758 ( 0.00%) ???:rustc_query_impl::plumbing::encode_query_values_inner::>, core::option::Option>::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 70,755 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/dep_graph/graph.rs:clippy_utils::trait_ref_of_method 70,755 ( 0.00%) ???:rustc_middle::verify_ich::incremental_verify_ich::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 70,562 ( 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::> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 70,545 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/fmt/mod.rs:<&str as core::fmt::Display>::fmt [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 70,475 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/invalid_upcast_comparisons.rs:::check_expr 70,413 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/range.rs:::check_fn 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,354 ( 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::lifetimes::could_use_elision 70,210 ( 0.00%) /rust/deps/hashbrown-0.17.0/src/raw.rs:>::insert_full 70,169 ( 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:::expr'2 70,140 ( 0.00%) ???:::{closure#1} as core::ops::function::FnOnce<(rustc_middle::ty::context::TyCtxt, rustc_middle::dep_graph::dep_node::DepNode, rustc_middle::dep_graph::serialized::SerializedDepNodeIndex, rustc_middle::dep_graph::graph::DepNodeIndex)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 70,134 ( 0.00%) ???:::resolve_const_item_rhs [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 70,132 ( 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] 70,085 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::visit_block [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 70,035 ( 0.00%) ???:>::reserve_rehash::>::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 70,027 ( 0.00%) ???:::typeck_root_def_id_local'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 69,968 ( 0.00%) ???:::assoc_parent [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 69,948 ( 0.00%) ???:rustc_lint::unused::must_use::is_ty_must_use'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 69,848 ( 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_item 69,740 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/functions/must_use.rs:clippy_lints::functions::must_use::check_trait_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 69,720 ( 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:>::dying_next [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 69,691 ( 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,540 ( 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] 69,499 ( 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:::clone'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 69,444 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:>::reserve::do_reserve_and_handle:: 69,417 ( 0.00%) ???:::instantiate_value_path [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 69,356 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/methods/implicit_clone.rs:clippy_lints::methods::implicit_clone::is_clone_like [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 69,305 ( 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_ctxt 69,266 ( 0.00%) ???:::end [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 69,248 ( 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: as alloc::vec::spec_from_iter_nested::SpecFromIterNested, clippy_lints::manual_clamp::block_stmt_with_last::{closure#0}>, core::option::IntoIter>, (clippy_lints::manual_clamp::MaybeBorrowedStmtKind, clippy_lints::manual_clamp::MaybeBorrowedStmtKind)>, clippy_lints::manual_clamp::is_two_if_pattern::{closure#0}>>>::from_iter 69,182 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/take_while.rs: 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} [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 69,125 ( 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_item_kind 69,079 ( 0.00%) ???:rustc_ty_utils::instance::resolve_instance_raw [???] 68,989 ( 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_utils::get_expr_use_or_unification_node 68,931 ( 0.00%) ???:::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 68,862 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/nonstandard_macro_braces.rs:::check_mac [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 68,823 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/write/mod.rs:::check_item 68,781 ( 0.00%) ???:)>>::call_once'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 68,701 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/visitors.rs:rustc_hir::intravisit::walk_arm::> 68,653 ( 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:rustc_hir::intravisit::walk_expr::>'2 68,623 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/slice.rs:clippy_lints::loops::never_loop::never_loop_block'2 68,553 ( 0.00%) ???:::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 68,541 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/dereference.rs:::check_item 68,513 ( 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:::check_body 68,404 ( 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:clippy_lints::loops::never_loop::never_loop_block'2 68,381 ( 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/vec_cache.rs:::impl_trait_ref:: 68,329 ( 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:<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::Ty> as rustc_type_ir::fold::TypeFoldable>::fold_with::> 68,217 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/manual_ignore_case_cmp.rs:clippy_lints::manual_ignore_case_cmp::get_ascii_type [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 68,015 ( 0.00%) ???:>::swap_remove:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 67,932 ( 0.00%) ???:>>, core::iter::adapters::map::Map, ::create_derived_impl::{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] 67,860 ( 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:::check_expr::{closure#0} 67,849 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/redundant_static_lifetimes.rs:::check_item 67,840 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/hir/map.rs:clippy_utils::is_else_clause 67,826 ( 0.00%) ???:isatty [/usr/lib/libc.so.6] 67,808 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/maybe_uninit.rs:::check_expr 67,802 ( 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/vec_cache.rs:clippy_utils::test_item_names 67,761 ( 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::doc::check_doc::> 67,715 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 67,701 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 67,695 ( 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] 67,627 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/visitors.rs:rustc_hir::intravisit::walk_block::::check::{closure#0}>>'2 67,624 ( 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 67,610 ( 0.00%) 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] 67,560 ( 0.00%) ???:::get_or_insert [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 67,550 ( 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::macros::is_assert_arg 67,372 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::eq 67,311 ( 0.00%) ???:>::grow_one [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 67,248 ( 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:::visit_poly_trait_ref 67,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/mod.rs:::get::{closure#0}> as rustc_hir::intravisit::Visitor>::visit_expr'2 67,185 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 66,970 ( 0.00%) ???:>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 66,940 ( 0.00%) ???:<[(rustc_middle::ty::predicate::Clause, rustc_span::span_encoding::Span)] 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] 66,914 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/unwrap.rs:::visit_branch'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 66,910 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/def.rs:clippy_lints::methods::clone_on_copy::check_function 66,910 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/def.rs:clippy_lints::methods::unnecessary_fallible_conversions::check_function 66,820 ( 0.00%) ???:::visit_trait_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 66,813 ( 0.00%) ???:::get_module [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 66,799 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::, rustc_middle::dep_graph::graph::DepNodeIndex>, true> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 66,769 ( 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,740 ( 0.00%) ???:core::ptr::drop_glue::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 66,731 ( 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 66,624 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/collapsible_if.rs:::check_collapsible_if_if [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 66,620 ( 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:rustc_hir::intravisit::walk_expr::::{closure#0}>>'2 66,554 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 66,520 ( 0.00%) ???:::with_rib::<(), ::with_constant_rib<::resolve_anon_const_manual<::resolve_anon_const::{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] 66,511 ( 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::::check::{closure#0}>> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 66,425 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/operators/manual_isolate_lowest_one.rs:clippy_lints::operators::manual_isolate_lowest_one::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 66,420 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/definitions.rs:::opt_item_name:: 66,412 ( 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_block 66,372 ( 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: as alloc::vec::spec_from_iter_nested::SpecFromIterNested<&rustc_hir::hir::Expr, core::iter::adapters::chain::Chain, core::slice::iter::Iter>>>::from_iter 66,356 ( 0.00%) ???:::check_generic_param [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 66,331 ( 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] 66,248 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/len_without_is_empty.rs:::check_impl_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 66,194 ( 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 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 66,055 ( 0.00%) ???:rustc_query_impl::query_impl::associated_types_for_impl_traits_in_trait_or_impl::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] 65,993 ( 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] 65,910 ( 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_single_char_names 65,904 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/cmp.rs:::visit_pat'2 65,782 ( 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_attributes 65,780 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::is_format_macro [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 65,730 ( 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/adt.rs:::check_ty_ 65,706 ( 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 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 65,688 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/hir/map.rs:::hir 65,682 ( 0.00%) ???:::span_to_lines [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 65,626 ( 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:::visit_block'2 65,572 ( 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:clippy_utils::source::with_leading_whitespace 65,534 ( 0.00%) ???:rustc_expand::mbe::macro_check::check_binders'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 65,454 ( 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, core::slice::iter::Iter>>, clippy_lints::ptr::ptr_arg::check_fn_args::{closure#0}>, clippy_lints::ptr::ptr_arg::check_body::{closure#0}>>>::from_iter [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 65,376 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/returns/mod.rs:::check_block 65,304 ( 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:>::with::<::with::outer_expn_data::{closure#0}>::{closure#0}, rustc_span::hygiene::ExpnData> 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,196 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/dep_graph/graph.rs:::check_fn 65,058 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/../../stdarch/crates/core_arch/src/x86/sse2.rs:>::swap_remove:: 64,920 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/macros.rs: as rustc_hir::intravisit::Visitor>::visit_expr'2 64,896 ( 0.00%) ???:rustc_ty_utils::representability::params_in_repr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 64,820 ( 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::> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 64,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:clippy_lints::doc::missing_headers::check 64,706 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/query/caches.rs:::check_expr 64,666 ( 0.00%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 64,629 ( 0.00%) /rust/deps/hashbrown-0.17.0/src/control/bitmask.rs:, rustc_type_ir::sty::Region>>::new 64,609 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/ifs/branches_sharing_code.rs:clippy_lints::ifs::branches_sharing_code::check_match [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 64,586 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 64,552 ( 0.00%) ???:>::complete::>> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 64,439 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/count.rs:clippy_lints::doc::check_doc::> 64,372 ( 0.00%) ???:std::string::_Rep::_M_refdata() [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 64,292 ( 0.00%) ???:rustc_query_impl::execution::try_execute_query::>, true>'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 64,260 ( 0.00%) ???:rustc_ast::mut_visit::walk_flat_map_stmt:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 64,249 ( 0.00%) ???:rustc_borrowck::type_check::type_check [???] 64,227 ( 0.00%) ???:rustc_query_impl::query_impl::param_env_normalized_for_post_analysis::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] 64,224 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/control/tag.rs:::check_body 64,220 ( 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:::emit_lint_if_under_msrv 64,155 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/control/bitmask.rs:::check_pat 64,099 ( 0.00%) ???:::opt_field_index [???] 64,012 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:::check_expr 63,970 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::visit_arm'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 63,899 ( 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_lints::misc_early::unneeded_field_pattern::check 63,860 ( 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::::expr_usage_requires_vec::{closure#0}, ()>>'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 63,788 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/raw.rs:>::insert 63,777 ( 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] 63,726 ( 0.00%) ???:<&usize as core::fmt::Display>::fmt'2 [/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,711 ( 0.00%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 63,708 ( 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/vec_cache.rs:clippy_lints::functions::result::result_err_ty 63,490 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/escape.rs:, ::check_fn::{closure#0}>, as core::iter::traits::collect::FromIterator>::from_iter, ::check_fn::{closure#0}>>::{closure#0}> as core::iter::traits::iterator::Iterator>::fold::<(), core::iter::traits::iterator::Iterator::for_each::call<(rustc_hir_id::HirId, ()), as core::iter::traits::collect::Extend<(rustc_hir_id::HirId, ())>>::extend, ::check_fn::{closure#0}>, as core::iter::traits::collect::FromIterator>::from_iter, ::check_fn::{closure#0}>>::{closure#0}>>::{closure#0}>::{closure#0}> 63,392 ( 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:::check_stmt 63,392 ( 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:::check_stmt [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 63,353 ( 0.00%) ???:>>::walk_ref [???] 63,346 ( 0.00%) ???:::visit_nested_item [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 63,328 ( 0.00%) ???:::parent_callsite [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 63,288 ( 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] 63,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:rustc_hir::intravisit::walk_arm::> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 63,212 ( 0.00%) include/jemalloc/internal/jemalloc_internal_inlines_b.h:realloc 63,054 ( 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:::check_pat 63,025 ( 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:rustc_hir::intravisit::walk_block::>'2 62,952 ( 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 62,930 ( 0.00%) src/sz.c:ecache_evict 62,928 ( 0.00%) ???:::lower_lit [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 62,876 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/hir/map.rs:::check_fn 62,846 ( 0.00%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/definitions.rs:::def_key:: 62,550 ( 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 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 62,529 ( 0.00%) site/frontend/rust-clippy/clippy_utils/src/res.rs:clippy_utils::ty::expr_sig 62,415 ( 0.00%) ???:rustc_builtin_macros::deriving::clone::expand_deriving_clone [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 62,220 ( 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:::check_item_kind 62,202 ( 0.00%) ???: as rustc_hir::intravisit::Visitor>::visit_poly_trait_ref [???] 62,184 ( 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 62,116 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/matches/match_wild_enum.rs: as alloc::vec::spec_from_iter_nested::SpecFromIterNested<&rustc_middle::ty::VariantDef, core::iter::adapters::filter::Filter, clippy_lints::matches::match_wild_enum::check::{closure#1}>>>::from_iter 62,098 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/methods/should_implement_trait.rs:clippy_lints::methods::should_implement_trait::check_impl_item [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 62,036 ( 0.00%) /rust/deps/thin-vec-0.2.19/src/lib.rs:core::ptr::drop_glue:: 62,020 ( 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_stmt 62,016 ( 0.00%) ???:::from_token [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 61,990 ( 0.00%) ???:>::find_cycles_from_node:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 61,952 ( 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:::check_block 61,939 ( 0.00%) ???:::drop [???] 61,902 ( 0.00%) ???:::make_canonicalized_query_response::<()> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 61,880 ( 0.00%) ???:>::compress::<>::to_errors::{closure#2}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 61,854 ( 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_ty 61,850 ( 0.00%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 61,680 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/types/mod.rs:::check_local 61,665 ( 0.00%) site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs:::check_impl_item_post [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 61,590 ( 0.00%) ???: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] 61,512 ( 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:>::retain::<>::multipart_suggestion_with_style<&str>::{closure#0}>::{closure#0} 61,466 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/raw.rs:, pulldown_cmark::parse::LinkDef)> as core::ops::drop::Drop>::drop [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 61,464 ( 0.00%) ???:>::size_and_align_from_meta [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 61,434 ( 0.00%) /rust/deps/hashbrown-0.17.1/src/raw.rs:, pulldown_cmark::parse::FootnoteDef)> as core::ops::drop::Drop>::drop [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] -------------------------------------------------------------------------------- -- 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; . 1,151,185 ( 0.01%) pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 2,170 ( 0.00%) if let Some(higher::WhileLet { if_then, let_pat, let_expr, label, .. }) = higher::WhileLet::hir(expr) . // check for `Some(..)` pattern 1,302 ( 0.00%) && let Some(some_pat) = as_some_pattern(cx, let_pat) 92,442 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::as_some_pattern (434x) . // check for call to `Iterator::next` 1,752 ( 0.00%) && let ExprKind::MethodCall(method_name, iter_expr, [], _) = let_expr.kind 24 ( 0.00%) && 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) . // get the loop containing the match expression . && !uses_iter(cx, &iter_expr_struct, if_then) . { . let mut applicability = Applicability::MachineApplicable; . . let loop_label = label.map_or(String::new(), |l| format!("{}: ", l.ident.name)); -- line 33 ---------------------------------------- -- 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, . ); . } 1,315,640 ( 0.01%) } . . #[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: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/mod.rs -------------------------------------------------------------------------------- Ir -- line 144 ---------------------------------------- . pub(crate) struct GenericShunt<'a, I, R> { . iter: I, . residual: &'a mut Option, . } . . /// Process the given iterator as if it yielded the item's `Try::Output` . /// type instead. Any `Try::Residual`s encountered will stop the inner iterator . /// and be propagated back to the overall result. 2,544 ( 0.00%) pub(crate) fn try_process(iter: I, mut f: F) -> ChangeOutputType . where . I: Iterator>, . for<'a> F: FnMut(GenericShunt<'a, I, R>) -> U, . R: Residual, . { . // FIXME(#11084): we might be able to get rid of GenericShunt in favor of . // Iterator::scan, as performance should be comparable . 10,881 ( 0.00%) let mut residual = None; . let shunt = GenericShunt { iter, residual: &mut residual }; . let value = f(shunt); 21,762 ( 0.00%) match residual { . Some(r) => FromResidual::from_residual(r), 31,379 ( 0.00%) None => Try::from_output(value), . } 2,968 ( 0.00%) } . . impl Iterator for GenericShunt<'_, I, R> . where . I: Iterator>, . { . type Item = ::Output; . 187,292 ( 0.00%) fn next(&mut self) -> Option { . self.try_for_each(ControlFlow::Break).break_value() 168,629 ( 0.00%) } . . fn size_hint(&self) -> (usize, Option) { . if self.residual.is_some() { . (0, Some(0)) . } else { . let (_, upper) = self.iter.size_hint(); . (0, upper) . } -- line 186 ---------------------------------------- -- line 187 ---------------------------------------- . } . . fn try_fold(&mut self, init: B, mut f: F) -> T . where . F: FnMut(B, Self::Item) -> T, . T: Try, . { . self.iter 157 ( 0.00%) .try_fold(init, |acc, x| match Try::branch(x) { . ControlFlow::Continue(x) => ControlFlow::from_try(f(acc, x)), . ControlFlow::Break(r) => { 459 ( 0.00%) *self.residual = Some(r); . ControlFlow::Break(try { acc }) 30 ( 0.00%) } . }) . .into_try() . } . . impl_fold_via_try_fold! { fold -> try_fold } . } . . #[unstable(issue = "none", feature = "inplace_iteration")] -- line 208 ---------------------------------------- 461 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/operators/absurd_extreme_comparisons.rs -------------------------------------------------------------------------------- Ir -- line 6 ---------------------------------------- . use clippy_utils::consts::{ConstEvalCtxt, Constant}; . use clippy_utils::diagnostics::span_lint_and_help; . use clippy_utils::source::snippet; . use clippy_utils::ty::is_isize_or_usize; . use clippy_utils::{clip, int_bits, unsext}; . . use super::ABSURD_EXTREME_COMPARISONS; . 31,568 ( 0.00%) pub(super) fn check<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'_>, . op: BinOpKind, . lhs: &'tcx Expr<'_>, . rhs: &'tcx Expr<'_>, . ) { 11,838 ( 0.00%) if let Some((culprit, result)) = detect_absurd_comparison(cx, op, lhs, rhs) { . let msg = "this comparison involving the minimum or maximum element for this \ . type contains a case that is always true or always false"; . . let conclusion = match result { . AbsurdComparisonResult::AlwaysFalse => "this comparison is always false".to_owned(), . AbsurdComparisonResult::AlwaysTrue => "this comparison is always true".to_owned(), . AbsurdComparisonResult::InequalityImpossible => format!( . "the case where the two sides are not equal never occurs, consider using `{} == {}` \ -- line 29 ---------------------------------------- -- line 39 ---------------------------------------- . match culprit.which { . ExtremeType::Minimum => "minimum", . ExtremeType::Maximum => "maximum", . } . ); . . span_lint_and_help(cx, ABSURD_EXTREME_COMPARISONS, expr.span, msg, None, help); . } 31,568 ( 0.00%) } . . enum ExtremeType { . Minimum, . Maximum, . } . . struct ExtremeExpr<'a> { . which: ExtremeType, -- line 55 ---------------------------------------- -- line 58 ---------------------------------------- . . enum AbsurdComparisonResult { . AlwaysFalse, . AlwaysTrue, . InequalityImpossible, . } . . fn is_cast_between_fixed_and_target<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) -> bool { 14,935 ( 0.00%) if let ExprKind::Cast(cast_exp, _) = expr.kind { 159 ( 0.00%) let precast_ty = cx.typeck_results().expr_ty(cast_exp); 2,120 ( 0.00%) => ???:::expr_ty (53x) 159 ( 0.00%) let cast_ty = cx.typeck_results().expr_ty(expr); 2,132 ( 0.00%) => ???:::expr_ty (53x) . 126 ( 0.00%) return is_isize_or_usize(precast_ty) != is_isize_or_usize(cast_ty); . } . . false . } . . fn detect_absurd_comparison<'tcx>( . cx: &LateContext<'tcx>, . op: BinOpKind, . lhs: &'tcx Expr<'_>, . rhs: &'tcx Expr<'_>, . ) -> Option<(ExtremeExpr<'tcx>, AbsurdComparisonResult)> { . use AbsurdComparisonResult::{AlwaysFalse, AlwaysTrue, InequalityImpossible}; . use ExtremeType::{Maximum, Minimum}; . // absurd comparison only makes sense on primitive types . // primitive types don't implement comparison operators with each other 43,406 ( 0.00%) if cx.typeck_results().expr_ty(lhs) != cx.typeck_results().expr_ty(rhs) { 315,884 ( 0.00%) => ???:::expr_ty (7,892x) . return None; . } . . // comparisons between fix sized types and target sized types are considered unanalyzable 85 ( 0.00%) if is_cast_between_fixed_and_target(cx, lhs) || is_cast_between_fixed_and_target(cx, rhs) { . return None; . } . . let (rel, normalized_lhs, normalized_rhs) = normalize_comparison(op, lhs, rhs)?; . 9,779 ( 0.00%) let lx = detect_extreme_expr(cx, normalized_lhs); 1,712,829 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/operators/absurd_extreme_comparisons.rs:clippy_lints::operators::absurd_extreme_comparisons::detect_extreme_expr (2,811x) 10,469 ( 0.00%) let rx = detect_extreme_expr(cx, normalized_rhs); 900,612 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/operators/absurd_extreme_comparisons.rs:clippy_lints::operators::absurd_extreme_comparisons::detect_extreme_expr (2,811x) . . Some(match rel { . Rel::Lt => { 1,224 ( 0.00%) match (lx, rx) { . (Some(l @ ExtremeExpr { which: Maximum, .. }), _) => (l, AlwaysFalse), // max < x . (_, Some(r @ ExtremeExpr { which: Minimum, .. })) => (r, AlwaysFalse), // x < min . _ => return None, . } . }, . Rel::Le => { 4,568 ( 0.00%) match (lx, rx) { . (Some(l @ ExtremeExpr { which: Minimum, .. }), _) => (l, AlwaysTrue), // min <= x . (Some(l @ ExtremeExpr { which: Maximum, .. }), _) => (l, InequalityImpossible), // max <= x . (_, Some(r @ ExtremeExpr { which: Minimum, .. })) => (r, InequalityImpossible), // x <= min . (_, Some(r @ ExtremeExpr { which: Maximum, .. })) => (r, AlwaysTrue), // x <= max . _ => return None, . } . }, . Rel::Ne | Rel::Eq => return None, . }) . } . 44,976 ( 0.00%) fn detect_extreme_expr<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) -> Option> { 11,244 ( 0.00%) let ty = cx.typeck_results().expr_ty(expr); 224,964 ( 0.00%) => ???:::expr_ty (5,622x) . 39,354 ( 0.00%) let cv = ConstEvalCtxt::new(cx).eval(expr)?; 1,773,386 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval (5,622x) 314,832 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::new (5,622x) . 23,302 ( 0.00%) let which = match (ty.kind(), cv) { . (&ty::Bool, Constant::Bool(false)) | (&ty::Uint(_), Constant::Int(0)) => ExtremeType::Minimum, 1,625 ( 0.00%) (&ty::Int(ity), Constant::Int(i)) if i == unsext(cx.tcx, i128::MIN >> (128 - int_bits(cx.tcx, ity)), ity) => { 1,300 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::clip (65x) 585 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::int_bits (65x) . ExtremeType::Minimum . }, . . (&ty::Bool, Constant::Bool(true)) => ExtremeType::Maximum, 1,365 ( 0.00%) (&ty::Int(ity), Constant::Int(i)) if i == unsext(cx.tcx, i128::MAX >> (128 - int_bits(cx.tcx, ity)), ity) => { 1,300 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::clip (65x) 585 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::int_bits (65x) . ExtremeType::Maximum . }, 7,620 ( 0.00%) (&ty::Uint(uty), Constant::Int(i)) if clip(cx.tcx, u128::MAX, uty) == i => ExtremeType::Maximum, 20,828 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::clip (762x) . . _ => return None, . }; . Some(ExtremeExpr { which, expr }) 50,598 ( 0.00%) } 24,195 ( 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/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(); 35,053 ( 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; 24 ( 0.00%) while idx < len { . // SAFETY: idx < len, so both are in-bounds and readable 36 ( 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); 2,362,587 ( 0.02%) compare_bytes(lhs as _, rhs as _, size) == 0 26,582 ( 0.00%) => ???:0x0000000000173660 (2,103x) . } . } . } . . #[doc(hidden)] . #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] . // intermediate trait for specialization of slice's PartialOrd . const trait SlicePartialOrd: Sized { -- line 165 ---------------------------------------- -- line 382 ---------------------------------------- . fn slice_contains(&self, x: &[Self]) -> bool; . } . . impl SliceContains for T . where . T: PartialEq, . { . default fn slice_contains(&self, x: &[Self]) -> bool { 36 ( 0.00%) x.iter().any(|y| *y == *self) 16 ( 0.00%) } . } . . impl SliceContains for T { . #[inline] . fn slice_contains(&self, x: &[Self]) -> bool { . // SAFETY: `UnsignedBytewiseOrd` guarantees that `Self` has the same . // layout as `u8` and is initialized, so both the value and slice can . // be read as bytes. -- line 399 ---------------------------------------- -- line 429 ---------------------------------------- . // SIMD . let mut chunks = arr.chunks_exact(LANE_COUNT); . for chunk in &mut chunks { . if chunk.iter().fold(false, |acc, x| acc | (*x == *self)) { . return true; . } . } . // Scalar remainder 740 ( 0.00%) return chunks.remainder().iter().any(|x| *x == *self); . } . } . )* . }; . } . . impl_slice_contains!(u16, u32, u64, i16, i32, i64, f32, f64, usize, isize, char); 320,999 ( 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; . 36,502 ( 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; 91,255 ( 0.00%) while let Some(parent) = get_parent_expr(cx, expr) 2,388,267 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (18,251x) 12,940 ( 0.00%) && let ExprKind::Call(recv, _) = parent.kind . && expr.span == recv.span . { . expr = parent; . depth += 1; . } . (expr, depth) . } . . impl<'tcx> LateLintPass<'tcx> for RedundantClosureCall { 1,937,824 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>) { 1,330,644 ( 0.01%) if expr.span.in_external_macro(cx.sess().source_map()) { . return; . } . 18,251 ( 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. 36,502 ( 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!()`. 36,502 ( 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); . } . }, . ); . } 1,937,824 ( 0.02%) } . 152,544 ( 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>, . count: usize, . } . impl<'tcx> Visitor<'tcx> for ClosureUsageCount<'_, 'tcx> { . type NestedFilter = nested_filter::OnlyBodies; . 270 ( 0.00%) fn visit_expr(&mut self, expr: &'tcx hir::Expr<'tcx>) { 112 ( 0.00%) if let ExprKind::Call(closure, _) = expr.kind 16 ( 0.00%) && let ExprKind::Path(hir::QPath::Resolved(_, path)) = closure.kind 28 ( 0.00%) && self.path.segments[0].ident == path.segments[0].ident 40 ( 0.00%) && self.path.res == path.res 76 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/def.rs:::eq (4x) . { 4 ( 0.00%) self.count += 1; . } 324 ( 0.00%) hir_visit::walk_expr(self, expr); 4,851 ( 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_block::count_closure_usage::ClosureUsageCount> (5x) . } . . fn maybe_tcx(&mut self) -> Self::MaybeTyCtxt { 1 ( 0.00%) self.cx.tcx . } . } 3 ( 0.00%) let mut closure_usage_count = ClosureUsageCount { cx, path, count: 0 }; . closure_usage_count.visit_block(block); . closure_usage_count.count . } . 28,836 ( 0.00%) for w in block.stmts.windows(2) { 54,356 ( 0.00%) if let hir::StmtKind::Let(local) = w[0].kind 47,712 ( 0.00%) && let Some(t) = local.init 31,322 ( 0.00%) && let ExprKind::Closure { .. } = t.kind 33 ( 0.00%) && let hir::PatKind::Binding(_, _, ident, _) = local.pat.kind 24 ( 0.00%) && let hir::StmtKind::Semi(second) = w[1].kind 5 ( 0.00%) && let ExprKind::Assign(_, call, _) = second.kind 3 ( 0.00%) && let ExprKind::Call(closure, _) = call.kind 5 ( 0.00%) && let ExprKind::Path(hir::QPath::Resolved(_, path)) = closure.kind 3 ( 0.00%) && ident == path.segments[0].ident 2 ( 0.00%) && count_closure_usage(cx, block, path) == 1 . { . span_lint_hir( . cx, . REDUNDANT_CLOSURE_CALL, . second.hir_id, . second.span, . "closure called just once immediately after it was declared", . ); . } . } 174,336 ( 0.00%) } . } 123,513 ( 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 { 408,954 ( 0.00%) fn check_pat(&mut self, cx: &LateContext<'tcx>, ref_pat: &'tcx Pat<'_>) { 127,501 ( 0.00%) if let PatKind::Ref(pat, Pinnedness::Not, Mutability::Not) = ref_pat.kind 4,258 ( 0.00%) && !ref_pat.span.from_expansion() 2,126 ( 0.00%) && cx . .tcx 2,126 ( 0.00%) .hir_parent_iter(ref_pat.hir_id) 2,236 ( 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 134 ( 0.00%) .all(|pat| !matches!(pat.kind, PatKind::Or(_))) . { 21,338 ( 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 64 ---------------------------------------- . String::new(), . Applicability::MachineApplicable, . ); . }, . ); . }, . // Slices where each element is `ref`: `&[ref a, ref b, ..., ref z]` . PatKind::Slice( 8 ( 0.00%) before, . None . | Some(Pat { . kind: PatKind::Wild, .. . }), 8 ( 0.00%) after, . ) => { 8 ( 0.00%) check_subpatterns( 212 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/needless_borrowed_ref.rs:clippy_lints::needless_borrowed_ref::check_subpatterns::, core::slice::iter::Iter>> (4x) . cx, . "dereferencing a slice pattern where every element takes a reference", . ref_pat, . pat, . itertools::chain(before, after), . ); . }, 30 ( 0.00%) PatKind::Tuple(subpatterns, _) | PatKind::TupleStruct(_, subpatterns, _) => { . check_subpatterns( . cx, . "dereferencing a tuple pattern where every element takes a reference", . ref_pat, . pat, . subpatterns, . ); . }, 1,750 ( 0.00%) PatKind::Struct(_, fields, _) => { . check_subpatterns( . cx, . "dereferencing a struct pattern where every field's pattern takes a reference", . ref_pat, . pat, . fields.iter().map(|field| field.pat), . ); . }, . _ => {}, . } . } 467,376 ( 0.00%) } . } . 40 ( 0.00%) fn check_subpatterns<'tcx>( . cx: &LateContext<'tcx>, . message: &'static str, . ref_pat: &Pat<'_>, . pat: &Pat<'_>, . subpatterns: impl IntoIterator>, . ) { . let mut suggestions = Vec::new(); . . for subpattern in subpatterns { 27,635 ( 0.00%) match subpattern.kind { 1,230 ( 0.00%) PatKind::Binding(BindingMode::REF, _, ident, None) => { . // `ref ident` . // ^^^^ 2,460 ( 0.00%) let span = subpattern.span.until(ident.span); 236,160 ( 0.00%) => ???:::until (1,230x) . suggestions.push((span, String::new())); . }, . PatKind::Wild => {}, . _ => return, . } . } . 331 ( 0.00%) if !suggestions.is_empty() { 5,294 ( 0.00%) span_lint_and_then(cx, NEEDLESS_BORROWED_REFERENCE, ref_pat.span, message, |diag| { 205,398,356 ( 1.71%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then::, ::check_pat::{closure#3}>>::{closure#0}> (329x) 717,583 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then::::{closure#0}> (2x) . // `&pat` . // ^ 1,324 ( 0.00%) let span = ref_pat.span.until(pat.span); 63,552 ( 0.00%) => ???:::until (331x) . suggestions.push((span, String::new())); . . diag.multipart_suggestion( . "try removing the `&` and `ref` parts", 993 ( 0.00%) suggestions, . Applicability::MachineApplicable, . ); . }); . } 363 ( 0.00%) } 12,524 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/methods/chars_cmp_with_unwrap.rs -------------------------------------------------------------------------------- Ir -- line 3 ---------------------------------------- . use clippy_utils::source::snippet_with_applicability; . use rustc_ast::ast; . use rustc_errors::Applicability; . use rustc_hir as hir; . use rustc_lint::{LateContext, Lint}; . use rustc_span::Symbol; . . /// Wrapper fn for `CHARS_NEXT_CMP` and `CHARS_LAST_CMP` lints with `unwrap()`. 159,120 ( 0.00%) pub(super) fn check( . cx: &LateContext<'_>, . info: &crate::methods::BinaryExprInfo<'_>, . chain_methods: &[Symbol], . lint: &'static Lint, . suggest: &str, . ) -> bool { 73,440 ( 0.00%) if let Some(args) = method_chain_args(info.chain, chain_methods) 1,707,603 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::method_chain_args (12,240x) . && let hir::ExprKind::Lit(lit) = info.other.kind . && let ast::LitKind::Char(c) = lit.node . { . let mut applicability = Applicability::MachineApplicable; . span_lint_and_sugg( . cx, . lint, . info.expr.span, -- line 26 ---------------------------------------- -- line 34 ---------------------------------------- . ), . applicability, . ); . . true . } else { . false . } 110,160 ( 0.00%) } 12,240 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/operators/float_cmp.rs -------------------------------------------------------------------------------- Ir -- line 7 ---------------------------------------- . use rustc_hir::def_id::DefId; . use rustc_hir::{BinOpKind, Expr, ExprKind, UnOp}; . use rustc_lint::LateContext; . use rustc_middle::ty; . use rustc_span::SyntaxContext; . . use super::{FLOAT_CMP, FLOAT_CMP_CONST}; . 2,180,052 ( 0.02%) pub(crate) fn check_assert<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { . if let Some(macro_call) = . first_node_macro_backtrace(cx, e).find(|macro_call| is_assert_eq_diag(cx, macro_call.def_id)) 2,025 ( 0.00%) && let Some((lhs, rhs, _)) = find_assert_eq_args(cx, e, macro_call.expn) 1,223,996 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::find_assert_eq_args (405x) 405 ( 0.00%) && is_float(cx, lhs) . { . let ecx = ConstEvalCtxt::new(cx); . let ctxt = macro_call.span.ctxt(); . . let has_const = is_float_const(&ecx, lhs, ctxt) || is_float_const(&ecx, rhs, ctxt); . if !has_const { . return; . } -- line 27 ---------------------------------------- -- line 30 ---------------------------------------- . let msg = if is_comparing_arrays { . "strict comparison of `f32` or `f64` constant arrays" . } else { . "strict comparison of `f32` or `f64` constant" . }; . . clippy_utils::diagnostics::span_lint(cx, FLOAT_CMP_CONST, macro_call.span, msg); . } 1,937,824 ( 0.02%) } . . fn is_float_const(ecx: &ConstEvalCtxt<'_>, expr: &Expr<'_>, ctxt: SyntaxContext) -> bool { . match ecx.eval_with_source(expr, ctxt) { . Some((c, s)) if !is_allowed(&c) => !s.is_local(), . _ => false, . } . } . . fn is_assert_eq_diag(cx: &LateContext<'_>, def_id: DefId) -> bool { 50,466 ( 0.00%) matches!( 34,080 ( 0.00%) cx.tcx.get_diagnostic_name(def_id), 633,202 ( 0.01%) => ???:::get_diagnostic_name (8,520x) . Some(sym::assert_eq_macro | sym::assert_ne_macro | sym::debug_assert_eq_macro | sym::debug_assert_ne_macro) . ) . } . . fn is_inside_assert_eq(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { . macro_backtrace(expr.span).any(|mc| is_assert_eq_diag(cx, mc.def_id)) . } . 80,832 ( 0.00%) pub(crate) fn check<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'_>, . op: BinOpKind, . left: &'tcx Expr<'_>, . right: &'tcx Expr<'_>, . ) { 39,100 ( 0.00%) if (op == BinOpKind::Eq || op == BinOpKind::Ne) && is_float(cx, left) { . // Skip if inside assert_eq!/assert_ne! macro to avoid double-linting . // (handled by check_assert) 12 ( 0.00%) if is_inside_assert_eq(cx, expr) { . return; . } . 4 ( 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(); 14 ( 0.00%) let left_is_local = match ecx.eval_with_source(left, ctxt) { 122 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval_with_source (2x) . Some((c, s)) if !is_allowed(&c) => s.is_local(), . Some(_) => return, . None => true, . }; 16 ( 0.00%) let right_is_local = match ecx.eval_with_source(right, ctxt) { 122 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval_with_source (2x) . Some((c, s)) if !is_allowed(&c) => s.is_local(), . Some(_) => return, . None => true, . }; . . // Allow comparing the results of signum() . if is_signum(cx, left) && is_signum(cx, right) { . return; . } . 10 ( 0.00%) if let Some(name) = parent_item_name(cx, expr) { 342 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::parent_item_name (2x) . let name = name.as_str(); 2 ( 0.00%) if name == "eq" || name == "ne" || name == "is_nan" || name.starts_with("eq_") || name.ends_with("_eq") { . return; . } . } . let is_comparing_arrays = is_array(cx, left) || is_array(cx, right); . let (lint, msg) = get_lint_and_message(left_is_local && right_is_local, is_comparing_arrays); . span_lint_and_then(cx, lint, expr.span, msg, |diag| { . let lhs = Sugg::hir(cx, left, ".."); . let rhs = Sugg::hir(cx, right, ".."); -- line 100 ---------------------------------------- -- line 108 ---------------------------------------- . lhs - rhs, . if op == BinOpKind::Eq { '<' } else { '>' } . ), . Applicability::HasPlaceholders, // snippet . ); . } . }); . } 53,888 ( 0.00%) } . . fn get_lint_and_message(is_local: bool, is_comparing_arrays: bool) -> (&'static rustc_lint::Lint, &'static str) { . if is_local { . ( . FLOAT_CMP, . if is_comparing_arrays { . "strict comparison of `f32` or `f64` arrays" . } else { -- line 124 ---------------------------------------- -- line 149 ---------------------------------------- . }), . _ => false, . } . } . . // Return true if `expr` is the result of `signum()` invoked on a float value. . fn is_signum(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { . // The negation of a signum is still a signum 6 ( 0.00%) if let ExprKind::Unary(UnOp::Neg, child_expr) = expr.kind { . return is_signum(cx, child_expr); . } . 10 ( 0.00%) if let ExprKind::MethodCall(method_name, self_arg, [], _) = expr.kind 2 ( 0.00%) && method_name.ident.name == sym::signum . // Check that the receiver of the signum() is a float (expressions[0] is the receiver of . // the method call) . { . return is_float(cx, self_arg); . } . false . } . . fn is_float(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { 9,912 ( 0.00%) let value = &cx.typeck_results().expr_ty(expr).peel_refs().kind(); 116,008 ( 0.00%) => ???:::expr_ty (2,899x) . . if let ty::Array(arr_ty, _) = value { 40 ( 0.00%) return matches!(arr_ty.kind(), ty::Float(_)); . } . . matches!(value, ty::Float(_)) . } . . fn is_array(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { . matches!(&cx.typeck_results().expr_ty(expr).peel_refs().kind(), ty::Array(_, _)) . } -- line 183 ---------------------------------------- 7,496 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/toplevel_ref_arg.rs -------------------------------------------------------------------------------- Ir -- line 45 ---------------------------------------- . pub TOPLEVEL_REF_ARG, . style, . "an entire binding declared as `ref`, in a function argument or a `let` statement" . } . . declare_lint_pass!(ToplevelRefArg => [TOPLEVEL_REF_ARG]); . . impl<'tcx> LateLintPass<'tcx> for ToplevelRefArg { 45,728 ( 0.00%) fn check_fn( . &mut self, . cx: &LateContext<'tcx>, . k: FnKind<'tcx>, . decl: &'tcx FnDecl<'_>, . body: &'tcx Body<'_>, . _: Span, . _: LocalDefId, . ) { 11,432 ( 0.00%) if !matches!(k, FnKind::Closure) { . for arg in iter_input_pats(decl, body) { 57,570 ( 0.00%) if let PatKind::Binding(BindingMode(ByRef::Yes(..), _), ..) = arg.pat.kind . && is_lint_allowed(cx, REF_PATTERNS, arg.pat.hir_id) . && !arg.span.in_external_macro(cx.tcx.sess.source_map()) . { . span_lint_hir( . cx, . TOPLEVEL_REF_ARG, . arg.hir_id, . arg.pat.span, . "`ref` directly on a function parameter does not prevent taking ownership of the passed argument. \ . Consider using a reference type instead", . ); . } . } . } 45,728 ( 0.00%) } . 253,568 ( 0.00%) fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx Stmt<'_>) { 83,453 ( 0.00%) if let StmtKind::Let(local) = stmt.kind 98,847 ( 0.00%) && let PatKind::Binding(BindingMode(ByRef::Yes(_, mutabl), _), .., name, None) = local.pat.kind . && let Some(init) = local.init . // Do not emit if clippy::ref_patterns is not allowed to avoid having two lints for the same issue. . && is_lint_allowed(cx, REF_PATTERNS, local.pat.hir_id) . && !stmt.span.in_external_macro(cx.tcx.sess.source_map()) . { . let ctxt = local.span.ctxt(); . let mut app = Applicability::MachineApplicable; . let sugg_init = Sugg::hir_with_context(cx, init, ctxt, "..", &mut app); -- line 91 ---------------------------------------- -- line 110 ---------------------------------------- . stmt.span, . "try", . format!("let {name}{tyopt} = {initref};", name = snippet(cx, name.span, "..")), . app, . ); . }, . ); . } 253,568 ( 0.00%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/attrs/deprecated_cfg_attr.rs -------------------------------------------------------------------------------- Ir . use super::{Attribute, DEPRECATED_CFG_ATTR, DEPRECATED_CLIPPY_CFG_ATTR, unnecessary_clippy_cfg}; . use clippy_utils::diagnostics::span_lint_and_sugg; . use clippy_utils::msrvs::{self, MsrvStack}; . use clippy_utils::sym; . use rustc_ast::AttrStyle; . use rustc_errors::Applicability; . use rustc_lint::EarlyContext; . 64,160 ( 0.00%) pub(super) fn check(cx: &EarlyContext<'_>, attr: &Attribute, msrv: &MsrvStack) { . // check cfg_attr . if attr.has_name(sym::cfg_attr) 564 ( 0.00%) && let Some(items) = attr.meta_item_list() 149,456 ( 0.00%) => ???:::meta_item_list (94x) 188 ( 0.00%) && items.len() == 2 . && let Some(feature_item) = items[0].meta_item() . { . // check for `rustfmt` 470 ( 0.00%) if feature_item.has_name(sym::rustfmt) 752 ( 0.00%) => ???:::has_name (94x) . && msrv.meets(msrvs::TOOL_ATTRIBUTES) . // check for `rustfmt_skip` and `rustfmt::skip` . && let Some(skip_item) = &items[1].meta_item() . && (skip_item.has_name(sym::rustfmt_skip) . || skip_item . .path . .segments . .last() -- line 25 ---------------------------------------- -- line 36 ---------------------------------------- . DEPRECATED_CFG_ATTR, . attr.span, . "`cfg_attr` is deprecated for rustfmt and got replaced by tool attributes", . "use", . "#[rustfmt::skip]".to_string(), . Applicability::MachineApplicable, . ); . } else { 282 ( 0.00%) check_deprecated_cfg_recursively(cx, feature_item); 4,559 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/attrs/deprecated_cfg_attr.rs:clippy_lints::attrs::deprecated_cfg_attr::check_deprecated_cfg_recursively (94x) 282 ( 0.00%) if let Some(behind_cfg_attr) = items[1].meta_item() { 376 ( 0.00%) unnecessary_clippy_cfg::check(cx, feature_item, behind_cfg_attr, attr); 3,008 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/attrs/unnecessary_clippy_cfg.rs:clippy_lints::attrs::unnecessary_clippy_cfg::check (94x) . } . } . } 48,120 ( 0.00%) } . 64,160 ( 0.00%) pub(super) fn check_clippy(cx: &EarlyContext<'_>, attr: &Attribute) { . if attr.has_name(sym::cfg) 828 ( 0.00%) && let Some(list) = attr.meta_item_list() 69,189 ( 0.00%) => ???:::meta_item_list (138x) . { 552 ( 0.00%) for item in list.iter().filter_map(|item| item.meta_item()) { 414 ( 0.00%) check_deprecated_cfg_recursively(cx, item); 6,702 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/attrs/deprecated_cfg_attr.rs:clippy_lints::attrs::deprecated_cfg_attr::check_deprecated_cfg_recursively (138x) . } . } 56,140 ( 0.00%) } . 1,680 ( 0.00%) fn check_deprecated_cfg_recursively(cx: &EarlyContext<'_>, attr: &rustc_ast::MetaItem) { 1,908 ( 0.00%) if let Some(ident) = attr.ident() { 2,088 ( 0.00%) => ???:::ident (232x) . if matches!(ident.name, sym::any | sym::all | sym::not) { 28 ( 0.00%) let Some(list) = attr.meta_item_list() else { return }; 42 ( 0.00%) => ???:::meta_item_list (7x) 29 ( 0.00%) for item in list.iter().filter_map(|item| item.meta_item()) { 24 ( 0.00%) check_deprecated_cfg_recursively(cx, item); 372 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/attrs/deprecated_cfg_attr.rs:clippy_lints::attrs::deprecated_cfg_attr::check_deprecated_cfg_recursively'2 (8x) . } . } else { . check_cargo_clippy_attr(cx, attr); . } . } 1,200 ( 0.00%) } . . fn check_cargo_clippy_attr(cx: &EarlyContext<'_>, item: &rustc_ast::MetaItem) { 1,165 ( 0.00%) if item.has_name(sym::feature) && item.value_str() == Some(sym::cargo_clippy) { 1,800 ( 0.00%) => ???:::has_name (225x) . span_lint_and_sugg( . cx, . DEPRECATED_CLIPPY_CFG_ATTR, . item.span, . "`feature = \"cargo-clippy\"` was replaced by `clippy`", . "replace with", . "clippy".to_string(), . Applicability::MachineApplicable, -- line 84 ---------------------------------------- 385 ( 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.rs -------------------------------------------------------------------------------- Ir -- line 94 ---------------------------------------- . pub(super) const fn new(slice: &'a [T]) -> Self { . let len = slice.len(); . let ptr: NonNull = NonNull::from_ref(slice).cast(); . // SAFETY: Similar to `IterMut::new`. . unsafe { . let end_or_len = . if T::IS_ZST { without_provenance(len) } else { ptr.as_ptr().add(len) }; . 2,074 ( 0.00%) Self { ptr, end_or_len, _marker: PhantomData } . } . } . . /// Views the underlying data as a subslice of the original data. . /// . /// # Examples . /// . /// Basic usage: -- line 110 ---------------------------------------- -- line 1347 ---------------------------------------- . } . . #[stable(feature = "rust1", since = "1.0.0")] . impl<'a, T> Iterator for Windows<'a, T> { . type Item = &'a [T]; . . #[inline] . fn next(&mut self) -> Option<&'a [T]> { 217,505 ( 0.00%) if self.size.get() > self.v.len() { . None . } else { . let ret = Some(&self.v[..self.size.get()]); . self.v = &self.v[1..]; . ret . } . } . . #[inline] . fn size_hint(&self) -> (usize, Option) { 192 ( 0.00%) if self.size.get() > self.v.len() { . (0, Some(0)) . } else { . let size = self.v.len() - self.size.get() + 1; . (size, Some(size)) . } . } . . #[inline] -- line 1374 ---------------------------------------- 66,538 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_rotate.rs -------------------------------------------------------------------------------- Ir -- line 36 ---------------------------------------- . #[clippy::version = "1.81.0"] . pub MANUAL_ROTATE, . style, . "using bit shifts to rotate integers" . } . . declare_lint_pass!(ManualRotate => [MANUAL_ROTATE]); . 3 ( 0.00%) #[derive(Clone, Copy, Debug, PartialEq, Eq)] . enum ShiftDirection { . Left, . Right, . } . . impl Display for ShiftDirection { . fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { . 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>)> { 1,158 ( 0.00%) if let ExprKind::Binary(op, l, r) = expr.kind { 253 ( 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 { 1,695,596 ( 0.01%) fn check_expr<'tcx>(&mut self, cx: &LateContext<'tcx>, expr: &Expr<'tcx>) { 505,019 ( 0.00%) if let ExprKind::Binary(op, l, r) = expr.kind 19,948 ( 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) 3 ( 0.00%) && 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(), . _ => return, . } . { -- line 85 ---------------------------------------- -- line 130 ---------------------------------------- . expr.span, . "this expression can be rewritten as", . format!("{expr_sugg}.{shift_function}({amount})"), . applicability, . ); . }, . ); . } 1,937,824 ( 0.02%) } . } 28 ( 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) { 376,542 ( 0.00%) 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) { 11,295 ( 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/single_component_path_imports.rs -------------------------------------------------------------------------------- Ir -- line 49 ---------------------------------------- . name: Symbol, . span: Span, . item_id: NodeId, . can_suggest: bool, . } . . impl EarlyLintPass for SingleComponentPathImports { . fn check_crate(&mut self, cx: &EarlyContext<'_>, krate: &Crate) { 1 ( 0.00%) if cx.sess().opts.edition < Edition::Edition2018 { . return; . } . 1 ( 0.00%) self.check_mod(&krate.items); 13,064 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/single_component_path_imports.rs:::check_mod (1x) . } . 44,964 ( 0.00%) fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) { 19,984 ( 0.00%) for SingleUse { span, can_suggest, .. } in self.found.remove(&item.id).into_iter().flatten() { . if can_suggest { . span_lint_and_sugg( . cx, . SINGLE_COMPONENT_PATH_IMPORTS, . span, . "this import is redundant", . "remove it entirely", . String::new(), -- line 73 ---------------------------------------- -- line 79 ---------------------------------------- . SINGLE_COMPONENT_PATH_IMPORTS, . span, . "this import is redundant", . None, . "remove this import", . ); . } . } 39,968 ( 0.00%) } . } . . #[derive(Default)] . struct ImportUsageVisitor { . // keep track of imports reused with `self` keyword, such as `self::std` in the example below. . // Removing the `use std;` would make this a compile error (#10549) . // ``` . // use std; -- line 95 ---------------------------------------- -- line 118 ---------------------------------------- . && path.segments[0].ident.name == kw::SelfLower . { . self.imports_referenced_with_self.push(path.segments[1].ident.name); . } . } . } . . impl SingleComponentPathImports { 176 ( 0.00%) fn check_mod(&mut self, items: &[Box]) { . // keep track of imports reused with `self` keyword, such as `self::crypto_hash` in the example . // below. Removing the `use crypto_hash;` would make this a compile error . // ``` . // use crypto_hash; . // . // use self::crypto_hash::{Algorithm, Hasher}; . // ``` . let mut imports_reused_with_self = Vec::new(); -- line 134 ---------------------------------------- -- line 142 ---------------------------------------- . // keep track of macros defined in the module as we don't want it to trigger on this (#7106) . // ``` . // macro_rules! foo { () => {} }; . // pub(crate) use foo; . // ``` . let mut macros = Vec::new(); . . for item in items { 633 ( 0.00%) self.track_uses(item, &mut imports_reused_with_self, &mut single_use_usages, &mut macros); . } . . // Only walk the module's AST in search of `self::xxx` paths when there are single . // component imports left to lint, as the visitor recurses into every nested item. . single_use_usages.retain(|usage| !imports_reused_with_self.contains(&usage.name)); . if single_use_usages.is_empty() { . return; . } -- line 158 ---------------------------------------- -- line 162 ---------------------------------------- . import_usage_visitor.visit_item(item); . } . . for usage in single_use_usages { . if !import_usage_visitor.imports_referenced_with_self.contains(&usage.name) { . self.found.entry(usage.item_id).or_default().push(usage); . } . } 176 ( 0.00%) } . . fn track_uses( . &mut self, . item: &Item, . imports_reused_with_self: &mut Vec, . single_use_usages: &mut Vec, . macros: &mut Vec, . ) { 2,997 ( 0.00%) if item.span.from_expansion() || item.vis.kind.is_pub() { . return; . } . 1,795 ( 0.00%) match &item.kind { . ItemKind::Mod(_, _, ModKind::Loaded(items, ..)) => { 42 ( 0.00%) self.check_mod(items); 11,912 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/single_component_path_imports.rs:::check_mod'2 (17x) . }, . ItemKind::MacroDef(ident, MacroDef { macro_rules: true, .. }) => { 2 ( 0.00%) macros.push(ident.name); . }, . ItemKind::Use(use_tree) => { . let segments = &use_tree.prefix.segments; . . // keep track of `use some_module;` usages 540 ( 0.00%) if segments.len() == 1 { 30 ( 0.00%) if let UseTreeKind::Simple(None) = use_tree.kind { . let name = segments[0].ident.name; . if !macros.contains(&name) { . single_use_usages.push(SingleUse { . name, . span: item.span, . item_id: item.id, . can_suggest: true, . }); -- line 203 ---------------------------------------- -- line 223 ---------------------------------------- . can_suggest: false, . }); . } . } . } . } . } . // keep track of `use self::some_module` usages 120 ( 0.00%) else if segments[0].ident.name == kw::SelfLower { . // simple case such as `use self::module::SomeStruct` . if segments.len() > 1 { 1 ( 0.00%) imports_reused_with_self.push(segments[1].ident.name); . return; . } . . // nested case such as `use self::{module1::Struct1, module2::Struct2}` . if let UseTreeKind::Nested { items, .. } = &use_tree.kind { . for tree in items { . let segments = &tree.0.prefix.segments; . if !segments.is_empty() { -- line 242 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 86 ---------------------------------------- . } . . /// A "Path" is essentially Rust's notion of a name. . /// . /// It's represented as a sequence of identifiers, . /// along with a bunch of supporting information. . /// . /// E.g., `std::cmp::PartialEq`. 22,902 ( 0.00%) #[derive(Clone, Encodable, Decodable, Debug, Walkable)] . pub struct Path { . pub span: Span, . /// The segments in the path: the things separated by `::`. . /// 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 { 642 ( 0.00%) if let [segment] = self.segments.as_ref() . && segment == name . { . true . } else { . false . } . } . } -- line 114 ---------------------------------------- -- line 203 ---------------------------------------- . s.push_str(&ident.to_string()); . } . s . } . . /// A segment of a path: an identifier, an optional lifetime, and a set of types. . /// . /// E.g., `std`, `String` or `Box`. 1,884 ( 0.00%) #[derive(Clone, Encodable, Decodable, Debug, Walkable)] . pub struct PathSegment { . /// The identifier portion of this path segment. . pub ident: Ident, . 311 ( 0.00%) pub id: NodeId, . . /// Type/lifetime parameters attached to this path. They come in . /// two flavors: `Path` and `Path(A,B) -> C`. . /// `None` means that no parameter list is supplied (`Path`), . /// `Some` means that parameter list is supplied (`Path`) . /// but it can be empty (`Path<>`). . /// `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 { 213 ( 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)`. 1,150 ( 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. 285 ( 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. 337 ( 0.00%) #[derive(Clone, Encodable, Decodable, Debug, Walkable)] 2,290 ( 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 (38x) 228 ( 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 (6x) 140 ( 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 (5x) . 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 383 ---------------------------------------- . impl TraitBoundModifiers { . pub const NONE: Self = Self { . constness: BoundConstness::Never, . asyncness: BoundAsyncness::Normal, . polarity: BoundPolarity::Positive, . }; . } . 8 ( 0.00%) #[derive(Clone, Encodable, Decodable, Debug, Walkable)] . pub enum GenericBound { . 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 { 3,399 ( 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 607 ---------------------------------------- . . /// A block (`{ .. }`). . /// . /// E.g., `{ .. }` as in `fn foo() { .. }`. . #[derive(Clone, Encodable, Decodable, Debug, Walkable)] . pub struct Block { . /// The statements in the block. . pub stmts: ThinVec, 23 ( 0.00%) pub id: NodeId, . /// Distinguishes between `unsafe { ... }` and `{ ... }`. 23 ( 0.00%) pub rules: BlockCheckMode, . pub span: Span, . } . . /// A match pattern. . /// . /// Patterns appear in match statements and some other contexts, such as `let` and `if let`. 749,352 ( 0.01%) #[derive(Clone, Encodable, Decodable, Debug, Walkable)] 2,961,302 ( 0.02%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/ast.rs:::clone (6,531x) . pub struct Pat { 1,950 ( 0.00%) pub id: NodeId, 5,844 ( 0.00%) pub kind: PatKind, 593,848 ( 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:::clone'2 (1,946x) . pub span: Span, . } . . impl Pat { . /// Attempt reparsing the pattern as a type. . /// This is intended for use by diagnostics. . pub fn to_ty(&self) -> Option> { . let kind = match &self.kind { -- line 635 ---------------------------------------- -- line 712 ---------------------------------------- . while let PatKind::Ref(inner, _, _) = ¤t.kind { . current = inner; . } . current . } . . /// Is this a `..` pattern? . pub fn is_rest(&self) -> bool { 4,614 ( 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 771 ---------------------------------------- . } . } . . /// A single field in a struct pattern. . /// . /// Patterns like the fields of `Foo { x, ref y, ref mut z }` . /// are treated the same as `x: x, y: ref y, z: ref mut z`, . /// except when `is_shorthand` is true. 97,002 ( 0.00%) #[derive(Clone, Encodable, Decodable, Debug, Walkable)] . pub struct PatField { . /// The identifier for the field. . pub ident: Ident, . /// The pattern the field is destructured to. . pub pat: Box, . pub is_shorthand: bool, . pub attrs: AttrVec, . pub id: NodeId, . pub span: Span, . pub is_placeholder: bool, . } . 466 ( 0.00%) #[derive(Clone, Copy, Debug, Eq, PartialEq)] . #[derive(Encodable, Decodable, StableHash, Walkable)] . pub enum ByRef { . Yes(Pinnedness, Mutability), . No, . } . . impl ByRef { . #[must_use] -- line 800 ---------------------------------------- -- 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`. 740,245 ( 0.01%) #[derive(Clone, Encodable, Decodable, Debug, Walkable)] 718,087 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::visit_pat'2 (947x) 11,766 ( 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 (375x) . 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`), . /// or a unit struct/variant pattern, or a const pattern (in the last two cases the third . /// field must be `None`). Disambiguation cannot be done with parser alone, so it happens . /// during name resolution. 54 ( 0.00%) Ident(BindingMode, Ident, Option>), . . /// A struct or struct variant pattern (e.g., `Variant {x, y, ..}`). 2,184 ( 0.00%) Struct(Option>, Path, ThinVec, PatFieldsRest), . . /// A tuple struct/variant pattern (`Variant(x, y, .., z)`). 2,094 ( 0.00%) TupleStruct(Option>, Path, ThinVec), . . /// An or-pattern `A | B | C`. . /// Invariant: `pats.len() >= 2`. . Or(ThinVec), . . /// A possibly qualified path pattern. . /// Unqualified path patterns `A::B::C` can legally refer to variants, structs, constants . /// or associated constants. Qualified path patterns `::B::C`/`::B::C` can -- line 897 ---------------------------------------- -- line 945 ---------------------------------------- . /// A macro pattern; pre-expansion. . MacCall(Box), . . /// Placeholder for a pattern that wasn't syntactically well formed in some way. . Err(ErrorGuaranteed), . } . . /// Whether the `..` is present in a struct fields pattern. 12,723 ( 0.00%) #[derive(Clone, Copy, Encodable, Decodable, Debug, PartialEq, Walkable)] . pub enum PatFieldsRest { . /// `module::StructName { field, ..}` . Rest(Span), . /// `module::StructName { field, syntax error }` . Recovered(ErrorGuaranteed), . /// `module::StructName { field }` . None, . } . . /// The kind of borrow in an `AddrOf` expression, . /// e.g., `&place` or `&raw const place`. 78 ( 0.00%) #[derive(Clone, Copy, PartialEq, Eq, Debug)] . #[derive(Encodable, Decodable, StableHash, Walkable)] . pub enum BorrowKind { . /// A normal borrow, `&$expr` or `&mut $expr`. . /// The resulting type is either `&'a T` or `&'a mut T` . /// where `T = typeof($expr)` and `'a` is some lifetime. . Ref, . /// A raw borrow, `&raw const $expr` or `&raw mut $expr`. . /// The resulting type is either `*const T` or `*mut T` -- line 973 ---------------------------------------- -- 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, . } . 113,282 ( 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::*; 499 ( 0.00%) match self { . Add => "+", . Sub => "-", . Mul => "*", . Div => "/", . Rem => "%", . And => "&&", . Or => "||", . BitXor => "^", -- line 1033 ---------------------------------------- -- line 1037 ---------------------------------------- . Shr => ">>", . Eq => "==", . Lt => "<", . Le => "<=", . Ne => "!=", . Ge => ">=", . Gt => ">", . } 7 ( 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::*; 34,836 ( 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 { 300 ( 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, . } . } . } . 56 ( 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 1156 ---------------------------------------- . } . } . . pub type AssignOp = Spanned; . . /// Unary operator. . /// . /// Note that `&data` is not an operator, it's an `AddrOf` expression. 2,637 ( 0.00%) #[derive(Clone, Copy, Debug, PartialEq, Encodable, Decodable, StableHash, Walkable)] . pub enum UnOp { . /// The `*` operator for dereferencing . Deref, . /// The `!` operator for logical inversion . Not, . /// The `-` operator for negation . Neg, . } . . impl UnOp { . pub fn as_str(&self) -> &'static str { 4 ( 0.00%) match self { . UnOp::Deref => "*", . UnOp::Not => "!", . UnOp::Neg => "-", . } . } . . /// Returns `true` if the unary operator takes its argument by value. . pub fn is_by_value(self) -> bool { -- line 1184 ---------------------------------------- -- 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>)> { 81,779 ( 0.00%) match self { . Self::Decl => None, 16,350 ( 0.00%) Self::Init(init) => Some((init, None)), 2 ( 0.00%) Self::InitElse(init, els) => Some((init, Some(els))), . } . } . } . . /// An arm of a 'match'. . /// . /// E.g., `0..=10 => { println!("match!") }` as in . /// -- line 1337 ---------------------------------------- -- line 1388 ---------------------------------------- . /// explicit discriminant values for enum variants. . #[derive(Clone, Encodable, Decodable, Debug, Walkable)] . pub struct AnonConst { . pub id: NodeId, . pub value: Box, . } . . /// An expression. 65,950 ( 0.00%) #[derive(Clone, Encodable, Decodable, Debug)] . pub struct Expr { 2,638 ( 0.00%) pub id: NodeId, . pub kind: ExprKind, . pub span: Span, . pub attrs: AttrVec, . pub tokens: Option, . } . . impl Expr { . /// Check if this expression is potentially a trivial const arg, i.e., one that can _potentially_ -- line 1406 ---------------------------------------- -- line 1474 ---------------------------------------- . Parens::No, . ))), . _ => None, . } . } . . pub fn peel_parens(&self) -> &Expr { . let mut expr = self; 479 ( 0.00%) while let ExprKind::Paren(inner) = &expr.kind { 9 ( 0.00%) 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 1491 ---------------------------------------- -- line 1699 ---------------------------------------- . match self { . RangeLimits::HalfOpen => "..", . RangeLimits::Closed => "..=", . } . } . } . . /// A method call (e.g. `x.foo::(a, b, c)`). 1,244 ( 0.00%) #[derive(Clone, Encodable, Decodable, Debug)] . pub struct MethodCall { . /// The method name and its generic arguments, e.g. `foo::`. . pub seg: PathSegment, . /// The receiver, e.g. `x`. 311 ( 0.00%) pub receiver: Box, . /// The arguments, e.g. `a, b, c`. 220 ( 0.00%) pub args: ThinVec>, . /// The span of the function, without the dot and receiver e.g. `foo::(a, b, c)`. . pub span: Span, . } . 2,760 ( 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 1737 ---------------------------------------- . pub struct StructExpr { . pub qself: Option>, . pub path: Path, . pub fields: ThinVec, . pub rest: StructRest, . } . . // Adding a new variant? Please update `test_expr` in `tests/ui/macros/stringify.rs`. 24,697 ( 0.00%) #[derive(Clone, Encodable, Decodable, Debug)] . pub enum ExprKind { . /// An array (e.g, `[a, b, c, d]`). . Array(ThinVec>), . /// Allow anonymous constants from an inline `const` block. . ConstBlock(AnonConst), . /// A function call. . /// . /// The first field resolves to the function itself, . /// and the second field is the list of arguments. . /// This also represents calling the constructor of . /// tuple-like ADTs such as tuple structs and enum variants. 110 ( 0.00%) Call(Box, ThinVec>), 5,213 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs: as core::clone::Clone>::clone (21x) . /// A method call (e.g., `x.foo::(a, b, c)`). 622 ( 0.00%) MethodCall(Box), 240,129 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs: as core::clone::Clone>::clone (301x) . /// A tuple (e.g., `(a, b, c, d)`). . Tup(ThinVec>), . /// A binary operation (e.g., `a + b`, `a * b`). 102 ( 0.00%) Binary(BinOp, Box, Box), 5,998 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs: as core::clone::Clone>::clone (18x) . /// A unary operation (e.g., `!x`, `*x`). 33 ( 0.00%) Unary(UnOp, Box), 1,254 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs: as core::clone::Clone>::clone (6x) . /// A `move(expr)` expression. . Move(Box, Span), . /// A literal (e.g., `1`, `"foo"`). . Lit(token::Lit), . /// A cast (e.g., `foo as f64`). 6 ( 0.00%) Cast(Box, Box), 319 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs: as core::clone::Clone>::clone (1x) 224 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs: as core::clone::Clone>::clone (1x) . /// A type ascription (e.g., `builtin # type_ascribe(42, usize)`). . /// . /// Usually not written directly in user code but . /// indirectly via the macro `type_ascribe!(...)`. . Type(Box, Box), . /// A `let pat = expr` expression that is only semantically allowed in the condition . /// of `if` / `while` expressions. (e.g., `if let 0 = x { .. }`). . /// -- line 1779 ---------------------------------------- -- line 1780 ---------------------------------------- . /// `Span` represents the whole `let pat = expr` statement. . Let(Box, Box, Span, Recovered), . /// An `if` block, with an optional `else` block. . /// . /// `if expr { block } else { expr }` . /// . /// If present, the "else" expr is always `ExprKind::Block` (for `else`) or . /// `ExprKind::If` (for `else if`). 20 ( 0.00%) If(Box, Box, Option>), . /// A while loop, with an optional label. . /// . /// `'label: while expr { block }` . While(Box, Box, Option

{ . #[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),* $(,)?)) => { 124,225,716 ( 1.03%) if $self.$field.active { 105,974,552 ( 0.88%) rustc_lint::LateLintPass::$name(&mut $self.$field.pass, $($arg),*); 427,235 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/only_used_in_recursion.rs:::check_body_post (6,204x) 111,672 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/needless_borrows_for_generic_args.rs:::check_body_post (6,204x) 111,672 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/dereference.rs:::check_body_post (6,204x) . } . }; . } . . /// 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),*);)*]) => ( 10,701,744 ( 0.09%) $(#[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),*)); 6,147,202 ( 0.05%) })* . ) . } . . /// 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());)* 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) 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); . } . }; . } 1,791,582 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_hash_one.rs -------------------------------------------------------------------------------- Ir -- line 55 ---------------------------------------- . . impl ManualHashOne { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl LateLintPass<'_> for ManualHashOne { 160,488 ( 0.00%) fn check_local(&mut self, cx: &LateContext<'_>, local: &LetStmt<'_>) { . // `let mut hasher = seg.build_hasher();` 142,215 ( 0.00%) if let PatKind::Binding(BindingMode::MUT, hasher, _, None) = local.pat.kind 3,528 ( 0.00%) && let Some(init) = local.init 2,352 ( 0.00%) && !init.span.from_expansion() 3,449 ( 0.00%) && let ExprKind::MethodCall(seg, build_hasher, [], _) = init.kind 421 ( 0.00%) && seg.ident.name == sym::build_hasher . . && let Node::Stmt(local_stmt) = cx.tcx.parent_hir_node(local.hir_id) . && let Node::Block(block) = cx.tcx.parent_hir_node(local_stmt.hir_id) . . && let mut stmts = block.stmts.iter() . .skip_while(|stmt| stmt.hir_id != local_stmt.hir_id) . .skip(1) . .filter(|&stmt| is_local_used(cx, stmt, hasher)) -- line 77 ---------------------------------------- -- line 121 ---------------------------------------- . ), . ], . Applicability::MachineApplicable, . ); . } . }, . ); . } 160,488 ( 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/sty.rs -------------------------------------------------------------------------------- Ir -- line 426 ---------------------------------------- . .fresh_float_tys . .get(n as usize) . .copied() . .unwrap_or_else(|| Ty::new_infer(tcx, ty::FreshFloatTy(n))) . } . . #[inline] . pub fn new_param(tcx: TyCtxt<'tcx>, index: u32, name: Symbol) -> Ty<'tcx> { 822 ( 0.00%) Ty::new(tcx, Param(ParamTy { index, name })) . } . . #[inline] . pub fn new_bound( . tcx: TyCtxt<'tcx>, . index: ty::DebruijnIndex, . bound_ty: ty::BoundTy<'tcx>, . ) -> Ty<'tcx> { -- line 442 ---------------------------------------- -- line 489 ---------------------------------------- . ty::AliasTyKind::Opaque { def_id } => { . debug_assert_matches!(tcx.def_kind(def_id), DefKind::OpaqueTy) . } . ty::AliasTyKind::Free { def_id } => { . debug_assert_matches!(tcx.def_kind(def_id), DefKind::TyAlias) . } . } . } 2,608 ( 0.00%) Ty::new(tcx, Alias(is_rigid, alias_ty)) . } . . #[inline] . pub fn new_pat(tcx: TyCtxt<'tcx>, base: Ty<'tcx>, pat: ty::Pattern<'tcx>) -> Ty<'tcx> { . Ty::new(tcx, Pat(base, pat)) . } . . #[inline] -- line 505 ---------------------------------------- -- line 604 ---------------------------------------- . . #[inline] . pub fn new_ref( . tcx: TyCtxt<'tcx>, . r: Region<'tcx>, . ty: Ty<'tcx>, . mutbl: ty::Mutability, . ) -> Ty<'tcx> { 441 ( 0.00%) Ty::new(tcx, Ref(r, ty, mutbl)) . } . . #[inline] . pub fn new_mut_ref(tcx: TyCtxt<'tcx>, r: Region<'tcx>, ty: Ty<'tcx>) -> Ty<'tcx> { . Ty::new_ref(tcx, r, ty, hir::Mutability::Mut) . } . . #[inline] -- line 620 ---------------------------------------- -- line 679 ---------------------------------------- . | DefKind::GlobalAsm . | DefKind::Impl { .. } . | DefKind::Closure . | DefKind::SyntheticCoroutineBody => { . bug!("not an adt: {def:?} ({:?})", tcx.def_kind(def.did())) . } . } . } 8 ( 0.00%) Ty::new(tcx, Adt(def, args)) . } . . #[inline] . pub fn new_foreign(tcx: TyCtxt<'tcx>, def_id: DefId) -> Ty<'tcx> { . Ty::new(tcx, Foreign(def_id)) . } . . #[inline] -- line 695 ---------------------------------------- -- line 703 ---------------------------------------- . ty: Ty<'tcx>, . ct: ty::Const<'tcx>, . ) -> Ty<'tcx> { . Ty::new(tcx, Array(ty, ct)) . } . . #[inline] . pub fn new_slice(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>) -> Ty<'tcx> { 15 ( 0.00%) Ty::new(tcx, Slice(ty)) . } . . #[inline] . pub fn new_tup(tcx: TyCtxt<'tcx>, ts: &[Ty<'tcx>]) -> Ty<'tcx> { . if ts.is_empty() { tcx.types.unit } else { Ty::new(tcx, Tuple(tcx.mk_type_list(ts))) } . } . . pub fn new_tup_from_iter(tcx: TyCtxt<'tcx>, iter: I) -> T::Output -- line 719 ---------------------------------------- -- line 1152 ---------------------------------------- . // noticeable performance hit. See #126069 for details. . #[inline(always)] . pub fn kind(self) -> &'tcx TyKind<'tcx> { . self.0.0 . } . . #[inline] . pub fn is_unit(self) -> bool { 140,230 ( 0.00%) match self.kind() { 1,485 ( 0.00%) Tuple(tys) => tys.is_empty(), . _ => false, . } . } . . /// Check if type is an `usize`. . #[inline] . pub fn is_usize(self) -> bool { . matches!(self.kind(), Uint(UintTy::Usize)) -- line 1169 ---------------------------------------- -- line 1172 ---------------------------------------- . /// Check if type is an `usize` or an integral type variable. . #[inline] . pub fn is_usize_like(self) -> bool { . matches!(self.kind(), Uint(UintTy::Usize) | Infer(IntVar(_))) . } . . #[inline] . pub fn is_never(self) -> bool { 143,690 ( 0.00%) matches!(self.kind(), Never) . } . . #[inline] . pub fn is_primitive(self) -> bool { 1,024 ( 0.00%) matches!(self.kind(), Bool | Char | Int(_) | Uint(_) | Float(_)) . } . . #[inline] . pub fn is_adt(self) -> bool { . matches!(self.kind(), Adt(..)) . } . . #[inline] . pub fn is_ref(self) -> bool { 2,957 ( 0.00%) matches!(self.kind(), Ref(..)) . } . . #[inline] . pub fn is_ty_var(self) -> bool { . matches!(self.kind(), Infer(TyVar(_))) . } . . #[inline] -- line 1203 ---------------------------------------- -- line 1218 ---------------------------------------- . . #[inline] . pub fn is_ty_or_numeric_infer(self) -> bool { . matches!(self.kind(), Infer(_)) . } . . #[inline] . pub fn is_phantom_data(self) -> bool { 10,772 ( 0.00%) if let Adt(def, _) = self.kind() { def.is_phantom_data() } else { false } . } . . #[inline] . pub fn is_unsafe_cell(self) -> bool { . if let Adt(def, _) = self.kind() { def.is_unsafe_cell() } else { false } . } . . #[inline] . pub fn is_bool(self) -> bool { 16,239 ( 0.00%) *self.kind() == Bool 113 ( 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 (19x) . } . . /// Returns `true` if this type is a `str`. . #[inline] . pub fn is_str(self) -> bool { 5,817 ( 0.00%) *self.kind() == Str 14,262 ( 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 (2,851x) . } . . /// Returns true if this type is `&str`. The reference's lifetime is ignored. . #[inline] . pub fn is_imm_ref_str(self) -> bool { . matches!(self.kind(), ty::Ref(_, inner, hir::Mutability::Not) if inner.is_str()) . } . . #[inline] . pub fn is_param(self, index: u32) -> bool { 306 ( 0.00%) match self.kind() { 93 ( 0.00%) ty::Param(data) => data.index == index, . _ => false, . } . } . . #[inline] . pub fn is_slice(self) -> bool { 41 ( 0.00%) matches!(self.kind(), Slice(_)) . } . . #[inline] . pub fn is_array_slice(self) -> bool { . match self.kind() { . Slice(_) => true, . ty::RawPtr(ty, _) | Ref(_, ty, _) => matches!(ty.kind(), Slice(_)), . _ => false, -- line 1269 ---------------------------------------- -- line 1345 ---------------------------------------- . .try_to_target_usize(tcx) . .expect("expected SIMD field to have definite array size"), . *f0_elem_ty, . ) . } . . #[inline] . pub fn is_mutable_ptr(self) -> bool { 36 ( 0.00%) matches!(self.kind(), RawPtr(_, hir::Mutability::Mut) | Ref(_, _, hir::Mutability::Mut)) . } . . /// Get the mutability of the reference or `None` when not a reference . #[inline] . pub fn ref_mutability(self) -> Option { . match self.kind() { . Ref(_, _, mutability) => Some(*mutability), . _ => None, . } . } . . #[inline] . pub fn is_raw_ptr(self) -> bool { 4,782 ( 0.00%) matches!(self.kind(), RawPtr(_, _)) . } . . /// Tests if this is any kind of primitive pointer type (reference, raw pointer, fn pointer). . /// `Box` is *not* considered a pointer here! . #[inline] . pub fn is_any_ptr(self) -> bool { . self.is_ref() || self.is_raw_ptr() || self.is_fn_ptr() . } -- line 1375 ---------------------------------------- -- line 1461 ---------------------------------------- . | RawPtr(_, _) . | Infer(IntVar(_) | FloatVar(_)) . ) . } . . /// Returns `true` if this type is a floating point type. . #[inline] . pub fn is_floating_point(self) -> bool { 2,466 ( 0.00%) matches!(self.kind(), Float(_) | Infer(FloatVar(_))) . } . . #[inline] . pub fn is_trait(self) -> bool { 3 ( 0.00%) matches!(self.kind(), Dynamic(_, _)) . } . . #[inline] . pub fn is_enum(self) -> bool { 92 ( 0.00%) matches!(self.kind(), Adt(adt_def, _) if adt_def.is_enum()) . } . . #[inline] . pub fn is_union(self) -> bool { . matches!(self.kind(), Adt(adt_def, _) if adt_def.is_union()) . } . . #[inline] -- line 1487 ---------------------------------------- -- line 1496 ---------------------------------------- . . #[inline] . pub fn is_coroutine_closure(self) -> bool { . matches!(self.kind(), CoroutineClosure(..)) . } . . #[inline] . pub fn is_integral(self) -> bool { 14,829 ( 0.00%) matches!(self.kind(), Infer(IntVar(_)) | Int(_) | Uint(_)) . } . . #[inline] . pub fn is_fresh_ty(self) -> bool { . matches!(self.kind(), Infer(FreshTy(_))) . } . . #[inline] -- line 1512 ---------------------------------------- -- line 1521 ---------------------------------------- . . #[inline] . pub fn is_numeric(self) -> bool { . self.is_integral() || self.is_floating_point() . } . . #[inline] . pub fn is_signed(self) -> bool { 3,232 ( 0.00%) matches!(self.kind(), Int(_)) . } . . #[inline] . pub fn is_ptr_sized_integral(self) -> bool { 324 ( 0.00%) matches!(self.kind(), Int(ty::IntTy::Isize) | Uint(ty::UintTy::Usize)) . } . . #[inline] . pub fn has_concrete_skeleton(self) -> bool { . !matches!(self.kind(), Param(_) | Infer(_) | Error(_)) . } . . /// Checks whether a type recursively contains another type -- line 1542 ---------------------------------------- -- line 1630 ---------------------------------------- . . #[tracing::instrument(level = "trace", skip(tcx))] . pub fn unnormalized_fn_sig(self, tcx: TyCtxt<'tcx>) -> ty::Unnormalized<'tcx, PolyFnSig<'tcx>> { . self.kind().unnormalized_fn_sig(tcx) . } . . #[inline] . pub fn is_fn(self) -> bool { 84,149 ( 0.00%) matches!(self.kind(), FnDef(..) | FnPtr(..)) . } . . #[inline] . pub fn is_fn_ptr(self) -> bool { . matches!(self.kind(), FnPtr(..)) . } . . #[inline] . pub fn is_opaque(self) -> bool { 642 ( 0.00%) matches!(self.kind(), Alias(_, ty::AliasTy { kind: ty::Opaque { .. }, .. })) . } . . #[inline] . pub fn ty_adt_def(self) -> Option> { 139,973 ( 0.00%) match self.kind() { 49,027 ( 0.00%) Adt(adt, _) => Some(*adt), . _ => None, . } . } . . /// Returns a list of tuple type arguments. . /// . /// Panics when called on anything but a tuple. . #[inline] . pub fn tuple_fields(self) -> &'tcx List> { 144 ( 0.00%) match self.kind() { 72 ( 0.00%) Tuple(args) => args, . _ => bug!("tuple_fields called on non-tuple: {self:?}"), . } . } . . /// Returns a list of tuple type arguments, or `None` if `self` isn't a tuple. . #[inline] . pub fn opt_tuple_fields(self) -> Option<&'tcx List>> { . match self.kind() { -- line 1673 ---------------------------------------- 7,338 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_async_fn.rs -------------------------------------------------------------------------------- Ir -- line 34 ---------------------------------------- . pub MANUAL_ASYNC_FN, . style, . "manual implementations of `async` functions can be simplified using the dedicated syntax" . } . . declare_lint_pass!(ManualAsyncFn => [MANUAL_ASYNC_FN]); . . impl<'tcx> LateLintPass<'tcx> for ManualAsyncFn { 45,728 ( 0.00%) fn check_fn( . &mut self, . cx: &LateContext<'tcx>, . kind: FnKind<'tcx>, . decl: &'tcx FnDecl<'_>, . body: &'tcx Body<'_>, . span: Span, . fn_def_id: LocalDefId, . ) { . if let Some(header) = kind.header() 16,299 ( 0.00%) && !header.asyncness.is_async() . // Check that this function returns `impl Future` 4,863 ( 0.00%) && let FnRetTy::Return(ret_ty) = decl.output 9,742 ( 0.00%) && let TyKind::OpaqueDef(opaque) = ret_ty.kind 48 ( 0.00%) && let Some(trait_ref) = future_trait_ref(cx, opaque) . && let Some(output) = future_output_ty(trait_ref) . && captures_all_lifetimes(cx, fn_def_id, opaque.def_id) . // Check that the body of the function consists of one async block . && let ExprKind::Block(block, _) = body.value.kind . && block.stmts.is_empty() . && let Some(closure_body) = desugared_async_block(cx, block) . && let Some(vis_span_opt) = match cx.tcx.hir_node_by_def_id(fn_def_id) { . Node::Item(item) => Some(Some(item.vis_span)), -- line 64 ---------------------------------------- -- line 96 ---------------------------------------- . (block.span, body_snip), . ], . Applicability::MachineApplicable, . ); . } . }, . ); . } 45,728 ( 0.00%) } . } . . fn future_trait_ref<'tcx>(cx: &LateContext<'tcx>, opaque: &'tcx OpaqueTy<'tcx>) -> Option<&'tcx TraitRef<'tcx>> { 16 ( 0.00%) if let Some(trait_ref) = opaque.bounds.iter().find_map(|bound| { 16 ( 0.00%) if let GenericBound::Trait(poly) = bound { . Some(&poly.trait_ref) . } else { . None . } 80 ( 0.00%) }) && trait_ref.trait_def_id() == cx.tcx.lang_items().future_trait() 640 ( 0.00%) => ???:::lang_items (16x) 208 ( 0.00%) => ???:::trait_def_id (16x) . { . return Some(trait_ref); . } . . None . } . . fn future_output_ty<'tcx>(trait_ref: &'tcx TraitRef<'tcx>) -> Option<&'tcx Ty<'tcx>> { -- line 122 ---------------------------------------- 64 ( 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &Expr<'tcx>) { . // `&[foo.clone()]` expressions 507,308 ( 0.00%) if let ExprKind::AddrOf(_, mutability, arr) = &expr.kind . // mutable references would have a different meaning . && mutability.is_not() . . // check for single item arrays 31,746 ( 0.00%) && let ExprKind::Array([item]) = &arr.kind . . // check for clones 46 ( 0.00%) && let ExprKind::MethodCall(path, recv, _, _) = item.kind . . && self.msrv.meets(cx, { . if is_in_const_context(cx) { . msrvs::CONST_SLICE_FROM_REF . } else { . msrvs::SLICE_FROM_REF . } . }) -- line 84 ---------------------------------------- -- 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, . ); . } 1,937,824 ( 0.02%) } . } . . /// 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/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 { 2,180,052 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 562,663 ( 0.00%) if e.span.from_expansion() { . return; . } . 11,838 ( 0.00%) if let ExprKind::Binary(Spanned { node, .. }, left_side, right_side) = e.kind 23,676 ( 0.00%) && is_expn_of(left_side.span, sym::cfg).is_none() 134,283 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_expn_of (3,946x) 23,676 ( 0.00%) && is_expn_of(right_side.span, sym::cfg).is_none() 134,164 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_expn_of (3,946x) 19,730 ( 0.00%) && cx.typeck_results().expr_ty(left_side).is_bool() 157,936 ( 0.00%) => ???:::expr_ty (3,946x) 3,460 ( 0.00%) && cx.typeck_results().expr_ty(right_side).is_bool() 27,716 ( 0.00%) => ???:::expr_ty (692x) . { 692 ( 0.00%) let ignore_case = None::<(fn(_) -> _, &str)>; 692 ( 0.00%) let ignore_no_literal = None::<(fn(_, _) -> _, &str)>; 3,165 ( 0.00%) match node { . BinOpKind::Eq => { . let true_case = Some((|h| h, "equality checks against true are unnecessary")); . let false_case = Some(( 42 ( 0.00%) |h: Sugg<'tcx>| !h, 8,854 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/sugg.rs:::not (14x) . "equality checks against false can be replaced by a negation", . )); 1,089 ( 0.00%) check_comparison(cx, e, true_case, false_case, true_case, false_case, ignore_no_literal); 77,730,310 ( 0.65%) => site/frontend/rust-clippy/clippy_lints/src/bool_comparison.rs:clippy_lints::bool_comparison::check_comparison::<::check_expr::{closure#0}, ::check_expr::{closure#1}, ::check_expr::{closure#0}, ::check_expr::{closure#1}, fn(clippy_utils::sugg::Sugg, clippy_utils::sugg::Sugg) -> clippy_utils::sugg::Sugg> (363x) . }, . BinOpKind::Ne => { . let true_case = Some(( . |h: Sugg<'tcx>| !h, . "inequality checks against true can be replaced by a negation", . )); . let false_case = Some((|h| h, "inequality checks against false are unnecessary")); . check_comparison(cx, e, true_case, false_case, true_case, false_case, ignore_no_literal); 363 ( 0.00%) }, . BinOpKind::Lt => check_comparison( . cx, . e, . ignore_case, . Some((|h| h, "greater than checks against false are unnecessary")), . Some(( . |h: Sugg<'tcx>| !h, . "less than comparison against true can be replaced by a negation", -- line 76 ---------------------------------------- -- line 94 ---------------------------------------- . Some(( . |l: Sugg<'tcx>, r: Sugg<'tcx>| l.bit_and(&(!r)), . "order comparisons between booleans can be simplified", . )), . ), . _ => (), . } . } 1,937,824 ( 0.02%) } . } . 2,541 ( 0.00%) 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)>, . right_false: Option<(impl FnOnce(Sugg<'a>) -> Sugg<'a>, &'static str)>, . no_literal: Option<(impl FnOnce(Sugg<'a>, Sugg<'a>) -> Sugg<'a>, &'static str)>, . ) { 1,452 ( 0.00%) if let ExprKind::Binary(_, left_side, right_side) = e.kind { 363 ( 0.00%) let mut applicability = Applicability::MachineApplicable; . // Eliminate parentheses in `e` by using the lo pos of lhs and hi pos of rhs, . // calling `source_callsite` make sure macros are handled correctly, see issue #9907 4,356 ( 0.00%) let binop_span = left_side.span.source_callsite().to(right_side.span.source_callsite()); 50,094 ( 0.00%) => ???:::to (363x) 17,424 ( 0.00%) => ???:::source_callsite (726x) . 2,499 ( 0.00%) match (fetch_bool_expr(left_side), fetch_bool_expr(right_side)) { . (Some(true), None) => left_true.map_or((), |(h, m)| { . suggest_bool_comparison(cx, binop_span, right_side, applicability, m, h); . }), . (None, Some(true)) => right_true.map_or((), |(h, m)| { . suggest_bool_comparison(cx, binop_span, left_side, applicability, m, h); . }), . (Some(false), None) => left_false.map_or((), |(h, m)| { . suggest_bool_comparison(cx, binop_span, right_side, applicability, m, h); 14 ( 0.00%) }), . (None, Some(false)) => right_false.map_or((), |(h, m)| { 56 ( 0.00%) suggest_bool_comparison(cx, binop_span, left_side, applicability, m, h); 3,353,996 ( 0.03%) => site/frontend/rust-clippy/clippy_lints/src/bool_comparison.rs:clippy_lints::bool_comparison::suggest_bool_comparison::<::check_expr::{closure#1}> (14x) . }), . (None, None) => no_literal.map_or((), |(h, m)| { . let left_side = Sugg::hir_with_context(cx, left_side, binop_span.ctxt(), "..", &mut applicability); . let right_side = Sugg::hir_with_context(cx, right_side, binop_span.ctxt(), "..", &mut applicability); . span_lint_and_sugg( . cx, . BOOL_COMPARISON, . binop_span, -- line 139 ---------------------------------------- -- line 141 ---------------------------------------- . "try", . h(left_side, right_side).into_string(), . applicability, . ); . }), . _ => (), . } . } 2,904 ( 0.00%) } . 168 ( 0.00%) fn suggest_bool_comparison<'a, 'tcx>( . cx: &LateContext<'tcx>, . span: Span, . expr: &Expr<'_>, . mut app: Applicability, . message: &'static str, . conv_hint: impl FnOnce(Sugg<'a>) -> Sugg<'a>, . ) { 2,946 ( 0.00%) let hint = Sugg::hir_with_context(cx, expr, span.ctxt(), "..", &mut app); 12,298 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/sugg.rs:::hir_with_context (14x) 196 ( 0.00%) span_lint_and_sugg( 3,331,598 ( 0.03%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_sugg:: (14x) . cx, . BOOL_COMPARISON, . span, . message, . "try", 42 ( 0.00%) conv_hint(hint).into_string(), 476 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/sugg.rs:::into_string (14x) . app, . ); 70 ( 0.00%) } . . fn fetch_bool_expr(expr: &Expr<'_>) -> Option { 363 ( 0.00%) if let ExprKind::Lit(lit_ptr) = peel_blocks(expr).kind 726 ( 0.00%) && let LitKind::Bool(value) = lit_ptr.node . { . return Some(value); . } . None . } 341,586 ( 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/take_while.rs -------------------------------------------------------------------------------- Ir -- line 17 ---------------------------------------- . pub struct TakeWhile { . iter: I, . flag: bool, . predicate: P, . } . . impl TakeWhile { . pub(in crate::iter) const fn new(iter: I, predicate: P) -> TakeWhile { 150 ( 0.00%) TakeWhile { iter, flag: false, predicate } . } . } . . #[stable(feature = "core_impl_debug", since = "1.9.0")] . impl fmt::Debug for TakeWhile { . fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { . f.debug_struct("TakeWhile").field("iter", &self.iter).field("flag", &self.flag).finish() . } -- line 33 ---------------------------------------- -- line 37 ---------------------------------------- . impl Iterator for TakeWhile . where . P: FnMut(&I::Item) -> bool, . { . type Item = I::Item; . . #[inline] . fn next(&mut self) -> Option { 110 ( 0.00%) if self.flag { . None . } else { . let x = self.iter.next()?; 44 ( 0.00%) if (self.predicate)(&x) { . Some(x) . } else { . self.flag = true; . None . } . } . } . -- line 57 ---------------------------------------- -- line 73 ---------------------------------------- . R: Try, . { . fn check<'a, T, Acc, R: Try>( . flag: &'a mut bool, . p: &'a mut impl FnMut(&T) -> bool, . mut fold: impl FnMut(Acc, T) -> R + 'a, . ) -> impl FnMut(Acc, T) -> ControlFlow + 'a { . move |acc, x| { 59,471 ( 0.00%) if p(&x) { . ControlFlow::from_try(fold(acc, x)) . } else { 9,879 ( 0.00%) *flag = true; . ControlFlow::Break(try { acc }) . } . } . } . 11,646 ( 0.00%) if self.flag { . try { init } . } else { . let flag = &mut self.flag; . let p = &mut self.predicate; . self.iter.try_fold(init, check(flag, p, fold)).into_try() . } . } . -- line 98 ---------------------------------------- 36,667 ( 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 { 2,180,052 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 484,456 ( 0.00%) 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); . }, . ); . } 1,937,824 ( 0.02%) } . } . . /// 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)> { 520,151 ( 0.00%) let (has_ref, expr) = if let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner) = expr.kind { . (true, inner) 797,945 ( 0.01%) } else if let Some(parent) = get_parent_expr(cx, expr) // Already checked by the parent expr. 20,703,305 ( 0.17%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (159,589x) 275,893 ( 0.00%) && let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, _) = parent.kind . { . return None; . } else { . (false, expr) . }; . 329,698 ( 0.00%) if let ExprKind::Array(members) = expr.kind 290 ( 0.00%) && !members.is_empty() 126 ( 0.00%) && !span_contains_comment(cx, expr.span) 525 ( 0.00%) && !span_contains_cfg(cx, expr.span) 68,191 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/attrs.rs:clippy_utils::attrs::span_contains_cfg (105x) . { . return members . .iter() . .try_fold(Vec::new(), |mut acc, member| { 210 ( 0.00%) if let ExprKind::Lit(lit) = member.kind 62 ( 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 ---------------------------------------- 616,373 ( 0.01%) -------------------------------------------------------------------------------- -- 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 551,190 ( 0.00%) if let ExprKind::Call(box_from_raw, [arg]) = expr.kind 49,298 ( 0.00%) && let ExprKind::Path(QPath::TypeRelative(ty, seg)) = box_from_raw.kind 4,106 ( 0.00%) && seg.ident.name == sym::from_raw 1 ( 0.00%) && 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", . ); . } 1,937,824 ( 0.02%) } . } . . /// 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 2 ( 0.00%) if Some(def_id) == cx.tcx.lang_items().owned_box() { 40 ( 0.00%) => ???:::lang_items (1x) . return Some("Box"); . } . 8 ( 0.00%) if let Some(symbol) = cx.tcx.get_diagnostic_name(def_id) { 53 ( 0.00%) => ???:::get_diagnostic_name (1x) . if symbol == sym::Arc { . return Some("Arc"); . } else if symbol == sym::Rc { . return Some("Rc"); . } . } . 7 ( 0.00%) if matches!(cx.tcx.get_diagnostic_name(def_id), Some(sym::RcWeak | sym::ArcWeak)) { 53 ( 0.00%) => ???:::get_diagnostic_name (1x) . Some("Weak") . } else { . None . } . } 1 ( 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 { 968,912 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 517,641 ( 0.00%) if let ExprKind::MethodCall(name, recv, [_], _) = expr.kind 5,073 ( 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, . ); . } . } 968,912 ( 0.01%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/unused_io_amount.rs -------------------------------------------------------------------------------- Ir -- line 78 ---------------------------------------- . /// . /// We then check the individual expressions via `check_expr`. We use the same logic for . /// semi expressions and the final expression as we need to check match and if expressions . /// for binding of the io amount to `Ok(_)`. . /// . /// We explicitly check for the match source to be Normal as it needs special logic . /// to consider the arms, and we want to avoid breaking the logic for situations where things . /// get desugared to match. 196,128 ( 0.00%) fn check_block(&mut self, cx: &LateContext<'tcx>, block: &'tcx hir::Block<'tcx>) { 21,792 ( 0.00%) let fn_def_id = block.hir_id.owner.to_def_id(); 130,752 ( 0.00%) if let Some(impl_id) = cx.tcx.trait_impl_of_assoc(fn_def_id) { 2,528,723 ( 0.02%) => ???:::trait_impl_of_assoc (21,792x) . let trait_id = cx.tcx.impl_trait_id(impl_id); . // We don't want to lint inside io::Read or io::Write implementations, as the author has more . // information about their trait implementation than our lint, see https://github.com/rust-lang/rust-clippy/issues/4836 35,984 ( 0.00%) if let Some(trait_name) = cx.tcx.get_diagnostic_name(trait_id) 305,965 ( 0.00%) => ???:::get_diagnostic_name (4,498x) . && matches!(trait_name, sym::IoRead | sym::IoWrite) . { . return; . } . . let async_paths = [ . &paths::TOKIO_IO_ASYNCREADEXT, . &paths::TOKIO_IO_ASYNCWRITEEXT, -- line 100 ---------------------------------------- -- line 102 ---------------------------------------- . &paths::FUTURES_IO_ASYNCWRITEEXT, . ]; . . if async_paths.into_iter().any(|path| path.matches(cx, trait_id)) { . return; . } . } . 21,792 ( 0.00%) for stmt in block.stmts { 72,494 ( 0.00%) if let hir::StmtKind::Semi(exp) = stmt.kind { 18,204 ( 0.00%) check_expr(cx, exp); 755,235 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/unused_io_amount.rs:clippy_lints::unused_io_amount::check_expr (9,102x) . } . } . 65,376 ( 0.00%) if let Some(exp) = block.expr 36,895 ( 0.00%) && matches!( 29,322 ( 0.00%) exp.kind, . ExprKind::If(_, _, _) | ExprKind::Match(_, _, hir::MatchSource::Normal) . ) . { 52,083 ( 0.00%) check_expr(cx, exp); 566,947 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unused_io_amount.rs:clippy_lints::unused_io_amount::check_expr (5,787x) . } 128,040 ( 0.00%) } . } . . fn non_consuming_err_arm<'a>(cx: &LateContext<'a>, arm: &hir::Arm<'a>) -> bool { . // if there is a guard, we consider the result to be consumed . if arm.guard.is_some() { . return false; . } . if is_unreachable_or_panic(cx, arm.body) { -- line 132 ---------------------------------------- -- line 154 ---------------------------------------- . // if the body is unreachable or there is a panic, . // we consider the result to be consumed . return false; . } . . is_ok_wild_or_dotdot_pattern(cx, arm.pat) . } . 134,001 ( 0.00%) fn check_expr<'a>(cx: &LateContext<'a>, expr: &'a hir::Expr<'a>) { 67,822 ( 0.00%) match expr.kind { . ExprKind::If(cond, _, _) 19,292 ( 0.00%) if let ExprKind::Let(hir::LetExpr { pat, init, .. }) = cond.kind 10,285 ( 0.00%) && is_ok_wild_or_dotdot_pattern(cx, pat) 227,950 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unused_io_amount.rs:clippy_lints::unused_io_amount::is_ok_wild_or_dotdot_pattern (2,057x) . && let Some(op) = should_lint(cx, init) => . { . emit_lint(cx, cond.span, cond.hir_id, op, &[pat.span]); . }, . // we will capture only the case where the match is Ok( ) or Err( ) . // prefer to match the minimum possible, and expand later if needed . // to avoid false positives on something as used as this 5,202 ( 0.00%) ExprKind::Match(expr, [arm1, arm2], hir::MatchSource::Normal) if let Some(op) = should_lint(cx, expr) => { 14,209 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unused_io_amount.rs:clippy_lints::unused_io_amount::should_lint (336x) . if non_consuming_ok_arm(cx, arm1) && non_consuming_err_arm(cx, arm2) { . emit_lint(cx, expr.span, expr.hir_id, op, &[arm1.pat.span]); . } . if non_consuming_ok_arm(cx, arm2) && non_consuming_err_arm(cx, arm1) { . emit_lint(cx, expr.span, expr.hir_id, op, &[arm2.pat.span]); . } . }, . ExprKind::Match(_, _, hir::MatchSource::Normal) => {}, 68,800 ( 0.00%) _ if let Some(op) = should_lint(cx, expr) => { 655,509 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/unused_io_amount.rs:clippy_lints::unused_io_amount::should_lint (13,760x) . emit_lint(cx, expr.span, expr.hir_id, op, &[]); . }, . _ => {}, . } 119,112 ( 0.00%) } . 126,864 ( 0.00%) fn should_lint<'a>(cx: &LateContext<'a>, mut inner: &'a hir::Expr<'a>) -> Option { . inner = unpack_match(inner); 14,096 ( 0.00%) inner = unpack_try(cx, inner); . inner = unpack_call_chain(inner); . inner = unpack_await(cx, inner); . // we type-check it to get whether it's a read/write or their vectorized forms . // and keep only the ones that are produce io amount . check_io_mode(cx, inner) 126,864 ( 0.00%) } . . fn is_ok_wild_or_dotdot_pattern<'a>(cx: &LateContext<'a>, pat: &hir::Pat<'a>) -> bool { . // the if checks whether we are in a result Ok( ) pattern . // and the return checks whether it is unhandled . 7,330 ( 0.00%) if let PatKind::TupleStruct(ref path, inner_pat, _) = pat.kind . // we check against Result::Ok to avoid linting on Err(_) or something else. 7,506 ( 0.00%) && cx.qpath_res(path, pat.hir_id).ctor_parent(cx).is_lang_item(cx, hir::LangItem::ResultOk) 24,656 ( 0.00%) => ???:::qpath_res (1,072x) . { 4 ( 0.00%) if matches!(inner_pat, []) { . return true; . } . . if let [cons_pat] = inner_pat 2 ( 0.00%) && matches!(cons_pat.kind, PatKind::Wild) . { . return true; . } . return false; . } . false 2,057 ( 0.00%) } . . // this is partially taken from panic_unimplemented . fn is_unreachable_or_panic(cx: &LateContext<'_>, expr: &hir::Expr<'_>) -> bool { . let expr = peel_blocks(expr); . let Some(macro_call) = root_macro_call_first_node(cx, expr) else { . return false; . }; . if is_panic(cx, macro_call.def_id) { . return !cx.tcx.hir_is_inside_const_context(expr.hir_id); . } . cx.tcx.is_diagnostic_item(sym::unreachable_macro, macro_call.def_id) . } . . fn unpack_call_chain<'a>(mut expr: &'a hir::Expr<'a>) -> &'a hir::Expr<'a> { 44,663 ( 0.00%) while let ExprKind::MethodCall(path, receiver, ..) = expr.kind { . if matches!( 2,307 ( 0.00%) path.ident.name, 23,876 ( 0.00%) sym::unwrap . | sym::expect . | sym::unwrap_or . | sym::unwrap_or_else . | sym::ok . | sym::is_ok . | sym::is_err . | sym::or_else . | sym::or -- line 246 ---------------------------------------- -- line 249 ---------------------------------------- . } else { . break; . } . } . expr . } . . fn unpack_try<'a>(cx: &LateContext<'_>, mut expr: &'a hir::Expr<'a>) -> &'a hir::Expr<'a> { 33,985 ( 0.00%) while let ExprKind::Call(func, [arg_0]) = expr.kind 3,666 ( 0.00%) && let ExprKind::Path(qpath) = func.kind 3,666 ( 0.00%) && cx.tcx.qpath_is_lang_item(qpath, hir::LangItem::TryTraitBranch) 78,094 ( 0.00%) => ???:::qpath_is_lang_item (611x) . { . expr = arg_0; . } . expr . } . . fn unpack_match<'a>(mut expr: &'a hir::Expr<'a>) -> &'a hir::Expr<'a> { 43,480 ( 0.00%) while let ExprKind::Match(res, _, _) = expr.kind { . expr = res; . } . expr . } . . /// If `expr` is an (e).await, return the inner expression "e" that's being . /// waited on. Otherwise return None. . fn unpack_await<'a>(cx: &LateContext<'_>, expr: &'a hir::Expr<'a>) -> &'a hir::Expr<'a> { 23,614 ( 0.00%) if let ExprKind::Match(expr, _, hir::MatchSource::AwaitDesugar) = expr.kind . && let ExprKind::Call(func, [arg_0]) = expr.kind . && let ExprKind::Path(qpath) = func.kind . && cx.tcx.qpath_is_lang_item(qpath, hir::LangItem::IntoFutureIntoFuture) . { . return arg_0; . } . expr . } . . /// Check whether the current expr is a function call for an IO operation . fn check_io_mode(cx: &LateContext<'_>, call: &hir::Expr<'_>) -> Option { 23,610 ( 0.00%) let ExprKind::MethodCall(path, ..) = call.kind else { . return None; . }; . 6,870 ( 0.00%) let vectorized = match path.ident.as_str() { 73,280 ( 0.00%) => ???:::as_str (2,290x) 138 ( 0.00%) "write_vectored" | "read_vectored" => true, 680 ( 0.00%) "write" | "read" => false, . _ => { . return None; . }, . }; . 60 ( 0.00%) if let Some(method_def_id) = cx.typeck_results().type_dependent_def_id(call.hir_id) 612 ( 0.00%) => ???:::type_dependent_def_id (12x) 60 ( 0.00%) && let Some(trait_def_id) = cx.tcx.trait_of_assoc(method_def_id) 1,656 ( 0.00%) => ???:::trait_of_assoc (12x) . { . if let Some(diag_name) = cx.tcx.get_diagnostic_name(trait_def_id) { . match diag_name { . sym::IoRead => Some(IoOp::SyncRead(vectorized)), . sym::IoWrite => Some(IoOp::SyncWrite(vectorized)), . _ => None, . } . } else if paths::FUTURES_IO_ASYNCREADEXT.matches(cx, trait_def_id) -- line 309 ---------------------------------------- 53,918 ( 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/chain.rs -------------------------------------------------------------------------------- Ir -- line 29 ---------------------------------------- . // . // Only the "first" iterator is actually set `None` when exhausted, depending on whether you . // iterate forward or backward. If you mix directions, then both sides may be `None`. . a: Option, . b: Option, . } . impl Chain { . pub(in super::super) const fn new(a: A, b: B) -> Chain { 78,732 ( 0.00%) Chain { a: Some(a), b: Some(b) } . } . } . . /// Converts the arguments to iterators and links them together, in a chain. . /// . /// See the documentation of [`Iterator::chain`] for more. . /// . /// # Examples -- line 45 ---------------------------------------- -- line 73 ---------------------------------------- . impl Iterator for Chain . where . A: Iterator, . B: Iterator, . { . type Item = A::Item; . . #[inline] 783 ( 0.00%) fn next(&mut self) -> Option { 8,217 ( 0.00%) and_then_or_clear(&mut self.a, Iterator::next).or_else(|| self.b.as_mut()?.next()) 990 ( 0.00%) } . . #[inline] . #[rustc_inherit_overflow_checks] . fn count(self) -> usize { . let a_count = match self.a { . Some(a) => a.count(), . None => 0, . }; . let b_count = match self.b { . Some(b) => b.count(), . None => 0, . }; . a_count + b_count . } . 16,392 ( 0.00%) fn try_fold(&mut self, mut acc: Acc, mut f: F) -> R . where . Self: Sized, . F: FnMut(Acc, Self::Item) -> R, . R: Try, . { 6,123 ( 0.00%) if let Some(ref mut a) = self.a { . acc = a.try_fold(acc, &mut f)?; 12 ( 0.00%) self.a = None; . } 12 ( 0.00%) if let Some(ref mut b) = self.b { 24 ( 0.00%) acc = b.try_fold(acc, f)?; . // we don't fuse the second iterator . } . try { acc } 20,394 ( 0.00%) } . 128 ( 0.00%) fn fold(self, mut acc: Acc, mut f: F) -> Acc . where . F: FnMut(Acc, Self::Item) -> Acc, . { 18,420 ( 0.00%) if let Some(a) = self.a { . acc = a.fold(acc, &mut f); . } 9,798 ( 0.00%) if let Some(b) = self.b { . acc = b.fold(acc, f); . } . acc 144 ( 0.00%) } . . #[inline] . fn advance_by(&mut self, mut n: usize) -> Result<(), NonZero> { . if let Some(ref mut a) = self.a { . n = match a.advance_by(n) { . Ok(()) => return Ok(()), . Err(k) => k.get(), . }; -- line 135 ---------------------------------------- -- line 175 ---------------------------------------- . // Must exhaust a before b. . let a_last = self.a.and_then(Iterator::last); . let b_last = self.b.and_then(Iterator::last); . b_last.or(a_last) . } . . #[inline] . fn size_hint(&self) -> (usize, Option) { 84,626 ( 0.00%) match self { . Chain { a: Some(a), b: Some(b) } => { . let (a_lower, a_upper) = a.size_hint(); 10,618 ( 0.00%) let (b_lower, b_upper) = b.size_hint(); . . let lower = a_lower.saturating_add(b_lower); . . let upper = match (a_upper, b_upper) { . (Some(x), Some(y)) => x.checked_add(y), . _ => None, . }; . -- line 194 ---------------------------------------- -- line 325 ---------------------------------------- . fn default() -> Self { . Chain::new(Default::default(), Default::default()) . } . } . . #[inline] . fn and_then_or_clear(opt: &mut Option, f: impl FnOnce(&mut T) -> Option) -> Option { . let x = f(opt.as_mut()?); 72,858 ( 0.00%) if x.is_none() { 30,787 ( 0.00%) *opt = None; . } . x . } 260,094 ( 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 { 968,912 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 1,155,704 ( 0.01%) match &expr.kind { 28,112 ( 0.00%) ExprKind::MethodCall(path, func, [param], _) => { 10,146 ( 0.00%) if let Some(adt) = cx.typeck_results().expr_ty(func).peel_refs().ty_adt_def() 203,304 ( 0.00%) => ???:::expr_ty (5,073x) 3,722 ( 0.00%) && matches!( 12,742 ( 0.00%) (cx.tcx.get_diagnostic_name(adt.did()), path.ident.name), 225,948 ( 0.00%) => ???:::get_diagnostic_name (3,722x) 3,152 ( 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); . } . }, 55,436 ( 0.00%) ExprKind::Call(func, [param]) => { 45,191 ( 0.00%) if let ExprKind::Path(ref path) = func.kind 45,188 ( 0.00%) && let Some(def_id) = cx.qpath_res(path, func.hir_id).opt_def_id() 486,129 ( 0.00%) => ???:::qpath_res (11,297x) 55,975 ( 0.00%) && cx.tcx.is_diagnostic_item(sym::permissions_from_mode, def_id) 863,432 ( 0.01%) => ???:::is_diagnostic_item (11,195x) . && 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); . } . }, . _ => {}, . } 1,211,140 ( 0.01%) } . } . . 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 ---------------------------------------- 33,891 ( 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 { 1,937,824 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . if let Some(higher::If { cond, then, .. }) = higher::If::hir(expr) 9,474 ( 0.00%) && let ExprKind::MethodCall(_, target_arg, [pattern], _) = cond.kind 56 ( 0.00%) && let ExprKind::Path(target_path) = &target_arg.kind 85 ( 0.00%) && let Some(method_def_id) = cx.typeck_results().type_dependent_def_id(cond.hir_id) 867 ( 0.00%) => ???:::type_dependent_def_id (17x) . { 136 ( 0.00%) let strip_kind = match cx.tcx.get_diagnostic_name(method_def_id) { 989 ( 0.00%) => ???:::get_diagnostic_name (17x) . Some(sym::str_starts_with) => StripKind::Prefix, . Some(sym::str_ends_with) => StripKind::Suffix, . _ => return, . }; 6 ( 0.00%) let target_res = cx.qpath_res(target_path, target_arg.hir_id); 23 ( 0.00%) => ???:::qpath_res (1x) 5 ( 0.00%) if target_res == Res::Err { 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/def.rs:::eq (1x) . return; . } . 5 ( 0.00%) if let Res::Local(hir_id) = target_res 13 ( 0.00%) && let Some(used_mutably) = mutated_variables(then, cx) 58,399 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/usage.rs:clippy_utils::usage::mutated_variables (1x) . && used_mutably.contains(&hir_id) . { . return; 1 ( 0.00%) } 10 ( 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) . 14 ( 0.00%) let (strippings, bindings) = find_stripping(cx, strip_kind, target_res, pattern, then, expr.span.ctxt()); 659 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_strip.rs:clippy_lints::manual_strip::find_stripping (1x) 1 ( 0.00%) if !strippings.is_empty() && self.msrv.meets(cx, msrvs::STR_STRIP_PREFIX) { . let kind_word = match strip_kind { . StripKind::Prefix => "prefix", . StripKind::Suffix => "suffix", . }; . . let test_span = expr.span.until(then.span); . . // If the first use is a simple `let` statement, reuse its identifier in the `if let Some(…)` and -- line 103 ---------------------------------------- -- line 144 ---------------------------------------- . ) . .collect(), . app, . ); . }, . ); . } . } 1,937,824 ( 0.02%) } . } . . // 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 ---------------------------------------- -- line 189 ---------------------------------------- . constant_length(cx, pattern, ctxt).is_some_and(|length| n == length) . } else { . len_arg(cx, expr).is_some_and(|arg| eq_expr_value(cx, SyntaxContext::root(), pattern, arg)) . } . } . . // Tests if `expr` is a `&str`. . fn is_ref_str(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { 12 ( 0.00%) match cx.typeck_results().expr_ty_adjusted(expr).kind() { 69 ( 0.00%) => ???:::expr_ty_adjusted (1x) 1 ( 0.00%) ty::Ref(_, ty, _) => ty.is_str(), . _ => false, . } . } . . // Removes the outer `AddrOf` expression if needed. . fn peel_ref<'a>(expr: &'a Expr<'_>) -> &'a Expr<'a> { 5 ( 0.00%) if let ExprKind::AddrOf(BorrowKind::Ref, _, unref) = &expr.kind { . unref . } else { . expr . } . } . . /// Find expressions where `target` is stripped using the length of `pattern`. . /// We'll suggest replacing these expressions with the result of the `strip_{prefix,suffix}` . /// method. . /// Also, all bindings found during the visit are counted and returned. 4 ( 0.00%) fn find_stripping<'tcx>( . cx: &LateContext<'tcx>, . strip_kind: StripKind, . target: Res, . pattern: &'tcx Expr<'_>, . expr: &'tcx Expr<'tcx>, . ctxt: SyntaxContext, . ) -> (Vec<&'tcx Expr<'tcx>>, FxHashMap) { . struct StrippingFinder<'a, 'tcx> { -- line 224 ---------------------------------------- -- line 227 ---------------------------------------- . target: Res, . pattern: &'tcx Expr<'tcx>, . results: Vec<&'tcx Expr<'tcx>>, . bindings: FxHashMap, . ctxt: SyntaxContext, . } . . impl<'tcx> Visitor<'tcx> for StrippingFinder<'_, 'tcx> { 32 ( 0.00%) fn visit_expr(&mut self, ex: &'tcx Expr<'_>) { 10 ( 0.00%) if is_ref_str(self.cx, ex) . && let unref = peel_ref(ex) 2 ( 0.00%) && let ExprKind::Index(indexed, index, _) = &unref.kind . && let Some(higher::Range { start, end, .. }) = higher::Range::hir(self.cx, index) . && let ExprKind::Path(path) = &indexed.kind . && self.cx.qpath_res(path, ex.hir_id) == self.target . { . match (self.strip_kind, start, end) { . (StripKind::Prefix, Some(start), None) . if eq_pattern_length(self.cx, self.pattern, start, self.ctxt) => . { -- line 246 ---------------------------------------- -- line 262 ---------------------------------------- . { . self.results.push(ex); . return; . }, . _ => {}, . } . } . 12 ( 0.00%) walk_expr(self, ex); 483 ( 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 (1x) 32 ( 0.00%) } . . fn visit_pat(&mut self, pat: &'tcx rustc_hir::Pat<'tcx>) -> Self::Result { . if let PatKind::Binding(_, _, ident, _) = pat.kind { . *self.bindings.entry(ident.name).or_default() += 1; . } . walk_pat(self, pat); . } . } . 16 ( 0.00%) let mut finder = StrippingFinder { . cx, . strip_kind, . target, . pattern, . results: vec![], . bindings: FxHashMap::default(), . ctxt, . }; 2 ( 0.00%) walk_expr(&mut finder, expr); 625 ( 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:: (1x) 8 ( 0.00%) (finder.results, finder.bindings) 3 ( 0.00%) } 47 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/redundant_locals.rs -------------------------------------------------------------------------------- Ir -- line 42 ---------------------------------------- . pub REDUNDANT_LOCALS, . suspicious, . "redundant redefinition of a local binding" . } . . declare_lint_pass!(RedundantLocals => [REDUNDANT_LOCALS]); . . impl<'tcx> LateLintPass<'tcx> for RedundantLocals { 180,549 ( 0.00%) fn check_local(&mut self, cx: &LateContext<'tcx>, local: &'tcx LetStmt<'tcx>) { 120,366 ( 0.00%) if !local.span.is_desugaring(DesugaringKind::Async) 1,958,707 ( 0.02%) => ???:::is_desugaring (20,061x) . // the pattern is a single by-value binding 234,171 ( 0.00%) && let PatKind::Binding(BindingMode(ByRef::No, mutability), _, ident, None) = local.pat.kind . // the binding is not type-ascribed 19,332 ( 0.00%) && local.ty.is_none() . // the expression is a resolved path 57,714 ( 0.00%) && let Some(expr) = local.init 44,928 ( 0.00%) && let ExprKind::Path(qpath @ QPath::Resolved(None, path)) = expr.kind . // the path is a single segment equal to the local's name 1,320 ( 0.00%) && let [last_segment] = path.segments 18 ( 0.00%) && last_segment.ident == ident . // resolve the path to its defining binding pattern 90 ( 0.00%) && let Res::Local(binding_id) = cx.qpath_res(&qpath, expr.hir_id) 207 ( 0.00%) => ???:::qpath_res (9x) 72 ( 0.00%) && let Node::Pat(binding_pat) = cx.tcx.hir_node(binding_id) 593 ( 0.00%) => ???:::hir_node (9x) . // the previous binding has the same mutability 72 ( 0.00%) && find_binding(binding_pat, ident).is_some_and(|bind| bind.1 == mutability) . // the local does not change the effect of assignments to the binding. see #11290 10 ( 0.00%) && !affects_assignments(cx, mutability, binding_id, local.hir_id) 4 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/redundant_locals.rs:clippy_lints::redundant_locals::affects_assignments (1x) . // the local does not affect the code's drop behavior 7 ( 0.00%) && !needs_ordered_drop(cx, cx.typeck_results().expr_ty(expr)) 359 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::needs_ordered_drop (1x) 40 ( 0.00%) => ???:::expr_ty (1x) . // the local is user-controlled 4 ( 0.00%) && !local.span.in_external_macro(cx.sess().source_map()) 117 ( 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 (1x) 5 ( 0.00%) && !is_from_proc_macro(cx, expr) 660 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::is_from_proc_macro:: (1x) 8 ( 0.00%) && !is_by_value_closure_capture(cx, local.hir_id, binding_id) 1,610 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/redundant_locals.rs:clippy_lints::redundant_locals::is_by_value_closure_capture (1x) . { . span_lint_and_help( . cx, . REDUNDANT_LOCALS, . local.span, 3 ( 0.00%) format!("redundant redefinition of a binding `{ident}`"), 3 ( 0.00%) Some(binding_pat.span), 2 ( 0.00%) format!("`{ident}` is initially defined here"), . ); . } 160,488 ( 0.00%) } . } . . /// Checks if the enclosing body is a closure and if the given local is captured by value. . /// . /// In those cases, the redefinition may be necessary to force a move: . /// ``` . /// fn assert_static(_: T) {} . /// . /// let v = String::new(); . /// let closure = || { . /// let v = v; // <- removing this redefinition makes `closure` no longer `'static` . /// dbg!(&v); . /// }; . /// assert_static(closure); . /// ``` 8 ( 0.00%) fn is_by_value_closure_capture(cx: &LateContext<'_>, redefinition: HirId, root_variable: HirId) -> bool { 3 ( 0.00%) let closure_def_id = cx.tcx.hir_enclosing_body_owner(redefinition); 1,527 ( 0.00%) => ???:::hir_enclosing_body_owner (1x) . 6 ( 0.00%) cx.tcx.is_closure_like(closure_def_id.to_def_id()) 58 ( 0.00%) => ???:::is_closure_like (1x) . && cx.tcx.closure_captures(closure_def_id).iter().any(|c| { . matches!(c.info.capture_kind, UpvarCapture::ByValue) . && matches!(c.place.base, PlaceBase::Upvar(upvar) if upvar.var_path.hir_id == root_variable) . }) 7 ( 0.00%) } . . /// Find the annotation of a binding introduced by a pattern, or `None` if it's not introduced. . fn find_binding(pat: &Pat<'_>, name: Ident) -> Option { 18 ( 0.00%) let mut ret = None; . 27 ( 0.00%) pat.each_binding_or_first(&mut |annotation, _, _, ident| { . if ident == name { 27 ( 0.00%) ret = Some(annotation); . } . }); . 9 ( 0.00%) ret . } . . /// Check if a rebinding of a local changes the effect of assignments to the binding. . fn affects_assignments(cx: &LateContext<'_>, mutability: Mutability, bind: HirId, rebind: HirId) -> bool { . // the binding is mutable and the rebinding is in a different scope than the original binding 2 ( 0.00%) mutability == Mutability::Mut && cx.tcx.hir_get_enclosing_scope(bind) != cx.tcx.hir_get_enclosing_scope(rebind) 1 ( 0.00%) } 66 ( 0.00%) -------------------------------------------------------------------------------- -- 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) { 3,752 ( 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 187 ---------------------------------------- . Self::UnusualByteGroupings => ( . UNUSUAL_BYTE_GROUPINGS, . "digits of hex, binary or octal literal not in groups of equal size", . "consider", . ), . } . } . 3 ( 0.00%) fn display(&self, num_lit: &NumericLiteral<'_>, cx: &EarlyContext<'_>, span: Span) { 2,148 ( 0.00%) let (lint, message, try_msg) = self.lint_and_text(); . #[expect(clippy::collapsible_span_lint_calls, reason = "rust-clippy#7797")] 5,371 ( 0.00%) span_lint_and_then(cx, lint, span, message, |diag| { 712 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then::::display::{closure#0}> (1x) . diag.span_suggestion(span, try_msg, num_lit.format(), Applicability::MaybeIncorrect); . }); 2 ( 0.00%) } . } . . pub struct LiteralDigitGrouping { . lint_fraction_readability: bool, . } . . impl EarlyLintPass for LiteralDigitGrouping { 1,416,289 ( 0.01%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { . // `NumericLiteral::from_lit_kind` only accepts integer and float literals. 416,829 ( 0.00%) if let ExprKind::Lit(lit) = expr.kind 36,525 ( 0.00%) && matches!(lit.kind, token::LitKind::Integer | token::LitKind::Float) 27,276 ( 0.00%) && !expr.span.in_external_macro(cx.sess().source_map()) . { . self.check_lit(cx, lit, expr.span); . } 1,618,616 ( 0.01%) } . } . . // 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) { 44,184 ( 0.00%) if let Some(src) = span.get_text(cx) 50,496 ( 0.00%) && let Ok(lit_kind) = LitKind::from_token_lit(lit) 1,385,944 ( 0.01%) => ???:::from_token_lit (6,312x) 132,552 ( 0.00%) && let Some(mut num_lit) = NumericLiteral::from_lit_kind(&src, &lit_kind) 968,319 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/numeric_literal.rs:::from_lit_kind (6,312x) 157,800 ( 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 (6,312x) . { . if !Self::check_for_mistyped_suffix(cx, span, &mut num_lit) { . return; . } . . if Self::is_literal_uuid_formatted(&num_lit) { . return; . } . 18,936 ( 0.00%) let result = (|| { 2,103 ( 0.00%) let integral_group_size = Self::get_group_size(num_lit.integer.split('_'), num_lit.radix, true)?; 17,328 ( 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 { 6,312 ( 0.00%) if num_lit.suffix.is_some() { . return true; . } . 16,461 ( 0.00%) let (part, mistyped_suffixes, is_float) = if let Some((_, exponent)) = &mut num_lit.exponent { . (exponent, &["32", "64"][..], true) 5,487 ( 0.00%) } else if num_lit.fraction.is_some() { . return true; . } else { . (&mut num_lit.integer, &["8", "16", "32", "64"][..], false) . }; . 10,974 ( 0.00%) let mut split = part.rsplit('_'); 10,974 ( 0.00%) let last_group = split.next().expect("At least one group"); 5,519 ( 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 { 4,206 ( 0.00%) if num_lit.radix != Radix::Hexadecimal { . return false; . } . . // UUIDs should not have a fraction . if num_lit.fraction.is_some() { . return false; . } . 4,206 ( 0.00%) let group_sizes: Vec = num_lit.integer.split('_').map(str::len).collect(); 4,206 ( 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"); . 12,624 ( 0.00%) if (radix == Radix::Binary || radix == Radix::Octal || radix == Radix::Hexadecimal) . && let Some(second_size) = groups.next() 19 ( 0.00%) && (!groups.all(|i| i == second_size) || first > second_size) . { . return Err(WarningType::UnusualByteGroupings); . } . . if let Some(second) = groups.next() { 7 ( 0.00%) if !groups.all(|x| x == second) || first > second { . Err(WarningType::InconsistentDigitGrouping) 12 ( 0.00%) } else if second > 4 { . Err(WarningType::LargeDigitGroups) . } else { . Ok(Some(second)) . } 12,612 ( 0.00%) } else if first > 5 && lint_unreadable { . Err(WarningType::UnreadableLiteral) . } else { . Ok(None) . } . } . } . . pub struct DecimalLiteralRepresentation { . threshold: u64, . } . . impl EarlyLintPass for DecimalLiteralRepresentation { 1,416,289 ( 0.01%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { . // Only integer tokens can produce `LitKind::Int`. 404,654 ( 0.00%) if let ExprKind::Lit(lit) = expr.kind . && lit.kind == token::LitKind::Integer 20,457 ( 0.00%) && !expr.span.in_external_macro(cx.sess().source_map()) . { 31,560 ( 0.00%) self.check_lit(cx, lit, expr.span); . } 1,618,616 ( 0.01%) } . } . . 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. 44,184 ( 0.00%) if let Ok(lit_kind) = LitKind::from_token_lit(lit) 1,385,944 ( 0.01%) => ???:::from_token_lit (6,312x) 25,248 ( 0.00%) && let LitKind::Int(val, _) = lit_kind 6,312 ( 0.00%) && val >= u128::from(self.threshold) 2,160 ( 0.00%) && let Some(src) = span.get_text(cx) 98,712 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/source.rs:::get_text::<&rustc_lint::context::EarlyContext> (216x) 1,296 ( 0.00%) && let Some(num_lit) = NumericLiteral::from_lit_kind(&src, &lit_kind) 34,605 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/numeric_literal.rs:::from_lit_kind (216x) 5,400 ( 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 (216x) . && num_lit.radix == Radix::Decimal . { 12 ( 0.00%) let hex = format!("{val:#X}"); 20 ( 0.00%) let num_lit = NumericLiteral::new(&hex, num_lit.suffix, false); 288 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/numeric_literal.rs:::new (4x) 8 ( 0.00%) let _: Result<(), ()> = Self::do_lint(num_lit.integer).map_err(|warning_type| { 2 ( 0.00%) warning_type.display(&num_lit, cx, span); 733 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/literal_representation.rs:::display (1x) . }); . } . } . . fn do_lint(digits: &str) -> Result<(), WarningType> { 8 ( 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); . } 8 ( 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 14 ( 0.00%) if ((f.eq("1") || f.eq("2") || f.eq("4") || f.eq("8")) && m.chars().all(|c| c == '0')) 8 ( 0.00%) || ((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 10 ( 0.00%) || ((f.eq("7") || f.eq("F")) && s.chars().all(|c| c == '0' || c == 'F')) . { . return Err(WarningType::DecimalRepresentation); . } . } . . Ok(()) . } . } -- line 500 ---------------------------------------- 94,255 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/large_const_arrays.rs -------------------------------------------------------------------------------- Ir -- line 41 ---------------------------------------- . impl LargeConstArrays { . pub fn new(conf: &'static Conf) -> Self { . Self { . maximum_allowed_size: conf.array_size_threshold, . } . } . . /// Checks recursively checks whether `ty` has an array exceeding allowed size 2,280 ( 0.00%) fn check_impl<'a>(&self, cx: &LateContext<'a>, ty: Ty<'a>) -> bool { 1,572 ( 0.00%) match ty.kind() { 83 ( 0.00%) ty::Adt(adt_def, args) => adt_def . .all_fields() 664 ( 0.00%) .any(|f| self.check_impl(cx, f.ty(cx.tcx, args).skip_norm_wip())), 7,321 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/large_const_arrays.rs:::check_impl'2 (83x) 5,819 ( 0.00%) => ???:::ty (83x) . ty::Array(element_type, cst) => { 24 ( 0.00%) let normalized = cx . .tcx 36 ( 0.00%) .try_normalize_erasing_regions(cx.typing_env(), Unnormalized::new_wip(*cst)) 189 ( 0.00%) => ???:::typing_env (9x) . .unwrap_or(*cst); 24 ( 0.00%) if let Some(element_count) = normalized.try_to_target_usize(cx.tcx) 12 ( 0.00%) && let Ok(element_size) = cx.layout_of(*element_type).map(|l| l.size.bytes()) 72 ( 0.00%) && u128::from(self.maximum_allowed_size) < u128::from(element_count) * u128::from(element_size) . { . true . } else { . false . } . }, . ty::Tuple(fields) => fields.iter().any(|f| self.check_impl(cx, f)), . _ => false, . } 1,824 ( 0.00%) } . } . . impl<'tcx> LateLintPass<'tcx> for LargeConstArrays { 41,566 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) { 11,876 ( 0.00%) if let ItemKind::Const(ident, generics, _, _) = &item.kind . // Since static items may not have generics, skip generic const items. . // FIXME(generic_const_items): I don't think checking `generics.hwcp` suffices as it . // doesn't account for empty where-clauses that only consist of keyword `where` IINM. 692 ( 0.00%) && generics.params.is_empty() && !generics.has_where_clause_predicates 346 ( 0.00%) && !item.span.from_expansion() 435 ( 0.00%) && let ty = cx.tcx.type_of(item.owner_id).instantiate_identity().skip_norm_wip() 580 ( 0.00%) && self.check_impl(cx, ty) 493,825 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/large_const_arrays.rs:::check_impl (145x) . { . let hi_pos = ident.span.lo() - BytePos::from_usize(1); . let sugg_span = Span::new( . hi_pos - BytePos::from_usize("const".len()), . hi_pos, . item.span.ctxt(), . item.span.parent(), . ); -- line 91 ---------------------------------------- -- line 99 ---------------------------------------- . sugg_span, . "make this a static item", . "static", . Applicability::MachineApplicable, . ); . }, . ); . } 47,504 ( 0.00%) } . } 48 ( 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 { 726,684 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 517,641 ( 0.00%) if let ExprKind::MethodCall(path, receiver, [arg], _) = &expr.kind 10,146 ( 0.00%) && let ExprKind::Lit(lit) = &arg.kind 2,793 ( 0.00%) && LitKind::Bool(false) == lit.node 2,011 ( 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 (399x) 4 ( 0.00%) && path.ident.name == sym::set_readonly . && cx . .typeck_results() . .expr_ty(receiver) . .is_diag_item(cx, sym::FsPermissions) . { . span_lint_and_then( . cx, . PERMISSIONS_SET_READONLY_FALSE, -- line 47 ---------------------------------------- -- 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", . ); . }, . ); . } 968,912 ( 0.01%) } . } 401 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/ifs/same_functions_in_if_cond.rs -------------------------------------------------------------------------------- Ir -- line 2 ---------------------------------------- . use clippy_utils::{SpanlessEq, eq_expr_value, hash_expr, search_same}; . use rustc_hir::Expr; . use rustc_lint::LateContext; . use rustc_span::SyntaxContext; . . use super::SAME_FUNCTIONS_IN_IF_CONDITION; . . /// Implementation of `SAME_FUNCTIONS_IN_IF_CONDITION`. 36,368 ( 0.00%) pub(super) fn check(cx: &LateContext<'_>, conds: &[&Expr<'_>]) { 4,791 ( 0.00%) let eq: &dyn Fn(&&Expr<'_>, &&Expr<'_>) -> bool = &|&lhs, &rhs| -> bool { . // Do not lint if any expr originates from a macro 140 ( 0.00%) if lhs.span.from_expansion() || rhs.span.from_expansion() { . return false; . } . // Do not spawn warning if `IFS_SAME_COND` already produced it. 315 ( 0.00%) if eq_expr_value(cx, SyntaxContext::root(), lhs, rhs) { 54,041 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:clippy_utils::hir_utils::eq_expr_value (35x) . return false; . } 210 ( 0.00%) SpanlessEq::new(cx).eq_expr(SyntaxContext::root(), lhs, rhs) 73,425 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:::eq_expr (35x) 245 ( 0.00%) }; . 40,946 ( 0.00%) for group in search_same(conds, |e| hash_expr(cx, e), eq) { 36,124 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:clippy_utils::hir_utils::hash_expr (32x) . let spans: Vec<_> = group.into_iter().map(|expr| expr.span).collect(); . span_lint( . cx, . SAME_FUNCTIONS_IN_IF_CONDITION, . spans, . "these `if` branches have the same function call", . ); . } 36,368 ( 0.00%) } 9,092 ( 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 { 2,180,052 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { . use rustc_ast::LitKind; . 1,949,122 ( 0.02%) if let ExprKind::Call(fun, [bytes_arg]) = e.kind . // Find `std::str::converts::from_utf8` or `std::primitive::str::from_utf8` 33,585 ( 0.00%) && let Some(sym::str_from_utf8 | sym::str_inherent_from_utf8) = 11,298 ( 0.00%) fun.res(cx).opt_diag_name(cx) . . // Find string::as_bytes 10 ( 0.00%) && let ExprKind::AddrOf(BorrowKind::Ref, _, args) = bytes_arg.kind 6 ( 0.00%) && let ExprKind::Index(left, right, _) = args.kind 6 ( 0.00%) && let (method_names, expressions, _) = method_calls(left, 1) 198 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::method_calls (1x) . && method_names == [sym::as_bytes] . && expressions.len() == 1 . && expressions[0].1.is_empty() . . // Check for slicer . && let ExprKind::Struct(&qpath, _, _) = right.kind . && cx.tcx.qpath_is_lang_item(qpath, LangItem::Range) . { -- line 305 ---------------------------------------- -- 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, . ); . } . 512,568 ( 0.00%) if !e.span.in_external_macro(cx.sess().source_map()) . && let ExprKind::MethodCall(path, receiver, ..) = &e.kind 27,184 ( 0.00%) && path.ident.name == sym::as_bytes 4 ( 0.00%) && 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, . STRING_LIT_AS_BYTES, -- line 334 ---------------------------------------- -- line 362 ---------------------------------------- . snippet_with_applicability(cx, receiver.span, r#""foo""#, &mut applicability) . ), . applicability, . ); . } . } . } . 270,340 ( 0.00%) if let ExprKind::MethodCall(path, recv, [], _) = &e.kind 15,930 ( 0.00%) && path.ident.name == sym::into_bytes 4 ( 0.00%) && 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() . { . let mut applicability = Applicability::MachineApplicable; -- line 380 ---------------------------------------- -- line 387 ---------------------------------------- . "consider using a byte string literal instead", . format!( . "b{}.to_vec()", . snippet_with_applicability(cx, recv.span, r#""..""#, &mut applicability) . ), . applicability, . ); . } 1,937,824 ( 0.02%) } . } . . 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &Expr<'_>) { . let tyckres = cx.typeck_results(); 520,533 ( 0.00%) if let ExprKind::MethodCall(path, split_recv, [], split_ws_span) = expr.kind 7,965 ( 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, . ); . } 1,937,824 ( 0.02%) } . } . . 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 ---------------------------------------- 253,528 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/question_mark.rs -------------------------------------------------------------------------------- Ir -- line 123 ---------------------------------------- . /// . /// NB: This conveniently prevents the cause of . /// issue [#12412](https://github.com/rust-lang/rust-clippy/issues/12412), . /// since accessing an `Option` field from a borrowed struct requires borrow, such as . /// `&some_struct.opt`, which is type of `&Option`. And we can't suggest `&some_struct.opt?` . /// or `(&some_struct.opt)?` since the first one has different semantics and the later does . /// not implements `Try`. . fn init_expr_can_use_question_mark(cx: &LateContext<'_>, init_expr: &Expr<'_>) -> bool { 2 ( 0.00%) let init_ty = cx.typeck_results().expr_ty_adjusted(init_expr); 69 ( 0.00%) => ???:::expr_ty_adjusted (1x) 2 ( 0.00%) cx.tcx 1 ( 0.00%) .lang_items() 40 ( 0.00%) => ???:::lang_items (1x) . .try_trait() 5 ( 0.00%) .is_some_and(|did| implements_trait(cx, init_ty, did, &[])) 8,063 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::implements_trait (1x) . } . 39,701 ( 0.00%) if let StmtKind::Let(LetStmt { . pat, . init: Some(init_expr), . els: Some(els), . .. 79,815 ( 0.00%) }) = stmt.kind 2 ( 0.00%) && 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 = . Sugg::hir_with_context(cx, init_expr, stmt.span.ctxt(), "..", &mut applicability).maybe_paren(); -- line 152 ---------------------------------------- -- line 198 ---------------------------------------- . "this `let...else` may be rewritten with the `?` operator", . "replace it with", . sugg, . applicability, . ); . } . } . 17,712 ( 0.00%) fn is_early_return(smbl: Symbol, cx: &LateContext<'_>, if_block: &IfBlockType<'_>) -> bool { 6,642 ( 0.00%) match *if_block { 282 ( 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. 384 ( 0.00%) caller_ty.is_diag_item(cx, smbl) 240 ( 0.00%) && expr_return_none_or_err(smbl, cx, if_then, caller, None) 1,276 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:clippy_lints::question_mark::expr_return_none_or_err (30x) . && match smbl { . sym::Option => call_sym == sym::is_none, . sym::Result => call_sym == sym::is_err, . _ => false, . } . }, 1,932 ( 0.00%) IfBlockType::IfLet(res, let_expr_ty, let_pat_sym, let_expr, if_then, if_else) => { 3,444 ( 0.00%) let_expr_ty.is_diag_item(cx, smbl) . && match smbl { 3,380 ( 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. 1,071 ( 0.00%) res.ctor_parent(cx).is_lang_item(cx, OptionSome) 342 ( 0.00%) && if_else.is_some_and(|inner| expr_return_none_or_err(smbl, cx, inner, let_expr, None)) 2,964 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:clippy_lints::question_mark::expr_return_none_or_err (57x) . }, . sym::Result => { 4 ( 0.00%) (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)) . })) 6 ( 0.00%) || res.ctor_parent(cx).is_lang_item(cx, ResultErr) 11 ( 0.00%) && expr_return_none_or_err(smbl, cx, if_then, let_expr, Some(let_pat_sym)) 32 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:clippy_lints::question_mark::expr_return_none_or_err (1x) . && if_else.is_none() . }, . _ => false, . } . }, . } 17,712 ( 0.00%) } . 352 ( 0.00%) fn expr_return_none_or_err( . smbl: Symbol, . cx: &LateContext<'_>, . expr: &Expr<'_>, . cond_expr: &Expr<'_>, . err_sym: Option, . ) -> bool { 628 ( 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), 6 ( 0.00%) ExprKind::Path(ref qpath) => match smbl { 12 ( 0.00%) sym::Option => cx 36 ( 0.00%) .qpath_res(qpath, expr.hir_id) 138 ( 0.00%) => ???:::qpath_res (6x) 4 ( 0.00%) .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, . }, 32 ( 0.00%) ExprKind::Call(call_expr, [arg]) => { 15 ( 0.00%) if smbl == sym::Result . && let ExprKind::Path(QPath::Resolved(_, path)) = &call_expr.kind . && let Some(segment) = path.segments.first() . && let Some(err_sym) = err_sym . && let ExprKind::Path(QPath::Resolved(_, arg_path)) = &arg.kind . && let Some(PathSegment { ident, .. }) = arg_path.segments.first() . { . return segment.ident.name == sym::Err && err_sym == ident.name; . } . false . }, . _ => false, . } 440 ( 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) 27,132 ( 0.00%) && !is_else_clause(cx.tcx, expr) 779,326 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_else_clause (4,522x) 9,268 ( 0.00%) && let ExprKind::MethodCall(segment, caller, [], _) = &cond.kind 282 ( 0.00%) && let caller_ty = cx.typeck_results().expr_ty(caller) 5,640 ( 0.00%) => ???:::expr_ty (141x) 1,410 ( 0.00%) && let if_block = IfBlockType::IfIs(caller, caller_ty, segment.ident.name, then) 1,410 ( 0.00%) && (is_early_return(sym::Option, cx, &if_block) || is_early_return(sym::Result, cx, &if_block)) 23,804 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:clippy_lints::question_mark::is_early_return (282x) . { . 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 { 999 ( 0.00%) let scrutinee_ty = cx.typeck_results().expr_ty_adjusted(scrutinee).peel_refs(); 22,437 ( 0.00%) => ???:::expr_ty_adjusted (333x) . let ty::Adt(scrutinee_adt_def, _) = scrutinee_ty.kind() else { . return None; . }; . 969 ( 0.00%) match cx.tcx.get_diagnostic_name(scrutinee_adt_def.did())? { 19,329 ( 0.00%) => ???:::get_diagnostic_name (323x) 428 ( 0.00%) sym::Result => Some(TryMode::Result), . sym::Option => Some(TryMode::Option), . _ => None, . } . } . . // Check that `pat` is `{ctor_lang_item}(val)`, returning `val`. 16 ( 0.00%) fn extract_ctor_call<'a, 'tcx>( . cx: &LateContext<'tcx>, . expected_ctor: LangItem, . pat: &'a Pat<'tcx>, . ) -> Option<&'a Pat<'tcx>> { 88 ( 0.00%) if let PatKind::TupleStruct(variant_path, [val_binding], _) = &pat.kind 28 ( 0.00%) && cx 84 ( 0.00%) .qpath_res(variant_path, pat.hir_id) 322 ( 0.00%) => ???:::qpath_res (14x) 14 ( 0.00%) .ctor_parent(cx) . .is_lang_item(cx, expected_ctor) . { . Some(val_binding) . } else { . None . } 16 ( 0.00%) } . . // Extracts the local ID of a plain `val` pattern. . fn extract_binding_pat(pat: &Pat<'_>) -> Option { 16 ( 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 391 ---------------------------------------- . 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 { 124 ( 0.00%) if arm.guard.is_some() { . return false; . } . 248 ( 0.00%) let arm_body = peel_blocks(arm.body); 244 ( 0.00%) match mode { . TryMode::Result => { . // Check that pat is Err(val) 64 ( 0.00%) if let Some(ok_pat) = extract_ctor_call(cx, ResultErr, arm.pat) 3,046 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:clippy_lints::question_mark::extract_ctor_call (16x) . && let Some(ok_val) = extract_binding_pat(ok_pat) . // check `=> return Err(...)` 2 ( 0.00%) && 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) . // check if `...` is `val` from binding or `val.into()` . && is_local_or_local_into(cx, ret_expr, ok_val) . { . true . } else { . false . } . }, . TryMode::Option => { . // Check the pat is `None` 424 ( 0.00%) if is_none_pattern(cx, arm.pat) 11,032 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_none_pattern (106x) . // Check `=> return None` 134 ( 0.00%) && let ExprKind::Ret(Some(ret_expr)) = arm_body.kind 40 ( 0.00%) && is_none_expr(cx, ret_expr) 176 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/res.rs:clippy_utils::is_none_expr (8x) . && !ret_expr.span.from_expansion() . { . true . } else { . false . } . }, . } 124 ( 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), . } . } . 620 ( 0.00%) fn check_arms_are_try<'tcx>( . cx: &LateContext<'tcx>, . mode: TryMode, . arm1: &Arm<'tcx>, . arm2: &Arm<'tcx>, . ) -> Option> { 248 ( 0.00%) (check_arm_is_none_or_err(cx, mode, arm2).then(|| check_arm_is_some_or_ok(cx, mode, arm1))) 10,465 ( 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 (62x) 248 ( 0.00%) .or_else(|| check_arm_is_none_or_err(cx, mode, arm1).then(|| check_arm_is_some_or_ok(cx, mode, arm2))) 7,905 ( 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 (62x) . .flatten() 372 ( 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>), . } . 76,648 ( 0.00%) fn check_if_try_match<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'tcx>) { 30,670 ( 0.00%) if let ExprKind::Match(scrutinee, [arm1, arm2], MatchSource::Normal | MatchSource::Postfix) = expr.kind 998 ( 0.00%) && !expr.span.from_expansion() 666 ( 0.00%) && let Some(mode) = find_try_mode(cx, scrutinee) 372 ( 0.00%) && !span_contains_cfg(cx, expr.span) 54,719 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/attrs.rs:clippy_utils::attrs::span_contains_cfg (62x) 310 ( 0.00%) && let Some(if_let_or_match_then) = check_arms_are_try(cx, mode, arm1, arm2) 20,168 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:clippy_lints::question_mark::check_arms_are_try (62x) . { . span_lint_and_then( . cx, . QUESTION_MARK, . expr.span, . "this `match` expression can be replaced with `?`", . |diag| { . let mut applicability = Applicability::MachineApplicable; -- line 482 ---------------------------------------- -- line 509 ---------------------------------------- . ); . } . diag.span_suggestion(expr.span, "try instead", sugg, applicability); . }, . } . }, . ); . } 76,648 ( 0.00%) } . . fn check_if_let_some_or_err_and_early_return<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'tcx>) { 9,652 ( 0.00%) if let Some(higher::IfLet { . let_pat, . let_expr, . if_then, . if_else, . .. 48,260 ( 0.00%) }) = higher::IfLet::hir(cx, expr) 695,180 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (9,652x) 5,972 ( 0.00%) && let PatKind::TupleStruct(ref path1, [field], ddpos) = let_pat.kind . && ddpos.as_opt_usize().is_none() 8,748 ( 0.00%) && let PatKind::Binding(BindingMode(by_ref, _), bind_id, ident, None) = field.kind 2,904 ( 0.00%) && let caller_ty = cx.typeck_results().expr_ty(let_expr) 38,760 ( 0.00%) => ???:::expr_ty (968x) 13,552 ( 0.00%) && let if_block = IfBlockType::IfLet( 7,744 ( 0.00%) cx.qpath_res(path1, let_pat.hir_id), 22,264 ( 0.00%) => ???:::qpath_res (968x) . caller_ty, . ident.name, . let_expr, . if_then, . if_else, . ) 4,840 ( 0.00%) && let is_option_early_return = is_early_return(sym::Option, cx, &if_block) 274,578 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:clippy_lints::question_mark::is_early_return (968x) 6,756 ( 0.00%) && (is_option_early_return || is_early_return(sym::Result, cx, &if_block)) 128,434 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:clippy_lints::question_mark::is_early_return (964x) 8 ( 0.00%) && if_else 76 ( 0.00%) .map(|e| eq_expr_value(cx, expr.span.ctxt(), let_expr, peel_blocks(e))) 1,122 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:clippy_utils::hir_utils::eq_expr_value (4x) . .is_none_or(|e| !e) . { 20 ( 0.00%) if !is_copy(cx, caller_ty) 246,849 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::is_copy (4x) . && let Some(hir_id) = let_expr.res_local_id() 5 ( 0.00%) && local_used_after_expr(cx, hir_id, expr) 32,839 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/usage.rs:clippy_utils::usage::local_used_after_expr (1x) . { . return; . } . . // Leave `if let Some(x) = opt { .. } else { None }` to `needless_match` or `manual_map_option`. 8 ( 0.00%) if is_option_early_return 16 ( 0.00%) && if_else.is_some_and(|else_| !matches!(peel_blocks_with_stmt(else_).kind, ExprKind::Ret(_))) 68 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::peel_blocks_with_stmt (4x) . { . return; . } . . span_lint_and_then( . cx, . QUESTION_MARK, . expr.span, -- line 562 ---------------------------------------- -- 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 { 87,168 ( 0.00%) if let Some(expr) = bl.expr 75,380 ( 0.00%) && let ExprKind::Call(callee, [_]) = expr.kind 22,932 ( 0.00%) && let ExprKind::Path(qpath) = callee.kind 6,552 ( 0.00%) && cx.tcx.qpath_is_lang_item(qpath, LangItem::TryTraitFromOutput) 167,918 ( 0.00%) => ???:::qpath_is_lang_item (1,638x) . { . true . } else { . false . } . } . . fn is_inferred_ret_closure(expr: &Expr<'_>) -> bool { 1,662,318 ( 0.01%) let ExprKind::Closure(closure) = expr.kind else { . return false; . }; . 1,698 ( 0.00%) match closure.fn_decl.output { 12 ( 0.00%) FnRetTy::Return(ret_ty) => ret_ty.is_suggestable_infer_ty(), 253 ( 0.00%) => ???:::is_suggestable_infer_ty (3x) . FnRetTy::DefaultReturn(_) => true, . } . } . . impl<'tcx> LateLintPass<'tcx> for QuestionMark { 221,872 ( 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. 63,392 ( 0.00%) if !matches!(stmt.kind, StmtKind::Let(..)) { . return; . } . 300,915 ( 0.00%) if !is_lint_allowed(cx, QUESTION_MARK_USED, stmt.hir_id) || !self.msrv.meets(cx, msrvs::QUESTION_MARK_OPERATOR) 25,001,979 ( 0.21%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_lint_allowed (20,061x) 541,647 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (20,061x) . { . return; . } . 140,427 ( 0.00%) if !self.inside_try_block() && !is_in_const_context(cx) { 7,346,857 ( 0.06%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_const_context (20,061x) . check_let_some_else_return_none(cx, stmt); . } . self.check_manual_let_else(cx, stmt); 253,568 ( 0.00%) } . 2,422,280 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 726,690 ( 0.01%) if is_inferred_ret_closure(expr) { 280 ( 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(..)) 29,022 ( 0.00%) && !self.inside_try_block() 38,696 ( 0.00%) && !is_in_const_context(cx) 3,486,868 ( 0.03%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_const_context (9,674x) 67,564 ( 0.00%) && is_lint_allowed(cx, QUESTION_MARK_USED, expr.hir_id) 13,425,207 ( 0.11%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_lint_allowed (9,652x) 57,912 ( 0.00%) && self.msrv.meets(cx, msrvs::QUESTION_MARK_OPERATOR) 260,604 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (9,652x) . { . check_is_none_or_err_and_early_return(cx, expr); . check_if_let_some_or_err_and_early_return(cx, expr); . 19,304 ( 0.00%) if self.inferred_ret_closure_stack == 0 { 28,743 ( 0.00%) check_if_try_match(cx, expr); 314,513 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:clippy_lints::question_mark::check_if_try_match (9,581x) . } . } 1,938,104 ( 0.02%) } . . fn check_expr_post(&mut self, _: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 289 ( 0.00%) if is_inferred_ret_closure(expr) { 280 ( 0.00%) self.inferred_ret_closure_stack -= 1; . } . } . . fn check_block(&mut self, cx: &LateContext<'tcx>, block: &'tcx Block<'tcx>) { 26,706 ( 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>) { 26,706 ( 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; . } . } . } 137,248 ( 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_hir/src/hir.rs -------------------------------------------------------------------------------- Ir -- line 216 ---------------------------------------- . pub fn ident(&self) -> Ident { . match *self { . ParamName::Plain(ident) | ParamName::Error(ident) => ident, . ParamName::Fresh => Ident::with_dummy_span(kw::UnderscoreLifetime), . } . } . } . 180 ( 0.00%) #[derive(Debug, Copy, Clone, PartialEq, Eq, Hash, StableHash)] . pub enum LifetimeKind { . /// User-given names or fresh (synthetic) names. . Param(LocalDefId), . . /// Implicit lifetime in a context like `dyn Foo`. This is . /// distinguished from implicit lifetimes elsewhere because the . /// lifetime that they default to must appear elsewhere within the . /// enclosing type. This means that, in an `impl Trait` context, we -- line 232 ---------------------------------------- -- line 249 ---------------------------------------- . Infer, . . /// User wrote `'static` or nothing (which gets converted to `'_`). . Static, . } . . impl LifetimeKind { . fn is_elided(&self) -> bool { 816 ( 0.00%) match self { . LifetimeKind::ImplicitObjectLifetimeDefault | LifetimeKind::Infer => true, . . // It might seem surprising that `Fresh` counts as not *elided* . // -- but this is because, as far as the code in the compiler is . // concerned -- `Fresh` variants act equivalently to "some fresh name". . // They correspond to early-bound regions on an impl, in other words. . LifetimeKind::Error(..) | LifetimeKind::Param(..) | LifetimeKind::Static => false, . } -- line 265 ---------------------------------------- -- line 408 ---------------------------------------- . } . } . . pub fn invalid() -> Self { . Self::new(Ident::dummy(), HirId::INVALID, Res::Err) . } . . pub fn args(&self) -> &GenericArgs<'hir> { 10,015 ( 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>> { 3,649 ( 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() . } . } . 1,734 ( 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. 2,832 ( 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<'_>> { 5,370 ( 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 { 7,336 ( 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 { 18,407 ( 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> { 2,556 ( 0.00%) self.predicates.iter().filter_map(move |pred| match pred.kind { . WherePredicateKind::BoundPredicate(bp) 7,668 ( 0.00%) if bp.is_param_bound(param_def_id.to_def_id()) => 2,499 ( 0.00%) => ???:::is_param_bound (119x) . { . 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, . } . } . } . 1,212 ( 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 { 16,638 ( 0.00%) match &self { . Attribute::Unparsed(n) => { 969 ( 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 { 97,551 ( 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> { 163,591 ( 0.00%) match &self { 12,416 ( 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, . } . } . . #[inline] . fn doc_str(&self) -> Option { 1 ( 0.00%) match &self { . Attribute::Parsed(AttributeKind::DocComment { comment, .. }) => Some(*comment), . _ => None, . } . } . . fn is_automatically_derived_attr(&self) -> bool { . matches!(self, Attribute::Parsed(AttributeKind::AutomaticallyDerived)) . } . . #[inline] . fn doc_str_and_fragment_kind(&self) -> Option<(Symbol, DocFragmentKind)> { 31,214 ( 0.00%) match &self { . Attribute::Parsed(AttributeKind::DocComment { kind, comment, .. }) => { 86,712 ( 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 { 12,924 ( 0.00%) matches!( . self, . Attribute::Parsed( . AttributeKind::ProcMacro . | AttributeKind::ProcMacroAttribute . | AttributeKind::ProcMacroDerive { .. } . ) . ) . } . . fn is_doc_hidden(&self) -> bool { 118,468 ( 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 1870 ---------------------------------------- . pub kind: PatKind<'hir>, . pub span: Span, . /// Whether to use default binding modes. . /// At present, this is false only for destructuring assignment. . pub default_binding_modes: bool, . } . . impl<'hir> Pat<'hir> { 15,340 ( 0.00%) fn walk_short_(&self, it: &mut impl FnMut(&Pat<'hir>) -> bool) -> bool { 60 ( 0.00%) if !it(self) { . return false; . } . . use PatKind::*; 4,323 ( 0.00%) match self.kind { . Missing => unreachable!(), . Wild | Never | Expr(_) | Range(..) | Binding(.., None) | Err(_) => true, 587 ( 0.00%) Box(s) | Deref(s) | Ref(s, _, _) | Binding(.., Some(s)) | Guard(s, _) => { 630 ( 0.00%) s.walk_short_(it) 1,204 ( 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:::walk_short_::'2 (43x) . } 3,603 ( 0.00%) Struct(_, fields, _) => fields.iter().all(|field| field.pat.walk_short_(it)), 21,648 ( 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:::walk_short_::'2 (517x) 105 ( 0.00%) TupleStruct(_, s, _) | Tuple(s, _) | Or(s) => s.iter().all(|p| p.walk_short_(it)), 624 ( 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:::walk_short_::'2 (15x) . Slice(before, slice, after) => { . before.iter().chain(slice).chain(after.iter()).all(|p| p.walk_short_(it)) . } . } 9,776 ( 0.00%) } . . /// Walk the pattern in left-to-right order, . /// short circuiting (with `.all(..)`) if `false` is returned. . /// . /// Note that when visiting e.g. `Tuple(ps)`, . /// if visiting `ps[0]` returns `false`, . /// then `ps[1]` will not be visited. . pub fn walk_short(&self, mut it: impl FnMut(&Pat<'hir>) -> bool) -> bool { 1,238 ( 0.00%) self.walk_short_(&mut it) 810 ( 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:::walk_short_:: (30x) . } . 7,223 ( 0.00%) fn walk_(&self, it: &mut impl FnMut(&Pat<'hir>) -> bool) { 3,457 ( 0.00%) if !it(self) { . return; . } . . use PatKind::*; 7,129 ( 0.00%) match self.kind { . Missing | Wild | Never | Expr(_) | Range(..) | Binding(.., None) | Err(_) => {} 564 ( 0.00%) Box(s) | Deref(s) | Ref(s, _, _) | Binding(.., Some(s)) | Guard(s, _) => s.walk_(it), 273 ( 0.00%) Struct(_, fields, _) => fields.iter().for_each(|field| field.pat.walk_(it)), 665 ( 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:::walk_::'2 (19x) 155 ( 0.00%) TupleStruct(_, s, _) | Tuple(s, _) | Or(s) => s.iter().for_each(|p| p.walk_(it)), 193 ( 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:::walk_::<::each_binding_or_first::{closure#0}>::{closure#0}>'2 (2x) 8 ( 0.00%) Slice(before, slice, after) => { 12 ( 0.00%) before.iter().chain(slice).chain(after.iter()).for_each(|p| p.walk_(it)) 140 ( 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:::walk_::'2 (4x) . } . } 6,728 ( 0.00%) } . . /// Walk the pattern in left-to-right order. . /// . /// If `it(pat)` returns `false`, the children are not visited. . pub fn walk(&self, mut it: impl FnMut(&Pat<'hir>) -> bool) { 1,411 ( 0.00%) self.walk_(&mut it) 4,657 ( 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:::walk_:: (24x) . } . . /// Walk the pattern in left-to-right order. . /// . /// If you always want to recurse, prefer this method over `walk`. . pub fn walk_always(&self, mut it: impl FnMut(&Pat<'_>)) { . self.walk(|p| { 23 ( 0.00%) it(p); . true . }) . } . . /// Whether this a never pattern. . pub fn is_never_pattern(&self) -> bool { . let mut is_never_pattern = false; . self.walk(|pat| match &pat.kind { -- line 1945 ---------------------------------------- -- line 2036 ---------------------------------------- . RangeEnd::Excluded => "..", . }) . } . } . . // Equivalent to `Option`. That type takes up 16 bytes on 64-bit, but . // this type only takes up 4 bytes, at the cost of being restricted to a . // maximum value of `u32::MAX - 1`. In practice, this is more than enough. 44 ( 0.00%) #[derive(Clone, Copy, PartialEq, Eq, Hash, StableHash)] . pub struct DotDotPos(u32); . . impl DotDotPos { . /// Panics if n >= u32::MAX. . pub fn new(n: Option) -> Self { . match n { . Some(n) => { . assert!(n < u32::MAX as usize); . Self(n as u32) . } . None => Self(u32::MAX), . } . } . . pub fn as_opt_usize(&self) -> Option { 10,474 ( 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, . } . 42 ( 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 { 77,574 ( 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; 112,862 ( 0.00%) while let ExprKind::DropTemps(inner) = &expr.kind { 60 ( 0.00%) expr = inner; . } . expr . } . . pub fn peel_blocks(&self) -> &Self { . let mut expr = self; 2,795,765 ( 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; 750,513 ( 0.01%) while let ExprKind::AddrOf(.., inner) = &expr.kind { 11,784 ( 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 3105 ---------------------------------------- . QPath::Resolved(_, path) => path.span, . QPath::TypeRelative(qself, ps) => qself.span.to(ps.ident.span), . } . } . . /// Returns the span of the qself of this `QPath`. For example, `()` in . /// `<() as Trait>::method`. . pub fn qself_span(&self) -> Span { 2 ( 0.00%) match *self { . QPath::Resolved(_, path) => path.span, 3 ( 0.00%) QPath::TypeRelative(qself, _) => qself.span, . } . } . } . . /// Hints at the original code for a let statement. . #[derive(Copy, Clone, Debug, StableHash)] . pub enum LocalSource { . /// A `match _ { .. }`. -- line 3123 ---------------------------------------- -- 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 _ { .. }`. 3,996 ( 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. 4,712 ( 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. 30,657 ( 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>> { 443,489 ( 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(); 11,284 ( 0.00%) while let TyKind::Ref(_, MutTy { ty, .. }) = &final_ty.kind { 2,589 ( 0.00%) final_ty = ty; . } . final_ty . } . } . . impl<'hir> Ty<'hir> { . pub fn peel_refs(&self) -> &Self { . let mut final_ty = self; 3,198 ( 0.00%) while let TyKind::Ref(_, MutTy { ty, .. }) = &final_ty.kind { 1,066 ( 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)> { 147,741 ( 0.00%) let TyKind::Path(QPath::Resolved(None, path)) = self.kind else { . return None; . }; 43,034 ( 0.00%) let [segment] = &path.segments else { . return None; . }; 134,932 ( 0.00%) match path.res { 15,048 ( 0.00%) Res::Def(DefKind::TyParam, def_id) | Res::SelfTyParam { trait_: def_id } => { 5,904 ( 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` 13,576 ( 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) 1,484 ( 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 { 5,630 ( 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 { 2,813 ( 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 { 18,250 ( 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 { 11,149 ( 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 { 46,210 ( 0.00%) match *self { 664 ( 0.00%) Self::DefaultReturn(span) => span, 24,686 ( 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 4422 ---------------------------------------- . /// Fields and constructor id of the variant. . pub data: VariantData<'hir>, . /// Explicit discriminant (e.g., `Foo = 1`). . pub disr_expr: Option<&'hir AnonConst>, . /// Span . pub span: Span, . } . 8 ( 0.00%) #[derive(Copy, Clone, PartialEq, Debug, StableHash)] . pub enum UseKind { . /// One import, e.g., `use foo::bar` or `use foo::bar as baz`. . /// Also produced for each element of a list `use`, e.g. . /// `use foo::{a, b}` lowers to `use foo::a; use foo::b;`. . /// . /// The identifier is the name defined by the import. E.g. for `use . /// foo::bar` it is `bar`, for `use foo::bar as baz` it is `baz`. . Single(Ident), -- line 4438 ---------------------------------------- -- line 4523 ---------------------------------------- . /// . /// E.g., `Bar = ..` as in `enum Foo { Bar = .. }`. . Unit(#[stable_hash(ignore)] HirId, LocalDefId), . } . . impl<'hir> VariantData<'hir> { . /// Return the fields of this variant. . pub fn fields(&self) -> &'hir [FieldDef<'hir>] { 280 ( 0.00%) match *self { 3 ( 0.00%) VariantData::Struct { fields, .. } | VariantData::Tuple(fields, ..) => fields, . _ => &[], . } . } . . pub fn ctor(&self) -> Option<(CtorKind, HirId, LocalDefId)> { 24 ( 0.00%) match *self { . VariantData::Tuple(_, hir_id, def_id) => Some((CtorKind::Fn, hir_id, def_id)), . VariantData::Unit(hir_id, def_id) => Some((CtorKind::Const, hir_id, def_id)), . VariantData::Struct { .. } => None, . } . } . . #[inline] . pub fn ctor_kind(&self) -> Option { -- line 4546 ---------------------------------------- -- 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. 38,523 ( 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 4671 ---------------------------------------- . . expect_trait_alias, (Constness, Ident, &'hir Generics<'hir>, GenericBounds<'hir>), . ItemKind::TraitAlias(constness, ident, generics, bounds), (*constness, *ident, generics, bounds); . . expect_impl, &Impl<'hir>, ItemKind::Impl(imp), imp; . } . } . 3 ( 0.00%) #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug)] . #[derive(Encodable, Decodable, StableHash, Default)] . pub enum Safety { . /// This is the default variant, because the compiler messing up . /// metadata encoding and failing to encode a `Safe` flag, means . /// downstream crates think a thing is `Unsafe` instead of silently . /// treating an unsafe thing as safe. . #[default] . Unsafe, -- line 4687 ---------------------------------------- -- line 4714 ---------------------------------------- . fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { . f.write_str(match *self { . Self::Unsafe => "unsafe", . Self::Safe => "safe", . }) . } . } . 124 ( 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 { 8,028 ( 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 { 28,503 ( 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 { 2,206 ( 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, . } 292 ( 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 ---------------------------------------- 996,853 ( 0.01%) -------------------------------------------------------------------------------- -- 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, . } . 49,632 ( 0.00%) pub(super) fn check<'a>(cx: &LateContext<'a>, body: &Body<'a>) { . let mut bindings: FxHashMap> = FxHashMap::default(); . 6,204 ( 0.00%) for_each_expr_without_closures(body.value, |expr| { 1,188,774 ( 0.01%) match expr.kind { 21,043 ( 0.00%) ExprKind::Block(block, _) => { 21,043 ( 0.00%) for stmt in block.stmts { 82,842 ( 0.00%) if let StmtKind::Let(let_stmt) = stmt.kind { 60,180 ( 0.00%) collect_binding_from_local(cx, let_stmt, &mut bindings); 26,350 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/casts/needless_type_cast.rs:clippy_lints::casts::needless_type_cast::collect_binding_from_local (1,460x) . } . } . }, 2,432 ( 0.00%) ExprKind::Let(let_expr) => { 7,296 ( 0.00%) collect_binding_from_let(cx, let_expr, &mut bindings); 43,776 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/casts/needless_type_cast.rs:clippy_lints::casts::needless_type_cast::collect_binding_from_let (2,432x) . }, . _ => {}, . } . ControlFlow::<()>::Continue(()) . }); . . #[allow(rustc::potential_query_instability)] 18,612 ( 0.00%) let mut binding_vec: Vec<_> = bindings.into_iter().collect(); . binding_vec.sort_by_key(|(_, info)| info.ty_span.lo()); . 6,324 ( 0.00%) for (hir_id, binding_info) in binding_vec { . check_binding_usages(cx, body, hir_id, &binding_info); . } 49,632 ( 0.00%) } . 17,024 ( 0.00%) fn collect_binding_from_let<'a>( . cx: &LateContext<'a>, . let_expr: &rustc_hir::LetExpr<'a>, . bindings: &mut FxHashMap>, . ) { 2,432 ( 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), . }, . ); . } . } 19,456 ( 0.00%) } . 140,420 ( 0.00%) fn collect_binding_from_local<'a>( . cx: &LateContext<'a>, . let_stmt: &LetStmt<'a>, . bindings: &mut FxHashMap>, . ) { 20,060 ( 0.00%) if let_stmt.ty.is_none() 998 ( 0.00%) || let_stmt.span.from_expansion() 118 ( 0.00%) || let_stmt . .init 385 ( 0.00%) .is_some_and(|init| has_generic_return_type(cx, init) || contains_unsafe(init)) 41,330 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/casts/needless_type_cast.rs:clippy_lints::casts::needless_type_cast::has_generic_return_type (77x) . { . return; . } . 63 ( 0.00%) if let PatKind::Binding(_, hir_id, _, _) = let_stmt.pat.kind . && let Some(ty_hir) = let_stmt.ty . { 21 ( 0.00%) let ty = cx.typeck_results().pat_ty(let_stmt.pat); 840 ( 0.00%) => ???:::pat_ty (21x) . if ty.is_numeric() { . bindings.insert( . hir_id, 75 ( 0.00%) BindingInfo { . source_ty: ty, 15 ( 0.00%) ty_span: ty_hir.span, . init: let_stmt.init, . }, . ); . } . } 160,480 ( 0.00%) } . . fn contains_unsafe(expr: &Expr<'_>) -> bool { . for_each_expr_without_closures(expr, |e| { 263 ( 0.00%) if let ExprKind::Block(block, _) = e.kind . && let BlockCheckMode::UnsafeBlock(UnsafeSource::UserProvided) = block.rules . { . return ControlFlow::Break(()); . } . ControlFlow::Continue(()) . }) . .is_some() . } . 940 ( 0.00%) fn has_generic_return_type(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { 983 ( 0.00%) match &expr.kind { . ExprKind::Block(block, _) => { 108 ( 0.00%) if let Some(tail_expr) = block.expr { . return has_generic_return_type(cx, tail_expr); . } . false . }, . ExprKind::If(_, then_block, else_expr) => { 54 ( 0.00%) has_generic_return_type(cx, then_block) || else_expr.is_some_and(|e| has_generic_return_type(cx, e)) 306 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/casts/needless_type_cast.rs:clippy_lints::casts::needless_type_cast::has_generic_return_type'2 (9x) . }, 44 ( 0.00%) ExprKind::Match(_, arms, _) => arms.iter().any(|arm| has_generic_return_type(cx, arm.body)), 580 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/casts/needless_type_cast.rs:clippy_lints::casts::needless_type_cast::has_generic_return_type'2 (8x) . ExprKind::Loop(block, label, ..) => for_each_expr_without_closures(*block, |e| { . match e.kind { . ExprKind::Loop(..) => { . // Unlabeled breaks inside nested loops target the inner loop, not ours . return ControlFlow::Continue(Descend::No); . }, . ExprKind::Break(dest, Some(break_expr)) => { . let targets_this_loop = -- line 148 ---------------------------------------- -- line 152 ---------------------------------------- . } . }, . _ => {}, . } . ControlFlow::Continue(Descend::Yes) . }) . .is_some(), . ExprKind::MethodCall(..) => { 190 ( 0.00%) if let Some(def_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id) { 1,962 ( 0.00%) => ???:::type_dependent_def_id (38x) 38 ( 0.00%) let sig = cx.tcx.fn_sig(def_id).instantiate_identity().skip_norm_wip(); . let ret_ty = sig.output().skip_binder(); . return ret_ty.has_param(); . } . false . }, . ExprKind::Call(callee, _) => { 84 ( 0.00%) if let ExprKind::Path(qpath) = &callee.kind { 105 ( 0.00%) let res = cx.qpath_res(qpath, callee.hir_id); 1,494 ( 0.00%) => ???:::qpath_res (19x) 294 ( 0.00%) if let Res::Def(DefKind::Fn | DefKind::AssocFn, def_id) = res { 21 ( 0.00%) let sig = cx.tcx.fn_sig(def_id).instantiate_identity().skip_norm_wip(); . let ret_ty = sig.output().skip_binder(); . return ret_ty.has_param(); . } . } . false . }, . _ => false, . } 658 ( 0.00%) } . . fn is_generic_res(cx: &LateContext<'_>, res: Res) -> bool { . let has_type_params = |def_id| { . cx.tcx . .generics_of(def_id) . .own_params . .iter() . .any(|p| p.kind.is_ty_or_const()) . }; . cx.tcx.res_generics_def_id(res).is_some_and(has_type_params) . } . 42 ( 0.00%) fn is_cast_in_generic_context<'a>(cx: &LateContext<'a>, cast_expr: &Expr<'a>) -> bool { 24 ( 0.00%) let mut current_id = cast_expr.hir_id; . . loop { 40 ( 0.00%) let parent_id = cx.tcx.parent_hir_id(current_id); 511 ( 0.00%) => ???:::parent_hir_id (8x) 8 ( 0.00%) if parent_id == current_id { . return false; . } . 40 ( 0.00%) let parent = cx.tcx.hir_node(parent_id); 503 ( 0.00%) => ???:::hir_node (8x) . 16 ( 0.00%) match parent { 2 ( 0.00%) rustc_hir::Node::Expr(parent_expr) => { 14 ( 0.00%) match &parent_expr.kind { . ExprKind::Closure(_) => return false, . ExprKind::Call(callee, _) => { . if let ExprKind::Path(qpath) = &callee.kind { . let res = cx.qpath_res(qpath, callee.hir_id); . if is_generic_res(cx, res) { . return true; . } . } -- line 214 ---------------------------------------- -- line 227 ---------------------------------------- . }, . _ => {}, . } . current_id = parent_id; . }, . _ => return false, . } . } 48 ( 0.00%) } . 3 ( 0.00%) fn can_coerce_to_target_type(expr: &Expr<'_>) -> bool { 7 ( 0.00%) match expr.kind { . ExprKind::Lit(lit) => matches!( . lit.node, . LitKind::Int(_, LitIntType::Unsuffixed) | LitKind::Float(_, LitFloatType::Unsuffixed) . ), . ExprKind::Unary(rustc_hir::UnOp::Neg, inner) => can_coerce_to_target_type(inner), . ExprKind::Binary(_, lhs, rhs) => can_coerce_to_target_type(lhs) && can_coerce_to_target_type(rhs), . _ => false, . } 2 ( 0.00%) } . . fn check_binding_usages<'a>(cx: &LateContext<'a>, body: &Body<'a>, hir_id: HirId, binding_info: &BindingInfo<'a>) { . let mut usages = Vec::new(); . . for_each_expr(cx.tcx, body.value, |expr| { 6,176 ( 0.00%) if let ExprKind::Path(ref qpath) = expr.kind 2,306 ( 0.00%) && !expr.span.from_expansion() 11,383 ( 0.00%) && let Res::Local(id) = cx.qpath_res(qpath, expr.hir_id) 20,056 ( 0.00%) => ???:::qpath_res (783x) 1,204 ( 0.00%) && id == hir_id . { 245 ( 0.00%) let parent_id = cx.tcx.parent_hir_id(expr.hir_id); 3,115 ( 0.00%) => ???:::parent_hir_id (49x) 196 ( 0.00%) let parent = cx.tcx.hir_node(parent_id); 3,066 ( 0.00%) => ???:::hir_node (49x) . 145 ( 0.00%) let usage = if let rustc_hir::Node::Expr(parent_expr) = parent 141 ( 0.00%) && let ExprKind::Cast(..) = parent_expr.kind 12 ( 0.00%) && !parent_expr.span.from_expansion() . { . UsageInfo { 18 ( 0.00%) cast_to: Some(cx.typeck_results().expr_ty(parent_expr)), 240 ( 0.00%) => ???:::expr_ty (6x) 30 ( 0.00%) in_generic_context: is_cast_in_generic_context(cx, parent_expr), 1,330 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/casts/needless_type_cast.rs:clippy_lints::casts::needless_type_cast::is_cast_in_generic_context (6x) . } . } else { . UsageInfo { . cast_to: None, . in_generic_context: false, . } . }; 49 ( 0.00%) usages.push(usage); . } . ControlFlow::<()>::Continue(()) . }); . 1 ( 0.00%) let Some(first_target) = usages . .first() 15 ( 0.00%) .and_then(|u| u.cast_to) . .filter(|&t| t != binding_info.source_ty) . .filter(|&t| usages.iter().all(|u| u.cast_to == Some(t) && !u.in_generic_context)) . else { . return; . }; . . // Don't lint if there's exactly one use and the initializer cannot be coerced to the . // target type (i.e., would require an explicit cast). In such cases, the fix would add . // a cast to the initializer rather than eliminating one - the cast isn't truly "needless." . // See: https://github.com/rust-lang/rust-clippy/issues/16240 2 ( 0.00%) if usages.len() == 1 1 ( 0.00%) && binding_info . .init 6 ( 0.00%) .is_some_and(|init| !can_coerce_to_target_type(init) && !init.span.from_expansion()) 13 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/casts/needless_type_cast.rs:clippy_lints::casts::needless_type_cast::can_coerce_to_target_type (1x) . { . return; . } . . span_lint_and_then( . cx, . NEEDLESS_TYPE_CAST, . binding_info.ty_span, -- line 304 ---------------------------------------- 186,284 ( 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. 24,152 ( 0.00%) if let ItemKind::Use(path, kind @ (UseKind::Single(_) | UseKind::Glob)) = item.kind 5,880 ( 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 20,480 ( 0.00%) && let Some(res) = path.res.present_items().next() 2,938 ( 0.00%) && let Some(def_id) = res.opt_def_id() 7,345 ( 0.00%) && self.msrv.meets(cx, msrvs::NUMERIC_ASSOCIATED_CONSTANTS) 39,663 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (1,469x) . { . let module = if is_integer_module(cx, def_id) { . true 8,790 ( 0.00%) } else if is_numeric_const(cx, def_id) { 102,148 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/legacy_numeric_constants.rs:clippy_lints::legacy_numeric_constants::is_numeric_const (1,465x) . false . } else { . return; . }; . 16 ( 0.00%) span_lint_and_then( 834,688 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then::::check_item::{closure#0}> (4x) . cx, . LEGACY_NUMERIC_CONSTANTS, 4 ( 0.00%) path.span, 28 ( 0.00%) if module { . "importing legacy numeric constants" . } else { . "importing a legacy numeric constant" . }, 24 ( 0.00%) |diag| { 8 ( 0.00%) if let UseKind::Single(ident) = kind . && ident.name == kw::Underscore . { . diag.help("remove this import"); . return; . } . 16 ( 0.00%) let def_path = cx.get_def_path(def_id); 3,343 ( 0.00%) => ???:::get_def_path (4x) . 28 ( 0.00%) if module && let [.., module_name] = &*def_path { . if kind == UseKind::Glob { . diag.help(format!("remove this import and use associated constants `{module_name}::` from the primitive type instead")); . } else { 12 ( 0.00%) diag.help("remove this import").note(format!( . "then `{module_name}::` will resolve to the respective associated constant" . )); . } . } 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") . ); . } . }, . ); . } 5,938 ( 0.00%) } . 2,422,280 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx rustc_hir::Expr<'tcx>) { . // `std::::` check 1,131,503 ( 0.01%) let (sugg, msg) = if let ExprKind::Path(qpath) = &expr.kind . && let QPath::Resolved(None, path) = qpath 94,564 ( 0.00%) && let Some(def_id) = path.res.opt_def_id() 152,873 ( 0.00%) && is_numeric_const(cx, def_id) 1,645,289 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/legacy_numeric_constants.rs:clippy_lints::legacy_numeric_constants::is_numeric_const (21,839x) 1,164 ( 0.00%) && let [.., mod_name, name] = &*cx.get_def_path(def_id) 96,626 ( 0.00%) => ???:::get_def_path (97x) . // Skip linting if this usage looks identical to the associated constant, . // since this would only require removing a `use` import (which is already linted). 76 ( 0.00%) && !is_numeric_const_path_canonical(path, [*mod_name, *name]) . { 468 ( 0.00%) (format!("{mod_name}::{name}"), "usage of a legacy numeric constant") . // `::xxx_value` check 350,764 ( 0.00%) } else if let ExprKind::Call(func, []) = &expr.kind 4,156 ( 0.00%) && let ExprKind::Path(qpath) = &func.kind 4,156 ( 0.00%) && let QPath::TypeRelative(ty, last_segment) = qpath 4,480 ( 0.00%) && let Some(def_id) = cx.qpath_res(qpath, func.hir_id).opt_def_id() 69,952 ( 0.00%) => ???:::qpath_res (896x) 896 ( 0.00%) && is_integer_method(cx, def_id) 24 ( 0.00%) && let Some(mod_name) = ty.span.get_text(cx) 21 ( 0.00%) && ty.span.eq_ctxt(last_segment.ident.span) 90 ( 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:::eq_ctxt (3x) . { 6 ( 0.00%) let name = last_segment.ident.name.as_str()[..=2].to_ascii_uppercase(); 18 ( 0.00%) (format!("{mod_name}::{name}"), "usage of a legacy numeric method") . } else { . return; . }; . 324 ( 0.00%) if !expr.span.in_external_macro(cx.sess().source_map()) 30 ( 0.00%) && self.msrv.meets(cx, msrvs::NUMERIC_ASSOCIATED_CONSTANTS) 135 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (5x) 25 ( 0.00%) && !is_from_proc_macro(cx, expr) 3,186 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::is_from_proc_macro:: (5x) . { 80 ( 0.00%) span_lint_and_then(cx, LEGACY_NUMERIC_CONSTANTS, expr.span, msg, |diag| { 1,555,271 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then::::check_expr::{closure#0}> (5x) . diag.span_suggestion_verbose( 5 ( 0.00%) expr.span, . "use the associated constant instead", . sugg, . Applicability::MaybeIncorrect, . ); . }); . } 1,937,824 ( 0.02%) } . } . . fn is_integer_module(cx: &LateContext<'_>, did: DefId) -> bool { 7,337 ( 0.00%) matches!( 7,345 ( 0.00%) cx.tcx.get_diagnostic_name(did), 84,916 ( 0.00%) => ???:::get_diagnostic_name (1,469x) . Some( . sym::isize_legacy_mod . | sym::i128_legacy_mod . | sym::i64_legacy_mod . | sym::i32_legacy_mod . | sym::i16_legacy_mod . | sym::i8_legacy_mod . | sym::usize_legacy_mod -- line 159 ---------------------------------------- -- line 161 ---------------------------------------- . | sym::u64_legacy_mod . | sym::u32_legacy_mod . | sym::u16_legacy_mod . | sym::u8_legacy_mod . ) . ) . } . 23,304 ( 0.00%) fn is_numeric_const(cx: &LateContext<'_>, did: DefId) -> bool { 140,109 ( 0.00%) matches!( 69,912 ( 0.00%) cx.tcx.get_diagnostic_name(did), 1,467,310 ( 0.01%) => ???:::get_diagnostic_name (23,304x) . 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 . ) . ) 46,608 ( 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 { 232 ( 0.00%) let [ . hir::PathSegment { . ident: one, args: None, .. . }, . hir::PathSegment { . ident: two, args: None, .. . }, 38 ( 0.00%) ] = expr_path.segments . else { . return false; . }; . 19 ( 0.00%) one.name == mod_name && two.name == name . } . . fn is_integer_method(cx: &LateContext<'_>, did: DefId) -> bool { 2,697 ( 0.00%) matches!( 1,792 ( 0.00%) cx.tcx.get_diagnostic_name(did), 67,561 ( 0.00%) => ???:::get_diagnostic_name (896x) . 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 ---------------------------------------- 274,798 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/ptr/mod.rs -------------------------------------------------------------------------------- Ir -- line 134 ---------------------------------------- . style, . "use `std::ptr::eq` when comparing raw pointers" . } . . declare_lint_pass!(Ptr => [CMP_NULL, MUT_FROM_REF, PTR_ARG, PTR_EQ]); . . impl<'tcx> LateLintPass<'tcx> for Ptr { . fn check_trait_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx TraitItem<'_>) { 4,998 ( 0.00%) if let TraitItemKind::Fn(sig, trait_method) = &item.kind { . if matches!(trait_method, TraitFn::Provided(_)) { . // Handled by `check_body`. . return; . } . 3,800 ( 0.00%) mut_from_ref::check(cx, sig, None); 172,005 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/ptr/mut_from_ref.rs:clippy_lints::ptr::mut_from_ref::check (950x) 3,800 ( 0.00%) ptr_arg::check_trait_item(cx, item.owner_id, sig); 211,101 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/ptr/ptr_arg.rs:clippy_lints::ptr::ptr_arg::check_trait_item (950x) . } . } . 55,836 ( 0.00%) fn check_body(&mut self, cx: &LateContext<'tcx>, body: &Body<'tcx>) { 18,612 ( 0.00%) let mut parents = cx.tcx.hir_parent_iter(body.value.hir_id); 20,724 ( 0.00%) let (item_id, sig, is_trait_item) = match parents.next() { . Some((_, Node::Item(i))) => { 4,085 ( 0.00%) if let ItemKind::Fn { sig, .. } = &i.kind { . (i.owner_id, sig, false) . } else { . return; . } . }, . Some((_, Node::ImplItem(i))) => { 7,964 ( 0.00%) if !matches!(parents.next(), 11,946 ( 0.00%) Some((_, Node::Item(i))) if matches!(&i.kind, ItemKind::Impl(i) if i.of_trait.is_none()) . ) { . return; . } 3,022 ( 0.00%) if let ImplItemKind::Fn(sig, _) = &i.kind { . (i.owner_id, sig, false) . } else { . return; . } . }, . Some((_, Node::TraitItem(i))) => { 572 ( 0.00%) if let TraitItemKind::Fn(sig, _) = &i.kind { . (i.owner_id, sig, true) . } else { . return; . } . }, . _ => return, . }; . 11,860 ( 0.00%) mut_from_ref::check(cx, sig, Some(body)); 962,833 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/ptr/mut_from_ref.rs:clippy_lints::ptr::mut_from_ref::check (2,965x) 17,790 ( 0.00%) ptr_arg::check_body(cx, body, item_id, sig, is_trait_item); 1,487,774 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/ptr/ptr_arg.rs:clippy_lints::ptr::ptr_arg::check_body (2,965x) 52,597 ( 0.00%) } . . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 26,944 ( 0.00%) if let ExprKind::Binary(op, l, r) = expr.kind 19,956 ( 0.00%) && (op.node == BinOpKind::Eq || op.node == BinOpKind::Ne) . { . #[expect( . clippy::collapsible_if, . reason = "the outer `if`s check the HIR, the inner ones run lints" . )] 26,091 ( 0.00%) if !cmp_null::check(cx, expr, op.node, l, r) { 8,048,835 ( 0.07%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/ptr/cmp_null.rs:clippy_lints::ptr::cmp_null::check (2,899x) 17,394 ( 0.00%) ptr_eq::check(cx, op.node, l, r, expr.span); 521,117 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/ptr/ptr_eq.rs:clippy_lints::ptr::ptr_eq::check (2,899x) . } . } . } . } 21,270 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/casts/borrow_as_ptr.rs -------------------------------------------------------------------------------- Ir -- line 6 ---------------------------------------- . use rustc_errors::Applicability; . use rustc_hir::{BorrowKind, Expr, ExprKind, Mutability, Ty, TyKind}; . use rustc_lint::LateContext; . use rustc_middle::ty::adjustment::{Adjust, AutoBorrow}; . use rustc_span::BytePos; . . use super::BORROW_AS_PTR; . 3,129 ( 0.00%) pub(super) fn check<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'_>, . cast_expr: &'tcx Expr<'_>, . cast_to: &'tcx Ty<'_>, . msrv: Msrv, . ) -> bool { 897 ( 0.00%) if let TyKind::Ptr(target) = cast_to.kind 12 ( 0.00%) && !matches!(target.ty.kind, TyKind::TraitObject(..)) . && let ExprKind::AddrOf(BorrowKind::Ref, mutability, e) = cast_expr.kind . && !is_lint_allowed(cx, BORROW_AS_PTR, expr.hir_id) . // Fix #9884 . && !is_expr_temporary_value(cx, e) . && !expr.span.in_external_macro(cx.tcx.sess.source_map()) . && !is_from_proc_macro(cx, expr) . { . let mut app = Applicability::MachineApplicable; -- line 30 ---------------------------------------- -- line 51 ---------------------------------------- . }; . (format!("{std_or_core}::ptr::{macro_name}!({snip})"), expr.span) . }; . . span_lint_and_sugg(cx, BORROW_AS_PTR, span, "borrow as raw pointer", "try", suggestion, app); . return true; . } . false 3,576 ( 0.00%) } . . /// Check for an implicit cast from reference to raw pointer outside an explicit `as`. 968,576 ( 0.01%) pub(super) fn check_implicit_cast<'cx>(cx: &LateContext<'cx>, expr: &Expr<'cx>) { 562,411 ( 0.00%) if !expr.span.from_expansion() 16,440 ( 0.00%) && let ExprKind::AddrOf(BorrowKind::Ref, _, pointee) = expr.kind 10,640 ( 0.00%) && !matches!(get_parent_expr(cx, expr).map(|e| e.kind), Some(ExprKind::Cast(..))) 721,714 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (5,480x) 21,920 ( 0.00%) && let [deref, borrow] = cx.typeck_results().expr_adjustments(expr) 229,027 ( 0.00%) => ???:::expr_adjustments (5,480x) 4,098 ( 0.00%) && matches!(deref.kind, Adjust::Deref(..)) 8,196 ( 0.00%) && let Adjust::Borrow(AutoBorrow::RawPtr(mutability)) = borrow.kind . // Do not suggest taking a raw pointer to a temporary value . && !is_expr_temporary_value(cx, pointee) . && !is_from_proc_macro(cx, expr) . { . span_lint_and_then(cx, BORROW_AS_PTR, expr.span, "implicit borrow as raw pointer", |diag| { . diag.span_suggestion_verbose( . expr.span.until(pointee.span), . "use a raw pointer instead", . format!("&raw {} ", mutability.ptr_str()), . Applicability::MachineApplicable, . ); . }); . } 1,210,720 ( 0.01%) } 345,353 ( 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 { 220,671 ( 0.00%) fn check_local(&mut self, cx: &LateContext<'tcx>, local: &'tcx LetStmt<'tcx>) { . let_unit_value::check(cx, &self.format_args, local); 160,488 ( 0.00%) } . . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 726,684 ( 0.01%) unit_cmp::check(cx, expr); 79,413,853 ( 0.66%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/unit_types/unit_cmp.rs:clippy_lints::unit_types::unit_cmp::check (242,228x) 726,684 ( 0.01%) unit_arg::check(cx, expr); 39,926,620 ( 0.33%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/unit_types/unit_arg.rs:clippy_lints::unit_types::unit_arg::check (242,228x) . } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/item_name_repetitions.rs -------------------------------------------------------------------------------- Ir -- line 181 ---------------------------------------- . is_public: bool, . /// How many bodies are between this module and the current lint pass position. . /// . /// Only the most recently seen module is updated when entering/exiting a body. . in_body_count: u32, . } . . impl ItemNameRepetitions { 7 ( 0.00%) pub fn new(conf: &'static Conf) -> Self { 9 ( 0.00%) Self { . modules: Vec::new(), 1 ( 0.00%) enum_threshold: conf.enum_variant_name_threshold, 1 ( 0.00%) struct_threshold: conf.struct_field_name_threshold, 1 ( 0.00%) avoid_breaking_exported_api: conf.avoid_breaking_exported_api, 1 ( 0.00%) allow_exact_repetitions: conf.allow_exact_repetitions, 1 ( 0.00%) allow_private_module_inception: conf.allow_private_module_inception, 14 ( 0.00%) allowed_prefixes: conf.allowed_prefixes.iter().map(|s| to_camel_case(s)).collect(), 2,298 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/str_utils.rs:clippy_utils::str_utils::to_camel_case (6x) . } 9 ( 0.00%) } . . fn is_allowed_prefix(&self, prefix: &str) -> bool { . self.allowed_prefixes.contains(prefix) . } . } . . #[must_use] . fn have_no_extra_prefix(prefixes: &[&str]) -> bool { . prefixes.iter().all(|p| p == &"" || p == &"_") . } . . impl ItemNameRepetitions { . /// Lint the names of enum variants against the name of the enum. . fn check_variants(&self, cx: &LateContext<'_>, item: &Item<'_>, def: &EnumDef<'_>) { 2,004 ( 0.00%) if self.avoid_breaking_exported_api && cx.effective_visibilities.is_exported(item.owner_id.def_id) { 7,500 ( 0.00%) => ???:::is_exported (135x) . return; . } . . if (def.variants.len() as u64) < self.enum_threshold { . return; . } . 63 ( 0.00%) let Some(ident) = item.kind.ident() else { . return; . }; . let item_name = ident.name.as_str(); 84 ( 0.00%) for var in def.variants { . check_enum_start(cx, item_name, var); . check_enum_end(cx, item_name, var); . } . 21 ( 0.00%) Self::check_enum_common_affix(cx, item, def); . } . . /// Lint the names of struct fields against the name of the struct. 1,440 ( 0.00%) fn check_fields(&self, cx: &LateContext<'_>, item: &Item<'_>, fields: &[FieldDef<'_>]) { 320 ( 0.00%) if (fields.len() as u64) < self.struct_threshold { . return; . } . 340 ( 0.00%) self.check_struct_name_repetition(cx, item, fields); . self.check_struct_common_affix(cx, item, fields); 1,280 ( 0.00%) } . . fn check_enum_common_affix(cx: &LateContext<'_>, item: &Item<'_>, def: &EnumDef<'_>) { . let first = match def.variants.first() { 21 ( 0.00%) Some(variant) => variant.ident.name.as_str(), . None => return, . }; 63 ( 0.00%) let mut pre = camel_case_split(first); 26,532 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/str_utils.rs:clippy_utils::str_utils::camel_case_split (21x) 42 ( 0.00%) let mut post = pre.clone(); 1,961 ( 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 (21x) 8 ( 0.00%) post.reverse(); . for var in def.variants { . let name = var.ident.name.as_str(); . 129 ( 0.00%) let variant_split = camel_case_split(name); 73,929 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/str_utils.rs:clippy_utils::str_utils::camel_case_split (43x) 86 ( 0.00%) if variant_split.len() == 1 { . return; . } . 100 ( 0.00%) pre = pre . .iter() . .zip(variant_split.iter()) . .take_while(|(a, b)| a == b) . .map(|e| *e.0) . .collect(); 100 ( 0.00%) post = post . .iter() . .zip(variant_split.iter().rev()) . .take_while(|(a, b)| a == b) . .map(|e| *e.0) . .collect(); . } 3 ( 0.00%) let (what, value) = match (have_no_extra_prefix(&pre), post.is_empty()) { . (true, true) => return, . (false, _) => ("pre", pre.join("")), . (true, false) => { . post.reverse(); . ("post", post.join("")) . }, . }; . span_lint_and_help( -- line 281 ---------------------------------------- -- line 296 ---------------------------------------- . // this prevents linting in macros in which the location of the field identifier names differ . if !fields . .iter() . .all(|field| item.kind.ident().is_some_and(|i| i.span.eq_ctxt(field.ident.span))) . { . return; . } . 510 ( 0.00%) if self.avoid_breaking_exported_api . && fields . .iter() 404 ( 0.00%) .any(|field| cx.effective_visibilities.is_exported(field.def_id)) 18,708 ( 0.00%) => ???:::is_exported (404x) . { . return; . } . . let mut pre: Vec<&str> = match fields.first() { . Some(first_field) => first_field.ident.name.as_str().split('_').collect(), . None => return, . }; . let mut post = pre.clone(); . post.reverse(); . for field in fields { . let field_split: Vec<&str> = field.ident.name.as_str().split('_').collect(); 206 ( 0.00%) if field_split.len() == 1 { . return; . } . 5 ( 0.00%) pre = pre . .into_iter() . .zip(field_split.iter()) . .take_while(|(a, b)| &a == b) . .map(|e| e.0) . .collect(); . post = post . .into_iter() . .zip(field_split.iter().rev()) -- line 332 ---------------------------------------- -- line 335 ---------------------------------------- . .collect(); . } . let prefix = pre.join("_"); . post.reverse(); . let postfix = match post.last() { . Some(&"") => post.join("_") + "_", . Some(_) | None => post.join("_"), . }; 10 ( 0.00%) if fields.len() > 1 { 5 ( 0.00%) let (what, value) = match ( 5 ( 0.00%) prefix.is_empty() || prefix.chars().all(|c| c == '_'), . postfix.is_empty(), . ) { . (true, true) => return, . (false, _) => ("pre", prefix), . (true, false) => ("post", postfix), . }; . if fields.iter().all(|field| is_bool(field.ty)) { . // If all fields are booleans, we don't want to emit this lint. -- line 353 ---------------------------------------- -- line 360 ---------------------------------------- . format!("all fields have the same {what}fix: `{value}`"), . None, . format!("remove the {what}fixes"), . ); . } . } . . fn check_struct_name_repetition(&self, cx: &LateContext<'_>, item: &Item<'_>, fields: &[FieldDef<'_>]) { 340 ( 0.00%) let Some(ident) = item.kind.ident() else { return }; 170 ( 0.00%) let snake_name = to_snake_case(ident.name.as_str()); 79,207 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/str_utils.rs:clippy_utils::str_utils::to_snake_case (85x) . let item_name_words: Vec<&str> = snake_name.split('_').collect(); . for field in fields { 3,353 ( 0.00%) if self.avoid_breaking_exported_api && cx.effective_visibilities.is_exported(field.def_id) { 22,953 ( 0.00%) => ???:::is_exported (479x) . continue; . } . 389 ( 0.00%) if !field.ident.span.eq_ctxt(ident.span) { . // consider linting only if the field identifier has the same SyntaxContext as the item(struct) . continue; . } . . let field_words: Vec<&str> = field.ident.name.as_str().split('_').collect(); 778 ( 0.00%) if field_words.len() >= item_name_words.len() { . // if the field name is shorter than the struct name it cannot contain it 208 ( 0.00%) if field_words.iter().zip(item_name_words.iter()).all(|(a, b)| a == b) { . span_lint_hir( . cx, . STRUCT_FIELD_NAMES, 2 ( 0.00%) field.hir_id, 1 ( 0.00%) field.span, . "field name starts with the struct's name", . ); . } 418 ( 0.00%) if field_words.len() > item_name_words.len() . // lint only if the end is not covered by the start . && field_words . .iter() . .rev() . .zip(item_name_words.iter().rev()) . .all(|(a, b)| a == b) . { . span_lint_hir( -- line 401 ---------------------------------------- -- line 410 ---------------------------------------- . } . } . } . . fn check_enum_start(cx: &LateContext<'_>, item_name: &str, variant: &Variant<'_>) { . let name = variant.ident.name.as_str(); . let item_name_chars = item_name.chars().count(); . 896 ( 0.00%) if count_match_start(item_name, name).char_count == item_name_chars 23,656 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/str_utils.rs:clippy_utils::str_utils::count_match_start (128x) . && name.chars().nth(item_name_chars).is_some_and(|c| !c.is_lowercase()) 12 ( 0.00%) && name.chars().nth(item_name_chars + 1).is_some_and(|c| !c.is_numeric()) 60 ( 0.00%) && !check_enum_tuple_path_match(name, variant.data) 180 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/item_name_repetitions.rs:clippy_lints::item_name_repetitions::check_enum_tuple_path_match (10x) . { . span_lint_hir( . cx, . ENUM_VARIANT_NAMES, 20 ( 0.00%) variant.hir_id, 10 ( 0.00%) variant.span, . "variant name starts with the enum's name", . ); . } . } . . fn check_enum_end(cx: &LateContext<'_>, item_name: &str, variant: &Variant<'_>) { . let name = variant.ident.name.as_str(); . let item_name_chars = item_name.chars().count(); . 1,024 ( 0.00%) if count_match_end(item_name, name).char_count == item_name_chars 19,890 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/str_utils.rs:clippy_utils::str_utils::count_match_end (128x) . && !check_enum_tuple_path_match(name, variant.data) . { . span_lint_hir( . cx, . ENUM_VARIANT_NAMES, . variant.hir_id, . variant.span, . "variant name ends with the enum's name", . ); . } . } . . /// Checks if an enum tuple variant contains a single field . /// whose qualified path contains the variant's name. 80 ( 0.00%) fn check_enum_tuple_path_match(variant_name: &str, variant_data: VariantData<'_>) -> bool { . // Only check single-field tuple variants 20 ( 0.00%) let VariantData::Tuple(fields, ..) = variant_data else { . return false; . }; . if fields.len() != 1 { . return false; . } . // Check if field type is a path and contains the variant name . match fields[0].ty.kind { . TyKind::Path(QPath::Resolved(_, path)) => path . .segments . .iter() . .any(|segment| segment.ident.name.as_str() == variant_name), . TyKind::Path(QPath::TypeRelative(_, segment)) => segment.ident.name.as_str() == variant_name, . _ => false, . } 80 ( 0.00%) } . . impl LateLintPass<'_> for ItemNameRepetitions { . fn check_item_post(&mut self, _: &LateContext<'_>, item: &Item<'_>) { 11,876 ( 0.00%) if matches!(item.kind, ItemKind::Mod(..)) { . let prev = self.modules.pop(); . debug_assert!(prev.is_some()); . } . } . . fn check_body(&mut self, _: &LateContext<'_>, _: &Body<'_>) { 12,408 ( 0.00%) if let [.., last] = &mut *self.modules { 12,406 ( 0.00%) last.in_body_count += 1; . } . } . . fn check_body_post(&mut self, _: &LateContext<'_>, _: &Body<'_>) { 12,408 ( 0.00%) if let [.., last] = &mut *self.modules { 12,406 ( 0.00%) last.in_body_count -= 1; . } . } . 53,442 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) { 34,534 ( 0.00%) let ident = match item.kind { 212 ( 0.00%) ItemKind::Mod(ident, _) => { 318 ( 0.00%) if let [.., prev] = &*self.modules . && prev.name == ident.name . && prev.in_body_count == 0 . && (!self.allow_private_module_inception || prev.is_public) . && !item.span.from_expansion() . && !is_from_proc_macro(cx, item) . { . span_lint( . cx, -- line 502 ---------------------------------------- -- line 503 ---------------------------------------- . MODULE_INCEPTION, . item.span, . "module has the same name as its containing module", . ); . } . ident . }, . 945 ( 0.00%) ItemKind::Enum(ident, _, def) => { 675 ( 0.00%) if !ident.span.in_external_macro(cx.tcx.sess.source_map()) { 135 ( 0.00%) self.check_variants(cx, item, &def); . } . ident . }, 472 ( 0.00%) ItemKind::Struct(ident, _, data) => { 868 ( 0.00%) if let VariantData::Struct { fields, .. } = data 640 ( 0.00%) && !ident.span.in_external_macro(cx.tcx.sess.source_map()) . { 1,120 ( 0.00%) self.check_fields(cx, item, fields); 421,714 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/item_name_repetitions.rs:::check_fields (160x) . } . ident . }, . . ItemKind::Const(ident, ..) 3 ( 0.00%) | ItemKind::ExternCrate(_, ident) . | ItemKind::Fn { ident, .. } . | ItemKind::Macro(ident, ..) . | ItemKind::Static(_, ident, ..) . | ItemKind::Trait { ident, .. } . | ItemKind::TraitAlias(_, ident, ..) . | ItemKind::TyAlias(ident, ..) . | ItemKind::Union(ident, ..) . | ItemKind::Use(_, UseKind::Single(ident)) => ident, . . ItemKind::ForeignMod { .. } | ItemKind::GlobalAsm { .. } | ItemKind::Impl(_) | ItemKind::Use(..) => return, . }; . . let item_name = ident.name.as_str(); 6,842 ( 0.00%) let item_camel = to_camel_case(item_name); 2,394,337 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/str_utils.rs:clippy_utils::str_utils::to_camel_case (3,421x) . 6,842 ( 0.00%) if let [.., prev] = &*self.modules 10,026 ( 0.00%) && prev.is_public 3,012 ( 0.00%) && prev.in_body_count == 0 3,036 ( 0.00%) && !item.span.from_expansion() 2,832 ( 0.00%) && !matches!(item.kind, ItemKind::Macro(..)) 5,644 ( 0.00%) && cx.tcx.visibility(item.owner_id).is_public() . { 1,054 ( 0.00%) if !self.allow_exact_repetitions && item_camel == prev.name_camel { . if !is_from_proc_macro(cx, item) { . span_lint( . cx, . MODULE_NAME_REPETITIONS, . ident.span, . "item name is the same as its containing module's name", . ); . } 1,054 ( 0.00%) } else if item_camel.len() > prev.name_camel.len() { . if let Some(s) = item_camel.strip_prefix(&prev.name_camel) . && let Some(c) = s.chars().next() 224 ( 0.00%) && (c == '_' || c.is_uppercase() || c.is_numeric()) . { 93 ( 0.00%) if !is_from_proc_macro(cx, item) { 16,148 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::is_from_proc_macro:: (31x) . span_lint( . cx, . MODULE_NAME_REPETITIONS, . ident.span, . "item name starts with its containing module's name", . ); . } . } else if let Some(s) = item_camel.strip_suffix(&prev.name_camel) 16 ( 0.00%) && !self.is_allowed_prefix(s) 24 ( 0.00%) && !is_from_proc_macro(cx, item) 4,093 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::is_from_proc_macro:: (8x) . { . span_lint( . cx, . MODULE_NAME_REPETITIONS, . ident.span, . "item name ends with its containing module's name", . ); . } . } . } . 6,822 ( 0.00%) if matches!(item.kind, ItemKind::Mod(..)) { . self.modules.push(ModInfo { . name: ident.name, . name_camel: item_camel, 318 ( 0.00%) is_public: cx.tcx.visibility(item.owner_id).is_public(), . in_body_count: 0, . }); . } 47,504 ( 0.00%) } . } 34,930 ( 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/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 { 45,898 ( 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 { 30,472 ( 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. . 91,718 ( 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 { 76,429 ( 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. . 221,687 ( 0.00%) if self < rhs { . None . } else { . // SAFETY: just checked this can't overflow 101,358 ( 0.00%) Some(unsafe { intrinsics::unchecked_sub(self, rhs) }) . } . } . . /// Strict integer subtraction. Computes `self - rhs`, panicking if . /// overflow occurred. . /// . /// # Panics . /// -- line 1064 ---------------------------------------- -- line 1144 ---------------------------------------- . ( . lhs: $SelfT = self, . rhs: $SelfT = rhs, . ) => !lhs.overflowing_sub(rhs).1, . ); . . // SAFETY: this is guaranteed to be safe by the caller. . unsafe { 22 ( 0.00%) intrinsics::unchecked_sub(self, rhs) . } . } . . /// Checked subtraction with a signed integer. Computes `self - rhs`, . /// returning `None` if overflow occurred. . /// . /// # Examples . /// -- line 1160 ---------------------------------------- -- line 1353 ---------------------------------------- . ( . lhs: $SelfT = self, . rhs: $SelfT = rhs, . ) => !lhs.overflowing_mul(rhs).1, . ); . . // SAFETY: this is guaranteed to be safe by the caller. . unsafe { 299,189 ( 0.00%) intrinsics::unchecked_mul(self, rhs) . } . } . . /// Checked integer division. Computes `self / rhs`, returning `None` . /// if `rhs == 0`. . /// . /// # Examples . /// -- line 1369 ---------------------------------------- -- line 1372 ---------------------------------------- . #[doc = concat!("assert_eq!(1", stringify!($SelfT), ".checked_div(0), None);")] . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_checked_int_div", since = "1.52.0")] . #[must_use = "this returns the result of the operation, \ . without modifying the original"] . #[inline] . pub const fn checked_div(self, rhs: Self) -> Option { 4 ( 0.00%) if intrinsics::unlikely(rhs == 0) { . None . } else { . // SAFETY: div by zero has been checked above and unsigned types have no other . // failure modes for division 8 ( 0.00%) Some(unsafe { intrinsics::unchecked_div(self, rhs) }) 22 ( 0.00%) => /rustc/84b36a78a28a63f134171c670be1932ffa2485f8/library/compiler-builtins/compiler-builtins/src/macros.rs:__udivti3 (2x) . } . } . . /// Strict integer division. Computes `self / rhs`. . /// . /// Strict division on unsigned types is just normal division. There's no . /// way overflow could ever happen. This function exists so that all . /// operations are accounted for in the strict operations. -- line 1393 ---------------------------------------- -- line 2048 ---------------------------------------- . concat!(stringify!($SelfT), "::unchecked_shl cannot overflow"), . ( . rhs: u32 = rhs, . ) => rhs < <$ActualT>::BITS, . ); . . // SAFETY: this is guaranteed to be safe by the caller. . unsafe { 456 ( 0.00%) intrinsics::unchecked_shl(self, rhs) . } . } . . /// Unbounded shift left. Computes `self << rhs`, without bounding the value of `rhs`. . /// . /// If `rhs` is larger or equal to the number of bits in `self`, . /// the entire value is shifted out, and `0` is returned. . /// -- line 2064 ---------------------------------------- -- 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 { 19,450 ( 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 { 28,027 ( 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 { 555,539 ( 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 { 125,176 ( 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 { 992,565 ( 0.01%) 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 2942 ---------------------------------------- . #[doc = concat!("assert_eq!(", stringify!($SelfT), "::MAX.overflowing_add(1), (0, 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_add(self, rhs: Self) -> (Self, bool) { 553 ( 0.00%) let (a, b) = intrinsics::add_with_overflow(self as $ActualT, rhs as $ActualT); . (a as Self, b) . } . . /// Calculates `self` + `rhs` + `carry` and returns a tuple containing . /// the sum and the output carry (in that order). . /// . /// Performs "ternary addition" of two integer operands and a carry-in . /// bit, and returns an output integer and a carry-out bit. This allows -- line 2958 ---------------------------------------- -- 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) { 637,294 ( 0.01%) 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 3740 ---------------------------------------- . /// ``` . #[stable(feature = "int_roundings1", since = "1.73.0")] . #[rustc_const_stable(feature = "int_roundings1", since = "1.73.0")] . #[must_use = "this returns the result of the operation, \ . without modifying the original"] . #[inline] . #[track_caller] . pub const fn div_ceil(self, rhs: Self) -> Self { 36 ( 0.00%) let d = self / rhs; 31 ( 0.00%) let r = self % rhs; 38 ( 0.00%) if r > 0 { . d + 1 . } else { . d . } . } . . /// Calculates the smallest value greater than or equal to `self` that . /// is a multiple of `rhs`. -- line 3758 ---------------------------------------- -- line 3827 ---------------------------------------- . /// ``` . #[stable(feature = "unsigned_is_multiple_of", since = "1.87.0")] . #[rustc_const_stable(feature = "unsigned_is_multiple_of", since = "1.87.0")] . #[must_use] . #[inline] . pub const fn is_multiple_of(self, rhs: Self) -> bool { . match rhs { . 0 => self == 0, 10 ( 0.00%) _ => self % rhs == 0, . } . } . . /// Returns `true` if and only if `self == 2^k` for some unsigned integer `k`. . /// . /// # Examples . /// . /// ``` -- line 3843 ---------------------------------------- -- 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 { 125 ( 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 { 88 ( 0.00%) if self <= 1 { return 0; } . 140 ( 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. 70 ( 0.00%) let z = unsafe { intrinsics::ctlz_nonzero(p) }; 140 ( 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 { 5 ( 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 ---------------------------------------- 605,713 ( 0.01%) -------------------------------------------------------------------------------- -- 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 { 2,422,280 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 12,677 ( 0.00%) if let Some(macro_call) = root_macro_call_first_node(cx, e) 14,066 ( 0.00%) && let is_debug = match cx.tcx.get_diagnostic_name(macro_call.def_id) { 142,222 ( 0.00%) => ???:::get_diagnostic_name (1,811x) . Some(sym::debug_assert_macro) => true, . Some(sym::assert_macro) => false, . _ => return, . } 1,806 ( 0.00%) && let Some((condition, _)) = find_assert_args(cx, e, macro_call.expn) 486,660 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::find_assert_args (258x) . // Check if the whole expression can be moved into a const context. . // Note that const eval can evaluate things which cannot be moved (e.g. `false && x`). 1,290 ( 0.00%) && is_const_evaluatable(cx.tcx, cx.typeck_results(), condition) 149,173 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/visitors.rs:clippy_utils::visitors::is_const_evaluatable (258x) . && let Some((Constant::Bool(assert_val), const_src)) = . ConstEvalCtxt::new(cx).eval_with_source(condition, macro_call.span.ctxt()) . && let in_const_context = is_inside_always_const_context(cx.tcx, e.hir_id) . && (const_src.is_local() || !in_const_context) . && !(is_debug && as_bool_lit(condition) == Some(false)) . { . let (msg, help) = if !const_src.is_local() { . let help = if self.msrv.meets(cx, msrvs::CONST_BLOCKS) { -- line 65 ---------------------------------------- -- 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); . } 1,937,824 ( 0.02%) } . } . . 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 ---------------------------------------- 4,396 ( 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . // (x % c + c) % c 484,456 ( 0.00%) if let ExprKind::Binary(rem_op, rem_lhs, rem_rhs) = expr.kind 6,736 ( 0.00%) && rem_op.node == BinOpKind::Rem 22 ( 0.00%) && let ExprKind::Binary(add_op, add_lhs, add_rhs) = rem_lhs.kind . && 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) -- line 63 ---------------------------------------- -- line 93 ---------------------------------------- . MANUAL_REM_EUCLID, . expr.span, . "manual `rem_euclid` implementation", . "consider using", . format!("{rem_of}.rem_euclid({const1})"), . app, . ); . } 1,937,824 ( 0.02%) } . } . . // 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 ---------------------------------------- 11 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs -------------------------------------------------------------------------------- Ir -- line 47 ---------------------------------------- . /// Any decimal or hexadecimal digit depending on the location. . Num, . /// An attribute. . Attr(Symbol), . } . . /// Checks if the start and the end of the span's text matches the patterns. This will return false . /// if the span crosses multiple files or if source is not available. 197,040 ( 0.00%) fn span_matches_pat(sess: &Session, span: Span, start_pat: Pat, end_pat: Pat) -> bool { 98,520 ( 0.00%) let pos = sess.source_map().lookup_byte_offset(span.lo()); 3,221,596 ( 0.03%) => ???:::lookup_byte_offset (19,704x) 39,408 ( 0.00%) let Some(ref src) = pos.sf.src else { . return false; . }; . let end = span.hi() - pos.sf.start_pos; 157,632 ( 0.00%) src.get(pos.pos.0 as usize..end.0 as usize).is_some_and(|s| { . // Spans can be wrapped in a mixture or parenthesis, whitespace, and trailing commas. 19,714 ( 0.00%) let start_str = s.trim_start_matches(|c: char| c.is_whitespace() || c == '('); . let end_str = s.trim_end_matches(|c: char| c.is_whitespace() || c == ')' || c == ','); 256,152 ( 0.00%) (match start_pat { . Pat::Str(text) => start_str.starts_with(text), . Pat::MultiStr(texts) => texts.iter().any(|s| start_str.starts_with(s)), . Pat::OwnedMultiStr(texts) => texts.iter().any(|s| start_str.starts_with(s)), . Pat::Sym(sym) => start_str.starts_with(sym.as_str()), . Pat::Num => start_str.as_bytes().first().is_some_and(u8::is_ascii_digit), . Pat::Attr(sym) => { . let start_str = start_str . .strip_prefix("#[") . .or_else(|| start_str.strip_prefix("#![")) . .unwrap_or(start_str); . start_str.trim_start().starts_with(sym.as_str()) . }, 157,632 ( 0.00%) } && match end_pat { . Pat::Str(text) => end_str.ends_with(text), . Pat::MultiStr(texts) => texts.iter().any(|s| end_str.ends_with(s)), . Pat::OwnedMultiStr(texts) => texts.iter().any(|s| end_str.ends_with(s)), 7,453 ( 0.00%) Pat::Sym(sym) => end_str.ends_with(sym.as_str()), . Pat::Num => end_str.as_bytes().last().is_some_and(u8::is_ascii_hexdigit), . Pat::Attr(_) => false, . }) 59,112 ( 0.00%) }) 177,336 ( 0.00%) } . . /// Get the search patterns to use for the given literal . fn lit_search_pat(lit: &LitKind) -> (Pat, Pat) { 1,120 ( 0.00%) match lit { 21 ( 0.00%) LitKind::Str(_, StrStyle::Cooked) => (Pat::Str("\""), Pat::Str("\"")), . LitKind::Str(_, StrStyle::Raw(0)) => (Pat::Str("r"), Pat::Str("\"")), . LitKind::Str(_, StrStyle::Raw(_)) => (Pat::Str("r#"), Pat::Str("#")), . LitKind::ByteStr(_, StrStyle::Cooked) => (Pat::Str("b\""), Pat::Str("\"")), . LitKind::ByteStr(_, StrStyle::Raw(0)) => (Pat::Str("br\""), Pat::Str("\"")), . LitKind::ByteStr(_, StrStyle::Raw(_)) => (Pat::Str("br#\""), Pat::Str("#")), . LitKind::Byte(_) => (Pat::Str("b'"), Pat::Str("'")), . LitKind::Char(_) => (Pat::Str("'"), Pat::Str("'")), . LitKind::Int(_, LitIntType::Signed(IntTy::Isize)) => (Pat::Num, Pat::Str("isize")), . LitKind::Int(_, LitIntType::Unsigned(UintTy::Usize)) => (Pat::Num, Pat::Str("usize")), 352 ( 0.00%) LitKind::Int(..) => (Pat::Num, Pat::Num), . LitKind::Float(..) => (Pat::Num, Pat::Str("")), . LitKind::Bool(true) => (Pat::Str("true"), Pat::Str("true")), . LitKind::Bool(false) => (Pat::Str("false"), Pat::Str("false")), . _ => (Pat::Str(""), Pat::Str("")), . } 95 ( 0.00%) } . . /// Get the search patterns to use for the given path 11,633 ( 0.00%) fn qpath_search_pat(path: &QPath<'_>) -> (Pat, Pat) { 23,266 ( 0.00%) match path { . QPath::Resolved(ty, path) => { 9,785 ( 0.00%) let start = if ty.is_some() { . Pat::Str("<") . } else { 9,785 ( 0.00%) path.segments.first().map_or(Pat::Str(""), |seg| { 19,533 ( 0.00%) if seg.ident.name == kw::PathRoot { . Pat::Str("::") . } else { . Pat::Sym(seg.ident.name) . } . }) . }; . let end = path.segments.last().map_or(Pat::Str(""), |seg| { 9,787 ( 0.00%) if seg.args.is_some() { . Pat::Str(">") . } else { . Pat::Sym(seg.ident.name) . } . }); 58,710 ( 0.00%) (start, end) . }, 14,784 ( 0.00%) QPath::TypeRelative(_, name) => (Pat::Str(""), Pat::Sym(name.ident.name)), . } 11,633 ( 0.00%) } . . fn path_search_pat(path: &Path<'_>) -> (Pat, Pat) { . let (head, tail) = match path.segments { 24 ( 0.00%) [] => return (Pat::Str(""), Pat::Str("")), . [p] => (Pat::Sym(p.ident.name), p), . // QPath::Resolved can have a path that looks like `::baz` where . // the path (`Bar::baz`) has it's span covering the whole QPath. 24 ( 0.00%) [.., tail] => (Pat::Str(""), tail), . }; . ( . head, 6 ( 0.00%) if tail.args.is_some() { . Pat::Str(">") . } else { 6 ( 0.00%) Pat::Sym(tail.ident.name) . }, . ) . } . . /// Get the search patterns to use for the given expression . fn expr_search_pat(tcx: TyCtxt<'_>, e: &Expr<'_>) -> (Pat, Pat) { 451,638 ( 0.00%) fn expr_search_pat_inner(tcx: TyCtxt<'_>, e: &Expr<'_>, outer_span: Span) -> (Pat, Pat) { . // The expression can have subexpressions in different contexts, in which case . // building up a search pattern from the macro expansion would lead to false positives; . // e.g. `return format!(..)` would be considered to be from a proc macro . // if we build up a pattern for the macro expansion and compare it to the invocation `format!()`. . // So instead we return an empty pattern such that `span_matches_pat` always returns true. 100,181 ( 0.00%) if !e.span.eq_ctxt(outer_span) { . return (Pat::Str(""), Pat::Str("")); . } . 155,382 ( 0.00%) match e.kind { 92 ( 0.00%) ExprKind::ConstBlock(_) => (Pat::Str("const"), Pat::Str("}")), . // Parenthesis are trimmed from the text before the search patterns are matched. . // See: `span_matches_pat` 37 ( 0.00%) ExprKind::Tup([]) => (Pat::Str(")"), Pat::Str("(")), 15,474 ( 0.00%) ExprKind::Unary(UnOp::Deref, e) => (Pat::Str("*"), expr_search_pat_inner(tcx, e, outer_span).1), 65,020 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::expr_search_pat::expr_search_pat_inner'2 (690x) . ExprKind::Unary(UnOp::Not, e) => (Pat::Str("!"), expr_search_pat_inner(tcx, e, outer_span).1), . ExprKind::Unary(UnOp::Neg, e) => (Pat::Str("-"), expr_search_pat_inner(tcx, e, outer_span).1), 1,045 ( 0.00%) ExprKind::Lit(lit) => lit_search_pat(&lit.node), 72 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::lit_search_pat (4x) 576 ( 0.00%) ExprKind::Array(_) | ExprKind::Repeat(..) => (Pat::Str("["), Pat::Str("]")), 10,832 ( 0.00%) ExprKind::Call(e, []) | ExprKind::MethodCall(_, e, [], _) => { 3,392 ( 0.00%) (expr_search_pat_inner(tcx, e, outer_span).0, Pat::Str("(")) 7,991 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::expr_search_pat::expr_search_pat_inner'2 (83x) . }, 5,494 ( 0.00%) ExprKind::Call(first, [.., last]) 510 ( 0.00%) | ExprKind::MethodCall(_, first, [.., last], _) . | ExprKind::Binary(_, first, last) 4 ( 0.00%) | ExprKind::Tup([first, .., last]) . | ExprKind::Assign(first, last, _) 11,732 ( 0.00%) | ExprKind::AssignOp(_, first, last) => ( 8,799 ( 0.00%) expr_search_pat_inner(tcx, first, outer_span).0, 11,948 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::expr_search_pat::expr_search_pat_inner'2 (76x) 23,464 ( 0.00%) expr_search_pat_inner(tcx, last, outer_span).1, 11,842 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::expr_search_pat::expr_search_pat_inner'2 (76x) . ), . ExprKind::Tup([e]) | ExprKind::DropTemps(e) => expr_search_pat_inner(tcx, e, outer_span), 40 ( 0.00%) ExprKind::Cast(e, _) | ExprKind::Type(e, _) => (expr_search_pat_inner(tcx, e, outer_span).0, Pat::Str("")), 332 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::expr_search_pat::expr_search_pat_inner'2 (3x) . ExprKind::Let(let_expr) => (Pat::Str("let"), expr_search_pat_inner(tcx, let_expr.init, outer_span).1), 54 ( 0.00%) ExprKind::If(..) => (Pat::Str("if"), Pat::Str("}")), . ExprKind::Loop(_, Some(_), _, _) | ExprKind::Block(_, Some(_)) => (Pat::Str("'"), Pat::Str("}")), . ExprKind::Loop(_, None, LoopSource::Loop, _) => (Pat::Str("loop"), Pat::Str("}")), . ExprKind::Loop(_, None, LoopSource::While, _) => (Pat::Str("while"), Pat::Str("}")), . ExprKind::Loop(_, None, LoopSource::ForLoop, _) | ExprKind::Match(_, _, MatchSource::ForLoopDesugar) => { . (Pat::Str("for"), Pat::Str("}")) . }, . ExprKind::Match(_, _, MatchSource::Normal) => (Pat::Str("match"), Pat::Str("}")), . ExprKind::Match(e, _, MatchSource::TryDesugar(_)) => { . (expr_search_pat_inner(tcx, e, outer_span).0, Pat::Str("?")) . }, . ExprKind::Match(e, _, MatchSource::AwaitDesugar) | ExprKind::Yield(e, YieldSource::Await { .. }) => { . (expr_search_pat_inner(tcx, e, outer_span).0, Pat::Str("await")) . }, 69 ( 0.00%) ExprKind::Closure(&Closure { body, .. }) => ( 92 ( 0.00%) Pat::Str(""), 207 ( 0.00%) expr_search_pat_inner(tcx, tcx.hir_body(body).value, outer_span).1, 3,232 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::expr_search_pat::expr_search_pat_inner'2 (23x) 1,915 ( 0.00%) => ???:::hir_body (23x) . ), . ExprKind::Block( . Block { . rules: BlockCheckMode::UnsafeBlock(UnsafeSource::UserProvided), . .. . }, . None, . ) => (Pat::Str("unsafe"), Pat::Str("}")), 18 ( 0.00%) ExprKind::Block(_, None) => (Pat::Str("{"), Pat::Str("}")), 22,828 ( 0.00%) ExprKind::Field(e, name) => (expr_search_pat_inner(tcx, e, outer_span).0, Pat::Sym(name.name)), 4,792 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::expr_search_pat::expr_search_pat_inner'2 (53x) 9,240 ( 0.00%) ExprKind::Index(e, _, _) => (expr_search_pat_inner(tcx, e, outer_span).0, Pat::Str("]")), 109,218 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::expr_search_pat::expr_search_pat_inner'2 (731x) 127,897 ( 0.00%) ExprKind::Path(ref path) => qpath_search_pat(path), 30,090 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::qpath_search_pat (885x) 44,656 ( 0.00%) ExprKind::AddrOf(_, _, e) => (Pat::Str("&"), expr_search_pat_inner(tcx, e, outer_span).1), 978,041 ( 0.01%) => site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::expr_search_pat::expr_search_pat_inner'2 (5,482x) . ExprKind::Break(Destination { label: None, .. }, None) => (Pat::Str("break"), Pat::Str("break")), . ExprKind::Break(Destination { label: Some(name), .. }, None) => { . (Pat::Str("break"), Pat::Sym(name.ident.name)) . }, . ExprKind::Break(_, Some(e)) => (Pat::Str("break"), expr_search_pat_inner(tcx, e, outer_span).1), . ExprKind::Continue(Destination { label: None, .. }) => (Pat::Str("continue"), Pat::Str("continue")), . ExprKind::Continue(Destination { label: Some(name), .. }) => { . (Pat::Str("continue"), Pat::Sym(name.ident.name)) . }, . ExprKind::Ret(None) => (Pat::Str("return"), Pat::Str("return")), 6,153 ( 0.00%) ExprKind::Ret(Some(e)) => (Pat::Str("return"), expr_search_pat_inner(tcx, e, outer_span).1), 88,681 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::expr_search_pat::expr_search_pat_inner'2 (879x) 60 ( 0.00%) ExprKind::Struct(path, _, _) => (qpath_search_pat(path).0, Pat::Str("}")), 202 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::qpath_search_pat (6x) . ExprKind::Yield(e, YieldSource::Yield) => (Pat::Str("yield"), expr_search_pat_inner(tcx, e, outer_span).1), . _ => (Pat::Str(""), Pat::Str("")), . } 106,952 ( 0.00%) } . 26,694 ( 0.00%) expr_search_pat_inner(tcx, e, e.span) 1,992,783 ( 0.02%) => site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::expr_search_pat::expr_search_pat_inner (8,898x) . } . . fn fn_header_search_pat(header: FnHeader) -> Pat { 8,007 ( 0.00%) if header.is_async() { . Pat::Str("async") 16,014 ( 0.00%) } else if matches!(header.constness, rustc_hir::Constness::Const { always: false }) { . Pat::Str("const") . } else if header.is_unsafe() { . Pat::Str("unsafe") 23,862 ( 0.00%) } else if header.abi != ExternAbi::Rust { . Pat::Str("extern") . } else { . Pat::MultiStr(&["fn", "extern"]) . } . } . . fn item_search_pat(item: &Item<'_>) -> (Pat, Pat) { 35,379 ( 0.00%) let (start_pat, end_pat) = match &item.kind { . ItemKind::ExternCrate(..) => (Pat::Str("extern"), Pat::Str(";")), . ItemKind::Static(..) => (Pat::Str("static"), Pat::Str(";")), . ItemKind::Const(..) => (Pat::Str("const"), Pat::Str(";")), 6,996 ( 0.00%) ItemKind::Fn { sig, .. } => (fn_header_search_pat(sig.header), Pat::Str("")), . ItemKind::ForeignMod { .. } => (Pat::Str("extern"), Pat::Str("}")), . ItemKind::TyAlias(..) => (Pat::Str("type"), Pat::Str(";")), . ItemKind::Enum(..) => (Pat::Str("enum"), Pat::Str("}")), . ItemKind::Struct(_, _, VariantData::Struct { .. }) => (Pat::Str("struct"), Pat::Str("}")), . ItemKind::Struct(..) => (Pat::Str("struct"), Pat::Str(";")), . ItemKind::Union(..) => (Pat::Str("union"), Pat::Str("}")), . ItemKind::Trait { . safety: Safety::Unsafe, .. -- line 270 ---------------------------------------- -- line 282 ---------------------------------------- . ItemKind::Impl(_) => (Pat::Str("impl"), Pat::Str("}")), . ItemKind::Mod(..) => (Pat::Str("mod"), Pat::Str("")), . ItemKind::Macro(_, def, _) => ( . Pat::Str(if def.macro_rules { "macro_rules" } else { "macro" }), . Pat::Str(""), . ), . ItemKind::TraitAlias(..) => (Pat::Str("trait"), Pat::Str(";")), . ItemKind::GlobalAsm { .. } => return (Pat::Str("global_asm"), Pat::Str("")), 5 ( 0.00%) ItemKind::Use(..) => return (Pat::Str(""), Pat::Str("")), . }; 5,948 ( 0.00%) if item.vis_span.is_empty() { 6,804 ( 0.00%) (start_pat, end_pat) . } else { 17,744 ( 0.00%) (Pat::Str("pub"), end_pat) . } . } . . fn trait_item_search_pat(item: &TraitItem<'_>) -> (Pat, Pat) { 23,540 ( 0.00%) match &item.kind { . TraitItemKind::Const(..) => (Pat::Str("const"), Pat::Str(";")), . TraitItemKind::Type(..) => (Pat::Str("type"), Pat::Str(";")), 6,420 ( 0.00%) TraitItemKind::Fn(sig, ..) => (fn_header_search_pat(sig.header), Pat::Str("")), . } . } . . fn impl_item_search_pat(item: &ImplItem<'_>) -> (Pat, Pat) { 30,464 ( 0.00%) let (mut start_pat, end_pat) = match &item.kind { . ImplItemKind::Const(..) => (Pat::Str("const"), Pat::Str(";")), . ImplItemKind::Type(..) => (Pat::Str("type"), Pat::Str(";")), 3,584 ( 0.00%) ImplItemKind::Fn(sig, ..) => (fn_header_search_pat(sig.header), Pat::Str("")), . }; 5,376 ( 0.00%) if let ImplItemImplKind::Inherent { vis_span, .. } = item.impl_kind 1,792 ( 0.00%) && !vis_span.is_empty() . { 5,528 ( 0.00%) start_pat = Pat::Str("pub"); . } 21,504 ( 0.00%) (start_pat, end_pat) . } . . fn field_def_search_pat(def: &FieldDef<'_>) -> (Pat, Pat) { . if def.vis_span.is_empty() { . if def.is_positional() { . (Pat::Str(""), Pat::Str("")) . } else { . (Pat::Sym(def.ident.name), Pat::Str("")) -- line 326 ---------------------------------------- -- line 333 ---------------------------------------- . fn variant_search_pat(v: &Variant<'_>) -> (Pat, Pat) { . match v.data { . VariantData::Struct { .. } => (Pat::Sym(v.ident.name), Pat::Str("}")), . VariantData::Tuple(..) => (Pat::Sym(v.ident.name), Pat::Str("")), . VariantData::Unit(..) => (Pat::Sym(v.ident.name), Pat::Sym(v.ident.name)), . } . } . 15,687 ( 0.00%) fn fn_kind_pat(tcx: TyCtxt<'_>, kind: &FnKind<'_>, body: &Body<'_>, hir_id: HirId) -> (Pat, Pat) { 18,546 ( 0.00%) let (mut start_pat, end_pat) = match kind { 1,185 ( 0.00%) FnKind::ItemFn(.., header) => (fn_header_search_pat(*header), Pat::Str("")), 1,116 ( 0.00%) FnKind::Method(.., sig) => (fn_header_search_pat(sig.header), Pat::Str("")), . FnKind::Closure => return (Pat::Str(""), expr_search_pat(tcx, body.value).1), . }; 16,846 ( 0.00%) match tcx.hir_node(hir_id) { 117,047 ( 0.00%) => ???:::hir_node (1,743x) 3,555 ( 0.00%) Node::Item(Item { vis_span, .. }) . | Node::ImplItem(ImplItem { 532 ( 0.00%) impl_kind: ImplItemImplKind::Inherent { vis_span, .. }, . .. . }) => { 3,754 ( 0.00%) if !vis_span.is_empty() { . start_pat = Pat::Str("pub"); . } . }, . Node::ImplItem(_) | Node::TraitItem(_) => {}, . _ => start_pat = Pat::Str(""), . } 17,430 ( 0.00%) (start_pat, end_pat) 15,687 ( 0.00%) } . . fn attr_search_pat(attr: &Attribute) -> (Pat, Pat) { 2,259 ( 0.00%) match attr.kind { . AttrKind::Normal(..) => { 3,012 ( 0.00%) if let Some(name) = attr.name() { 6,777 ( 0.00%) => ???:::name (753x) . // NOTE: This will likely have false positives, like `allow = 1` 3,012 ( 0.00%) (Pat::Attr(name), Pat::Str("")) . } else { . (Pat::Str("#"), Pat::Str("]")) . } . }, . AttrKind::Synthetic(..) => unreachable!(), . AttrKind::DocComment(_kind @ CommentKind::Line, ..) => { . if attr.style == AttrStyle::Outer { . (Pat::Str("///"), Pat::Str("")) -- line 376 ---------------------------------------- -- line 689 ---------------------------------------- . type Context: LintContext; . fn search_pat(&self, cx: &Self::Context) -> (Pat, Pat); . fn span(&self) -> Span; . } . macro_rules! impl_with_search_pat { . (($cx_ident:ident: $cx_ty:ident<$cx_lt:lifetime>, $self:tt: $ty:ty) => $fn:ident($($args:tt)*)) => { . impl<$cx_lt> WithSearchPat<$cx_lt> for $ty { . type Context = $cx_ty<$cx_lt>; 67,981 ( 0.00%) fn search_pat(&$self, $cx_ident: &Self::Context) -> (Pat, Pat) { 12 ( 0.00%) $fn($($args)*) 74,534 ( 0.00%) } . fn span(&self) -> Span { . self.span . } . } . }; . } 8,898 ( 0.00%) impl_with_search_pat!((cx: LateContext<'tcx>, self: Expr<'tcx>) => expr_search_pat(cx.tcx, self)); . impl_with_search_pat!((_cx: LateContext<'tcx>, self: Item<'_>) => item_search_pat(self)); . impl_with_search_pat!((_cx: LateContext<'tcx>, self: TraitItem<'_>) => trait_item_search_pat(self)); . impl_with_search_pat!((_cx: LateContext<'tcx>, self: ImplItem<'_>) => impl_item_search_pat(self)); . impl_with_search_pat!((_cx: LateContext<'tcx>, self: FieldDef<'_>) => field_def_search_pat(self)); . impl_with_search_pat!((_cx: LateContext<'tcx>, self: Variant<'_>) => variant_search_pat(self)); . impl_with_search_pat!((_cx: LateContext<'tcx>, self: Ty<'_>) => ty_search_pat(self)); . impl_with_search_pat!((_cx: LateContext<'tcx>, self: Ident) => ident_search_pat(*self)); . impl_with_search_pat!((_cx: LateContext<'tcx>, self: Lit) => lit_search_pat(&self.node)); -- line 714 ---------------------------------------- -- line 718 ---------------------------------------- . . impl_with_search_pat!((_cx: EarlyContext<'tcx>, self: Attribute) => attr_search_pat(self)); . impl_with_search_pat!((_cx: EarlyContext<'tcx>, self: ast::Ty) => ast_ty_search_pat(self)); . . impl<'cx> WithSearchPat<'cx> for (&FnKind<'cx>, &Body<'cx>, HirId, Span) { . type Context = LateContext<'cx>; . . fn search_pat(&self, cx: &Self::Context) -> (Pat, Pat) { 12,201 ( 0.00%) fn_kind_pat(cx.tcx, self.0, self.1, self.2) 355,569 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::fn_kind_pat (1,743x) . } . . fn span(&self) -> Span { . self.3 . } . } . . /// Checks if the item likely came from a proc-macro. . /// . /// This should be called after `in_external_macro` and the initial pattern matching of the ast as . /// it is significantly slower than both of those. 612 ( 0.00%) pub fn is_from_proc_macro<'cx, T: WithSearchPat<'cx>>(cx: &T::Context, item: &T) -> bool { 56,936 ( 0.00%) let (start_pat, end_pat) = item.search_pat(cx); 306 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:::search_pat (2x) 227,060 ( 0.00%) !span_matches_pat(cx.sess(), item.span(), start_pat, end_pat) 940 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::span_matches_pat (2x) 408 ( 0.00%) } . . /// Checks if the span actually refers to a match expression . pub fn is_span_match(cx: &impl LintContext, span: Span) -> bool { 16,094 ( 0.00%) span_matches_pat(cx.sess(), span, Pat::Str("match"), Pat::Str("}")) 556,502 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::span_matches_pat (1,238x) . } . . /// Checks if the span actually refers to an if expression . pub fn is_span_if(cx: &impl LintContext, span: Span) -> bool { 2,385 ( 0.00%) span_matches_pat(cx.sess(), span, Pat::Str("if"), Pat::Str("}")) 58,515 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::span_matches_pat (159x) . } 370,225 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/operators/decimal_bitwise_operands.rs -------------------------------------------------------------------------------- Ir -- line 5 ---------------------------------------- . use rustc_ast::LitKind; . use rustc_data_structures::packed::Pu128; . use rustc_hir::{BinOpKind, Expr, ExprKind}; . use rustc_lint::LateContext; . use rustc_span::Span; . . use super::DECIMAL_BITWISE_OPERANDS; . 28,672 ( 0.00%) pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, op: BinOpKind, left: &'tcx Expr<'_>, right: &'tcx Expr<'_>) { 12,288 ( 0.00%) if !matches!(op, BinOpKind::BitAnd | BinOpKind::BitOr | BinOpKind::BitXor) { . return; . } . 1,008 ( 0.00%) for expr in [left, right] { . check_expr(cx, expr); . } 32,768 ( 0.00%) } . . fn check_expr(cx: &LateContext<'_>, expr: &Expr<'_>) { 3,118 ( 0.00%) match &expr.kind { . ExprKind::Block(block, _) => { . if let Some(block_expr) = block.expr { . check_expr(cx, block_expr); . } . }, . ExprKind::Cast(cast_expr, _) => { . check_expr(cx, cast_expr); . }, . ExprKind::Unary(_, unary_expr) => { . check_expr(cx, unary_expr); . }, . ExprKind::AddrOf(_, _, addr_of_expr) => { . check_expr(cx, addr_of_expr); . }, . ExprKind::Lit(lit) => { 396 ( 0.00%) if let LitKind::Int(Pu128(val), _) = lit.node 192 ( 0.00%) && !is_single_digit(val) 25 ( 0.00%) && !is_power_of_twoish(val) 105 ( 0.00%) && let Some(src) = lit.span.get_text(cx) 105 ( 0.00%) && let Some(num_lit) = NumericLiteral::from_lit_kind(&src, &lit.node) 2,325 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/numeric_literal.rs:::from_lit_kind (15x) 375 ( 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 (15x) . && num_lit.is_decimal() . { . emit_lint(cx, lit.span, num_lit.suffix, val); . } . }, . _ => (), . } . } . . fn is_power_of_twoish(val: u128) -> bool { . val.is_power_of_two() || val.wrapping_add(1).is_power_of_two() . } . . fn is_single_digit(val: u128) -> bool { 297 ( 0.00%) val <= 9 . } . . fn emit_lint(cx: &LateContext<'_>, span: Span, suffix: Option<&str>, val: u128) { . span_lint_and_help( . cx, . DECIMAL_BITWISE_OPERANDS, . span, . "using decimal literal for bitwise operation", -- line 67 ---------------------------------------- 2,329 ( 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 968,912 ( 0.01%) if let ExprKind::Call(..) | ExprKind::MethodCall(..) = expr.kind 83,548 ( 0.00%) && let child_ty = cx.typeck_results().expr_ty(expr) 1,673,216 ( 0.01%) => ???:::expr_ty (41,774x) 59,580 ( 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); . }, . _ => {}, . } . } 1,937,824 ( 0.02%) } . } . . 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 ---------------------------------------- 41,774 ( 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 { 1,937,824 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 484,456 ( 0.00%) if !expr.span.from_expansion() . && let Some(if_expr) = If::hir(expr) . && let Some(r#else) = if_expr.r#else 1,276 ( 0.00%) && let ExprKind::Binary(op, rhs, lhs) = if_expr.cond.kind 1,288 ( 0.00%) && let (BinOpKind::Gt | BinOpKind::Ge, mut a, mut b) | (BinOpKind::Lt | BinOpKind::Le, mut b, mut a) = . (op.node, rhs, lhs) 59 ( 0.00%) && let Some((ty, b_n_refs)) = self.are_ty_eligible(cx, a, b) 590 ( 0.00%) && is_sub_expr(cx, if_expr.then, a, b, ty) 3,889 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_abs_diff.rs:clippy_lints::manual_abs_diff::is_sub_expr (59x) . && is_sub_expr(cx, r#else, b, a, ty) . { . span_lint_and_then( . cx, . MANUAL_ABS_DIFF, . expr.span, . "manual absolute difference pattern without using `abs_diff`", . |diag| { -- line 73 ---------------------------------------- -- 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); . }, . ); . } 1,937,824 ( 0.02%) } . } . . 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)> { 531 ( 0.00%) let is_int = |ty: Ty<'_>| matches!(ty.kind(), ty::Uint(_) | ty::Int(_)) && self.msrv.meets(cx, msrvs::ABS_DIFF); 1,593 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (59x) . let is_duration = . |ty: Ty<'_>| ty.is_diag_item(cx, sym::Duration) && self.msrv.meets(cx, msrvs::DURATION_ABS_DIFF); . 236 ( 0.00%) let a_ty = cx.typeck_results().expr_ty(a).peel_refs(); 2,360 ( 0.00%) => ???:::expr_ty (59x) 354 ( 0.00%) let (b_ty, b_n_refs, _) = peel_and_count_ty_refs(cx.typeck_results().expr_ty(b)); 2,360 ( 0.00%) => ???:::expr_ty (59x) 531 ( 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 (59x) . 177 ( 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. 1,593 ( 0.00%) fn is_sub_expr( . cx: &LateContext<'_>, . expr: &Expr<'_>, . expected_a: &Expr<'_>, . expected_b: &Expr<'_>, . expected_ty: Ty<'_>, . ) -> bool { . let expr = peel_blocks(expr); . 118 ( 0.00%) if let ty::Int(ty) = expected_ty.kind() { . let unsigned = Ty::new_uint(cx.tcx, ty.to_unsigned()); . 22 ( 0.00%) return if let ExprKind::Cast(expr, cast_ty) = expr.kind . && cx.typeck_results().node_type(cast_ty.hir_id) == unsigned . { . is_sub_expr(cx, expr, expected_a, expected_b, unsigned) . } else { . false . }; . } . 50 ( 0.00%) let ctxt = expr.span.ctxt(); 100 ( 0.00%) if let ExprKind::Binary(op, a, b) = expr.kind . && let BinOpKind::Sub = op.node . && eq_expr_value(cx, ctxt, a, expected_a) . && eq_expr_value(cx, ctxt, b, expected_b) . { . true . } else { . false . } 531 ( 0.00%) } . . fn is_unsuffixed_numeral_lit(expr: &Expr<'_>) -> bool { . matches!(expr.kind, ExprKind::Lit(lit) if lit.node.is_numeric() && lit.node.is_unsuffixed()) . } 776 ( 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 { 18,418 ( 0.00%) match value { . BinOpKind::Le => Ok(Self::Le), . BinOpKind::Ge => Ok(Self::Ge), . _ => Err(()), . } . } . } . . impl IntPlusOne { . fn is_one(expr: &Expr) -> bool { 8 ( 0.00%) if let ExprKind::Lit(token_lit) = expr.kind . && matches!(LitKind::from_token_lit(token_lit), Ok(LitKind::Int(Pu128(1), ..))) . { . return true; . } . false . } . . fn is_neg_one(expr: &Expr) -> bool { 2 ( 0.00%) if let ExprKind::Unary(UnOp::Neg, expr) = &expr.kind { . 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> { 2,862 ( 0.00%) if let ExprKind::Binary(op, lhs, rhs) = &expr.kind . && op.node == BinOpKind::Add . { 2 ( 0.00%) if Self::is_one(rhs) { . // x + 1 . return Some(lhs); 2 ( 0.00%) } 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> { 2,854 ( 0.00%) if let ExprKind::Binary(op, lhs, rhs) = &expr.kind { 1 ( 0.00%) if op.node == BinOpKind::Sub && Self::is_one(rhs) { . // x - 1 . return Some(lhs); 1 ( 0.00%) } else if op.node == BinOpKind::Add && Self::is_neg_one(lhs) { . // -1 + x . return Some(rhs); . } . } . None . } . . fn check_binop<'tcx>(le_or_ge: LeOrGe, lhs: &'tcx Expr, rhs: &'tcx Expr) -> Option<(&'tcx Expr, &'tcx Expr)> { -- line 112 ---------------------------------------- -- 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 { 1,213,962 ( 0.01%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 404,654 ( 0.00%) if let ExprKind::Binary(binop, lhs, rhs) = &expr.kind 13,472 ( 0.00%) && let Ok(le_or_ge) = LeOrGe::try_from(binop.node) 2,854 ( 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); . } 1,416,289 ( 0.01%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/types/rc_buffer.rs -------------------------------------------------------------------------------- Ir -- line 5 ---------------------------------------- . use rustc_errors::Applicability; . use rustc_hir::def_id::DefId; . use rustc_hir::{QPath, Ty, TyKind}; . use rustc_lint::LateContext; . use std::borrow::Cow; . . use super::RC_BUFFER; . 83,100 ( 0.00%) pub(super) fn check(cx: &LateContext<'_>, hir_ty: &Ty<'_>, qpath: &QPath<'_>, def_id: DefId) -> bool { 8,310 ( 0.00%) let mut app = Applicability::Unspecified; 74,790 ( 0.00%) let rc = match cx.tcx.get_diagnostic_name(def_id) { 458,701 ( 0.00%) => ???:::get_diagnostic_name (8,310x) . Some(sym::Rc) => "Rc", . Some(sym::Arc) => "Arc", . _ => return false, . }; . if let Some(ty) = qpath_generic_tys(qpath).next() . && let Some(alternate) = match_buffer_type(cx, ty, &mut app) . { . span_lint_and_then( -- line 23 ---------------------------------------- -- line 28 ---------------------------------------- . |diag| { . diag.span_suggestion_verbose(ty.span, "try", alternate, app); . }, . ); . true . } else { . false . } 66,480 ( 0.00%) } . . fn match_buffer_type( . cx: &LateContext<'_>, . ty: &Ty<'_>, . applicability: &mut Applicability, . ) -> Option> { . let id = ty.basic_res().opt_def_id()?; . let path = match cx.tcx.get_diagnostic_name(id) { -- line 44 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/methods/or_fun_call.rs -------------------------------------------------------------------------------- Ir -- line 16 ---------------------------------------- . use rustc_hir as hir; . use rustc_lint::LateContext; . use rustc_middle::ty; . use rustc_span::{Span, Symbol}; . . use super::{OR_FUN_CALL, UNWRAP_OR_DEFAULT}; . . /// Checks for the `OR_FUN_CALL` lint. 34,977 ( 0.00%) pub(super) fn check<'tcx>( . cx: &LateContext<'tcx>, . expr: &hir::Expr<'_>, . method_span: Span, . name: Symbol, . receiver: &'tcx hir::Expr<'_>, . args: &'tcx [hir::Expr<'_>], . msrv: Msrv, . ) { . // Bail out early unless the method is one that `check_unwrap_or_default` or . // `check_or_fn_call` can lint, to avoid walking the argument of every method call. . if !matches!( . name, 78,394 ( 0.00%) sym::unwrap_or . | sym::unwrap_or_else . | sym::or_insert . | sym::or_insert_with . | sym::get_or_insert . | sym::map_or . | sym::ok_or . | sym::or . | sym::and . ) { . return; . } . 162 ( 0.00%) if let [arg] = args { 39 ( 0.00%) let inner_arg = peel_blocks(arg); 39 ( 0.00%) for_each_expr(cx.tcx, inner_arg, |ex| { . // `or_fun_call` lint needs to take nested expr into account, . // but `unwrap_or_default` lint doesn't, we don't want something like: . // `opt.unwrap_or(Foo { inner: String::default(), other: 1 })` to get replaced by . // `opt.unwrap_or_default()`. 212 ( 0.00%) let is_nested_expr = ex.hir_id != inner_arg.hir_id; . 1,415 ( 0.00%) let is_triggered = match ex.kind { 1 ( 0.00%) hir::ExprKind::Call(fun, fun_args) => { . let inner_fun_has_args = !fun_args.is_empty(); 62 ( 0.00%) let fun_span = if inner_fun_has_args || is_nested_expr { 30 ( 0.00%) None . } else { 3 ( 0.00%) Some(fun.span) . }; . (!inner_fun_has_args . && !is_nested_expr 19 ( 0.00%) && check_unwrap_or_default(cx, name, receiver, fun, Some(ex), expr.span, method_span, msrv)) 12,992 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/or_fun_call.rs:clippy_lints::methods::or_fun_call::check_unwrap_or_default (1x) 397 ( 0.00%) || check_or_fn_call(cx, name, method_span, receiver, arg, None, expr.span, fun_span) . }, 174 ( 0.00%) hir::ExprKind::Path(..) | hir::ExprKind::Closure(..) if !is_nested_expr => { 338 ( 0.00%) check_unwrap_or_default(cx, name, receiver, ex, None, expr.span, method_span, msrv) 597,221 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/or_fun_call.rs:clippy_lints::methods::or_fun_call::check_unwrap_or_default (26x) . }, . hir::ExprKind::Index(..) | hir::ExprKind::MethodCall(..) => { 98 ( 0.00%) check_or_fn_call(cx, name, method_span, receiver, arg, None, expr.span, None) . }, . _ => false, . }; . 159 ( 0.00%) if is_triggered { . ControlFlow::Break(()) . } else { . ControlFlow::Continue(()) . } . }); . } . . // `map_or` takes two arguments 3 ( 0.00%) if let [arg, lambda] = args { 3 ( 0.00%) let inner_arg = peel_blocks(arg); 3 ( 0.00%) for_each_expr(cx.tcx, inner_arg, |ex| { 5 ( 0.00%) let is_top_most_expr = ex.hir_id == inner_arg.hir_id; 25 ( 0.00%) match ex.kind { . hir::ExprKind::Call(fun, fun_args) => { 3 ( 0.00%) let fun_span = if fun_args.is_empty() && is_top_most_expr { . Some(fun.span) . } else { . None . }; 12 ( 0.00%) if check_or_fn_call(cx, name, method_span, receiver, arg, Some(lambda), expr.span, fun_span) { . return ControlFlow::Break(()); . } . }, . hir::ExprKind::MethodCall(..) . if check_or_fn_call(cx, name, method_span, receiver, arg, Some(lambda), expr.span, None) => . { . return ControlFlow::Break(()); . }, . _ => {}, . } . ControlFlow::Continue(()) . }); . } 23,318 ( 0.00%) } . . /// Checks for `unwrap_or(T::new())`, `unwrap_or(T::default())`, . /// `or_insert(T::new())` or `or_insert(T::default())`. . /// Similarly checks for `unwrap_or_else(T::new)`, `unwrap_or_else(T::default)`, . /// `or_insert_with(T::new)` or `or_insert_with(T::default)`. . #[expect(clippy::too_many_arguments)] 324 ( 0.00%) fn check_unwrap_or_default( . cx: &LateContext<'_>, . name: Symbol, . receiver: &hir::Expr<'_>, . fun: &hir::Expr<'_>, . call_expr: Option<&hir::Expr<'_>>, . span: Span, . method_span: Span, . msrv: Msrv, . ) -> bool { 17 ( 0.00%) let sugg = match (name, call_expr.is_some()) { 150 ( 0.00%) (sym::unwrap_or, true) | (sym::unwrap_or_else, false) => sym::unwrap_or_default, . (sym::or_insert, true) | (sym::or_insert_with, false) => sym::or_default, . _ => return false, . }; . 60 ( 0.00%) let receiver_ty = cx.typeck_results().expr_ty_adjusted(receiver).peel_refs(); 1,140 ( 0.00%) => ???:::expr_ty_adjusted (15x) . . // Check MSRV, but only for `Result::unwrap_or_default` 30 ( 0.00%) if receiver_ty.is_diag_item(cx, sym::Result) && !msrv.meets(cx, msrvs::RESULT_UNWRAP_OR_DEFAULT) { . return false; . } . . // `Default` for raw pointers is only stable since 1.88.0, so the suggestion would not compile . // below that MSRV (#17379). Only reachable under `-Zbuild-std`, hence not covered by our UI . // tests against a precompiled `std` — removing this breaks no test, but does bring the false . // positive back for build-std users. 15 ( 0.00%) if let Some(call_expr) = call_expr 4 ( 0.00%) && cx.typeck_results().expr_ty(call_expr).is_raw_ptr() 40 ( 0.00%) => ???:::expr_ty (1x) 11 ( 0.00%) && !msrv.meets(cx, msrvs::RAW_PTR_DEFAULT) . { . return false; . } . 75 ( 0.00%) if !expr_type_is_certain(cx, receiver) { 438,056 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/type_certainty/mod.rs:clippy_utils::ty::type_certainty::expr_type_is_certain (15x) . return false; . } . . let is_new = |fun: &hir::Expr<'_>| { 33 ( 0.00%) if let hir::ExprKind::Path(ref qpath) = fun.kind { . let path = last_path_segment(qpath).ident.name; . matches!(path, sym::new) . } else { . false . } . }; . . let output_type_implements_default = |fun| { -- line 169 ---------------------------------------- -- line 180 ---------------------------------------- . .get_diagnostic_item(sym::Default) . .is_some_and(|default_trait_id| implements_trait(cx, output_ty, default_trait_id, &[])) . } else { . false . } . }; . . let Some(suggested_method_def_id) = receiver_ty.ty_adt_def().and_then(|adt_def| { 11 ( 0.00%) cx.tcx . .inherent_impls(adt_def.did()) . .iter() 56 ( 0.00%) .flat_map(|&impl_id| cx.tcx.associated_items(impl_id).filter_by_name_unhygienic(sugg)) 1,412 ( 0.00%) => ???:::filter_by_name_unhygienic (14x) . .find_map(|assoc| { 66 ( 0.00%) if assoc.is_method() && cx.tcx.fn_sig(assoc.def_id).skip_binder().inputs().skip_binder().len() == 1 { . Some(assoc.def_id) . } else { . None . } . }) . }) else { . return false; . }; . let in_sugg_method_implementation = { 11 ( 0.00%) matches!( . suggested_method_def_id.as_local(), . Some(local_def_id) if local_def_id == cx.tcx.hir_get_parent_item(receiver.hir_id).def_id . ) . }; . if in_sugg_method_implementation { . return false; . } . -- line 211 ---------------------------------------- -- line 213 ---------------------------------------- . // non-empty `Vec`, then it will not be a default value anyway. Bail out in all cases. . if call_expr.and_then(|call_expr| VecArgs::hir(cx, call_expr)).is_some() { . return false; . } . . // needs to target Default::default in particular or be *::new and have a Default impl . // available . if (is_new(fun) && output_type_implements_default(fun)) 33 ( 0.00%) || match call_expr { . Some(call_expr) => is_default_equivalent(cx, call_expr), 110 ( 0.00%) None => is_default_equivalent_call(cx, fun, None) || closure_body_returns_empty_to_string(cx, fun), 1,055 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/or_fun_call.rs:clippy_lints::methods::or_fun_call::closure_body_returns_empty_to_string (11x) 275 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_default_equivalent_call (11x) . } . { . span_lint_and_sugg( . cx, . UNWRAP_OR_DEFAULT, . method_span.with_hi(span.hi()), . format!("use of `{name}` to construct default value"), . "try", -- line 231 ---------------------------------------- -- line 232 ---------------------------------------- . format!("{sugg}()"), . Applicability::MachineApplicable, . ); . . true . } else { . false . } 216 ( 0.00%) } . . /// Checks for `*or(foo())`. . #[expect(clippy::too_many_arguments)] 897 ( 0.00%) fn check_or_fn_call<'tcx>( . cx: &LateContext<'tcx>, . name: Symbol, . method_span: Span, . self_expr: &hir::Expr<'_>, . arg: &'tcx hir::Expr<'_>, . // `Some` if fn has second argument . second_arg: Option<&hir::Expr<'_>>, . span: Span, -- line 252 ---------------------------------------- -- line 265 ---------------------------------------- . ), . (sym::Option, false, &[sym::get_or_insert], "with"), . (sym::Option, true, &[sym::and], "then"), . (sym::Result, true, &[sym::map_or, sym::or, sym::unwrap_or], "else"), . (sym::Result, true, &[sym::and], "then"), . ]; . . if KNOW_TYPES.iter().any(|k| k.2.contains(&name)) 50 ( 0.00%) && switch_to_lazy_eval(cx, arg) 36,238 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/eager_or_lazy.rs:clippy_utils::eager_or_lazy::switch_to_lazy_eval (6x) 8 ( 0.00%) && !contains_return(arg) 8 ( 0.00%) && let self_ty = cx.typeck_results().expr_ty(self_expr) 160 ( 0.00%) => ???:::expr_ty (4x) 28 ( 0.00%) && let Some(&(_, fn_has_arguments, _, suffix)) = KNOW_TYPES . .iter() 16 ( 0.00%) .find(|&&i| self_ty.is_diag_item(cx, i.0) && i.2.contains(&name)) . { . let ctxt = span.ctxt(); 4 ( 0.00%) let mut app = Applicability::HasPlaceholders; . let sugg = { 16 ( 0.00%) let (snippet_span, use_lambda) = match (fn_has_arguments, fun_span) { 1 ( 0.00%) (false, Some(fun_span)) => (fun_span, false), 3 ( 0.00%) _ => (arg.span, true), . }; . 16 ( 0.00%) let snip = snippet_with_context(cx, snippet_span, ctxt, "..", &mut app).0; . let snip = if use_lambda { 18 ( 0.00%) let l_arg = if fn_has_arguments { "_" } else { "" }; 24 ( 0.00%) format!("|{l_arg}| {snip}") . } else { 2 ( 0.00%) snip.into_owned() . }; . 8 ( 0.00%) if let Some(f) = second_arg { . let f = snippet_with_context(cx, f.span, ctxt, "..", &mut app).0; . format!("{snip}, {f}") . } else { 16 ( 0.00%) snip . } 8 ( 0.00%) }; . let span_replace_word = method_span.with_hi(span.hi()); 44 ( 0.00%) span_lint_and_sugg( 7,609 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_sugg:: (4x) . cx, . OR_FUN_CALL, . span_replace_word, 12 ( 0.00%) format!("function call inside of `{name}`"), . "try", 40 ( 0.00%) format!("{name}_{suffix}({sugg})"), . app, . ); . true . } else { . false . } 312 ( 0.00%) } . . fn closure_body_returns_empty_to_string(cx: &LateContext<'_>, e: &hir::Expr<'_>) -> bool { 44 ( 0.00%) if let hir::ExprKind::Closure(&hir::Closure { body, .. }) = e.kind { 11 ( 0.00%) let body = cx.tcx.hir_body(body); 901 ( 0.00%) => ???:::hir_body (11x) . 11 ( 0.00%) if body.params.is_empty() 11 ( 0.00%) && let hir::Expr { kind, .. } = &body.value 22 ( 0.00%) && let hir::ExprKind::MethodCall(hir::PathSegment { ident, .. }, self_arg, [], _) = kind . && ident.name == sym::to_string . && let hir::Expr { kind, .. } = self_arg . && let hir::ExprKind::Lit(lit) = kind . && let ast::LitKind::Str(rustc_span::sym::empty, _) = lit.node . { . return true; . } . } . . false 11 ( 0.00%) } 22,956 ( 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)> { 93 ( 0.00%) Some(match self { 7 ( 0.00%) 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 { 338 ( 0.00%) match self { 26 ( 0.00%) UintTy::U8 => 8, 11 ( 0.00%) UintTy::U16 => 16, . UintTy::U32 => 32, . UintTy::U64 => 64, . UintTy::U128 => 128, . UintTy::Usize => usize::BITS.into(), . } . } . } . impl IntTypeBounds for IntTy { . type Output = i128; . fn min_max(self) -> Option<(Self::Output, Self::Output)> { 389 ( 0.00%) Some(match self { . IntTy::I8 => (i8::MIN.into(), i8::MAX.into()), . IntTy::I16 => (i16::MIN.into(), i16::MAX.into()), . IntTy::I32 => (i32::MIN.into(), i32::MAX.into()), . IntTy::I64 => (i64::MIN.into(), i64::MAX.into()), . IntTy::I128 => (i128::MIN, i128::MAX), . IntTy::Isize => (isize::MIN.try_into().ok()?, isize::MAX.try_into().ok()?), . }) . } -- line 114 ---------------------------------------- -- line 120 ---------------------------------------- . IntTy::I64 => 64, . IntTy::I128 => 128, . IntTy::Isize => isize::BITS.into(), . } . } . } . . impl PartialEq for Constant { 3,120 ( 0.00%) fn eq(&self, other: &Self) -> bool { 3,900 ( 0.00%) match (self, other) { . (Self::Str(ls), Self::Str(rs)) => ls == rs, . (Self::Binary(l), Self::Binary(r)) => l == r, 6 ( 0.00%) (&Self::Char(l), &Self::Char(r)) => l == r, 868 ( 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() . }, 33 ( 0.00%) (&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, . } 1,560 ( 0.00%) } . } . . impl Hash for Constant { 5,700 ( 0.00%) fn hash(&self, state: &mut H) . where . H: Hasher, . { . std::mem::discriminant(self).hash(state); 2,850 ( 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); . }, 3 ( 0.00%) Self::Char(c) => { . c.hash(state); . }, . Self::Int(i) => { . i.hash(state); . }, . Self::F16(f) => { . // FIXME(f16_f128): once conversions to/from `f128` are available on all platforms, . f.hash(state); -- line 176 ---------------------------------------- -- line 179 ---------------------------------------- . f64::from(f).to_bits().hash(state); . }, . Self::F64(f) => { . f.to_bits().hash(state); . }, . Self::F128(f) => { . f.hash(state); . }, 40 ( 0.00%) Self::Bool(b) => { . b.hash(state); . }, . Self::Vec(ref v) | Self::Tuple(ref v) => { . v.hash(state); . }, . Self::Repeat(ref c, l) => { . c.hash(state); . l.hash(state); -- line 195 ---------------------------------------- -- line 197 ---------------------------------------- . Self::RawPtr(u) => { . u.hash(state); . }, . Self::Ref(ref r) => { . r.hash(state); . }, . Self::Err => {}, . } 3,420 ( 0.00%) } . } . . impl Constant { 624 ( 0.00%) pub fn partial_cmp(tcx: TyCtxt<'_>, cmp_type: Ty<'_>, left: &Self, right: &Self) -> Option { 884 ( 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)), 468 ( 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, . } 468 ( 0.00%) } . . /// Returns the integer value or `None` if `self` or `val_type` is not integer type. 496 ( 0.00%) pub fn int_value(&self, tcx: TyCtxt<'_>, val_type: Ty<'_>) -> Option { 1,012 ( 0.00%) if let Constant::Int(const_int) = *self { 1,241 ( 0.00%) match *val_type.kind() { 110 ( 0.00%) ty::Int(ity) => Some(FullInt::S(sext(tcx, const_int, ity))), 958 ( 0.00%) ty::Uint(_) => Some(FullInt::U(const_int)), . _ => None, . } . } else { . None . } 744 ( 0.00%) } . . #[must_use] 3,632 ( 0.00%) pub fn peel_refs(mut self) -> Self { 1,362 ( 0.00%) while let Constant::Ref(r) = self { . self = *r; . } 1,816 ( 0.00%) self 3,178 ( 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 391 ---------------------------------------- . (&Self::Char(x), &ty::Char) => x == char::MAX, . (&Self::F32(x), &ty::Float(FloatTy::F32)) => x == f32::INFINITY, . (&Self::F64(x), &ty::Float(FloatTy::F64)) => x == f64::INFINITY, . _ => false, . } . } . . pub fn is_pos_infinity(&self) -> bool { 36 ( 0.00%) match *self { . // FIXME(f16_f128): add f16 and f128 when constants are available . Constant::F32(x) => x == f32::INFINITY, . Constant::F64(x) => x == f64::INFINITY, . _ => false, . } . } . . pub fn is_neg_infinity(&self) -> bool { -- line 407 ---------------------------------------- -- line 410 ---------------------------------------- . Constant::F32(x) => x == f32::NEG_INFINITY, . Constant::F64(x) => x == f64::NEG_INFINITY, . _ => false, . } . } . } . . /// Parses a `LitKind` to a `Constant`. 36,827 ( 0.00%) pub fn lit_to_mir_constant(lit: &LitKind, ty: Option>) -> Constant { 26,305 ( 0.00%) match *lit { 1,116 ( 0.00%) LitKind::Str(ref is, _) => Constant::Str(is.to_string()), . LitKind::Byte(b) => Constant::Int(u128::from(b)), 846 ( 0.00%) LitKind::ByteStr(ref s, _) | LitKind::CStr(ref s, _) => Constant::Binary(s.as_byte_str().to_vec()), 3,008 ( 0.00%) => ???:::as_byte_str (94x) 80 ( 0.00%) LitKind::Char(c) => Constant::Char(c), 7,236 ( 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() { . ty::Float(FloatTy::F16) => Constant::parse_f16(is.as_str()), . 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!(), . }, 6,270 ( 0.00%) LitKind::Bool(b) => Constant::Bool(b), . LitKind::Err(_) => Constant::Err, . } 42,088 ( 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 466 ---------------------------------------- . pub fn is_zero(self) -> bool { . matches!(self, Self::S(0) | Self::U(0)) . } . } . . impl PartialEq for FullInt { . fn eq(&self, other: &Self) -> bool { . self.cmp(other) == Ordering::Equal 488 ( 0.00%) } . } . . impl PartialOrd for FullInt { . fn partial_cmp(&self, other: &Self) -> Option { . Some(self.cmp(other)) . } . } . -- line 482 ---------------------------------------- -- line 483 ---------------------------------------- . impl Ord for FullInt { . fn cmp(&self, other: &Self) -> Ordering { . use FullInt::{S, U}; . . fn cmp_s_u(s: i128, u: u128) -> Ordering { . u128::try_from(s).map_or(Ordering::Less, |x| x.cmp(&u)) . } . 9,531 ( 0.00%) match (*self, *other) { . (S(s), S(o)) => s.cmp(&o), . (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(), . } 571 ( 0.00%) } . } . . /// Evaluates an expression if it's a builtin integer type. 110 ( 0.00%) pub fn eval_int(cx: &LateContext<'_>, e: &Expr<'_>) -> Option { 55 ( 0.00%) match e.kind { 63 ( 0.00%) 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())) . }, 6 ( 0.00%) _ if let ty = cx.typeck_results().expr_ty(e) 80 ( 0.00%) => ???:::expr_ty (2x) 8 ( 0.00%) && let ty::Int(_) | ty::Uint(_) = *ty.kind() => . { . ConstEvalCtxt::new(cx).eval(e).and_then(|x| x.int_value(cx.tcx, ty)) . }, 2 ( 0.00%) _ => None, . } 99 ( 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()`). 95,862 ( 0.00%) pub fn new(cx: &LateContext<'tcx>) -> Self { 129,024 ( 0.00%) Self { 32,374 ( 0.00%) tcx: cx.tcx, 16,215 ( 0.00%) typing_env: cx.typing_env(), 5,520 ( 0.00%) => ???:::typing_env (184x) . typeck: cx.typeck_results(), . source: Cell::new(ConstantSource::Local), . ctxt: Cell::new(SyntaxContext::root()), . } 95,862 ( 0.00%) } . . /// Creates an evaluation context. . pub fn with_env(tcx: TyCtxt<'tcx>, typing_env: ty::TypingEnv<'tcx>, typeck: &'tcx TypeckResults<'tcx>) -> Self { 140,024 ( 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. 20 ( 0.00%) pub fn eval_with_source(&self, e: &Expr<'_>, ctxt: SyntaxContext) -> Option<(Constant, ConstantSource)> { . self.source.set(ConstantSource::Local); . self.ctxt.set(ctxt); 57,124 ( 0.00%) self.expr(e).map(|c| (c, self.source.get())) 54,216 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:::expr (184x) 20 ( 0.00%) } . . /// Attempts to evaluate the expression. . pub fn eval(&self, e: &Expr<'_>) -> Option { 8,133 ( 0.00%) self.expr(e) 3,981,981 ( 0.03%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:::expr (8,121x) . } . . /// 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. 32,795 ( 0.00%) pub fn eval_local(&self, e: &Expr<'_>, ctxt: SyntaxContext) -> Option { 33,145 ( 0.00%) match self.eval_with_source(e, ctxt) { 15,204 ( 0.00%) Some((x, ConstantSource::Local)) => Some(x), 14,186 ( 0.00%) _ => None, 25,610 ( 0.00%) } 19,045 ( 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:: (817x) 32,795 ( 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. 370 ( 0.00%) pub fn eval_full_int(&self, e: &Expr<'_>, ctxt: SyntaxContext) -> Option { 67 ( 0.00%) match self.eval_with_source(e, ctxt) { 90 ( 0.00%) Some((x, ConstantSource::Local)) => x.int_value(self.tcx, self.typeck.expr_ty(e)), 400 ( 0.00%) => ???:::expr_ty (10x) 54 ( 0.00%) _ => None, 27 ( 0.00%) } 333 ( 0.00%) } . 1,976 ( 0.00%) pub fn eval_pat_expr(&self, pat_expr: &PatExpr<'_>) -> Option { 494 ( 0.00%) match &pat_expr.kind { . PatExprKind::Lit { lit, negated } => { 1,540 ( 0.00%) let ty = self.typeck.node_type_opt(pat_expr.hir_id); 8,140 ( 0.00%) => ???:::node_type_opt (220x) 880 ( 0.00%) let val = lit_to_mir_constant(&lit.node, ty); 5,500 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:clippy_utils::consts::lit_to_mir_constant (220x) 440 ( 0.00%) if *negated { 6 ( 0.00%) self.constant_negate(&val, ty?) . } else { 856 ( 0.00%) Some(val) . } 220 ( 0.00%) }, 150 ( 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:: (6x) 162 ( 0.00%) PatExprKind::Path(qpath) => self.qpath(qpath, pat_expr.hir_id), 108,339 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:::qpath (27x) . } 2,250 ( 0.00%) } . . fn check_ctxt(&self, ctxt: SyntaxContext) { 61,518 ( 0.00%) if self.ctxt.get() != ctxt { . self.source.set(ConstantSource::NonLocal); . } . } . 257,430 ( 0.00%) fn qpath(&self, qpath: &QPath<'_>, hir_id: HirId) -> Option { . self.fetch_path(qpath, hir_id) 38,310 ( 0.00%) .and_then(|c| mir_to_const(self.tcx, c, self.typeck.node_type(hir_id))) 157,071 ( 0.00%) => ???:::node_type (3,831x) 151,585 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:clippy_utils::consts::mir_to_const (3,831x) 205,944 ( 0.00%) } . . /// Simple constant folding: Insert an expression, get a constant or none. 735,182 ( 0.01%) fn expr(&self, e: &Expr<'_>) -> Option { 52,518 ( 0.00%) self.check_ctxt(e.span.ctxt()); 315,108 ( 0.00%) match e.kind { . ExprKind::ConstBlock(ConstBlock { body, .. }) => self.expr(self.tcx.hir_body(body).value), . ExprKind::DropTemps(e) => self.expr(e), 180,012 ( 0.00%) ExprKind::Path(ref qpath) => self.qpath(qpath, e.hir_id), 7,331,021 ( 0.06%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:::qpath (17,169x) 480 ( 0.00%) ExprKind::Block(block, _) => { 480 ( 0.00%) self.check_ctxt(block.span.ctxt()); . self.block(block) . }, 20,164 ( 0.00%) ExprKind::Lit(lit) => { 5,041 ( 0.00%) self.check_ctxt(lit.span.ctxt()); 35,287 ( 0.00%) Some(lit_to_mir_constant(&lit.node, self.typeck.expr_ty_opt(e))) 172,455 ( 0.00%) => ???:::expr_ty_opt (4,417x) 166,416 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:clippy_utils::consts::lit_to_mir_constant (4,417x) . }, 240 ( 0.00%) ExprKind::Array(vec) => self.multi(vec).map(Constant::Vec), 608 ( 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)) . }, 5,111 ( 0.00%) ExprKind::Unary(op, operand) => self.expr(operand).and_then(|o| match op { 140,126 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:::expr'2 (955x) 35 ( 0.00%) UnOp::Not => self.constant_not(&o, self.typeck.expr_ty(e)), 280 ( 0.00%) => ???:::expr_ty (7x) 900 ( 0.00%) UnOp::Neg => self.constant_negate(&o, self.typeck.expr_ty(e)), 3,600 ( 0.00%) => ???:::expr_ty (90x) 7,101 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:::constant_negate (90x) . UnOp::Deref => Some(if let Constant::Ref(r) = o { *r } else { o }), 582 ( 0.00%) }), 2,425 ( 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:: (97x) 474 ( 0.00%) ExprKind::If(cond, then, ref otherwise) => self.ifthenelse(cond, then, *otherwise), 10,437 ( 0.00%) ExprKind::Binary(op, left, right) => { . self.check_ctxt(e.span.ctxt()); . self.binop(op.node, left, right) . }, 6,971 ( 0.00%) ExprKind::Call(callee, []) => { . // We only handle a few const functions for now. 4,140 ( 0.00%) if let ExprKind::Path(qpath) = &callee.kind 6,210 ( 0.00%) && let Some(did) = self.typeck.qpath_res(qpath, callee.hir_id).opt_def_id() 20,719 ( 0.00%) => ???:::qpath_res (993x) . { 5,165 ( 0.00%) match self.tcx.get_diagnostic_name(did) { 53,481 ( 0.00%) => ???:::get_diagnostic_name (991x) . 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)), . 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 . } . }, 1,656 ( 0.00%) ExprKind::Index(arr, index, _) => self.index(arr, index), 1,476 ( 0.00%) ExprKind::AddrOf(_, _, inner) => self.expr(inner).map(|r| Constant::Ref(Box::new(r))), 73,963 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:::expr'2 (389x) . ExprKind::Field(base, ref field) 39,846 ( 0.00%) if let base_ty = self.typeck.expr_ty(base) 228,584 ( 0.00%) => ???:::expr_ty (5,708x) 28,685 ( 0.00%) && match self.typeck.expr_adjustments(base) { 218,889 ( 0.00%) => ???:::expr_adjustments (5,708x) 13,282 ( 0.00%) [] => true, . [.., a] => a.target == base_ty, . } 22,600 ( 0.00%) && let Some(Constant::Adt(constant)) = self.expr(base) 690,766 ( 0.01%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:::expr'2 (4,406x) . && 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, . } 486,390 ( 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. 539 ( 0.00%) pub fn eval_is_empty(&self, e: &Expr<'_>) -> Option { 294 ( 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, . } 343 ( 0.00%) } . . #[expect(clippy::cast_possible_wrap)] . fn constant_not(&self, o: &Constant, ty: Ty<'_>) -> Option { . use self::Constant::{Bool, Int}; 49 ( 0.00%) match *o { . Bool(b) => Some(Bool(!b)), . Int(value) => { 14 ( 0.00%) let value = !value; 35 ( 0.00%) match *ty.kind() { . ty::Int(ity) => Some(Int(unsext(self.tcx, value as i128, ity))), 35 ( 0.00%) ty::Uint(ity) => Some(Int(clip(self.tcx, value, ity))), 140 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::clip (7x) . _ => None, . } . }, . _ => None, . } . } . 450 ( 0.00%) fn constant_negate(&self, o: &Constant, ty: Ty<'_>) -> Option { . use self::Constant::{F32, F64, Int}; 768 ( 0.00%) match *o { . Int(value) => { 192 ( 0.00%) let ty::Int(ity) = *ty.kind() else { return None }; . let (min, _) = ity.min_max()?; . // sign extend 108 ( 0.00%) let value = sext(self.tcx, value, ity); 156 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::sext (6x) . . // Applying unary - to the most negative value of any signed integer type panics. 384 ( 0.00%) if value == min { . return None; . } . . let value = value.checked_neg()?; . // clear unused bits 510 ( 0.00%) Some(Int(unsext(self.tcx, value, ity))) 120 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::clip (6x) . }, . F32(f) => Some(F32(-f)), . F64(f) => Some(F64(-f)), . _ => None, . } 450 ( 0.00%) } . . /// Create `Some(Vec![..])` of all constants, unless there is any . /// non-constant part. . fn multi(&self, vec: &[Expr<'_>]) -> Option> { 1,928 ( 0.00%) vec.iter().map(|elem| self.expr(elem)).collect::>() 94,291 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:::expr'2 (482x) . } . . /// 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. 101,586 ( 0.00%) let did = match *qpath { . QPath::Resolved(None, path) 75,150 ( 0.00%) if path.span.ctxt() == self.ctxt.get() 23,648 ( 0.00%) && path.segments.iter().all(|s| self.ctxt.get() == s.ident.span.ctxt()) 61,736 ( 0.00%) && let Res::Def(DefKind::Const { .. }, did) = path.res 17,655 ( 0.00%) && (matches!( 11,716 ( 0.00%) self.tcx.get_diagnostic_name(did), 156,155 ( 0.00%) => ???:::get_diagnostic_name (2,929x) . 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 . ) 2,902 ( 0.00%) ) || self.tcx.opt_parent(did).is_some_and(|parent| { 8,706 ( 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 . }, . QPath::TypeRelative(ty, const_name) 4,845 ( 0.00%) if let TyKind::Path(QPath::Resolved(None, ty_path)) = ty.kind 2,764 ( 0.00%) && let [.., ty_name] = ty_path.segments . && (matches!( 2,073 ( 0.00%) ty_name.ident.name, 5,283 ( 0.00%) sym::i8 . | sym::i16 . | sym::i32 . | sym::i64 . | sym::i128 . | sym::u8 . | sym::u16 . | sym::u32 . | sym::u64 . | sym::u128 . | sym::f32 . | sym::f64 . | sym::char 10 ( 0.00%) ) || (ty_name.ident.name == sym::usize && const_name.ident.name == sym::MIN)) 381 ( 0.00%) && const_name.ident.span.ctxt() == self.ctxt.get() 238 ( 0.00%) && ty.span.ctxt() == self.ctxt.get() 238 ( 0.00%) && ty_name.ident.span.ctxt() == self.ctxt.get() 238 ( 0.00%) && matches!(ty_path.res, Res::PrimTy(_)) 1,364 ( 0.00%) && let Some((DefKind::AssocConst { .. }, did)) = self.typeck.type_dependent_def(id) 6,581 ( 0.00%) => ???:::type_dependent_def (119x) 275 ( 0.00%) && self.tcx.inherent_impl_of_assoc(did).is_some() => 44,139 ( 0.00%) => ???:::inherent_impl_of_assoc (55x) . { . 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. 76,321 ( 0.00%) _ if let Res::Def( . DefKind::Const { is_type_const: false } | DefKind::AssocConst { is_type_const: false }, 7,514 ( 0.00%) did, 182,431 ( 0.00%) ) = self.typeck.qpath_res(qpath, id) => 418,235 ( 0.00%) => ???:::qpath_res (25,661x) . { . self.source.set(ConstantSource::NonLocal); . did . }, . _ => return None, . }; . 23,034 ( 0.00%) let args = self.typeck.node_args(id); 138,072 ( 0.00%) => ???:::node_args (3,839x) . 7,678 ( 0.00%) if !args.is_empty() { 16 ( 0.00%) let owner_def_id = self.typeck.hir_owner.def_id.to_def_id(); 24 ( 0.00%) 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. 16 ( 0.00%) if self . .tcx 24 ( 0.00%) .instantiate_and_check_impossible_clauses((owner_def_id, identity_args)) . { . return None; . } . } . 3,839 ( 0.00%) self.tcx 30,712 ( 0.00%) .const_eval_resolve(self.typing_env, mir::UnevaluatedConst::new(did, args), qpath.span()) 4,624,803 ( 0.04%) => ???:::const_eval_resolve (3,839x) 43,899 ( 0.00%) => ???:::span (3,839x) . .ok() . } . . fn index(&self, lhs: &'_ Expr<'_>, index: &'_ Expr<'_>) -> Option { 2,484 ( 0.00%) let lhs = self.expr(lhs); 80,191 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:::expr'2 (510x) 2,484 ( 0.00%) let index = self.expr(index); 93,609 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:::expr'2 (510x) . 10,764 ( 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 . } . }, 828 ( 0.00%) _ => None, . } . } . . /// A block can only yield a constant if it has exactly one constant expression. . fn block(&self, block: &Block<'_>) -> Option { 480 ( 0.00%) if block.stmts.is_empty() 648 ( 0.00%) && let Some(expr) = block.expr . { . // Try to detect any `cfg`ed statements or empty macro expansions. 648 ( 0.00%) let span = block.span.data(); 17,973 ( 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 (216x) 216 ( 0.00%) if span.ctxt == SyntaxContext::root() { 525 ( 0.00%) if let Some(expr_span) = walk_span_to_context(expr.span, span.ctxt) 7,164 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::walk_span_to_context (75x) . && let expr_lo = expr_span.lo() 75 ( 0.00%) && expr_lo >= span.lo 600 ( 0.00%) && let Some(src) = (span.lo..expr_lo).get_source_range(self.tcx) 225 ( 0.00%) && let Some(src) = src.as_str() 2,100 ( 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_str (75x) . { . use rustc_lexer::TokenKind::{BlockComment, LineComment, OpenBrace, Semi, Whitespace}; 225 ( 0.00%) if !tokenize(src, FrontmatterAllowed::No) . .map(|t| t.kind) . .filter(|t| !matches!(t, Whitespace | LineComment { .. } | BlockComment { .. } | Semi)) . .eq([OpenBrace]) . { . self.source.set(ConstantSource::NonLocal); . } . } else { . // Unable to access the source. Assume a non-local dependency. . self.source.set(ConstantSource::NonLocal); . } . } . 864 ( 0.00%) self.expr(expr) 17,039 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:::expr'2 (216x) . } else { . None . } . } . . fn ifthenelse(&self, cond: &Expr<'_>, then: &Expr<'_>, otherwise: Option<&Expr<'_>>) -> Option { 1,014 ( 0.00%) if let Some(Constant::Bool(b)) = self.expr(cond) { 24,762 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:::expr'2 (145x) 44 ( 0.00%) if b { . self.expr(then) . } else { . otherwise.as_ref().and_then(|expr| self.expr(expr)) . } . } else { . None . } . } . . #[expect(clippy::too_many_lines)] . fn binop(&self, op: BinOpKind, left: &Expr<'_>, right: &Expr<'_>) -> Option { 17,395 ( 0.00%) let l = self.expr(left)?; 447,894 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:::expr'2 (2,684x) 828 ( 0.00%) let r = self.expr(right); 91,630 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:::expr'2 (192x) 6,045 ( 0.00%) match (l, r) { 1,077 ( 0.00%) (Constant::Int(l), Some(Constant::Int(r))) => match *self.typeck.expr_ty_opt(left)?.kind() { 2,730 ( 0.00%) => ???:::expr_ty_opt (70x) 1 ( 0.00%) ty::Int(ity) => { . let (ty_min_value, _) = ity.min_max()?; . let bits = ity.bits(); 5 ( 0.00%) let l = sext(self.tcx, l, ity); 26 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::sext (1x) 5 ( 0.00%) let r = sext(self.tcx, r, ity); 26 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::sext (1x) . . // 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 4 ( 0.00%) if let BinOpKind::Div | BinOpKind::Rem = op . && l == ty_min_value . && r == -1 . { . return None; . } . 4 ( 0.00%) let zext = |n: i128| Constant::Int(unsext(self.tcx, n, ity)); 20 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::clip (1x) 5 ( 0.00%) match op { . // When +, * or binary - create a value greater than the maximum value, or less than . // the minimum value that can be stored, it panics. . BinOpKind::Add => l.checked_add(r).and_then(|n| ity.ensure_fits(n)).map(zext), . BinOpKind::Sub => l.checked_sub(r).and_then(|n| ity.ensure_fits(n)).map(zext), . BinOpKind::Mul => l.checked_mul(r).and_then(|n| ity.ensure_fits(n)).map(zext), . BinOpKind::Div if r != 0 => l.checked_div(r).map(zext), . BinOpKind::Rem if r != 0 => l.checked_rem(r).map(zext), . // Using << or >> where the right-hand argument is greater than or equal to the number of bits . // in the type of the left-hand argument, or is negative panics. . BinOpKind::Shr if r < bits && !r.is_negative() => l.checked_shr(r.try_into().ok()?).map(zext), 3 ( 0.00%) BinOpKind::Shl if r < bits && !r.is_negative() => l.checked_shl(r.try_into().ok()?).map(zext), . BinOpKind::BitXor => Some(zext(l ^ r)), . BinOpKind::BitOr => Some(zext(l | r)), . BinOpKind::BitAnd => Some(zext(l & r)), . // FIXME: f32/f64 currently consider `0.0` and `-0.0` as different. . 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, . } . }, 82 ( 0.00%) ty::Uint(ity) => { . let bits = ity.bits(); 738 ( 0.00%) let mask = !0u128 >> (128 - bits); . 410 ( 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)) . }, 171 ( 0.00%) BinOpKind::Shl if r < bits => { 114 ( 0.00%) l.checked_shl(r.try_into().ok()?).map(|x| Constant::Int(x & mask)) . }, . BinOpKind::BitXor => Some(Constant::Int(l ^ r)), . BinOpKind::BitOr => Some(Constant::Int(l | r)), . BinOpKind::BitAnd => Some(Constant::Int(l & r)), . 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)), -- line 1051 ---------------------------------------- -- 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, . }, 2,674 ( 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)), 193 ( 0.00%) _ => None, 579 ( 0.00%) }, 3,050 ( 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) 166 ( 0.00%) } 1,750 ( 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:: (70x) . } . } . 34,839 ( 0.00%) pub fn mir_to_const<'tcx>(tcx: TyCtxt<'tcx>, val: ConstValue, ty: Ty<'tcx>) -> Option { 26,568 ( 0.00%) match (val, ty.kind()) { 11,112 ( 0.00%) (_, &ty::Adt(adt_def, _)) if adt_def.is_struct() => Some(Constant::Adt(val)), 14,955 ( 0.00%) (ConstValue::Scalar(Scalar::Int(int)), _) => match ty.kind() { . ty::Bool => Some(Constant::Bool(int == ScalarInt::TRUE)), 7,340 ( 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, . }, . (_, ty::Ref(_, inner_ty, _)) if matches!(inner_ty.kind(), ty::Str) => { -- line 1116 ---------------------------------------- -- 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, . } 34,839 ( 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. 1,840 ( 0.00%) pub fn integer_const(cx: &LateContext<'_>, expr: &Expr<'_>, ctxt: SyntaxContext) -> Option { 812 ( 0.00%) if let Some(Constant::Int(value)) = ConstEvalCtxt::new(cx).eval_local(expr, ctxt) { 348 ( 0.00%) Some(value) . } else { 136 ( 0.00%) None . } 1,472 ( 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 { 543 ( 0.00%) integer_const(cx, expr, ctxt) == Some(0) 72,981 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/consts.rs:clippy_utils::consts::integer_const (181x) . } . . 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 ---------------------------------------- 504,471 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/casts/cast_ptr_alignment.rs -------------------------------------------------------------------------------- Ir -- line 4 ---------------------------------------- . use rustc_hir::{Expr, ExprKind, GenericArg}; . use rustc_lint::LateContext; . use rustc_middle::ty::layout::LayoutOf as _; . use rustc_middle::ty::{self, Ty}; . . use super::CAST_PTR_ALIGNMENT; . . pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'_>, cast_from: Ty<'tcx>, cast_to: Ty<'tcx>) { 2,682 ( 0.00%) lint_cast_ptr_alignment(cx, expr, cast_from, cast_to); 13,475 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/casts/cast_ptr_alignment.rs:clippy_lints::casts::cast_ptr_alignment::lint_cast_ptr_alignment (447x) . } . 1,210,720 ( 0.01%) pub(super) fn check_cast_method(cx: &LateContext<'_>, expr: &Expr<'_>) { 512,400 ( 0.00%) if let ExprKind::MethodCall(method_path, self_arg, [], _) = &expr.kind 15,930 ( 0.00%) && method_path.ident.name == sym::cast . && let Some(generic_args) = method_path.args . && let [GenericArg::Type(cast_to)] = generic_args.args . // There probably is no obvious reason to do this, just to be consistent with `as` cases. . && !is_hir_ty_cfg_dependant(cx, cast_to.as_unambig_ty()) . { . let (cast_from, cast_to) = (cx.typeck_results().expr_ty(self_arg), cx.typeck_results().expr_ty(expr)); . lint_cast_ptr_alignment(cx, expr, cast_from, cast_to); . } 1,452,864 ( 0.01%) } . 3,576 ( 0.00%) fn lint_cast_ptr_alignment<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'_>, cast_from: Ty<'tcx>, cast_to: Ty<'tcx>) { 894 ( 0.00%) if let ty::RawPtr(from_ptr_ty, _) = *cast_from.kind() 6 ( 0.00%) && let ty::RawPtr(to_ptr_ty, _) = *cast_to.kind() 6 ( 0.00%) && let Ok(from_layout) = cx.layout_of(from_ptr_ty) 6 ( 0.00%) && let Ok(to_layout) = cx.layout_of(to_ptr_ty) 2 ( 0.00%) && from_layout.align.abi < to_layout.align.abi . // with c_void, we inherently need to trust the user . && !is_c_void(cx, from_ptr_ty) . // when casting from a ZST, we don't know enough to properly lint . && !from_layout.is_zst() . && !is_used_as_unaligned(cx, expr) . && !expr.span.in_external_macro(cx.tcx.sess.source_map()) . { . span_lint( -- line 41 ---------------------------------------- -- line 44 ---------------------------------------- . expr.span, . format!( . "casting from `{cast_from}` to a more-strictly-aligned pointer (`{cast_to}`) ({} < {} bytes)", . from_layout.align.bytes(), . to_layout.align.bytes(), . ), . ); . } 3,129 ( 0.00%) } . . fn is_used_as_unaligned(cx: &LateContext<'_>, e: &Expr<'_>) -> bool { . let Some(parent) = get_parent_expr(cx, e) else { . return false; . }; . match parent.kind { . ExprKind::MethodCall(name, self_arg, ..) if self_arg.hir_id == e.hir_id => { . if matches!(name.ident.name, sym::read_unaligned | sym::write_unaligned) -- line 60 ---------------------------------------- 10 ( 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, . space_hint: String, . } . impl VecReserveSearcher { . fn display_err(&self, cx: &LateContext<'_>) { 15 ( 0.00%) if self.space_hint.is_empty() { . return; . } . . let s = format!("{}Vec::with_capacity({});", self.init_part, self.space_hint); . . span_lint_and_sugg( . cx, . RESERVE_AFTER_INITIALIZATION, -- line 58 ---------------------------------------- -- line 62 ---------------------------------------- . s, . Applicability::HasPlaceholders, . ); . } . } . . impl<'tcx> LateLintPass<'tcx> for ReserveAfterInitialization { . fn check_block(&mut self, _: &LateContext<'tcx>, _: &'tcx Block<'tcx>) { 21,792 ( 0.00%) self.searcher = None; . } . 120,366 ( 0.00%) fn check_local(&mut self, cx: &LateContext<'tcx>, local: &'tcx LetStmt<'tcx>) { 60,183 ( 0.00%) if let Some(init_expr) = local.init 139,768 ( 0.00%) && let PatKind::Binding(BindingMode::MUT, id, _, None) = local.pat.kind 3,528 ( 0.00%) && !local.span.in_external_macro(cx.sess().source_map()) 6,708 ( 0.00%) && let Some(init) = get_vec_init_kind(cx, init_expr) 66,360 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:clippy_utils::higher::get_vec_init_kind (1,118x) . && !matches!( . init, . VecInitKind::WithExprCapacity(_) | VecInitKind::WithConstCapacity(_) . ) . { 144 ( 0.00%) self.searcher = Some(VecReserveSearcher { . local_id: id, . err_span: local.span, . init_part: snippet( . cx, . local . .span . .shrink_to_lo() 80 ( 0.00%) .to(init_expr.span.source_callsite().shrink_to_lo()), 2,208 ( 0.00%) => ???:::to (16x) 1,484 ( 0.00%) => ???:::source_callsite (16x) . "..", . ) . .into_owned(), . space_hint: String::new(), . }); . } 140,427 ( 0.00%) } . 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 726,596 ( 0.01%) if self.searcher.is_none() 406 ( 0.00%) && let ExprKind::Assign(left, right, _) = expr.kind 1,357 ( 0.00%) && let ExprKind::Path(QPath::Resolved(None, path)) = left.kind 327 ( 0.00%) && let Res::Local(id) = path.res 327 ( 0.00%) && !expr.span.in_external_macro(cx.sess().source_map()) 654 ( 0.00%) && let Some(init) = get_vec_init_kind(cx, right) 4,113 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:clippy_utils::higher::get_vec_init_kind (109x) . && !matches!( . init, . VecInitKind::WithExprCapacity(_) | VecInitKind::WithConstCapacity(_) . ) . { 9 ( 0.00%) self.searcher = Some(VecReserveSearcher { . local_id: id, . err_span: expr.span, . init_part: snippet( . cx, 6 ( 0.00%) left.span.shrink_to_lo().to(right.span.source_callsite().shrink_to_lo()), 138 ( 0.00%) => ???:::to (1x) 24 ( 0.00%) => ???:::source_callsite (1x) . "..", . ) . .into_owned(), // see `assign_expression` test . space_hint: String::new(), . }); . } 1,937,824 ( 0.02%) } . 221,872 ( 0.00%) fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx Stmt<'_>) { 63,518 ( 0.00%) if let Some(searcher) = self.searcher.take() { 33 ( 0.00%) if let StmtKind::Expr(expr) | StmtKind::Semi(expr) = stmt.kind 13 ( 0.00%) && let ExprKind::MethodCall(name, self_arg, [space_hint], _) = expr.kind 2 ( 0.00%) && 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); . } . } 253,568 ( 0.00%) } . 87,168 ( 0.00%) fn check_block_post(&mut self, cx: &LateContext<'tcx>, _: &'tcx Block<'tcx>) { 43,593 ( 0.00%) if let Some(searcher) = self.searcher.take() { . searcher.display_err(cx); . } 87,168 ( 0.00%) } . } 8,798 ( 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_type_ir/src/ty_kind.rs -------------------------------------------------------------------------------- Ir -- line 20 ---------------------------------------- . use crate::ty::AliasTy; . use crate::{ . self as ty, BoundVarIndexKind, FloatTy, FreeAliasTy, InherentAliasTy, IntTy, Interner, . OpaqueAliasTy, ProjectionAliasTy, Region, UintTy, Unnormalized, . }; . . mod closure; . 183 ( 0.00%) #[derive_where(Clone, Copy, Hash, PartialEq, Eq, Debug; I: Interner)] . #[derive(TypeVisitable_Generic, GenericTypeVisitable, TypeFoldable_Generic, Lift_Generic)] . #[cfg_attr( . feature = "nightly", . derive(Encodable_NoContext, Decodable_NoContext, StableHash_NoContext) . )] . pub enum AliasTyKind { . /// A projection `::AssocType`. . /// -- line 36 ---------------------------------------- -- line 111 ---------------------------------------- . /// aliases which cannot be further normalized in their current scope normalize to themselves . /// with `IsRigid::Yes`. At this point we no longer have to try and renormalize this alias . /// later on. . /// . /// FIXME(#155345): Alias handling is currently still in flux for the new trait . /// solver and this is currently somewhat messy. Please reach out on . /// #t-types/trait-system-refactor-initiative if you encounter this and it isn't . /// immediately clear what to do. 122 ( 0.00%) #[derive(Debug, Clone, Copy, Hash, PartialEq)] . #[derive(TypeVisitable_Generic, GenericTypeVisitable, TypeFoldable_Generic)] . #[cfg_attr( . feature = "nightly", . derive(Decodable_NoContext, Encodable_NoContext, StableHash_NoContext) . )] . pub enum IsRigid { . Yes, . No, -- line 127 ---------------------------------------- -- line 133 ---------------------------------------- . } . } . . /// Defines the kinds of types used by the type system. . /// . /// Types written by the user start out as `hir::TyKind` and get . /// converted to this representation using `::lower_ty`. . #[cfg_attr(feature = "nightly", rustc_diagnostic_item = "IrTyKind")] 319,510 ( 0.00%) #[derive_where(Clone, Copy, Hash, PartialEq; I: Interner)] . #[derive(GenericTypeVisitable)] . #[cfg_attr( . feature = "nightly", . derive(Encodable_NoContext, Decodable_NoContext, StableHash_NoContext) . )] . pub enum TyKind { . /// The primitive boolean type. Written as `bool`. . Bool, -- line 149 ---------------------------------------- -- line 1080 ---------------------------------------- . /// Get the ABI, including the unwind flag. . pub fn abi(self) -> ExternAbi { . let abi_index = self.flags & Self::EXTERN_ABI_MASK; . ExternAbi::from_packed(abi_index) . } . . /// Get the safety flag. . pub fn is_safe(self) -> bool { 14 ( 0.00%) self.flags & Self::SAFE_FLAG != 0 . } . . /// Returns the safety mode. . pub fn safety(self) -> I::Safety { . if self.is_safe() { I::Safety::safe() } else { I::Safety::unsafe_mode() } . } . . /// Do the function arguments end with a C-style variadic argument? . pub fn c_variadic(self) -> bool { 7,364 ( 0.00%) self.flags & Self::C_VARIADIC_FLAG != 0 . } . . /// Get the index of the splatted argument, if any. . pub fn splatted(self) -> Option { . if self.splatted == Self::NO_SPLATTED_ARG_INDEX { None } else { Some(self.splatted) } . } . } . . #[derive_where(Clone, Copy, PartialEq, Hash; I: Interner)] . #[cfg_attr( . feature = "nightly", . derive(Encodable_NoContext, Decodable_NoContext, StableHash_NoContext) . )] 30,610 ( 0.00%) #[derive(TypeVisitable_Generic, GenericTypeVisitable, TypeFoldable_Generic, Lift_Generic)] 24,600 ( 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/generic_args.rs:<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::Ty> as rustc_type_ir::fold::TypeFoldable>::fold_with::> (20x) . pub struct FnSig { . pub inputs_and_output: I::Tys, 30,570 ( 0.00%) #[type_visitable(ignore)] . #[type_foldable(identity)] . pub fn_sig_kind: FnSigKind, . } . . impl Eq for FnSig {} . . impl FnSig { . pub fn inputs(self) -> I::FnInputTys { 25,595 ( 0.00%) self.inputs_and_output.inputs() 56 ( 0.00%) => ???:<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::Ty> as rustc_type_ir::inherent::Tys>::inputs (8x) . } . . pub fn output(self) -> I::Ty { 55,651 ( 0.00%) self.inputs_and_output.output() 265 ( 0.00%) => ???:<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::Ty> as rustc_type_ir::inherent::Tys>::output (53x) . } . . pub fn is_fn_trait_compatible(self) -> bool { . !self.c_variadic() && self.safety().is_safe() && self.abi() == ExternAbi::Rust . } . . /// Set the safety flag. . #[must_use = "this method does not modify the receiver"] -- line 1136 ---------------------------------------- -- line 1176 ---------------------------------------- . #[inline] . pub fn inputs(self) -> ty::Binder { . self.map_bound(|fn_sig| fn_sig.inputs()) . } . . #[inline] . #[track_caller] . pub fn input(self, index: usize) -> ty::Binder { 1 ( 0.00%) self.map_bound(|fn_sig| fn_sig.inputs().get(index).unwrap()) . } . . pub fn inputs_and_output(self) -> ty::Binder { . self.map_bound(|fn_sig| fn_sig.inputs_and_output) . } . . #[inline] . pub fn output(self) -> ty::Binder { -- line 1192 ---------------------------------------- 76,622 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/methods/useless_nonzero_new_unchecked.rs -------------------------------------------------------------------------------- Ir -- line 5 ---------------------------------------- . use clippy_utils::source::snippet_with_applicability; . use rustc_errors::Applicability; . use rustc_hir::{Block, BlockCheckMode, Expr, ExprKind, Node, QPath, UnsafeSource}; . use rustc_lint::LateContext; . use rustc_span::sym; . . use super::USELESS_NONZERO_NEW_UNCHECKED; . 117,502 ( 0.00%) pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'_>, func: &Expr<'tcx>, args: &[Expr<'_>], msrv: Msrv) { 67,140 ( 0.00%) if let ExprKind::Path(QPath::TypeRelative(ty, segment)) = func.kind 10,383 ( 0.00%) && segment.ident.name == sym::new_unchecked . && let [init_arg] = args . && is_inside_always_const_context(cx.tcx, expr.hir_id) . && cx.typeck_results().node_type(ty.hir_id).is_diag_item(cx, sym::NonZero) . && msrv.meets(cx, msrvs::CONST_UNWRAP) . { . let mut app = Applicability::MachineApplicable; . let ty_str = snippet_with_applicability(cx, ty.span, "_", &mut app); . let msg = format!("`{ty_str}::new()` and `Option::unwrap()` can be safely used in a `const` context"); -- line 23 ---------------------------------------- -- line 51 ---------------------------------------- . // this may no longer be needed for the fixed expression. . span_lint_and_then(cx, USELESS_NONZERO_NEW_UNCHECKED, expr.span, msg, |diagnostic| { . diagnostic . .span_suggestion(expr.span, "use instead", sugg, app) . .note("the fixed expression does not require an `unsafe` context"); . }); . } . } 134,288 ( 0.00%) } 9,103 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/partialeq_to_none.rs -------------------------------------------------------------------------------- Ir -- line 36 ---------------------------------------- . pub PARTIALEQ_TO_NONE, . style, . "Binary comparison to `Option::None` relies on `T: PartialEq`, which is unneeded" . } . . declare_lint_pass!(PartialeqToNone => [PARTIALEQ_TO_NONE]); . . impl<'tcx> LateLintPass<'tcx> for PartialeqToNone { 1,937,824 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { . // Skip expanded code, as we have no control over it anyway... 484,456 ( 0.00%) if e.span.from_expansion() { . return; . } . . // If the expression is of type `Option` . let is_ty_option = |expr: &Expr<'_>| { . cx.typeck_results() 8 ( 0.00%) .expr_ty(expr) 160 ( 0.00%) => ???:::expr_ty (4x) . .peel_refs() . .is_diag_item(cx, sym::Option) . }; . . // If the expression is a literal `Option::None` . let is_none_ctor = 28,560 ( 0.00%) |expr: &Expr<'_>| !expr.span.from_expansion() && is_none_expr(cx, peel_hir_expr_refs(expr).0); 106,223 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/res.rs:clippy_utils::is_none_expr (4,080x) 20,416 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::peel_hir_expr_refs (4,080x) . 164,455 ( 0.00%) let mut applicability = Applicability::MachineApplicable; . 344,694 ( 0.00%) if let ExprKind::Binary(op, left_side, right_side) = e.kind { . // All other comparisons (e.g. `>= None`) have special meaning wrt T 8,000 ( 0.00%) let is_eq = match op.node { . BinOpKind::Eq => true, . BinOpKind::Ne => false, . _ => return, . }; . . // We are only interested in comparisons between `Option` and a literal `Option::None` 4,088 ( 0.00%) let scrutinee = match ( 4,080 ( 0.00%) is_none_ctor(left_side) && is_ty_option(right_side), 4,080 ( 0.00%) is_none_ctor(right_side) && is_ty_option(left_side), . ) { . (true, false) => right_side, . (false, true) => left_side, . _ => return, . }; . . // Peel away refs/derefs (as long as we don't cross manual deref impls), as . // autoref/autoderef will take care of those 32 ( 0.00%) let sugg = format!( 252 ( 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) . "{}.{}", 44 ( 0.00%) sugg::Sugg::hir_with_applicability(cx, peel_ref_operators(cx, scrutinee), "..", &mut applicability) 5,860 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/sugg.rs:::hir_with_applicability (4x) 76 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::peel_ref_operators (4x) 12 ( 0.00%) .maybe_paren(), 152 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/sugg.rs:::maybe_paren (4x) 24 ( 0.00%) if is_eq { "is_none()" } else { "is_some()" } . ); . 48 ( 0.00%) span_lint_and_sugg( 1,052,252 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_sugg:: (4x) . cx, . PARTIALEQ_TO_NONE, 4 ( 0.00%) e.span, . "binary comparison to literal `Option::None`", 16 ( 0.00%) if is_eq { . "use `Option::is_none()` instead" . } else { . "use `Option::is_some()` instead" . }, . sugg, . applicability, . ); . } 1,937,824 ( 0.02%) } . } 2,169 ( 0.00%) -------------------------------------------------------------------------------- -- 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; _]); 74 ( 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) { 286 ( 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. 115,610 ( 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)) { 20,222 ( 0.00%) return *availability; . } 1,197 ( 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() . }; 2,786 ( 0.00%) let version = if feature.is_some_and(|feature| tcx.features().enabled(feature)) { 15,920 ( 0.00%) => ???:::features (398x) 1,592 ( 0.00%) => ???:::enabled (398x) . 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 94,590 ( 0.00%) } . . /// Emit lint if `def_id`, associated with `node` and `span`, is below the current MSRV. 1,219,710 ( 0.01%) 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(); 78,836 ( 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, 7,308 ( 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. 168,144 ( 0.00%) if let Some(current) = self.msrv.current(cx) 105,090 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::current (10,509x) 157,635 ( 0.00%) && let Availability::Since(version) = self.get_def_id_availability(cx.tcx, def_id, needs_const) 1,313,426 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/incompatible_msrv.rs:::get_def_id_availability (10,509x) 42,036 ( 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"); . } . }, . ); . } 650,512 ( 0.01%) } . } . . impl<'tcx> LateLintPass<'tcx> for IncompatibleMsrv { 2,180,052 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 1,556,612 ( 0.01%) match expr.kind { . ExprKind::MethodCall(_, _, _, span) => { 98,392 ( 0.00%) if let Some(method_did) = cx.typeck_results().type_dependent_def_id(expr.hir_id) { 718,368 ( 0.01%) => ???:::type_dependent_def_id (14,056x) 168,672 ( 0.00%) self.emit_lint_if_under_msrv(cx, is_in_const_context(cx), method_did, expr.hir_id, span); 4,986,616 ( 0.04%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_const_context (14,056x) 1,701,968 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/incompatible_msrv.rs:::emit_lint_if_under_msrv (14,056x) . } . }, 194,018 ( 0.00%) ExprKind::Call(callee, _) if let ExprKind::Path(qpath) = callee.kind => { 55,432 ( 0.00%) self.called_path = Some(callee.hir_id); 83,148 ( 0.00%) let needs_const = is_in_const_context(cx); 10,016,044 ( 0.08%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_const_context (27,716x) 166,296 ( 0.00%) let def_id = if let Some(def_id) = cx.qpath_res(&qpath, callee.hir_id).opt_def_id() { 1,328,843 ( 0.01%) => ???:::qpath_res (27,716x) . def_id 282 ( 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; . }; 193,025 ( 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. 107,642 ( 0.00%) ExprKind::Path(qpath) 968,778 ( 0.01%) if let Some(path_def_id) = cx.qpath_res(&qpath, expr.hir_id).opt_def_id() 3,195,985 ( 0.03%) => ???:::qpath_res (107,642x) . && self.called_path != Some(expr.hir_id) => . { 51,394 ( 0.00%) self.emit_lint_if_under_msrv(cx, false, path_def_id, expr.hir_id, expr.span); . }, . _ => {}, . } 1,937,824 ( 0.02%) } . . fn check_ty(&mut self, cx: &LateContext<'tcx>, hir_ty: &'tcx hir::Ty<'tcx, AmbigArg>) { 279,522 ( 0.00%) if let hir::TyKind::Path(qpath) = hir_ty.kind 348,888 ( 0.00%) && let Some(ty_def_id) = cx.qpath_res(&qpath, hir_ty.hir_id).opt_def_id() 1,040,163 ( 0.01%) => ???:::qpath_res (43,611x) . // `CStr` and `CString` have been moved around but have been available since Rust 1.0.0 226,387 ( 0.00%) && !matches!(cx.tcx.get_diagnostic_name(ty_def_id), Some(sym::cstr_type | sym::cstring_type)) 1,903,743 ( 0.02%) => ???:::get_diagnostic_name (32,341x) . { 291,069 ( 0.00%) self.emit_lint_if_under_msrv(cx, false, ty_def_id, hir_ty.hir_id, hir_ty.span); 1,988,509 ( 0.02%) => site/frontend/rust-clippy/clippy_lints/src/incompatible_msrv.rs:::emit_lint_if_under_msrv (32,341x) . } . } . } . . /// 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 ---------------------------------------- 176,798 ( 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 -- line 913 ---------------------------------------- . 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, . 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, . 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, . 0, 0, 0, 0, 0, 0, 0, 0, 0, . ]; . #[inline] . pub const fn lookup(c: char) -> bool { . debug_assert!(!c.is_ascii()); 312 ( 0.00%) match c as u32 >> 8 { . 0 => WHITESPACE_MAP[c as usize & 0xff] & 1 != 0, . 22 => c as u32 == 0x1680, . 32 => WHITESPACE_MAP[c as usize & 0xff] & 2 != 0, . 48 => c as u32 == 0x3000, . _ => false, . } . } . } -- line 929 ---------------------------------------- 202,506 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/operators/double_comparison.rs -------------------------------------------------------------------------------- Ir -- line 3 ---------------------------------------- . use clippy_utils::source::snippet_with_applicability; . use rustc_errors::Applicability; . use rustc_hir::{BinOpKind, Expr, ExprKind}; . use rustc_lint::LateContext; . use rustc_span::Span; . . use super::DOUBLE_COMPARISONS; . 47,152 ( 0.00%) pub(super) fn check(cx: &LateContext<'_>, op: BinOpKind, lhs: &Expr<'_>, rhs: &Expr<'_>, span: Span) { 13,472 ( 0.00%) if let ExprKind::Binary(lop, llhs, lrhs) = lhs.kind 4,880 ( 0.00%) && let ExprKind::Binary(rop, rlhs, rrhs) = rhs.kind . && let ctxt = span.ctxt() 5,852 ( 0.00%) && eq_expr_value(cx, ctxt, llhs, rlhs) 815,943 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:clippy_utils::hir_utils::eq_expr_value (836x) 2,772 ( 0.00%) && eq_expr_value(cx, ctxt, lrhs, rrhs) 1,127,434 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:clippy_utils::hir_utils::eq_expr_value (396x) . { . let op = match (op, lop.node, rop.node) { . // x == y || x < y => x <= y . (BinOpKind::Or, BinOpKind::Eq, BinOpKind::Lt) . // x < y || x == y => x <= y . | (BinOpKind::Or, BinOpKind::Lt, BinOpKind::Eq) => { . "<=" . }, -- line 24 ---------------------------------------- -- line 64 ---------------------------------------- . DOUBLE_COMPARISONS, . span, . "this binary expression can be simplified", . "try", . sugg, . applicability, . ); . } 53,888 ( 0.00%) } 10,428 ( 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 { 108,196 ( 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 { 721,001 ( 0.01%) 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),* $(,)?) => {{ 3,956 ( 0.00%) $(try_visit!(Visitable::visit($expr, $visitor, ()));)* 4,332 ( 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 (114x) . }}; . } . . 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, ) => { 445,384 ( 0.00%) Walkable::walk_ref($expr, $visitor) 127 ( 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 (3x) . }; . } . . 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 { 1,298,643 ( 0.01%) fn walk_ref(&$lt $self, $vis: &mut $vis_ty) -> V::Result { . $block 1,102,248 ( 0.01%) } . } . }; . } . . macro_rules! impl_visitable_noop { . (<$lt:lifetime> $($ty:ty,)*) => { . $( . impl_visitable!(|&$lt self: $ty, _vis: &mut V, _extra: ()| { -- line 250 ---------------------------------------- -- line 273 ---------------------------------------- . })* . }; . } . . macro_rules! impl_visitable_direct { . (<$lt:lifetime> $($ty:ty,)*) => { . $(impl_visitable!( . |&$lt self: $ty, visitor: &mut V, _extra: ()| { 8 ( 0.00%) Walkable::walk_ref(self, visitor) . } . );)* . }; . } . . 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; 61,902 ( 0.00%) visitor.$method(self $(, $extra_name)?) 1,137,780 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::visit_pat'2 (1,640x) . }); . 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 { 277 ( 0.00%) walk_fn(self, fk) 39,507 ( 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:: (11x) . } . . // (non-mut) `Visitor`-only methods . $( . fn visit_stmt(&mut self, s: &$lt Stmt) -> Self::Result { 83,117 ( 0.00%) walk_stmt(self, s) 33,850,202 ( 0.28%) => /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:: (10,421x) . } . . 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 738 ---------------------------------------- . fn flat_map_where_predicate( . &mut self, . where_predicate: WherePredicate, . ) -> SmallVec<[WherePredicate; 1]> { . walk_flat_map_where_predicate(self, where_predicate) . } . . fn flat_map_pat_field(&mut self, fp: PatField) -> SmallVec<[PatField; 1]> { 22,824 ( 0.00%) walk_flat_map_pat_field(self, fp) 471,561 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/mut_visit.rs:rustc_ast::mut_visit::walk_flat_map_pat_field:: (5,704x) . } . )? . } . . pub trait WalkItemKind { . type Ctxt; . fn walk<$($lt,)? V: $Visitor$(<$lt>)?>( . &$($lt)? $($mut)? self, -- line 754 ---------------------------------------- -- line 922 ---------------------------------------- . visit_visitable!($($mut)? vis, alias), . ForeignItemKind::MacCall(mac) => . visit_visitable!($($mut)? vis, mac), . } . V::Result::output() . } . } . 2,216 ( 0.00%) pub fn walk_fn<$($lt,)? V: $Visitor$(<$lt>)?>(vis: &mut V, kind: FnKind<$($lt)? $(${ignore($mut)} '_)?>) -> V::Result { 831 ( 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 . ); . } 277 ( 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; 12,876 ( 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); 871,185 ( 0.01%) 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), 280 ( 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 { 277 ( 0.00%) binder, . capture_clause, 277 ( 0.00%) coroutine_kind, . constness, . movability, 277 ( 0.00%) fn_decl, 277 ( 0.00%) body, . fn_decl_span, . fn_arg_span, . }) => { . visit_visitable!($($mut)? vis, constness, movability, capture_clause); 1,108 ( 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); 277 ( 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), . ExprKind::Assign(lhs, rhs, span) => . visit_visitable!($($mut)? vis, lhs, rhs, span), . ExprKind::AssignOp(op, lhs, rhs) => . visit_visitable!($($mut)? vis, op, lhs, rhs), 36 ( 0.00%) ExprKind::Field(subexpression, ident) => 36 ( 0.00%) visit_visitable!($($mut)? vis, subexpression, ident), . ExprKind::Index(main_expression, index_expression, span) => . visit_visitable!($($mut)? vis, main_expression, index_expression, span), . ExprKind::Range(start, end, limit) => . visit_visitable!($($mut)? vis, start, end, limit), . ExprKind::Underscore => {} . ExprKind::Path(maybe_qself, path) => . visit_visitable!($($mut)? vis, maybe_qself, path), . ExprKind::Break(opt_label, opt_expr) => -- line 1045 ---------------------------------------- -- line 1161 ---------------------------------------- . . fn $name<'a, V: Visitor<'a>>( . vis: &mut V, . values: &'a ThinVec<$Ty>, . $( . $param: $ParamTy, . )* . ) -> V::Result { 56,822 ( 0.00%) walk_list!(vis, $visit_fn, values$(,$param)*); 18,070,800 ( 0.15%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::visit_arm (3,134x) . 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; . } . 290,784 ( 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)); 181,740 ( 0.00%) match kind { 163,590 ( 0.00%) StmtKind::Let(local) => try_visit!(visitor.visit_local(local)), 3,266,432 ( 0.03%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::visit_local (4,813x) . StmtKind::Item(item) => try_visit!(visitor.visit_item(item)), 19,905 ( 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() 672 ( 0.00%) } 512,613 ( 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 { 1,453,368 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'_>, e: &Expr<'_>) { 562,663 ( 0.00%) if !e.span.from_expansion() 2,513 ( 0.00%) && let ExprKind::Unary(UnOp::Deref, deref_target) = e.kind 1,370 ( 0.00%) && !deref_target.span.from_expansion() 1,370 ( 0.00%) && 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() . { . let mut applicability = Applicability::MachineApplicable; . let mut sugg = || Sugg::hir_with_applicability(cx, addrof_target, "_", &mut applicability); -- line 54 ---------------------------------------- -- line 73 ---------------------------------------- . DEREF_ADDROF, . e.span, . "immediately dereferencing a reference", . "try", . sugg.to_string(), . applicability, . ); . } 1,453,368 ( 0.01%) } . } . . /// 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 ---------------------------------------- 328,910 ( 0.00%) -------------------------------------------------------------------------------- -- 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) { 512,568 ( 0.00%) if let hir::ExprKind::MethodCall(is_some_path, to_digit_expr, [], _) = &expr.kind 15,930 ( 0.00%) && is_some_path.ident.name == sym::is_some . { 214 ( 0.00%) let match_result = match to_digit_expr.kind { 41 ( 0.00%) hir::ExprKind::MethodCall(to_digits_path, char_arg, [radix_arg], _) => { 9 ( 0.00%) 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 . } . }, . hir::ExprKind::Call(to_digits_call, [char_arg, radix_arg]) => { -- line 65 ---------------------------------------- -- line 89 ---------------------------------------- . format!("{char_arg_snip}.is_digit({radix_snip})") . } else { . format!("char::is_digit({char_arg_snip}, {radix_snip})") . }, . applicability, . ); . } . } 1,937,824 ( 0.02%) } . } -------------------------------------------------------------------------------- -- 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) { 19,998 ( 0.00%) duplicate_underscore_argument::check(cx, fn_kind); 8,745,901 ( 0.07%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/duplicate_underscore_argument.rs:clippy_lints::functions::duplicate_underscore_argument::check (6,666x) . } . } . . 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 { 68,592 ( 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, . ) { 5,716 ( 0.00%) let hir_id = cx.tcx.local_def_id_to_hir_id(def_id); 57,160 ( 0.00%) too_many_arguments::check_fn(cx, kind, decl, hir_id, def_id, self.too_many_arguments_threshold); 22,864 ( 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); 74,308 ( 0.00%) misnamed_getters::check_fn(cx, kind, decl, body, span); 261,049 ( 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 (5,716x) 1,233 ( 0.00%) impl_trait_in_params::check_fn(cx, &kind, body, hir_id); 74,308 ( 0.00%) ref_option::check_fn( 3,099,042 ( 0.03%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/ref_option.rs:clippy_lints::functions::ref_option::check_fn (5,716x) . cx, . kind, . decl, . span, . hir_id, . def_id, . body, 11,432 ( 0.00%) self.avoid_breaking_exported_api, . ); 40,012 ( 0.00%) } . . fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>) { 17,814 ( 0.00%) must_use::check_item(cx, item); 6,729,584 ( 0.06%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/must_use.rs:clippy_lints::functions::must_use::check_item (5,938x) 17,814 ( 0.00%) result::check_item( 1,895,050 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::check_item (5,938x) . cx, . item, 5,938 ( 0.00%) self.large_error_threshold, 5,938 ( 0.00%) &self.large_error_ignored, 5,938 ( 0.00%) self.msrv, . ); . } . 41,110 ( 0.00%) fn check_impl_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::ImplItem<'_>) { 12,333 ( 0.00%) must_use::check_impl_item(cx, item); 28,336,152 ( 0.24%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/must_use.rs:clippy_lints::functions::must_use::check_impl_item (4,111x) 12,333 ( 0.00%) result::check_impl_item( 3,638,313 ( 0.03%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::check_impl_item (4,111x) . cx, . item, 4,111 ( 0.00%) self.large_error_threshold, 4,111 ( 0.00%) &self.large_error_ignored, 4,111 ( 0.00%) self.msrv, . ); . impl_trait_in_params::check_impl_item(cx, item); 20,555 ( 0.00%) renamed_function_params::check_impl_item(cx, item, &self.trait_ids); 1,670,195 ( 0.01%) => /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 (4,111x) 32,888 ( 0.00%) } . 12,630 ( 0.00%) fn check_trait_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::TraitItem<'_>) { 1,236 ( 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); 3,789 ( 0.00%) must_use::check_trait_item(cx, item); 673,794 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/must_use.rs:clippy_lints::functions::must_use::check_trait_item (1,263x) 3,789 ( 0.00%) result::check_trait_item( 1,253,094 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::check_trait_item (1,263x) . cx, . item, 1,263 ( 0.00%) self.large_error_threshold, 1,263 ( 0.00%) &self.large_error_ignored, 1,263 ( 0.00%) self.msrv, . ); 1,263 ( 0.00%) impl_trait_in_params::check_trait_item(cx, item, self.avoid_breaking_exported_api); 5,052 ( 0.00%) ref_option::check_trait_item(cx, item, self.avoid_breaking_exported_api); 956,482 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/ref_option.rs:clippy_lints::functions::ref_option::check_trait_item (1,263x) 10,104 ( 0.00%) } . . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>) { 1,211,140 ( 0.01%) result::check_expr(cx, expr, self.large_error_threshold, &self.large_error_ignored); 4,181,063 ( 0.03%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::check_expr (242,228x) . } . } 82,490 ( 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { . // If the expression is a call (`Box::new(...)`) 551,190 ( 0.00%) if let ExprKind::Call(box_new, [arg]) = expr.kind . // And call is of the form `::something` . // Here, it would be `::new` 49,663 ( 0.00%) && let ExprKind::Path(QPath::TypeRelative(ty, seg)) = box_new.kind . // And that method is `new` 4,106 ( 0.00%) && seg.ident.name == sym::new . // And the call is that of a `Box` method 1,132 ( 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())` 43 ( 0.00%) && let ExprKind::Call(arg_path, _) = arg.kind . // And we are not in a foreign crate's macro 15 ( 0.00%) && !expr.span.in_external_macro(cx.sess().source_map()) 351 ( 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 (3x) . // And the argument expression has the same context as the outer call expression . // or that we are inside a `vec!` macro expansion 15 ( 0.00%) && (expr.span.eq_ctxt(arg.span) || is_local_vec_expn(cx, arg, expr)) 90 ( 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:::eq_ctxt (3x) . // And the argument is `Default::default()` or the type is specified 24 ( 0.00%) && (is_plain_default(cx, arg_path) || (given_type(cx, expr) && is_default_equivalent(cx, arg))) 448 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/box_default.rs:clippy_lints::box_default::given_type (3x) 86 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/box_default.rs:clippy_lints::box_default::is_plain_default (3x) . { . span_lint_and_sugg( . cx, . BOX_DEFAULT, . expr.span, . "`Box::new(_)` of default value", . "try", . "Box::default()".into(), . Applicability::MachineApplicable, . ); . } 1,937,824 ( 0.02%) } . } . 3 ( 0.00%) 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" 14 ( 0.00%) if let ExprKind::Path(QPath::Resolved(None, path)) = &arg_path.kind 5 ( 0.00%) && let Res::Def(_, def_id) = path.res . { . // avoid generic parameters 4 ( 0.00%) cx.tcx.is_diagnostic_item(sym::default_fn, def_id) && path.segments.iter().all(|seg| seg.args.is_none()) 54 ( 0.00%) => ???:::is_diagnostic_item (1x) . } else { . false . } 3 ( 0.00%) } . . fn is_local_vec_expn(cx: &LateContext<'_>, expr: &Expr<'_>, ref_expr: &Expr<'_>) -> bool { . macro_backtrace(expr.span) . .next() . .is_some_and(|call| cx.tcx.is_diagnostic_item(sym::vec_macro, call.def_id) && call.span.eq_ctxt(ref_expr.span)) . } . . #[derive(Default)] -- line 91 ---------------------------------------- -- line 100 ---------------------------------------- . fn visit_ty(&mut self, t: &Ty<'_, AmbigArg>) { . self.0 |= matches!(t.kind, TyKind::OpaqueDef(..) | TyKind::TraitObject(..)); . if !self.0 { . walk_ty(self, t); . } . } . } . 24 ( 0.00%) fn given_type(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { 46 ( 0.00%) match cx.tcx.parent_hir_node(expr.hir_id) { 338 ( 0.00%) => ???:::parent_hir_node (3x) . Node::LetStmt(LetStmt { ty: Some(ty), .. }) => { . let mut v = InferVisitor::default(); . v.visit_ty_unambig(ty); . !v.0 . }, . Node::Expr(Expr { . kind: ExprKind::Call(path, args), . .. -- line 117 ---------------------------------------- -- line 118 ---------------------------------------- . }) . | Node::Block(Block { . expr: Some(Expr { . kind: ExprKind::Call(path, args), . .. . }), . .. . }) => { 1 ( 0.00%) if let Some(index) = args.iter().position(|arg| arg.hir_id == expr.hir_id) . && let Some(sig) = expr_sig(cx, path) . && let Some(input) = sig.input(index) . && let Some(input_ty) = input.no_bound_vars() . { . input_ty == cx.typeck_results().expr_ty_adjusted(expr) . } else { . false . } . }, . _ => false, . } 21 ( 0.00%) } 374 ( 0.00%) -------------------------------------------------------------------------------- -- 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 { 1,211,140 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) { 484,456 ( 0.00%) if let Assign(left_expr, collect_expr, _) = &expr.kind 1,442 ( 0.00%) && let hir::ExprKind::MethodCall(seg, target_expr, [], _) = &collect_expr.kind 176 ( 0.00%) && seg.args.is_none() 440 ( 0.00%) && let Some(collect_def_id) = cx.typeck_results().type_dependent_def_id(collect_expr.hir_id) 4,540 ( 0.00%) => ???:::type_dependent_def_id (88x) 528 ( 0.00%) && cx.tcx.is_diagnostic_item(sym::iterator_collect_fn, collect_def_id) 9,237 ( 0.00%) => ???:::is_diagnostic_item (88x) . { . 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); . } 1,453,368 ( 0.01%) } . } . . fn check_into_iter( . cx: &LateContext<'_>, . left_expr: &hir::Expr<'_>, . target_expr: &hir::Expr<'_>, . parent_expr_span: Span, . msrv: Msrv, -- line 79 ---------------------------------------- 176 ( 0.00%) -------------------------------------------------------------------------------- -- 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)> { 404,654 ( 0.00%) if let ExprKind::MethodCall(MethodCall { . seg: name_ident, . receiver, . .. . }) = &expr.kind 14,056 ( 0.00%) && let method_name = name_ident.ident.name 84,312 ( 0.00%) && matches!(method_name, sym::ceil | sym::floor | sym::round) 36 ( 0.00%) && 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 { 1,416,289 ( 0.01%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 14,056 ( 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, . ); . } 1,618,616 ( 0.01%) } . } 14,056 ( 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; . 408,954 ( 0.00%) pub(crate) fn check(cx: &LateContext<'_>, pat: &Pat<'_>) { 116,844 ( 0.00%) if !pat.span.from_expansion() 93,408 ( 0.00%) && let PatKind::Struct(QPath::Resolved(_, path), fields, Some(dotdot)) = pat.kind . && let Some(def_id) = path.res.opt_def_id() 731 ( 0.00%) && let ty = cx.tcx.type_of(def_id).instantiate_identity().skip_norm_wip() 1,462 ( 0.00%) && let ty::Adt(def, _) = ty.kind() 2,178 ( 0.00%) && (def.is_struct() || def.is_union()) 27 ( 0.00%) && fields.len() == def.non_enum_variant().fields.len() 72 ( 0.00%) => ???:::non_enum_variant (9x) . && !def.non_enum_variant().is_field_list_non_exhaustive() . { . span_lint_and_then( . cx, . REST_PAT_IN_FULLY_BOUND_STRUCTS, . pat.span, . "unnecessary use of `..` pattern in struct binding. All fields were already bound", . |diag| { -- line 23 ---------------------------------------- -- line 25 ---------------------------------------- . dotdot, . "consider removing `..` from this binding", . "", . rustc_errors::Applicability::MachineApplicable, . ); . }, . ); . } 467,376 ( 0.00%) } 1,462 ( 0.00%) -------------------------------------------------------------------------------- -- 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. 11,760 ( 0.00%) pub fn method_call<'tcx>(recv: &'tcx Expr<'tcx>) -> Option<(Symbol, &'tcx Expr<'tcx>, &'tcx [Expr<'tcx>], Span, Span)> { 87,953 ( 0.00%) if let ExprKind::MethodCall(path, receiver, args, call_span) = recv.kind 36,235 ( 0.00%) && !args.iter().any(|e| e.range_span().unwrap_or(e.span).from_expansion()) 4,818 ( 0.00%) => ???:::range_span (219x) 49,204 ( 0.00%) && !receiver.range_span().unwrap_or(receiver.span).from_expansion() 12,782 ( 0.00%) => ???:::range_span (563x) . { 31,274 ( 0.00%) Some((path.ident.name, receiver, args, path.ident.span, call_span)) . } else { 907 ( 0.00%) None . } 11,760 ( 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%) } . 1,937,824 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 484,456 ( 0.00%) if expr.span.from_expansion() { . return; . } . 1,060,723 ( 0.01%) match expr.kind { 67,144 ( 0.00%) ExprKind::Call(func, args) => { 83,930 ( 0.00%) unnecessary_fallible_conversions::check_function(cx, expr, func); 5,215,807 ( 0.04%) => /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 (16,786x) 184,646 ( 0.00%) manual_c_str_literals::check(cx, expr, func, args, self.msrv); 778,599 ( 0.01%) => /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 (16,786x) 134,288 ( 0.00%) useless_nonzero_new_unchecked::check(cx, expr, func, args, self.msrv); 338,416 ( 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 (16,786x) 134,288 ( 0.00%) io_other_error::check(cx, expr, func, args, self.msrv); 870,429 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/io_other_error.rs:clippy_lints::methods::io_other_error::check (16,786x) 167,860 ( 0.00%) swap_with_temporary::check(cx, expr, func, args); 1,047,465 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/swap_with_temporary.rs:clippy_lints::methods::swap_with_temporary::check (16,786x) 100,716 ( 0.00%) ip_constant::check(cx, expr, func, args); 404,690 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/ip_constant.rs:clippy_lints::methods::ip_constant::check (16,786x) 50,358 ( 0.00%) clone_on_copy::check_function(cx, expr); 4,431,708 ( 0.04%) => /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 (16,786x) 184,646 ( 0.00%) unwrap_expect_used::check_call( 1,811,419 ( 0.02%) => /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 (16,786x) . cx, . expr, . func, . args, 16,786 ( 0.00%) self.allow_unwrap_in_tests, 16,786 ( 0.00%) self.allow_expect_in_tests, 16,786 ( 0.00%) self.allow_unwrap_in_consts, 16,786 ( 0.00%) self.allow_expect_in_consts, 16,786 ( 0.00%) &self.unwrap_allowed_ids, . &self.unwrap_allowed_aliases, . ); . }, . ExprKind::MethodCall(..) => { 104,931 ( 0.00%) self.check_methods(cx, expr); 21,522,331 ( 0.18%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:::check_methods (11,659x) . }, 19,488 ( 0.00%) ExprKind::Binary(op, lhs, rhs) if op.node == hir::BinOpKind::Eq || op.node == hir::BinOpKind::Ne => { 8,160 ( 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); . }, 192 ( 0.00%) ExprKind::Binary(op, lhs, rhs) if op.node == hir::BinOpKind::Or => { 1,152 ( 0.00%) manual_is_variant_and::check_or(cx, expr, lhs, rhs, self.msrv); 1,951 ( 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_or (96x) . }, . _ => (), . } 1,843,784 ( 0.02%) } . 41,110 ( 0.00%) fn check_impl_item(&mut self, cx: &LateContext<'tcx>, impl_item: &'tcx hir::ImplItem<'_>) { 12,333 ( 0.00%) if impl_item.span.in_external_macro(cx.sess().source_map()) { . return; . } . 14,369 ( 0.00%) if let hir::ImplItemKind::Fn(ref sig, id) = impl_item.kind { 13,975 ( 0.00%) let parent = cx.tcx.hir_get_parent_item(impl_item.hir_id()).def_id; 393,505 ( 0.00%) => ???:::hir_get_parent_item (2,795x) 11,180 ( 0.00%) let item = cx.tcx.hir_expect_item(parent); 181,380 ( 0.00%) => ???:::hir_expect_item (2,795x) 8,385 ( 0.00%) let self_ty = cx.tcx.type_of(item.owner_id).instantiate_identity().skip_norm_wip(); 11,180 ( 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(); 5,590 ( 0.00%) let method_sig = cx.tcx.instantiate_bound_regions_with_erased(method_sig); 3,089,415 ( 0.03%) => /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::> (2,795x) 2,795 ( 0.00%) let first_arg_ty_opt = method_sig.inputs().iter().next().copied(); 22,360 ( 0.00%) should_implement_trait::check_impl_item(cx, impl_item, self_ty, implements_trait, first_arg_ty_opt, sig); 146,935 ( 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 (2,795x) . 11,180 ( 0.00%) if sig.decl.implicit_self().has_implicit_self() 22,360 ( 0.00%) => ???:::implicit_self (2,795x) 4,630 ( 0.00%) && !(self.avoid_breaking_exported_api 11,575 ( 0.00%) && cx.effective_visibilities.is_exported(impl_item.owner_id.def_id)) 129,135 ( 0.00%) => ???:::is_exported (2,315x) 5,564 ( 0.00%) && let Some(first_arg) = iter_input_pats(sig.decl, cx.tcx.hir_body(id)).next() 95,126 ( 0.00%) => ???:::hir_body (1,391x) 2,782 ( 0.00%) && let Some(first_arg_ty) = first_arg_ty_opt . { 8,346 ( 0.00%) wrong_self_convention::check( 1,881,603 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/wrong_self_convention.rs:clippy_lints::methods::wrong_self_convention::check (1,391x) . cx, 1,391 ( 0.00%) impl_item.ident.name, . self_ty, . first_arg_ty, 2,782 ( 0.00%) first_arg.pat.span, . implements_trait, . false, . ); . } . . new_ret_no_self::check_impl_item(cx, impl_item, self_ty, implements_trait); . } 32,888 ( 0.00%) } . 8,841 ( 0.00%) fn check_trait_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx TraitItem<'_>) { 2,526 ( 0.00%) if let TraitItemKind::Fn(ref sig, _) = item.kind 6,180 ( 0.00%) && !item.span.in_external_macro(cx.tcx.sess.source_map()) . { 4,944 ( 0.00%) if sig.decl.implicit_self().has_implicit_self() 9,888 ( 0.00%) => ???:::implicit_self (1,236x) . && let Some(first_arg_hir_ty) = sig.decl.inputs.first() 1,184 ( 0.00%) && let Some(&first_arg_ty) = cx . .tcx 2,368 ( 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(); 7,104 ( 0.00%) wrong_self_convention::check( 905,406 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/wrong_self_convention.rs:clippy_lints::methods::wrong_self_convention::check (1,184x) . cx, 2,368 ( 0.00%) item.ident.name, . self_ty, . first_arg_ty, 1,184 ( 0.00%) first_arg_hir_ty.span, . false, . true, . ); . } . 3,708 ( 0.00%) new_ret_no_self::check_trait_item(cx, item); 21,860 ( 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 (1,236x) . } 10,104 ( 0.00%) } . } . . impl Methods { . #[expect(clippy::too_many_lines)] 81,613 ( 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) { 86,244 ( 0.00%) (sym::add | sym::sub | sym::wrapping_add | sym::wrapping_sub, [_arg]) => { 22 ( 0.00%) zst_offset::check(cx, expr, recv); 861 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/zst_offset.rs:clippy_lints::methods::zst_offset::check (11x) . }, . (sym::all, [arg]) => { 207 ( 0.00%) needless_character_iteration::check(cx, expr, recv, arg, true); 3,073 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/needless_character_iteration.rs:clippy_lints::methods::needless_character_iteration::check (23x) 184 ( 0.00%) match method_call(recv) { 2,726 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (23x) . Some((sym::cloned, recv2, [], _, _)) => { . iter_overeager_cloned::check( . cx, . expr, . recv, . recv2, . iter_overeager_cloned::Op::NeedlessMove(arg), . false, -- line 5284 ---------------------------------------- -- line 5289 ---------------------------------------- . }, . _ => {}, . } . }, . (name @ (sym::chunks_exact | sym::chunks_exact_mut), [arg]) => { . chunks_exact_to_as_chunks::check(cx, recv, arg, expr, call_span, name, self.msrv); . }, . (sym::and_then, [arg]) => { 160 ( 0.00%) manual_option_zip::check(cx, expr, recv, arg, self.msrv); 4,449 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/manual_option_zip.rs:clippy_lints::methods::manual_option_zip::check (16x) . let biom_option_linted = bind_instead_of_map::check_and_then_some(cx, expr, recv, arg); . let biom_result_linted = bind_instead_of_map::check_and_then_ok(cx, expr, recv, arg); 64 ( 0.00%) if !biom_option_linted && !biom_result_linted { 128 ( 0.00%) let ule_and_linted = unnecessary_lazy_eval::check(cx, expr, recv, arg, "and", true); 18,770 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/unnecessary_lazy_eval.rs:clippy_lints::methods::unnecessary_lazy_eval::check (16x) 32 ( 0.00%) if !ule_and_linted { 80 ( 0.00%) return_and_then::check(cx, expr, recv, arg); 149,193 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/return_and_then.rs:clippy_lints::methods::return_and_then::check (16x) . } . } . 96 ( 0.00%) manual_filter::check_and_then_method(cx, recv, arg, call_span, expr); 4,978 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/manual_filter.rs:clippy_lints::matches::manual_filter::check_and_then_method (16x) . }, . (sym::any, [arg]) => { 81 ( 0.00%) needless_character_iteration::check(cx, expr, recv, arg, false); 1,049 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/needless_character_iteration.rs:clippy_lints::methods::needless_character_iteration::check (9x) 71 ( 0.00%) match method_call(recv) { 889 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (9x) . Some((sym::cloned, recv2, [], _, _)) => iter_overeager_cloned::check( . cx, . expr, . recv, . recv2, . iter_overeager_cloned::Op::NeedlessMove(arg), . false, . ), . Some((sym::chars, recv, _, _, _)) . if let ExprKind::Closure(arg) = arg.kind . && let body = cx.tcx.hir_body(arg.body) . && let [param] = body.params => . { . string_lit_chars_any::check(cx, expr, recv, param, peel_blocks(body.value), self.msrv); . }, 4 ( 0.00%) Some((sym::map, _, [map_arg], _, map_call_span)) => { 2 ( 0.00%) map_all_any_identity::check(cx, expr, recv, map_call_span, map_arg, call_span, arg, "any"); . }, 5 ( 0.00%) Some((sym::iter, iter_recv, ..)) => { 25 ( 0.00%) manual_contains::check(cx, expr, iter_recv, arg); 276,913 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/manual_contains.rs:clippy_lints::methods::manual_contains::check (5x) 5 ( 0.00%) }, . _ => {}, . } . }, . (sym::arg, [arg]) => { . suspicious_command_arg_space::check(cx, recv, arg, span); . }, 70,632 ( 0.00%) (sym::as_deref | sym::as_deref_mut, []) => { . needless_option_as_deref::check(cx, expr, recv, name); . }, . (sym::as_bytes, []) => { 14 ( 0.00%) if let Some((sym::as_str, recv, [], as_str_span, _)) = method_call(recv) { 40 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (2x) . redundant_as_str::check(cx, expr, recv, as_str_span, span); . } 6 ( 0.00%) sliced_string_as_bytes::check(cx, expr, recv); 306,808 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/sliced_string_as_bytes.rs:clippy_lints::methods::sliced_string_as_bytes::check (2x) . }, 66 ( 0.00%) (sym::as_mut | sym::as_ref, []) => useless_asref::check(cx, expr, name, recv), 21,830 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/useless_asref.rs:clippy_lints::methods::useless_asref::check (22x) . (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), 52 ( 0.00%) (sym::bytes, []) => unbuffered_bytes::check(cx, expr, recv), 5,280 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/unbuffered_bytes.rs:clippy_lints::methods::unbuffered_bytes::check (26x) . (sym::cloned, []) => { 243 ( 0.00%) cloned_instead_of_copied::check(cx, expr, recv, span, self.msrv); 819,232 ( 0.01%) => /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 (27x) 140 ( 0.00%) if let Some((method @ (sym::as_ref | sym::as_mut), as_ref_recv, [], as_ref_ident_span, _)) = 108 ( 0.00%) method_call(recv) 2,862 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (27x) . { . option_as_ref_cloned::check(cx, span, method, as_ref_recv, as_ref_ident_span); . } . }, 350 ( 0.00%) (sym::collect, []) if cx.ty_based_def(expr).opt_parent(cx).is_diag_item(cx, sym::Iterator) => { 2,900 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/res.rs: as clippy_utils::res::MaybeDef>::opt_parent:: (25x) 225 ( 0.00%) needless_collect::check(cx, span, expr, recv, call_span); 1,089,155 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/needless_collect.rs:clippy_lints::methods::needless_collect::check (25x) 125 ( 0.00%) match method_call(recv) { 2,969 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (25x) 111 ( 0.00%) Some((name @ (sym::cloned | sym::copied), recv2, [], _, _)) => { 24 ( 0.00%) iter_cloned_collect::check(cx, name, expr, recv2); 1,762 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/iter_cloned_collect.rs:clippy_lints::methods::iter_cloned_collect::check (8x) . }, 80 ( 0.00%) Some((sym::map, m_recv, [m_arg], m_ident_span, _)) => { 40 ( 0.00%) map_collect_result_unit::check(cx, expr, m_recv, m_arg); 1,372 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/map_collect_result_unit.rs:clippy_lints::methods::map_collect_result_unit::check (10x) 50 ( 0.00%) format_collect::check(cx, expr, m_arg, m_ident_span); 1,160 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/format_collect.rs:clippy_lints::methods::format_collect::check (10x) . }, . Some((sym::take, take_self_arg, [take_arg], _, _)) => { . if self.msrv.meets(cx, msrvs::STR_REPEAT) { . manual_str_repeat::check(cx, expr, recv, take_self_arg, take_arg); . } . }, 30 ( 0.00%) Some((sym::drain, recv, args, ..)) => match args { . [arg] => drain_collect::check(cx, Some(arg), expr, recv), . [] => drain_collect::check(cx, None, expr, recv), . _ => {}, . }, . _ => {}, . } . }, 70 ( 0.00%) (sym::count, []) if cx.ty_based_def(expr).opt_parent(cx).is_diag_item(cx, sym::Iterator) => { 580 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/res.rs: as clippy_utils::res::MaybeDef>::opt_parent:: (5x) 25 ( 0.00%) match method_call(recv) { 903 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (5x) 35 ( 0.00%) Some((sym::cloned, recv2, [], _, _)) => { . iter_overeager_cloned::check( . cx, . expr, . recv, . recv2, . iter_overeager_cloned::Op::RmCloned, . false, . ); . }, 5 ( 0.00%) Some((name2 @ (sym::into_iter | sym::iter | sym::iter_mut), recv2, [], _, _)) => { . iter_count::check(cx, expr, recv2, name2); . }, 20 ( 0.00%) Some((sym::map, _, [arg], _, _)) => suspicious_map::check(cx, expr, recv, arg), 20 ( 0.00%) Some((sym::filter, recv2, [arg], _, _)) => bytecount::check(cx, expr, recv2, arg), 749 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/bytecount.rs:clippy_lints::methods::bytecount::check (4x) . Some((sym::bytes, recv2, [], _, _)) => bytes_count_to_len::check(cx, expr, recv, recv2), . _ => {}, . } . }, . (sym::min | sym::max, [arg]) => { 20 ( 0.00%) unnecessary_min_or_max::check(cx, expr, name, recv, arg); 4,726 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/unnecessary_min_or_max.rs:clippy_lints::methods::unnecessary_min_or_max::check (5x) . }, 8,940 ( 0.00%) (sym::drain, ..) => { 36 ( 0.00%) if let Node::Stmt(Stmt { hir_id: _, kind, .. }) = cx.tcx.parent_hir_node(expr.hir_id) 460 ( 0.00%) => ???:::parent_hir_node (4x) 3 ( 0.00%) && matches!(kind, StmtKind::Semi(_)) . && args.len() <= 1 . { 5 ( 0.00%) clear_with_drain::check(cx, expr, recv, span, args.first()); 694 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/clear_with_drain.rs:clippy_lints::methods::clear_with_drain::check (1x) 3 ( 0.00%) } else if let [arg] = args { 9 ( 0.00%) iter_with_drain::check(cx, expr, recv, span, arg); 218 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/iter_with_drain.rs:clippy_lints::methods::iter_with_drain::check (3x) . } . }, . (sym::ends_with, [arg]) => { . if let ExprKind::MethodCall(.., span) = expr.kind { 11 ( 0.00%) case_sensitive_file_extension_comparisons::check(cx, expr, span, recv, arg, self.msrv); 2,666 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/case_sensitive_file_extension_comparisons.rs:clippy_lints::methods::case_sensitive_file_extension_comparisons::check (1x) . } 7 ( 0.00%) path_ends_with_ext::check(cx, recv, arg, expr, self.msrv, &self.allowed_dotfiles); 75 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/path_ends_with_ext.rs:clippy_lints::methods::path_ends_with_ext::check (1x) . }, . (sym::expect, [_]) => { . match method_call(recv) { 224 ( 0.00%) Some((sym::ok, recv_inner, [], _, _)) => ok_expect::check(cx, expr, recv, recv_inner), . Some((sym::err, recv, [], err_span, _)) => { . err_expect::check(cx, expr, recv, span, err_span, self.msrv); . }, . _ => {}, . } 405 ( 0.00%) unnecessary_literal_unwrap::check(cx, expr, recv, name, args); . }, . (sym::unwrap_unchecked, []) => { . unnecessary_unwrap_unchecked::check(cx, expr, recv, call_span); . unnecessary_literal_unwrap::check(cx, expr, recv, name, args); . }, . (sym::expect_err, [_]) | (sym::unwrap_err | sym::unwrap_err_unchecked, []) => { . unnecessary_literal_unwrap::check(cx, expr, recv, name, args); . }, . (sym::extend, [arg]) => { 4,088 ( 0.00%) string_extend_chars::check(cx, expr, recv, arg); 39,370 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/string_extend_chars.rs:clippy_lints::methods::string_extend_chars::check (511x) 2,555 ( 0.00%) extend_with_drain::check(cx, expr, recv, arg); 41,034 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/extend_with_drain.rs:clippy_lints::methods::extend_with_drain::check (511x) . }, . (sym::filter, [arg]) => { 148 ( 0.00%) if let Some((sym::cloned, recv2, [], _span2, _)) = method_call(recv) { 1,566 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (16x) . // if `arg` has side-effect, the semantic will change 10 ( 0.00%) iter_overeager_cloned::check( 52,959 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/iter_overeager_cloned.rs:clippy_lints::methods::iter_overeager_cloned::check (2x) . cx, . expr, . recv, . recv2, 8 ( 0.00%) iter_overeager_cloned::Op::FixClosure(name, arg), . false, . ); . } 112 ( 0.00%) if self.msrv.meets(cx, msrvs::ITER_FLATTEN) { 432 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (16x) . // use the sourcemap to get the span of the closure 80 ( 0.00%) iter_filter::check(cx, expr, arg, span); 472,559 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/iter_filter.rs:clippy_lints::methods::iter_filter::check (16x) . } 96 ( 0.00%) some_filter::check(cx, expr, recv, arg, self.msrv); 448 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/some_filter.rs:clippy_lints::methods::some_filter::check (16x) . }, . (sym::find, [arg]) => { 42 ( 0.00%) if let Some((sym::cloned, recv2, [], _span2, _)) = method_call(recv) { 534 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (6x) . // if `arg` has side-effect, the semantic will change . iter_overeager_cloned::check( . cx, . expr, . recv, . recv2, . iter_overeager_cloned::Op::FixClosure(name, arg), . false, . ); . } . }, . (sym::filter_map, [arg]) => { 27 ( 0.00%) unnecessary_filter_map::check(cx, expr, arg, call_span, unnecessary_filter_map::Kind::FilterMap); 240,999 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/unnecessary_filter_map.rs:clippy_lints::methods::unnecessary_filter_map::check (3x) 15 ( 0.00%) filter_map_bool_then::check(cx, expr, arg, call_span); 983,898 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/filter_map_bool_then.rs:clippy_lints::methods::filter_map_bool_then::check (3x) 18 ( 0.00%) filter_map_identity::check(cx, expr, arg, span); 2,531 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/filter_map_identity.rs:clippy_lints::methods::filter_map_identity::check (3x) 33 ( 0.00%) lines_filter_map_ok::check_filter_or_flat_map( 1,426 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/lines_filter_map_ok.rs:clippy_lints::methods::lines_filter_map_ok::check_filter_or_flat_map (3x) . cx, . expr, . recv, . "filter_map", . arg, . call_span, 3 ( 0.00%) self.msrv, . ); 28 ( 0.00%) if let Some((map_name @ (sym::iter | sym::into_iter), recv2, _, _, _)) = method_call(recv) { 267 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (3x) 6 ( 0.00%) iter_kv_map::check(cx, map_name, expr, recv2, arg, self.msrv, sym::filter_map); . } . }, . (sym::find_map, [arg]) => { . unnecessary_filter_map::check(cx, expr, arg, call_span, unnecessary_filter_map::Kind::FindMap); . }, . (sym::flat_map, [arg]) => { 28 ( 0.00%) flat_map_identity::check(cx, expr, arg, span); 2,224 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/flat_map_identity.rs:clippy_lints::methods::flat_map_identity::check (4x) 24 ( 0.00%) flat_map_option::check(cx, expr, arg, span); 2,186 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/flat_map_option.rs:clippy_lints::methods::flat_map_option::check (4x) 48 ( 0.00%) lines_filter_map_ok::check_filter_or_flat_map( 1,929 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/lines_filter_map_ok.rs:clippy_lints::methods::lines_filter_map_ok::check_filter_or_flat_map (4x) 4 ( 0.00%) cx, expr, recv, "flat_map", arg, call_span, self.msrv, . ); 27 ( 0.00%) if let Some((map_name @ (sym::iter | sym::into_iter), recv2, _, _, _)) = method_call(recv) { 356 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (4x) 3 ( 0.00%) iter_kv_map::check(cx, map_name, expr, recv2, arg, self.msrv, sym::flat_map); . } . }, . (sym::flatten, []) => { 10 ( 0.00%) match method_call(recv) { 103 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (1x) . Some((sym::map, recv, [map_arg], map_span, _)) => { . map_flatten::check(cx, expr, recv, map_arg, map_span); . }, . Some((sym::cloned, recv2, [], _, _)) => iter_overeager_cloned::check( . cx, . expr, . recv, . recv2, . iter_overeager_cloned::Op::LaterCloned, . true, . ), . _ => {}, . } 4 ( 0.00%) lines_filter_map_ok::check_flatten(cx, expr, recv, call_span, self.msrv); 501 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/lines_filter_map_ok.rs:clippy_lints::methods::lines_filter_map_ok::check_flatten (1x) . }, 6 ( 0.00%) (sym::fold, [init, acc]) => { 18 ( 0.00%) manual_try_fold::check(cx, expr, init, acc, call_span, self.msrv); 72,712 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/manual_try_fold.rs:clippy_lints::methods::manual_try_fold::check (2x) 12 ( 0.00%) unnecessary_fold::check(cx, expr, init, acc, span); 1,969 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/unnecessary_fold.rs:clippy_lints::methods::unnecessary_fold::check (2x) . }, 7 ( 0.00%) (sym::for_each, [arg]) => match method_call(recv) { 133 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (1x) . Some((sym::inspect, _, [_], span2, _)) => inspect_for_each::check(cx, expr, span2), . Some((sym::cloned, recv2, [], _, _)) => iter_overeager_cloned::check( . cx, . expr, . recv, . recv2, . iter_overeager_cloned::Op::NeedlessMove(arg), . false, . ), . _ => {}, . }, . (sym::get, [arg]) => { 440 ( 0.00%) get_first::check(cx, expr, recv, arg); 324,344 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/get_first.rs:clippy_lints::methods::get_first::check (55x) 275 ( 0.00%) get_last_with_len::check(cx, expr, recv, arg); 937 ( 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 (55x) . }, . (sym::get_or_insert_with, [arg]) => { . unnecessary_lazy_eval::check(cx, expr, recv, arg, "get_or_insert", false); . }, . (sym::hash, [arg]) => { 4 ( 0.00%) unit_hash::check(cx, expr, recv, arg); 1,408 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/unit_hash.rs:clippy_lints::methods::unit_hash::check (4x) . }, . (sym::is_empty, []) => { 345 ( 0.00%) match method_call(recv) { 1,049 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (49x) 6 ( 0.00%) 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); . }, . _ => {}, . } 196 ( 0.00%) is_empty::check(cx, expr, recv); 75,925 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/is_empty.rs:clippy_lints::methods::is_empty::check (49x) . }, . (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), 210 ( 0.00%) (sym::is_none, []) => check_is_some_is_none(cx, expr, recv, call_span, false, self.msrv), 1,344 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::check_is_some_is_none (30x) 350 ( 0.00%) (sym::is_some, []) => check_is_some_is_none(cx, expr, recv, call_span, true, self.msrv), 2,408 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::check_is_some_is_none (40x) . (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, []) => { 918 ( 0.00%) iter_on_single_or_empty_collections::check(cx, expr, name, recv); 13,359 ( 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 (224x) . }, . (sym::join, [join_arg]) => { 8 ( 0.00%) if let Some((sym::collect, _, _, span, _)) = method_call(recv) { 40 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (2x) . unnecessary_join::check(cx, expr, recv, join_arg, span); . } else { 10 ( 0.00%) join_absolute_paths::check(cx, recv, join_arg, expr.span); 190 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/join_absolute_paths.rs:clippy_lints::methods::join_absolute_paths::check (2x) . } . }, . (sym::last, []) => { 63 ( 0.00%) if let Some((sym::cloned, recv2, [], _span2, _)) = method_call(recv) { 180 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (9x) . iter_overeager_cloned::check( . cx, . expr, . recv, . recv2, . iter_overeager_cloned::Op::LaterCloned, . false, . ); . } 27 ( 0.00%) double_ended_iterator_last::check(cx, expr, recv, call_span); 2,754 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/double_ended_iterator_last.rs:clippy_lints::methods::double_ended_iterator_last::check (9x) . }, . (sym::len, []) => { 2,860 ( 0.00%) if let Some((prev_method @ (sym::as_bytes | sym::bytes), prev_recv, [], _, _)) = method_call(recv) { 16,274 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (691x) . 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 { 952 ( 0.00%) map_clone::check(cx, expr, recv, m_arg, self.msrv); 66,682 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/map_clone.rs:clippy_lints::methods::map_clone::check (119x) 952 ( 0.00%) map_with_unused_argument_over_ranges::check(cx, expr, recv, m_arg, self.msrv, span); 8,644 ( 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 (119x) 595 ( 0.00%) manual_is_variant_and::check_map(cx, expr, self.msrv); 17,364 ( 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 (119x) 1,005 ( 0.00%) match method_call(recv) { 10,846 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (119x) 30 ( 0.00%) Some((map_name @ (sym::iter | sym::into_iter), recv2, _, _, _)) => { 180 ( 0.00%) iter_kv_map::check(cx, map_name, expr, recv2, m_arg, self.msrv, sym::map); 4,035 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/iter_kv_map.rs:clippy_lints::methods::iter_kv_map::check (30x) . }, . Some((sym::cloned, recv2, [], _, _)) => iter_overeager_cloned::check( . cx, . expr, . recv, . recv2, . iter_overeager_cloned::Op::NeedlessMove(m_arg), . false, . ), . _ => {}, . } . } else { 50 ( 0.00%) map_err_ignore::check(cx, expr, m_arg); 15,683 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/map_err_ignore.rs:clippy_lints::methods::map_err_ignore::check (10x) . } 847 ( 0.00%) if let Some((name, recv2, args, span2, _)) = method_call(recv) { 11,696 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (129x) . match (name, args) { 590 ( 0.00%) (sym::as_mut, []) => option_as_ref_deref::check(cx, expr, recv2, m_arg, true, self.msrv), 8 ( 0.00%) (sym::as_ref, []) => option_as_ref_deref::check(cx, expr, recv2, m_arg, false, self.msrv), 298 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/option_as_ref_deref.rs:clippy_lints::methods::option_as_ref_deref::check (1x) 14 ( 0.00%) (sym::filter, [f_arg]) => { 28 ( 0.00%) filter_map::check(cx, expr, recv2, f_arg, span2, recv, m_arg, span, false); . }, 4 ( 0.00%) (sym::find, [f_arg]) => { 5 ( 0.00%) filter_map::check(cx, expr, recv2, f_arg, span2, recv, m_arg, span, true); . }, . _ => {}, . } . } 1,032 ( 0.00%) map_identity::check(cx, expr, recv, m_arg, name, span); 75,932 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/map_identity.rs:clippy_lints::methods::map_identity::check (129x) 903 ( 0.00%) manual_inspect::check(cx, expr, m_arg, name, span, self.msrv); 142,055 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/manual_inspect.rs:clippy_lints::methods::manual_inspect::check (129x) . }, 9 ( 0.00%) (sym::map_or, [def, map]) => { 24 ( 0.00%) option_map_or_none::check(cx, expr, recv, def, map); 1,086 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/option_map_or_none.rs:clippy_lints::methods::option_map_or_none::check (3x) 21 ( 0.00%) manual_ok_or::check(cx, expr, recv, def, map); 2,023 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/manual_ok_or.rs:clippy_lints::methods::manual_ok_or::check (3x) 27 ( 0.00%) unnecessary_map_or::check(cx, expr, recv, def, map, span, self.msrv); 465,233 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/unnecessary_map_or.rs:clippy_lints::methods::unnecessary_map_or::check (3x) . }, . (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); 5 ( 0.00%) }, . (sym::next, []) => { 92 ( 0.00%) if let Some((name2, recv2, args2, _, _)) = method_call(recv) { 578 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (22x) . match (name2, args2) { 16 ( 0.00%) (sym::cloned, []) => iter_overeager_cloned::check( . cx, . expr, . recv, . recv2, . iter_overeager_cloned::Op::LaterCloned, . false, . ), . (sym::filter, [arg]) => { . filter_next::check(cx, expr, recv2, arg, filter_next::Direction::Forward); . }, . (sym::filter_map, [arg]) => filter_map_next::check(cx, expr, recv2, arg, self.msrv), 14 ( 0.00%) (sym::iter | sym::iter_mut, []) => iter_next_slice::check(cx, expr, recv2, name2), . (sym::skip, [arg]) => iter_skip_next::check(cx, expr, recv2, arg), . (sym::skip_while, [_]) => skip_while_next::check(cx, expr), . (sym::rev, []) => manual_next_back::check(cx, expr, recv, recv2), . _ => {}, . } . } . }, . (sym::next_back, []) => { . if let Some((name2, recv2, args2, _, _)) = method_call(recv) . && let (sym::filter, [arg]) = (name2, args2) . && self.msrv.meets(cx, msrvs::DOUBLE_ENDED_ITERATOR_RFIND) . { . filter_next::check(cx, expr, recv2, arg, filter_next::Direction::Backward); . } . }, 11 ( 0.00%) (sym::nth, [n_arg]) => match method_call(recv) { 168 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (1x) 1 ( 0.00%) Some((sym::bytes, recv2, [], _, _)) => bytes_nth::check(cx, expr, recv2, n_arg), . Some((sym::cloned, recv2, [], _, _)) => iter_overeager_cloned::check( . cx, . expr, . recv, . recv2, . iter_overeager_cloned::Op::LaterCloned, . false, . ), 1 ( 0.00%) Some((iter_method @ (sym::iter | sym::iter_mut), iter_recv, [], iter_span, _)) => { . if !iter_nth::check(cx, expr, iter_recv, iter_method, iter_span, span) { . iter_nth_zero::check(cx, expr, recv, n_arg); . } . }, . _ => iter_nth_zero::check(cx, expr, recv, n_arg), . }, . (sym::offset | sym::wrapping_offset, [arg]) => { 21 ( 0.00%) zst_offset::check(cx, expr, recv); 325 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/zst_offset.rs:clippy_lints::methods::zst_offset::check (3x) . 24 ( 0.00%) ptr_offset_with_cast::check(cx, name, expr, recv, arg, self.msrv); 360 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/ptr_offset_with_cast.rs:clippy_lints::methods::ptr_offset_with_cast::check (3x) 15 ( 0.00%) ptr_offset_by_literal::check(cx, expr, self.msrv); 375 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/ptr_offset_by_literal.rs:clippy_lints::methods::ptr_offset_by_literal::check (3x) . }, . (sym::ok_or_else, [arg]) => { 7 ( 0.00%) unnecessary_lazy_eval::check(cx, expr, recv, arg, "ok_or", true); . }, . (sym::open, [_]) => { . open_options::check(cx, expr, recv); . }, . (sym::or_else, [arg]) => { 6 ( 0.00%) if !bind_instead_of_map::check_or_else_err(cx, expr, recv, arg) { 4 ( 0.00%) unnecessary_lazy_eval::check(cx, expr, recv, arg, "or", false); . } . }, . (sym::peek, []) => { 4 ( 0.00%) by_ref_peekable_peek::check(cx, expr, recv); 6 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/by_ref_peekable_peek.rs:clippy_lints::methods::by_ref_peekable_peek::check (2x) . }, . (sym::push, [arg]) => { 430 ( 0.00%) path_buf_push_overwrite::check(cx, expr, arg); 130,015 ( 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 (215x) . }, . (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 5729 ---------------------------------------- . // Check for repeated `str::replace` calls to perform `collapsible_str_replace` lint . if self.msrv.meets(cx, msrvs::PATTERN_TRAIT_CHAR_ARRAY) . && name == sym::replace . && let Some((sym::replace, ..)) = method_call(recv) . { . collapsible_str_replace::check(cx, expr, arg1, arg2); . } . }, 27 ( 0.00%) (sym::resize, [count_arg, default_arg]) => { 18 ( 0.00%) vec_resize_to_zero::check(cx, expr, count_arg, default_arg, span); 7,967 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/vec_resize_to_zero.rs:clippy_lints::methods::vec_resize_to_zero::check (9x) . }, . (sym::seek, [arg]) => { . if self.msrv.meets(cx, msrvs::SEEK_FROM_CURRENT) { . seek_from_current::check(cx, expr, recv, arg); . } . if self.msrv.meets(cx, msrvs::SEEK_REWIND) { . seek_to_start_instead_of_rewind::check(cx, expr, recv, arg, span); . } . }, . (sym::skip, [arg]) => { 6 ( 0.00%) iter_skip_zero::check(cx, expr, arg); 596 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/iter_skip_zero.rs:clippy_lints::methods::iter_skip_zero::check (1x) . iter_out_of_bounds::check_skip(cx, expr, recv, arg); . . if let Some((sym::cloned, recv2, [], _span2, _)) = method_call(recv) { . iter_overeager_cloned::check( . cx, . expr, . recv, . recv2, -- line 5757 ---------------------------------------- -- line 5766 ---------------------------------------- . (sym::sort_by, [arg]) => { . unnecessary_sort_by::check(cx, expr, call_span, arg, false); . }, . (sym::sort_unstable_by, [arg]) => { . unnecessary_sort_by::check(cx, expr, call_span, arg, true); . }, . (sym::split, [arg]) => { . str_split::check(cx, expr, recv, call_span, arg); 48 ( 0.00%) }, 5,014 ( 0.00%) (sym::splitn | sym::rsplitn, [count_arg, pat_arg]) => { . if let Some(Constant::Int(count)) = ConstEvalCtxt::new(cx).eval(count_arg) { . suspicious_splitn::check(cx, name, expr, recv, count); . 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); . } . }, 44,336 ( 0.00%) (sym::step_by, [arg]) => iterator_step_by_zero::check(cx, expr, arg), 539 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/iterator_step_by_zero.rs:clippy_lints::methods::iterator_step_by_zero::check (1x) 10 ( 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, . ); . } . }, 40 ( 0.00%) (sym::take, []) => needless_option_take::check(cx, expr, recv), 270 ( 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 (10x) 2 ( 0.00%) (sym::then, [arg]) => { 18 ( 0.00%) if !self.msrv.meets(cx, msrvs::BOOL_THEN_SOME) { 54 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (2x) . return; . } 10 ( 0.00%) unnecessary_lazy_eval::check(cx, expr, recv, arg, "then_some", true); 4 ( 0.00%) }, 400 ( 0.00%) (sym::try_into, []) if cx.ty_based_def(expr).opt_parent(cx).is_diag_item(cx, sym::TryInto) => { 2,900 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/res.rs: as clippy_utils::res::MaybeDef>::opt_parent:: (25x) 50 ( 0.00%) unnecessary_fallible_conversions::check_method(cx, expr); 484,287 ( 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_method (25x) . }, 2 ( 0.00%) (sym::to_owned, []) => { 4 ( 0.00%) if !suspicious_to_owned::check(cx, expr, span) { 450 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/suspicious_to_owned.rs:clippy_lints::methods::suspicious_to_owned::check (1x) 138 ( 0.00%) implicit_clone::check(cx, name, expr, recv); . } . }, 51,078 ( 0.00%) (sym::to_os_string | sym::to_path_buf | sym::to_string | sym::to_vec, []) => { 127 ( 0.00%) implicit_clone::check(cx, name, expr, recv); . }, . (sym::type_id, []) => { . type_id_on_box::check(cx, recv, expr.span); . }, . (sym::unwrap, []) => { 3,528 ( 0.00%) match method_call(recv) { 21,176 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (298x) 64 ( 0.00%) Some((sym::get, recv, [get_arg], _, _)) => { 32 ( 0.00%) get_unwrap::check(cx, expr, recv, get_arg, false); 8,853 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/get_unwrap.rs:clippy_lints::methods::get_unwrap::check (8x) . }, 6 ( 0.00%) Some((sym::get_mut, recv, [get_arg], _, _)) => { 4 ( 0.00%) get_unwrap::check(cx, expr, recv, get_arg, true); 201 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/get_unwrap.rs:clippy_lints::methods::get_unwrap::check (1x) 9 ( 0.00%) }, . Some((sym::or, recv, [or_arg], or_span, _)) => { . or_then_unwrap::check(cx, expr, recv, or_arg, or_span); . }, . _ => {}, . } 2,086 ( 0.00%) unnecessary_literal_unwrap::check(cx, expr, recv, name, args); 361,785 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/unnecessary_literal_unwrap.rs:clippy_lints::methods::unnecessary_literal_unwrap::check (298x) . }, 18,247 ( 0.00%) (sym::unwrap_or, [u_arg]) => { 70 ( 0.00%) match method_call(recv) { 1,372 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (14x) 84 ( 0.00%) 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); . }, 8 ( 0.00%) Some((sym::map, m_recv, [m_arg], span, _)) => { 32 ( 0.00%) map_unwrap_or::check(cx, expr, m_recv, m_arg, recv, u_arg, span, self.msrv); 22,042 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/map_unwrap_or.rs:clippy_lints::methods::map_unwrap_or::check (4x) . }, . Some((then_method @ (sym::then | sym::then_some), t_recv, [t_arg], _, _)) => { . obfuscated_if_else::check( . cx, . expr, . t_recv, . t_arg, . then_method, . obfuscated_if_else::Unwrap::Or(u_arg), . ); . }, . _ => {}, . } 84 ( 0.00%) unnecessary_literal_unwrap::check(cx, expr, recv, name, args); . }, . (sym::unwrap_or_default, []) => { 24 ( 0.00%) match method_call(recv) { 109 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (2x) . Some((sym::checked_sub, lhs, [rhs], _, _)) => { . manual_saturating_arithmetic::check_sub_unwrap_or_default(cx, expr, lhs, rhs); . }, . Some((sym::map, m_recv, [arg], span, _)) => { . manual_is_variant_and::check_map_unwrap_or_default(cx, expr, m_recv, arg, span, self.msrv); . }, 1 ( 0.00%) Some((then_method @ (sym::then | sym::then_some), t_recv, [t_arg], _, _)) => { . obfuscated_if_else::check( . cx, . expr, . t_recv, . t_arg, . then_method, . obfuscated_if_else::Unwrap::OrDefault, . ); . }, . _ => {}, . } 541 ( 0.00%) unnecessary_literal_unwrap::check(cx, expr, recv, name, args); . }, 11 ( 0.00%) (sym::unwrap_or_else, [u_arg]) => { 77 ( 0.00%) match method_call(recv) { 1,219 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:clippy_lints::methods::method_call (11x) 63 ( 0.00%) Some((sym::map, recv, [map_arg], _, _)) . if map_unwrap_or_else::check(cx, expr, recv, map_arg, u_arg, self.msrv) => {}, 18 ( 0.00%) Some((then_method @ (sym::then | sym::then_some), t_recv, [t_arg], _, _)) => { . obfuscated_if_else::check( . cx, . expr, . t_recv, . t_arg, . then_method, . obfuscated_if_else::Unwrap::OrElse(u_arg), . ); . }, . _ => { 88 ( 0.00%) unnecessary_lazy_eval::check(cx, expr, recv, u_arg, "unwrap_or", false); 169,894 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/unnecessary_lazy_eval.rs:clippy_lints::methods::unnecessary_lazy_eval::check (11x) . }, . } 66 ( 0.00%) 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); . }, 14,520 ( 0.00%) (sym::zip, [arg]) => { 824 ( 0.00%) if let ExprKind::MethodCall(name, iter_recv, [], _) = recv.kind 33 ( 0.00%) && name.ident.name == sym::iter . { 31 ( 0.00%) range_zip_with_len::check(cx, expr, iter_recv, arg); 11,098 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/range_zip_with_len.rs:clippy_lints::methods::range_zip_with_len::check (31x) . } . }, . _ => {}, . } . } . // Handle method calls whose receiver and arguments may come from expansion . if let ExprKind::MethodCall(path, recv, args, call_span) = expr.kind { 11,659 ( 0.00%) let method_span = path.ident.span; . . // Those methods do their own method name checking as they deal with multiple methods. 174,885 ( 0.00%) or_fun_call::check(cx, expr, method_span, path.ident.name, recv, args, self.msrv); 849,733 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/or_fun_call.rs:clippy_lints::methods::or_fun_call::check (11,659x) 104,931 ( 0.00%) unnecessary_to_owned::check(cx, expr, path.ident.name, recv, args, self.msrv); 5,544,960 ( 0.05%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/unnecessary_to_owned.rs:clippy_lints::methods::unnecessary_to_owned::check (11,659x) . 11,659 ( 0.00%) match (path.ident.name, args) { 113,802 ( 0.00%) (sym::clone, []) => { 4,992 ( 0.00%) clone_on_ref_ptr::check(cx, expr, recv); 117,659 ( 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 (832x) 4,160 ( 0.00%) clone_on_copy::check(cx, expr, recv); 2,282,086 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/clone_on_copy.rs:clippy_lints::methods::clone_on_copy::check (832x) . }, 162 ( 0.00%) (sym::expect, [arg]) => { 891 ( 0.00%) unwrap_expect_used::check( 259,088 ( 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 (81x) . cx, . expr, . recv, . false, 81 ( 0.00%) self.allow_expect_in_consts, 81 ( 0.00%) self.allow_expect_in_tests, 81 ( 0.00%) &self.unwrap_allowed_ids, . &self.unwrap_allowed_aliases, . unwrap_expect_used::Variant::Expect, . ); 648 ( 0.00%) expect_fun_call::check(cx, &self.format_args, expr, method_span, recv, arg); 6,237 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/expect_fun_call.rs:clippy_lints::methods::expect_fun_call::check (81x) . }, . (sym::expect_err, [_]) => { . unwrap_expect_used::check( . cx, . expr, . recv, . true, . self.allow_expect_in_consts, . self.allow_expect_in_tests, . &self.unwrap_allowed_ids, . &self.unwrap_allowed_aliases, . unwrap_expect_used::Variant::Expect, . ); . }, . (sym::insert_str | sym::push_str, _) => { 1 ( 0.00%) single_char_add_str::check(cx, expr, recv, args); 220 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/single_char_add_str.rs:clippy_lints::methods::single_char_add_str::check (1x) . }, 46 ( 0.00%) (sym::into_iter, []) => { 23 ( 0.00%) into_iter_on_ref::check(cx, expr, method_span, recv); 528,462 ( 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 (23x) . }, 9 ( 0.00%) (sym::map_or, [def, map]) => { 3 ( 0.00%) map_or_identity::check(cx, expr, recv, call_span, def, map); 1,257 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/map_or_identity.rs:clippy_lints::methods::map_or_identity::check (3x) 84 ( 0.00%) }, . 386 ( 0.00%) (sym::to_string, []) => { 121 ( 0.00%) inefficient_to_string::check(cx, expr, recv, self.msrv); 37,910 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/inefficient_to_string.rs:clippy_lints::methods::inefficient_to_string::check (121x) . }, 12 ( 0.00%) (sym::truncate, [arg]) => { 5 ( 0.00%) manual_clear::check(cx, expr, recv, arg, method_span); 994 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/manual_clear.rs:clippy_lints::methods::manual_clear::check (5x) 6 ( 0.00%) }, 616 ( 0.00%) (sym::unwrap, []) => { 2,464 ( 0.00%) unwrap_expect_used::check( . cx, . expr, . recv, . false, 308 ( 0.00%) self.allow_unwrap_in_consts, 308 ( 0.00%) self.allow_unwrap_in_tests, 308 ( 0.00%) &self.unwrap_allowed_ids, . &self.unwrap_allowed_aliases, . unwrap_expect_used::Variant::Unwrap, . ); . }, . (sym::unwrap_err, []) => { . unwrap_expect_used::check( . cx, . expr, -- line 5989 ---------------------------------------- -- line 5994 ---------------------------------------- . &self.unwrap_allowed_ids, . &self.unwrap_allowed_aliases, . unwrap_expect_used::Variant::Unwrap, . ); . }, . _ => {}, . } . } 93,272 ( 0.00%) } . } . 910 ( 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) { 163 ( 0.00%) Some((name @ (sym::find | sym::position | sym::rposition), f_recv, [arg], span, _)) => { . search_is_some::check(cx, expr, name, is_some, f_recv, arg, recv, span); . }, . Some((sym::get, f_recv, [arg], _, _)) => { . unnecessary_get_then_check::check(cx, call_span, recv, f_recv, arg, is_some); . }, 60 ( 0.00%) 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); . }, . _ => {}, . } 560 ( 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) => { 16,320 ( 0.00%) if !$func($cx, $info) { . ::std::mem::swap(&mut $info.chain, &mut $info.other); 18,360 ( 0.00%) if $func($cx, $info) { 741,147 ( 0.01%) => /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 (2,040x) . 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 ---------------------------------------- 227,142 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_utils/src/sugg.rs -------------------------------------------------------------------------------- Ir -- line 39 ---------------------------------------- . /// Literal constant `0`, for convenience. . pub const ZERO: Sugg<'static> = Sugg::NonParen(Cow::Borrowed("0")); . /// Literal constant `1`, for convenience. . pub const ONE: Sugg<'static> = Sugg::NonParen(Cow::Borrowed("1")); . /// a constant represents an empty string, for convenience. . pub const EMPTY: Sugg<'static> = Sugg::NonParen(Cow::Borrowed("")); . . impl Display for Sugg<'_> { 4,095 ( 0.00%) fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { 2,730 ( 0.00%) match self { . Sugg::NonParen(s) | Sugg::MaybeParen(s) => s.fmt(f), . Sugg::BinOp(op, lhs, rhs) => binop_to_string(*op, lhs, rhs).fmt(f), . Sugg::UnOp(op, inner) => write!(f, "{}{}", op.as_str(), inner.clone().maybe_inner_paren()), . } . } . } . . #[expect(clippy::wrong_self_convention)] // ok, because of the function `as_ty` method . impl<'a> Sugg<'a> { . /// Prepare a suggestion from an expression. 100 ( 0.00%) pub fn hir_opt(cx: &LateContext<'_>, expr: &hir::Expr<'_>) -> Option { 10 ( 0.00%) let ctxt = expr.span.ctxt(); 10 ( 0.00%) let get_snippet = |span| snippet_with_context(cx, span, ctxt, "", &mut Applicability::Unspecified).0; . snippet_opt(cx, expr.span).map(|_| Self::hir_from_snippet(cx, expr, get_snippet)) 90 ( 0.00%) } . . /// Convenience function around `hir_opt` for suggestions with a default . /// text. . pub fn hir(cx: &LateContext<'_>, expr: &hir::Expr<'_>, default: &'a str) -> Self { . Self::hir_opt(cx, expr).unwrap_or(Sugg::NonParen(Cow::Borrowed(default))) . } . . /// Same as `hir`, but it adapts the applicability level by following rules: . /// . /// - Applicability level `Unspecified` will never be changed. . /// - If the span is inside a macro, change the applicability level to `MaybeIncorrect`. . /// - If the default value is used and the applicability level is `MachineApplicable`, change it . /// to `HasPlaceholders` 100 ( 0.00%) pub fn hir_with_applicability( . cx: &LateContext<'_>, . expr: &hir::Expr<'_>, . default: &'a str, . applicability: &mut Applicability, . ) -> Self { 30 ( 0.00%) if *applicability != Applicability::Unspecified && expr.span.from_expansion() { . *applicability = Applicability::MaybeIncorrect; . } 10 ( 0.00%) Self::hir_opt(cx, expr).unwrap_or_else(|| { 14,237 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/sugg.rs:::hir_opt (10x) . if *applicability == Applicability::MachineApplicable { . *applicability = Applicability::HasPlaceholders; . } . Sugg::NonParen(Cow::Borrowed(default)) . }) 80 ( 0.00%) } . . /// Same as `hir`, but first walks the span up to the given context. This will result in the . /// macro call, rather than the expansion, if the span is from a child context. If the span is . /// not from a child context, it will be used directly instead. . /// . /// e.g. Given the expression `&vec![]`, getting a snippet from the span for `vec![]` as a HIR . /// node would result in `box []`. If given the context of the address of expression, this . /// function will correctly get a snippet of `vec![]`. 7,392 ( 0.00%) pub fn hir_with_context( . cx: &LateContext<'_>, . expr: &hir::Expr<'_>, . ctxt: SyntaxContext, . default: &'a str, . applicability: &mut Applicability, . ) -> Self { 1,232 ( 0.00%) if expr.span.ctxt() == ctxt { 1,848 ( 0.00%) if let ExprKind::Unary(op, inner) = expr.kind . && matches!(op, UnOp::Neg | UnOp::Not) . && cx.typeck_results().expr_ty(expr) == cx.typeck_results().expr_ty(inner) . { . Sugg::UnOp( . op, . Box::new(Self::hir_with_context(cx, inner, ctxt, default, applicability)), . ) . } else { 4,312 ( 0.00%) Self::hir_from_snippet(cx, expr, |span| { 1,232 ( 0.00%) snippet_with_context(cx, span, ctxt, default, applicability).0 . }) . } . } else { . let (snip, _) = snippet_with_context(cx, expr.span, ctxt, default, applicability); . Sugg::NonParen(snip) . } 5,544 ( 0.00%) } . . /// Generate a suggestion for an expression with the given snippet. This is used by the `hir_*` . /// function variants of `Sugg`, since these use different snippet functions. . pub fn hir_from_snippet( . cx: &LateContext<'_>, . expr: &hir::Expr<'_>, . mut get_snippet: impl FnMut(Span) -> Cow<'a, str>, . ) -> Self { 3,766 ( 0.00%) if let Some(range) = higher::Range::hir(cx, expr) { 27,720 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (616x) . let op = AssocOp::Range(range.ty.limits()); . let start = range.start.map_or("".into(), |expr| get_snippet(expr.span)); . let end = range.end.map_or("".into(), |expr| get_snippet(expr.span)); . . return Sugg::BinOp(op, start, end); . } . 2,514 ( 0.00%) match expr.kind { . ExprKind::AddrOf(..) . | ExprKind::If(..) . | ExprKind::Let(..) . | ExprKind::Closure { .. } . | ExprKind::Unary(..) . | ExprKind::Match(_, _, . MatchSource::Normal | MatchSource::Postfix | MatchSource::ForLoopDesugar 16 ( 0.00%) ) => Sugg::MaybeParen(get_snippet(expr.span)), . ExprKind::Continue(..) . | ExprKind::Yield(..) . | ExprKind::Array(..) . | ExprKind::Block(..) . | ExprKind::Break(..) . | ExprKind::Call(..) . | ExprKind::Field(..) . | ExprKind::Index(..) -- line 159 ---------------------------------------- -- line 169 ---------------------------------------- . | ExprKind::Become(..) . | ExprKind::Struct(..) . | ExprKind::Tup(..) . | ExprKind::Use(..) . | ExprKind::Err(_) . | ExprKind::UnsafeBinderCast(..) . | ExprKind::Match(_, _, . MatchSource::AwaitDesugar | MatchSource::TryDesugar(_) | MatchSource::FormatArgs 3,110 ( 0.00%) ) => Sugg::NonParen(get_snippet(expr.span)), . ExprKind::DropTemps(inner) => Self::hir_from_snippet(cx, inner, get_snippet), . ExprKind::Assign(lhs, rhs, _) => { . Sugg::BinOp(AssocOp::Assign, get_snippet(lhs.span), get_snippet(rhs.span)) . }, . ExprKind::AssignOp(op, lhs, rhs) => { . Sugg::BinOp(AssocOp::AssignOp(op.node), get_snippet(lhs.span), get_snippet(rhs.span)) . }, . ExprKind::Binary(op, lhs, rhs) => Sugg::BinOp( -- line 185 ---------------------------------------- -- line 303 ---------------------------------------- . } . . /// Convenience method to create the `&mut ` suggestion. . pub fn mut_addr(self) -> Sugg<'static> { . make_unop("&mut ", self) . } . . /// Convenience method to create the `*` suggestion. 1,656 ( 0.00%) pub fn deref(self) -> Sugg<'static> { . make_unop("*", self) 920 ( 0.00%) } . . /// Convenience method to create the `&*` suggestion. Currently this . /// is needed because `sugg.deref().addr()` produces an unnecessary set of . /// parentheses around the deref. . pub fn addr_deref(self) -> Sugg<'static> { . make_unop("&*", self) . } . -- line 321 ---------------------------------------- -- line 353 ---------------------------------------- . pub fn range(self, end: &Self, limits: ast::RangeLimits) -> Sugg<'static> { . make_assoc(AssocOp::Range(limits), &self, end) . } . . /// Adds parentheses to any expression that might need them. Suitable to the . /// `self` argument of a method call . /// (e.g., to build `bar.foo()` or `(1 + 2).foo()`). . #[must_use] 1,935 ( 0.00%) pub fn maybe_paren(self) -> Self { 2,365 ( 0.00%) match self { 1,926 ( 0.00%) Sugg::NonParen(..) => self, . // `(x)` and `(x).y()` both don't need additional parens. 4 ( 0.00%) Sugg::MaybeParen(sugg) => { 4 ( 0.00%) if has_enclosing_paren(&sugg) { 11 ( 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::sugg::has_enclosing_paren::<&alloc::borrow::Cow> (1x) . Sugg::MaybeParen(sugg) . } else { 4 ( 0.00%) Sugg::NonParen(format!("({sugg})").into()) . } . }, . Sugg::BinOp(op, lhs, rhs) => { . let sugg = binop_to_string(op, &lhs, &rhs); . Sugg::NonParen(format!("({sugg})").into()) . }, . Sugg::UnOp(op, inner) => Sugg::NonParen(format!("({}{})", op.as_str(), inner.maybe_inner_paren()).into()), . } 1,937 ( 0.00%) } . . /// Strip enclosing parentheses if present. This method must be called when . /// it is known that removing those will not change the meaning. For example, . /// if `self` is known to represent a reference and the suggestion will be . /// used as the argument of a function call, it is safe to remove the enclosing . /// parentheses. It would not be safe to do so for an expression that might . /// represent a tuple. . #[must_use] . pub fn strip_paren(self) -> Self { . match self { . Sugg::NonParen(s) | Sugg::MaybeParen(s) => Sugg::NonParen(strip_enclosing_paren(s)), . sugg => sugg, . } . } . 2,920 ( 0.00%) pub fn into_string(self) -> String { 2,920 ( 0.00%) match self { 1,095 ( 0.00%) Sugg::NonParen(p) | Sugg::MaybeParen(p) => p.into_owned(), . Sugg::BinOp(b, l, r) => binop_to_string(b, &l, &r), . Sugg::UnOp(op, inner) => format!("{}{}", op.as_str(), inner.maybe_inner_paren()), . } 2,920 ( 0.00%) } . . /// Checks if `self` starts with a unary operator. . fn starts_with_unary_op(&self) -> bool { 1,104 ( 0.00%) match self { . Sugg::UnOp(..) => true, . Sugg::BinOp(..) => false, 184 ( 0.00%) Sugg::MaybeParen(s) | Sugg::NonParen(s) => s.starts_with(['*', '!', '-', '&']), . } . } . . /// Call `maybe_paren` on `self` if it doesn't start with a unary operator, . /// don't touch it otherwise. . fn maybe_inner_paren(self) -> Self { 396 ( 0.00%) if self.starts_with_unary_op() { 8 ( 0.00%) self . } else { 337 ( 0.00%) self.maybe_paren() 6,954 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/sugg.rs:::maybe_paren (183x) . } . } . } . . /// Generates a string from the operator and both sides. . fn binop_to_string(op: AssocOp, lhs: &str, rhs: &str) -> String { . match op { . AssocOp::Binary(op) => format!("{lhs} {} {rhs}", op.as_str()), -- line 425 ---------------------------------------- -- line 426 ---------------------------------------- . AssocOp::Assign => format!("{lhs} = {rhs}"), . AssocOp::AssignOp(op) => format!("{lhs} {} {rhs}", op.as_str()), . AssocOp::Cast => format!("{lhs} as {rhs}"), . AssocOp::Range(limits) => format!("{lhs}{}{rhs}", limits.as_str()), . } . } . . /// Returns `true` if `sugg` is enclosed in parenthesis. 15,784 ( 0.00%) pub fn has_enclosing_paren(sugg: impl AsRef) -> bool { 3,946 ( 0.00%) let mut chars = sugg.as_ref().chars(); 98,650 ( 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 (3,946x) 7,505 ( 0.00%) if chars.next() == Some('(') { . let mut depth = 1; . for c in &mut chars { 30,216 ( 0.00%) if c == '(' { 160 ( 0.00%) depth += 1; 553 ( 0.00%) } else if c == ')' { 553 ( 0.00%) depth -= 1; . } 15,188 ( 0.00%) if depth == 0 { . break; . } . } . chars.next().is_none() . } else { . false . } 19,733 ( 0.00%) } . . /// Strip enclosing parentheses from a snippet if present. . fn strip_enclosing_paren(snippet: Cow<'_, str>) -> Cow<'_, str> { . if has_enclosing_paren(&snippet) { . match snippet { . Cow::Borrowed(s) => Cow::Borrowed(&s[1..s.len() - 1]), . Cow::Owned(mut s) => { . s.pop(); -- line 460 ---------------------------------------- -- line 521 ---------------------------------------- . Self::BinOp(AssocOp::Cast, ..) => Sugg::MaybeParen(format!("-({self})").into()), . _ => make_unop("-", self), . } . } . } . . impl<'a> Not for Sugg<'a> { . type Output = Sugg<'a>; 126 ( 0.00%) fn not(self) -> Sugg<'a> { . use AssocOp::Binary; . use ast::BinOpKind::{Eq, Ge, Gt, Le, Lt, Ne}; . 140 ( 0.00%) match self { . Sugg::BinOp(op, lhs, rhs) => { . let to_op = match op { . Binary(Eq) => Binary(Ne), . Binary(Ne) => Binary(Eq), . Binary(Lt) => Binary(Ge), . Binary(Ge) => Binary(Lt), . Binary(Gt) => Binary(Le), . Binary(Le) => Binary(Gt), . _ => return make_unop("!", Sugg::BinOp(op, lhs, rhs)), . }; . Sugg::BinOp(to_op, lhs, rhs) . }, . Sugg::UnOp(UnOp::Not, expr) => *expr, 154 ( 0.00%) _ => make_unop("!", self), . } 112 ( 0.00%) } . } . . /// Helper type to display either `foo` or `(foo)`. . struct ParenHelper { . /// `true` if parentheses are needed. . paren: bool, . /// The main thing to display. . wrapped: T, -- line 557 ---------------------------------------- -- line 576 ---------------------------------------- . . /// Builds the string for `` adding parenthesis when necessary. . /// . /// For convenience, the operator is taken as a string because all unary . /// operators have the same precedence. . pub fn make_unop(op: &str, expr: Sugg<'_>) -> Sugg<'static> { . // If the `expr` starts with a unary operator already, do not wrap it in . // parentheses. 1,966 ( 0.00%) Sugg::MaybeParen(format!("{op}{}", expr.maybe_inner_paren()).into()) 11,592 ( 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:: (184x) . } . . /// Builds the string for ` ` adding parenthesis when necessary. . /// . /// Precedence of shift operator relative to other arithmetic operation is . /// often confusing so . /// parenthesis will always be added for a mix of these. . pub fn make_assoc(op: AssocOp, lhs: &Sugg<'_>, rhs: &Sugg<'_>) -> Sugg<'static> { -- line 592 ---------------------------------------- -- line 673 ---------------------------------------- . Binary(Add | BitAnd | BitOr | BitXor | And | Or | Mul) | Cast => Associativity::Both, . Binary(Div | Eq | Gt | Ge | Lt | Le | Rem | Ne | Shl | Shr | Sub) => Associativity::Left, . Range(_) => Associativity::None, . } . } . . /// Returns the indentation before `span` if there are nothing but `[ \t]` . /// before it on its line. 91 ( 0.00%) fn indentation(cx: &T, span: Span) -> Option { 39 ( 0.00%) let lo = cx.sess().source_map().lookup_char_pos(span.lo()); 6,068 ( 0.00%) => ???:::lookup_char_pos (13x) . lo.file 52 ( 0.00%) .get_line(lo.line - 1 /* line numbers in `Loc` are 1-based */) 2,091 ( 0.00%) => ???:::get_line (13x) . .and_then(|line| { . if let Some((pos, _)) = line.char_indices().find(|&(_, c)| c != ' ' && c != '\t') { . // We can mix char and byte positions here because we only consider `[ \t]`. 13 ( 0.00%) if lo.col == CharPos(pos) { 39 ( 0.00%) Some(line[..pos].into()) . } else { . None . } . } else { . None . } . }) 104 ( 0.00%) } . . /// Convenience extension trait for `Diag`. . pub trait DiagExt { . /// Suggests to add an attribute to an item. . /// . /// Correctly handles indentation of the attribute and item. . /// . /// # Example -- line 705 ---------------------------------------- -- line 756 ---------------------------------------- . if let Some(indent) = indentation(cx, item) { . let span = item.with_hi(item.lo()); . . self.span_suggestion(span, msg.to_string(), format!("{attr}\n{indent}"), applicability); . } . } . . fn suggest_append_item(&mut self, cx: &T, item: Span, msg: &str, new_item: &str, applicability: Applicability) { 156 ( 0.00%) if let Some(indent) = indentation(cx, item) { 9,561 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/sugg.rs:clippy_utils::sugg::indentation:: (13x) . let span = item.shrink_to_hi(); . let mut new_item_code = String::new(); 130 ( 0.00%) for l in new_item.lines() { 520 ( 0.00%) writeln!(new_item_code, "{indent}{l}").unwrap(); . } . self.span_suggestion( . span, . msg.to_string(), 52 ( 0.00%) format!("\n\n{}", new_item_code.strip_suffix('\n').unwrap()), . applicability, . ); . } . } . . fn suggest_remove_item(&mut self, cx: &T, item: Span, msg: &str, applicability: Applicability) { . let mut remove_span = item; . let fmpos = cx.sess().source_map().lookup_byte_offset(remove_span.hi()); -- line 781 ---------------------------------------- 17,422 ( 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<'_>) { 968,612 ( 0.01%) match expr.kind { 6,736 ( 0.00%) hir::ExprKind::Binary(op, _, _) => { 26,944 ( 0.00%) check_expr_inner(cx, expr, op.node, op.span); . }, 300 ( 0.00%) hir::ExprKind::AssignOp(op, _, _) => { 450 ( 0.00%) check_expr_inner(cx, expr, op.node.into(), op.span); . }, . _ => {}, . } . } . } . 48,202 ( 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) 8,771 ( 0.00%) && let Some(binop_trait_id) = cx.tcx.lang_items().get(binop_trait_lang) 50,120 ( 0.00%) => ???:::lang_items (1,253x) 5,012 ( 0.00%) && let Some(op_assign_trait_id) = cx.tcx.lang_items().get(op_assign_trait_lang) 50,120 ( 0.00%) => ???:::lang_items (1,253x) . . // Check for more than one binary operation in the implemented function . // Linting when multiple operations are involved can result in false positives 5,012 ( 0.00%) && let parent_fn = cx.tcx.hir_get_parent_item(expr.hir_id).def_id 23,807 ( 0.00%) => ???:::hir_get_parent_item (1,253x) 3,440 ( 0.00%) && let hir::Node::ImplItem(impl_item) = cx.tcx.hir_node_by_def_id(parent_fn) 3,636 ( 0.00%) && let hir::ImplItemKind::Fn(_, body_id) = impl_item.kind 1,768 ( 0.00%) && let body = cx.tcx.hir_body(body_id) 62,375 ( 0.00%) => ???:::hir_body (884x) 3,536 ( 0.00%) && let parent_fn = cx.tcx.hir_get_parent_item(expr.hir_id) 16,796 ( 0.00%) => ???:::hir_get_parent_item (884x) 3,536 ( 0.00%) && let Some(trait_ref) = trait_ref_of_method(cx, parent_fn) 134,589 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::trait_ref_of_method (884x) 576 ( 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() 11,792 ( 0.00%) .find(|&(ts, _)| ts.iter().any(|&t| Some(trait_id) == cx.tcx.lang_items().get(t))) 214,400 ( 0.00%) => ???:::lang_items (5,360x) . && 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) . ), . ); . } 55,088 ( 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 ---------------------------------------- 22,093 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/partialeq_ne_impl.rs -------------------------------------------------------------------------------- Ir -- line 27 ---------------------------------------- . pub PARTIALEQ_NE_IMPL, . complexity, . "re-implementing `PartialEq::ne`" . } . . declare_lint_pass!(PartialEqNeImpl => [PARTIALEQ_NE_IMPL]); . . impl<'tcx> LateLintPass<'tcx> for PartialEqNeImpl { 41,566 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) { 14,050 ( 0.00%) if let ItemKind::Impl(Impl { . of_trait: Some(of_trait), 3,822 ( 0.00%) items: impl_items, . .. 4,348 ( 0.00%) }) = item.kind 13,377 ( 0.00%) && !cx.tcx.is_automatically_derived(item.owner_id.to_def_id()) 255,609 ( 0.00%) => ???:::is_automatically_derived (1,911x) 2,136 ( 0.00%) && let Some(eq_trait) = cx.tcx.lang_items().eq_trait() 21,360 ( 0.00%) => ???:::lang_items (534x) 1,073 ( 0.00%) && of_trait.trait_ref.path.res.def_id() == eq_trait . { . for impl_item in impl_items { 5 ( 0.00%) if cx.tcx.item_name(impl_item.owner_id) == sym::ne { . span_lint_hir( . cx, . PARTIALEQ_NE_IMPL, . impl_item.hir_id(), . cx.tcx.def_span(impl_item.owner_id), . "re-implementing `PartialEq::ne` is unnecessary", . ); . } . } . } 47,504 ( 0.00%) } . } 1,068 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/uninit_vec.rs -------------------------------------------------------------------------------- Ir -- line 58 ---------------------------------------- . "Vec with uninitialized data" . } . . declare_lint_pass!(UninitVec => [UNINIT_VEC]); . . // FIXME: update to a visitor-based implementation. . // Threads: https://github.com/rust-lang/rust-clippy/pull/7682#discussion_r710998368 . impl<'tcx> LateLintPass<'tcx> for UninitVec { 196,128 ( 0.00%) fn check_block(&mut self, cx: &LateContext<'tcx>, block: &'tcx Block<'_>) { 21,792 ( 0.00%) let ctxt = block.span.ctxt(); 130,752 ( 0.00%) if !ctxt.in_external_macro(cx.tcx.sess.source_map()) { 3,141,482 ( 0.03%) => ???:::in_external_macro (21,792x) 46,047 ( 0.00%) for [stmt1, stmt2] in block.stmts.array_windows::<2>() { 62,784 ( 0.00%) if let StmtKind::Expr(expr) | StmtKind::Semi(expr) = stmt2.kind 13,138 ( 0.00%) && stmt1.span.ctxt() == ctxt 12,572 ( 0.00%) && stmt2.span.ctxt() == ctxt 11,572 ( 0.00%) && expr.span.ctxt() == ctxt . { 22,556 ( 0.00%) handle_uninit_vec_pair(cx, ctxt, stmt1, expr); 618,523 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/uninit_vec.rs:clippy_lints::uninit_vec::handle_uninit_vec_pair (5,639x) . } . } . 27,213 ( 0.00%) if let (Some(stmt), Some(expr)) = (block.stmts.last(), block.expr) 7,678 ( 0.00%) && stmt.span.ctxt() == ctxt 6,938 ( 0.00%) && expr.span.ctxt() == ctxt . { 34,430 ( 0.00%) handle_uninit_vec_pair(cx, ctxt, stmt, expr); 256,404 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/uninit_vec.rs:clippy_lints::uninit_vec::handle_uninit_vec_pair (3,130x) . } . } 149,296 ( 0.00%) } . } . 87,690 ( 0.00%) fn handle_uninit_vec_pair<'tcx>( . cx: &LateContext<'tcx>, . ctxt: SyntaxContext, . maybe_init_or_reserve: &'tcx Stmt<'tcx>, . maybe_set_len: &'tcx Expr<'tcx>, . ) { 17,538 ( 0.00%) if let Some(vec) = extract_init_or_reserve_target(cx, maybe_init_or_reserve) 6 ( 0.00%) && let Some((set_len_self, call_span)) = extract_set_len_self(cx, maybe_set_len) . && vec.location.eq_expr(cx, ctxt, set_len_self) . && let ty::Ref(_, vec_ty, _) = cx.typeck_results().expr_ty_adjusted(set_len_self).kind() . && let ty::Adt(_, args) = vec_ty.kind() . // `#[allow(...)]` attribute can be set on enclosing unsafe block of `set_len()` . && !is_lint_allowed(cx, UNINIT_VEC, maybe_set_len.hir_id) . { . if vec.has_capacity() { . // with_capacity / reserve -> set_len -- line 104 ---------------------------------------- -- line 119 ---------------------------------------- . span_lint( . cx, . UNINIT_VEC, . vec![call_span, maybe_init_or_reserve.span], . "calling `set_len()` on empty `Vec` creates out-of-bound values", . ); . } . } 70,152 ( 0.00%) } . . /// The target `Vec` that is initialized or reserved . #[derive(Clone, Copy)] . struct TargetVec<'tcx> { . location: VecLocation<'tcx>, . /// `None` if `reserve()` . init_kind: Option, . } -- line 135 ---------------------------------------- -- line 153 ---------------------------------------- . VecLocation::Expr(self_expr) => SpanlessEq::new(cx).eq_expr(ctxt, self_expr, expr), . } . } . } . . /// Finds the target location where the result of `Vec` initialization is stored . /// or `self` expression for `Vec::reserve()`. . fn extract_init_or_reserve_target<'tcx>(cx: &LateContext<'tcx>, stmt: &'tcx Stmt<'tcx>) -> Option> { 39,327 ( 0.00%) match stmt.kind { . StmtKind::Let(local) => { 19,386 ( 0.00%) if let Some(init_expr) = local.init 51,241 ( 0.00%) && let PatKind::Binding(_, hir_id, _, None) = local.pat.kind 31,870 ( 0.00%) && let Some(init_kind) = get_vec_init_kind(cx, init_expr) 447,325 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:clippy_utils::higher::get_vec_init_kind (6,374x) . { . return Some(TargetVec { . location: VecLocation::Local(hir_id), . init_kind: Some(init_kind), . }); . } . }, 10,975 ( 0.00%) StmtKind::Expr(expr) | StmtKind::Semi(expr) => match expr.kind { 320 ( 0.00%) ExprKind::Assign(lhs, rhs, _span) => { 800 ( 0.00%) if let Some(init_kind) = get_vec_init_kind(cx, rhs) { 6,502 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:clippy_utils::higher::get_vec_init_kind (160x) . return Some(TargetVec { . location: VecLocation::Expr(lhs), . init_kind: Some(init_kind), . }); . } . }, 8,536 ( 0.00%) ExprKind::MethodCall(path, self_expr, [_], _) if is_reserve(cx, path, self_expr) => { . return Some(TargetVec { . location: VecLocation::Expr(self_expr), . init_kind: None, . }); . }, . _ => (), . }, . StmtKind::Item(_) => (), . } . None . } . . fn is_reserve(cx: &LateContext<'_>, path: &PathSegment<'_>, self_expr: &Expr<'_>) -> bool { . cx.typeck_results() 909 ( 0.00%) .expr_ty(self_expr) 36,404 ( 0.00%) => ???:::expr_ty (909x) . .peel_refs() . .is_diag_item(cx, sym::Vec) . && path.ident.name == sym::reserve . } . . /// Returns self if the expression is `Vec::set_len()` . fn extract_set_len_self<'tcx>(cx: &LateContext<'_>, expr: &'tcx Expr<'_>) -> Option<(&'tcx Expr<'tcx>, Span)> { . // peel unsafe blocks in `unsafe { vec.set_len() }` . let expr = peel_hir_expr_while(expr, |e| { 10 ( 0.00%) if let ExprKind::Block(block, _) = e.kind { . // Extract the first statement/expression . match (block.stmts.first().map(|stmt| &stmt.kind), block.expr) { . (None, Some(expr)) => Some(expr), . (Some(StmtKind::Expr(expr) | StmtKind::Semi(expr)), _) => Some(expr), . _ => None, . } . } else { . None . } . }); 10 ( 0.00%) match expr.kind { 6 ( 0.00%) ExprKind::MethodCall(path, self_expr, [arg], _) => { 2 ( 0.00%) let self_type = cx.typeck_results().expr_ty(self_expr).peel_refs(); 80 ( 0.00%) => ???:::expr_ty (2x) 5 ( 0.00%) if self_type.is_diag_item(cx, sym::Vec) && path.ident.name == sym::set_len && !is_integer_literal(arg, 0) { . Some((self_expr, expr.span)) . } else { . None . } . }, . _ => None, . } . } -- line 229 ---------------------------------------- 263,254 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/swap.rs -------------------------------------------------------------------------------- Ir -- line 72 ---------------------------------------- . pub MANUAL_SWAP, . complexity, . "manual swap of two variables" . } . . declare_lint_pass!(Swap => [ALMOST_SWAPPED, MANUAL_SWAP]); . . impl<'tcx> LateLintPass<'tcx> for Swap { 217,920 ( 0.00%) fn check_block(&mut self, cx: &LateContext<'tcx>, block: &'tcx Block<'_>) { . check_manual_swap(cx, block); . check_suspicious_swap(cx, block); . check_xor_swap(cx, block); 174,336 ( 0.00%) } . } . . #[expect(clippy::too_many_arguments)] . fn generate_swap_warning<'tcx>( . block: &'tcx Block<'tcx>, . cx: &LateContext<'tcx>, . e1: &'tcx Expr<'tcx>, . e2: &'tcx Expr<'tcx>, -- line 92 ---------------------------------------- -- line 163 ---------------------------------------- . diag.note(format!("or maybe you should use `{sugg}::mem::replace`?")); . } . }, . ); . } . . /// Implementation of the `MANUAL_SWAP` lint. . fn check_manual_swap<'tcx>(cx: &LateContext<'tcx>, block: &'tcx Block<'tcx>) { 65,376 ( 0.00%) if is_in_const_context(cx) { 7,858,521 ( 0.07%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_const_context (21,792x) . return; . } . . for [s1, s2, s3] in block.stmts.array_windows::<3>() { 58,565 ( 0.00%) if let StmtKind::Let(tmp) = s1.kind . // let t = foo(); 30,687 ( 0.00%) && let Some(tmp_init) = tmp.init 50,101 ( 0.00%) && let PatKind::Binding(.., ident, None) = tmp.pat.kind . . // foo() = bar(); 20,748 ( 0.00%) && let StmtKind::Semi(first) = s2.kind 1,624 ( 0.00%) && let ExprKind::Assign(lhs1, rhs1, _) = first.kind . . // bar() = t; 100 ( 0.00%) && let StmtKind::Semi(second) = s3.kind 73 ( 0.00%) && let ExprKind::Assign(lhs2, rhs2, _) = second.kind 51 ( 0.00%) && let ExprKind::Path(QPath::Resolved(None, rhs2_path)) = rhs2.kind 10 ( 0.00%) && rhs2_path.segments.len() == 1 . 10 ( 0.00%) && ident.name == rhs2_path.segments[0].ident.name . 1 ( 0.00%) && let ctxt = s1.span.ctxt() 2 ( 0.00%) && s2.span.ctxt() == ctxt 2 ( 0.00%) && s3.span.ctxt() == ctxt 2 ( 0.00%) && first.span.ctxt() == ctxt 2 ( 0.00%) && second.span.ctxt() == ctxt . 8 ( 0.00%) && eq_expr_value(cx, ctxt, tmp_init, lhs1) 4,606 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:clippy_utils::hir_utils::eq_expr_value (1x) 10 ( 0.00%) && eq_expr_value(cx, ctxt, rhs1, lhs2) 928 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:clippy_utils::hir_utils::eq_expr_value (1x) . { . let span = s1.span.to(s3.span); . generate_swap_warning(block, cx, lhs1, lhs2, rhs1, rhs2, span, false); . } . } . } . . /// Implementation of the `ALMOST_SWAPPED` lint. . fn check_suspicious_swap(cx: &LateContext<'_>, block: &Block<'_>) { . for [first, second] in block.stmts.array_windows() { 84,976 ( 0.00%) if let Some((lhs0, rhs0)) = parse(first) 62,210 ( 0.00%) && let Some((lhs1, rhs1)) = parse(second) 10,398 ( 0.00%) && let ctxt = first.span.ctxt() 20,796 ( 0.00%) && ctxt == second.span.ctxt() 41,592 ( 0.00%) && !ctxt.in_external_macro(cx.sess().source_map()) 1,258,764 ( 0.01%) => ???:::in_external_macro (10,398x) 54,324 ( 0.00%) && is_same(cx, ctxt, lhs0, rhs1) 90,010 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/swap.rs:clippy_lints::swap::is_same (9,054x) 84 ( 0.00%) && is_same(cx, ctxt, lhs1, rhs0) 8,881 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/swap.rs:clippy_lints::swap::is_same (14x) . && !is_same(cx, ctxt, lhs1, rhs1) // Ignore a = b; a = a (#10421) . && let Some(lhs_sugg) = match &lhs0 { . ExprOrIdent::Expr(expr) => Sugg::hir_opt(cx, expr), . ExprOrIdent::Ident(ident) => Some(Sugg::NonParen(ident.as_str().into())), . } . && let Some(rhs_sugg) = Sugg::hir_opt(cx, rhs0) . { . let span = first.span.to(rhs1.span); -- line 225 ---------------------------------------- -- line 239 ---------------------------------------- . diag.note(format!("or maybe you should use `{sugg}::mem::replace`?")); . }, . ); . } . } . } . . fn is_same(cx: &LateContext<'_>, ctxt: SyntaxContext, lhs: ExprOrIdent<'_>, rhs: &Expr<'_>) -> bool { 18,136 ( 0.00%) match lhs { 148 ( 0.00%) ExprOrIdent::Expr(expr) => eq_expr_value(cx, ctxt, expr, rhs), 43,813 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:clippy_utils::hir_utils::eq_expr_value (74x) . ExprOrIdent::Ident(ident) => { 18,189 ( 0.00%) if let ExprKind::Path(QPath::Resolved(None, path)) = rhs.kind 103 ( 0.00%) && let [segment] = &path.segments . && segment.ident == ident . { . true . } else { . false . } . }, . } 8,994 ( 0.00%) } . . #[derive(Debug, Clone, Copy)] . enum ExprOrIdent<'a> { . Expr(&'a Expr<'a>), . Ident(Ident), . } . . fn parse<'a, 'hir>(stmt: &'a Stmt<'hir>) -> Option<(ExprOrIdent<'hir>, &'a Expr<'hir>)> { 86,176 ( 0.00%) if let StmtKind::Semi(expr) = stmt.kind { 12,999 ( 0.00%) if let ExprKind::Assign(lhs, rhs, _) = expr.kind { . return Some((ExprOrIdent::Expr(lhs), rhs)); . } . } else if let StmtKind::Let(expr) = stmt.kind 79,140 ( 0.00%) && let Some(rhs) = expr.init 155,349 ( 0.00%) && let PatKind::Binding(_, _, ident_l, _) = expr.pat.kind . { . return Some((ExprOrIdent::Ident(ident_l), rhs)); . } . None . } . . /// Implementation of the xor case for `MANUAL_SWAP` lint. . fn check_xor_swap<'tcx>(cx: &LateContext<'tcx>, block: &'tcx Block<'tcx>) { . for [s1, s2, s3] in block.stmts.array_windows::<3>() { 12,182 ( 0.00%) let ctxt = s1.span.ctxt(); 1,079 ( 0.00%) if let Some((lhs0, rhs0)) = extract_sides_of_xor_assign(s1, ctxt) . && let Some((lhs1, rhs1)) = extract_sides_of_xor_assign(s2, ctxt) . && let Some((lhs2, rhs2)) = extract_sides_of_xor_assign(s3, ctxt) . && eq_expr_value(cx, ctxt, lhs0, rhs1) . && eq_expr_value(cx, ctxt, lhs2, rhs1) . && eq_expr_value(cx, ctxt, lhs1, rhs0) . && eq_expr_value(cx, ctxt, lhs1, rhs2) . && s2.span.ctxt() == ctxt . && s3.span.ctxt() == ctxt -- line 294 ---------------------------------------- -- line 299 ---------------------------------------- . } . } . . /// Returns the lhs and rhs of an xor assignment statement. . fn extract_sides_of_xor_assign<'a, 'hir>( . stmt: &'a Stmt<'hir>, . ctxt: SyntaxContext, . ) -> Option<(&'a Expr<'hir>, &'a Expr<'hir>)> { 24,364 ( 0.00%) if let StmtKind::Semi(expr) = stmt.kind 2,228 ( 0.00%) && let ExprKind::AssignOp( . Spanned { . node: AssignOpKind::BitXorAssign, . .. . }, . lhs, . rhs, . ) = expr.kind . && expr.span.ctxt() == ctxt -- line 316 ---------------------------------------- 378,926 ( 0.00%) -------------------------------------------------------------------------------- -- 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { . // Check that the expression is generated by a macro. 562,663 ( 0.00%) if expr.span.from_expansion() . // Check that it's a string literal. 1,970 ( 0.00%) && let ExprKind::Lit(lit) = expr.kind 11,444 ( 0.00%) && let LitKind::Str(lit_s, _) = lit.node . // Get the direct parent of the expression. 9,850 ( 0.00%) && let Some(macro_call) = macro_backtrace(expr.span).next() . // Check if the `concat` macro from the `core` library. 13,790 ( 0.00%) && cx.tcx.is_diagnostic_item(sym::macro_concat, macro_call.def_id) 196,494 ( 0.00%) => ???:::is_diagnostic_item (1,970x) . // 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, . ); . } . } 1,937,824 ( 0.02%) } . } 157,516 ( 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/collections/btree/search.rs -------------------------------------------------------------------------------- Ir -- line 218 ---------------------------------------- . where . Q: Ord, . K: Borrow, . { . let node = self.reborrow(); . let keys = node.keys(); . debug_assert!(start_index <= keys.len()); . for (offset, k) in unsafe { keys.get_unchecked(start_index..) }.iter().enumerate() { 412,696 ( 0.00%) match key.cmp(k.borrow()) { 26,772 ( 0.00%) => ???:::cmp (291x) . Ordering::Greater => {} . Ordering::Equal => return IndexResult::KV(start_index + offset), . Ordering::Less => return IndexResult::Edge(start_index + offset), . } . } . IndexResult::Edge(keys.len()) . } . -- line 234 ---------------------------------------- 11,517 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/methods/unnecessary_to_owned.rs -------------------------------------------------------------------------------- Ir -- line 19 ---------------------------------------- . self, ClauseKind, GenericArg, GenericArgKind, GenericArgsRef, ParamTy, ProjectionPredicate, TraitPredicate, Ty, . }; . use rustc_span::Symbol; . use rustc_trait_selection::traits::query::evaluate_obligation::InferCtxtExt as _; . use rustc_trait_selection::traits::{Obligation, ObligationCause}; . . use super::UNNECESSARY_TO_OWNED; . 104,931 ( 0.00%) pub fn check<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'tcx>, . method_name: Symbol, . receiver: &'tcx Expr<'_>, . args: &'tcx [Expr<'_>], . msrv: Msrv, . ) { 151,567 ( 0.00%) if let Some(method_parent_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id).opt_parent(cx) 596,001 ( 0.00%) => ???:::type_dependent_def_id (11,659x) . && args.is_empty() . { 78 ( 0.00%) if is_cloned_or_copied(cx, method_name, method_parent_id) { . unnecessary_iter_cloned::check(cx, expr, method_name, receiver); 292 ( 0.00%) } else if is_to_owned_like(cx, expr, method_name, method_parent_id) { . if check_split_call_arg(cx, expr, method_name, receiver) { . return; . } . // At this point, we know the call is of a `to_owned`-like function. The functions . // `check_addr_of_expr` and `check_into_iter_call_arg` determine whether the call is unnecessary . // based on its context, that is, whether it is a referent in an `AddrOf` expression, an . // argument in a `into_iter` call, or an argument in the call of some other function. . if check_addr_of_expr(cx, expr, method_name, method_parent_id, receiver) { -- line 48 ---------------------------------------- -- line 54 ---------------------------------------- . if check_string_from_utf8(cx, expr, receiver) { . return; . } . check_other_call_arg(cx, expr, method_name, receiver); . } . } else { . check_borrow_predicate(cx, expr); . } 93,272 ( 0.00%) } . . /// Checks whether `expr` is a referent in an `AddrOf` expression and, if so, determines whether its . /// call of a `to_owned`-like function is unnecessary. . #[expect(clippy::too_many_lines)] . fn check_addr_of_expr( . cx: &LateContext<'_>, . expr: &Expr<'_>, . method_name: Symbol, . method_parent_id: DefId, . receiver: &Expr<'_>, . ) -> bool { 177 ( 0.00%) if let Some(parent) = get_parent_expr(cx, expr) 7,763 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (59x) 68 ( 0.00%) && let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, _) = parent.kind . && let adjustments = cx.typeck_results().expr_adjustments(parent).iter().collect::>() . && let . // For matching uses of `Cow::from` . [ . Adjustment { . kind: Adjust::Deref(DerefAdjustKind::Builtin), . target: referent_ty, . }, -- line 83 ---------------------------------------- -- line 205 ---------------------------------------- . /// call of a `to_owned`-like function is unnecessary. . fn check_into_iter_call_arg( . cx: &LateContext<'_>, . expr: &Expr<'_>, . method_name: Symbol, . receiver: &Expr<'_>, . msrv: Msrv, . ) -> bool { 236 ( 0.00%) if let Some(parent) = get_parent_expr(cx, expr) 7,763 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (59x) 136 ( 0.00%) && let Some(callee_def_id) = fn_def_id(cx, parent) 3,683 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::fn_def_id (34x) 32 ( 0.00%) && is_into_iter(cx, callee_def_id) . && let Some(iterator_trait_id) = cx.tcx.get_diagnostic_item(sym::Iterator) . && let parent_ty = cx.typeck_results().expr_ty(parent) . && implements_trait(cx, parent_ty, iterator_trait_id, &[]) . && let Some(item_ty) = get_iterator_item_ty(cx, parent_ty) . && let Some(receiver_snippet) = receiver.span.get_text(cx) . // If the receiver is a `Cow`, we can't remove the `into_owned` generally, see https://github.com/rust-lang/rust-clippy/issues/13624. . && !cx.typeck_results().expr_ty(receiver).is_diag_item(cx, sym::Cow) . // Calling `iter()` on a temporary object can lead to false positives. #14242 -- line 223 ---------------------------------------- -- line 248 ---------------------------------------- . } . false . } . . /// Checks for `&String::from_utf8(bytes.{to_vec,to_owned,...}()).unwrap()` coercing to `&str`, . /// which can be written as just `std::str::from_utf8(bytes).unwrap()`. . fn check_string_from_utf8<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>, receiver: &'tcx Expr<'tcx>) -> bool { . if let Some((call, arg)) = skip_addr_of_ancestors(cx, expr) 68 ( 0.00%) && !arg.span.from_expansion() 33 ( 0.00%) && let ExprKind::Call(callee, _) = call.kind 291 ( 0.00%) && fn_def_id(cx, call).is_some_and(|did| cx.tcx.is_diagnostic_item(sym::string_from_utf8, did)) 3,648 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::fn_def_id (33x) 1,728 ( 0.00%) => ???:::is_diagnostic_item (32x) . && let Some(unwrap_call) = get_parent_expr(cx, call) . && let ExprKind::MethodCall(unwrap_method_name, ..) = unwrap_call.kind . && matches!(unwrap_method_name.ident.name, sym::unwrap | sym::expect) . && let Some(ref_string) = get_parent_expr(cx, unwrap_call) . && let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, _) = ref_string.kind . && let adjusted_ty = cx.typeck_results().expr_ty_adjusted(ref_string) . // `&...` creates a `&String`, so only actually lint if this coerces to a `&str` . && matches!(adjusted_ty.kind(), ty::Ref(_, ty, _) if ty.is_str()) -- line 266 ---------------------------------------- -- line 306 ---------------------------------------- . } else { . false . } . } . . /// Checks whether `expr` is an argument in an `into_iter` call and, if so, determines whether its . /// call of a `to_owned`-like function is unnecessary. . fn check_split_call_arg(cx: &LateContext<'_>, expr: &Expr<'_>, method_name: Symbol, receiver: &Expr<'_>) -> bool { 177 ( 0.00%) if let Some(parent) = get_parent_expr(cx, expr) 7,763 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (59x) 40 ( 0.00%) && let Some((sym::split, argument_expr)) = get_fn_name_and_arg(cx, parent) . && let Some(receiver_snippet) = receiver.span.get_text(cx) . && let Some(arg_snippet) = argument_expr.span.get_text(cx) . { . // We may end-up here because of an expression like `x.to_string().split(…)` where the type of `x` . // implements `AsRef` but does not implement `Deref`. In this case, we have to . // add `.as_ref()` to the suggestion. . let as_ref = if cx.typeck_results().expr_ty(expr).is_lang_item(cx, LangItem::String) . && let Some(deref_trait_id) = cx.tcx.get_diagnostic_item(sym::Deref) -- line 323 ---------------------------------------- -- line 342 ---------------------------------------- . Applicability::MaybeIncorrect, . ); . return true; . } . false . } . . fn get_fn_name_and_arg<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'tcx>) -> Option<(Symbol, Expr<'tcx>)> { 335 ( 0.00%) match &expr.kind { . ExprKind::MethodCall(path, _, [arg_expr], ..) => Some((path.ident.name, *arg_expr)), . ExprKind::Call( . Expr { 21 ( 0.00%) kind: ExprKind::Path(qpath), . hir_id: path_hir_id, . .. . }, 21 ( 0.00%) [arg_expr], . ) => { . // Only return Fn-like DefIds, not the DefIds of statics/consts/etc that contain or . // deref to fn pointers, dyn Fn, impl Fn - #8850 142 ( 0.00%) if let Res::Def(DefKind::Fn | DefKind::Ctor(..) | DefKind::AssocFn, def_id) = 205 ( 0.00%) cx.typeck_results().qpath_res(qpath, *path_hir_id) 315 ( 0.00%) => ???:::qpath_res (21x) 60 ( 0.00%) && let Some(fn_name) = cx.tcx.opt_item_name(def_id) 1,470 ( 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:::opt_item_name:: (20x) . { 20 ( 0.00%) Some((fn_name, *arg_expr)) . } else { . None . } . }, . _ => None, . } . } . -- line 374 ---------------------------------------- -- line 376 ---------------------------------------- . /// of a `to_owned`-like function is unnecessary. . fn check_other_call_arg<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'tcx>, . method_name: Symbol, . receiver: &'tcx Expr<'tcx>, . ) -> bool { . if let Some((maybe_call, maybe_arg)) = skip_addr_of_ancestors(cx, expr) 370 ( 0.00%) && let Some((callee_def_id, _, recv, call_args)) = get_callee_generic_args_and_args(cx, maybe_call) 3,954 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/unnecessary_to_owned.rs:clippy_lints::methods::unnecessary_to_owned::get_callee_generic_args_and_args (34x) . && let fn_sig = cx.tcx.fn_sig(callee_def_id).instantiate_identity().skip_norm_wip().skip_binder() . && let Some(i) = recv.into_iter().chain(call_args).position(|arg| arg.hir_id == maybe_arg.hir_id) . && let Some(input) = fn_sig.inputs().get(i) 165 ( 0.00%) && let (input, n_refs, _) = peel_and_count_ty_refs(*input) 297 ( 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 (33x) . && let (trait_predicates, _) = get_input_traits_and_projections(cx, callee_def_id, input) 198 ( 0.00%) && let Some(sized_def_id) = cx.tcx.lang_items().sized_trait() 1,320 ( 0.00%) => ???:::lang_items (33x) 165 ( 0.00%) && let Some(meta_sized_def_id) = cx.tcx.lang_items().meta_sized_trait() 1,320 ( 0.00%) => ???:::lang_items (33x) 66 ( 0.00%) && let [trait_predicate] = trait_predicates . .iter() . .filter(|trait_predicate| trait_predicate.def_id() != sized_def_id) . .filter(|trait_predicate| trait_predicate.def_id() != meta_sized_def_id) . .collect::>()[..] . && let Some(deref_trait_id) = cx.tcx.get_diagnostic_item(sym::Deref) . && let Some(as_ref_trait_id) = cx.tcx.get_diagnostic_item(sym::AsRef) . && (trait_predicate.def_id() == deref_trait_id || trait_predicate.def_id() == as_ref_trait_id) . && let receiver_ty = cx.typeck_results().expr_ty(receiver) -- line 400 ---------------------------------------- -- line 430 ---------------------------------------- . } . . /// Walks an expression's ancestors until it finds a non-`AddrOf` expression. Returns the first such . /// expression found (if any) along with the immediately prior expression. . fn skip_addr_of_ancestors<'tcx>( . cx: &LateContext<'tcx>, . mut expr: &'tcx Expr<'tcx>, . ) -> Option<(&'tcx Expr<'tcx>, &'tcx Expr<'tcx>)> { 531 ( 0.00%) while let Some(parent) = get_parent_expr(cx, expr) { 15,526 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (118x) 170 ( 0.00%) if let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, _) = parent.kind { . expr = parent; . } else { . return Some((parent, expr)); . } . } . None . } . . /// Checks whether an expression is a function or method call and, if so, returns its `DefId`, . /// `GenericArgs`, and arguments. 306 ( 0.00%) fn get_callee_generic_args_and_args<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'tcx>, . ) -> Option<( . DefId, . GenericArgsRef<'tcx>, . Option<&'tcx Expr<'tcx>>, . &'tcx [Expr<'tcx>], . )> { 170 ( 0.00%) if let ExprKind::Call(callee, args) = expr.kind 99 ( 0.00%) && let callee_ty = cx.typeck_results().expr_ty(callee) 1,320 ( 0.00%) => ???:::expr_ty (33x) 66 ( 0.00%) && let ty::FnDef(callee_def_id, _) = callee_ty.kind() . { 132 ( 0.00%) let generic_args = cx.typeck_results().node_args(callee.hir_id); 1,159 ( 0.00%) => ???:::node_args (33x) 231 ( 0.00%) return Some((*callee_def_id, generic_args, None, args)); . } . if let ExprKind::MethodCall(_, recv, args, _) = expr.kind . && let Some(method_def_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id) . { . let generic_args = cx.typeck_results().node_args(expr.hir_id); . return Some((method_def_id, generic_args, Some(recv), args)); . } 1 ( 0.00%) None 272 ( 0.00%) } . . /// Returns the `TraitPredicate`s and `ProjectionPredicate`s for a function's input type. . fn get_input_traits_and_projections<'tcx>( . cx: &LateContext<'tcx>, . callee_def_id: DefId, . input: Ty<'tcx>, . ) -> (Vec>, Vec>) { . let mut trait_predicates = Vec::new(); -- line 481 ---------------------------------------- -- line 486 ---------------------------------------- . trait_predicates.push(trait_predicate); . }, . ClauseKind::Projection(projection_predicate) if projection_predicate.projection_term.self_ty() == input => { . projection_predicates.push(projection_predicate); . }, . _ => {}, . } . } 165 ( 0.00%) (trait_predicates, projection_predicates) . } . . #[expect(clippy::too_many_lines)] . fn can_change_type<'a>(cx: &LateContext<'a>, mut expr: &'a Expr<'a>, mut ty: Ty<'a>) -> bool { . for (_, node) in cx.tcx.hir_parent_iter(expr.hir_id) { . match node { . Node::Stmt(_) => return true, . Node::Block(..) => {}, -- line 502 ---------------------------------------- -- line 607 ---------------------------------------- . } . . fn has_lifetime(ty: Ty<'_>) -> bool { . ty.walk().any(|t| matches!(t.kind(), GenericArgKind::Lifetime(_))) . } . . /// Returns true if the named method is `Iterator::cloned` or `Iterator::copied`. . fn is_cloned_or_copied(cx: &LateContext<'_>, method_name: Symbol, method_parent_id: DefId) -> bool { 25,488 ( 0.00%) matches!(method_name, sym::cloned | sym::copied) && method_parent_id.is_diag_item(cx, sym::Iterator) . } . . /// Returns true if the named method can be used to convert the receiver to its "owned" . /// representation. . fn is_to_owned_like<'a>( . cx: &LateContext<'a>, . call_expr: &Expr<'a>, . method_name: Symbol, . method_parent_id: DefId, . ) -> bool { 50,800 ( 0.00%) is_cow_into_owned(cx, method_name, method_parent_id) 101,600 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/unnecessary_to_owned.rs:clippy_lints::methods::unnecessary_to_owned::is_cow_into_owned (6,350x) 49,947 ( 0.00%) || (method_name != sym::to_string && is_clone_like(cx, method_name, method_parent_id)) 70,205 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/implicit_clone.rs:clippy_lints::methods::implicit_clone::is_clone_like (6,229x) . || is_to_string_on_string_like(cx, call_expr, method_name, method_parent_id) . } . . /// Returns true if the named method is `Cow::into_owned`. 38,100 ( 0.00%) fn is_cow_into_owned(cx: &LateContext<'_>, method_name: Symbol, method_parent_id: DefId) -> bool { 6,350 ( 0.00%) method_name == sym::into_owned && method_parent_id.opt_impl_ty(cx).is_diag_item(cx, sym::Cow) 44,450 ( 0.00%) } . . /// Returns true if the named method is `ToString::to_string` and it's called on a type that . /// is string-like i.e. implements `AsRef` or `Deref`. . fn is_to_string_on_string_like<'a>( . cx: &LateContext<'_>, . call_expr: &'a Expr<'a>, . method_name: Symbol, . method_parent_id: DefId, . ) -> bool { 363 ( 0.00%) if method_name != sym::to_string || !method_parent_id.is_diag_item(cx, sym::ToString) { . return false; . } . 575 ( 0.00%) if let Some(args) = cx.typeck_results().node_args_opt(call_expr.hir_id) 4,485 ( 0.00%) => ???:::node_args_opt (115x) 230 ( 0.00%) && let [generic_arg] = args.as_slice() 115 ( 0.00%) && let GenericArgKind::Type(ty) = generic_arg.kind() 460 ( 0.00%) && let Some(deref_trait_id) = cx.tcx.get_diagnostic_item(sym::Deref) 12,190 ( 0.00%) => ???:::get_diagnostic_item (115x) 460 ( 0.00%) && let Some(as_ref_trait_id) = cx.tcx.get_diagnostic_item(sym::AsRef) 12,190 ( 0.00%) => ???:::get_diagnostic_item (115x) 805 ( 0.00%) && (cx.get_associated_type(ty, deref_trait_id, sym::Target) == Some(cx.tcx.types.str_) 615,148 ( 0.01%) => ???:::get_associated_type (115x) 920 ( 0.00%) || implements_trait(cx, ty, as_ref_trait_id, &[cx.tcx.types.str_.into()])) 349,379 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::implements_trait (115x) . { . true . } else { . false . } . } . . fn std_map_key<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option> { 78 ( 0.00%) match ty.kind() { . ty::Adt(adt, args) 108 ( 0.00%) if matches!( 72 ( 0.00%) cx.tcx.get_diagnostic_name(adt.did()), 3,132 ( 0.00%) => ???:::get_diagnostic_name (36x) . Some(sym::BTreeMap | sym::BTreeSet | sym::HashMap | sym::HashSet) . ) => . { 36 ( 0.00%) Some(args.type_at(0)) . }, . _ => None, . } . } . . fn is_str_and_string(cx: &LateContext<'_>, arg_ty: Ty<'_>, original_arg_ty: Ty<'_>) -> bool { . original_arg_ty.is_str() && arg_ty.is_lang_item(cx, LangItem::String) . } -- line 678 ---------------------------------------- -- line 681 ---------------------------------------- . (original_arg_ty.is_slice() || original_arg_ty.is_array() || original_arg_ty.is_array_slice()) . && arg_ty.is_diag_item(cx, sym::Vec) . } . . // This function will check the following: . // 1. The argument is a non-mutable reference. . // 2. It calls `to_owned()`, `to_string()` or `to_vec()`. . // 3. That the method is called on `String` or on `Vec` (only types supported for the moment). 252 ( 0.00%) fn check_if_applicable_to_argument<'tcx>(cx: &LateContext<'tcx>, arg: &Expr<'tcx>) { 227 ( 0.00%) if let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, expr) = arg.kind 62 ( 0.00%) && let ExprKind::MethodCall(method_path, caller, &[], _) = expr.kind . && let Some(method_def_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id) . && let method_name = method_path.ident.name . && match method_name { . sym::to_owned => cx.tcx.is_diagnostic_item(sym::to_owned_method, method_def_id), . sym::to_string => cx.tcx.is_diagnostic_item(sym::to_string_method, method_def_id), . sym::to_vec => cx . .tcx . .impl_of_assoc(method_def_id) -- line 699 ---------------------------------------- -- line 719 ---------------------------------------- . if original_arg_ty.is_array() { . format!("{snippet}.as_slice()") . } else { . snippet.to_owned() . }, . Applicability::MaybeIncorrect, . ); . } 288 ( 0.00%) } . . // In std "map types", the getters all expect a `Borrow` generic argument. So in here, we . // check that: . // 1. This is a method with only one argument that doesn't come from a trait. . // 2. That it has `Borrow` in its generic predicates. . // 3. `Self` is a std "map type" (ie `HashSet`, `HashMap`, `BTreeSet`, `BTreeMap`). . // 4. The key to the "map type" is not a reference. . fn check_borrow_predicate<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'tcx>) { 68,317 ( 0.00%) if let ExprKind::MethodCall(_, caller, &[arg], _) = expr.kind 21,435 ( 0.00%) && let Some(method_def_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id) 219,217 ( 0.00%) => ???:::type_dependent_def_id (4,287x) 12,861 ( 0.00%) && cx.tcx.trait_of_assoc(method_def_id).is_none() 890,229 ( 0.01%) => ???:::trait_of_assoc (4,287x) 14,340 ( 0.00%) && let Some(borrow_id) = cx.tcx.get_diagnostic_item(sym::Borrow) 304,008 ( 0.00%) => ???:::get_diagnostic_item (2,868x) . && cx.tcx.clauses_of(method_def_id).clauses.iter().any(|(clause, _)| { 5,794 ( 0.00%) if let ClauseKind::Trait(trait_pred) = clause.kind().skip_binder() 16,548 ( 0.00%) => ???:::kind (1,182x) . && trait_pred.polarity == ty::PredicatePolarity::Positive . && trait_pred.trait_ref.def_id == borrow_id . { . true . } else { . false . } . }) 39 ( 0.00%) && let caller_ty = cx.typeck_results().expr_ty(caller) 1,560 ( 0.00%) => ???:::expr_ty (39x) . // For now we limit it to "map types". 36 ( 0.00%) && let Some(key_ty) = std_map_key(cx, caller_ty) . // We need to check that the key type is not a reference. 36 ( 0.00%) && !key_ty.is_ref() . { 36 ( 0.00%) check_if_applicable_to_argument(cx, &arg); 829 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/unnecessary_to_owned.rs:clippy_lints::methods::unnecessary_to_owned::check_if_applicable_to_argument (36x) . } . } 92,981 ( 0.00%) -------------------------------------------------------------------------------- -- 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 484,456 ( 0.00%) if let ExprKind::Binary(ref op, left, right) = expr.kind 6,736 ( 0.00%) && BinOpKind::Mul == op.node 100 ( 0.00%) && !expr.span.from_expansion() 86 ( 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, . ); . } 1,937,824 ( 0.02%) } . } . . fn simplify<'tcx>( . cx: &LateContext<'tcx>, . expr1: &'tcx Expr<'tcx>, . expr2: &'tcx Expr<'tcx>, . ) -> Option<(&'tcx Expr<'tcx>, usize)> { 172 ( 0.00%) let expr1 = expr_or_init(cx, expr1); 3,771 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::expr_or_init (43x) 172 ( 0.00%) let expr2 = expr_or_init(cx, expr2); 3,791 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::expr_or_init (43x) . 344 ( 0.00%) simplify_half(cx, expr1, expr2).or_else(|| simplify_half(cx, expr2, expr1)) 3,216 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_slice_size_calculation.rs:clippy_lints::manual_slice_size_calculation::simplify_half (86x) . } . 602 ( 0.00%) fn simplify_half<'tcx>( . cx: &LateContext<'tcx>, . expr1: &'tcx Expr<'tcx>, . expr2: &'tcx Expr<'tcx>, . ) -> Option<(&'tcx Expr<'tcx>, usize)> { 172 ( 0.00%) if !expr1.span.from_expansion() . // expr1 is `[T1].len()`? 304 ( 0.00%) && let ExprKind::MethodCall(method_path, receiver, [], _) = expr1.kind 23 ( 0.00%) && method_path.ident.name == sym::len 36 ( 0.00%) && let receiver_ty = cx.typeck_results().expr_ty(receiver) 480 ( 0.00%) => ???:::expr_ty (12x) 48 ( 0.00%) && let (receiver_ty, refs_count, _) = peel_and_count_ty_refs(receiver_ty) 198 ( 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 (12x) 42 ( 0.00%) && let ty::Slice(ty1) = receiver_ty.kind() . // expr2 is `size_of::()`? . && let ExprKind::Call(func, []) = expr2.kind . && let ExprKind::Path(ref func_qpath) = func.kind . && let Some(def_id) = cx.qpath_res(func_qpath, func.hir_id).opt_def_id() . && cx.tcx.is_diagnostic_item(sym::mem_size_of, def_id) . && let Some(ty2) = cx.typeck_results().node_args(func.hir_id).types().next() . // T1 == T2? . && *ty1 == ty2 . { . Some((receiver, refs_count)) . } else { . None . } 774 ( 0.00%) } 217 ( 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 { 2,422,280 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 4,864 ( 0.00%) let (let_pat, let_expr, ifwhile) = 970,910 ( 0.01%) if let Some(higher::IfLet { let_pat, let_expr, .. }) = higher::IfLet::hir(cx, expr) { 1,858,564 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (242,228x) . (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; . }; . 6,069 ( 0.00%) if let ExprKind::MethodCall(ok_path, recv, [], ..) = let_expr.kind //check is expr.ok() has type Result.ok(, _) 91 ( 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, . ); . } 1,937,824 ( 0.02%) } . } 3,996 ( 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; . 2,180,052 ( 0.02%) pub(crate) fn check_assert<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 244,253 ( 0.00%) if let Some(macro_call) = first_node_macro_backtrace(cx, e).find(|macro_call| { 50,466 ( 0.00%) matches!( 34,080 ( 0.00%) cx.tcx.get_diagnostic_name(macro_call.def_id), 633,202 ( 0.01%) => ???:::get_diagnostic_name (8,520x) . Some(sym::assert_eq_macro | sym::assert_ne_macro | sym::debug_assert_eq_macro | sym::debug_assert_ne_macro) . ) 4,050 ( 0.00%) }) && let Some((lhs, rhs, _)) = find_assert_eq_args(cx, e, macro_call.expn) 1,223,996 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::find_assert_eq_args (405x) 2,835 ( 0.00%) && eq_expr_value(cx, macro_call.span.ctxt(), lhs, rhs) 189,133 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:clippy_utils::hir_utils::eq_expr_value (405x) 3 ( 0.00%) && macro_call.is_local() 17 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:::is_local (1x) 7 ( 0.00%) && !is_in_test_function(cx.tcx, e.hir_id) 22,131 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_test_function (1x) . { . span_lint( . cx, . EQ_OP, 4 ( 0.00%) lhs.span.to(rhs.span), 138 ( 0.00%) => ???:::to (1x) 3 ( 0.00%) format!( . "identical args used in this `{}!` macro call", 2 ( 0.00%) cx.tcx.item_name(macro_call.def_id) . ), . ); . } 1,937,824 ( 0.02%) } . 35,505 ( 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) 24,535 ( 0.00%) && eq_expr_value(cx, e.span.ctxt(), left, right) 3,867,129 ( 0.03%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:clippy_utils::hir_utils::eq_expr_value (3,505x) . && !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"); . } . }, . ); . } 31,560 ( 0.00%) } 742,731 ( 0.01%) -------------------------------------------------------------------------------- -- 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 { 1,325,872 ( 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> { 3,591 ( 0.00%) map_entry(self.base.rustc_entry(key)) 28,541 ( 0.00%) => /rust/deps/hashbrown-0.17.1/src/rustc_entry.rs:>::rustc_entry (130x) . } . . /// 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, . { 518 ( 0.00%) self.base.get(k) 8,877 ( 0.00%) => /rust/deps/hashbrown-0.17.1/src/raw.rs:>::get:: (259x) . } . . /// 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 { 67,234 ( 0.00%) self.base.insert(k, v) 235 ( 0.00%) => /rust/deps/hashbrown-0.17.1/src/map.rs:, rustc_hash::FxBuildHasher>>::insert (1x) . } . . /// 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, . { 18,394 ( 0.00%) self.base.remove(k) 38,999 ( 0.00%) => /rust/deps/hashbrown-0.17.1/src/map.rs:>::remove:: (1,037x) . } . . /// 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 { 6,379 ( 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. 857 ( 0.00%) fn from_iter>(iter: T) -> HashMap { . let mut map = HashMap::with_hasher(Default::default()); 28,580 ( 0.00%) map.extend(iter); 77 ( 0.00%) => ???:0x0000000000173dc0 (1x) 82,086 ( 0.00%) map 961 ( 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) 622 ( 0.00%) => /rust/deps/hashbrown-0.17.1/src/map.rs:, rustc_hash::FxBuildHasher> as core::iter::traits::collect::Extend<(&str, std::collections::hash::set::HashSet<&str, rustc_hash::FxBuildHasher>)>>::extend::<[(&str, std::collections::hash::set::HashSet<&str, rustc_hash::FxBuildHasher>); 3]> (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> { 1,714 ( 0.00%) match raw { . base::RustcEntry::Occupied(base) => Entry::Occupied(OccupiedEntry { base }), 1,096 ( 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 ---------------------------------------- 212,807 ( 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 729,116 ( 0.01%) if let ExprKind::Let(lt) = expr.kind 21,886 ( 0.00%) && match lt.pat.kind { . PatKind::Slice([], None, []) => true, . PatKind::Expr(lit) 3 ( 0.00%) if let PatExprKind::Lit { lit, .. } = lit.kind . && let LitKind::Str(lit, _) = lit.node => . { . lit.as_str().is_empty() . }, . _ => false, . } . && !expr.span.from_expansion() . && has_is_empty(cx, lt.init, self.msrv) -- line 117 ---------------------------------------- -- 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, . ); . } . 507,704 ( 0.00%) if let ExprKind::MethodCall(method, lhs_expr, [rhs_expr], _) = expr.kind 40,584 ( 0.00%) && cx.ty_based_def(expr).opt_parent(cx).is_diag_item(cx, sym::PartialEq) 2 ( 0.00%) && !expr.span.from_expansion() . { 10 ( 0.00%) self.check_empty_expr( 27 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/len_zero.rs:::check_empty_expr (1x) . cx, 1 ( 0.00%) expr.span, . lhs_expr, 2 ( 0.00%) peel_ref_operators(cx, rhs_expr), 19 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::peel_ref_operators (1x) 1 ( 0.00%) if method.ident.name == sym::ne { . "!" . } else { . Default::default() . }, . ); . } . 489,654 ( 0.00%) if let ExprKind::Binary(Spanned { node: cmp, .. }, left, right) = expr.kind 13,472 ( 0.00%) && !expr.span.from_expansion() . { . // expr.span might contains parenthesis, see issue #10529 3,946 ( 0.00%) let actual_span = span_without_enclosing_paren(cx, expr.span); 20,295 ( 0.00%) match cmp { . BinOpKind::Eq => { 21,109 ( 0.00%) self.check_cmp(cx, actual_span, left, right, "", 0); // len == 0 350,791 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/len_zero.rs:::check_cmp (1,919x) 15,352 ( 0.00%) self.check_cmp(cx, actual_span, right, left, "", 0); // 0 == len . }, . BinOpKind::Ne => { 1,573 ( 0.00%) self.check_cmp(cx, actual_span, left, right, "!", 0); // len != 0 7,877 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/len_zero.rs:::check_cmp (121x) 847 ( 0.00%) self.check_cmp(cx, actual_span, right, left, "!", 0); // 0 != len . }, . BinOpKind::Gt => { 902 ( 0.00%) self.check_cmp(cx, actual_span, left, right, "!", 0); // len > 0 735,320 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/len_zero.rs:::check_cmp (82x) 574 ( 0.00%) self.check_cmp(cx, actual_span, right, left, "", 1); // 1 > len . }, . BinOpKind::Lt => { 1,353 ( 0.00%) self.check_cmp(cx, actual_span, left, right, "", 1); // len < 1 7,197 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/len_zero.rs:::check_cmp (123x) 738 ( 0.00%) self.check_cmp(cx, actual_span, right, left, "!", 0); // 0 < len . }, 3,114 ( 0.00%) BinOpKind::Ge => self.check_cmp(cx, actual_span, left, right, "!", 1), // len >= 1 275 ( 0.00%) BinOpKind::Le => self.check_cmp(cx, actual_span, right, left, "!", 1), // 1 <= len . _ => (), . } . } 1,937,824 ( 0.02%) } . } . . impl LenZero { 45,576 ( 0.00%) fn check_cmp( . &self, . cx: &LateContext<'_>, . span: Span, . method: &Expr<'_>, . lit: &Expr<'_>, . op: &str, . compare_to: u32, . ) { 10,128 ( 0.00%) if method.span.from_expansion() { . return; . } . 11,590 ( 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 185 ( 0.00%) if parent_item_name(cx, method) == Some(sym::is_empty) { 6,630 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::parent_item_name (37x) . return; . } . 148 ( 0.00%) self.check_len(cx, span, method_path.ident.name, receiver, &lit.node, op, compare_to); . } else { 40,216 ( 0.00%) self.check_empty_expr(cx, span, method, lit, op); 137,409 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/len_zero.rs:::check_empty_expr (5,027x) . } 296 ( 0.00%) } . . #[expect(clippy::too_many_arguments)] . fn check_len( . &self, . cx: &LateContext<'_>, . span: Span, . method_name: Symbol, . receiver: &Expr<'_>, . lit: &LitKind, . op: &str, . compare_to: u32, . ) { 112 ( 0.00%) if let LitKind::Int(lit, _) = *lit { . // check if length is compared to the specified number . if lit != u128::from(compare_to) { . return; . } . 20 ( 0.00%) if method_name == sym::len && has_is_empty(cx, receiver, self.msrv) { 11,350 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/len_zero.rs:clippy_lints::len_zero::has_is_empty (4x) 4 ( 0.00%) let mut applicability = Applicability::MachineApplicable; 40 ( 0.00%) span_lint_and_sugg( 946,028 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_sugg:: (4x) . cx, . LEN_ZERO, . span, 48 ( 0.00%) format!("length comparison to {}", if compare_to == 0 { "zero" } else { "one" }), 8 ( 0.00%) format!("using `{op}is_empty` is clearer and more explicit"), 20 ( 0.00%) format!( . "{op}{}.is_empty()", 20 ( 0.00%) snippet_with_context(cx, receiver.span, span.ctxt(), "_", &mut applicability).0, . ), . applicability, . ); . } . } . } . 70,392 ( 0.00%) fn check_empty_expr(&self, cx: &LateContext<'_>, span: Span, lit1: &Expr<'_>, lit2: &Expr<'_>, op: &str) { 5 ( 0.00%) 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, . 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, . ); . } 40,224 ( 0.00%) } . } . . fn span_without_enclosing_paren(cx: &LateContext<'_>, span: Span) -> Span { 27,622 ( 0.00%) let Some(snippet) = span.get_text(cx) else { . return span; . }; 11,838 ( 0.00%) if has_enclosing_paren(snippet) { 290,847 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/sugg.rs:clippy_utils::sugg::has_enclosing_paren:: (3,946x) 285 ( 0.00%) let source_map = cx.tcx.sess.source_map(); 1,140 ( 0.00%) let left_paren = source_map.start_point(span); 96,605 ( 0.00%) => ???:::start_point (285x) 855 ( 0.00%) let right_parent = source_map.end_point(span); 124,525 ( 0.00%) => ???:::end_point (285x) 570 ( 0.00%) left_paren.between(right_parent) 56,145 ( 0.00%) => ???:::between (285x) . } else { . span . } . } . . fn is_empty_string(expr: &Expr<'_>) -> bool { 11,495 ( 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 { 15,100 ( 0.00%) if let ExprKind::Array(arr) = expr.kind { . return arr.is_empty(); . } . false . } . . /// Checks if this type has an `is_empty` method. 36 ( 0.00%) fn has_is_empty(cx: &LateContext<'_>, expr: &Expr<'_>, msrv: Msrv) -> bool { . /// Gets an `AssocItem` and return true if it matches `is_empty(self)`. 21 ( 0.00%) fn is_is_empty_and_stable(cx: &LateContext<'_>, item: &ty::AssocItem, msrv: Msrv) -> bool { 3 ( 0.00%) if item.is_fn() { 9 ( 0.00%) let sig = cx.tcx.fn_sig(item.def_id).skip_binder(); . let ty = sig.skip_binder(); 24 ( 0.00%) ty.inputs().len() == 1 && msrv.is_stable(cx, item.def_id) 1,548 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::is_stable (3x) . } else { . false . } 24 ( 0.00%) } . . /// Checks the inherent impl's items for an `is_empty(self)` method. 33 ( 0.00%) fn has_is_empty_impl(cx: &LateContext<'_>, id: DefId, msrv: Msrv) -> bool { 3 ( 0.00%) cx.tcx.inherent_impls(id).iter().any(|imp| { . cx.tcx . .associated_items(*imp) 32 ( 0.00%) .filter_by_name_unhygienic(sym::is_empty) 710 ( 0.00%) => ???:::filter_by_name_unhygienic (8x) 6 ( 0.00%) .any(|item| is_is_empty_and_stable(cx, item, msrv)) 8,772 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/len_zero.rs:clippy_lints::len_zero::has_is_empty::is_is_empty_and_stable (3x) . }) 24 ( 0.00%) } . . fn ty_has_is_empty<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>, depth: usize, msrv: Msrv) -> bool { 18 ( 0.00%) match ty.kind() { . ty::Dynamic(tt, ..) => tt.principal().is_some_and(|principal| { . cx.tcx . .associated_items(principal.def_id()) . .filter_by_name_unhygienic(sym::is_empty) . .any(|item| is_is_empty_and_stable(cx, item, msrv)) . }), . &ty::Alias( . _, . ty::AliasTy { . kind: ty::Projection { def_id }, . .. . }, . ) => has_is_empty_impl(cx, def_id, msrv), . ty::Adt(id, _) => { 18 ( 0.00%) has_is_empty_impl(cx, id.did(), msrv) 11,030 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/len_zero.rs:clippy_lints::len_zero::has_is_empty::has_is_empty_impl (3x) . || (cx.tcx.recursion_limit().value_within_limit(depth) . && cx.tcx.get_diagnostic_item(sym::Deref).is_some_and(|deref_id| { . implements_trait(cx, ty, deref_id, &[]) . && cx . .get_associated_type(ty, deref_id, sym::Target) . .is_some_and(|deref_ty| ty_has_is_empty(cx, deref_ty, depth + 1, msrv)) . })) . }, . ty::Array(..) | ty::Slice(..) | ty::Str => true, . _ => false, . } . } . 8 ( 0.00%) ty_has_is_empty(cx, cx.typeck_results().expr_ty(expr).peel_refs(), 0, msrv) 160 ( 0.00%) => ???:::expr_ty (4x) 32 ( 0.00%) } 66,408 ( 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}; . 2,180,052 ( 0.02%) pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 484,456 ( 0.00%) 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. 379,268 ( 0.00%) if is_questionmark_desugar_marked_call(expr) { . return; . } 1,435,958 ( 0.01%) if let Node::Expr(parent_expr) = cx.tcx.parent_hir_node(expr.hir_id) 19,536,158 ( 0.16%) => ???:::parent_hir_node (164,455x) 156,390 ( 0.00%) && is_questionmark_desugar_marked_call(parent_expr) . { . return; . } . 623,142 ( 0.01%) let (receiver, args) = match expr.kind { . ExprKind::Call(_, args) => (None, args), 45,816 ( 0.00%) ExprKind::MethodCall(_, receiver, args, _) => (Some(receiver), args), . _ => return, . }; . . let args_to_recover = receiver . .into_iter() . .chain(args) . .filter(|arg| { 103,995 ( 0.00%) if cx.typeck_results().expr_ty(arg).is_unit() && !utils::is_unit_literal(arg) { 2,075,116 ( 0.02%) => ???:::expr_ty (51,813x) . !matches!( . &arg.kind, . ExprKind::Match(.., MatchSource::TryDesugar(_)) | ExprKind::Path(..) . ) . } else { . false . } . }) . .collect::>(); 28,099 ( 0.00%) if !args_to_recover.is_empty() && !is_from_proc_macro(cx, expr) { . lint_unit_args(cx, expr, args_to_recover.as_slice()); . } 1,937,824 ( 0.02%) } . . fn is_questionmark_desugar_marked_call(expr: &Expr<'_>) -> bool { . use rustc_span::hygiene::DesugaringKind; 405,091 ( 0.00%) if let ExprKind::Call(callee, _) = expr.kind { 206,748 ( 0.00%) callee.span.is_desugaring(DesugaringKind::QuestionMark) 6,628,195 ( 0.06%) => ???:::is_desugaring (68,916x) . } 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 ---------------------------------------- 106,133 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/functions/impl_trait_in_params.rs -------------------------------------------------------------------------------- Ir -- line 6 ---------------------------------------- . use rustc_hir::intravisit::FnKind; . use rustc_hir::{Body, GenericParam, Generics, HirId, ImplItem, ImplItemKind, TraitItem, TraitItemKind}; . use rustc_lint::LateContext; . . use super::IMPL_TRAIT_IN_PARAMS; . . fn report(cx: &LateContext<'_>, param: &GenericParam<'_>, generics: &Generics<'_>) { . // No generics with nested generics, and no generics like FnMut(x) 178 ( 0.00%) span_lint_and_then( 2,162 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then:: (2x) . cx, . IMPL_TRAIT_IN_PARAMS, 18 ( 0.00%) param.span, . "`impl Trait` used as a function parameter", . |diag| { . if let Some(gen_span) = generics.span_for_param_suggestion() { . // If there's already a generic param with the same bound, do not lint **this** suggestion. . diag.span_suggestion_verbose( . gen_span, . "add a type parameter", . format!(", {{ /* Generic name */ }}: {}", ¶m.name.ident().as_str()[5..]), -- line 25 ---------------------------------------- -- line 33 ---------------------------------------- . Applicability::HasPlaceholders, . ); . } . }, . ); . } . . pub(super) fn check_fn<'tcx>(cx: &LateContext<'_>, kind: &'tcx FnKind<'_>, body: &'tcx Body<'_>, hir_id: HirId) { 11,432 ( 0.00%) if let FnKind::ItemFn(_, generics, _) = kind 3,699 ( 0.00%) && cx.tcx.visibility(cx.tcx.hir_body_owner_def_id(body.id())).is_public() 168,754 ( 0.00%) => ???:::hir_body_owner_def_id (1,233x) 3,183 ( 0.00%) && !is_in_test(cx.tcx, hir_id) 2,169,788 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_test (1,061x) . { 1,061 ( 0.00%) for param in generics.params { 1,998 ( 0.00%) if param.is_impl_trait() { 2 ( 0.00%) report(cx, param, generics); . } . } . } . } . . pub(super) fn check_impl_item(cx: &LateContext<'_>, impl_item: &ImplItem<'_>) { 16,050 ( 0.00%) if let ImplItemKind::Fn(_, body_id) = impl_item.kind 31,312 ( 0.00%) && let hir::Node::Item(item) = cx.tcx.parent_hir_node(impl_item.hir_id()) 521,338 ( 0.00%) => ???:::parent_hir_node (3,914x) 7,828 ( 0.00%) && let hir::ItemKind::Impl(impl_) = item.kind 7,828 ( 0.00%) && let hir::Impl { of_trait: None, .. } = impl_ 5,784 ( 0.00%) && let body = cx.tcx.hir_body(body_id) 95,943 ( 0.00%) => ???:::hir_body (1,446x) 4,338 ( 0.00%) && cx.tcx.visibility(cx.tcx.hir_body_owner_def_id(body.id())).is_public() 184,084 ( 0.00%) => ???:::hir_body_owner_def_id (1,446x) 6,714 ( 0.00%) && !is_in_test(cx.tcx, impl_item.hir_id()) 3,031,764 ( 0.03%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_test (1,119x) . { 2,238 ( 0.00%) for param in impl_item.generics.params { 142 ( 0.00%) if param.is_impl_trait() { 16 ( 0.00%) report(cx, param, impl_item.generics); . } . } . } . } . . pub(super) fn check_trait_item(cx: &LateContext<'_>, trait_item: &TraitItem<'_>, avoid_breaking_exported_api: bool) { 2,526 ( 0.00%) if !avoid_breaking_exported_api . && let TraitItemKind::Fn(_, _) = trait_item.kind . && let hir::Node::Item(item) = cx.tcx.parent_hir_node(trait_item.hir_id()) . // ^^ (Will always be a trait) . && !item.vis_span.is_empty() // Is public . && !is_in_test(cx.tcx, trait_item.hir_id()) . { . for param in trait_item.generics.params { . if param.is_impl_trait() { -- line 79 ---------------------------------------- 11,193 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/misc.rs -------------------------------------------------------------------------------- Ir -- line 96 ---------------------------------------- . declare_lint_pass!(LintPass => [ . SHORT_CIRCUIT_STATEMENT, . USED_UNDERSCORE_BINDING, . USED_UNDERSCORE_ITEMS, . ]); . . impl<'tcx> LateLintPass<'tcx> for LintPass { . fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx Stmt<'_>) { 72,494 ( 0.00%) if let StmtKind::Semi(expr) = stmt.kind 18,204 ( 0.00%) && let ExprKind::Binary(binop, a, b) = &expr.kind . && matches!(binop.node, BinOpKind::And | BinOpKind::Or) . && !stmt.span.from_expansion() . && expr.span.eq_ctxt(stmt.span) . { . span_lint_hir_and_then( . cx, . SHORT_CIRCUIT_STATEMENT, . expr.hir_id, -- line 113 ---------------------------------------- -- line 117 ---------------------------------------- . let mut app = Applicability::MachineApplicable; . let test = Sugg::hir_with_context(cx, a, expr.span.ctxt(), "_", &mut app); . let test = if binop.node == BinOpKind::Or { !test } else { test }; . let then = Sugg::hir_with_context(cx, b, expr.span.ctxt(), "_", &mut app); . diag.span_suggestion(stmt.span, "replace it with", format!("if {test} {{ {then}; }}"), app); . }, . ); . } 31,696 ( 0.00%) } . 2,180,052 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 726,684 ( 0.01%) if expr.span.in_external_macro(cx.sess().source_map()) 542,598 ( 0.00%) || expr.span.desugaring_kind().is_some() 17,329,446 ( 0.14%) => ???:::desugaring_kind (180,866x) 1,410,848 ( 0.01%) || in_automatically_derived(cx.tcx, expr.hir_id) 165,680,073 ( 1.38%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::in_automatically_derived (176,356x) . { . return; . } . . used_underscore_binding(cx, expr); . used_underscore_items(cx, expr); 1,937,824 ( 0.02%) } . } . . fn used_underscore_items<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 1,008,962 ( 0.01%) let (def_id, ident) = match expr.kind { 17,677 ( 0.00%) ExprKind::Call(func, ..) => { 79,975 ( 0.00%) if let ExprKind::Path(QPath::Resolved(.., path)) = func.kind . && let Some(last_segment) = path.segments.last() . && let Res::Def(_, def_id) = last_segment.res . { . (def_id, last_segment.ident) . } else { . return; . } . }, . ExprKind::MethodCall(path, ..) => { 40,776 ( 0.00%) if let Some(def_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id) { 694,632 ( 0.01%) => ???:::type_dependent_def_id (13,592x) 13,592 ( 0.00%) (def_id, path.ident) . } else { . return; . } 13,592 ( 0.00%) }, . ExprKind::Struct(QPath::Resolved(_, path), ..) => { 1,729 ( 0.00%) if let Some(last_segment) = path.segments.last() . && let Res::Def(_, def_id) = last_segment.res . { . (def_id, last_segment.ident) . } else { . return; . } . }, . _ => return, . }; . . let name = ident.name.as_str(); . let definition_span = cx.tcx.def_span(def_id); 24,386 ( 0.00%) if name.starts_with('_') . && !name.starts_with("__") . && !definition_span.from_expansion() . && def_id.is_local() . && !cx.tcx.is_foreign_item(def_id) . { . span_lint_and_then( . cx, . USED_UNDERSCORE_ITEMS, -- line 181 ---------------------------------------- -- line 184 ---------------------------------------- . |diag| { . diag.span_note(definition_span, "item is defined here".to_string()); . }, . ); . } . } . . fn used_underscore_binding<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 1,017,328 ( 0.01%) let (definition_hir_id, ident) = match expr.kind { . ExprKind::Path(ref qpath) => { 322,968 ( 0.00%) if let QPath::Resolved(None, path) = qpath 413,514 ( 0.00%) && let Res::Local(id) = path.res 2,292 ( 0.00%) && is_used(cx, expr) . { 304,440 ( 0.00%) (id, last_path_segment(qpath).ident) 730,656 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::last_path_segment (60,888x) . } else { . return; . } 60,888 ( 0.00%) }, 24,543 ( 0.00%) ExprKind::Field(recv, ident) => { 8,181 ( 0.00%) if let Some(adt_def) = cx.typeck_results().expr_ty_adjusted(recv).ty_adt_def() 527,968 ( 0.00%) => ???:::expr_ty_adjusted (8,181x) . && let Some(field) = adt_def.all_fields().find(|field| field.name == ident.name) . && let Some(local_did) = field.did.as_local() 2,782 ( 0.00%) && !cx.tcx.type_of(field.did).skip_binder().is_phantom_data() . { . (cx.tcx.local_def_id_to_hir_id(local_did), ident) . } else { . return; . } . }, . _ => return, . }; . . let name = ident.name.as_str(); 64,883 ( 0.00%) if name.starts_with('_') 6 ( 0.00%) && !name.starts_with("__") 54 ( 0.00%) && let definition_span = cx.tcx.hir_span(definition_hir_id) 942 ( 0.00%) => ???:::hir_span (6x) . && !definition_span.from_expansion() . && !fulfill_or_allowed(cx, USED_UNDERSCORE_BINDING, [expr.hir_id, definition_hir_id]) . { . span_lint_and_then( . cx, . USED_UNDERSCORE_BINDING, . expr.span, . "used underscore-prefixed binding".to_string(), -- line 228 ---------------------------------------- -- line 232 ---------------------------------------- . ); . } . } . . /// Heuristic to see if an expression is used. Should be compatible with . /// `unused_variables`'s idea . /// of what it means for an expression to be "used". . fn is_used(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { 922,143 ( 0.01%) get_parent_expr(cx, expr).is_none_or(|parent| match parent.kind { 21,625,639 ( 0.18%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (166,257x) 1,146 ( 0.00%) ExprKind::Assign(_, rhs, _) | ExprKind::AssignOp(_, _, rhs) => { 5,730 ( 0.00%) SpanlessEq::new(cx).eq_expr(parent.span.ctxt(), rhs, expr) 2,292,146 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:::eq_expr (1,146x) . }, . _ => is_used(cx, parent), . }) . } 1,028,583 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/functions/misnamed_getters.rs -------------------------------------------------------------------------------- Ir -- line 6 ---------------------------------------- . use rustc_lint::LateContext; . use rustc_middle::ty; . use rustc_span::Span; . . use std::iter; . . use super::MISNAMED_GETTERS; . 40,012 ( 0.00%) pub fn check_fn(cx: &LateContext<'_>, kind: FnKind<'_>, decl: &FnDecl<'_>, body: &Body<'_>, span: Span) { 11,432 ( 0.00%) let FnKind::Method(ref ident, sig) = kind else { . return; . }; . . // Takes only &(mut) self 8,400 ( 0.00%) if decl.inputs.len() != 1 { . return; . } . . let name = ident.name.as_str(); . 7,535 ( 0.00%) let name = match decl.implicit_self() { 12,088 ( 0.00%) => ???:::implicit_self (1,511x) . ImplicitSelfKind::RefMut => { . let Some(name) = name.strip_suffix("_mut") else { . return; . }; . name . }, . ImplicitSelfKind::Imm | ImplicitSelfKind::Mut | ImplicitSelfKind::RefImm => name, . ImplicitSelfKind::None => return, -- line 34 ---------------------------------------- -- line 38 ---------------------------------------- . name.strip_suffix("_unchecked").unwrap_or(name) . } else { . name . }; . . // Body must be `&(mut) .name`, potentially in an `unsafe` block . // self_data is not necessarily self, to also lint sub-getters, etc… . 4,168 ( 0.00%) let block_expr = if let ExprKind::Block(block, _) = body.value.kind 1,042 ( 0.00%) && block.stmts.is_empty() 2,463 ( 0.00%) && let Some(block_expr) = block.expr . { 2,335 ( 0.00%) if let ExprKind::Block(unsafe_block, _) = block_expr.kind 1 ( 0.00%) && unsafe_block.stmts.is_empty() . && matches!( . unsafe_block.rules, . BlockCheckMode::UnsafeBlock(UnsafeSource::UserProvided) . ) . && let Some(unsafe_block_expr) = unsafe_block.expr . { . unsafe_block_expr . } else { . block_expr . } . } else { . return; . }; 2,331 ( 0.00%) let expr_span = block_expr.span; . . // Accept &, &mut and 1,607 ( 0.00%) let expr = if let ExprKind::AddrOf(_, _, tmp) = block_expr.kind { . tmp . } else { . block_expr . }; 2,197 ( 0.00%) let (self_data, used_ident) = if let ExprKind::Field(self_data, ident) = expr.kind 28 ( 0.00%) && ident.name.as_str() != name . { . (self_data, ident) . } else { . return; . }; . . let mut used_field = None; . let mut correct_field = None; . let typeck_results = cx.typeck_results(); 364 ( 0.00%) for adjusted_type in iter::once(typeck_results.expr_ty(self_data)) 3,640 ( 0.00%) => ???:::expr_ty (91x) 364 ( 0.00%) .chain(typeck_results.expr_adjustments(self_data).iter().map(|adj| adj.target)) 2,153 ( 0.00%) => ???:::expr_adjustments (91x) . { 387 ( 0.00%) let ty::Adt(def, _) = adjusted_type.kind() else { . continue; . }; . 93 ( 0.00%) for f in def.all_fields() { 243 ( 0.00%) if f.name.as_str() == name { . correct_field = Some(f); . } 233 ( 0.00%) if f.name == used_ident.name { . used_field = Some(f); . } . } . } . 455 ( 0.00%) let Some(used_field) = used_field else { . // Can happen if the field access is a tuple. We don't lint those because the getter name could not . // start with a number. . return; . }; . . let Some(correct_field) = correct_field else { . // There is no field corresponding to the getter name. . // FIXME: This can be a false positive if the correct field is reachable through deeper -- line 109 ---------------------------------------- -- line 120 ---------------------------------------- . MISNAMED_GETTERS, . span, . "getter function appears to return the wrong field", . |diag| { . diag.span_suggestion(expr_span, "consider using", sugg, Applicability::MaybeIncorrect); . }, . ); . } 45,728 ( 0.00%) } 13,536 ( 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. 136,710 ( 0.00%) pub fn check_clippy_attr(sess: &Session, attr: &A) { 3,999 ( 0.00%) if let [clippy, segment2] = &*attr.path() 3 ( 0.00%) && *clippy == sym::clippy . { . let path_span = attr . .path_span() . .expect("Clippy attributes are unparsed and have a span"); . . match *segment2 { . sym::cyclomatic_complexity => { . sess.dcx() -- line 26 ---------------------------------------- -- line 40 ---------------------------------------- . | sym::msrv . | sym::has_significant_drop . | sym::format_args => {}, . _ => { . sess.dcx().span_err(path_span, "usage of unknown attribute"); . }, . } . } 106,330 ( 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| { 6,230 ( 0.00%) if let [clippy, segment2] = &*attr.path() 11 ( 0.00%) && *clippy == sym::clippy . { . if *segment2 == sym::cyclomatic_complexity { . return false; . } . *segment2 == name . } else { . false . } . }) . } . . /// If `attrs` contain exactly one instance of a built-in Clippy attribute called `name`, . /// returns that attribute, and `None` otherwise 4,095 ( 0.00%) pub fn get_unique_builtin_attr<'a, A: AttributeExt>(sess: &'a Session, attrs: &'a [A], name: Symbol) -> Option<&'a A> { . let mut unique_attr: Option<&A> = None; . for attr in get_builtin_attr(attrs, name) { . if let Some(duplicate) = unique_attr { . sess.dcx() . .struct_span_err(attr.span(), format!("`{name}` is defined multiple times")) . .with_span_note(duplicate.span(), "first definition found here") . .emit(); . } else { . unique_attr = Some(attr); . } . } . unique_attr 3,640 ( 0.00%) } . . /// Checks whether `attrs` contain any of `proc_macro`, `proc_macro_derive` or . /// `proc_macro_attribute` . pub fn is_proc_macro(attrs: &[impl AttributeExt]) -> bool { . attrs.iter().any(AttributeExt::is_proc_macro_attr) . } . . /// 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]` 12,944 ( 0.00%) pub fn has_non_exhaustive_attr(tcx: TyCtxt<'_>, adt: AdtDef<'_>) -> bool { 3,236 ( 0.00%) adt.is_variant_list_non_exhaustive() 89,940 ( 0.00%) || find_attr!(tcx, adt.did(), NonExhaustive(..)) 403,328 ( 0.00%) => ???:>::get_attrs (1,614x) . || adt.variants().iter().any(|variant_def| { 295,370 ( 0.00%) variant_def.is_field_list_non_exhaustive() || find_attr!(tcx, variant_def.def_id, NonExhaustive(..)) 6,283,761 ( 0.05%) => ???:>::get_attrs (35,908x) . }) . || adt . .all_fields() 40,286 ( 0.00%) .any(|field_def| find_attr!(tcx, field_def.did, NonExhaustive(..))) 2,318,745 ( 0.02%) => ???:>::get_attrs (18,902x) 12,944 ( 0.00%) } . . /// Checks whether the given span contains a `#[cfg(..)]` attribute 1,801 ( 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. 413 ( 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 . }) 5,403 ( 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 { 3,680 ( 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; 1,337,664 ( 0.01%) parse_attrs(sess, attrs, name, |val| stack.push(val)); 6,975,052 ( 0.06%) => site/frontend/rust-clippy/clippy_utils/src/attrs.rs:clippy_utils::attrs::parse_attrs::<::push_attrs::{closure#0}, rustc_hir::hir::Attribute> (334,416x) . } . pub fn pop_attrs(&mut self, sess: &Session, attrs: &[impl AttributeExt], name: Symbol) { . let stack = &mut self.stack; 1,337,664 ( 0.01%) parse_attrs(sess, attrs, name, |val| { 6,977,988 ( 0.06%) => site/frontend/rust-clippy/clippy_utils/src/attrs.rs:clippy_utils::attrs::parse_attrs::<::pop_attrs::{closure#0}, rustc_hir::hir::Attribute> (334,416x) . let popped = stack.pop(); . debug_assert_eq!(popped, Some(val)); . }); . } . } . 6,688,320 ( 0.06%) 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); . } 5,350,656 ( 0.04%) } 337,831 ( 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. 656,369 ( 0.01%) #[derive(Clone, Copy, Eq, PartialEq, Hash)] . #[rustc_pass_by_value] . pub struct Span { 10,334 ( 0.00%) lo_or_index: u32, 3,102 ( 0.00%) len_with_tag_or_marker: u16, 1,551 ( 0.00%) ctxt_or_parent_or_marker: u16, . } . . // Convenience structures for all span formats. . #[derive(Clone, Copy)] . struct InlineCtxt { . lo: u32, . len: u16, . ctxt: u16, -- line 93 ---------------------------------------- -- line 109 ---------------------------------------- . #[derive(Clone, Copy)] . struct Interned { . index: u32, . } . . impl InlineCtxt { . #[inline] . fn data(self) -> SpanData { 31,845 ( 0.00%) let len = self.len as u32; . debug_assert!(len <= MAX_LEN); 36,327 ( 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 133 ---------------------------------------- . (span.lo_or_index, span.len_with_tag_or_marker, span.ctxt_or_parent_or_marker); . InlineCtxt { lo, len, ctxt } . } . } . . impl InlineParent { . #[inline] . fn data(self) -> SpanData { 104,091 ( 0.00%) let len = (self.len_with_tag & !PARENT_TAG) as u32; . debug_assert!(len <= MAX_LEN); 278,747 ( 0.00%) SpanData { . lo: BytePos(self.lo), . hi: BytePos(self.lo.debug_strict_add(len)), . ctxt: SyntaxContext::root(), . parent: Some(LocalDefId { local_def_index: DefIndex::from_u16(self.parent) }), . } . } . #[inline] . fn span(lo: u32, len: u16, parent: u16) -> Span { . let (lo_or_index, len_with_tag_or_marker, ctxt_or_parent_or_marker) = 10,644 ( 0.00%) (lo, PARENT_TAG | len, parent); . Span { lo_or_index, len_with_tag_or_marker, ctxt_or_parent_or_marker } . } . #[inline] . fn from_span(span: Span) -> InlineParent { . let (lo, len_with_tag, parent) = . (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 { 104,686 ( 0.00%) SpanData { . ctxt: SyntaxContext::from_u16(self.ctxt), 49,636 ( 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, . ) => { 28,158,086 ( 0.23%) if $span.len_with_tag_or_marker != BASE_LEN_INTERNED_MARKER { 36,172,642 ( 0.30%) 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 . } 10,310,287 ( 0.09%) } 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] 11,088 ( 0.00%) pub fn new( . mut lo: BytePos, . mut hi: BytePos, . ctxt: SyntaxContext, . parent: Option, . ) -> Self { 24,713 ( 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). 5,187 ( 0.00%) let (len, ctxt32) = (hi.0 - lo.0, ctxt.as_u32()); 94,623 ( 0.00%) if len <= MAX_LEN && ctxt32 <= MAX_CTXT { 46,886 ( 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(); 104,267 ( 0.00%) if ctxt32 == 0 && parent32 <= MAX_CTXT { . return InlineParent::span(lo.0, len as u16, parent32 as u16); . } . } . } . } . . // Otherwise small ctxt may enable the partially inline format. . let index = |ctxt| { 25,430 ( 0.00%) with_span_interner(|interner| interner.intern(&SpanData { lo, hi, ctxt, parent })) 240,364 ( 0.00%) => ???:::intern (2,543x) . }; 5 ( 0.00%) if ctxt32 <= MAX_CTXT { . // Interned ctxt should never be read, so it can use any value. 5,050 ( 0.00%) PartiallyInterned::span(index(SyntaxContext::from_u32(u32::MAX)), ctxt32 as u16) . } else { . Interned::span(index(ctxt)) . } 113,477 ( 0.00%) } . . #[inline] 28,140 ( 0.00%) pub fn data(self) -> SpanData { . let data = self.data_untracked(); 117,072 ( 0.00%) if let Some(parent) = data.parent { 171,951 ( 0.00%) (*SPAN_TRACK)(parent); 168 ( 0.00%) => ???:rustc_interface::callbacks::track_span_parent (8x) . } . data 1,756 ( 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] 972 ( 0.00%) pub fn data_untracked(self) -> SpanData { . match_span_kind! { . self, . InlineCtxt(span) => span.data(), . InlineParent(span) => span.data(), 43,948 ( 0.00%) PartiallyInterned(span) => span.data(), . Interned(span) => span.data(), . } 243 ( 0.00%) } . . /// 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! { . self, . // All branches here, except `InlineParent`, actually return `span.ctxt_or_parent_or_marker`. . // Since `Interned` is selected if the field contains `CTXT_INTERNED_MARKER` returning that value -- line 312 ---------------------------------------- -- line 321 ---------------------------------------- . Interned(_span) => SyntaxContext::from_u16(CTXT_INTERNED_MARKER), . }; . !ctxt.is_root() . } . . /// Returns `true` if this is a dummy span with any hygienic context. . #[inline] . pub fn is_dummy(self) -> bool { 394 ( 0.00%) if self.len_with_tag_or_marker != BASE_LEN_INTERNED_MARKER { . // Inline-context or inline-parent format. . let lo = self.lo_or_index; . let len = (self.len_with_tag_or_marker & !PARENT_TAG) as u32; . debug_assert!(len <= MAX_LEN); 591 ( 0.00%) lo == 0 && len == 0 . } else { . // Fully-interned or partially-interned format. . let index = self.lo_or_index; . let data = with_span_interner(|interner| interner.spans[index as usize]); . data.lo == BytePos(0) && data.hi == BytePos(0) . } . } . -- line 342 ---------------------------------------- -- line 344 ---------------------------------------- . pub fn map_ctxt(self, map: impl FnOnce(SyntaxContext) -> SyntaxContext) -> Span { . let data = match_span_kind! { . self, . InlineCtxt(span) => { . // This format occurs 1-2 orders of magnitude more often than others (#125017), . // so it makes sense to micro-optimize it to avoid `span.data()` and `Span::new()`. . let new_ctxt = map(SyntaxContext::from_u16(span.ctxt)); . let new_ctxt32 = new_ctxt.as_u32(); 96 ( 0.00%) return if new_ctxt32 <= MAX_CTXT { . // Any small new context including zero will preserve the format. 48 ( 0.00%) InlineCtxt::span(span.lo, span.len, new_ctxt32 as u16) . } else { . span.data().with_ctxt(new_ctxt) . }; . }, . InlineParent(span) => span.data(), 72 ( 0.00%) PartiallyInterned(span) => span.data(), . Interned(span) => span.data(), . }; . . data.with_ctxt(map(data.ctxt)) 252 ( 0.00%) } . . // Returns either syntactic context, if it can be retrieved without taking the interner lock, . // or an index into the interner if it cannot. . #[inline] . fn inline_ctxt(self) -> Result { . match_span_kind! { . self, . InlineCtxt(span) => Ok(SyntaxContext::from_u16(span.ctxt)), -- line 373 ---------------------------------------- -- line 377 ---------------------------------------- . } . } . . /// This function is used as a fast path when decoding the full `SpanData` is not necessary. . /// It's a cut-down version of `data_untracked`. . #[cfg_attr(not(test), rustc_diagnostic_item = "SpanCtxt")] . #[inline] . pub fn ctxt(self) -> SyntaxContext { 150 ( 0.00%) self.inline_ctxt() . .unwrap_or_else(|index| with_span_interner(|interner| interner.spans[index].ctxt)) . } . . #[inline] 64 ( 0.00%) pub fn eq_ctxt(self, other: Span) -> bool { 161,289 ( 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 . }), . } 16 ( 0.00%) } . . #[inline] . pub fn with_parent(self, parent: Option) -> Span { . let data = match_span_kind! { . self, . InlineCtxt(span) => { . // This format occurs 1-2 orders of magnitude more often than others (#126544), . // so it makes sense to micro-optimize it to avoid `span.data()` and `Span::new()`. -- line 409 ---------------------------------------- -- line 415 ---------------------------------------- . if span.ctxt == 0 && parent32 <= MAX_CTXT { . return InlineParent::span(span.lo, span.len, parent32 as u16); . } . } . } . span.data() . }, . InlineParent(span) => span.data(), 5,616 ( 0.00%) PartiallyInterned(span) => span.data(), . Interned(span) => span.data(), . }; . 5,616 ( 0.00%) if let Some(old_parent) = data.parent { 4,081 ( 0.00%) (*SPAN_TRACK)(old_parent); 32,235 ( 0.00%) => ???:rustc_interface::callbacks::track_span_parent (1,535x) . } . data.with_parent(parent) . } . . #[inline] . pub fn parent(self) -> Option { . let interned_parent = 125 ( 0.00%) |index: u32| with_span_interner(|interner| interner.spans[index as usize].parent); . match_span_kind! { . self, . InlineCtxt(_span) => None, . InlineParent(span) => Some(LocalDefId { local_def_index: DefIndex::from_u16(span.parent) }), 125 ( 0.00%) PartiallyInterned(span) => interned_parent(span.index), . Interned(span) => interned_parent(span.index), . } . } . . #[inline] . pub(crate) fn to_raw_span(self) -> RawSpan { . // Field order must match `from_raw_span`. . RawSpan(self.lo_or_index, self.len_with_tag_or_marker, self.ctxt_or_parent_or_marker) -- line 449 ---------------------------------------- -- line 466 ---------------------------------------- . let (index, _) = self.spans.insert_full(*span_data); . index as u32 . } . } . . // If an interner exists, return it. Otherwise, prepare a fresh one. . #[inline] . fn with_span_interner T>(f: F) -> T { 20,380 ( 0.00%) crate::with_session_globals(|session_globals| f(&mut session_globals.span_interner.lock())) . } 14,184,781 ( 0.12%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/operators/float_equality_without_abs.rs -------------------------------------------------------------------------------- Ir -- line 5 ---------------------------------------- . use rustc_hir::def::{DefKind, Res}; . use rustc_hir::{BinOpKind, Expr, ExprKind}; . use rustc_lint::LateContext; . use rustc_middle::ty; . use rustc_span::Spanned; . . use super::FLOAT_EQUALITY_WITHOUT_ABS; . 60,624 ( 0.00%) pub(crate) fn check<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'_>, . op: BinOpKind, . lhs: &'tcx Expr<'_>, . rhs: &'tcx Expr<'_>, . ) { 33,137 ( 0.00%) let (lhs, rhs) = match op { . BinOpKind::Lt => (lhs, rhs), . BinOpKind::Gt => (rhs, lhs), . _ => return, . }; . 660 ( 0.00%) if let ExprKind::Binary( . // left hand side is a subtraction . Spanned { . node: BinOpKind::Sub, . .. . }, . val_l, . val_r, . ) = lhs.kind . . // right hand side matches _::EPSILON 8 ( 0.00%) && let ExprKind::Path(ref epsilon_path) = rhs.kind . && let Res::Def(DefKind::AssocConst { .. }, def_id) = cx.qpath_res(epsilon_path, rhs.hir_id) . && let Some(sym) = cx.tcx.get_diagnostic_name(def_id) . && matches!(sym, sym::f16_epsilon | sym::f32_epsilon | sym::f64_epsilon | sym::f128_epsilon) . . // values of the subtractions on the left hand side are of the type float . && let t_val_l = cx.typeck_results().expr_ty(val_l) . && let t_val_r = cx.typeck_results().expr_ty(val_r) . && let ty::Float(_) = t_val_l.kind() -- line 45 ---------------------------------------- -- line 58 ---------------------------------------- . FLOAT_EQUALITY_WITHOUT_ABS, . expr.span, . "float equality check without `.abs()`", . |diag| { . diag.span_suggestion(lhs.span, "add `.abs()`", suggestion, Applicability::MaybeIncorrect); . }, . ); . } 53,888 ( 0.00%) } 458 ( 0.00%) -------------------------------------------------------------------------------- -- 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 499,827 ( 0.00%) 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. 4,352 ( 0.00%) && field.ident.as_str().as_bytes().first().is_some_and(u8::is_ascii_digit) 69,632 ( 0.00%) => ???:::as_str (2,176x) . // Type aliases can't be used as functions. 8 ( 0.00%) && !matches!( 10 ( 0.00%) cx.qpath_res(path, e.hir_id), 23 ( 0.00%) => ???:::qpath_res (1x) . Res::Def(DefKind::TyAlias | DefKind::AssocTy, _) . ) . // This is the only syntax macros can use that works for all struct types. 2 ( 0.00%) && !e.span.from_expansion() 1 ( 0.00%) && let mut has_side_effects = false 2 ( 0.00%) && let Ok(mut expr_spans) = fields . .iter() . .map(|f| { 4 ( 0.00%) has_side_effects |= f.expr.can_have_side_effects(); 18 ( 0.00%) => ???:::can_have_side_effects (1x) 6 ( 0.00%) f.ident.as_str().parse::().map(|x| (x, f.expr.span)) 32 ( 0.00%) => ???:::as_str (1x) . }) . .collect::, _>>() . // We can only reorder the expressions if there are no side effects. 3 ( 0.00%) && (!has_side_effects || expr_spans.is_sorted_by_key(|&(idx, _)| idx)) . { 6 ( 0.00%) span_lint_and_then( 277,646 ( 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#2}> (1x) . cx, . INIT_NUMBERED_FIELDS, 1 ( 0.00%) e.span, . "used a field initializer for a tuple struct", 15 ( 0.00%) |diag| { 2 ( 0.00%) if !has_side_effects { . // We already checked the order if there are side effects. . expr_spans.sort_by_key(|&(idx, _)| idx); . } 1 ( 0.00%) let mut app = Applicability::MachineApplicable; . diag.span_suggestion( 2 ( 0.00%) e.span, . "use tuple initialization", 6 ( 0.00%) format!( . "{}({})", 3 ( 0.00%) snippet_with_applicability(cx, path.span(), "..", &mut app), 5 ( 0.00%) => ???:::span (1x) . expr_spans . .into_iter() . .map( 1 ( 0.00%) |(_, span)| snippet_with_context(cx, span, SyntaxContext::root(), "..", &mut app).0 . ) . .intersperse(Cow::Borrowed(", ")) . .collect::() . ), . app, . ); . }, . ); . } 1,695,596 ( 0.01%) } . } 4,359 ( 0.00%) -------------------------------------------------------------------------------- -- 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) { 418,710 ( 0.00%) if let ExprKind::MethodCall(MethodCall { seg, receiver, .. }) = &expr.kind 69,634 ( 0.00%) && matches!(seg.ident.name, sym::expect | sym::unwrap) 2,478 ( 0.00%) && is_direct_expn_of(receiver.span, sym::option_env).is_some() 13,019 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_direct_expn_of (413x) . { . 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, . "consider using the `env!` macro instead", -- line 48 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 540,679 ( 0.00%) if let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner_expr) = expr.kind 23,889 ( 0.00%) && let ExprKind::Call(fun, args) = inner_expr.kind 8,553 ( 0.00%) && let ExprKind::Path(ref qpath) = fun.kind 11,404 ( 0.00%) && let Some(fun_def_id) = cx.qpath_res(qpath, fun.hir_id).opt_def_id() 169,092 ( 0.00%) => ???:::qpath_res (2,851x) 14,255 ( 0.00%) && let ty::Ref(_, inner_str, _) = cx.typeck_results().expr_ty_adjusted(expr).kind() 211,517 ( 0.00%) => ???:::expr_ty_adjusted (2,851x) 8,553 ( 0.00%) && inner_str.is_str() . { 5 ( 0.00%) let fun_name = cx.tcx.get_diagnostic_name(fun_def_id); 80 ( 0.00%) => ???:::get_diagnostic_name (1x) . if fun_name == Some(sym::string_new) { . span_lint_and_sugg( . cx, . UNNECESSARY_OWNED_EMPTY_STRINGS, . expr.span, . "usage of `&String::new()` for a function expecting a `&str` argument", . "try", . "\"\"".to_owned(), -- line 55 ---------------------------------------- -- line 69 ---------------------------------------- . expr.span, . "usage of `&String::from(\"\")` for a function expecting a `&str` argument", . "try", . "\"\"".to_owned(), . Applicability::MachineApplicable, . ); . } . } 1,937,824 ( 0.02%) } . } 19,957 ( 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, exp: &Expr<'tcx>) { 539,892 ( 0.00%) if let ExprKind::Call(maybe_path, [src, radix]) = &exp.kind 44,840 ( 0.00%) && let ExprKind::Path(QPath::TypeRelative(ty, pathseg)) = &maybe_path.kind . . // check if the second argument is a primitive `10` 84 ( 0.00%) && is_integer_literal(radix, 10) . . // check if the second part of the path indeed calls the associated . // function `from_str_radix` 4 ( 0.00%) && pathseg.ident.name == sym::from_str_radix . . // check if the first part of the path is some integer primitive . && let TyKind::Path(ty_qpath) = &ty.kind . && let ty_res = cx.qpath_res(ty_qpath, ty.hir_id) . && let def::Res::PrimTy(prim_ty) = ty_res . && matches!(prim_ty, PrimTy::Int(_) | PrimTy::Uint(_)) . . // do not lint in constant context, because the suggestion won't work. -- line 63 ---------------------------------------- -- 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, . ); . } 1,937,824 ( 0.02%) } . } . . /// 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() . } 5,925 ( 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_hir/src/def.rs -------------------------------------------------------------------------------- Ir -- line 91 ---------------------------------------- . DeriveHelper, . /// Single-segment custom attribute registered by a derive macro . /// but used before that derive macro was expanded (deprecated). . DeriveHelperCompat, . } . . /// What kind of definition something is; e.g., `mod` vs `struct`. . /// `enum DefPathData` may need to be updated if a new variant is added here. 36,920 ( 0.00%) #[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug, StableHash)] . pub enum DefKind { . // Type namespace . Mod, . /// Refers to the struct itself, [`DefKind::Ctor`] refers to its constructor if it exists. . Struct, . Union, . Enum, . /// Refers to the variant itself, [`DefKind::Ctor`] refers to its constructor if it exists. -- line 107 ---------------------------------------- -- line 122 ---------------------------------------- . Fn, . Const { . is_type_const: bool, . }, . /// Constant generic parameter: `struct Foo { ... }` . ConstParam, . Static { . /// Whether it's a `unsafe static`, `safe static` (inside extern only) or just a `static`. 2 ( 0.00%) safety: hir::Safety, . /// Whether it's a `static mut` or just a `static`. . mutability: ast::Mutability, . /// Whether it's an anonymous static generated for nested allocations. 1 ( 0.00%) nested: bool, . }, . /// Refers to the struct or enum variant's constructor. . /// . /// ``` . /// struct S; . /// let x = S; // S in the value namespace is a Ctor . /// ``` . /// -- line 142 ---------------------------------------- -- line 264 ---------------------------------------- . | DefKind::Use . | DefKind::ExternCrate => "an", . DefKind::Macro(kinds) => kinds.article(), . _ => "a", . } . } . . pub fn ns(&self) -> Option { 582 ( 0.00%) match self { . DefKind::Mod . | DefKind::Struct . | DefKind::Union . | DefKind::Enum . | DefKind::Variant . | DefKind::Trait . | DefKind::TyAlias . | DefKind::ForeignTy -- line 280 ---------------------------------------- -- line 360 ---------------------------------------- . . #[inline] . pub fn is_adt(self) -> bool { . matches!(self, DefKind::Struct | DefKind::Union | DefKind::Enum) . } . . #[inline] . pub fn is_fn_like(self) -> bool { 12 ( 0.00%) matches!( 12 ( 0.00%) self, . DefKind::Fn | DefKind::AssocFn | DefKind::Closure | DefKind::SyntheticCoroutineBody . ) . } . . /// Whether the corresponding item has generic parameters, i.e. the `generics_of` query works. . pub fn has_generics(self) -> bool { . match self { . DefKind::AnonConst -- line 377 ---------------------------------------- -- line 467 ---------------------------------------- . /// - `String` will resolve to [`Res::Def`], and the `Res` will include the [`DefId`] . /// for `String` as defined in the standard library; . /// - `String::from` will also resolve to [`Res::Def`], with the [`DefId`] . /// pointing to `String::from`; . /// - `s` will resolve to [`Res::Local`]; . /// - the call to `str_to_string` will resolve to [`Res::Def`], with the [`DefId`] . /// pointing to the definition of `str_to_string` in the current crate. . // 17,649 ( 0.00%) #[derive(Clone, Copy, PartialEq, Eq, Encodable, Decodable, Hash, Debug, StableHash)] . pub enum Res { . /// Definition having a unique ID (`DefId`), corresponds to something defined in user code. . /// . /// **Not bound to a specific namespace.** . Def(DefKind, DefId), . . // Type namespace . /// A primitive type such as `i32` or `str`. -- line 483 ---------------------------------------- -- line 634 ---------------------------------------- . #[inline] . pub fn expect_full_res(&self) -> Res { . self.full_res().expect("unexpected unresolved segments") . } . } . . /// Different kinds of symbols can coexist even if they share the same textual name. . /// Therefore, they each have a separate universe (known as a "namespace"). 108 ( 0.00%) #[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash, Debug, Encodable, Decodable)] . #[derive(StableHash)] . pub enum Namespace { . /// The type namespace includes `struct`s, `enum`s, `union`s, `trait`s, and `mod`s . /// (and, by extension, crates). . /// . /// Note that the type namespace includes other items; this is not an . /// exhaustive list. . TypeNS, -- line 650 ---------------------------------------- -- line 784 ---------------------------------------- . where . Id: Debug, . { . self.opt_def_id().unwrap_or_else(|| panic!("attempted .def_id() on invalid res: {self:?}")) . } . . /// Return `Some(..)` with the `DefId` of this `Res` if it has a ID, else `None`. . pub fn opt_def_id(&self) -> Option { 1,051,091 ( 0.01%) match *self { 618,022 ( 0.01%) Res::Def(_, id) => Some(id), . . Res::Local(..) . | Res::PrimTy(..) . | Res::SelfTyParam { .. } . | Res::SelfTyAlias { .. } . | Res::SelfCtor(..) . | Res::ToolMod . | Res::OpenMod(..) -- line 801 ---------------------------------------- -- line 893 ---------------------------------------- . Res::Def(DefKind::Macro(kinds), _) => Some(kinds), . Res::NonMacroAttr(..) => Some(MacroKinds::ATTR), . _ => None, . } . } . . /// Returns `None` if this is `Res::Err` . pub fn ns(&self) -> Option { 160 ( 0.00%) match self { . Res::Def(kind, ..) => kind.ns(), . Res::PrimTy(..) . | Res::SelfTyParam { .. } . | Res::SelfTyAlias { .. } . | Res::ToolMod . | Res::OpenMod(..) => Some(Namespace::TypeNS), . Res::SelfCtor(..) | Res::Local(..) => Some(Namespace::ValueNS), . Res::NonMacroAttr(..) => Some(Namespace::MacroNS), -- line 909 ---------------------------------------- 241,014 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/definition_in_module_root.rs -------------------------------------------------------------------------------- Ir -- line 57 ---------------------------------------- . pub struct DefinitionInModuleRoot { . /// Stack tracking whether items at the current nesting level are in a . /// `mod.rs` file. When the stack is empty, we are at crate root depth . /// (not linted). . module_stack: Vec, . } . . impl EarlyLintPass for DefinitionInModuleRoot { 39,968 ( 0.00%) fn check_item(&mut self, cx: &EarlyContext<'_>, item: &ast::Item) { . // Handle module items: push state for their children. 15,412 ( 0.00%) match &item.kind { . ItemKind::Mod(.., ModKind::Loaded(_, Inline::No { .. }, mod_spans, ..)) => { 515 ( 0.00%) let file = cx.sess().source_map().lookup_source_file(mod_spans.inner_span.lo()); 15,347 ( 0.00%) => ???:::lookup_source_file (103x) . self.module_stack.push(is_mod_rs(&file)); . return; . }, . ItemKind::Mod(..) => { . // Inline module or unloaded — children are not in a root file. . self.module_stack.push(false); 3 ( 0.00%) return; . }, . _ => {}, . } . . // Skip items from macro expansion. 9,780 ( 0.00%) if item.span.from_expansion() { . return; . } . . // Only lint inside mod.rs files (not at crate root depth). 6,394 ( 0.00%) if !self.module_stack.last().copied().unwrap_or(false) { . return; . } . 268 ( 0.00%) let Some(kind) = definition_kind(item) else { . return; . }; . 216 ( 0.00%) let help = if let Some(ident) = item.kind.ident() { 378 ( 0.00%) format!("move {kind} `{ident}` to a dedicated file") . } else { 105 ( 0.00%) format!("move the {kind} to a dedicated file") . }; . . span_lint_and_help( . cx, . DEFINITION_IN_MODULE_ROOT, 89 ( 0.00%) item.span, . "definition in module root file", 178 ( 0.00%) None, . help, . ); 39,968 ( 0.00%) } . . fn check_item_post(&mut self, _: &EarlyContext<'_>, item: &ast::Item) { 39,968 ( 0.00%) if matches!(item.kind, ItemKind::Mod(..)) { . self.module_stack.pop(); . } . } . } . . /// Returns a human-readable kind string for flagged items, or `None` for . /// items that are allowed in root files (modules, imports, re-exports, . /// `#[macro_export]` macros). -- line 120 ---------------------------------------- -- line 146 ---------------------------------------- . . /// Check if an item has `#[macro_export]`. . fn has_macro_export(item: &ast::Item) -> bool { . item.attrs.iter().any(|attr| attr.has_name(sym::macro_export)) . } . . /// Check if a source file is `mod.rs`. . fn is_mod_rs(file: &SourceFile) -> bool { 206 ( 0.00%) if let FileName::Real(name) = &file.name { . name.local_path() 103 ( 0.00%) .and_then(|p| p.file_name()) 22,995 ( 0.00%) => ???:::file_name (103x) . .is_some_and(|n| n == "mod.rs") . } else { . false . } . } 1,182 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_utils/src/source.rs -------------------------------------------------------------------------------- Ir -- line 46 ---------------------------------------- . #[inline] . fn source_map(self) -> &'sm SourceMap { . ::rustc_lint::LintContext::sess(self).source_map() . } . } . impl<'sm> HasSourceMap<'sm> for &LateContext<'sm> { . #[inline] . fn source_map(self) -> &'sm SourceMap { 22,780 ( 0.00%) self.tcx.sess.source_map() . } . } . . /// Conversion of a value into the range portion of a `Span`. . pub trait SpanRange: Sized { . fn into_range(self) -> Range; . } . impl SpanRange for Span { 118,450 ( 0.00%) fn into_range(self) -> Range { . let data = self.data(); 47,380 ( 0.00%) data.lo..data.hi 47,380 ( 0.00%) } . } . impl SpanRange for SpanData { . fn into_range(self) -> Range { . self.lo..self.hi . } . } . impl SpanRange for Range { . fn into_range(self) -> Range { -- line 74 ---------------------------------------- -- line 93 ---------------------------------------- . fn into_span(self) -> Span { . self.span() . } . fn with_ctxt(self, ctxt: SyntaxContext) -> Span { . Span::new(self.lo, self.hi, ctxt, self.parent) . } . } . impl IntoSpan for Range { 2,120 ( 0.00%) fn into_span(self) -> Span { . Span::with_root_ctxt(self.start, self.end) 1,060 ( 0.00%) } 5 ( 0.00%) fn with_ctxt(self, ctxt: SyntaxContext) -> Span { . Span::new(self.start, self.end, ctxt, None) 3 ( 0.00%) } . } . . pub trait SpanExt: SpanRange { . /// Attempts to get a handle to the source text. Returns `None` if either the span is malformed, . /// or the source text is not accessible. 960 ( 0.00%) fn get_text<'sm>(self, sm: impl HasSourceMap<'sm>) -> Option { 74,887 ( 0.00%) get_source_range(sm.source_map(), self.into_range()).and_then(SourceText::new) 6,045 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::get_source_range (15x) 630 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:::into_range (15x) 1,200 ( 0.00%) } . . /// Gets the source file, and range in the file, of the given span. Returns `None` if the span . /// extends through multiple files, or is malformed. . fn get_source_range<'sm>(self, sm: impl HasSourceMap<'sm>) -> Option { 18,016 ( 0.00%) get_source_range(sm.source_map(), self.into_range()) 30,225 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::get_source_range (75x) . } . . /// Calls the given function with the source text referenced and returns the value. Returns . /// `None` if the source text cannot be retrieved. 14,749 ( 0.00%) fn with_source_text<'sm, T>(self, sm: impl HasSourceMap<'sm>, f: impl for<'a> FnOnce(&'a str) -> T) -> Option { 31,306 ( 0.00%) with_source_text(sm.source_map(), self.into_range(), f) 1,067,653 ( 0.01%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::with_source_text:: (1,801x) 86,198 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:::into_range (1,801x) 18,050 ( 0.00%) } . . /// Checks if the referenced source text satisfies the given predicate. Returns `false` if the . /// source text cannot be retrieved. . fn check_text<'sm>(self, sm: impl HasSourceMap<'sm>, pred: impl for<'a> FnOnce(&'a str) -> bool) -> bool { 8,599 ( 0.00%) self.with_source_text(sm, pred).unwrap_or(false) 803 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:::with_source_text::::{closure#0}> (1x) . } . . /// Calls the given function with the both the text of the source file and the referenced range, . /// and returns the value. Returns `None` if the source text cannot be retrieved. . fn with_source_text_and_range<'sm, T>( . self, . sm: impl HasSourceMap<'sm>, . f: impl for<'a> FnOnce(&'a str, Range) -> T, -- line 139 ---------------------------------------- -- line 141 ---------------------------------------- . with_source_text_and_range(sm.source_map(), self.into_range(), f) . } . . /// Calls the given function with the both the text of the source file and the referenced range, . /// and creates a new span with the returned range. Returns `None` if the source text cannot be . /// retrieved, or no result is returned. . /// . /// The new range must reside within the same source file. 5 ( 0.00%) fn map_range<'sm>( . self, . sm: impl HasSourceMap<'sm>, . f: impl for<'a> FnOnce(&'a SourceFile, &'a str, Range) -> Option>, . ) -> Option> { 5 ( 0.00%) map_range(sm.source_map(), self.into_range(), f) 42 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:::into_range (1x) 6 ( 0.00%) } . . /// Extends the range to include all preceding whitespace characters. . /// . /// The range will not be expanded if it would cross a line boundary, the line the range would . /// be extended to ends with a line comment and the text after the range contains a . /// non-whitespace character on the same line. e.g. . /// . /// ```ignore . /// ( // Some comment . /// foo) . /// ``` . /// . /// When the range points to `foo`, suggesting to remove the range after it's been extended will . /// cause the `)` to be placed inside the line comment as `( // Some comment)`. . fn with_leading_whitespace<'sm>(self, sm: impl HasSourceMap<'sm>) -> Range { 2,650 ( 0.00%) with_leading_whitespace(sm.source_map(), self.into_range()) 838,560 ( 0.01%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::with_leading_whitespace (418x) 17,556 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:::into_range (418x) . } . . /// Trims the leading whitespace from the range. . fn trim_start<'sm>(self, sm: impl HasSourceMap<'sm>) -> Range { . trim_start(sm.source_map(), self.into_range()) . } . } . impl SpanExt for T {} . . /// Handle to a range of text in a source file. . pub struct SourceText(SourceFileRange); . impl SourceText { . /// Takes ownership of the source file handle if the source text is accessible. 11,496 ( 0.00%) pub fn new(text: SourceFileRange) -> Option { . if text.as_str().is_some() { 45,984 ( 0.00%) Some(Self(text)) . } else { . None . } 11,496 ( 0.00%) } . . /// Gets the source text. . pub fn as_str(&self) -> &str { . self.0.as_str().unwrap() . } . . /// Converts this into an owned string. 145 ( 0.00%) pub fn to_owned(&self) -> String { . self.as_str().to_owned() 203 ( 0.00%) } . } . impl Deref for SourceText { . type Target = str; . fn deref(&self) -> &Self::Target { . self.as_str() 11,463 ( 0.00%) } . } . impl AsRef for SourceText { . fn as_ref(&self) -> &str { . self.as_str() . } . } . impl Index for SourceText . where -- line 215 ---------------------------------------- -- line 216 ---------------------------------------- . str: Index, . { . type Output = >::Output; . fn index(&self, idx: T) -> &Self::Output { . &self.as_str()[idx] . } . } . impl fmt::Display for SourceText { 17 ( 0.00%) fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 17 ( 0.00%) self.as_str().fmt(f) 3,717 ( 0.00%) => ???:::fmt (17x) . } . } . impl fmt::Debug for SourceText { . fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { . self.as_str().fmt(f) . } . } . 250,860 ( 0.00%) fn get_source_range(sm: &SourceMap, sp: Range) -> Option { 200,688 ( 0.00%) let start = sm.lookup_byte_offset(sp.start); 4,019,254 ( 0.03%) => ???:::lookup_byte_offset (25,086x) 125,430 ( 0.00%) let end = sm.lookup_byte_offset(sp.end); 4,019,254 ( 0.03%) => ???:::lookup_byte_offset (25,086x) 75,258 ( 0.00%) if !Arc::ptr_eq(&start.sf, &end.sf) || start.pos > end.pos { . return None; . } 75,258 ( 0.00%) sm.ensure_source_file_source_present(&start.sf); 701,586 ( 0.01%) => ???:::ensure_source_file_source_present (25,086x) . let range = start.pos.to_usize()..end.pos.to_usize(); 100,344 ( 0.00%) Some(SourceFileRange { sf: start.sf, range }) 225,774 ( 0.00%) } . 19,811 ( 0.00%) fn with_source_text(sm: &SourceMap, sp: Range, f: impl for<'a> FnOnce(&'a str) -> T) -> Option { 94,597 ( 0.00%) if let Some(src) = get_source_range(sm, sp) 679,821 ( 0.01%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::get_source_range (1,687x) 29,245 ( 0.00%) && let Some(src) = src.as_str() 47,236 ( 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_str (1,687x) . { . Some(f(src)) . } else { . None . } 14,408 ( 0.00%) } . . fn with_source_text_and_range( . sm: &SourceMap, . sp: Range, . f: impl for<'a> FnOnce(&'a str, Range) -> T, . ) -> Option { . if let Some(src) = get_source_range(sm, sp) . && let Some(text) = &src.sf.src -- line 261 ---------------------------------------- -- line 267 ---------------------------------------- . } . . #[expect(clippy::cast_possible_truncation)] . fn map_range( . sm: &SourceMap, . sp: Range, . f: impl for<'a> FnOnce(&'a SourceFile, &'a str, Range) -> Option>, . ) -> Option> { 4,779 ( 0.00%) if let Some(src) = get_source_range(sm, sp.clone()) 403 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::get_source_range (1x) 1,593 ( 0.00%) && let Some(text) = &src.sf.src 1,063 ( 0.00%) && let Some(range) = f(&src.sf, text, src.range.clone()) . { . debug_assert!( . range.start <= text.len() && range.end <= text.len(), . "Range `{range:?}` is outside the source file (file `{}`, length `{}`)", . src.sf.name.prefer_local_unconditionally(), . text.len(), . ); . debug_assert!(range.start <= range.end, "Range `{range:?}` has overlapping bounds"); 530 ( 0.00%) let dstart = (range.start as u32).wrapping_sub(src.range.start as u32); . let dend = (range.end as u32).wrapping_sub(src.range.start as u32); 3 ( 0.00%) Some(BytePos(sp.start.0.wrapping_add(dstart))..BytePos(sp.start.0.wrapping_add(dend))) . } else { . None . } . } . . fn ends_with_line_comment_or_broken(text: &str) -> bool { 2,650 ( 0.00%) let Some(last) = tokenize(text, FrontmatterAllowed::No).last() else { . return false; . }; . match last.kind { . // Will give the wrong result on text like `" // "` where the first quote ends a string . // started earlier. The only workaround is to lex the whole file which we don't really want . // to do. . TokenKind::LineComment { .. } | TokenKind::BlockComment { terminated: false, .. } => true, . TokenKind::Literal { kind, .. } => matches!( -- line 303 ---------------------------------------- -- line 313 ---------------------------------------- . _ => false, . } . } . . fn with_leading_whitespace_inner(lines: &[RelativeBytePos], src: &str, range: Range) -> Option { . debug_assert!(lines.is_empty() || lines[0].to_u32() == 0); . . let start = src.get(..range.start)?.trim_end(); 8,064 ( 0.00%) let next_line = lines.partition_point(|&pos| pos.to_usize() <= start.len()); . if let Some(line_end) = lines.get(next_line) 1,060 ( 0.00%) && line_end.to_usize() <= range.start 265 ( 0.00%) && let prev_start = lines.get(next_line - 1).map_or(0, |&x| x.to_usize()) . && ends_with_line_comment_or_broken(&start[prev_start..]) . && let next_line = lines.partition_point(|&pos| pos.to_usize() < range.end) . && let next_start = lines.get(next_line).map_or(src.len(), |&x| x.to_usize()) . && tokenize(src.get(range.end..next_start)?, FrontmatterAllowed::No) . .any(|t| !matches!(t.kind, TokenKind::Whitespace)) . { . Some(range.start) . } else { . Some(start.len()) . } . } . 5,830 ( 0.00%) fn with_leading_whitespace(sm: &SourceMap, sp: Range) -> Range { . map_range(sm, sp.clone(), |sf, src, range| { 1,060 ( 0.00%) Some(with_leading_whitespace_inner(sf.lines(), src, range.clone())?..range.end) 4,240 ( 0.00%) => ???:::lines (530x) . }) . .unwrap_or(sp) 5,300 ( 0.00%) } . . fn trim_start(sm: &SourceMap, sp: Range) -> Range { . map_range(sm, sp.clone(), |_, src, range| { . let src = src.get(range.clone())?; . Some(range.start + (src.len() - src.trim_start().len())..range.end) . }) . .unwrap_or(sp) . } -- line 350 ---------------------------------------- -- line 355 ---------------------------------------- . } . impl SourceFileRange { . /// Attempts to get the text from the source file. This can fail if the source text isn't . /// loaded. . pub fn as_str(&self) -> Option<&str> { . (self.sf.src.as_ref().map(|src| src.as_str())) . .or_else(|| self.sf.external_src.get()?.get_source()) . .and_then(|x| x.get(self.range.clone())) 8,298 ( 0.00%) } . } . . /// Like [`snippet_block`], but add braces if the expr is not an `ExprKind::Block` with no label. 150 ( 0.00%) pub fn expr_block<'sm>( . sm: impl HasSourceMap<'sm>, . expr: &Expr<'_>, . outer: SyntaxContext, . default: &str, . indent_relative_to: Option, . app: &mut Applicability, . ) -> String { 200 ( 0.00%) let (code, from_macro) = snippet_block_with_context(sm, expr.span, outer, default, indent_relative_to, app); 630,317 ( 0.01%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::snippet_block_with_context::<&rustc_lint::context::LateContext> (25x) 138 ( 0.00%) if !from_macro 19 ( 0.00%) && let ExprKind::Block(block, None) = expr.kind . && block.rules != BlockCheckMode::UnsafeBlock(UnsafeSource::UserProvided) . { 76 ( 0.00%) code . } else { . // FIXME: add extra indent for the unsafe blocks: . // original code: unsafe { ... } . // result code: { unsafe { ... } } . // desired code: {\n unsafe { ... }\n} 18 ( 0.00%) format!("{{ {code} }}") . } 125 ( 0.00%) } . . /// Returns a new Span that extends the original Span to the first non-whitespace char of the first . /// line. . /// . /// ```rust,ignore . /// let x = (); . /// // ^^ . /// // will be converted to . /// let x = (); . /// // ^^^^^^^^^^ . /// ``` . pub fn first_line_of_span<'sm>(sm: impl HasSourceMap<'sm>, span: Span) -> Span { 14 ( 0.00%) first_char_in_first_line(sm, span).map_or(span, |first_char_pos| span.with_lo(first_char_pos)) 2,795 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::first_char_in_first_line::<&rustc_lint::context::LateContext> (2x) 166 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:>::map_or::::{closure#0}> (2x) . } . 12 ( 0.00%) fn first_char_in_first_line<'sm>(sm: impl HasSourceMap<'sm>, span: Span) -> Option { 8 ( 0.00%) let line_span = line_span(sm, span); 934 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::line_span::<&rustc_lint::context::LateContext> (2x) 4 ( 0.00%) snippet_opt(sm, line_span).and_then(|snip| { . snip.find(|c: char| !c.is_whitespace()) . .map(|pos| line_span.lo() + BytePos::from_usize(pos)) . }) 16 ( 0.00%) } . . /// Extends the span to the beginning of the spans line, incl. whitespaces. . /// . /// ```no_run . /// let x = (); . /// // ^^ . /// // will be converted to . /// let x = (); . /// // ^^^^^^^^^^^^^^ . /// ``` 400 ( 0.00%) fn line_span<'sm>(sm: impl HasSourceMap<'sm>, span: Span) -> Span { 200 ( 0.00%) let span = original_sp(span, DUMMY_SP); 1,050 ( 0.00%) => ???:rustc_span::source_map::original_sp (50x) 150 ( 0.00%) let SourceFileAndLine { sf, line } = sm.source_map().lookup_line(span.lo()).unwrap(); 13,944 ( 0.00%) => ???:::lookup_line (50x) 200 ( 0.00%) let line_start = sf.lines()[line]; 400 ( 0.00%) => ???:::lines (50x) . let line_start = sf.absolute_position(line_start); . span.with_lo(line_start) 400 ( 0.00%) } . . /// Returns the indentation of the line of a span . /// . /// ```rust,ignore . /// let x = (); . /// // ^^ -- will return 0 . /// let x = (); . /// // ^^ -- will return 4 . /// ``` 192 ( 0.00%) pub fn indent_of<'sm>(sm: impl HasSourceMap<'sm>, span: Span) -> Option { 240 ( 0.00%) snippet_opt(sm, line_span(sm, span)).and_then(|snip| snip.find(|c: char| !c.is_whitespace())) 21,660 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::line_span::<&rustc_lint::context::LateContext> (48x) 288 ( 0.00%) } . . /// Gets a snippet of the indentation of the line of a span . pub fn snippet_indent<'sm>(sm: impl HasSourceMap<'sm>, span: Span) -> Option { . snippet_opt(sm, line_span(sm, span)).map(|mut s| { . let len = s.len() - s.trim_start().len(); . s.truncate(len); . s . }) -- line 447 ---------------------------------------- -- line 467 ---------------------------------------- . /// fn into(self) -> () {} . /// ^ . /// // in case of unformatted code . /// fn into2(self)-> () {} . /// ^ . /// fn into3(self) -> () {} . /// ^ . /// ``` 18 ( 0.00%) pub fn position_before_rarrow(s: &str) -> Option { . s.rfind("->").map(|rpos| { . let mut rpos = rpos; . let chars: Vec = s.chars().collect(); 8 ( 0.00%) while rpos > 1 { 4 ( 0.00%) if let Some(c) = chars.get(rpos - 1) 4 ( 0.00%) && c.is_whitespace() . { . rpos -= 1; . continue; . } . break; . } . rpos . }) 18 ( 0.00%) } . . /// Reindent a multiline string with possibility of ignoring the first line. 407 ( 0.00%) pub fn reindent_multiline(s: &str, ignore_first: bool, indent: Option) -> String { 111 ( 0.00%) let s_space = reindent_multiline_inner(s, ignore_first, indent, ' '); 226,917 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::reindent_multiline_inner (37x) 259 ( 0.00%) let s_tab = reindent_multiline_inner(&s_space, ignore_first, indent, '\t'); 245,251 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::reindent_multiline_inner (37x) 259 ( 0.00%) reindent_multiline_inner(&s_tab, ignore_first, indent, ' ') 239,739 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::reindent_multiline_inner (37x) 333 ( 0.00%) } . 1,443 ( 0.00%) fn reindent_multiline_inner(s: &str, ignore_first: bool, indent: Option, ch: char) -> String { . let x = s . .lines() . .skip(usize::from(ignore_first)) . .filter_map(|l| { 1,104 ( 0.00%) if l.is_empty() { . None . } else { . // ignore empty lines 10,363 ( 0.00%) Some(l.char_indices().find(|&(_, x)| x != ch).unwrap_or((l.len(), ch)).0) . } . }) . .min() . .unwrap_or(0); . let indent = indent.unwrap_or(0); . s.lines() . .enumerate() . .map(|(i, l)| { 3,654 ( 0.00%) if (ignore_first && i == 0) || l.is_empty() { . l.to_owned() 4,015 ( 0.00%) } else if x > indent { . l.split_at(x - indent).1.to_owned() . } else { 214 ( 0.00%) " ".repeat(indent - x) + l . } . }) . .collect::>() . .join("\n") 888 ( 0.00%) } . . /// Converts a span to a code snippet if available, otherwise returns the default. . /// . /// This is useful if you want to provide suggestions for your lint or more generally, if you want . /// to convert a given `Span` to a `str`. . /// . /// To create suggestions consider using [`snippet_with_applicability`] to ensure that the . /// applicability stays correct. -- line 535 ---------------------------------------- -- line 541 ---------------------------------------- . /// // ^^^^^ ^^^^^^^^^^ . /// // span1 span2 . /// . /// // The snippet call would return the corresponding code snippet . /// snippet(cx, span1, "..") // -> "value" . /// snippet(cx, span2, "..") // -> "Vec::new()" . /// ``` . pub fn snippet<'a, 'sm>(sm: impl HasSourceMap<'sm>, span: Span, default: &'a str) -> Cow<'a, str> { 154 ( 0.00%) snippet_opt(sm, span).map_or_else(|| Cow::Borrowed(default), From::from) 2,625 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::snippet_opt::<&rustc_lint::context::LateContext> (5x) . } . . /// Same as [`snippet`], but it adapts the applicability level by following rules: . /// . /// - Applicability level `Unspecified` will never be changed. . /// - If the span is inside a macro, change the applicability level to `MaybeIncorrect`. . /// - If the default value is used and the applicability level is `MachineApplicable`, change it to . /// `HasPlaceholders` -- line 557 ---------------------------------------- -- line 559 ---------------------------------------- . /// If the span might realistically contain a macro call (e.g. `vec![]`), consider using . /// [`snippet_with_context`] instead. . pub fn snippet_with_applicability<'a, 'sm>( . sm: impl HasSourceMap<'sm>, . span: Span, . default: &'a str, . applicability: &mut Applicability, . ) -> Cow<'a, str> { 2,021 ( 0.00%) snippet_with_applicability_sm(sm.source_map(), span, default, applicability) 1,112 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::snippet_with_applicability_sm (2x) . } . 4,740 ( 0.00%) fn snippet_with_applicability_sm<'a>( . sm: &SourceMap, . span: Span, . default: &'a str, . applicability: &mut Applicability, . ) -> Cow<'a, str> { 2,312 ( 0.00%) if *applicability != Applicability::Unspecified && span.from_expansion() { 5 ( 0.00%) *applicability = Applicability::MaybeIncorrect; . } 11,086 ( 0.00%) if let Some(t) = snippet_opt(sm, span) { 474 ( 0.00%) Cow::Owned(t) . } else { . if *applicability == Applicability::MachineApplicable { . *applicability = Applicability::HasPlaceholders; . } . Cow::Borrowed(default) . } 3,792 ( 0.00%) } . . /// Converts a span to a code snippet. Returns `None` if not available. 1,401 ( 0.00%) pub fn snippet_opt<'sm>(sm: impl HasSourceMap<'sm>, span: Span) -> Option { 32,367 ( 0.00%) sm.source_map().span_to_snippet(span).ok() 465,805 ( 0.00%) => ???:::span_to_snippet (905x) 1,868 ( 0.00%) } . . /// Converts a span (from a block) to a code snippet if available, otherwise use default. . /// . /// This trims the code of indentation, except for the first line. Use it for blocks or block-like . /// things which need to be printed as such. . /// . /// The `indent_relative_to` arg can be used, to provide a span, where the indentation of the . /// resulting snippet of the given span. -- line 600 ---------------------------------------- -- line 646 ---------------------------------------- . applicability: &mut Applicability, . ) -> String { . let snip = snippet_with_applicability(sm, span, default, applicability); . let indent = indent_relative_to.and_then(|s| indent_of(sm, s)); . reindent_multiline(&snip, true, indent) . } . . /// Combination of [`snippet_block`] and [`snippet_with_context`]. 275 ( 0.00%) pub fn snippet_block_with_context<'sm>( . sm: impl HasSourceMap<'sm>, . span: Span, . outer: SyntaxContext, . default: &str, . indent_relative_to: Option, . app: &mut Applicability, . ) -> (String, bool) { 100 ( 0.00%) let (snip, from_macro) = snippet_with_context(sm, span, outer, default, app); 50 ( 0.00%) let indent = indent_relative_to.and_then(|s| indent_of(sm, s)); 33,185 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::indent_of::<&rustc_lint::context::LateContext> (25x) 225 ( 0.00%) (reindent_multiline(&snip, true, indent), from_macro) 575,191 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::reindent_multiline (25x) 225 ( 0.00%) } . . /// Same as [`snippet_with_applicability`], but first walks the span up to the given context. . /// . /// This will result in the macro call, rather than the expansion, if the span is from a child . /// context. If the span is not from a child context, it will be used directly instead. . /// . /// e.g. Given the expression `&vec![]`, getting a snippet from the span for `vec![]` as a HIR node . /// would result in `box []`. If given the context of the address of expression, this function will -- line 673 ---------------------------------------- -- line 676 ---------------------------------------- . /// This will also return whether or not the snippet is a macro call. . pub fn snippet_with_context<'a, 'sm>( . sm: impl HasSourceMap<'sm>, . span: Span, . outer: SyntaxContext, . default: &'a str, . applicability: &mut Applicability, . ) -> (Cow<'a, str>, bool) { 10,413 ( 0.00%) snippet_with_context_sm(sm.source_map(), span, outer, default, applicability) 3,753 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::snippet_with_context_sm (5x) . } . 23,894 ( 0.00%) fn snippet_with_context_sm<'a>( . sm: &SourceMap, . span: Span, . outer: SyntaxContext, . default: &'a str, . applicability: &mut Applicability, . ) -> (Cow<'a, str>, bool) { . // If it is just range desugaring, use the desugaring span since it may include parenthesis. 3,676 ( 0.00%) if span.desugaring_kind() == Some(DesugaringKind::RangeExpr) && span.parent_callsite().unwrap().ctxt() == outer { 176,444 ( 0.00%) => ???:::desugaring_kind (1,838x) . return (snippet_with_applicability_sm(sm, span, default, applicability), false); . } . . let (span, is_macro_call) = walk_span_to_context(span, outer).map_or_else( . || { . // The span is from a macro argument, and the outer context is the macro using the argument . if *applicability != Applicability::Unspecified { . *applicability = Applicability::MaybeIncorrect; -- line 703 ---------------------------------------- -- line 707 ---------------------------------------- . }, . |outer_span| (outer_span, span.ctxt() != outer), . ); . . ( . snippet_with_applicability_sm(sm, span, default, applicability), . is_macro_call, . ) 16,542 ( 0.00%) } . . /// Walks the span up to the target context, thereby returning the macro call site if the span is . /// inside a macro expansion, or the original span if it is not. . /// . /// Note this will return `None` in the case of the span being in a macro expansion, but the target . /// context is from expanding a macro argument. . /// . /// Given the following -- line 723 ---------------------------------------- -- line 736 ---------------------------------------- . /// ```rust,ignore . /// macro_rules! m { ($e:expr) => { n!($e, 0) }; } . /// macro_rules! n { ($e:expr, $f:expr) => { f($e, $f) }; } . /// g(m!(0)) . /// ``` . /// . /// If called with a span of the call to `f` and a context of the call to `g` this will return a . /// span containing `m!(0)`. 17,856 ( 0.00%) pub fn walk_span_to_context(span: Span, outer: SyntaxContext) -> Option { 16,340 ( 0.00%) let outer_span = hygiene::walk_chain(span, outer); 1,296 ( 0.00%) => ???:rustc_span::hygiene::walk_chain (24x) . (outer_span.ctxt() == outer).then_some(outer_span) 17,856 ( 0.00%) } . . /// Trims the whitespace from the start and the end of the span. . pub fn trim_span(sm: &SourceMap, span: Span) -> Span { . let data = span.data(); . let sf: &_ = &sm.lookup_source_file(data.lo); . let Some(src) = sf.src.as_deref() else { . return span; . }; -- line 755 ---------------------------------------- -- line 774 ---------------------------------------- . /// ``` . pub fn expand_past_previous_comma<'sm>(sm: impl HasSourceMap<'sm>, span: Span) -> Span { . let extended = sm.source_map().span_extend_to_prev_char(span, ',', true); . extended.with_lo(extended.lo() - BytePos(1)) . } . . /// Converts `expr` to a `char` literal if it's a `str` literal containing a single . /// character (or a single byte with `ascii_only`) 80 ( 0.00%) pub fn str_literal_to_char_literal<'sm>( . sm: impl HasSourceMap<'sm>, . expr: &Expr<'_>, . applicability: &mut Applicability, . ascii_only: bool, . ) -> Option { 38 ( 0.00%) if let ExprKind::Lit(lit) = &expr.kind 20 ( 0.00%) && let LitKind::Str(r, style) = lit.node . && let string = r.as_str() 10 ( 0.00%) && let len = if ascii_only { . string.len() . } else { . string.chars().count() . } 15 ( 0.00%) && len == 1 . { 1 ( 0.00%) let snip = snippet_with_applicability(sm, expr.span, string, applicability); 2 ( 0.00%) let ch = if let StrStyle::Raw(nhash) = style { . let nhash = nhash as usize; . // for raw string: r##"a"## . &snip[(nhash + 2)..(snip.len() - 1 - nhash)] . } else { . // for regular string: "a" 1 ( 0.00%) &snip[1..(snip.len() - 1)] . }; . 3 ( 0.00%) let hint = format!( . "'{}'", . match ch { 3 ( 0.00%) "'" => "\\'", . r"\" => "\\\\", . "\\\"" => "\"", // no need to escape `"` in `'"'` . _ => ch, . } . ); . 4 ( 0.00%) Some(hint) . } else { 9 ( 0.00%) None . } 90 ( 0.00%) } . . #[cfg(test)] . mod test { . use super::reindent_multiline; . . #[test] . fn test_reindent_multiline_single_line() { . assert_eq!("", reindent_multiline("", false, None)); -- line 830 ---------------------------------------- 127,896 ( 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); 6,434,658 ( 0.05%) self.msrv.check_attributes(attrs); 5,018,244 ( 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 (1,229,832x) . } . . fn check_attributes_post(&mut self, cx: &rustc_lint::EarlyContext<'_>, attrs: &[rustc_ast::ast::Attribute]) { . let sess = rustc_lint::LintContext::sess(cx); 6,127,200 ( 0.05%) self.msrv.check_attributes_post(attrs); 5,018,244 ( 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 (1,229,832x) . } . }; . } . . /// 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 . /// ``` 78,376 ( 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)) 273 ( 0.00%) .filter(|init| cx.typeck_results().expr_adjustments(init).is_empty()) 3,404 ( 0.00%) => ???:::expr_adjustments (91x) . { . expr = init; . } . expr 46,971 ( 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`. 150 ( 0.00%) pub fn find_binding_init<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId) -> Option<&'tcx Expr<'tcx>> { 2,409 ( 0.00%) if let Node::Pat(pat) = cx.tcx.hir_node(hir_id) 18,011 ( 0.00%) => ???:::hir_node (273x) 1,786 ( 0.00%) && matches!(pat.kind, PatKind::Binding(BindingMode::NONE, ..)) 2,020 ( 0.00%) && let Node::LetStmt(local) = cx.tcx.parent_hir_node(hir_id) 29,978 ( 0.00%) => ???:::parent_hir_node (258x) . { 100 ( 0.00%) return local.init; . } . None 125 ( 0.00%) } . . /// 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 { . for (_, node) in cx.tcx.hir_parent_iter(local) { . match node { . Node::Pat(..) | Node::PatField(..) => {}, -- line 203 ---------------------------------------- -- 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"); 286,890 ( 0.00%) cx.enclosing_body.is_some_and(|id| { 143,445 ( 0.00%) cx.tcx 717,225 ( 0.01%) .hir_body_const_context(cx.tcx.hir_body_owner_def_id(id)) 30,314,164 ( 0.25%) => ???:::hir_body_const_context (143,445x) 19,198,264 ( 0.16%) => ???:::hir_body_owner_def_id (143,445x) . .is_some() . }) 143,445 ( 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 44,838 ( 0.00%) pub fn is_inside_always_const_context(tcx: TyCtxt<'_>, hir_id: HirId) -> bool { . use rustc_hir::ConstContext::{Const, ConstFn, Static}; 179,352 ( 0.00%) let Some(ctx) = tcx.hir_body_const_context(tcx.hir_enclosing_body_owner(hir_id)) else { 19,463,953 ( 0.16%) => ???:::hir_enclosing_body_owner (22,419x) 4,511,150 ( 0.04%) => ???:::hir_body_const_context (22,419x) . return false; . }; . match ctx { . ConstFn => false, . Static(_) . | Const { . allow_const_fn_promotion: _, . } => true, . } 44,838 ( 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. 36,240 ( 0.00%) pub fn is_lang_item_or_ctor(cx: &LateContext<'_>, did: DefId, item: LangItem) -> bool { 25,368 ( 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, . }; . 7,248 ( 0.00%) cx.tcx.lang_items().get(item) == Some(did) 144,960 ( 0.00%) => ???:::lang_items (3,624x) 28,992 ( 0.00%) } . . /// Checks is `expr` is `None` . pub fn is_none_expr(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { 486 ( 0.00%) expr.basic_res().ctor_parent(cx).is_lang_item(cx, OptionNone) 23,310 ( 0.00%) } . . /// If `expr` is `Some(inner)`, returns `inner` 249 ( 0.00%) pub fn as_some_expr<'tcx>(cx: &LateContext<'_>, expr: &'tcx Expr<'tcx>) -> Option<&'tcx Expr<'tcx>> { 521 ( 0.00%) if let ExprKind::Call(e, [arg]) = expr.kind 15 ( 0.00%) && e.basic_res().ctor_parent(cx).is_lang_item(cx, OptionSome) . { . Some(arg) . } else { . None . } 249 ( 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 { 10,689 ( 0.00%) matches!( 7,046 ( 0.00%) expr.kind, . ExprKind::Block( . Block { 585 ( 0.00%) stmts: [], . expr: None, . .. . }, . _ 2 ( 0.00%) ) | ExprKind::Tup([]) . ) . } . . /// Checks if given pattern is a wildcard (`_`) . pub fn is_wild(pat: &Pat<'_>) -> bool { 1,315 ( 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` 3,360 ( 0.00%) pub fn as_some_pattern<'a, 'hir>(cx: &LateContext<'_>, pat: &'a Pat<'hir>) -> Option<&'a [Pat<'hir>]> { 2,743 ( 0.00%) if let PatKind::TupleStruct(ref qpath, inner, _) = pat.kind 1,082 ( 0.00%) && cx 2,705 ( 0.00%) .qpath_res(qpath, pat.hir_id) 12,443 ( 0.00%) => ???:::qpath_res (541x) 541 ( 0.00%) .ctor_parent(cx) . .is_lang_item(cx, OptionSome) . { . Some(inner) . } else { . None . } 4,480 ( 0.00%) } . . /// Checks if the `pat` is `None`. . pub fn is_none_pattern(cx: &LateContext<'_>, pat: &Pat<'_>) -> bool { 20,483 ( 0.00%) matches!(pat.kind, 1,632 ( 0.00%) PatKind::Expr(PatExpr { kind: PatExprKind::Path(qpath), .. }) 9,488 ( 0.00%) if cx.qpath_res(qpath, pat.hir_id).ctor_parent(cx).is_lang_item(cx, OptionNone)) 40,926 ( 0.00%) => ???:::qpath_res (1,506x) 6,987 ( 0.00%) } . . /// Checks if `arm` has the form `None => None`. 3,948 ( 0.00%) pub fn is_none_arm(cx: &LateContext<'_>, arm: &Arm<'_>) -> bool { 887 ( 0.00%) is_none_pattern(cx, arm.pat) . && matches!( 116 ( 0.00%) peel_blocks(arm.body).kind, 7 ( 0.00%) ExprKind::Path(qpath) 42 ( 0.00%) if cx.qpath_res(&qpath, arm.body.hir_id).ctor_parent(cx).is_lang_item(cx, OptionNone) 161 ( 0.00%) => ???:::qpath_res (7x) . ) 4,606 ( 0.00%) } . . /// Checks if the given `QPath` belongs to a type alias. . pub fn is_ty_alias(qpath: &QPath<'_>) -> bool { 13,722 ( 0.00%) match *qpath { 64,205 ( 0.00%) QPath::Resolved(_, path) => matches!(path.res, Res::Def(DefKind::TyAlias | DefKind::AssocTy, ..)), 14,982 ( 0.00%) QPath::TypeRelative(ty, _) if let TyKind::Path(qpath) = ty.kind => is_ty_alias(&qpath), 24,872 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_ty_alias'2 (1,650x) . QPath::TypeRelative(..) => false, . } 6,861 ( 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> { 122,932 ( 0.00%) match *path { 122,752 ( 0.00%) QPath::Resolved(_, path) => path.segments.last().expect("A path must have at least one segment"), . QPath::TypeRelative(_, seg) => seg, . } 61,064 ( 0.00%) } . . pub fn qpath_generic_tys<'tcx>(qpath: &QPath<'tcx>) -> impl Iterator> { 402 ( 0.00%) last_path_segment(qpath) . .args . .map_or(&[][..], |a| a.args) . .iter() 1,206 ( 0.00%) .filter_map(|a| match a { . GenericArg::Type(ty) => Some(ty.as_unambig_ty()), . _ => None, . }) 402 ( 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) . /// } . /// } . /// ``` 113,208 ( 0.00%) pub fn trait_ref_of_method<'tcx>(cx: &LateContext<'tcx>, owner: OwnerId) -> Option<&'tcx TraitRef<'tcx>> { 99,057 ( 0.00%) if let Node::Item(item) = cx.tcx.hir_node(cx.tcx.hir_owner_parent(owner)) 943,869 ( 0.01%) => ???:::hir_node (14,151x) 28,302 ( 0.00%) && let ItemKind::Impl(impl_) = &item.kind 14,150 ( 0.00%) && let Some(of_trait) = impl_.of_trait . { . return Some(&of_trait.trait_ref); . } . None 113,208 ( 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 561 ---------------------------------------- . { . return Some(adt.did()) == cx.tcx.lang_items().string() . || (cx.tcx.get_diagnostic_name(adt.did())).is_some_and(|adt_name| std_types_symbols.contains(&adt_name)); . } . false . } . . /// Returns true if the expr is equal to `Default::default` when evaluated. 140 ( 0.00%) pub fn is_default_equivalent_call( . cx: &LateContext<'_>, . repl_func: &Expr<'_>, . whole_call_expr: Option<&Expr<'_>>, . ) -> bool { 59 ( 0.00%) if let ExprKind::Path(ref repl_func_qpath) = repl_func.kind 21 ( 0.00%) && let Some(repl_def) = cx.qpath_res(repl_func_qpath, repl_func.hir_id).opt_def(cx) 960 ( 0.00%) => ???:::qpath_res (3x) 12 ( 0.00%) && (repl_def.assoc_fn_parent(cx).is_diag_item(cx, sym::Default) . || is_default_equivalent_ctor(cx, repl_def.1, repl_func_qpath)) . { . return true; . } . . // Get the type of the whole method call expression, find the exact method definition, look at . // its body and check if it is similar to the corresponding `Default::default()` body. 22 ( 0.00%) let Some(e) = whole_call_expr else { return false }; . let Some(default_fn_def_id) = cx.tcx.get_diagnostic_item(sym::default_fn) else { . return false; . }; . let Some(ty) = cx.tcx.typeck(e.hir_id.owner.def_id).expr_ty_adjusted_opt(e) else { . return false; . }; . let args = rustc_ty::GenericArgs::for_item(cx.tcx, default_fn_def_id, |param, _| { . if let rustc_ty::GenericParamDefKind::Lifetime = param.kind { -- line 592 ---------------------------------------- -- line 651 ---------------------------------------- . { . return true; . }, . _ => {}, . } . } . } . false 112 ( 0.00%) } . . /// Returns true if the expr is equal to `Default::default()` of its type when evaluated. . /// . /// It doesn't cover all cases, like struct literals, but it is a close approximation. 169 ( 0.00%) pub fn is_default_equivalent(cx: &LateContext<'_>, e: &Expr<'_>) -> bool { 104 ( 0.00%) match &e.kind { . ExprKind::Lit(lit) => match lit.node { . LitKind::Bool(false) | LitKind::Int(Pu128(0), _) => true, . LitKind::Str(s, _) => s.is_empty(), . _ => false, . }, . ExprKind::Tup(items) | ExprKind::Array(items) => items.iter().all(|x| is_default_equivalent(cx, x)), . ExprKind::Repeat(x, len) => { 4 ( 0.00%) if let ConstArgKind::Anon(anon_const) = len.kind 7 ( 0.00%) && let ExprKind::Lit(const_lit) = cx.tcx.hir_body(anon_const.body).value.kind 83 ( 0.00%) => ???:::hir_body (1x) . && let LitKind::Int(v, _) = const_lit.node . && v <= 32 . && is_default_equivalent(cx, x) . { . true . } else { . false . } . }, 42 ( 0.00%) ExprKind::Call(repl_func, []) => is_default_equivalent_call(cx, repl_func, Some(e)), 1,749 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_default_equivalent_call (3x) . ExprKind::Call(from_func, [arg]) => is_default_equivalent_from(cx, from_func, arg), 5 ( 0.00%) ExprKind::Path(qpath) => cx 25 ( 0.00%) .qpath_res(qpath, e.hir_id) 115 ( 0.00%) => ???:::qpath_res (5x) . .ctor_parent(cx) . .is_lang_item(cx, OptionNone), . ExprKind::AddrOf(rustc_hir::BorrowKind::Ref, _, expr) => matches!(expr.kind, ExprKind::Array([])), 3 ( 0.00%) ExprKind::Block(Block { stmts: [], expr, .. }, _) => expr.is_some_and(|e| is_default_equivalent(cx, e)), . _ => false, . } 80 ( 0.00%) } . . fn is_default_equivalent_from(cx: &LateContext<'_>, from_func: &Expr<'_>, arg: &Expr<'_>) -> bool { . if let ExprKind::Path(QPath::TypeRelative(ty, seg)) = from_func.kind . && seg.ident.name == sym::from . { . match arg.kind { . ExprKind::Lit(hir::Lit { . node: LitKind::Str(sym, _), -- line 702 ---------------------------------------- -- line 743 ---------------------------------------- . /// `ignore_locals` set. The type `(usize, &mut String)` can have the second element moved, so it . /// isn't always safe to move into a closure when only a single field is needed. . /// . /// When called on the `continue` expression this will return false unless the outer loop expression . /// is in the `loop_ids` set. . /// . /// Note that this check is not recursive, so passing the `if` expression will always return true . /// even though sub-expressions might return false. 15 ( 0.00%) pub fn can_move_expr_to_closure_no_visit<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'_>, . loop_ids: &[HirId], . ignore_locals: &HirIdSet, . ) -> bool { 31 ( 0.00%) match expr.kind { . ExprKind::Break(Destination { target_id: Ok(id), .. }, _) . | ExprKind::Continue(Destination { target_id: Ok(id), .. }) . if loop_ids.contains(&id) => . { . true . }, . ExprKind::Break(..) . | ExprKind::Continue(_) -- line 765 ---------------------------------------- -- line 783 ---------------------------------------- . }, . _, . ) if !ignore_locals.contains(local_id) && can_partially_move_ty(cx, cx.typeck_results().node_type(hir_id)) => { . // TODO: check if the local has been partially moved. Assume it has for now. . false . }, . _ => true, . } 20 ( 0.00%) } . . /// How a local is captured by a closure 190 ( 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). 567 ( 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; . 693 ( 0.00%) for (parent, child_id) in hir_parent_with_src_iter(cx.tcx, e.hir_id) { 323 ( 0.00%) if let [ . Adjustment { . kind: Adjust::Deref(_) | Adjust::Borrow(AutoBorrow::Ref(..)), . target, . }, . ref adjust @ .., 235 ( 0.00%) ] = *cx . .typeck_results() . .adjustments() . .get(child_id) . .map_or(&[][..], |x| &**x) 164 ( 0.00%) && let rustc_ty::RawPtr(_, mutability) | rustc_ty::Ref(_, _, mutability) = 47 ( 0.00%) *adjust.last().map_or(target, |a| a.target).kind() . { . return CaptureKind::Ref(mutability); . } . 138 ( 0.00%) match parent { 397 ( 0.00%) Node::Expr(e) => match e.kind { 1 ( 0.00%) ExprKind::AddrOf(_, mutability, _) => return CaptureKind::Ref(mutability), . ExprKind::Index(..) | ExprKind::Unary(UnOp::Deref, _) => capture = CaptureKind::Ref(Mutability::Not), 18 ( 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, . } . } . 162 ( 0.00%) if capture == CaptureKind::Value && is_copy(cx, cx.typeck_results().expr_ty(capture_expr_ty)) { 1,080 ( 0.00%) => ???:::expr_ty (27x) . // Copy types are never automatically captured by value. . CaptureKind::Ref(Mutability::Not) . } else { . capture . } 567 ( 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`. 15 ( 0.00%) 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, . /// Local variables created in the expression. These don't need to be captured. . locals: HirIdSet, . /// Whether this expression can be turned into a closure. . allow_closure: bool, . /// Locals which need to be captured, and whether they need to be by value, reference, or . /// mutable reference. . captures: HirIdMap, . } . impl<'tcx> Visitor<'tcx> for V<'_, 'tcx> { 70 ( 0.00%) fn visit_expr(&mut self, e: &'tcx Expr<'_>) { 20 ( 0.00%) if !self.allow_closure { . return; . } . 89 ( 0.00%) match e.kind { 12 ( 0.00%) ExprKind::Path(QPath::Resolved(None, &Path { res: Res::Local(l), .. })) => { 3 ( 0.00%) if !self.locals.contains(&l) { 15 ( 0.00%) let cap = capture_local_usage(self.cx, e); 50,864 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::capture_local_usage (3x) 24 ( 0.00%) self.captures.entry(l).and_modify(|e| *e |= cap).or_insert(cap); 699 ( 0.00%) => /rust/deps/indexmap-2.14.0/src/map/entry.rs:>::or_insert (3x) 24 ( 0.00%) => /rust/deps/indexmap-2.14.0/src/map/entry.rs:>::and_modify::<::visit_expr::{closure#0}> (3x) . } . }, 2 ( 0.00%) ExprKind::Closure(closure) => { 10 ( 0.00%) for capture in self.cx.typeck_results().closure_min_captures_flattened(closure.def_id) { 24 ( 0.00%) => ???:::closure_min_captures_flattened (2x) . let local_id = match capture.place.base { . PlaceBase::Local(id) => id, . PlaceBase::Upvar(var) => var.var_path.hir_id, . _ => continue, . }; . if !self.locals.contains(&local_id) { . let capture = match capture.info.capture_kind { . UpvarCapture::ByValue => CaptureKind::Value, -- line 958 ---------------------------------------- -- line 972 ---------------------------------------- . } . }, . ExprKind::Loop(b, ..) => { . self.loops.push(e.hir_id); . self.visit_block(b); . self.loops.pop(); . }, . _ => { 40 ( 0.00%) self.allow_closure &= can_move_expr_to_closure_no_visit(self.cx, e, &self.loops, &self.locals); 12 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::can_move_expr_to_closure_no_visit (1x) 50 ( 0.00%) walk_expr(self, e); 52,442 ( 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:: (1x) . }, . } 40 ( 0.00%) } . . fn visit_pat(&mut self, p: &'tcx Pat<'tcx>) { . p.each_binding_or_first(&mut |_, id, _, _| { . self.locals.insert(id); . }); . } . } . 54 ( 0.00%) let mut v = V { . cx, . loops: Vec::new(), . locals: HirIdSet::default(), . allow_closure: true, . captures: HirIdMap::default(), . }; 6 ( 0.00%) v.visit_expr(expr); 52,648 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:::visit_expr (3x) . v.allow_closure.then_some(v.captures) 18 ( 0.00%) } . . /// Arguments of a method: the receiver and all the additional arguments. . pub type MethodArguments<'tcx> = Vec<(&'tcx Expr<'tcx>, &'tcx [Expr<'tcx>])>; . . /// Returns the method names and argument list of nested method call expressions that make up . /// `expr`. method/span lists are sorted with the most recent call first. 7 ( 0.00%) pub fn method_calls<'tcx>(expr: &'tcx Expr<'tcx>, max_depth: usize) -> (Vec, MethodArguments<'tcx>, Vec) { . let mut method_names = Vec::with_capacity(max_depth); . let mut arg_lists = Vec::with_capacity(max_depth); . let mut spans = Vec::with_capacity(max_depth); . . let mut current = expr; . for _ in 0..max_depth { 2 ( 0.00%) if let ExprKind::MethodCall(path, receiver, args, _) = ¤t.kind { . if receiver.span.from_expansion() || args.iter().any(|e| e.span.from_expansion()) { . break; . } . method_names.push(path.ident.name); . arg_lists.push((*receiver, &**args)); . spans.push(path.ident.span); . current = receiver; . } else { . break; . } . } . 14 ( 0.00%) (method_names, arg_lists, spans) 9 ( 0.00%) } . . /// 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()` 523,817 ( 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 156,073 ( 0.00%) if let ExprKind::MethodCall(path, receiver, args, _) = current.kind { 6,399 ( 0.00%) if path.ident.name == *method_name { 188 ( 0.00%) 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(); 510 ( 0.00%) Some(matched) 673,479 ( 0.01%) } . . /// Returns `true` if the provided `def_id` is an entrypoint to a program. 15,543 ( 0.00%) pub fn is_entrypoint_fn(cx: &LateContext<'_>, def_id: DefId) -> bool { 1,727 ( 0.00%) cx.tcx . .entry_fn(()) . .is_some_and(|(entry_fn_def_id, _)| def_id == entry_fn_def_id) 13,816 ( 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. 273 ( 0.00%) pub fn parent_item_name(cx: &LateContext<'_>, expr: &Expr<'_>) -> Option { 234 ( 0.00%) let parent_id = cx.tcx.hir_get_parent_item(expr.hir_id).def_id; 741 ( 0.00%) => ???:::hir_get_parent_item (39x) 161 ( 0.00%) match cx.tcx.hir_node_by_def_id(parent_id) { 11 ( 0.00%) Node::Item(item) => item.kind.ident().map(|ident| ident.name), 28 ( 0.00%) Node::TraitItem(TraitItem { ident, .. }) | Node::ImplItem(ImplItem { ident, .. }) => Some(ident.name), . _ => None, . } 312 ( 0.00%) } . . pub struct ContainsName<'a, 'tcx> { . pub cx: &'a LateContext<'tcx>, . pub name: Symbol, . } . . impl<'tcx> Visitor<'tcx> for ContainsName<'_, 'tcx> { . type Result = ControlFlow<()>; -- line 1091 ---------------------------------------- -- line 1100 ---------------------------------------- . } . . fn maybe_tcx(&mut self) -> Self::MaybeTyCtxt { . self.cx.tcx . } . } . . /// Checks if an `Expr` contains a certain name. 3 ( 0.00%) pub fn contains_name<'tcx>(name: Symbol, expr: &'tcx Expr<'_>, cx: &LateContext<'tcx>) -> bool { 6 ( 0.00%) let mut cn = ContainsName { cx, name }; . cn.visit_expr(expr).is_break() 6 ( 0.00%) } . . /// Returns `true` if `expr` contains a return expression . pub fn contains_return<'tcx>(expr: impl Visitable<'tcx>) -> bool { . for_each_expr_without_closures(expr, |e| { 32 ( 0.00%) if matches!(e.kind, ExprKind::Ret(..)) { . ControlFlow::Break(()) . } else { . ControlFlow::Continue(()) . } . }) . .is_some() . } . . /// Gets the parent expression, if any –- this is useful to constrain a lint. 355,276 ( 0.00%) pub fn get_parent_expr<'tcx>(cx: &LateContext<'tcx>, e: &Expr<'_>) -> Option<&'tcx Expr<'tcx>> { 710,552 ( 0.01%) get_parent_expr_for_hir(cx, e.hir_id) 710,552 ( 0.01%) } . . /// This retrieves the parent for the given `HirId` if it's an expression. This is useful for . /// constraint lints 38,553 ( 0.00%) pub fn get_parent_expr_for_hir<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId) -> Option<&'tcx Expr<'tcx>> { 1,472,988 ( 0.01%) match cx.tcx.parent_hir_node(hir_id) { 42,245,736 ( 0.35%) => ???:::parent_hir_node (355,276x) . Node::Expr(parent) => Some(parent), . _ => None, . } 25,702 ( 0.00%) } . . /// Gets the enclosing block, if any. 692 ( 0.00%) pub fn get_enclosing_block<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId) -> Option<&'tcx Block<'tcx>> { 346 ( 0.00%) let enclosing_node = cx . .tcx 692 ( 0.00%) .hir_get_enclosing_scope(hir_id) 86,402 ( 0.00%) => ???:::hir_get_enclosing_scope (346x) 1,038 ( 0.00%) .map(|enclosing_id| cx.tcx.hir_node(enclosing_id)); 22,572 ( 0.00%) => ???:::hir_node (346x) 2,076 ( 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, . }) 1,038 ( 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 1180 ---------------------------------------- . pub fn is_upvar_in_closure(cx: &LateContext<'_>, closure: &Closure<'_>, local_id: HirId) -> bool { . cx.typeck_results() . .closure_min_captures . .get(&closure.def_id) . .is_some_and(|x| x.contains_key(&local_id)) . } . . /// Gets the loop or closure enclosing the given expression, if any. 7 ( 0.00%) pub fn get_enclosing_loop_or_multi_call_closure<'tcx>( . cx: &LateContext<'tcx>, . expr: &Expr<'_>, . ) -> Option<&'tcx Expr<'tcx>> { 7 ( 0.00%) for (_, node) in cx.tcx.hir_parent_iter(expr.hir_id) { 10 ( 0.00%) match node { 5 ( 0.00%) Node::Expr(e) => match e.kind { . ExprKind::Closure { .. } . if let rustc_ty::Closure(_, subs) = cx.typeck_results().expr_ty(e).kind() . && subs.as_closure().kind() == ClosureKind::FnOnce => {}, . . // Note: A closure's kind is determined by how it's used, not it's captures. . ExprKind::Closure { .. } | ExprKind::Loop(..) => return Some(e), . _ => (), . }, . Node::Stmt(_) | Node::Block(_) | Node::LetStmt(_) | Node::Arm(_) | Node::ExprField(_) => (), . _ => break, . } . } . None 9 ( 0.00%) } . . /// Gets the parent node if it's an impl block. 650 ( 0.00%) pub fn get_parent_as_impl(tcx: TyCtxt<'_>, id: HirId) -> Option<&Impl<'_>> { 4,550 ( 0.00%) match tcx.hir_parent_iter(id).next() { . Some(( . _, . Node::Item(Item { . kind: ItemKind::Impl(imp), . .. . }), . )) => Some(imp), . _ => None, . } 1,300 ( 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> { 23,707 ( 0.00%) while let ExprKind::Block( . Block { 4,497 ( 0.00%) stmts: [], . expr: Some(inner), . rules: BlockCheckMode::DefaultBlock, . .. . }, . _, 16,560 ( 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 }` 210 ( 0.00%) pub fn peel_blocks_with_stmt<'a>(mut expr: &'a Expr<'a>) -> &'a Expr<'a> { 37,697 ( 0.00%) while let ExprKind::Block( . Block { 33,354 ( 0.00%) stmts: [], . expr: Some(inner), . rules: BlockCheckMode::DefaultBlock, . .. . } . | Block { . stmts: . [ . Stmt { 788 ( 0.00%) kind: StmtKind::Expr(inner) | StmtKind::Semi(inner), . .. . }, . ], . expr: None, . rules: BlockCheckMode::DefaultBlock, . .. . }, . _, 10,680 ( 0.00%) ) = expr.kind . { 2,873 ( 0.00%) expr = inner; . } . expr 210 ( 0.00%) } . . /// Checks if the given expression is the else clause of either an `if` or `if let` expression. 50,880 ( 0.00%) pub fn is_else_clause(tcx: TyCtxt<'_>, expr: &Expr<'_>) -> bool { 33,920 ( 0.00%) let mut iter = tcx.hir_parent_iter(expr.hir_id); 34,838 ( 0.00%) match iter.next() { . Some(( . _, . Node::Expr(Expr { . kind: ExprKind::If(_, _, Some(else_expr)), . .. . }), . )) => else_expr.hir_id == expr.hir_id, . _ => false, . } 67,840 ( 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 1323 ---------------------------------------- . node, . Node::LetStmt(LetStmt { els: Some(els), .. }) . if els.hir_id == child_id . ) . }) . } . . /// Checks whether the given `Expr` is a range over the entire container. 7 ( 0.00%) pub fn is_full_collection_range(cx: &LateContext<'_>, container: Option, expr: &Expr<'_>) -> bool { 7 ( 0.00%) if let Some(Range { start, end, ty, .. }) = Range::hir(cx, expr) { 443 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (1x) 1 ( 0.00%) start.is_none_or(|start| is_integer_literal(start, 0)) . && end.is_none_or(|end| { . if ty.limits() == RangeLimits::HalfOpen . && let Some(container) = container . && let ExprKind::MethodCall(seg, recv, [], _) = end.kind . { . seg.ident.name == sym::len && recv.res_local_id() == Some(container) . } else { . false . } . }) . } else { . false . } 4 ( 0.00%) } . . /// Checks whether the given expression is a constant literal of the given value. . pub fn is_integer_literal(expr: &Expr<'_>, value: u128) -> bool { 19,583 ( 0.00%) if let ExprKind::Lit(spanned) = expr.kind 1,529 ( 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. 318 ( 0.00%) pub fn is_float_literal(expr: &Expr<'_>, value: f64) -> bool { 306 ( 0.00%) if let ExprKind::Lit(spanned) = expr.kind . && let LitKind::Float(v, _) = spanned.node . { . v.as_str().parse() == Ok(value) . } else { . false . } 318 ( 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. 729 ( 0.00%) pub fn is_adjusted(cx: &LateContext<'_>, e: &Expr<'_>) -> bool { 486 ( 0.00%) cx.typeck_results().adjustments().get(e.hir_id).is_some() 972 ( 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] 1,607,095 ( 0.01%) pub fn is_expn_of(mut span: Span, name: Symbol) -> Option { . loop { . if span.from_expansion() { . let data = span.ctxt().outer_expn_data(); 255,588 ( 0.00%) let new_span = data.call_site; . 437,012 ( 0.00%) if let ExpnKind::Macro(MacroKind::Bang, mac_name) = data.kind . && mac_name == name . { 952 ( 0.00%) return Some(new_span); . } . . span = new_span; . } else { 188,594 ( 0.00%) return None; . } . } 850,815 ( 0.01%) } . . /// 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] 28,098 ( 0.00%) pub fn is_direct_expn_of(span: Span, name: Symbol) -> Option { . if span.from_expansion() { . let data = span.ctxt().outer_expn_data(); 6 ( 0.00%) let new_span = data.call_site; . 4,290 ( 0.00%) if let ExpnKind::Macro(MacroKind::Bang, mac_name) = data.kind . && mac_name == name . { 12 ( 0.00%) return Some(new_span); . } . } . 3,116 ( 0.00%) None 15,610 ( 0.00%) } . . /// Convenience function to get the return type of a function. 17,759 ( 0.00%) pub fn return_ty<'tcx>(cx: &LateContext<'tcx>, fn_def_id: OwnerId) -> Ty<'tcx> { 2,537 ( 0.00%) let ret_ty = cx.tcx.fn_sig(fn_def_id).instantiate_identity().skip_norm_wip().output(); 10,148 ( 0.00%) cx.tcx.instantiate_bound_regions_with_erased(ret_ty) 218,207 ( 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:: (2,537x) 17,759 ( 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 1467 ---------------------------------------- . _ => false, . }; . } . false . } . . /// Returns `true` if a pattern is refutable. . // TODO: should be implemented using rustc/mir_build/thir machinery 8,490 ( 0.00%) pub fn is_refutable(cx: &LateContext<'_>, pat: &Pat<'_>) -> bool { . fn is_qpath_refutable(cx: &LateContext<'_>, qpath: &QPath<'_>, id: HirId) -> bool { 115 ( 0.00%) !matches!( 237 ( 0.00%) cx.qpath_res(qpath, id), 414 ( 0.00%) => ???:::qpath_res (18x) . Res::Def(DefKind::Struct, ..) | Res::Def(DefKind::Ctor(def::CtorOf::Struct, _), _) . ) . } . . fn are_refutable<'a, I: IntoIterator>>(cx: &LateContext<'_>, i: I) -> bool { 54 ( 0.00%) i.into_iter().any(|pat| is_refutable(cx, pat)) 807 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_refutable'2 (13x) . } . 6,051 ( 0.00%) match pat.kind { . PatKind::Missing => unreachable!(), . PatKind::Wild | PatKind::Never => false, // If `!` typechecked then the type is empty, so not refutable. 792 ( 0.00%) PatKind::Binding(_, _, _, pat) => pat.is_some_and(|pat| is_refutable(cx, pat)), . PatKind::Box(pat) | PatKind::Ref(pat, _, _) => is_refutable(cx, pat), . PatKind::Expr(PatExpr { 24 ( 0.00%) kind: PatExprKind::Path(qpath), . hir_id, . .. 48 ( 0.00%) }) => is_qpath_refutable(cx, qpath, *hir_id), 8 ( 0.00%) PatKind::Or(pats) => { . // TODO: should be the honest check, that pats is exhaustive set . are_refutable(cx, pats) . }, . PatKind::Tuple(pats, _) => are_refutable(cx, pats), 4 ( 0.00%) PatKind::Struct(ref qpath, fields, _) => { 6 ( 0.00%) is_qpath_refutable(cx, qpath, pat.hir_id) || are_refutable(cx, fields.iter().map(|field| field.pat)) . }, 3 ( 0.00%) PatKind::TupleStruct(ref qpath, pats, _) => { 5 ( 0.00%) is_qpath_refutable(cx, qpath, pat.hir_id) || are_refutable(cx, pats) . }, . PatKind::Slice(head, middle, tail) => { 16 ( 0.00%) match &cx.typeck_results().node_type(pat.hir_id).kind() { 82 ( 0.00%) => ???:::node_type (2x) . rustc_ty::Slice(..) => { . // [..] is the only irrefutable slice pattern. . !head.is_empty() || middle.is_none() || !tail.is_empty() . }, . rustc_ty::Array(..) => are_refutable(cx, head.iter().chain(middle).chain(tail.iter())), . _ => { . // unreachable!() . true . }, . } . }, . PatKind::Expr(..) | PatKind::Range(..) | PatKind::Err(_) | PatKind::Deref(_) | PatKind::Guard(..) => true, . } 6,792 ( 0.00%) } . . /// If the pattern is an `or` pattern, call the function once for each sub pattern. Otherwise, call . /// the function once on the given pattern. . pub fn recurse_or_patterns<'tcx, F: FnMut(&'tcx Pat<'tcx>)>(pat: &'tcx Pat<'tcx>, mut f: F) { 4,162 ( 0.00%) if let PatKind::Or(pats) = pat.kind { . pats.iter().for_each(f); . } else { 3,994 ( 0.00%) f(pat); 1,638,944 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/match_wild_enum.rs:clippy_lints::matches::match_wild_enum::check::{closure#2} (1,997x) . } . } . . pub fn is_self(slf: &Param<'_>) -> bool { . if let PatKind::Binding(.., name, _) = slf.pat.kind { . name.name == kw::SelfLower . } else { . false -- line 1539 ---------------------------------------- -- 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> { 47,140 ( 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 1603 ---------------------------------------- . /// of the expectations in `ids` . /// . /// This should only be used when the lint would otherwise be emitted, for a way to check if a lint . /// is allowed early to skip work see [`is_lint_allowed`] . /// . /// To emit at a lint at a different context than the one current see . /// [`span_lint_hir`](diagnostics::span_lint_hir) or . /// [`span_lint_hir_and_then`](diagnostics::span_lint_hir_and_then) 24 ( 0.00%) pub fn fulfill_or_allowed(cx: &LateContext<'_>, lint: &'static Lint, ids: impl IntoIterator) -> bool { . let mut suppress_lint = false; . . for id in ids { 1,008 ( 0.00%) let level_spec = cx.tcx.lint_level_spec_at_node(lint, id); 114,078 ( 0.00%) => ???:::lint_level_spec_at_node (139x) 700 ( 0.00%) if let Some(expectation) = level_spec.lint_id() { . cx.fulfill_expectation(expectation); . } . 184 ( 0.00%) match level_spec.level() { . Level::Allow | Level::Expect => suppress_lint = true, . Level::Warn | Level::ForceWarn | Level::Deny | Level::Forbid => {}, . } . } . . suppress_lint 24 ( 0.00%) } . . /// 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. 316,228 ( 0.00%) pub fn is_lint_allowed(cx: &LateContext<'_>, lint: &'static Lint, id: HirId) -> bool { 158,114 ( 0.00%) cx.tcx.lint_level_spec_at_node(lint, id).is_allow() 106,671,364 ( 0.89%) => ???:::lint_level_spec_at_node (79,057x) 158,114 ( 0.00%) } . . pub fn strip_pat_refs<'hir>(mut pat: &'hir Pat<'hir>) -> &'hir Pat<'hir> { 49 ( 0.00%) while let PatKind::Ref(subpat, _, _) = pat.kind { . pat = subpat; . } . pat . } . 130 ( 0.00%) pub fn int_bits(tcx: TyCtxt<'_>, ity: IntTy) -> u64 { . Integer::from_int_ty(&tcx, ity).size().bits() 260 ( 0.00%) } . . #[expect(clippy::cast_possible_wrap)] . /// Turn a constant int byte representation into an i128 39 ( 0.00%) pub fn sext(tcx: TyCtxt<'_>, u: u128, ity: IntTy) -> i128 { . let amt = 128 - int_bits(tcx, ity); 2,265 ( 0.00%) ((u as i128) << amt) >> amt 117 ( 0.00%) } . . #[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); 810 ( 0.00%) ((u as u128) << amt) >> amt . } . . /// clip unused bytes 1,360 ( 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; 12,240 ( 0.00%) (u << amt) >> amt 4,080 ( 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. 1,351,441 ( 0.01%) pub fn in_automatically_derived(tcx: TyCtxt<'_>, id: HirId) -> bool { . tcx.hir_parent_owner_iter(id) 2,980,452 ( 0.02%) .filter(|(_, node)| matches!(node, OwnerNode::Item(item) if matches!(item.kind, ItemKind::Impl(_)))) 144,320 ( 0.00%) .any(|(id, _)| find_attr!(tcx, id.def_id, AutomaticallyDerived)) 5,834,950 ( 0.05%) => ???:>::get_attrs (57,705x) 1,351,441 ( 0.01%) } . . /// Checks if the given `DefId` matches the `libc` item. 41,910 ( 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. 12,573 ( 0.00%) cx.tcx.crate_name(did.krate) == sym::libc && cx.tcx.def_path_str(did).ends_with(name.as_str()) 33,528 ( 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 }`. 36,368 ( 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); 13,800 ( 0.00%) if let ExprKind::Block(block, _) = then.kind { . blocks.push(block); . } else { . panic!("ExprKind::If node is not an ExprKind::Block"); . } . 9,200 ( 0.00%) if let Some(else_expr) = r#else { . expr = else_expr; . } else { . break; . } . } . . // final `else {..}` 4,546 ( 0.00%) if !blocks.is_empty() 9,477 ( 0.00%) && let ExprKind::Block(block, _) = expr.kind . { . blocks.push(block); . } . 54,552 ( 0.00%) (conds, blocks) 40,914 ( 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. 700 ( 0.00%) fn is_body_identity_function<'hir>(cx: &LateContext<'_>, func: &Body<'hir>) -> bool { 300 ( 0.00%) let [param] = func.params else { . return false; . }; . 100 ( 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>]| { . for stmt in stmts { 47 ( 0.00%) if let StmtKind::Let(local) = stmt.kind 39 ( 0.00%) && let Some(init) = local.init 65 ( 0.00%) && is_expr_identity_of_pat(cx, param_pat, init, true) 1,189 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_expr_identity_of_pat (13x) . { . param_pat = local.pat; . } else { . return false; . } . } . . true . }; . 100 ( 0.00%) let mut expr = func.value; . loop { 529 ( 0.00%) match expr.kind { . ExprKind::Block( . &Block { 80 ( 0.00%) stmts: [], . expr: Some(e), . .. . }, . _, . ) . | ExprKind::Ret(Some(e)) => expr = e, . ExprKind::Block( . &Block { 34 ( 0.00%) stmts: [stmt], . expr: None, . .. . }, . _, . ) => { . if let StmtKind::Semi(e) | StmtKind::Expr(e) = stmt.kind . && let ExprKind::Ret(Some(ret_val)) = e.kind . { . expr = ret_val; . } else { . return false; . } . }, . ExprKind::Block( . &Block { 17 ( 0.00%) stmts, expr: Some(e), .. . }, . _, . ) => { . if !advance_param_pat_over_stmts(stmts) { . return false; . } . . expr = e; -- line 1870 ---------------------------------------- -- 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; . } . }, 830 ( 0.00%) _ => return is_expr_identity_of_pat(cx, param_pat, expr, true), 7,701 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_expr_identity_of_pat (83x) . } . } 153 ( 0.00%) } . . /// 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. 882 ( 0.00%) pub fn is_expr_identity_of_pat(cx: &LateContext<'_>, pat: &Pat<'_>, expr: &Expr<'_>, by_hir: bool) -> bool { 67 ( 0.00%) if cx . .typeck_results() . .pat_binding_modes() 196 ( 0.00%) .get(pat.hir_id) 67 ( 0.00%) .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); . 1,231 ( 0.00%) match (pat.kind, expr.kind) { 134 ( 0.00%) (PatKind::Binding(_, id, _, _), _) if by_hir => { 1 ( 0.00%) 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)) 4 ( 0.00%) if dotdot.as_opt_usize().is_none() && pats.len() == tup.len() => . { 12 ( 0.00%) over(pats, tup, |pat, expr| is_expr_identity_of_pat(cx, pat, expr, by_hir)) 195 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_expr_identity_of_pat'2 (2x) . }, . (PatKind::Slice(before, None, after), ExprKind::Array(arr)) if before.len() + after.len() == arr.len() => { . zip(before.iter().chain(after), arr).all(|(pat, expr)| is_expr_identity_of_pat(cx, pat, expr, by_hir)) . }, . (PatKind::TupleStruct(pat_ident, field_pats, dotdot), ExprKind::Call(ident, fields)) . if dotdot.as_opt_usize().is_none() && field_pats.len() == fields.len() => . { . // check ident -- line 1931 ---------------------------------------- -- 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, . } 784 ( 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::` 104 ( 0.00%) pub fn is_expr_untyped_identity_function(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { 520 ( 0.00%) match expr.kind { 280 ( 0.00%) ExprKind::Closure(&Closure { body, fn_decl, .. }) 282 ( 0.00%) if fn_decl.inputs.iter().all(|ty| matches!(ty.kind, TyKind::Infer(()))) => . { 651 ( 0.00%) is_body_identity_function(cx, cx.tcx.hir_body(body)) 11,404 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_body_identity_function (93x) 8,070 ( 0.00%) => ???:::hir_body (93x) . }, . ExprKind::Path(QPath::Resolved(_, path)) 14 ( 0.00%) if path.segments.iter().all(|seg| seg.infer_args) 14 ( 0.00%) && let Some(did) = path.res.opt_def_id() => . { 28 ( 0.00%) cx.tcx.is_diagnostic_item(sym::convert_identity, did) 470 ( 0.00%) => ???:::is_diagnostic_item (7x) . }, . _ => false, . } 12 ( 0.00%) } . . /// Checks if an expression represents the identity function . /// Only examines closures and `std::convert::identity` . /// . /// NOTE: If you want to use this function to find out if a closure is unnecessary, you likely want . /// to call [`is_expr_untyped_identity_function`] instead, which makes sure that the closure doesn't . /// have type annotations. This is important because removing a closure with bindings can . /// remove type information that helped type inference before, which can then lead to compile . /// errors. . pub fn is_expr_identity_function(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { 21 ( 0.00%) match expr.kind { 77 ( 0.00%) ExprKind::Closure(&Closure { body, .. }) => is_body_identity_function(cx, cx.tcx.hir_body(body)), 943 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_body_identity_function (7x) 608 ( 0.00%) => ???:::hir_body (7x) . _ => 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. 61,096 ( 0.00%) pub fn get_expr_use_or_unification_node<'tcx>(tcx: TyCtxt<'tcx>, expr: &Expr<'_>) -> Option<(Node<'tcx>, HirId)> { 68,733 ( 0.00%) for (node, child_id) in hir_parent_with_src_iter(tcx, expr.hir_id) { 18,302 ( 0.00%) match node { . Node::Block(_) => {}, 32 ( 0.00%) Node::Arm(arm) if arm.body.hir_id == child_id => {}, 29,777 ( 0.00%) Node::Expr(expr) => match expr.kind { . ExprKind::Block(..) | ExprKind::DropTemps(_) => {}, 512 ( 0.00%) ExprKind::Match(_, [arm], _) if arm.hir_id == child_id => {}, 114 ( 0.00%) ExprKind::If(_, then_expr, None) if then_expr.hir_id == child_id => return None, 7,004 ( 0.00%) _ => return Some((Node::Expr(expr), child_id)), . }, 1,266 ( 0.00%) node => return Some((node, child_id)), . } . } . None 61,096 ( 0.00%) } . . /// Checks if the result of an expression is used, or it's type is unified with another branch. 20 ( 0.00%) pub fn is_expr_used_or_unified(tcx: TyCtxt<'_>, expr: &Expr<'_>) -> bool { 20 ( 0.00%) !matches!( 10 ( 0.00%) get_expr_use_or_unification_node(tcx, expr), 1,015 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_expr_use_or_unification_node (5x) . None | Some(( . Node::Stmt(Stmt { . kind: StmtKind::Expr(_) . | StmtKind::Semi(_) . | StmtKind::Let(LetStmt { . pat: Pat { . kind: PatKind::Wild, . .. -- line 2022 ---------------------------------------- -- line 2023 ---------------------------------------- . }, . .. . }), . .. . }), . _ . )) . ) 10 ( 0.00%) } . . /// Checks if the expression is the final expression returned from a block. 3,158 ( 0.00%) pub fn is_expr_final_block_expr(tcx: TyCtxt<'_>, expr: &Expr<'_>) -> bool { 11,053 ( 0.00%) matches!(tcx.parent_hir_node(expr.hir_id), Node::Block(..)) 183,762 ( 0.00%) => ???:::parent_hir_node (1,579x) 3,158 ( 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() . .get(base.hir_id) . .is_some_and(|x| x.iter().any(|adj| matches!(adj.kind, Adjust::Deref(_)))) . }) . } . 2 ( 0.00%) pub fn std_or_core(cx: &LateContext<'_>) -> Option<&'static str> { . if is_no_core_crate(cx) { . None . } else if is_no_std_crate(cx) { . Some("core") . } else { . Some("std") . } 4 ( 0.00%) } . 7 ( 0.00%) pub fn is_no_std_crate(cx: &LateContext<'_>) -> bool { 298 ( 0.00%) find_attr!(cx.tcx, crate, NoStd) 110 ( 0.00%) => ???:::hir_krate_attrs (2x) 21 ( 0.00%) } . . pub fn is_no_core_crate(cx: &LateContext<'_>) -> bool { 30 ( 0.00%) find_attr!(cx.tcx, crate, NoCore) 110 ( 0.00%) => ???:::hir_krate_attrs (2x) . } . . /// 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() {} . /// } . /// ``` 33,807 ( 0.00%) pub fn is_trait_impl_item(cx: &LateContext<'_>, hir_id: HirId) -> bool { 56,044 ( 0.00%) if let Node::Item(item) = cx.tcx.parent_hir_node(hir_id) { 1,498,899 ( 0.01%) => ???:::parent_hir_node (11,269x) 38,448 ( 0.00%) matches!(item.kind, ItemKind::Impl(Impl { of_trait: Some(_), .. })) . } else { . false . } 22,538 ( 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 {} . /// } . /// ``` 18 ( 0.00%) pub fn fn_has_unsatisfiable_clauses(cx: &LateContext<'_>, did: DefId) -> bool { . use rustc_trait_selection::traits; 2 ( 0.00%) let clauses = cx . .tcx . .clauses_of(did) . .clauses . .iter() . .filter_map(|(p, _)| if p.is_global() { Some(*p) } else { None }); 18 ( 0.00%) traits::impossible_clauses(cx.tcx, traits::elaborate(cx.tcx, clauses).collect::>()) 798 ( 0.00%) => ???:rustc_trait_selection::traits::impossible_clauses (2x) 84 ( 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/elaborate.rs:rustc_type_ir::elaborate::elaborate::, clippy_utils::fn_has_unsatisfiable_clauses::{closure#0}>> (2x) 16 ( 0.00%) } . . /// Returns the `DefId` of the callee if the given expression is a function or method call. 658,220 ( 0.01%) pub fn fn_def_id(cx: &LateContext<'_>, expr: &Expr<'_>) -> Option { 164,561 ( 0.00%) fn_def_id_with_node_args(cx, expr).map(|(did, _)| did) 7,260,894 ( 0.06%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::fn_def_id_with_node_args (164,555x) 329,110 ( 0.00%) } . . /// Returns the `DefId` of the callee if the given expression is a function or method call, . /// as well as its node args. 1,152,620 ( 0.01%) pub fn fn_def_id_with_node_args<'tcx>( . cx: &LateContext<'tcx>, . expr: &Expr<'_>, . ) -> Option<(DefId, GenericArgsRef<'tcx>)> { . let typeck = cx.typeck_results(); 840,224 ( 0.01%) match &expr.kind { 35,046 ( 0.00%) ExprKind::MethodCall(..) => Some(( 70,092 ( 0.00%) typeck.type_dependent_def_id(expr.hir_id)?, 597,186 ( 0.00%) => ???:::type_dependent_def_id (11,682x) 46,728 ( 0.00%) typeck.node_args(expr.hir_id), 436,952 ( 0.00%) => ???:::node_args (11,682x) 28,473 ( 0.00%) )), . ExprKind::Call( . Expr { 16,922 ( 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 84,217 ( 0.00%) if let Res::Def(DefKind::Fn | DefKind::Ctor(..) | DefKind::AssocFn, id) = 168,565 ( 0.00%) typeck.qpath_res(qpath, *path_hir_id) 662,446 ( 0.01%) => ???:::qpath_res (16,922x) . { 100,746 ( 0.00%) Some((id, typeck.node_args(*path_hir_id))) 637,827 ( 0.01%) => ???:::node_args (16,791x) . } else { . None . } . }, . _ => None, . } 1,481,940 ( 0.01%) } . . /// 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)` 95,466 ( 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 { 22,940 ( 0.00%) [a, b] if eq(a, b) => return vec![vec![a, b]], 18,100 ( 0.00%) _ if exprs.len() <= 2 => return vec![], . _ => {}, . } . . let mut buckets: UnindexMap>> = UnindexMap::default(); . . for expr in exprs { 64 ( 0.00%) match buckets.entry(hash(expr)) { . indexmap::map::Entry::Occupied(mut o) => { . let bucket = o.get_mut(); 18 ( 0.00%) match bucket.iter_mut().find(|group| eq(expr, group[0])) { . Some(group) => group.push(expr), 9 ( 0.00%) None => bucket.push(vec![expr]), . } . }, . indexmap::map::Entry::Vacant(v) => { 290 ( 0.00%) v.insert(vec![vec![expr]]); 29 ( 0.00%) }, . } . } . . buckets . .into_values() . .flatten() 64 ( 0.00%) .filter(|group| group.len() > 1) . .collect() 81,828 ( 0.00%) } . . /// Peels off all references on the pattern. Returns the underlying pattern and the number of . /// references removed. 6,389 ( 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) { 18,253 ( 0.00%) if let PatKind::Ref(pat, _, _) = pat.kind { 1,825 ( 0.00%) peel(pat, count + 1) . } else { . (pat, count) . } . } . peel(pat, 0) 6,389 ( 0.00%) } . . /// Peels of expressions while the given closure returns `Some`. 7,936 ( 0.00%) 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> { 148 ( 0.00%) while let Some(e) = f(expr) { . expr = e; . } . expr 8,928 ( 0.00%) } . . /// Peels off up to the given number of references on the expression. Returns the underlying . /// expression and the number of references removed. 2 ( 0.00%) pub fn peel_n_hir_expr_refs<'a>(expr: &'a Expr<'a>, count: usize) -> (&'a Expr<'a>, usize) { . let mut remaining = count; 2 ( 0.00%) let e = peel_hir_expr_while(expr, |e| match e.kind { . ExprKind::AddrOf(ast::BorrowKind::Ref, _, e) if remaining != 0 => { . remaining -= 1; . Some(e) . }, . _ => None, . }); 1 ( 0.00%) (e, count - remaining) 1 ( 0.00%) } . . /// Peels off all unary operators of an expression. Returns the underlying expression and the number . /// of operators removed. . pub fn peel_hir_expr_unary<'a>(expr: &'a Expr<'a>) -> (&'a Expr<'a>, usize) { . let mut count: usize = 0; . let mut curr_expr = expr; . while let ExprKind::Unary(_, local_expr) = curr_expr.kind { . 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. 516,286 ( 0.00%) pub fn peel_hir_expr_refs<'a>(expr: &'a Expr<'a>) -> (&'a Expr<'a>, usize) { . let mut count = 0; 562,410 ( 0.00%) let e = peel_hir_expr_while(expr, |e| match e.kind { 11,531 ( 0.00%) ExprKind::AddrOf(ast::BorrowKind::Ref, _, e) => { 11,531 ( 0.00%) count += 1; . Some(e) . }, . _ => None, . }); . (e, count) 258,143 ( 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. 6,534 ( 0.00%) pub fn peel_ref_operators<'hir>(cx: &LateContext<'_>, mut expr: &'hir Expr<'hir>) -> &'hir Expr<'hir> { . loop { 2,925 ( 0.00%) match expr.kind { . ExprKind::AddrOf(_, _, e) => expr = e, 734 ( 0.00%) ExprKind::Unary(UnOp::Deref, e) if cx.typeck_results().expr_ty(e).is_ref() => expr = e, 40 ( 0.00%) => ???:::expr_ty (1x) . _ => break, . } . } . expr 3,630 ( 0.00%) } . . /// Returns a `Vec` of `Expr`s containing `AddrOf` operators (`&`) or deref operators (`*`) of a . /// given expression. 4,160 ( 0.00%) pub fn get_ref_operators<'hir>(cx: &LateContext<'_>, expr: &'hir Expr<'hir>) -> Vec<&'hir Expr<'hir>> { . let mut operators = Vec::new(); 2,600 ( 0.00%) peel_hir_expr_while(expr, |expr| match expr.kind { . ExprKind::AddrOf(_, _, e) => { . operators.push(expr); . Some(e) . }, . ExprKind::Unary(UnOp::Deref, e) if cx.typeck_results().expr_ty(e).is_ref() => { . operators.push(expr); . Some(e) . }, . _ => None, . }); 2,600 ( 0.00%) operators 4,160 ( 0.00%) } . 447 ( 0.00%) pub fn is_hir_ty_cfg_dependant(cx: &LateContext<'_>, ty: &hir::Ty<'_>) -> bool { 2,223 ( 0.00%) if let TyKind::Path(QPath::Resolved(_, path)) = ty.kind 896 ( 0.00%) && let Res::Def(_, def_id) = path.res . { 195 ( 0.00%) return find_attr!(cx.tcx, def_id, CfgTrace(..) | CfgAttrTrace(..)); 530 ( 0.00%) => ???:>::get_attrs (5x) . } . false 447 ( 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. 22,640 ( 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) { 10,946 ( 0.00%) if matches!(tcx.def_kind(id.owner_id), DefKind::Const { .. }) 495 ( 0.00%) && let item = tcx.hir_item(id) 11,256 ( 0.00%) => ???:::hir_item (165x) 495 ( 0.00%) && let ItemKind::Const(ident, _generics, ty, _body) = item.kind 738 ( 0.00%) && let TyKind::Path(QPath::Resolved(_, path)) = ty.kind . // We could also check for the type name `test::TestDescAndFn` 456 ( 0.00%) && let Res::Def(DefKind::Struct, _) = path.res 441 ( 0.00%) && find_attr!(tcx, item.hir_id(), RustcTestMarker(..)) 6,043 ( 0.00%) => ???:>::get_attrs (87x) . { . names.push(ident.name); . } . } . names.sort_unstable(); 352 ( 0.00%) entry.insert(names).clone() . }, . } 18,112 ( 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 15,848 ( 0.00%) pub fn is_in_test_function(tcx: TyCtxt<'_>, id: HirId) -> bool { 9,056 ( 0.00%) let names = test_item_names(tcx, tcx.parent_module(id)); 2,895,529 ( 0.02%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::test_item_names (2,264x) 239,114 ( 0.00%) => ???:::parent_module (2,264x) . // Without `--test` there are no test items, so the parent walk can never match. 2,264 ( 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 . }) 13,584 ( 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`] 9 ( 0.00%) pub fn is_cfg_test(tcx: TyCtxt<'_>, id: HirId) -> bool { 264,474 ( 0.00%) if let Some(cfgs) = find_attr!(tcx, id, CfgTrace(cfgs) => cfgs) 206 ( 0.00%) => ???:>::get_attrs (3x) . && cfgs . .iter() 996 ( 0.00%) .any(|(cfg, _)| matches!(cfg, CfgEntry::NameValue { name: sym::test, .. })) . { . true . } else { . false . } 6 ( 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)]` 22,630 ( 0.00%) pub fn is_in_test(tcx: TyCtxt<'_>, hir_id: HirId) -> bool { 11,315 ( 0.00%) is_in_test_function(tcx, hir_id) || is_in_cfg_test(tcx, hir_id) 3,169,112 ( 0.03%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_test_function (2,263x) 18,104 ( 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> { 11,536 ( 0.00%) pub fn use_node(&self, cx: &LateContext<'tcx>) -> ExprUseNode<'tcx> { 82,728 ( 0.00%) match self.node { 16,779 ( 0.00%) Node::LetStmt(l) => ExprUseNode::LetStmt(l), 240 ( 0.00%) Node::ExprField(field) => ExprUseNode::Field(field), . . Node::Item(&Item { . kind: ItemKind::Static(..) | ItemKind::Const(..), 4 ( 0.00%) owner_id, . .. . }) . | Node::TraitItem(&TraitItem { . kind: TraitItemKind::Const(..), . owner_id, . .. . }) . | Node::ImplItem(&ImplItem { . kind: ImplItemKind::Const(..), 2 ( 0.00%) owner_id, . .. 8 ( 0.00%) }) => ExprUseNode::ConstStatic(owner_id), . . Node::Item(&Item { . kind: ItemKind::Fn { .. }, . owner_id, . .. . }) . | Node::TraitItem(&TraitItem { . kind: TraitItemKind::Fn(..), . owner_id, . .. . }) . | Node::ImplItem(&ImplItem { . kind: ImplItemKind::Fn(..), 195 ( 0.00%) owner_id, . .. . }) => ExprUseNode::Return(owner_id), . 45,300 ( 0.00%) Node::Expr(use_expr) => match use_expr.kind { 16 ( 0.00%) ExprKind::Ret(_) => ExprUseNode::Return(OwnerId { 40 ( 0.00%) def_id: cx.tcx.hir_body_owner_def_id(cx.enclosing_body.unwrap()), 1,004 ( 0.00%) => ???:::hir_body_owner_def_id (8x) . }), . 27 ( 0.00%) ExprKind::Closure(closure) => ExprUseNode::Return(OwnerId { def_id: closure.def_id }), 3,768 ( 0.00%) ExprKind::Call(func, args) => match args.iter().position(|arg| arg.hir_id == self.child_id) { 11,304 ( 0.00%) Some(i) => ExprUseNode::FnArg(func, i), . None => ExprUseNode::Callee, . }, 3,420 ( 0.00%) ExprKind::MethodCall(name, _, args, _) => ExprUseNode::MethodArg( 684 ( 0.00%) use_expr.hir_id, 684 ( 0.00%) name.args, . args.iter() . .position(|arg| arg.hir_id == self.child_id) . .map_or(0, |i| i + 1), . ), . ExprKind::Field(_, name) => ExprUseNode::FieldAccess(name), 60 ( 0.00%) ExprKind::AddrOf(kind, mutbl, _) => ExprUseNode::AddrOf(kind, mutbl), . _ => ExprUseNode::Other, . }, . _ => ExprUseNode::Other, . } 34,608 ( 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 { 12,495 ( 0.00%) matches!(self, Self::Return(_)) . } . . /// Checks if the value is used as a method call receiver. . pub fn is_recv(&self) -> bool { 1,464 ( 0.00%) matches!(self, Self::MethodArg(_, _, 0)) . } . . /// Gets the needed type as it's defined without any type inference. 80,451 ( 0.00%) pub fn defined_ty(&self, cx: &LateContext<'tcx>) -> Option> { 137,302 ( 0.00%) match *self { . Self::LetStmt(LetStmt { ty: Some(ty), .. }) => Some(DefinedTy::Hir(ty)), 28 ( 0.00%) Self::ConstStatic(id) => Some(DefinedTy::Mir { . def_site_def_id: Some(id.def_id.to_def_id()), 4 ( 0.00%) ty: Binder::dummy(cx.tcx.type_of(id).instantiate_identity().skip_norm_wip()), . }), 420 ( 0.00%) Self::Return(id) => { 648 ( 0.00%) if let Node::Expr(Expr { . kind: ExprKind::Closure(c), . .. 219 ( 0.00%) }) = cx.tcx.hir_node_by_def_id(id.def_id) . { 45 ( 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(); 804 ( 0.00%) Some(DefinedTy::Mir { . def_site_def_id: Some(id.def_id.to_def_id()), . ty, . }) . } . }, 560 ( 0.00%) Self::Field(field) => match get_parent_expr_for_hir(cx, field.hir_id) { . Some(Expr { . hir_id, . kind: ExprKind::Struct(path, ..), . .. 800 ( 0.00%) }) => adt_and_variant_of_res(cx, cx.qpath_res(path, *hir_id)) 12,051 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::adt_and_variant_of_res (80x) 1,840 ( 0.00%) => ???:::qpath_res (80x) . .and_then(|(adt, variant)| { . variant . .fields . .iter() . .find(|f| f.name == field.ident.name) . .map(|f| (adt, f)) . }) . .map(|(adt, field_def)| DefinedTy::Mir { . def_site_def_id: Some(adt.did()), 480 ( 0.00%) ty: Binder::dummy(cx.tcx.type_of(field_def.did).instantiate_identity().skip_norm_wip()), 640 ( 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/binder.rs:>::dummy (80x) . }), . _ => None, . }, 7,508 ( 0.00%) Self::FnArg(callee, i) => { 11,262 ( 0.00%) let sig = expr_sig(cx, callee)?; 653,397 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::expr_sig (3,754x) 30,032 ( 0.00%) let (hir_ty, ty) = sig.input_with_hir(i)?; 162,222 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:::input_with_hir (3,754x) 22,588 ( 0.00%) Some(match hir_ty { . Some(hir_ty) => DefinedTy::Hir(hir_ty), . None => DefinedTy::Mir { . def_site_def_id: sig.predicates_id(), . ty, . }, . }) 3,758 ( 0.00%) }, 1,354 ( 0.00%) Self::MethodArg(id, _, i) => { 1,354 ( 0.00%) let id = cx.typeck_results().type_dependent_def_id(id)?; 34,683 ( 0.00%) => ???:::type_dependent_def_id (677x) 677 ( 0.00%) let sig = cx.tcx.fn_sig(id).skip_binder(); 2,708 ( 0.00%) Some(DefinedTy::Mir { . def_site_def_id: Some(id), . ty: sig.input(i), . }) 677 ( 0.00%) }, . Self::LetStmt(_) | Self::FieldAccess(..) | Self::Callee | Self::Other | Self::AddrOf(..) => None, . } 103,437 ( 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 { 24,284 ( 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> { 34,953 ( 0.00%) let mut adjustments: &[_] = typeck.expr_adjustments(e); 484,566 ( 0.00%) => ???:::expr_adjustments (11,651x) . let mut is_ty_unified = false; . let mut moved_before_use = false; . let mut same_ctxt = true; 163,114 ( 0.00%) ReplacingFilterMap( 23,302 ( 0.00%) hir_parent_with_src_iter(tcx, e.hir_id), . move |iter: &mut _, (parent, child_id)| { . let parent_ctxt; . let mut parent_adjustments: &[_] = &[]; 48,568 ( 0.00%) match parent { . Node::Expr(parent_expr) => { 6,021 ( 0.00%) parent_ctxt = parent_expr.span.ctxt(); 18,063 ( 0.00%) same_ctxt &= parent_ctxt == ctxt; 18,063 ( 0.00%) parent_adjustments = typeck.expr_adjustments(parent_expr); 230,484 ( 0.00%) => ???:::expr_adjustments (6,021x) 33,318 ( 0.00%) match parent_expr.kind { 482 ( 0.00%) ExprKind::Match(scrutinee, arms, _) if scrutinee.hir_id != child_id => { 23 ( 0.00%) is_ty_unified |= arms.len() != 1; . moved_before_use = true; . if adjustments.is_empty() { . adjustments = parent_adjustments; . } . return None; . }, 46 ( 0.00%) ExprKind::If(cond, _, else_) if cond.hir_id != child_id => { . is_ty_unified |= else_.is_some(); . moved_before_use = true; . if adjustments.is_empty() { . adjustments = parent_adjustments; . } . return None; . }, . ExprKind::Break(Destination { target_id: Ok(id), .. }, _) => { -- line 2715 ---------------------------------------- -- line 2716 ---------------------------------------- . is_ty_unified = true; . moved_before_use = true; . *iter = hir_parent_with_src_iter(tcx, id); . if adjustments.is_empty() { . adjustments = parent_adjustments; . } . return None; . }, 219 ( 0.00%) ExprKind::Block(b, _) => { 219 ( 0.00%) is_ty_unified |= b.targeted_by_break; . moved_before_use = true; . if adjustments.is_empty() { . adjustments = parent_adjustments; . } . return None; . }, . ExprKind::DropTemps(_) | ExprKind::Type(..) => { . if adjustments.is_empty() { -- line 2733 ---------------------------------------- -- line 2734 ---------------------------------------- . adjustments = parent_adjustments; . } . return None; . }, . _ => {}, . } . }, . Node::Arm(arm) => { 23 ( 0.00%) parent_ctxt = arm.span.ctxt(); 69 ( 0.00%) same_ctxt &= parent_ctxt == ctxt; 46 ( 0.00%) if arm.body.hir_id == child_id { . return None; . } . }, . Node::Block(b) => { 876 ( 0.00%) same_ctxt &= b.span.ctxt() == ctxt; . return None; . }, . Node::ConstBlock(_) => parent_ctxt = ctxt, 80 ( 0.00%) Node::ExprField(&ExprField { span, .. }) => { . parent_ctxt = span.ctxt(); 160 ( 0.00%) same_ctxt &= parent_ctxt == ctxt; 80 ( 0.00%) }, . Node::AnonConst(&AnonConst { span, .. }) . | Node::ConstArg(&ConstArg { span, .. }) . | 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(); 11,598 ( 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), . }) . }, . ) . } . 139,812 ( 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, . } . }) 93,208 ( 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| { 13,756 ( 0.00%) let end = pos + t.len; . let range = pos as usize..end as usize; . let inner = InnerSpan::new(range.start, range.end); 3,870 ( 0.00%) pos = end; 2,628 ( 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| { 212,716 ( 0.00%) 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 { 1,392 ( 0.00%) sm.span_take_while(span, |&ch| ch == ' ' || ch == ';') 1,044,365 ( 0.01%) => /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:: (1,392x) . } . . /// 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 2911 ---------------------------------------- . /// We get as parameters: . /// ```ignore . /// pat: Some(FooBar { a, b }) . /// else_body: return None . /// ``` . /// . /// We output `Some(a)` in the first instance, and `Some(FooBar { a, b })` in the second, because . /// the `?` operator is applicable here. Callers have to check whether we are in a constant or not. 21 ( 0.00%) pub fn pat_and_expr_can_be_question_mark<'a, 'hir>( . cx: &LateContext<'_>, . pat: &'a Pat<'hir>, . else_body: &Expr<'_>, . ) -> Option<&'a Pat<'hir>> { 24 ( 0.00%) if let Some([inner_pat]) = as_some_pattern(cx, pat) 51 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::as_some_pattern (3x) . && !is_refutable(cx, inner_pat) . && let else_body = peel_blocks(else_body) . && let ExprKind::Ret(Some(ret_val)) = else_body.kind . && let ExprKind::Path(ret_path) = ret_val.kind . && cx . .qpath_res(&ret_path, ret_val.hir_id) . .ctor_parent(cx) . .is_lang_item(cx, OptionNone) . { . Some(inner_pat) . } else { . None . } 18 ( 0.00%) } . . macro_rules! op_utils { . ($($name:ident $assign:ident)*) => { . /// 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)> { 27,928 ( 0.00%) match kind { . $(hir::BinOpKind::$name => Some((LangItem::$name, LangItem::$assign)),)* . _ => None, . } . } . }; . } . . op_utils! { -- line 2958 ---------------------------------------- -- line 2966 ---------------------------------------- . BitOr BitOrAssign . Shl ShlAssign . Shr ShrAssign . } . . /// Returns `true` if the pattern is a `PatWild`, or is an ident prefixed with `_` . /// that is not locally used. . pub fn pat_is_wild<'tcx>(cx: &LateContext<'tcx>, pat: &'tcx PatKind<'_>, body: impl Visitable<'tcx>) -> bool { 620 ( 0.00%) match *pat { . PatKind::Wild => true, 215 ( 0.00%) PatKind::Binding(_, id, ident, None) if ident.as_str().starts_with('_') => { 32 ( 0.00%) => ???:::as_str (1x) 3 ( 0.00%) !visitors::is_local_used(cx, body, id) . }, . _ => false, . } 19 ( 0.00%) } . . #[derive(Clone, Copy)] . pub enum RequiresSemi { . Yes, . No, . } . impl RequiresSemi { . pub fn requires_semi(self) -> bool { . matches!(self, Self::Yes) . } . } . . /// Check if the expression return `!`, a type coerced from `!`, or could return `!` if the final . /// expression were turned into a statement. . #[expect(clippy::too_many_lines)] 680 ( 0.00%) pub fn is_never_expr<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) -> Option { . struct BreakTarget { . id: HirId, . unused: bool, . } . . struct V<'cx, 'tcx> { . cx: &'cx LateContext<'tcx>, . break_targets: Vec, -- line 3005 ---------------------------------------- -- line 3012 ---------------------------------------- . impl V<'_, '_> { . fn push_break_target(&mut self, id: HirId) { . self.break_targets.push(BreakTarget { id, unused: true }); . self.break_targets_for_result_ty += u32::from(self.in_final_expr); . } . } . . impl<'tcx> Visitor<'tcx> for V<'_, 'tcx> { 10,109 ( 0.00%) fn visit_expr(&mut self, e: &'tcx Expr<'_>) { . // Note: Part of the complexity here comes from the fact that . // coercions are applied to the innermost expression. . // e.g. In `let x: u32 = { break () };` the never-to-any coercion . // is applied to the break expression. This means we can't just . // check the block's type as it will be `u32` despite the fact . // that the block always diverges. . . // The rest of the complexity comes from checking blocks which -- line 3028 ---------------------------------------- -- line 3029 ---------------------------------------- . // syntactically return a value, but will always diverge before . // reaching that point. . // e.g. In `let x = { foo(panic!()) };` the block's type will be the . // return type of `foo` even though it will never actually run. This . // can be trivially fixed by adding a semicolon after the call, but . // we must first detect that a semicolon is needed to make that . // suggestion. . 1,972 ( 0.00%) if self.is_never && self.break_targets.is_empty() { . if self.in_final_expr && !self.requires_semi { . // This expression won't ever run, but we still need to check . // if it can affect the type of the final expression. . match e.kind { . ExprKind::DropTemps(e) => self.visit_expr(e), . ExprKind::If(_, then, Some(else_)) => { . self.visit_expr(then); . self.visit_expr(else_); -- line 3045 ---------------------------------------- -- line 3066 ---------------------------------------- . }, . _ => { . self.requires_semi = !self.cx.typeck_results().expr_ty(e).is_never(); . }, . } . } . return; . } 5,678 ( 0.00%) match e.kind { . ExprKind::DropTemps(e) => self.visit_expr(e), . ExprKind::Ret(None) | ExprKind::Continue(_) => self.is_never = true, . ExprKind::Ret(Some(e)) | ExprKind::Become(e) => { . self.in_final_expr = false; . self.visit_expr(e); . self.is_never = true; . }, . ExprKind::Break(dest, e) => { -- line 3082 ---------------------------------------- -- line 3093 ---------------------------------------- . { . target.unused &= self.is_never; . if i < self.break_targets_for_result_ty as usize { . self.requires_semi = true; . } . } . self.is_never = true; . }, 57 ( 0.00%) ExprKind::If(cond, then, else_) => { . let in_final_expr = mem::replace(&mut self.in_final_expr, false); 57 ( 0.00%) self.visit_expr(cond); 669 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:::visit_expr'2 (1x) 19 ( 0.00%) self.in_final_expr = in_final_expr; . 57 ( 0.00%) if self.is_never { . self.visit_expr(then); . if let Some(else_) = else_ { . self.visit_expr(else_); . } . } else { . self.visit_expr(then); . let is_never = mem::replace(&mut self.is_never, false); 38 ( 0.00%) if let Some(else_) = else_ { 12 ( 0.00%) self.visit_expr(else_); 13,511 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:::visit_expr'2 (1x) 4 ( 0.00%) self.is_never &= is_never; . } . } . }, 6 ( 0.00%) ExprKind::Match(scrutinee, arms, _) => { . let in_final_expr = mem::replace(&mut self.in_final_expr, false); 6 ( 0.00%) self.visit_expr(scrutinee); 619 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:::visit_expr'2 (1x) 2 ( 0.00%) self.in_final_expr = in_final_expr; . 6 ( 0.00%) if self.is_never { . for arm in arms { . self.visit_arm(arm); . } . } else { . let mut is_never = true; . for arm in arms { 6 ( 0.00%) self.is_never = false; 12 ( 0.00%) if let Some(guard) = arm.guard { . let in_final_expr = mem::replace(&mut self.in_final_expr, false); . self.visit_expr(guard); . self.in_final_expr = in_final_expr; . // The compiler doesn't consider diverging guards as causing the arm to diverge. . self.is_never = false; . } 9 ( 0.00%) self.visit_expr(arm.body); 583 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:::visit_expr'2 (2x) 3 ( 0.00%) is_never &= self.is_never; . } 2 ( 0.00%) self.is_never = is_never; . } . }, . ExprKind::Loop(b, _, _, _) => { . self.push_break_target(e.hir_id); . self.in_final_expr = false; . self.visit_block(b); . self.is_never = self.break_targets.pop().unwrap().unused; . }, 81 ( 0.00%) ExprKind::Block(b, _) => { 243 ( 0.00%) if b.targeted_by_break { . self.push_break_target(b.hir_id); . self.visit_block(b); . self.is_never &= self.break_targets.pop().unwrap().unused; . } else { . self.visit_block(b); . } . }, 884 ( 0.00%) _ => { 884 ( 0.00%) self.in_final_expr = false; 2,652 ( 0.00%) walk_expr(self, e); 51,426 ( 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:: (120x) 3,536 ( 0.00%) self.is_never |= self.cx.typeck_results().expr_ty(e).is_never(); 4,800 ( 0.00%) => ???:::expr_ty (120x) . }, . } 7,356 ( 0.00%) } . . fn visit_block(&mut self, b: &'tcx Block<'_>) { . let in_final_expr = mem::replace(&mut self.in_final_expr, false); 81 ( 0.00%) for s in b.stmts { . self.visit_stmt(s); . } 162 ( 0.00%) self.in_final_expr = in_final_expr; 338 ( 0.00%) if let Some(e) = b.expr { . self.visit_expr(e); . } . } . . fn visit_local(&mut self, l: &'tcx LetStmt<'_>) { 78 ( 0.00%) if let Some(e) = l.init { 52 ( 0.00%) self.visit_expr(e); 9,654 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:::visit_expr'2 (15x) . } 78 ( 0.00%) if let Some(else_) = l.els { . let is_never = self.is_never; . self.visit_block(else_); . self.is_never = is_never; . } . } . . fn visit_arm(&mut self, arm: &Arm<'tcx>) { . if let Some(guard) = arm.guard { -- line 3192 ---------------------------------------- -- line 3193 ---------------------------------------- . let in_final_expr = mem::replace(&mut self.in_final_expr, false); . self.visit_expr(guard); . self.in_final_expr = in_final_expr; . } . self.visit_expr(arm.body); . } . } . 544 ( 0.00%) if cx.typeck_results().expr_ty(e).is_never() { 5,440 ( 0.00%) => ???:::expr_ty (136x) . Some(RequiresSemi::No) 657 ( 0.00%) } else if let ExprKind::Block(b, _) = e.kind 94 ( 0.00%) && !b.targeted_by_break 47 ( 0.00%) && b.expr.is_none() . { . // If a block diverges without a final expression then it's type is `!`. . None . } else { 976 ( 0.00%) let mut v = V { . cx, . break_targets: Vec::new(), . break_targets_for_result_ty: 0, . in_final_expr: true, . requires_semi: false, . is_never: false, . }; 244 ( 0.00%) v.visit_expr(e); 119,108 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:::visit_expr (122x) . v.is_never 366 ( 0.00%) .then_some(if v.requires_semi && matches!(e.kind, ExprKind::Block(..)) { . RequiresSemi::Yes . } else { . RequiresSemi::No . }) . } 680 ( 0.00%) } . . /// Produces a path from a local caller to the type of the called method. Suitable for user . /// output/suggestions. . /// . /// Returned path can be either absolute (for methods defined non-locally), or relative (for local . /// methods). . pub fn get_path_from_caller_to_method_type<'tcx>( . tcx: TyCtxt<'tcx>, -- line 3234 ---------------------------------------- -- line 3372 ---------------------------------------- . expr.kind, . ExprKind::Block(..) | ExprKind::ConstBlock(..) | ExprKind::If(..) | ExprKind::Loop(..) | ExprKind::Match(..) . ) . } . . /// Returns true if the given `expr` is binary expression that needs to be wrapped in parentheses. . pub fn binary_expr_needs_parentheses(expr: &Expr<'_>) -> bool { . fn contains_block(expr: &Expr<'_>, is_operand: bool) -> bool { 4,419 ( 0.00%) match expr.kind { 6 ( 0.00%) ExprKind::Binary(_, lhs, _) | ExprKind::Cast(lhs, _) => contains_block(lhs, true), . _ if is_block_like(expr) => is_operand, . _ => false, . } . } . . contains_block(expr, false) 882 ( 0.00%) } . . /// Returns true if the specified expression is in a receiver position. . pub fn is_receiver_of_method_call(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { . if let Some(parent_expr) = get_parent_expr(cx, expr) . && let ExprKind::MethodCall(_, receiver, ..) = parent_expr.kind . && receiver.hir_id == expr.hir_id . { . return true; . } . false . } . . /// Returns true if `expr` creates any temporary whose type references a non-static lifetime and has . /// a significant drop and does not consume it. 1,762 ( 0.00%) pub fn leaks_droppable_temporary_with_limited_lifetime<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) -> bool { 6 ( 0.00%) for_each_unconsumed_temporary(cx, expr, |temporary_ty| { 10 ( 0.00%) if temporary_ty.has_significant_drop(cx.tcx, cx.typing_env()) 19,242 ( 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/util.rs:::has_significant_drop (1x) 30 ( 0.00%) => ???:::typing_env (1x) . && temporary_ty . .walk() . .any(|arg| matches!(arg.kind(), GenericArgKind::Lifetime(re) if !re.is_static())) . { . ControlFlow::Break(()) . } else { . ControlFlow::Continue(()) . } 5 ( 0.00%) }) . .is_break() 1,762 ( 0.00%) } . . /// Returns true if `expr` creates any temporary that has a significant drop and does not consume . /// it. . pub fn leaks_droppable_temporary<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) -> bool { . for_each_unconsumed_temporary(cx, expr, |temporary_ty| { . if temporary_ty.has_significant_drop(cx.tcx, cx.typing_env()) { . ControlFlow::Break(()) . } else { -- line 3424 ---------------------------------------- -- line 3433 ---------------------------------------- . /// . /// Similar to [`is_adjusted`], this not only checks if an expression's type was adjusted, . /// but also going through extra steps to see if it fits the description of [coercion sites]. . /// . /// You should used this when you want to avoid suggesting replacing an expression that is currently . /// a coercion site or coercion propagating expression with one that is not. . /// . /// [coercion sites]: https://doc.rust-lang.org/stable/reference/type-coercions.html#coercion-sites 27 ( 0.00%) pub fn expr_requires_coercion<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'tcx>) -> bool { . let expr_ty_is_adjusted = cx . .typeck_results() 18 ( 0.00%) .expr_adjustments(expr) 108 ( 0.00%) => ???:::expr_adjustments (3x) . .iter() . // ignore `NeverToAny` adjustments, such as `panic!` call. . .any(|adj| !matches!(adj.kind, Adjust::NeverToAny)); . if expr_ty_is_adjusted { . return true; . } . . // Identify coercion sites and recursively check if those sites . // actually have type adjustments. 56 ( 0.00%) match expr.kind { 6 ( 0.00%) ExprKind::Call(_, args) | ExprKind::MethodCall(_, _, args, _) if let Some(def_id) = fn_def_id(cx, expr) => { 2 ( 0.00%) let fn_sig = cx.tcx.fn_sig(def_id).instantiate_identity().skip_norm_wip(); . 2 ( 0.00%) if !fn_sig.output().skip_binder().has_type_flags(TypeFlags::HAS_TY_PARAM) { . return false; . } . 6 ( 0.00%) let self_arg_count = usize::from(matches!(expr.kind, ExprKind::MethodCall(..))); . let mut args_with_ty_param = { . fn_sig . .inputs() . .skip_binder() . .iter() . .skip(self_arg_count) . .zip(args) . .filter_map(|(arg_ty, arg)| { . if arg_ty.has_type_flags(TypeFlags::HAS_TY_PARAM) { . Some(arg) . } else { . None . } . }) . }; 3 ( 0.00%) args_with_ty_param.any(|arg| expr_requires_coercion(cx, arg)) 8,421 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::expr_requires_coercion'2 (1x) . }, . // Struct/union initialization. . ExprKind::Struct(qpath, _, _) => { . let res = cx.typeck_results().qpath_res(qpath, expr.hir_id); . if let Some((_, v_def)) = adt_and_variant_of_res(cx, res) { . let rustc_ty::Adt(_, generic_args) = cx.typeck_results().expr_ty_adjusted(expr).kind() else { . // This should never happen, but when it does, not linting is the better option. . return true; -- line 3486 ---------------------------------------- -- line 3502 ---------------------------------------- . ) . | ExprKind::Ret(Some(ret_expr)) => expr_requires_coercion(cx, ret_expr), . . // ===== Coercion-propagation expressions ===== . ExprKind::Array(elems) | ExprKind::Tup(elems) => elems.iter().any(|elem| expr_requires_coercion(cx, elem)), . // Array but with repeating syntax. . ExprKind::Repeat(rep_elem, _) => expr_requires_coercion(cx, rep_elem), . // Others that may contain coercion sites. 2 ( 0.00%) ExprKind::If(_, then, maybe_else) => { 4 ( 0.00%) expr_requires_coercion(cx, then) || maybe_else.is_some_and(|e| expr_requires_coercion(cx, e)) 8,825 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::expr_requires_coercion'2 (1x) . }, . ExprKind::Match(_, arms, _) => arms . .iter() . .map(|arm| arm.body) . .any(|body| expr_requires_coercion(cx, body)), . _ => false, . } 27 ( 0.00%) } . . /// Returns `true` if `expr` designates a mutable static, a mutable local binding, or an expression . /// that can be owned. . pub fn is_mutable(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { . if let Some(hir_id) = expr.res_local_id() . && let Node::Pat(pat) = cx.tcx.hir_node(hir_id) . { . matches!(pat.kind, PatKind::Binding(BindingMode::MUT, ..)) -- line 3527 ---------------------------------------- -- line 3570 ---------------------------------------- . { . Some(into_future_arg) . } else { . None . } . } . . /// Checks if the given expression is a call to `Default::default()`. 13,009 ( 0.00%) pub fn is_expr_default<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) -> bool { 42,624 ( 0.00%) if let ExprKind::Call(fn_expr, []) = &expr.kind 2,004 ( 0.00%) && let ExprKind::Path(qpath) = &fn_expr.kind 4,509 ( 0.00%) && let Res::Def(_, def_id) = cx.qpath_res(qpath, fn_expr.hir_id) 37,868 ( 0.00%) => ???:::qpath_res (501x) . { 1,503 ( 0.00%) cx.tcx.is_diagnostic_item(sym::default_fn, def_id) 48,484 ( 0.00%) => ???:::is_diagnostic_item (501x) . } else { . false . } 13,009 ( 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 3597 ---------------------------------------- . /// . /// Contrary to [`TyCtxt::hir_get_fn_id_for_return_block()`], if `expr` is part of a . /// larger expression, for example a field expression of a `struct`, it will not be . /// considered as matching the condition and will return `false`. . /// . /// Also, even if `expr` is assigned to a variable which is later returned, this function . /// will still return `false` because `expr` is not used *directly* as the return value . /// as it goes through the intermediate variable. 112 ( 0.00%) pub fn potential_return_of_enclosing_body(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { 16 ( 0.00%) let enclosing_body_owner = cx . .tcx 112 ( 0.00%) .local_def_id_to_hir_id(cx.tcx.hir_enclosing_body_owner(expr.hir_id)); 8,951 ( 0.00%) => ???:::hir_enclosing_body_owner (16x) . let mut prev_id = expr.hir_id; . let mut skip_until_id = None; 80 ( 0.00%) for (hir_id, node) in cx.tcx.hir_parent_iter(expr.hir_id) { 24 ( 0.00%) if hir_id == enclosing_body_owner { . return true; . } 40 ( 0.00%) if let Some(id) = skip_until_id { . prev_id = hir_id; . if id == hir_id { . skip_until_id = None; . } . continue; . } 76 ( 0.00%) match node { 9 ( 0.00%) Node::Block(Block { expr, .. }) if expr.is_some_and(|expr| expr.hir_id == prev_id) => {}, . Node::Arm(arm) if arm.body.hir_id == prev_id => {}, 56 ( 0.00%) Node::Expr(expr) => match expr.kind { . ExprKind::Ret(_) => return true, . ExprKind::If(_, then, opt_else) . if then.hir_id == prev_id || opt_else.is_some_and(|els| els.hir_id == prev_id) => {}, . ExprKind::Match(_, arms, _) if arms.iter().any(|arm| arm.hir_id == prev_id) => {}, 4 ( 0.00%) ExprKind::Block(block, _) if block.hir_id == prev_id => {}, . ExprKind::Break( . Destination { . target_id: Ok(target_id), . .. . }, . _, . ) => skip_until_id = Some(target_id), . _ => break, -- line 3638 ---------------------------------------- -- line 3640 ---------------------------------------- . _ => break, . } . prev_id = hir_id; . } . . // `expr` is used as part of "something" and is not returned directly from its . // enclosing body. . false 144 ( 0.00%) } . . /// Checks if the expression has adjustments that require coercion, for example: dereferencing with . /// overloaded deref, coercing pointers and `dyn` objects. . pub fn expr_adjustment_requires_coercion(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { . cx.typeck_results().expr_adjustments(expr).iter().any(|adj| { . matches!( . adj.kind, . Adjust::Deref(DerefAdjustKind::Overloaded(_)) -- line 3656 ---------------------------------------- -- 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 { 6,006 ( 0.00%) cx.tcx.sess.edition().at_least_rust_2024() && msrv.meets(cx, msrvs::LET_CHAINS) 2,002 ( 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) 123,474 ( 0.00%) .map(move |parent| (tcx.hir_node(parent), mem::replace(&mut id, parent))) 516,941 ( 0.00%) => ???:::hir_node (7,765x) . } 1,649,805 ( 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; . 3,129 ( 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, . ) { 894 ( 0.00%) if let ty::RawPtr(from_ty, from_mutbl) = cast_from.kind() 4 ( 0.00%) && let ty::RawPtr(to_ty, to_mutbl) = cast_to.kind() 2 ( 0.00%) && 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() . && let Some(prefix) = std_or_core(cx) . && let mut app = Applicability::MachineApplicable -- line 31 ---------------------------------------- -- 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, . ); . } . } 3,576 ( 0.00%) } . 1,452,864 ( 0.01%) pub(super) fn check_null_ptr_cast_method(cx: &LateContext<'_>, expr: &Expr<'_>) { 520,365 ( 0.00%) if let ExprKind::MethodCall(method, cast_from_expr, [], _) = expr.kind 16,729 ( 0.00%) && let ExprKind::Call(func, []) = cast_from_expr.kind 43 ( 0.00%) && let ExprKind::Path(QPath::Resolved(None, path)) = func.kind . && let Some(defid) = path.res.opt_def_id() 40 ( 0.00%) && let method = match (cx.tcx.get_diagnostic_name(defid), method.ident.name) { 265 ( 0.00%) => ???:::get_diagnostic_name (5x) . (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) . && let mut app = Applicability::MachineApplicable . && let sugg = snippet_with_applicability(cx, cast_from_expr.span, "_", &mut app) . && let Some((_, after_lt)) = sugg.split_once("::<") -- line 92 ---------------------------------------- -- 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, . ); . } 1,695,008 ( 0.01%) } 5 ( 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/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)] 35,952 ( 0.00%) #[derive(Copy, Debug, Hash)] 3,986 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::hash:: (97x) . #[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 { 1,605,401 ( 0.01%) 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 { 711,313 ( 0.01%) match self { 8 ( 0.00%) None => false, 147,228 ( 0.00%) Some(x) => f(x), 58,221 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/only_used_in_recursion.rs:::check_expr::{closure#0} (5,075x) . } . } . . /// Returns `true` if the option is a [`None`] value. . /// . /// # Examples . /// . /// ``` -- line 670 ---------------------------------------- -- line 675 ---------------------------------------- . /// assert_eq!(x.is_none(), true); . /// ``` . #[must_use = "if you intended to assert that this doesn't have a value, consider \ . wrapping this in an `assert!()` instead"] . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_option_basics", since = "1.48.0")] . pub const fn is_none(&self) -> bool { 5,704 ( 0.00%) !self.is_some() . } . . /// Returns `true` if the option is a [`None`] or the value inside of it matches a predicate. . /// . /// # Examples . /// . /// ``` . /// let x: Option = Some(2); -- line 691 ---------------------------------------- -- 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 { 1,416,131 ( 0.01%) match self { . None => true, 15 ( 0.00%) Some(x) => f(x), . } . } . . ///////////////////////////////////////////////////////////////////////// . // Adapter for working with references . ///////////////////////////////////////////////////////////////////////// . . /// Converts from `&Option` to `Option<&T>`. -- line 719 ---------------------------------------- -- 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> { 287,620 ( 0.00%) 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> { 742,828 ( 0.01%) 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. 28,741 ( 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 { 2,488,107 ( 0.02%) match self { 10,974 ( 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 { 28,699 ( 0.00%) match self { 18,370 ( 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, . { 767,865 ( 0.01%) match self { 7,986 ( 0.00%) Some(x) => x, 9 ( 0.00%) None => default, . } . } . . /// Returns the contained [`Some`] value or computes it from a closure. . /// . /// # Examples . /// . /// ``` -- line 1050 ---------------------------------------- -- 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, . { 169,400 ( 0.00%) match self { 104,939 ( 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, . { 20,999 ( 0.00%) match self { 31,110 ( 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, . { 1,481,416 ( 0.01%) match self { 271,346 ( 0.00%) Some(x) => Some(f(x)), 1,283 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:clippy_lints::question_mark::check_if_let_some_or_err_and_early_return::{closure#0} (4x) 438 ( 0.00%) None => None, . } 1,496 ( 0.00%) } . . /// Calls a function with a reference to the contained value if [`Some`]. . /// . /// Returns the original option. . /// . /// # Examples . /// . /// ``` -- line 1174 ---------------------------------------- -- line 1214 ---------------------------------------- . /// . /// let x: Option<&str> = None; . /// assert_eq!(x.map_or(42, |v| v.len()), 42); . /// ``` . #[inline] . #[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")] 2 ( 0.00%) pub const fn map_or(self, default: U, f: F) -> U . where . F: [const] FnOnce(T) -> U + [const] Destruct, . U: [const] Destruct, . { 216,923 ( 0.00%) match self { 42,949 ( 0.00%) Some(t) => f(t), 155,154 ( 0.00%) None => default, . } 27,020 ( 0.00%) } 858 ( 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:: (143x) . . /// 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, . { 33,164 ( 0.00%) match self { 832 ( 0.00%) Some(t) => f(t), . None => default(), . } 2,016 ( 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, . { 141,046 ( 0.00%) match self { 152,497 ( 0.00%) Some(x) => f(x), 21,912 ( 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, . { 814,145 ( 0.01%) if let Some(x) = self { 143,955 ( 0.00%) if predicate(&x) { 41,203 ( 0.00%) return Some(x); . } . } 239,381 ( 0.00%) None 678 ( 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, . { 9,201 ( 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, . { 81,904 ( 0.00%) match self { 850 ( 0.00%) x @ Some(_) => x, . None => f(), . } 48 ( 0.00%) } . . /// Returns [`Some`] if exactly one of `self`, `optb` is [`Some`], otherwise returns [`None`]. . /// . /// # Examples . /// . /// ``` . /// let x = Some(2); . /// let y: Option = None; -- line 1662 ---------------------------------------- -- 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, . { 123,987 ( 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 1801 ---------------------------------------- . /// ``` . #[inline] . #[stable(feature = "option_entry", since = "1.20.0")] . #[rustc_const_unstable(feature = "const_option_ops", issue = "143956")] . pub const fn get_or_insert_with(&mut self, f: F) -> &mut T . where . F: [const] FnOnce() -> T + [const] Destruct, . { 2,928 ( 0.00%) if let None = self { . // The effect of the following statement is identical to . // *self = Some(f()); . // except that it does not drop the old value of `*self`. This is not a leak, because . // we just checked that the old value is `None`, which contains no fields to drop. . // This implementation strategy . // . // * avoids needing a `T: [const] Destruct` bound, to the benefit of `const` callers, . // * and avoids possibly compiling needless drop code (as would sometimes happen in the -- line 1817 ---------------------------------------- -- 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, . { 5,826 ( 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 { 313,569 ( 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 { 4,322,348 ( 0.04%) match self { 2,378 ( 0.00%) Some(x) => Some(x.clone()), 4,727 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/boxed.rs: as core::clone::Clone>::clone (10x) . None => None, . } . } . . #[inline] . fn clone_from(&mut self, source: &Self) { . match (self, source) { . (Some(to), Some(from)) => to.clone_from(from), -- line 2283 ---------------------------------------- -- 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` 4,920,192 ( 0.04%) match (self, other) { 230 ( 0.00%) (Some(l), Some(r)) => *l == *r, 4,485 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eq (115x) . (Some(_), None) => false, . (None, Some(_)) => false, . (None, None) => true, . } . } . } . . // Manually implementing here somewhat improves codegen for -- line 2448 ---------------------------------------- -- line 2659 ---------------------------------------- . iter: Option, . } . . #[unstable(feature = "option_into_flat_iter", issue = "148441")] . impl Iterator for OptionFlatten { . type Item = A::Item; . . fn next(&mut self) -> Option { 4 ( 0.00%) match &mut self.iter { . Some(iter) => iter.next(), . None => None, . } . } . . fn size_hint(&self) -> (usize, Option) { . match &self.iter { . Some(iter) => iter.size_hint(), -- line 2675 ---------------------------------------- -- 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 { 424 ( 0.00%) iter::try_process(iter.into_iter(), |i| i.collect()) 113,668 ( 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> (401x) . } . } . . #[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 { 1,423,155 ( 0.01%) match self { 74,109 ( 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 { 12,226 ( 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 2930 ---------------------------------------- . #[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 { . Some(inner) => inner, 62 ( 0.00%) None => None, . } . } . } . . impl<'a, T> Option<&'a Option> { . /// Converts from `Option<&Option>` to `Option<&T>`. . /// . /// # Examples -- line 2946 ---------------------------------------- 2,349,984 ( 0.02%) -------------------------------------------------------------------------------- -- 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<'_>) { 242,228 ( 0.00%) if let ExprKind::Binary(ref op, left, right) = e.kind 6,736 ( 0.00%) && BinOpKind::Mul == op.node . { 250 ( 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 ---------------------------------------- 100 ( 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_type_ir/src/data_structures/delayed_map.rs -------------------------------------------------------------------------------- Ir -- line 19 ---------------------------------------- . fn default() -> Self { . DelayedMap { cache: Default::default(), count: 0 } . } . } . . impl DelayedMap { . #[inline(always)] . pub fn insert(&mut self, key: K, value: V) -> bool { 79,500 ( 0.00%) if self.count >= CACHE_CUTOFF { . self.cold_insert(key, value) . } else { 53,000 ( 0.00%) self.count += 1; . true . } . } . . #[cold] . #[inline(never)] . fn cold_insert(&mut self, key: K, value: V) -> bool { . self.cache.insert(key, value).is_none() . } . . #[inline(always)] . pub fn get(&self, key: &K) -> Option<&V> { 26,500 ( 0.00%) if self.cache.is_empty() { None } else { self.cold_get(key) } . } . . #[cold] . #[inline(never)] . fn cold_get(&self, key: &K) -> Option<&V> { . self.cache.get(key) . } . } -- line 51 ---------------------------------------- 26,500 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/needless_ifs.rs -------------------------------------------------------------------------------- Ir -- line 32 ---------------------------------------- . pub NEEDLESS_IFS, . complexity, . "checks for empty if branches" . } . . declare_lint_pass!(NeedlessIfs => [NEEDLESS_IFS]); . . impl LateLintPass<'_> for NeedlessIfs { 221,872 ( 0.00%) fn check_stmt<'tcx>(&mut self, cx: &LateContext<'tcx>, stmt: &Stmt<'tcx>) { 65,799 ( 0.00%) if let StmtKind::Expr(expr) = stmt.kind . && let Some(If { . cond, . then, . r#else: None, . }) = If::hir(expr) 1,992 ( 0.00%) && let ExprKind::Block(block, ..) = then.kind 664 ( 0.00%) && block.stmts.is_empty() 42 ( 0.00%) && block.expr.is_none() . && !expr.span.in_external_macro(cx.sess().source_map()) . && then.span.check_text(cx, |src| { . // Ignore . // - empty macro expansions . // - empty reptitions in macro expansions . // - comments . // - #[cfg]'d out code . src.bytes() -- line 57 ---------------------------------------- -- line 76 ---------------------------------------- . format!("{cond_snippet};") . } . } else { . String::new() . }, . Applicability::MachineApplicable, . ); . } 253,568 ( 0.00%) } . } -------------------------------------------------------------------------------- -- 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` 70,213 ( 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>)> { 25,532 ( 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 24,575 ( 0.00%) .instantiate_bound_regions_with_erased(cx.tcx.fn_sig(id).instantiate_identity().skip_norm_wip().output()); 308,218 ( 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:: (4,915x) . . // for async functions, peel through `impl Future` to get `T` 24,575 ( 0.00%) if cx.tcx.ty_is_opaque_future(ty) 106,711 ( 0.00%) => ???:::ty_is_opaque_future (4,915x) . && let Some(future_output_ty) = cx.tcx.get_impl_future_output_ty(ty) . { . ty = future_output_ty; . } . 9,830 ( 0.00%) if let ty::Adt(adt_def, args) = ty.kind() 22,902 ( 0.00%) && cx.tcx.is_diagnostic_item(sym::Result, adt_def.did()) 257,344 ( 0.00%) => ???:::is_diagnostic_item (3,817x) . { 310 ( 0.00%) let err_ty = args.type_at(1); . return Some((hir_ty, err_ty)); . } . } . None 57,447 ( 0.00%) } . 53,442 ( 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, . ) { 11,876 ( 0.00%) if let hir::ItemKind::Fn { ref sig, .. } = item.kind 14,796 ( 0.00%) && let Some((hir_ty, err_ty)) = result_err_ty(cx, sig.decl, item.owner_id.def_id, item.span) 693,874 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::result_err_ty (1,233x) . { 270 ( 0.00%) if cx.effective_visibilities.is_exported(item.owner_id.def_id) { 2,658 ( 0.00%) => ???:::is_exported (54x) . let fn_header_span = item.span.with_hi(sig.decl.output.span().hi()); 1 ( 0.00%) check_result_unit_err(cx, err_ty, fn_header_span, msrv); . } 378 ( 0.00%) check_result_large_err(cx, err_ty, hir_ty.span, large_err_threshold, large_err_ignored, false); 753,233 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::check_result_large_err (54x) . } 47,504 ( 0.00%) } . 36,999 ( 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 8,222 ( 0.00%) if let hir::ImplItemKind::Fn(ref sig, _) = item.kind 46,968 ( 0.00%) && let Some((hir_ty, err_ty)) = result_err_ty(cx, sig.decl, item.owner_id.def_id, item.span) 1,395,944 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::result_err_ty (3,914x) 964 ( 0.00%) && trait_ref_of_method(cx, item.owner_id).is_none() 36,544 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::trait_ref_of_method (241x) . { 420 ( 0.00%) if cx.effective_visibilities.is_exported(item.owner_id.def_id) { 4,083 ( 0.00%) => ???:::is_exported (84x) . let fn_header_span = item.span.with_hi(sig.decl.output.span().hi()); 4 ( 0.00%) check_result_unit_err(cx, err_ty, fn_header_span, msrv); . } 588 ( 0.00%) check_result_large_err(cx, err_ty, hir_ty.span, large_err_threshold, large_err_ignored, false); 1,368,900 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::check_result_large_err (84x) . } 32,888 ( 0.00%) } . 12,630 ( 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, . ) { 2,526 ( 0.00%) if let hir::TraitItemKind::Fn(ref sig, _) = item.kind { 2,472 ( 0.00%) let fn_header_span = item.span.with_hi(sig.decl.output.span().hi()); 13,596 ( 0.00%) if let Some((hir_ty, err_ty)) = result_err_ty(cx, sig.decl, item.owner_id.def_id, item.span) { 399,427 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::result_err_ty (1,236x) 75 ( 0.00%) if cx.effective_visibilities.is_exported(item.owner_id.def_id) { 855 ( 0.00%) => ???:::is_exported (15x) . check_result_unit_err(cx, err_ty, fn_header_span, msrv); . } 105 ( 0.00%) check_result_large_err(cx, err_ty, hir_ty.span, large_err_threshold, large_err_ignored, false); 674,117 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::check_result_large_err (15x) . } . } 10,104 ( 0.00%) } . . fn check_result_unit_err(cx: &LateContext<'_>, err_ty: Ty<'_>, fn_header_span: Span, msrv: Msrv) { 54 ( 0.00%) if err_ty.is_unit() && (!is_no_std_crate(cx) || msrv.meets(cx, msrvs::ERROR_IN_CORE)) { 101 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_no_std_crate (1x) 27 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (1x) . span_lint_and_help( . cx, . RESULT_UNIT_ERR, . fn_header_span, . "this returns a `Result<_, ()>`", 8 ( 0.00%) None, . "use a custom `Error` type instead", . ); . } . } . 2,112 ( 0.00%) fn check_result_large_err<'tcx>( . cx: &LateContext<'tcx>, . err_ty: Ty<'tcx>, . hir_ty_span: Span, . large_err_threshold: u64, . large_err_ignored: &DefIdSet, . is_closure: bool, . ) { 352 ( 0.00%) if let ty::Adt(adt, _) = err_ty.kind() 124 ( 0.00%) && large_err_ignored.contains(&adt.did()) . { . return; . } . 1,636 ( 0.00%) let subject = if is_closure { "closure" } else { "function" }; . if let ty::Adt(adt, subst) = err_ty.kind() . && let Some(local_def_id) = adt.did().as_local() 372 ( 0.00%) && let hir::Node::Item(item) = cx.tcx.hir_node_by_def_id(local_def_id) 186 ( 0.00%) && let hir::ItemKind::Enum(_, _, ref def) = item.kind . { 534 ( 0.00%) let variants_size = AdtVariantInfo::new(cx, *adt, subst); 2,479,481 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:::new (89x) 267 ( 0.00%) if let Some((first_variant, variants)) = variants_size.split_first() 267 ( 0.00%) && first_variant.size >= large_err_threshold . { . span_lint_and_then( . cx, . RESULT_LARGE_ERR, . hir_ty_span, . format!("the `Err`-variant returned from this {subject} is very large"), . |diag| { . diag.span_label( -- line 147 ---------------------------------------- -- line 162 ---------------------------------------- . } . } . . diag.help(format!("try reducing the size of `{err_ty}`, for example by boxing large elements or replacing it with `Box<{err_ty}>`")); . }, . ); . } . } else { 265 ( 0.00%) let ty_size = approx_ty_size(cx, err_ty); 307,865 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::approx_ty_size (87x) 178 ( 0.00%) if ty_size >= large_err_threshold { . span_lint_and_then( . cx, . RESULT_LARGE_ERR, . hir_ty_span, . format!("the `Err`-variant returned from this {subject} is very large"), . |diag: &mut Diag<'_, ()>| { . 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}>`")); . }, . ); . } . } 1,408 ( 0.00%) } . 1,695,596 ( 0.01%) pub(super) fn check_expr<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx hir::Expr<'tcx>, . large_err_threshold: u64, . large_err_ignored: &DefIdSet, . ) { 484,456 ( 0.00%) if let hir::ExprKind::Closure(closure) = expr.kind 849 ( 0.00%) && let ty::Closure(_, args) = cx.typeck_results().expr_ty(expr).kind() 11,332 ( 0.00%) => ???:::expr_ty (283x) 283 ( 0.00%) && let closure_sig = args.as_closure().sig() . && let Ok(err_binder) = closure_sig.output().try_map_bound(|output_ty| { 566 ( 0.00%) if let ty::Adt(adt, args) = output_ty.kind() 429 ( 0.00%) && let [_, err_arg] = args.as_slice() 31 ( 0.00%) && let Some(err_ty) = err_arg.as_type() 124 ( 0.00%) && adt.is_diag_item(cx, sym::Result) . { . return Ok(err_ty); . } . . Err(()) . }) . { 69 ( 0.00%) let err_ty = cx.tcx.instantiate_bound_regions_with_erased(err_binder); 621 ( 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:: (23x) 69 ( 0.00%) let hir_ty_span = match closure.fn_decl.output { . hir::FnRetTy::Return(hir_ty) => hir_ty.span, 23 ( 0.00%) hir::FnRetTy::DefaultReturn(_) => expr.span, . }; 299 ( 0.00%) check_result_large_err(cx, err_ty, hir_ty_span, large_err_threshold, large_err_ignored, true); 31,091 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::check_result_large_err (23x) . } 1,937,640 ( 0.02%) } 13,265 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/operators/manual_midpoint.rs -------------------------------------------------------------------------------- Ir -- line 5 ---------------------------------------- . use rustc_ast::BinOpKind; . use rustc_errors::Applicability; . use rustc_hir::{Expr, ExprKind}; . use rustc_lint::LateContext; . use rustc_middle::ty::{self, Ty}; . . use super::MANUAL_MIDPOINT; . 43,406 ( 0.00%) pub(super) fn check<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'_>, . op: BinOpKind, . left: &'tcx Expr<'_>, . right: &'tcx Expr<'_>, . msrv: Msrv, . ) { . let (maybe_add_expr, require_uint) = 27,405 ( 0.00%) if op == BinOpKind::Div && (is_integer_literal(right, 2) || is_float_literal(right, 2.0)) { 188 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_float_literal (20x) . (left, false) 172 ( 0.00%) } else if op == BinOpKind::Mul && is_float_literal(left, 0.5) { 370 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_float_literal (43x) . (right, false) 172 ( 0.00%) } else if op == BinOpKind::Mul && is_float_literal(right, 0.5) { 384 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_float_literal (43x) . (left, false) . } else if op == BinOpKind::Shr && is_integer_literal(right, 1) { . (left, true) . } else { . return; . }; . 6 ( 0.00%) if !left.span.from_expansion() 6 ( 0.00%) && !right.span.from_expansion() . && let Some((add_l_expr, add_r_expr)) = add_operands(maybe_add_expr) . && add_operands(add_l_expr).is_none() && add_operands(add_r_expr).is_none() . && let left_ty = cx.typeck_results().expr_ty_adjusted(add_l_expr) . && let right_ty = cx.typeck_results().expr_ty_adjusted(add_r_expr) . && left_ty == right_ty . && (!require_uint || matches!(left_ty.kind(), ty::Uint(_))) . // Do not lint on `(_+1)/2` and `(1+_)/2`, it is likely a `div_ceil()` operation . && !is_integer_literal(add_l_expr, 1) && !is_integer_literal(add_r_expr, 1) -- line 43 ---------------------------------------- -- line 52 ---------------------------------------- . MANUAL_MIDPOINT, . expr.span, . "manual implementation of `midpoint` which can overflow", . format!("use `{left_ty}::midpoint` instead"), . sugg, . app, . ); . } 31,568 ( 0.00%) } . . /// Return the left and right operands if `expr` represents an addition . fn add_operands<'e, 'tcx>(expr: &'e Expr<'tcx>) -> Option<(&'e Expr<'tcx>, &'e Expr<'tcx>)> { 6 ( 0.00%) match expr.kind { 2 ( 0.00%) ExprKind::Binary(op, left, right) if op.node == BinOpKind::Add => Some((left, right)), . _ => None, . } . } . . fn is_midpoint_implemented(cx: &LateContext<'_>, ty: Ty<'_>, msrv: Msrv) -> bool { . match ty.kind() { . ty::Uint(_) | ty::Float(_) => msrv.meets(cx, msrvs::UINT_FLOAT_MIDPOINT), . ty::Int(_) => msrv.meets(cx, msrvs::INT_MIDPOINT), -- line 73 ---------------------------------------- 6 ( 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 { 2,422,280 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 726,684 ( 0.01%) eq_op::check_assert(cx, e); 28,759,492 ( 0.24%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/eq_op.rs:clippy_lints::operators::eq_op::check_assert (242,228x) 726,684 ( 0.01%) float_cmp::check_assert(cx, e); 20,265,305 ( 0.17%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/float_cmp.rs:clippy_lints::operators::float_cmp::check_assert (242,228x) 1,142,429 ( 0.01%) match e.kind { 20,208 ( 0.00%) ExprKind::Binary(op, lhs, rhs) => { 13,472 ( 0.00%) if !e.span.from_expansion() { 23,676 ( 0.00%) absurd_extreme_comparisons::check(cx, e, op.node, lhs, rhs); 3,181,331 ( 0.03%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/absurd_extreme_comparisons.rs:clippy_lints::operators::absurd_extreme_comparisons::check (3,946x) . if !(macro_with_not_op(lhs) || macro_with_not_op(rhs)) { 23,670 ( 0.00%) eq_op::check(cx, e, op.node, lhs, rhs); 4,031,909 ( 0.03%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/eq_op.rs:clippy_lints::operators::eq_op::check (3,945x) 23,670 ( 0.00%) op_ref::check(cx, e, op.node, lhs, rhs); 463,348 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/op_ref.rs:clippy_lints::operators::op_ref::check (3,945x) . } . erasing_op::check(cx, e, op.node, lhs, rhs); 23,676 ( 0.00%) identity_op::check(cx, e, op.node, lhs, rhs); 1,928,311 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/identity_op.rs:clippy_lints::operators::identity_op::check (3,946x) . invalid_upcast_comparisons::check(cx, op.node, lhs, rhs, e.span); 27,622 ( 0.00%) needless_bitwise_bool::check(cx, e, op.node, lhs, rhs); 89,101 ( 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 (3,946x) 31,568 ( 0.00%) manual_midpoint::check(cx, e, op.node, lhs, rhs, self.msrv); 104,446 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/manual_midpoint.rs:clippy_lints::operators::manual_midpoint::check (3,946x) 27,622 ( 0.00%) manual_is_multiple_of::check(cx, e, op.node, lhs, rhs, self.msrv); 209,138 ( 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 (3,946x) 27,622 ( 0.00%) manual_isolate_lowest_one::check(cx, e, op.node, lhs, rhs, self.msrv); 77,325 ( 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 (3,946x) 19,730 ( 0.00%) decimal_bitwise_operands::check(cx, op.node, lhs, rhs); 90,375 ( 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 (3,946x) . } 47,152 ( 0.00%) self.arithmetic_context.check_binary(cx, e, op.node, lhs, rhs); 320,680 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/numeric_arithmetic.rs:::check_binary (6,736x) 40,416 ( 0.00%) bit_mask::check(cx, e, op.node, lhs, rhs); 858,657 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/bit_mask.rs:clippy_lints::operators::bit_mask::check (6,736x) . verbose_bit_mask::check(cx, e, op.node, lhs, rhs, self.verbose_bit_mask_threshold); 47,152 ( 0.00%) double_comparison::check(cx, op.node, lhs, rhs, e.span); 2,087,503 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/double_comparison.rs:clippy_lints::operators::double_comparison::check (6,736x) 40,416 ( 0.00%) const_comparisons::check(cx, op, lhs, rhs, e.span); 1,063,194 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/const_comparisons.rs:clippy_lints::operators::const_comparisons::check (6,736x) 40,416 ( 0.00%) duration_subsec::check(cx, e, op.node, lhs, rhs); 115,056 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/duration_subsec.rs:clippy_lints::operators::duration_subsec::check (6,736x) 40,416 ( 0.00%) float_equality_without_abs::check(cx, e, op.node, lhs, rhs); 148,775 ( 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 (6,736x) 40,416 ( 0.00%) integer_division::check(cx, e, op.node, lhs, rhs); 150,759 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/integer_division.rs:clippy_lints::operators::integer_division::check (6,736x) 40,416 ( 0.00%) integer_division_remainder_used::check(cx, op.node, lhs, rhs, e.span); 205,490 ( 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 (6,736x) . cmp_owned::check(cx, e, op.node, lhs, rhs); 38,283 ( 0.00%) float_cmp::check(cx, e, op.node, lhs, rhs); 324,679 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/float_cmp.rs:clippy_lints::operators::float_cmp::check (6,736x) . modulo_one::check(cx, e, op.node, rhs); 40,416 ( 0.00%) modulo_arithmetic::check( 122,815 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/modulo_arithmetic.rs:clippy_lints::operators::modulo_arithmetic::check (6,736x) . cx, . e, . op.node, . lhs, . rhs, 6,736 ( 0.00%) self.modulo_arithmetic_allow_comparison_to_zero, . ); 94,304 ( 0.00%) manual_div_ceil::check(cx, e, op.node, lhs, rhs, self.msrv); 592,826 ( 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 (6,736x) . }, 450 ( 0.00%) ExprKind::AssignOp(op, lhs, rhs) => { . let bin_op = op.node.into(); 300 ( 0.00%) if !e.span.from_expansion() { 750 ( 0.00%) decimal_bitwise_operands::check(cx, bin_op, lhs, rhs); 4,336 ( 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 (150x) . } 1,200 ( 0.00%) self.arithmetic_context.check_binary(cx, e, bin_op, lhs, rhs); 19,513 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/numeric_arithmetic.rs:::check_binary (150x) 900 ( 0.00%) misrefactored_assign_op::check(cx, e, bin_op, lhs, rhs); 2,418 ( 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 (150x) 2,100 ( 0.00%) modulo_arithmetic::check(cx, e, bin_op, lhs, rhs, false); 2,550 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/modulo_arithmetic.rs:clippy_lints::operators::modulo_arithmetic::check (150x) . }, 812 ( 0.00%) ExprKind::Assign(lhs, rhs, _) => { 2,436 ( 0.00%) assign_op_pattern::check(cx, e, lhs, rhs, self.msrv); 838,838 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/assign_op_pattern.rs:clippy_lints::operators::assign_op_pattern::check (406x) 4,872 ( 0.00%) self_assignment::check(cx, e, lhs, rhs); 338,870 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/self_assignment.rs:clippy_lints::operators::self_assignment::check (406x) . }, 57 ( 0.00%) ExprKind::Unary(op, arg) => . { . #[expect(clippy::collapsible_match)] 2,509 ( 0.00%) if op == UnOp::Neg { 684 ( 0.00%) self.arithmetic_context.check_negate(cx, e, arg); 28,706 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/numeric_arithmetic.rs:::check_negate (57x) . } . }, . _ => (), . } 1,879,032 ( 0.02%) } . . 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 { 15,982 ( 0.00%) if let ExprKind::Unary(_, e) = e.kind { 396 ( 0.00%) e.span.from_expansion() . } else { . false . } . } 84,934 ( 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. 15,506 ( 0.00%) if matches!(kind, FnKind::Closure) || (span.from_expansion() && span.in_external_macro(cx.sess().source_map())) { . return; . } . 8,624 ( 0.00%) let mut line_count: u64 = 0; 4,312 ( 0.00%) let too_many = body.value.span.check_text(cx, |src| { . let mut in_comment = false; . let mut code_in_line; . 12,936 ( 0.00%) let function_lines = if matches!(body.value.kind, hir::ExprKind::Block(..)) 4,312 ( 0.00%) && src.as_bytes().first().copied() == Some(b'{') 4,312 ( 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(); 68,787 ( 0.00%) if line.is_empty() { . break; . } 134,182 ( 0.00%) if in_comment { 26 ( 0.00%) 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()); 402,468 ( 0.00%) code_in_line |= multi_idx > 0 && single_idx > 0; . // Implies multi_idx is below line.len() 134,156 ( 0.00%) if multi_idx < single_idx { . line = &line[multi_idx + 2..]; . in_comment = true; . continue; . } . } . break; . } 134,145 ( 0.00%) if code_in_line { 246,024 ( 0.00%) line_count += 1; . } . } 17,248 ( 0.00%) line_count > too_many_lines_threshold . }); . . if too_many { . span_lint( . cx, . TOO_MANY_LINES, . cx.tcx.def_span(def_id), 216 ( 0.00%) format!("this function has too many lines ({line_count}/{too_many_lines_threshold})"), . ); . } . } 740,320 ( 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_middle/src/hir/map.rs -------------------------------------------------------------------------------- Ir -- line 30 ---------------------------------------- . tcx: TyCtxt<'tcx>, . // Cache the current value of `hir_owner_nodes` to avoid repeatedly calling the same query for . // the same owner, which will uselessly record many times the same query dependency. . current_owner_nodes: Option<&'tcx OwnerNodes<'tcx>>, . } . . impl<'tcx> ParentHirIterator<'tcx> { . fn new(tcx: TyCtxt<'tcx>, current_id: HirId) -> ParentHirIterator<'tcx> { 9,084 ( 0.00%) ParentHirIterator { current_id, tcx, current_owner_nodes: None } . } . } . . impl<'tcx> Iterator for ParentHirIterator<'tcx> { . type Item = HirId; . . fn next(&mut self) -> Option { . if self.current_id == CRATE_HIR_ID { -- line 46 ---------------------------------------- -- line 100 ---------------------------------------- . Some((self.current_id.owner, node)) . } . } . . impl<'tcx> TyCtxt<'tcx> { . #[inline] . pub fn local_def_id_to_hir_id(self, def_id: impl IntoQueryKey) -> HirId { . let def_id = def_id.into_query_key(); 76,364 ( 0.00%) match self.hir_owner(def_id) { . ProjectedMaybeOwner::Owner(_) => HirId::make_owner(def_id), . ProjectedMaybeOwner::NonOwner(hir_id) => hir_id, . } . } . . /// This function is used only inside eval-always query `analysis` . /// (`analysis -> run_required_analysis` -> `emit_delayed_lints`), so it is safe . /// to obtain delayed lints from non-eval-always `owner` query. -- line 116 ---------------------------------------- -- line 151 ---------------------------------------- . . #[inline] . pub fn expect_hir_owner_node(self, def_id: LocalDefId) -> OwnerNode<'tcx> { . self.expect_hir_owner_nodes(def_id).node() . } . . #[inline] . pub fn hir_owner_node(self, owner_id: OwnerId) -> OwnerNode<'tcx> { 2 ( 0.00%) self.hir_owner_nodes(owner_id).node() 16 ( 0.00%) => ???:::node (1x) . } . . /// Retrieves the `hir::Node` corresponding to `id`. . pub fn hir_node(self, id: HirId) -> Node<'tcx> { . self.hir_owner_nodes(id.owner).nodes[id.local_id].node . } . . /// Retrieves the `hir::Node` corresponding to `id`. . #[inline] . pub fn hir_node_by_def_id(self, id: LocalDefId) -> Node<'tcx> { 28,421 ( 0.00%) self.hir_node(self.local_def_id_to_hir_id(id)) 138 ( 0.00%) => ???:::hir_node (2x) . } . . /// Returns `HirId` of the parent HIR node of node with this `hir_id`. . /// Returns the same `hir_id` if and only if `hir_id == CRATE_HIR_ID`. . /// . /// If calling repeatedly and iterating over parents, prefer [`TyCtxt::hir_parent_iter`]. . pub fn parent_hir_id(self, hir_id: HirId) -> HirId { . let HirId { owner, local_id } = hir_id; -- line 178 ---------------------------------------- -- line 303 ---------------------------------------- . self.hir_span(hir_id), . "body_owned_by: {} has no associated body", . self.hir_id_to_string(hir_id) . ); . }) . } . . pub fn hir_body_param_idents(self, id: BodyId) -> impl Iterator> { 5,916 ( 0.00%) self.hir_body(id).params.iter().map(|param| match param.pat.kind { 970 ( 0.00%) PatKind::Binding(_, _, ident, _) => Some(ident), 24 ( 0.00%) PatKind::Wild => Some(Ident::new(kw::Underscore, param.pat.span)), . _ => None, . }) . } . . /// Returns the `BodyOwnerKind` of this `LocalDefId`. . /// . /// Panics if `LocalDefId` does not have an associated body. 50,395 ( 0.00%) pub fn hir_body_owner_kind(self, def_id: impl Into) -> BodyOwnerKind { 14,150 ( 0.00%) let def_id = def_id.into(); 84,940 ( 0.00%) match self.def_kind(def_id) { . DefKind::Const { .. } | DefKind::AssocConst { .. } => { 241 ( 0.00%) BodyOwnerKind::Const { inline: false } . } . DefKind::AnonConst => BodyOwnerKind::Const { . inline: self.anon_const_kind(def_id) == ty::AnonConstKind::NonTypeSystemInline, 227 ( 0.00%) }, . DefKind::Ctor(..) | DefKind::Fn | DefKind::AssocFn => BodyOwnerKind::Fn, . DefKind::Closure | DefKind::SyntheticCoroutineBody => BodyOwnerKind::Closure, . DefKind::Static { safety: _, mutability, nested: false } => { . BodyOwnerKind::Static(mutability) . } . DefKind::GlobalAsm => BodyOwnerKind::GlobalAsm, . dk => bug!("{:?} is not a body node: {:?}", def_id, dk), . } 44,190 ( 0.00%) } . . /// Returns the `ConstContext` of the body associated with this `LocalDefId`. . /// . /// Panics if `LocalDefId` does not have an associated body. . /// . /// This should only be used for determining the context of a body, a return . /// value of `Some` does not always suggest that the owner of the body is `const`, . /// just that it has to be checked as if it were. -- line 346 ---------------------------------------- -- line 524 ---------------------------------------- . pub fn hir_parent_id_iter(self, current_id: HirId) -> impl Iterator { . ParentHirIterator::new(self, current_id) . } . . /// Returns an iterator for the nodes in the ancestor tree of the `current_id` . /// until the crate root is reached. Prefer this over your own loop using `parent_id`. . #[inline] . pub fn hir_parent_iter(self, current_id: HirId) -> impl Iterator)> { 650,675 ( 0.01%) self.hir_parent_id_iter(current_id).map(move |id| (id, self.hir_node(id))) 1,006 ( 0.00%) => ???:::hir_node (16x) . } . . /// Returns an iterator for the nodes in the ancestor tree of the `current_id` . /// until the crate root is reached. Prefer this over your own loop using `parent_id`. . #[inline] . pub fn hir_parent_owner_iter(self, current_id: HirId) -> ParentOwnerIterator<'tcx> { . ParentOwnerIterator { current_id, tcx: self } . } -- line 540 ---------------------------------------- 106,163 ( 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 { 2,664,508 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 484,456 ( 0.00%) let for_loop = higher::ForLoop::hir(expr); 3,679,340 ( 0.03%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (242,228x) 242,228 ( 0.00%) if let Some(higher::ForLoop { 287 ( 0.00%) pat, 287 ( 0.00%) arg, 287 ( 0.00%) body, 287 ( 0.00%) loop_id, 287 ( 0.00%) span, 1,148 ( 0.00%) label, 484,456 ( 0.00%) }) = 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 574 ( 0.00%) if body.span.from_expansion() { . return; . } 861 ( 0.00%) self.check_for_loop(cx, pat, arg, body, expr, span, label); 861 ( 0.00%) if let ExprKind::Block(block, _) = body.kind { 574 ( 0.00%) never_loop::check(cx, block, loop_id, span, for_loop.as_ref()); 2,097,807 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::check (287x) . } . } . . // we don't want to check expanded macros 484,456 ( 0.00%) if expr.span.from_expansion() { . return; . } . . // check for never_loop 493,826 ( 0.00%) if let ExprKind::Loop(block, ..) = expr.kind { 4,610 ( 0.00%) never_loop::check(cx, block, expr.hir_id, expr.span, None); 22,378,650 ( 0.19%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::check (461x) . } . . // 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`) 1,423 ( 0.00%) if let ExprKind::Loop(block, label, LoopSource::Loop, _) = expr.kind { . // also check for empty `loop {}` statements, skipping those in #[panic_handler] 30 ( 0.00%) empty_loop::check(cx, expr, block); 50 ( 0.00%) while_let_loop::check(cx, expr, block); 566,014 ( 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 (10x) 40 ( 0.00%) infinite_loop::check(cx, expr, block, label); 7,360 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/loops/infinite_loop.rs:clippy_lints::loops::infinite_loop::check (10x) . } . 328,930 ( 0.00%) while_let_on_iterator::check(cx, expr); 2,901,504 ( 0.02%) => /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 (164,455x) . 17 ( 0.00%) if let Some(higher::While { . condition, body, span, .. 17 ( 0.00%) }) = higher::While::hir(expr) . { 68 ( 0.00%) while_immutable_condition::check(cx, condition, body); 968,954 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/loops/while_immutable_condition.rs:clippy_lints::loops::while_immutable_condition::check (17x) 51 ( 0.00%) while_float::check(cx, condition); 1,031 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/loops/while_float.rs:clippy_lints::loops::while_float::check (17x) . missing_spin_loop::check(cx, condition, body); 68 ( 0.00%) manual_while_let_some::check(cx, condition, body, span); 255 ( 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 (17x) . } . 374,624 ( 0.00%) if let ExprKind::MethodCall(path, recv, args, _) = expr.kind { 11,659 ( 0.00%) let name = path.ident.name; . 369 ( 0.00%) let is_iterator_method = || { 252 ( 0.00%) cx.ty_based_def(expr) 2 ( 0.00%) .assoc_fn_parent(cx) . .is_diag_item(cx, sym::Iterator) 492 ( 0.00%) }; . . // is_iterator_method is a bit expensive, so we call it last in each match arm . match (name, args) { 82,610 ( 0.00%) (sym::for_each | sym::all | sym::any, [arg]) => { 98 ( 0.00%) if let ExprKind::Closure(closure) = arg.kind 192 ( 0.00%) && is_iterator_method() 9,344 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/loops/mod.rs:::check_expr::{closure#0} (32x) . { 160 ( 0.00%) unused_enumerate_index::check_method(cx, recv, arg, closure); 8,813 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/loops/unused_enumerate_index.rs:clippy_lints::loops::unused_enumerate_index::check_method (32x) 160 ( 0.00%) never_loop::check_iterator_reduction(cx, expr, recv, closure); 5,277 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::check_iterator_reduction (32x) . } . }, . . (sym::filter_map | sym::find_map | sym::flat_map | sym::map, [arg]) => { 343 ( 0.00%) if let ExprKind::Closure(closure) = arg.kind 546 ( 0.00%) && is_iterator_method() 25,879 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/loops/mod.rs:::check_expr::{closure#0} (91x) . { 232 ( 0.00%) unused_enumerate_index::check_method(cx, recv, arg, closure); 11,618 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/loops/unused_enumerate_index.rs:clippy_lints::loops::unused_enumerate_index::check_method (58x) . } . }, . 2,046 ( 0.00%) (sym::try_for_each | sym::reduce, [arg]) | (sym::fold | sym::try_fold, [_, arg]) => { 113 ( 0.00%) if let ExprKind::Closure(closure) = arg.kind 4 ( 0.00%) && is_iterator_method() . { 8 ( 0.00%) never_loop::check_iterator_reduction(cx, expr, recv, closure); 300 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::check_iterator_reduction (2x) . } . }, . . _ => {}, . } . } 1,937,824 ( 0.02%) } . } . . 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> { 16,639 ( 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, . { 484,840 ( 0.00%) if let Some(ref mut iter) = self.iter { 245,860 ( 0.00%) acc = iter.try_fold(acc, fold)?; 9,037,454 ( 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> (242,228x) . } . try { acc } . } . . #[inline] . fn find

(&mut self, predicate: P) -> Option . where . P: FnMut(&Self::Item) -> bool, -- line 438 ---------------------------------------- 1,356 ( 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/slice.rs -------------------------------------------------------------------------------- Ir -- line 244 ---------------------------------------- . #[rustc_allow_incoherent_impl] . #[stable(feature = "slice_sort_by_key", since = "1.7.0")] . #[inline] . pub fn sort_by_key(&mut self, mut f: F) . where . F: FnMut(&T) -> K, . K: Ord, . { 12 ( 0.00%) stable_sort(self, |a, b| f(a).lt(&f(b))); . } . . /// Sorts the slice in ascending order with a key extraction function, preserving initial order . /// of equal elements. . /// . /// This sort is stable (i.e., does not reorder equal elements) and *O*(*m* \* *n* + *n* \* . /// log(*n*)) worst-case, where the key function is *O*(*m*). . /// -- line 260 ---------------------------------------- -- line 424 ---------------------------------------- . } . let mut vec = Vec::with_capacity_in(s.len(), alloc); . let mut guard = DropGuard { vec: &mut vec, num_init: 0 }; . let slots = guard.vec.spare_capacity_mut(); . // .take(slots.len()) is necessary for LLVM to remove bounds checks . // and has better codegen than zip. . for (i, b) in s.iter().enumerate().take(slots.len()) { . guard.num_init = i; 208 ( 0.00%) slots[i].write(b.clone()); 7,643 ( 0.00%) => ???:::clone (104x) . } . core::mem::forget(guard); . // SAFETY: . // the vec was allocated and initialized above to at least this length. . unsafe { . vec.set_len(s.len()); . } 47,795 ( 0.00%) vec . } . } . . impl ConvertVec for T { . #[inline] . fn to_vec(s: &[Self], alloc: A) -> Vec { . let len = s.len(); . let mut v = Vec::with_capacity_in(len, alloc); . // SAFETY: . // allocated above with the capacity of `s`, and initialize to `s.len()` in . // ptr::copy_to_non_overlapping below. 55,792 ( 0.00%) if len > 0 { . unsafe { . s.as_ptr().copy_to_nonoverlapping(v.as_mut_ptr(), len); . v.set_len(len); . } . } . v . } . } -- line 460 ---------------------------------------- -- line 502 ---------------------------------------- . /// . /// ```should_panic . /// // this will panic at runtime . /// b"0123456789abcdef".repeat(usize::MAX); . /// ``` . #[rustc_allow_incoherent_impl] . #[cfg(not(no_global_oom_handling))] . #[stable(feature = "repeat_generic_slice", since = "1.40.0")] 3,336 ( 0.00%) pub fn repeat(&self, n: usize) -> Vec . where . T: Copy, . { 834 ( 0.00%) if n == 0 { . return Vec::new(); . } . . // If `n` is larger than zero, it can be split as . // `n = 2^expn + rem (2^expn > rem, expn >= 0, rem >= 0)`. . // `2^expn` is the number represented by the leftmost '1' bit of `n`, . // and `rem` is the remaining part of `n`. . -- line 522 ---------------------------------------- -- line 524 ---------------------------------------- . let capacity = self.len().checked_mul(n).expect("capacity overflow"); . let mut buf = Vec::with_capacity(capacity); . . // `2^expn` repetition is done by doubling `buf` `expn`-times. . buf.extend(self); . { . let mut m = n >> 1; . // If `m > 0`, there are remaining bits up to the leftmost '1'. 1,077 ( 0.00%) while m > 0 { . // `buf.extend(buf)`: . unsafe { . ptr::copy_nonoverlapping::( . buf.as_ptr(), . (buf.as_mut_ptr()).add(buf.len()), . buf.len(), . ); . // `buf` has capacity of `self.len() * n`. . let buf_len = buf.len(); 672 ( 0.00%) buf.set_len(buf_len * 2); . } . . m >>= 1; . } . } . . // `rem` (`= n - 2^expn`) repetition is done by copying . // first `rem` repetitions from `buf` itself. . let rem_len = capacity - buf.len(); // `self.len() * rem` 810 ( 0.00%) if rem_len > 0 { . // `buf.extend(buf[0 .. rem_len])`: . unsafe { . // This is non-overlapping since `2^expn > rem`. . ptr::copy_nonoverlapping::( . buf.as_ptr(), . (buf.as_mut_ptr()).add(buf.len()), . rem_len, . ); . // `buf.len() + rem_len` equals to `buf.capacity()` (`= self.len() * n`). . buf.set_len(capacity); . } . } 1,620 ( 0.00%) buf 3,753 ( 0.00%) } . . /// Flattens a slice of `T` into a single value `Self::Output`. . /// . /// # Examples . /// . /// ``` . /// assert_eq!(["hello", "world"].concat(), "helloworld"); . /// assert_eq!([[1, 2], [3, 4]].concat(), [1, 2, 3, 4]); -- line 574 ---------------------------------------- 47,929 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/types/mod.rs -------------------------------------------------------------------------------- Ir -- line 406 ---------------------------------------- . . pub struct Types { . vec_box_size_threshold: u64, . type_complexity_threshold: u64, . avoid_breaking_exported_api: bool, . } . . impl<'tcx> LateLintPass<'tcx> for Types { 68,592 ( 0.00%) fn check_fn( . &mut self, . cx: &LateContext<'tcx>, . fn_kind: FnKind<'_>, . decl: &FnDecl<'tcx>, . _: &Body<'_>, . _: Span, . def_id: LocalDefId, . ) { 28,350 ( 0.00%) let is_in_trait_impl = if let hir::Node::Item(item) = cx . .tcx 11,432 ( 0.00%) .hir_node_by_def_id(cx.tcx.hir_get_parent_item(cx.tcx.local_def_id_to_hir_id(def_id)).def_id) 784,162 ( 0.01%) => ???:::hir_get_parent_item (5,716x) . { 22,714 ( 0.00%) matches!(item.kind, ItemKind::Impl(hir::Impl { of_trait: Some(_), .. })) . } else { . false . }; . 11,432 ( 0.00%) let is_exported = cx.effective_visibilities.is_exported(def_id); 317,000 ( 0.00%) => ???:::is_exported (5,716x) . 6,496 ( 0.00%) self.check_fn_decl( . cx, . decl, . CheckTyContext { . is_in_trait_impl, 22,864 ( 0.00%) in_body: matches!(fn_kind, FnKind::Closure), . is_exported, . ..CheckTyContext::default() . }, . ); 45,728 ( 0.00%) } . . fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'tcx>) { 17,814 ( 0.00%) let is_exported = cx.effective_visibilities.is_exported(item.owner_id.def_id); 323,820 ( 0.00%) => ???:::is_exported (5,938x) . 29,650 ( 0.00%) match item.kind { 965 ( 0.00%) ItemKind::Static(_, _, ty, _) | ItemKind::Const(_, _, ty, _) => self.check_ty( 63,752 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/types/mod.rs:::check_ty (193x) . cx, . ty, . CheckTyContext { . is_exported, . ..CheckTyContext::default() . }, . ), . // functions, enums, structs, impls and traits are covered . _ => (), . } . } . 28,777 ( 0.00%) fn check_impl_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx ImplItem<'tcx>) { 8,222 ( 0.00%) match item.kind { 68 ( 0.00%) ImplItemKind::Const(ty, _) => { 272 ( 0.00%) let is_in_trait_impl = if let hir::Node::Item(item) = cx . .tcx 272 ( 0.00%) .hir_node_by_def_id(cx.tcx.hir_get_parent_item(item.hir_id()).def_id) 9,534 ( 0.00%) => ???:::hir_get_parent_item (68x) . { 544 ( 0.00%) matches!(item.kind, ItemKind::Impl(hir::Impl { of_trait: Some(_), .. })) . } else { . false . }; . 204 ( 0.00%) self.check_ty( 27,997 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/types/mod.rs:::check_ty (68x) . cx, . ty, . CheckTyContext { . is_in_trait_impl, . ..CheckTyContext::default() . }, . ); . }, . // Methods are covered by check_fn. . // Type aliases are ignored because oftentimes it's impossible to . // make type alias declaration in trait simpler, see #1013 . ImplItemKind::Fn(..) | ImplItemKind::Type(..) => (), . } 32,888 ( 0.00%) } . . fn check_field_def(&mut self, cx: &LateContext<'tcx>, field: &hir::FieldDef<'tcx>) { 2,976 ( 0.00%) if field.span.from_expansion() { . return; . } . 4,422 ( 0.00%) let is_exported = cx.effective_visibilities.is_exported(field.def_id); 77,208 ( 0.00%) => ???:::is_exported (1,474x) . 7,370 ( 0.00%) self.check_ty( 1,087,884 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/types/mod.rs:::check_ty (1,474x) . cx, 1,474 ( 0.00%) field.ty, . CheckTyContext { . is_exported, . ..CheckTyContext::default() . }, . ); . } . 12,630 ( 0.00%) fn check_trait_item(&mut self, cx: &LateContext<'tcx>, item: &TraitItem<'tcx>) { 3,789 ( 0.00%) let is_exported = cx.effective_visibilities.is_exported(item.owner_id.def_id); 71,976 ( 0.00%) => ???:::is_exported (1,263x) . . let context = CheckTyContext { . is_exported, . ..CheckTyContext::default() . }; . 10,173 ( 0.00%) match item.kind { 3 ( 0.00%) TraitItemKind::Const(ty, _) | TraitItemKind::Type(_, Some(ty)) => { 12 ( 0.00%) self.check_ty(cx, ty, context); . }, . TraitItemKind::Fn(ref sig, trait_method) => { . // Check only methods without body . // Methods with body are covered by check_fn. 2,472 ( 0.00%) if let TraitFn::Required(_) = trait_method { 2,850 ( 0.00%) self.check_fn_decl(cx, sig.decl, context); . } . }, . TraitItemKind::Type(..) => (), . } 2,608 ( 0.00%) } . . fn check_local(&mut self, cx: &LateContext<'tcx>, local: &LetStmt<'tcx>) { 60,183 ( 0.00%) if let Some(ty) = local.ty { 1,497 ( 0.00%) self.check_ty( 35,981 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/types/mod.rs:::check_ty (499x) . cx, . ty, . CheckTyContext { . in_body: true, . ..CheckTyContext::default() . }, . ); . } . } . } . . impl Types { . pub fn new(conf: &'static Conf) -> Self { . Self { 2 ( 0.00%) vec_box_size_threshold: conf.vec_box_size_threshold, 1 ( 0.00%) type_complexity_threshold: conf.type_complexity_threshold, 1 ( 0.00%) avoid_breaking_exported_api: conf.avoid_breaking_exported_api, . } . } . . fn check_fn_decl<'tcx>(&mut self, cx: &LateContext<'tcx>, decl: &FnDecl<'tcx>, context: CheckTyContext) { . // Ignore functions in trait implementations as they are usually forced by the trait definition. . // . // FIXME: ideally we would like to warn *if the complicated type can be simplified*, but it's hard . // to check. 17,148 ( 0.00%) if context.is_in_trait_impl { . return; . } . 4,198 ( 0.00%) for input in decl.inputs { 38,248 ( 0.00%) self.check_ty(cx, input, context); 1,282,754 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/types/mod.rs:::check_ty (2,222x) . } . 12,017 ( 0.00%) if let FnRetTy::Return(ty) = decl.output { 14,484 ( 0.00%) self.check_ty(cx, ty, context); 2,080,200 ( 0.02%) => site/frontend/rust-clippy/clippy_lints/src/types/mod.rs:::check_ty (2,687x) . } . } . . /// Recursively check for `TypePass` lints in the given type. Stop at the first . /// lint found. . /// . /// The parameter `is_local` distinguishes the context of the type. 187,143 ( 0.00%) fn check_ty<'tcx>(&mut self, cx: &LateContext<'tcx>, hir_ty: &hir::Ty<'tcx>, mut context: CheckTyContext) { 46,603 ( 0.00%) if hir_ty.span.from_expansion() { . return; . } . . // Skip trait implementations; see issue #605. 42,148 ( 0.00%) if context.is_in_trait_impl { . return; . } . 46,766 ( 0.00%) if !context.is_nested_call && type_complexity::check(cx, hir_ty, self.type_complexity_threshold) { . return; . } . 162,223 ( 0.00%) match hir_ty.kind { 46,848 ( 0.00%) TyKind::Path(ref qpath) if !context.in_body => { 31,026 ( 0.00%) let hir_id = hir_ty.hir_id; 46,539 ( 0.00%) let res = cx.qpath_res(qpath, hir_id); 330,001 ( 0.00%) => ???:::qpath_res (14,022x) . if let Some(def_id) = res.opt_def_id() . && self.is_type_change_allowed(context) . { . // All lints that are being checked in this block are guarded by . // the `avoid_breaking_exported_api` configuration. When adding a . // new lint, please also add the name to the configuration documentation . // in `clippy_config::conf` . . let mut triggered = false; 49,860 ( 0.00%) triggered |= box_collection::check(cx, hir_ty, qpath, def_id); 491,629 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/types/box_collection.rs:clippy_lints::types::box_collection::check (7,442x) 66,480 ( 0.00%) triggered |= redundant_allocation::check(cx, hir_ty, qpath, def_id); 978,007 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/types/redundant_allocation.rs:clippy_lints::types::redundant_allocation::check (7,442x) 58,170 ( 0.00%) triggered |= rc_buffer::check(cx, hir_ty, qpath, def_id); 627,625 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/types/rc_buffer.rs:clippy_lints::types::rc_buffer::check (7,442x) 74,790 ( 0.00%) triggered |= vec_box::check(cx, hir_ty, qpath, def_id, self.vec_box_size_threshold); 631,893 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/types/vec_box.rs:clippy_lints::types::vec_box::check (7,442x) 58,170 ( 0.00%) triggered |= option_option::check(cx, hir_ty, qpath, def_id); 643,434 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/types/option_option.rs:clippy_lints::types::option_option::check (7,442x) 49,860 ( 0.00%) triggered |= linked_list::check(cx, hir_ty, def_id); 522,178 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/types/linked_list.rs:clippy_lints::types::linked_list::check (7,442x) 66,480 ( 0.00%) triggered |= rc_mutex::check(cx, hir_ty, qpath, def_id); 589,156 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/types/rc_mutex.rs:clippy_lints::types::rc_mutex::check (7,442x) 41,550 ( 0.00%) triggered |= owned_cow::check(cx, qpath, def_id); 604,040 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/types/owned_cow.rs:clippy_lints::types::owned_cow::check (7,442x) . 132,960 ( 0.00%) if triggered { . return; . } . } 61,862 ( 0.00%) match *qpath { . QPath::Resolved(Some(ty), p) => { . context.is_nested_call = true; 18 ( 0.00%) self.check_ty(cx, ty, context); 974 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/types/mod.rs:::check_ty'2 (1x) 6 ( 0.00%) for ty in p.segments.iter().flat_map(|seg| { . seg.args . .as_ref() . .map_or_else(|| [].iter(), |params| params.args.iter()) . .filter_map(|arg| match arg { . GenericArg::Type(ty) => Some(ty), . _ => None, . }) . }) { . self.check_ty(cx, ty.as_unambig_ty(), context); . } . }, . QPath::Resolved(None, p) => { . context.is_nested_call = true; 32,057 ( 0.00%) for ty in p.segments.iter().flat_map(|seg| { . seg.args . .as_ref() 2,346 ( 0.00%) .map_or_else(|| [].iter(), |params| params.args.iter()) 2,666 ( 0.00%) .filter_map(|arg| match arg { . GenericArg::Type(ty) => Some(ty), . _ => None, . }) . }) { 7,362 ( 0.00%) self.check_ty(cx, ty.as_unambig_ty(), context); 758,044 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/types/mod.rs:::check_ty'2 (1,147x) . } . }, 95 ( 0.00%) QPath::TypeRelative(ty, seg) => { . context.is_nested_call = true; 570 ( 0.00%) self.check_ty(cx, ty, context); 14,128 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/types/mod.rs:::check_ty'2 (42x) 285 ( 0.00%) if let Some(params) = seg.args { . for ty in params.args.iter().filter_map(|arg| match arg { . GenericArg::Type(ty) => Some(ty), . _ => None, . }) { . self.check_ty(cx, ty.as_unambig_ty(), context); . } . } . }, . } . }, . TyKind::Path(ref qpath) => { 618 ( 0.00%) let res = cx.qpath_res(qpath, hir_ty.hir_id); 2,419 ( 0.00%) => ???:::qpath_res (103x) . if let Some(def_id) = res.opt_def_id() . && self.is_type_change_allowed(context) . { 189 ( 0.00%) owned_cow::check(cx, qpath, def_id); 5,521 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/types/owned_cow.rs:clippy_lints::types::owned_cow::check (63x) . } . }, 9,440 ( 0.00%) TyKind::Ref(lt, ref mut_ty) => { . context.is_nested_call = true; 28,320 ( 0.00%) if !borrowed_box::check(cx, hir_ty, lt, mut_ty) { 175,393 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/types/borrowed_box.rs:clippy_lints::types::borrowed_box::check (4,624x) . self.check_ty(cx, mut_ty.ty, context); . } . }, 232 ( 0.00%) TyKind::Slice(ty) | TyKind::Array(ty, _) | TyKind::Ptr(MutTy { ty, .. }) => { . context.is_nested_call = true; . self.check_ty(cx, ty, context); . }, 176 ( 0.00%) TyKind::Tup(tys) => { . context.is_nested_call = true; . for ty in tys { 1,072 ( 0.00%) self.check_ty(cx, ty, context); 61,419 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/types/mod.rs:::check_ty'2 (160x) . } . }, . _ => {}, . } 136,104 ( 0.00%) } . . /// This function checks if the type is allowed to change in the current context . /// based on the `avoid_breaking_exported_api` configuration . fn is_type_change_allowed(&self, context: CheckTyContext) -> bool { . !(context.is_exported && self.avoid_breaking_exported_api) . } . } . -- line 694 ---------------------------------------- 142,596 ( 0.00%) -------------------------------------------------------------------------------- -- 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; . 17,080 ( 0.00%) fn docs_link(diag: &mut Diag<'_, ()>, lint: &'static Lint) { 6,832 ( 0.00%) if env::var("CLIPPY_DISABLE_DOCS_LINKS").is_err() 13,664 ( 0.00%) && let Some(lint) = lint.name_lower().strip_prefix("clippy::") 461,064 ( 0.00%) => ???:::name_lower (3,416x) . { 20,496 ( 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", 10,248 ( 0.00%) _ => "main", . } . )); . } 13,664 ( 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) { 1,511 ( 0.00%) span_lint_and_then(cx, lint, sp, msg, |_| {}); 65,648 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then::::{closure#0}> (50x) . } . . /// 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 145 ---------------------------------------- . pub fn span_lint_and_help( . cx: &T, . lint: &'static Lint, . span: impl Into, . msg: impl Into, . help_span: Option, . help: impl Into, . ) { 1,460 ( 0.00%) span_lint_and_then(cx, lint, span, msg, |diag| { 878,373 ( 0.01%) => site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then::::{closure#0}> (4x) 21 ( 0.00%) if let Some(help_span) = help_span { . diag.span_help(help_span, help.into()); . } else { . diag.help(help.into()); . } . }); . } . . /// Like [`span_lint`] but with a `note` section instead of a `help` message. -- line 162 ---------------------------------------- -- line 200 ---------------------------------------- . pub fn span_lint_and_note( . cx: &T, . lint: &'static Lint, . span: impl Into, . msg: impl Into, . note_span: Option, . note: impl Into, . ) { 42 ( 0.00%) span_lint_and_then(cx, lint, span, msg, |diag| { 1,152,811 ( 0.01%) => site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then::::{closure#0}> (3x) 9 ( 0.00%) if let Some(note_span) = note_span { . diag.span_note(note_span, note.into()); . } else { . diag.note(note.into()); . } . }); . } . . /// Like [`span_lint`] but allows to add notes, help and suggestions using a closure. -- line 217 ---------------------------------------- -- 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] 92,966 ( 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 { 21,918 ( 0.00%) fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, ()> { . let mut lint = Diag::new(dcx, level, ""); . (self.0)(&mut lint); 6,986 ( 0.00%) lint 14,932 ( 0.00%) } . } . . let sp = sp.into(); . #[expect(clippy::disallowed_methods)] 17,836 ( 0.00%) cx.emit_span_lint( 34,105 ( 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::::check_item::{closure#0}>::{closure#0}>> (66x) . lint, . sp.clone(), 203,626 ( 0.00%) ClippyDiag(|diag: &mut Diag<'_, ()>| { 30 ( 0.00%) => ???:0x0000000000173dc0 (1x) 4,176 ( 0.00%) diag.primary_message(msg); 4,176 ( 0.00%) diag.span(sp); 15,738 ( 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:: (366x) 7,408 ( 0.00%) f(diag); 616 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/unnecessary_literal_unwrap.rs:clippy_lints::methods::unnecessary_literal_unwrap::check::{closure#1} (1x) 6,744 ( 0.00%) docs_link(diag, lint); 1,068,879 ( 0.01%) => site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::docs_link (366x) . . #[cfg(debug_assertions)] . validate_diag(diag); . }), . ); 53,656 ( 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) { 11 ( 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 325 ---------------------------------------- . cx: &LateContext<'_>, . lint: &'static Lint, . hir_id: HirId, . sp: impl Into, . msg: impl Into, . f: impl FnOnce(&mut Diag<'_, ()>), . ) { . #[expect(clippy::disallowed_methods)] 5,566 ( 0.00%) cx.tcx.emit_node_span_lint( 421,303 ( 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:::emit_node_span_lint::::{closure#0}>> (1x) . lint, . hir_id, . sp, 12,648 ( 0.00%) rustc_errors::DiagDecorator(|diag| { 12 ( 0.00%) diag.primary_message(msg); 2,879 ( 0.00%) f(diag); 5,190 ( 0.00%) docs_link(diag, lint); 1,451,025 ( 0.01%) => site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::docs_link (520x) . . #[cfg(debug_assertions)] . validate_diag(diag); . }), . ); . } . . /// Add a span lint with a suggestion on how to fix it. -- line 348 ---------------------------------------- -- 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] 9,822 ( 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, . ) { 3,709 ( 0.00%) span_lint_and_then(cx, lint, sp, msg.into(), |diag| { 523 ( 0.00%) 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(()); . }); 5,768 ( 0.00%) } 247,768 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/methods/implicit_clone.rs -------------------------------------------------------------------------------- Ir -- line 5 ---------------------------------------- . use clippy_utils::ty::{implements_trait, peel_and_count_ty_refs}; . use rustc_errors::Applicability; . use rustc_hir as hir; . use rustc_lint::LateContext; . use rustc_span::Symbol; . . use super::IMPLICIT_CLONE; . 1,152 ( 0.00%) pub fn check(cx: &LateContext<'_>, method_name: Symbol, expr: &hir::Expr<'_>, recv: &hir::Expr<'_>) { 1,024 ( 0.00%) if let Some(method_parent_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id).opt_parent(cx) 6,544 ( 0.00%) => ???:::type_dependent_def_id (128x) 896 ( 0.00%) && is_clone_like(cx, method_name, method_parent_id) 16,275 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/implicit_clone.rs:clippy_lints::methods::implicit_clone::is_clone_like (128x) 605 ( 0.00%) && let return_type = cx.typeck_results().expr_ty(expr) 4,840 ( 0.00%) => ???:::expr_ty (121x) 363 ( 0.00%) && let input_type = cx.typeck_results().expr_ty(recv) 4,840 ( 0.00%) => ???:::expr_ty (121x) 484 ( 0.00%) && let (input_type, ref_count, _) = peel_and_count_ty_refs(input_type) 2,119 ( 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 (121x) 448 ( 0.00%) && !(ref_count > 0 && method_parent_id.is_diag_item(cx, sym::ToOwned)) 56 ( 0.00%) && let Some(ty_name) = input_type.ty_adt_def().map(|adt_def| cx.tcx.item_name(adt_def.did())) 56 ( 0.00%) && return_type == input_type . && let Some(clone_trait) = cx.tcx.lang_items().clone_trait() . && implements_trait(cx, return_type, clone_trait, &[]) . { . let mut app = Applicability::MachineApplicable; . let recv_snip = snippet_with_context(cx, recv.span, expr.span.ctxt(), "..", &mut app).0; . span_lint_and_sugg( . cx, . IMPLICIT_CLONE, -- line 29 ---------------------------------------- -- line 33 ---------------------------------------- . if ref_count > 1 { . format!("({}{recv_snip}).clone()", "*".repeat(ref_count - 1)) . } else { . format!("{recv_snip}.clone()") . }, . app, . ); . } 1,024 ( 0.00%) } . . /// Returns true if the named method can be used to clone the receiver. 12,714 ( 0.00%) pub fn is_clone_like(cx: &LateContext<'_>, method_name: Symbol, method_parent_id: hir::def_id::DefId) -> bool { . match method_name { 44,114 ( 0.00%) sym::to_os_string => method_parent_id.opt_impl_ty(cx).is_diag_item(cx, sym::OsStr), . sym::to_owned => method_parent_id.is_diag_item(cx, sym::ToOwned), . sym::to_path_buf => method_parent_id.opt_impl_ty(cx).is_diag_item(cx, sym::Path), . sym::to_string => method_parent_id.is_diag_item(cx, sym::ToString), . sym::to_vec => method_parent_id 60 ( 0.00%) .opt_impl_ty(cx) 4,209 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/res.rs:::opt_impl_ty:: (12x) . .is_some_and(|ty| ty.instantiate_identity().skip_norm_wip().is_slice()), . _ => false, . } 12,468 ( 0.00%) } 536 ( 0.00%) -------------------------------------------------------------------------------- -- 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)] 1,937,824 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . // Skip path expressions from deref calls. e.g. `Deref::deref(e)` 484,456 ( 0.00%) 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 484,456 ( 0.00%) if expr.span.from_expansion() { 155,546 ( 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 323,305 ( 0.00%) if let Some((state, data)) = self.state.take() { 1,345 ( 0.00%) self.report(cx, expr, state, data, typeck); . } . return; . }; 6,165 ( 0.00%) self.skip_expr = skip_expr; . 12,330 ( 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; . } . 12,330 ( 0.00%) match (self.state.take(), kind) { . (None, kind) => { 24,660 ( 0.00%) let expr_ty = typeck.expr_ty(expr); 246,672 ( 0.00%) => ???:::expr_ty (6,165x) 30,825 ( 0.00%) let use_site = get_expr_use_site(cx.tcx, typeck, SyntaxContext::root(), expr); 1,952,040 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_expr_use_site (6,165x) 31,500 ( 0.00%) let adjusted_ty = use_site.adjustments.last().map_or(expr_ty, |a| a.target); . 67,815 ( 0.00%) match kind { 1,370 ( 0.00%) RefOp::Deref if use_site.same_ctxt => { 665 ( 0.00%) let use_node = use_site.use_node(cx); 20,770 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:::use_node (665x) 1,995 ( 0.00%) let sub_ty = typeck.expr_ty(sub_expr); 26,624 ( 0.00%) => ???:::expr_ty (665x) 3,990 ( 0.00%) if let ExprUseNode::FieldAccess(name) = use_node . && !use_site.moved_before_use . && !ty_contains_field(sub_ty, name.name) . { . self.state = Some(( . State::ExplicitDerefField { . name: name.name, . derefs_manually_drop: is_manually_drop(sub_ty), . }, . StateData { . first_expr: expr, . adjusted_ty, . }, . )); 665 ( 0.00%) } else if sub_ty.is_ref() . // Linting method receivers would require verifying that name lookup . // would resolve the same way. This is complicated by trait methods. . && !use_node.is_recv() 1,881 ( 0.00%) && let Some(ty) = use_node.defined_ty(cx) 123,318 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:::defined_ty (627x) 556 ( 0.00%) && TyCoercionStability::for_defined_ty(cx, ty, use_node.is_return()).is_deref_stable() 14,328 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/dereference.rs:::for_defined_ty (278x) . { . self.state = Some(( . State::ExplicitDeref { mutability: None }, . StateData { . first_expr: expr, . adjusted_ty, . }, . )); -- line 315 ---------------------------------------- -- line 328 ---------------------------------------- . mutbl, . }, . StateData { . first_expr: expr, . adjusted_ty, . }, . )); . }, 10,960 ( 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) => { 19,934 ( 0.00%) if !matches!(adjust.kind, Adjust::Deref(_)) { . break Some(adjust); 4,464 ( 0.00%) } else if !adjust.target.is_ref() { . deref_count += 1; . break iter.next(); . } . deref_count += 1; . }, . None => break None, . } . }; . 32,616 ( 0.00%) let use_node = use_site.use_node(cx); 168,262 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:::use_node (5,436x) 21,744 ( 0.00%) let stability = use_node.defined_ty(cx).map_or(TyCoercionStability::None, |ty| { 778,589 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:::defined_ty (5,436x) 4,442 ( 0.00%) TyCoercionStability::for_defined_ty(cx, ty, use_node.is_return()) 4,215,379 ( 0.04%) => site/frontend/rust-clippy/clippy_lints/src/dereference.rs:::for_defined_ty (2,221x) . }); 71,254 ( 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 }) 16,366 ( 0.00%) } else if let Some(&Adjustment { . kind: Adjust::Borrow(AutoBorrow::Ref(mutability)), . .. 5,436 ( 0.00%) }) = next_adjust 17,392 ( 0.00%) && matches!(mutability, AutoBorrowMutability::Mut { .. }) . && !stability.is_reborrow_stable() . { . (3, deref_msg) . } else { . (2, deref_msg) . }; . 10,872 ( 0.00%) if deref_count >= required_refs { 150 ( 0.00%) 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, 210 ( 0.00%) for_field_access: if let ExprUseNode::FieldAccess(name) = use_node . && !use_site.moved_before_use . { . Some(name.name) . } else { . None . }, . }), . StateData { . first_expr: expr, . adjusted_ty, . }, . )); 5,406 ( 0.00%) } else if stability.is_deref_stable() . // Auto-deref doesn't combine with other adjustments 11,032 ( 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(_))) . { 3,945 ( 0.00%) self.state = Some(( . State::Borrow { mutability }, . StateData { . first_expr: expr, . adjusted_ty, . }, . )); . } . }, -- line 521 ---------------------------------------- -- 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), . } 1,937,824 ( 0.02%) } . 408,954 ( 0.00%) fn check_pat(&mut self, cx: &LateContext<'tcx>, pat: &'tcx Pat<'_>) { 257,918 ( 0.00%) if let PatKind::Binding(BindingMode::REF, id, name, _) = pat.kind { 4,179 ( 0.00%) if let Some(opt_prev_pat) = self.ref_locals.get_mut(&id) { 16,716 ( 0.00%) => /rust/deps/indexmap-2.14.0/src/map.rs:>::get_mut:: (1,393x) . // 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); . prev_pat.replacements.push(( -- line 662 ---------------------------------------- -- line 665 ---------------------------------------- . .0 . .into(), . )); . } . } . return; . } . 2,786 ( 0.00%) if !pat.span.from_expansion() 6,960 ( 0.00%) && let ty::Ref(_, tam, _) = *cx.typeck_results().pat_ty(pat).kind() 55,680 ( 0.00%) => ???:::pat_ty (1,392x) . // only lint immutable refs, because borrowed `&mut T` cannot be moved out 2,784 ( 0.00%) && let ty::Ref(_, _, Mutability::Not) = *tam.kind() . { . let mut app = Applicability::MachineApplicable; . let snip = snippet_with_context(cx, name.span, pat.span.ctxt(), "..", &mut app).0; . self.current_body = self.current_body.or(cx.enclosing_body); . self.ref_locals.insert( . id, . Some(RefPat { . always_deref: true, -- line 684 ---------------------------------------- -- line 685 ---------------------------------------- . spans: vec![pat.span], . app, . replacements: vec![(pat.span, snip.into())], . hir_id: pat.hir_id, . }), . ); . } . } 467,376 ( 0.00%) } . 43,428 ( 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; . } 49,632 ( 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 15,700 ( 0.00%) if !self.in_deref_impl() && is_deref_or_derefmut_impl(cx, item) { 20 ( 0.00%) 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) { 10 ( 0.00%) self.outermost_deref_impl = None; . } . } . } . . fn is_deref_or_derefmut_impl(cx: &LateContext<'_>, item: &Item<'_>) -> bool { 23,752 ( 0.00%) if let hir::ItemKind::Impl(impl_) = item.kind . && let Some(of_trait) = impl_.of_trait 5,733 ( 0.00%) && let Some(trait_id) = of_trait.trait_ref.trait_def_id() 24,843 ( 0.00%) => ???:::trait_def_id (1,911x) . { 7,638 ( 0.00%) cx.tcx.lang_items().deref_trait() == Some(trait_id) || cx.tcx.lang_items().deref_mut_trait() == Some(trait_id) 152,640 ( 0.00%) => ???:::lang_items (3,816x) . } else { . false . } . } . . fn try_parse_ref_op<'tcx>( . tcx: TyCtxt<'tcx>, . typeck: &'tcx TypeckResults<'_>, . expr: &'tcx Expr<'_>, . ) -> Option<(RefOp, &'tcx Expr<'tcx>, Option)> { 1,034,552 ( 0.01%) let (call_path_id, def_id, arg) = match expr.kind { 87,098 ( 0.00%) ExprKind::MethodCall(_, arg, [], _) => (None, typeck.type_dependent_def_id(expr.hir_id)?, arg), 325,994 ( 0.00%) => ???:::type_dependent_def_id (6,378x) . ExprKind::Call( . &Expr { 2,985 ( 0.00%) kind: ExprKind::Path(QPath::Resolved(None, path)), 2,911 ( 0.00%) hir_id, . .. . }, 36,479 ( 0.00%) [arg], . ) => (Some(hir_id), path.res.opt_def_id()?, arg), 6,165 ( 0.00%) ExprKind::Unary(UnOp::Deref, sub_expr) if !typeck.expr_ty(sub_expr).is_raw_ptr() => { 27,424 ( 0.00%) => ???:::expr_ty (685x) . return Some((RefOp::Deref, sub_expr, None)); . }, . ExprKind::AddrOf(BorrowKind::Ref, mutability, sub_expr) => { 27,400 ( 0.00%) return Some((RefOp::AddrOf(mutability), sub_expr, None)); . }, . _ => return None, . }; 83,601 ( 0.00%) let mutbl = match tcx.get_diagnostic_name(def_id) { 626,601 ( 0.01%) => ???:::get_diagnostic_name (9,289x) . 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 { 11,090 ( 0.00%) matches!(self, Self::Deref) . } . . fn is_reborrow_stable(self) -> bool { . matches!(self, Self::Deref | Self::Reborrow) . } . 14,994 ( 0.00%) fn for_defined_ty<'tcx>(cx: &LateContext<'tcx>, ty: DefinedTy<'tcx>, for_return: bool) -> Self { 7,497 ( 0.00%) match ty { 34 ( 0.00%) DefinedTy::Hir(ty) => Self::for_hir_ty(ty), 7,067 ( 0.00%) DefinedTy::Mir { def_site_def_id, ty } => Self::for_mir_ty( . cx.tcx, . def_site_def_id, 7,395 ( 0.00%) cx.tcx.instantiate_bound_regions_with_erased(ty), 1,785,201 ( 0.01%) => /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:: (2,465x) . for_return, . ), . } 17,493 ( 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; . // . // Here `y1` and `y2` would resolve to different types, so the type `&Box<_>` is not stable when . // switching to auto-dereferencing. . fn for_hir_ty<'tcx>(ty: &'tcx hir::Ty<'tcx>) -> Self { 68 ( 0.00%) let TyKind::Ref(_, ty) = &ty.kind else { . return Self::None; . }; . let mut ty = ty; . . loop { 210 ( 0.00%) break match ty.ty.kind { . TyKind::Ref(_, ref ref_ty) => { . ty = ref_ty; . continue; . }, 8 ( 0.00%) TyKind::Path( . QPath::TypeRelative(_, path) . | QPath::Resolved( . _, . Path { 184 ( 0.00%) segments: [.., path], .. . }, . ), . ) => { 90 ( 0.00%) if let Some(args) = path.args 64 ( 0.00%) && args.args.iter().any(|arg| match arg { 880 ( 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 core::iter::traits::iterator::Iterator>::any::<::for_hir_ty::{closure#0}> (8x) . hir::GenericArg::Infer(_) => true, . hir::GenericArg::Type(ty) => ty_contains_infer(ty.as_unambig_ty()), . _ => false, . }) . { . Self::Reborrow . } else { . Self::Deref -- line 887 ---------------------------------------- -- 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 { 4,930 ( 0.00%) let ty::Ref(_, mut ty, _) = *ty.kind() else { . return Self::None; . }; . 4,274 ( 0.00%) if let Some(def_id) = def_site_def_id { 8,532 ( 0.00%) let typing_env = ty::TypingEnv::non_body_analysis(tcx, def_id); 1,907,760 ( 0.02%) => /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:: (2,133x) . ty = tcx . .try_normalize_erasing_regions(typing_env, Unnormalized::new_wip(ty)) . .unwrap_or(ty); . } . loop { 12,755 ( 0.00%) break match *ty.kind() { . ty::Ref(_, ref_ty, _) => { . ty = ref_ty; . continue; . }, 864 ( 0.00%) ty::Param(_) if for_return => Self::Deref, . ty::Alias( . _, . ty::AliasTy { . kind: ty::Free { .. } | ty::Inherent { .. }, . .. . }, . ) => unreachable!("should have been normalized away above"), . ty::Alias( . _, . ty::AliasTy { . kind: ty::Projection { .. }, . .. . }, 1,242 ( 0.00%) ) if !for_return && ty.has_non_region_param() => Self::Reborrow, . ty::Infer(_) . | ty::Error(_) . | ty::Bound(..) . | ty::Alias( . _, . ty::AliasTy { . kind: ty::Opaque { .. }, . .. . }, . ) . | ty::Placeholder(_) . | ty::Dynamic(..) . | ty::Param(_) => Self::Reborrow, . ty::Adt(_, args) 3,768 ( 0.00%) if ty.has_placeholders() . || ty.has_opaque_types() 5,009 ( 0.00%) || (!for_return && args.has_non_region_param()) => . { . Self::Reborrow . }, . ty::Bool . | ty::Char . | ty::Int(_) . | ty::Uint(_) . | ty::Array(..) -- line 970 ---------------------------------------- -- line 1007 ---------------------------------------- . } . self.visit_id(inf_id); . } . . fn visit_ty(&mut self, ty: &hir::Ty<'_, AmbigArg>) { . if self.0 || matches!(ty.kind, TyKind::OpaqueDef(..) | TyKind::Err(_)) { . self.0 = true; . } else { 16 ( 0.00%) walk_ty(self, ty); 496 ( 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:: (8x) . } . } . } 8 ( 0.00%) let mut v = V(false); . v.visit_ty_unambig(ty); . v.0 . } . . fn ty_contains_field(ty: Ty<'_>, name: Symbol) -> bool { . if let ty::Adt(adt, _) = *ty.kind() { . adt.is_struct() && adt.all_fields().any(|f| f.name == name) . } else { -- line 1027 ---------------------------------------- -- 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) { 290,572 ( 0.00%) if let Some(outer_pat) = self.ref_locals.get_mut(&local) 871,716 ( 0.01%) => /rust/deps/indexmap-2.14.0/src/map.rs:>::get_mut:: (72,643x) . && let Some(pat) = outer_pat . // Check for auto-deref . && !matches!( . cx.typeck_results().expr_adjustments(e), . [ . Adjustment { . kind: Adjust::Deref(_), . .. -- line 1046 ---------------------------------------- -- line 1089 ---------------------------------------- . // binding, but not if the identifier was created in a macro. e.g. `concat_idents` and proc . // macros . _ => *outer_pat = None, . } . } . } . . #[expect(clippy::needless_pass_by_value, clippy::too_many_lines)] 13,450 ( 0.00%) fn report( . &self, . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'_>, . state: State, . data: StateData<'tcx>, . typeck: &'tcx TypeckResults<'tcx>, . ) { 10,760 ( 0.00%) match state { . State::DerefMethod { . ty_changed_count, . is_ufcs, . mutbl, . } => { . if self.in_deref_impl() { . // `deref(_mut)` is fine in an `impl Deref(Mut)` . return; -- line 1113 ---------------------------------------- -- line 1151 ---------------------------------------- . Mutability::Not => "explicit `deref` method call", . Mutability::Mut => "explicit `deref_mut` method call", . }, . "try", . format!("{addr_of_str}{deref_str}{expr_str}"), . app, . ); . }, 60 ( 0.00%) State::DerefedBorrow(state) => { . // Do not suggest removing a non-mandatory `&` in `&*rawptr` in an `unsafe` context, . // as this may make rustc trigger its `dangerous_implicit_autorefs` lint. 150 ( 0.00%) if let ExprKind::AddrOf(BorrowKind::Ref, _, subexpr) = data.first_expr.kind 60 ( 0.00%) && let ExprKind::Unary(UnOp::Deref, subsubexpr) = subexpr.kind . && cx.typeck_results().expr_ty_adjusted(subsubexpr).is_raw_ptr() . { . return; . } . 60 ( 0.00%) let mut app = Applicability::MachineApplicable; 60 ( 0.00%) let (snip, snip_is_macro) = 60 ( 0.00%) snippet_with_context(cx, expr.span, data.first_expr.span.ctxt(), "..", &mut app); . span_lint_hir_and_then( . cx, 60 ( 0.00%) NEEDLESS_BORROW, 60 ( 0.00%) data.first_expr.hir_id, . data.first_expr.span, . state.msg, 30 ( 0.00%) |diag| { 270 ( 0.00%) let needs_paren = match cx.tcx.parent_hir_node(data.first_expr.hir_id) { 3,422 ( 0.00%) => ???:::parent_hir_node (30x) 90 ( 0.00%) Node::Expr(e) => match e.kind { 42 ( 0.00%) ExprKind::Call(callee, _) if callee.hir_id != data.first_expr.hir_id => false, . ExprKind::Call(..) => { . cx.precedence(expr) < ExprPrecedence::Unambiguous . || matches!(expr.kind, ExprKind::Field(..)) . }, 63 ( 0.00%) _ => cx.precedence(expr) < cx.precedence(e), 1,962 ( 0.00%) => ???:::precedence (18x) . }, . _ => false, . }; 120 ( 0.00%) let is_in_tuple = matches!( 120 ( 0.00%) get_parent_expr(cx, data.first_expr), 3,752 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (30x) . Some(Expr { . kind: ExprKind::Tup(..), . .. . }) . ); . 150 ( 0.00%) let sugg = if !snip_is_macro && needs_paren && !has_enclosing_paren(&snip) && !is_in_tuple { . format!("({snip})") . } else { . snip.into() . }; 90 ( 0.00%) diag.span_suggestion(data.first_expr.span, "change this to", sugg, app); 90 ( 0.00%) }, . ); . }, . State::ExplicitDeref { mutability } => { . if is_block_like(expr) . && let ty::Ref(_, ty, _) = data.adjusted_ty.kind() . && ty.is_sized(cx.tcx, cx.typing_env()) . { . // Rustc bug: auto deref doesn't work on block expression when targeting sized types. -- line 1212 ---------------------------------------- -- line 1290 ---------------------------------------- . let sugg = if needs_parens { . format!("({snip})") . } else { . snip.into_owned() . }; . diag.span_suggestion(data.first_expr.span, "try", sugg, app); . }, . ); 30 ( 0.00%) }, . State::Borrow { .. } | State::Reborrow { .. } => (), . } 10,760 ( 0.00%) } . } 553,615 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/methods/swap_with_temporary.rs -------------------------------------------------------------------------------- Ir -- line 7 ---------------------------------------- . use rustc_middle::ty::adjustment::{Adjust, DerefAdjustKind}; . use rustc_span::sym; . . use super::SWAP_WITH_TEMPORARY; . . const MSG_TEMPORARY: &str = "this expression returns a temporary value"; . const MSG_TEMPORARY_REFMUT: &str = "this is a mutable reference to a temporary value"; . 117,502 ( 0.00%) pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'_>, func: &Expr<'_>, args: &'tcx [Expr<'_>]) { 76,101 ( 0.00%) if let ExprKind::Path(QPath::Resolved(_, func_path)) = func.kind . && let Some(func_def_id) = func_path.res.opt_def_id() 97,328 ( 0.00%) && cx.tcx.is_diagnostic_item(sym::mem_swap, func_def_id) 586,628 ( 0.00%) => ???:::is_diagnostic_item (8,848x) . { . match (ArgKind::new(cx, &args[0]), ArgKind::new(cx, &args[1])) { . (ArgKind::RefMutToTemp(left_temp), ArgKind::RefMutToTemp(right_temp)) => { . emit_lint_useless(cx, expr, &args[0], &args[1], left_temp, right_temp); . }, . (ArgKind::RefMutToTemp(left_temp), right) => emit_lint_assign(cx, expr, &right, &args[0], left_temp), . (left, ArgKind::RefMutToTemp(right_temp)) => emit_lint_assign(cx, expr, &left, &args[1], right_temp), . _ => {}, . } . } 134,288 ( 0.00%) } . . enum ArgKind<'tcx> { . // Mutable reference to a place, coming from a macro, and number of dereferences to use . RefMutToPlaceAsMacro(&'tcx Expr<'tcx>, usize), . // Place behind a mutable reference, and number of dereferences to use . RefMutToPlace(&'tcx Expr<'tcx>, usize), . // Temporary value behind a mutable reference . RefMutToTemp(&'tcx Expr<'tcx>), -- line 37 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/returns/needless_return.rs -------------------------------------------------------------------------------- Ir -- line 22 ---------------------------------------- . Block, . Unit, . NeedsPar(Cow<'tcx, str>, Applicability), . Expr(Cow<'tcx, str>, Applicability), . } . . impl RetReplacement<'_> { . fn sugg_help(&self) -> &'static str { 5,274 ( 0.00%) match self { . Self::Empty | Self::Expr(..) => "remove `return`", . Self::Block => "replace `return` with an empty block", . Self::Unit => "replace `return` with a unit value", . Self::NeedsPar(..) => "remove `return` and wrap the sequence with parentheses", . } . } . . fn applicability(&self) -> Applicability { 1,758 ( 0.00%) match self { 1,758 ( 0.00%) Self::Expr(_, ap) | Self::NeedsPar(_, ap) => *ap, . _ => Applicability::MachineApplicable, . } . } . } . . impl Display for RetReplacement<'_> { 879 ( 0.00%) fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { 4,395 ( 0.00%) match self { . Self::Empty => f.write_str(""), . Self::Block => f.write_str("{}"), . Self::Unit => f.write_str("()"), . Self::NeedsPar(inner, _) => write!(f, "({inner})"), 4,395 ( 0.00%) Self::Expr(inner, _) => write!(f, "{inner}"), . } 1,758 ( 0.00%) } . } . . pub(super) fn check_fn<'tcx>(cx: &LateContext<'tcx>, kind: FnKind<'tcx>, body: &'tcx Body<'tcx>, sp: Span) { . if sp.from_expansion() { . return; . } . 7,326 ( 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) 534 ( 0.00%) let replacement = if let ExprKind::Ret(None) = &body.value.kind { . RetReplacement::Block . } else { . RetReplacement::Empty . }; 534 ( 0.00%) check_final_expr(cx, body.value, vec![], replacement, None); 92,650 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/returns/needless_return.rs:clippy_lints::returns::needless_return::check_final_expr (267x) . }, . FnKind::ItemFn(..) | FnKind::Method(..) => { 10,188 ( 0.00%) check_block_return(cx, &body.value.kind, sp, vec![]); 246,312,697 ( 2.05%) => site/frontend/rust-clippy/clippy_lints/src/returns/needless_return.rs:clippy_lints::returns::needless_return::check_block_return (3,396x) . }, . } . } . . // if `expr` is a block, check if there are needless returns in it 68,628 ( 0.00%) fn check_block_return<'tcx>(cx: &LateContext<'tcx>, expr_kind: &ExprKind<'tcx>, sp: Span, mut semi_spans: Vec) { 19,608 ( 0.00%) if let ExprKind::Block(block, _) = expr_kind { 20,396 ( 0.00%) if let Some(block_expr) = block.expr { 7,300 ( 0.00%) check_final_expr(cx, block_expr, semi_spans, RetReplacement::Empty, None); 2,874 ( 0.00%) } else if let Some(stmt) = block.stmts.last() { 7,125 ( 0.00%) if span_contains_cfg( 577,932 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/attrs.rs:clippy_utils::attrs::span_contains_cfg (1,079x) . cx, 4,275 ( 0.00%) Span::between( 216,092 ( 0.00%) => ???:::between (1,079x) 2,850 ( 0.00%) stmt.span, 2,850 ( 0.00%) cx.sess().source_map().end_point(block.span), // the closing brace of the block 472,268 ( 0.00%) => ???:::end_point (1,079x) . ), . ) { . return; . } 8,550 ( 0.00%) match stmt.kind { . StmtKind::Expr(expr) => { . check_final_expr(cx, expr, semi_spans, RetReplacement::Empty, None); . }, 1,424 ( 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 9,936 ( 0.00%) if let Some(semi_span) = stmt.span.trim_start(semi_expr.span) { 140,892 ( 0.00%) => ???:::trim_start (1,078x) . let semi_span_to_remove = 5,568 ( 0.00%) span_find_starting_semi(cx.sess().source_map(), semi_span.with_hi(sp.hi())); 753,145 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::span_find_starting_semi (1,063x) . semi_spans.push(semi_span_to_remove); . } 14,240 ( 0.00%) check_final_expr(cx, semi_expr, semi_spans, RetReplacement::Empty, None); . }, . _ => (), . } . } . } 74,264 ( 0.00%) } . 92,148 ( 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(); 900 ( 0.00%) match &peeled_drop_expr.kind { . // simple return is always "bad" . ExprKind::Ret(inner) => { . // check if expr return nothing 2,643 ( 0.00%) let ret_span = if inner.is_none() && replacement == RetReplacement::Empty { . extend_span_to_previous_non_ws(cx, peeled_drop_expr.span) . } else { 4,405 ( 0.00%) peeled_drop_expr.span . }; . 1,762 ( 0.00%) let replacement = if let Some(inner_expr) = inner { . // if desugar of `do yeet`, don't lint 1,768 ( 0.00%) if let ExprKind::Call(path_expr, [_]) = inner_expr.kind 12 ( 0.00%) && let ExprKind::Path(qpath) = path_expr.kind 14 ( 0.00%) && cx.tcx.qpath_is_lang_item(qpath, LangItem::TryTraitFromYeet) 224 ( 0.00%) => ???:::qpath_is_lang_item (2x) . { . return; . } . 881 ( 0.00%) let mut applicability = Applicability::MachineApplicable; 3,526 ( 0.00%) let (snippet, _) = snippet_with_context(cx, inner_expr.span, ret_span.ctxt(), "..", &mut applicability); 3,524 ( 0.00%) if binary_expr_needs_parentheses(inner_expr) { 6,162 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::binary_expr_needs_parentheses (878x) . RetReplacement::NeedsPar(snippet, applicability) . } else { . RetReplacement::Expr(snippet, applicability) . } . } else { . match match_ty_opt { . Some(match_ty) => { . match match_ty.kind() { -- line 153 ---------------------------------------- -- line 161 ---------------------------------------- . // want here . _ => return, . } . }, . None => replacement, . } . }; . 5,286 ( 0.00%) if inner.is_some_and(|inner| leaks_droppable_temporary_with_limited_lifetime(cx, inner)) { 127,548 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::leaks_droppable_temporary_with_limited_lifetime (878x) . return; . } . 1,758 ( 0.00%) if ret_span.from_expansion() || is_from_proc_macro(cx, expr) { . return; . } . . // Returns may be used to turn an expression into a statement in rustc's AST. . // This allows the addition of attributes, like `#[allow]` (See: clippy#9361) . // `#[expect(clippy::needless_return)]` needs to be handled separately to . // actually fulfill the expectation (clippy::#12998) 5,274 ( 0.00%) match cx.tcx.hir_attrs(expr.hir_id) { 51,837 ( 0.00%) => ???:::hir_attrs (878x) 3,516 ( 0.00%) [] => {}, . [attr] => { . if matches!(Level::from_opt_symbol(attr.name()), Some(Level::Expect)) . && let metas = attr.meta_item_list() . && let Some(lst) = metas . && let [MetaItemInner::MetaItem(meta_item), ..] = lst.as_slice() . && let [tool, lint_name] = meta_item.path.segments.as_slice() . && tool.ident.name == sym::clippy . && matches!( -- line 190 ---------------------------------------- -- line 195 ---------------------------------------- . // This is an expectation of the `needless_return` lint . } else { . return; . } . }, . _ => return, . } . 12,306 ( 0.00%) emit_return_lint( 240,283,378 ( 2.00%) => site/frontend/rust-clippy/clippy_lints/src/returns/needless_return.rs:clippy_lints::returns::needless_return::emit_return_lint (878x) . cx, 879 ( 0.00%) peeled_drop_expr.span, . ret_span, . semi_spans, . &replacement, . expr.hir_id, . ); 879 ( 0.00%) }, 43,069 ( 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:: (878x) . ExprKind::If(_, then, else_clause_opt) => { 1,986 ( 0.00%) check_block_return(cx, &then.kind, peeled_drop_expr.span, semi_spans.clone()); 278,743 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/returns/needless_return.rs:clippy_lints::returns::needless_return::check_block_return'2 (181x) 455 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/returns/needless_return.rs:clippy_lints::returns::needless_return::check_block_return (5x) 993 ( 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. 1,841 ( 0.00%) check_final_expr(cx, else_clause, semi_spans, RetReplacement::Empty, match_ty_opt); 59,714 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/returns/needless_return.rs:clippy_lints::returns::needless_return::check_final_expr'2 (150x) . } . }, . // 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) => { 780 ( 0.00%) let match_ty = cx.typeck_results().expr_ty(peeled_drop_expr); 13,240 ( 0.00%) => ???:::expr_ty (331x) 390 ( 0.00%) for arm in *arms { 14,536 ( 0.00%) check_final_expr(cx, arm.body, semi_spans.clone(), RetReplacement::Unit, Some(match_ty)); 914,984 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/returns/needless_return.rs:clippy_lints::returns::needless_return::check_final_expr'2 (1,872x) . } . }, . // if it's a whole block, check it 60,770 ( 0.00%) other_expr_kind => check_block_return(cx, other_expr_kind, peeled_drop_expr.span, semi_spans), 482,201 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/returns/needless_return.rs:clippy_lints::returns::needless_return::check_block_return'2 (2,005x) 69,426 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/returns/needless_return.rs:clippy_lints::returns::needless_return::check_block_return (259x) . } 63,197 ( 0.00%) } 38 ( 0.00%) => ???:__rustc::__rdl_dealloc (1x) . 10,548 ( 0.00%) fn emit_return_lint( . cx: &LateContext<'_>, . lint_span: Span, . ret_span: Span, . semi_spans: Vec, . replacement: &RetReplacement<'_>, . at: HirId, . ) { . span_lint_hir_and_then( . cx, 1,758 ( 0.00%) NEEDLESS_RETURN, . at, . lint_span, . "unneeded `return` statement", . |diag| { 879 ( 0.00%) let suggestions = std::iter::once((ret_span, replacement.to_string())) . .chain(semi_spans.into_iter().map(|span| (span, String::new()))) . .collect(); . . diag.multipart_suggestion(replacement.sugg_help(), suggestions, replacement.applicability()); . }, . ); 7,032 ( 0.00%) } . . // Go backwards while encountering whitespace and extend the given Span to that point. . fn extend_span_to_previous_non_ws(cx: &LateContext<'_>, sp: Span) -> Span { . if let Ok(prev_source) = cx.sess().source_map().span_to_prev_source(sp) { . let ws = *b" \t\n"; . if let Some(non_ws_pos) = prev_source.bytes().rposition(|c| !ws.contains(&c)) { . let len = prev_source.len() - non_ws_pos - 1; . return sp.with_lo(sp.lo() - BytePos::from_usize(len)); -- line 265 ---------------------------------------- 57,282 ( 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/cell.rs -------------------------------------------------------------------------------- Ir -- line 410 ---------------------------------------- . /// use std::cell::Cell; . /// . /// let c = Cell::new(5); . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_cell_new", since = "1.24.0")] . #[inline] . pub const fn new(value: T) -> Cell { 306 ( 0.00%) Cell { value: UnsafeCell::new(value) } . } . . /// Sets the contained value. . /// . /// # Examples . /// . /// ``` . /// use std::cell::Cell; -- line 426 ---------------------------------------- -- line 550 ---------------------------------------- . /// ``` . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_cell", since = "1.88.0")] . #[rustc_should_not_be_called_on_const_items] . pub const fn get(&self) -> T { . // SAFETY: This can cause data races if called from a separate thread, . // but `Cell` is `!Sync` so this won't happen. 822,170 ( 0.01%) unsafe { *self.value.get() } . } . . /// Updates the contained value using a function. . /// . /// # Examples . /// . /// ``` . /// use std::cell::Cell; -- line 566 ---------------------------------------- -- line 2050 ---------------------------------------- . } . . #[rustc_const_unstable(feature = "const_ref_cell", issue = "137844")] . const impl Drop for BorrowRefMut<'_> { . #[inline] . fn drop(&mut self) { . let borrow = self.borrow.get(); . debug_assert!(is_writing(borrow)); 49 ( 0.00%) self.borrow.replace(borrow + 1); . } . } . . impl<'b> BorrowRefMut<'b> { . #[inline] . const fn new(borrow: &'b Cell) -> Option> { . // NOTE: Unlike BorrowRefMut::clone, new is called to create the initial . // mutable reference, and so there must currently be no existing . // references. Thus, while clone increments the mutable refcount, here . // we explicitly only allow going from UNUSED to UNUSED - 1. 3,506 ( 0.00%) match borrow.get() { . UNUSED => { . borrow.replace(UNUSED - 1); . Some(BorrowRefMut { borrow }) . } . _ => None, . } . } . -- line 2077 ---------------------------------------- 100,806 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/operators/modulo_arithmetic.rs -------------------------------------------------------------------------------- Ir -- line 3 ---------------------------------------- . use clippy_utils::sext; . use rustc_hir::{BinOpKind, Expr, ExprKind, Node}; . use rustc_lint::LateContext; . use rustc_middle::ty::{self, Ty}; . use std::fmt::Display; . . use super::MODULO_ARITHMETIC; . 48,202 ( 0.00%) pub(super) fn check<'tcx>( . cx: &LateContext<'tcx>, . e: &'tcx Expr<'_>, . op: BinOpKind, . lhs: &'tcx Expr<'_>, . rhs: &'tcx Expr<'_>, . allow_comparison_to_zero: bool, . ) { 6,886 ( 0.00%) if op == BinOpKind::Rem { 43 ( 0.00%) if allow_comparison_to_zero && used_in_comparison_with_zero(cx, e) { . return; . } . 20 ( 0.00%) let lhs_operand = analyze_operand(lhs, cx, e); 928 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/operators/modulo_arithmetic.rs:clippy_lints::operators::modulo_arithmetic::analyze_operand (4x) 16 ( 0.00%) let rhs_operand = analyze_operand(rhs, cx, e); 1,268 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/operators/modulo_arithmetic.rs:clippy_lints::operators::modulo_arithmetic::analyze_operand (4x) 16 ( 0.00%) if let Some(lhs_operand) = lhs_operand . && let Some(rhs_operand) = rhs_operand . { . check_const_operands(cx, e, &lhs_operand, &rhs_operand); . } else { 4 ( 0.00%) check_non_const_operands(cx, e, lhs); . } 12 ( 0.00%) } 55,088 ( 0.00%) } . . fn used_in_comparison_with_zero(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { 88 ( 0.00%) if let Node::Expr(parent_expr) = cx.tcx.parent_hir_node(expr.hir_id) 1,286 ( 0.00%) => ???:::parent_hir_node (11x) 66 ( 0.00%) && let ExprKind::Binary(op, lhs, rhs) = parent_expr.kind 29 ( 0.00%) && let BinOpKind::Eq | BinOpKind::Ne = op.node . { 16 ( 0.00%) let ecx = ConstEvalCtxt::new(cx); 448 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::new (8x) 8 ( 0.00%) let ctxt = expr.span.ctxt(); 48 ( 0.00%) matches!(ecx.eval_local(lhs, ctxt), Some(Constant::Int(0))) 1,994 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval_local (8x) 68 ( 0.00%) || matches!(ecx.eval_local(rhs, ctxt), Some(Constant::Int(0))) 1,345 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval_local (8x) . } else { . false . } . } . . struct OperandInfo { . string_representation: Option, . is_negative: bool, . is_integral: bool, . } . 96 ( 0.00%) fn analyze_operand(operand: &Expr<'_>, cx: &LateContext<'_>, expr: &Expr<'_>) -> Option { 80 ( 0.00%) match ConstEvalCtxt::new(cx).eval(operand)? { 1,132 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval (8x) 448 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::new (8x) 36 ( 0.00%) Constant::Int(v) => match *cx.typeck_results().expr_ty(expr).kind() { 160 ( 0.00%) => ???:::expr_ty (4x) . ty::Int(ity) => { . let value: i128 = sext(cx.tcx, v, ity); . Some(OperandInfo { . string_representation: Some(value.to_string()), . is_negative: value < 0, . is_integral: true, . }) . }, 12 ( 0.00%) ty::Uint(_) => Some(OperandInfo { . string_representation: None, . is_negative: false, . is_integral: true, . }), . _ => None, . }, . // FIXME(f16_f128): add when casting is available on all platforms . Constant::F32(f) => Some(floating_point_operand_info(&f)), . Constant::F64(f) => Some(floating_point_operand_info(&f)), . _ => None, 4 ( 0.00%) } 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) 64 ( 0.00%) } . . fn floating_point_operand_info>(f: &T) -> OperandInfo { . OperandInfo { . string_representation: Some(format!("{:.3}", *f)), . is_negative: *f < 0.0.into(), . is_integral: false, . } . } . . fn might_have_negative_value(t: Ty<'_>) -> bool { 20 ( 0.00%) t.is_signed() || t.is_floating_point() . } . . fn check_const_operands<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'_>, . lhs_operand: &OperandInfo, . rhs_operand: &OperandInfo, . ) { -- line 98 ---------------------------------------- -- line 112 ---------------------------------------- . diag.note("or consider using `rem_euclid` or similar function"); . } . }, . ); . } . } . . fn check_non_const_operands<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, operand: &Expr<'_>) { 12 ( 0.00%) let operand_type = cx.typeck_results().expr_ty(operand); 160 ( 0.00%) => ???:::expr_ty (4x) . if might_have_negative_value(operand_type) { . span_lint_and_then( . cx, . MODULO_ARITHMETIC, . expr.span, . "you are using modulo operator on types that might have different signs", . |diag| { . diag.note("double check for expected result especially when interoperating with different languages"); -- line 128 ---------------------------------------- 146 ( 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 { 1,453,368 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'tcx>) { 540,679 ( 0.00%) if let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, addrof_target) = e.kind 22,439 ( 0.00%) && let ExprKind::Unary(UnOp::Deref, deref_target) = addrof_target.kind 940 ( 0.00%) && !matches!(deref_target.kind, ExprKind::Unary(UnOp::Deref, ..)) 928 ( 0.00%) && !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 { . // `*&*foo` should lint `deref_addrof` instead. . ExprKind::Unary(UnOp::Deref, _) => is_lint_allowed(cx, DEREF_ADDROF, parent.hir_id), -- line 66 ---------------------------------------- -- line 119 ---------------------------------------- . e.span, . "if you would like to deref, try using `&**`", . format!("&**{deref_text}"), . Applicability::MaybeIncorrect, . ); . }, . ); . } 1,695,596 ( 0.01%) } . } . . /// 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)) . } 11,893 ( 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 . } . }}; 1,558,836 ( 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 . 18,760 ( 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 30 ( 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. 16 ( 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; . . // SAFETY: the caller guarantees that `offset` doesn't exceed `self.len()`, . // so this new pointer is inside `self` and thus guaranteed to be non-null. . unsafe { . if_zst!(mut self, . // Using the intrinsic directly avoids emitting a UbCheck . len => *len = crate::intrinsics::unchecked_sub(*len, offset), 284 ( 0.00%) _end => self.ptr = self.ptr.add(offset), . ); . } . old . } . . // Helper function for moving the end of the iterator backwards by `offset` elements, . // returning the new end. . // Unsafe because the offset must not exceed `self.len()`. -- line 117 ---------------------------------------- -- 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. . 3,669 ( 0.00%) let ptr = self.ptr; 911 ( 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.) 16,314,834 ( 0.14%) 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. 78,484 ( 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()) . } 1,804 ( 0.00%) } . . fn next_chunk(&mut self) -> Result<[$elem; N], crate::array::IntoIter<$elem, N>> { . if T::IS_ZST || len!(self) < N { . return crate::array::iter_next_chunk(self); . } . . // SAFETY: the check above ensures len >= N . unsafe { -- line 200 ---------------------------------------- -- line 217 ---------------------------------------- . . #[inline] . fn count(self) -> usize { . len!(self) . } . . #[inline] . fn nth(&mut self, n: usize) -> Option<$elem> { 1,480 ( 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 48,681 ( 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) }; 321,951 ( 0.00%) if i == len { . break; . } . } 5,664 ( 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 . Self: Sized, . F: FnMut(Self::Item), . { . while let Some(x) = self.next() { 815 ( 0.00%) f(x); 343,926 ( 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::{closure#2} (235x) . } . } . . // We override the default implementation, which uses `try_fold`, . // because this simple implementation generates less LLVM IR and is . // faster to compile. . #[inline] 234 ( 0.00%) fn all(&mut self, mut f: F) -> bool . where . Self: Sized, . F: FnMut(Self::Item) -> bool, . { . while let Some(x) = self.next() { 133,015 ( 0.00%) if !f(x) { . return false; . } . } . true 96 ( 0.00%) } . . // We override the default implementation, which uses `try_fold`, . // because this simple implementation generates less LLVM IR and is . // faster to compile. . #[inline] 72 ( 0.00%) fn any(&mut self, mut f: F) -> bool . where . Self: Sized, . F: FnMut(Self::Item) -> bool, . { . while let Some(x) = self.next() { 1,532,426 ( 0.01%) if f(x) { . return true; . } . } . false 72 ( 0.00%) } . . // We override the default implementation, which uses `try_fold`, . // because this simple implementation generates less LLVM IR and is . // faster to compile. . #[inline] 55 ( 0.00%) fn find

(&mut self, mut predicate: P) -> Option . where . Self: Sized, . P: FnMut(&Self::Item) -> bool, . { . while let Some(x) = self.next() { 532,310 ( 0.00%) if predicate(&x) { . return Some(x); . } . } . None 45 ( 0.00%) } . . // We override the default implementation, which uses `try_fold`, . // because this simple implementation generates less LLVM IR and is . // 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() { 160,585 ( 0.00%) if let Some(y) = f(x) { 36,804 ( 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::lifetimes::report_elidable_lifetimes::{closure#0} as core::ops::function::FnMut<(&rustc_span::def_id::LocalDefId,)>>::call_mut (39x) . return Some(y); . } . } . None 18 ( 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() { 25,210 ( 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); . } 10,553 ( 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; 4,227 ( 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 ---------------------------------------- 18,387,475 ( 0.15%) -------------------------------------------------------------------------------- -- 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 { 790,503 ( 0.01%) 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 { 802,514 ( 0.01%) 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. 343,412 ( 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])* 3,564 ( 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 ---------------------------------------- 370,866 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/let_with_type_underscore.rs -------------------------------------------------------------------------------- Ir -- line 23 ---------------------------------------- . pub LET_WITH_TYPE_UNDERSCORE, . complexity, . "unneeded underscore type (`_`) in a variable declaration" . } . . declare_lint_pass!(UnderscoreTyped => [LET_WITH_TYPE_UNDERSCORE]); . . impl EarlyLintPass for UnderscoreTyped { 123,683 ( 0.00%) fn check_local(&mut self, cx: &EarlyContext<'_>, local: &Local) { 53,007 ( 0.00%) if let Some(ty) = &local.ty // Ensure that it has a type defined 998 ( 0.00%) && let TyKind::Infer = ty.kind // that type is '_' . && local.span.eq_ctxt(ty.span) . && let sm = cx.sess().source_map() . && !local.span.in_external_macro(sm) . && !is_from_proc_macro(cx, &**ty) . { . let span_to_remove = sm . .span_extend_to_prev_char_before(ty.span, ':', true) . .with_leading_whitespace(cx) -- line 41 ---------------------------------------- -- line 51 ---------------------------------------- . span_to_remove, . "remove the explicit type `_` declaration", . "", . Applicability::MachineApplicable, . ); . }, . ); . } 141,352 ( 0.00%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/mem_replace.rs -------------------------------------------------------------------------------- Ir -- line 127 ---------------------------------------- . impl_lint_pass!(MemReplace => [ . MEM_REPLACE_OPTION_WITH_NONE, . MEM_REPLACE_OPTION_WITH_SOME, . MEM_REPLACE_WITH_DEFAULT, . MEM_REPLACE_WITH_UNINIT, . ]); . . fn check_replace_option_with_none(cx: &LateContext<'_>, src: &Expr<'_>, dest: &Expr<'_>, expr_span: Span) -> bool { 25 ( 0.00%) if is_none_expr(cx, src) { 113 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/res.rs:clippy_utils::is_none_expr (5x) . // Since this is a late pass (already type-checked), . // and we already know that the second argument is an . // `Option`, we do not need to check the first . // argument's type. All that's left is to get . // the replacee's expr after peeling off the `&mut` . let sugg_expr = peel_ref_operators(cx, dest); . let mut applicability = Applicability::MachineApplicable; . span_lint_and_sugg( -- line 143 ---------------------------------------- -- line 160 ---------------------------------------- . . fn check_replace_option_with_some( . cx: &LateContext<'_>, . src: &Expr<'_>, . dest: &Expr<'_>, . expr_span: Span, . msrv: Msrv, . ) -> bool { 25 ( 0.00%) if let Some(src_arg) = as_some_expr(cx, src) 22 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::as_some_expr (5x) . && msrv.meets(cx, msrvs::OPTION_REPLACE) . { . // We do not have to check for a `const` context here, because `core::mem::replace()` and . // `Option::replace()` have been const-stabilized simultaneously in version 1.83.0. . let sugg_expr = peel_ref_operators(cx, dest); . let mut applicability = Applicability::MachineApplicable; . span_lint_and_sugg( . cx, -- line 176 ---------------------------------------- -- line 186 ---------------------------------------- . applicability, . ); . true . } else { . false . } . } . 28 ( 0.00%) fn check_replace_with_uninit(cx: &LateContext<'_>, src: &Expr<'_>, dest: &Expr<'_>, expr_span: Span) { 32 ( 0.00%) if let Some(method_def_id) = cx.typeck_results().type_dependent_def_id(src.hir_id) 177 ( 0.00%) => ???:::type_dependent_def_id (4x) . // check if replacement is mem::MaybeUninit::uninit().assume_init() 7 ( 0.00%) && cx.tcx.is_diagnostic_item(sym::assume_init, method_def_id) 119 ( 0.00%) => ???:::is_diagnostic_item (1x) . { . let Some(top_crate) = std_or_core(cx) else { return }; . let mut applicability = Applicability::MachineApplicable; . span_lint_and_sugg( . cx, . MEM_REPLACE_WITH_UNINIT, . expr_span, . "replacing with `mem::MaybeUninit::uninit().assume_init()`", -- line 205 ---------------------------------------- -- line 208 ---------------------------------------- . "{top_crate}::ptr::read({})", . snippet_with_applicability(cx, dest.span, "", &mut applicability) . ), . applicability, . ); . return; . } . 8 ( 0.00%) if let ExprKind::Call(repl_func, []) = src.kind . && let ExprKind::Path(ref repl_func_qpath) = repl_func.kind . && let Some(repl_def_id) = cx.qpath_res(repl_func_qpath, repl_func.hir_id).opt_def_id() . { . let repl_name = cx.tcx.get_diagnostic_name(repl_def_id); . if repl_name == Some(sym::mem_uninitialized) { . let Some(top_crate) = std_or_core(cx) else { return }; . let mut applicability = Applicability::MachineApplicable; . span_lint_and_sugg( -- line 224 ---------------------------------------- -- line 239 ---------------------------------------- . MEM_REPLACE_WITH_UNINIT, . expr_span, . "replacing with `mem::zeroed()`", . None, . "consider using a default value or the `take_mut` crate instead", . ); . } . } 32 ( 0.00%) } . 65 ( 0.00%) fn check_replace_with_default( . cx: &LateContext<'_>, . src: &Expr<'_>, . dest: &Expr<'_>, . expr: &Expr<'_>, . msrv: Msrv, . ) -> bool { 30 ( 0.00%) if is_expr_used_or_unified(cx.tcx, expr) 1,080 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_expr_used_or_unified (5x) . // disable lint for primitives 10 ( 0.00%) && let expr_type = cx.typeck_results().expr_ty_adjusted(src) 341 ( 0.00%) => ???:::expr_ty_adjusted (5x) . && !is_non_aggregate_primitive_type(expr_type) 25 ( 0.00%) && is_default_equivalent(cx, src) 538 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_default_equivalent (5x) 4 ( 0.00%) && !expr.span.in_external_macro(cx.tcx.sess.source_map()) 6 ( 0.00%) && let Some(top_crate) = std_or_core(cx) 195 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::std_or_core (1x) 6 ( 0.00%) && msrv.meets(cx, msrvs::MEM_TAKE) 27 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (1x) . { 10 ( 0.00%) span_lint_and_then( 344,411 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then:: (1x) . cx, . MEM_REPLACE_WITH_DEFAULT, . expr.span, . "replacing a value of type `T` with `T::default()`", 5 ( 0.00%) |diag| { 1 ( 0.00%) let mut applicability = Applicability::MachineApplicable; 7 ( 0.00%) let (dest_snip, _) = snippet_with_context(cx, dest.span, expr.span.ctxt(), "", &mut applicability); 7 ( 0.00%) let suggestion = format!("{top_crate}::mem::take({dest_snip})"); . . diag.span_suggestion( 1 ( 0.00%) expr.span, 2 ( 0.00%) format!("consider using `{top_crate}::mem::take` instead"), 3 ( 0.00%) suggestion, . applicability, . ); . }, . ); . true . } else { . false . } 40 ( 0.00%) } . . pub struct MemReplace { . msrv: Msrv, . } . . impl MemReplace { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl<'tcx> LateLintPass<'tcx> for MemReplace { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 548,860 ( 0.00%) if let ExprKind::Call(func, [dest, src]) = expr.kind . // Check that `expr` is a call to `mem::replace()` 26,904 ( 0.00%) && let ExprKind::Path(ref func_qpath) = func.kind 35,872 ( 0.00%) && let Some(def_id) = cx.qpath_res(func_qpath, func.hir_id).opt_def_id() 532,519 ( 0.00%) => ???:::qpath_res (8,968x) 53,676 ( 0.00%) && cx.tcx.is_diagnostic_item(sym::mem_replace, def_id) 573,464 ( 0.00%) => ???:::is_diagnostic_item (8,946x) . // Check that second argument is `Option::None` 5 ( 0.00%) && !check_replace_option_with_none(cx, src, dest, expr.span) 5 ( 0.00%) && !check_replace_option_with_some(cx, src, dest, expr.span, self.msrv) 40 ( 0.00%) && !check_replace_with_default(cx, src, dest, expr, self.msrv) 346,940 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/mem_replace.rs:clippy_lints::mem_replace::check_replace_with_default (5x) . { 24 ( 0.00%) check_replace_with_uninit(cx, src, dest, expr.span); 432 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/mem_replace.rs:clippy_lints::mem_replace::check_replace_with_uninit (4x) . } 1,937,824 ( 0.02%) } . } 35,894 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/nonstandard_macro_braces.rs -------------------------------------------------------------------------------- Ir -- line 39 ---------------------------------------- . . pub struct MacroBraces { . macro_braces: (FxHashMap, usize), . /// Spans for statement macro calls, they have special behaviour with semicolons . mac_stmt_spans: Vec, . } . . impl MacroBraces { 840 ( 0.00%) pub fn new(conf: &'static Conf) -> Self { 420 ( 0.00%) Self { . macro_braces: macro_braces(&conf.standard_macro_braces), . mac_stmt_spans: Vec::new(), . } 945 ( 0.00%) } . } . . impl EarlyLintPass for MacroBraces { 18,333 ( 0.00%) fn check_mac(&mut self, cx: &EarlyContext<'_>, mac: &ast::MacCall) { . if let Some(last_segment) = mac.path.segments.last() 2,619 ( 0.00%) && let name = last_segment.ident.as_str() 83,808 ( 0.00%) => ???:::as_str (2,619x) 1,869 ( 0.00%) && let Some(&braces) = self.macro_braces.0.get(name) 7,476 ( 0.00%) && let Some(snip) = snippet_opt(cx.sess(), mac.span().with_lo(last_segment.span().lo())) 95,319 ( 0.00%) => ???:::span (623x) 3,115 ( 0.00%) => ???:::span (623x) 1,246 ( 0.00%) && let Some(macro_args_str) = &snip.strip_prefix(name).and_then(|snip| snip.strip_prefix('!')) 1,530 ( 0.00%) && let Some(old_open_brace @ ('{' | '(' | '[')) = macro_args_str.trim_start().chars().next() 1,246 ( 0.00%) && old_open_brace != braces.0 . { . // Semicolons added for statements that previously ended in braces, see issue #9913 . let add_semi = self.mac_stmt_spans.iter().any(|s| *s == mac.span()); . emit_help( . cx, . &snippet_opt(cx.sess(), mac.span()).unwrap(), . braces, . mac.span(), . add_semi, . ); . } 20,952 ( 0.00%) } . . // See issue #9913 . fn check_stmt(&mut self, _: &EarlyContext<'_>, stmt: &ast::Stmt) { 105,700 ( 0.00%) if let ast::StmtKind::MacCall(mac_callstmt) = &stmt.kind 3,304 ( 0.00%) && let ast::MacCallStmt { . style: ast::MacStmtStyle::Braces, . .. 1,652 ( 0.00%) } = **mac_callstmt . { . self.mac_stmt_spans.push(mac_callstmt.mac.span()); . } 12,471 ( 0.00%) } . . fn check_mac_def(&mut self, cx: &EarlyContext<'_>, mac: &ast::MacroDef) { 50,239 ( 0.00%) fn check_ts(cx: &EarlyContext<'_>, ts: &TokenStream, macro_braces: &FxHashMap) { . for (i, current_token) in ts.iter().enumerate() { 97,493 ( 0.00%) if let TokenTree::Delimited(_, _, _, token_stream) = current_token { . // Peel extra braces and parenthesis in macros! 21,453 ( 0.00%) check_ts(cx, token_stream, macro_braces); 963,478 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/nonstandard_macro_braces.rs:::check_mac_def::check_ts'2 (56x) . } else . // |-TokenKind::Bang . // v . // println! { "Hi" } . // ^^^^^^^ . // | ^^^^^^^^ Brackets always come 1 token after TokenKind::Bang . // ident_token 76,040 ( 0.00%) if let TokenTree::Token( . Token { . kind: TokenKind::Ident(ident_token, _), . span: ident_span, . }, . _, . ) = current_token . && let Some(bang_token) = ts.get(i + 1) 18,794 ( 0.00%) && let Some(macro_args_token) = ts.get(i + 2) 60,016 ( 0.00%) && let TokenTree::Token( . Token { . kind: TokenKind::Bang, .. . }, . _, . ) = *bang_token 252 ( 0.00%) && let TokenTree::Delimited(delim_span, _, delim, _) = macro_args_token . // Span from ident_token to brackets (so, the full macro call) 605 ( 0.00%) && let snip_span = ident_span.with_hi(delim_span.close.hi()) 363 ( 0.00%) && let Some(snip) = snippet_opt(cx, snip_span) . && let Some(&braces) = macro_braces.get(ident_token.as_str()) . && let Some(old_open_brace) = match delim { . Delimiter::Brace => Some('{'), . Delimiter::Parenthesis => Some('('), . Delimiter::Bracket => Some('['), . Delimiter::Invisible(_) => None, . } . && old_open_brace != braces.0 . { . emit_help(cx, &snip, braces, snip_span, false); . } . } 57,416 ( 0.00%) } . 52 ( 0.00%) if mac.macro_rules { 130 ( 0.00%) check_ts(cx, &mac.body.tokens, &self.macro_braces.0); 286,430 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/nonstandard_macro_braces.rs:::check_mac_def::check_ts (13x) . } . } . } . . fn emit_help(cx: &EarlyContext<'_>, snip: &str, (open, close): (char, char), span: Span, add_semi: bool) { . let semi = if add_semi { ";" } else { "" }; . if let Some((macro_name, macro_args_str)) = snip.split_once('!') { . let mut macro_args = macro_args_str.trim().to_string(); -- line 144 ---------------------------------------- -- line 154 ---------------------------------------- . format!("{macro_name}!{open}{macro_args}{close}{semi}"), . Applicability::MachineApplicable, . ); . } . } . . fn macro_braces(conf: &[MacroMatcher]) -> (FxHashMap, usize) { . // TODO: Use `Symbol`s here, instead of strings. 210 ( 0.00%) let mut braces = FxHashMap::from_iter( 195,630 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/collections/hash/map.rs: as core::iter::traits::collect::FromIterator<(alloc::string::String, (char, char))>>::from_iter::<[(alloc::string::String, (char, char)); 13]> (105x) 5,985 ( 0.00%) [ . ("assert_matches", ('(', ')')), . ("cfg_select", ('{', '}')), . ("debug_assert_matches", ('(', ')')), . ("format", ('(', ')')), . ("format_args", ('(', ')')), . ("eprint", ('(', ')')), . ("eprintln", ('(', ')')), . ("print", ('(', ')')), -- line 171 ---------------------------------------- -- line 188 ---------------------------------------- . )] . #[expect(clippy::redundant_closure_for_method_calls, reason = "Clarity")] . let max_len = braces . .keys() . .map(|macro_name| macro_name.len()) . .max() . .expect("`braces` is non-empty"); . 420 ( 0.00%) (braces, max_len) . } 15,079 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/let_underscore.rs -------------------------------------------------------------------------------- Ir -- line 130 ---------------------------------------- . declare_lint_pass!(LetUnderscore => [ . LET_UNDERSCORE_FUTURE, . LET_UNDERSCORE_LOCK, . LET_UNDERSCORE_MUST_USE, . LET_UNDERSCORE_UNTYPED, . ]); . . impl<'tcx> LateLintPass<'tcx> for LetUnderscore { 140,427 ( 0.00%) fn check_local(&mut self, cx: &LateContext<'tcx>, local: &LetStmt<'tcx>) { 40,122 ( 0.00%) if matches!(local.source, LocalSource::Normal) 60,183 ( 0.00%) && let PatKind::Wild = local.pat.kind 1,233 ( 0.00%) && let Some(init) = local.init 42 ( 0.00%) && !local.span.in_external_macro(cx.tcx.sess.source_map()) . { 6 ( 0.00%) let init_ty = cx.typeck_results().expr_ty(init); 240 ( 0.00%) => ???:::expr_ty (6x) 12 ( 0.00%) let contains_sync_guard = init_ty.walk().any(|inner| match inner.kind() { 42 ( 0.00%) => ???:::walk (6x) . GenericArgKind::Type(inner_ty) => inner_ty . .ty_adt_def() . .is_some_and(|adt| paths::PARKING_LOT_GUARDS.iter().any(|path| path.matches(cx, adt.did()))), . GenericArgKind::Lifetime(_) | GenericArgKind::Const(_) => false, . }); 6 ( 0.00%) if contains_sync_guard { . #[expect(clippy::collapsible_span_lint_calls, reason = "rust-clippy#7797")] . span_lint_and_then( . cx, . LET_UNDERSCORE_LOCK, . local.span, . "non-binding `let` on a synchronization lock", . |diag| { . diag.help( . "consider using an underscore-prefixed named \ . binding or dropping explicitly with `std::mem::drop`", . ); . }, . ); 6 ( 0.00%) } else if local.ty.is_none() 18 ( 0.00%) && let Some(future_trait_def_id) = cx.tcx.lang_items().future_trait() 240 ( 0.00%) => ???:::lang_items (6x) 66 ( 0.00%) && implements_trait(cx, cx.typeck_results().expr_ty(init), future_trait_def_id, &[]) 19,460 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::implements_trait (6x) 240 ( 0.00%) => ???:::expr_ty (6x) . { . #[expect(clippy::collapsible_span_lint_calls, reason = "rust-clippy#7797")] . span_lint_and_then( . cx, . LET_UNDERSCORE_FUTURE, . local.span, . "non-binding `let` on a future", . |diag| { . diag.help("consider awaiting the future or dropping explicitly with `std::mem::drop`"); . }, . ); 78 ( 0.00%) } else if let Some(must_use_path) = opt_must_use_path(cx, cx.typeck_results().expr_ty(init)) { 5,826 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::opt_must_use_path (6x) 240 ( 0.00%) => ???:::expr_ty (6x) 54 ( 0.00%) span_lint_and_then( 7,257 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then::::check_local::{closure#3}> (6x) . cx, . LET_UNDERSCORE_MUST_USE, . local.span, . "non-binding `let` on an expression with `#[must_use]` type", 30 ( 0.00%) |diag| { . diag.help("consider explicitly using expression value"); . let ty_span = local.ty.map_or(init.span, |ty| ty.span); . diag.span_note( . ty_span, . format!("type is {}", describe_must_use_type(cx, &must_use_path)), . ); . }, . ); 6 ( 0.00%) } else if is_must_use_func_call(cx, init) { 90 ( 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:: (6x) . #[expect(clippy::collapsible_span_lint_calls, reason = "rust-clippy#7797")] . span_lint_and_then( . cx, . LET_UNDERSCORE_MUST_USE, . local.span, . "non-binding `let` on a result of a `#[must_use]` function", . |diag| { . diag.help("consider explicitly using function result"); . }, . ); . } . 24 ( 0.00%) if local.pat.default_binding_modes && local.ty.is_none() { . // When `default_binding_modes` is true, the `let` keyword is present. . . // Ignore unnameable types . if let Some(init) = local.init 18 ( 0.00%) && !cx.typeck_results().expr_ty(init).is_suggestable(cx.tcx, true) 240 ( 0.00%) => ???:::expr_ty (6x) . { . return; . } . . // Ignore if it is from a procedural macro... 24 ( 0.00%) if is_from_proc_macro(cx, init) { 5,139 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::is_from_proc_macro:: (6x) . return; . } . 60 ( 0.00%) span_lint_and_then( 7,212 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then::::check_local::{closure#5}> (6x) . cx, . LET_UNDERSCORE_UNTYPED, . local.span, . "non-binding `let` without a type annotation", . |diag| { . diag.span_help( . Span::new( . local.pat.span.hi(), -- line 230 ---------------------------------------- -- line 233 ---------------------------------------- . local.pat.span.parent(), . ), . "consider adding a type annotation", . ); . }, . ); . } . } 160,488 ( 0.00%) } . } 20,145 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/doc/doc_suspicious_footnotes.rs -------------------------------------------------------------------------------- Ir -- line 5 ---------------------------------------- . use rustc_hir::attrs::AttributeKind; . use rustc_hir::{AttrStyle, Attribute}; . use rustc_lint::{LateContext, LintContext as _}; . . use std::ops::Range; . . use super::{DOC_SUSPICIOUS_FOOTNOTES, Fragments}; . 76,643 ( 0.00%) pub fn check(cx: &LateContext<'_>, doc: &str, range: Range, fragments: &Fragments<'_>, attrs: &[Attribute]) { . for i in doc[range.clone()] . .bytes() . .enumerate() 391,751 ( 0.00%) .filter_map(|(i, c)| if c == b'[' { Some(i) } else { None }) . { . let start = i + range.start; . if doc.as_bytes().get(start + 1) == Some(&b'^') . && let Some(end) = all_numbers_upto_brace(doc, start + 2) . && doc.as_bytes().get(end) != Some(&b':') . && doc.as_bytes().get(start - 1) != Some(&b'\\') . && let Some(this_fragment) = { . // the `doc` string contains all fragments concatenated together -- line 25 ---------------------------------------- -- line 107 ---------------------------------------- . Applicability::HasPlaceholders, . ); . } . } . }, . ); . } . } 87,592 ( 0.00%) } . . fn all_numbers_upto_brace(text: &str, i: usize) -> Option { . for (j, c) in text.as_bytes()[i..].iter().copied().enumerate().take(64) { . if c == b']' && j != 0 { . return Some(i + j + 1); . } . if !c.is_ascii_digit() || j >= 64 { . break; -- line 123 ---------------------------------------- 87,592 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_pop_if.rs -------------------------------------------------------------------------------- Ir -- line 63 ---------------------------------------- . msrv: Msrv, . binary_heap_pop_if_feature_enabled: bool, . } . . impl ManualPopIf { . pub fn new(tcx: TyCtxt<'_>, conf: &'static Conf) -> Self { . Self { . msrv: conf.msrv.into(), 6 ( 0.00%) binary_heap_pop_if_feature_enabled: tcx.features().enabled(sym::binary_heap_pop_if), 40 ( 0.00%) => ???:::features (1x) 4 ( 0.00%) => ???:::enabled (1x) . } . } . . fn msrv_compatible(&self, cx: &LateContext<'_>, kind: ManualPopIfKind) -> bool { 23,420 ( 0.00%) match kind { . ManualPopIfKind::Vec => self.msrv.meets(cx, msrvs::VEC_POP_IF), . ManualPopIfKind::VecDequeBack => self.msrv.meets(cx, msrvs::VEC_DEQUE_POP_BACK_IF), . ManualPopIfKind::VecDequeFront => self.msrv.meets(cx, msrvs::VEC_DEQUE_POP_FRONT_IF), . ManualPopIfKind::BinaryHeap => self.binary_heap_pop_if_feature_enabled, . } . } . } . -- line 84 ---------------------------------------- -- line 112 ---------------------------------------- . fn pop_if_method(self) -> Symbol { . match self { . ManualPopIfKind::Vec | ManualPopIfKind::BinaryHeap => sym::pop_if, . ManualPopIfKind::VecDequeBack => sym::pop_back_if, . ManualPopIfKind::VecDequeFront => sym::pop_front_if, . } . } . 3 ( 0.00%) fn is_diag_item(self, cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { 3 ( 0.00%) let ty = cx.typeck_results().expr_ty(expr).peel_refs(); 40 ( 0.00%) => ???:::expr_ty (1x) 6 ( 0.00%) match self { . ManualPopIfKind::Vec => ty.is_diag_item(cx, sym::Vec), . ManualPopIfKind::VecDequeBack | ManualPopIfKind::VecDequeFront => ty.is_diag_item(cx, sym::VecDeque), . ManualPopIfKind::BinaryHeap => ty.is_diag_item(cx, sym::BinaryHeap), . } . } . } . . impl fmt::Display for ManualPopIfKind { -- line 130 ---------------------------------------- -- line 199 ---------------------------------------- . cond: &'tcx Expr<'_>, . then_block: &'tcx Expr<'_>, . if_expr_span: Span, . kind: ManualPopIfKind, . ) -> Option> { . let peek_method = kind.peek_method(); . let pop_method = kind.pop_method(); . 47,608 ( 0.00%) if let ExprKind::MethodCall(path, receiver, [closure_arg], _) = cond.kind 64 ( 0.00%) && path.ident.name == sym::is_some_and . && let ExprKind::MethodCall(check_path, collection_expr, [], _) = receiver.kind . && check_path.ident.name == peek_method . && kind.is_diag_item(cx, collection_expr) . && let ExprKind::Closure(closure) = closure_arg.kind . && let body = cx.tcx.hir_body(closure.body) . && let Some((pop_collection, pop_span, suggestable)) = check_pop_unwrap(cx, then_block, pop_method) . && eq_expr_value(cx, if_expr_span.ctxt(), collection_expr, pop_collection) . && let Some(param) = body.params.first() -- line 216 ---------------------------------------- -- line 243 ---------------------------------------- . cond: &'tcx Expr<'_>, . then_block: &'tcx Expr<'_>, . if_expr_span: Span, . kind: ManualPopIfKind, . ) -> Option> { . let peek_method = kind.peek_method(); . let pop_method = kind.pop_method(); . 54,432 ( 0.00%) if let ExprKind::Let(let_expr) = cond.kind 51,784 ( 0.00%) && let PatKind::TupleStruct(qpath, [binding_pat], _) = let_expr.pat.kind . { 21,744 ( 0.00%) let res = cx.qpath_res(&qpath, let_expr.pat.hir_id); 83,352 ( 0.00%) => ???:::qpath_res (3,624x) . . if let Some(def_id) = res.opt_def_id() 14,496 ( 0.00%) && is_lang_item_or_ctor(cx, def_id, LangItem::OptionSome) 1,099,934 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_lang_item_or_ctor (3,624x) 7,152 ( 0.00%) && let PatKind::Binding(_, binding_id, binding_name, _) = binding_pat.kind 11,260 ( 0.00%) && let ExprKind::MethodCall(path, collection_expr, [], _) = let_expr.init.kind 128 ( 0.00%) && path.ident.name == peek_method 3 ( 0.00%) && kind.is_diag_item(cx, collection_expr) 124 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_pop_if.rs:::is_diag_item (1x) . && let ExprKind::Block(block, _) = then_block.kind . { . // The inner if can be either a statement or a block expression . let inner_if = match (block.stmts, block.expr) { . ([stmt], _) => match stmt.kind { . StmtKind::Expr(expr) | StmtKind::Semi(expr) => expr, . _ => return None, . }, -- line 269 ---------------------------------------- -- line 307 ---------------------------------------- . cond: &'tcx Expr<'_>, . then_block: &'tcx Expr<'_>, . if_expr_span: Span, . kind: ManualPopIfKind, . ) -> Option> { . let peek_method = kind.peek_method(); . let pop_method = kind.pop_method(); . 48,496 ( 0.00%) if let ExprKind::Binary(op, left, right) = cond.kind 10,088 ( 0.00%) && op.node == rustc_ast::BinOpKind::And 3,312 ( 0.00%) && let ExprKind::Let(let_expr) = left.kind . && let PatKind::TupleStruct(qpath, [binding_pat], _) = let_expr.pat.kind . { . let res = cx.qpath_res(&qpath, let_expr.pat.hir_id); . . if let Some(def_id) = res.opt_def_id() . && is_lang_item_or_ctor(cx, def_id, LangItem::OptionSome) . && let PatKind::Binding(_, binding_id, binding_name, _) = binding_pat.kind . && let ExprKind::MethodCall(path, collection_expr, [], _) = let_expr.init.kind -- line 325 ---------------------------------------- -- line 355 ---------------------------------------- . cond: &'tcx Expr<'_>, . then_block: &'tcx Expr<'_>, . if_expr_span: Span, . kind: ManualPopIfKind, . ) -> Option> { . let peek_method = kind.peek_method(); . let pop_method = kind.pop_method(); . 47,608 ( 0.00%) if let ExprKind::MethodCall(unwrap_path, receiver, [default_arg], _) = cond.kind 64 ( 0.00%) && unwrap_path.ident.name == sym::unwrap_or . && matches!(default_arg.kind, ExprKind::Lit(lit) if matches!(lit.node, LitKind::Bool(false))) . && let ExprKind::MethodCall(map_path, map_receiver, [closure_arg], _) = receiver.kind . && map_path.ident.name == sym::map . && let ExprKind::MethodCall(check_path, collection_expr, [], _) = map_receiver.kind . && check_path.ident.name == peek_method . && kind.is_diag_item(cx, collection_expr) . && let ExprKind::Closure(closure) = closure_arg.kind . && let body = cx.tcx.hir_body(closure.body) -- line 372 ---------------------------------------- -- line 455 ---------------------------------------- . ControlFlow::Break((collection_expr, span, false)) . } else { . ControlFlow::Continue(()) . } . }) . } . . impl<'tcx> LateLintPass<'tcx> for ManualPopIf { 1,937,824 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 515,951 ( 0.00%) let ExprKind::If(cond, then_block, None) = expr.kind else { . return; . }; . 29,275 ( 0.00%) let in_else_clause = is_else_clause(cx.tcx, expr); 1,016,059 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_else_clause (5,855x) . 152,230 ( 0.00%) for kind in [ . ManualPopIfKind::Vec, . ManualPopIfKind::VecDequeBack, . ManualPopIfKind::VecDequeFront, . ManualPopIfKind::BinaryHeap, . ] { . if let Some(mut pattern) = check_is_some_and_pattern(cx, cond, then_block, expr.span, kind) 14,496 ( 0.00%) .or_else(|| check_if_let_pattern(cx, cond, then_block, expr.span, kind)) . .or_else(|| check_let_chain_pattern(cx, cond, then_block, expr.span, kind)) . .or_else(|| check_map_unwrap_or_pattern(cx, cond, then_block, expr.span, kind)) . && self.msrv_compatible(cx, kind) . { . if in_else_clause { . pattern.suggestable = false; . } . . pattern.emit_lint(cx); . return; . } . } 1,937,824 ( 0.02%) } . } 42,942 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_is_ascii_check.rs -------------------------------------------------------------------------------- Ir -- line 65 ---------------------------------------- . } . . impl ManualIsAsciiCheck { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . 6 ( 0.00%) #[derive(Debug, PartialEq)] . enum CharRange { . /// 'a'..='z' | b'a'..=b'z' . LowerChar, . /// 'A'..='Z' | b'A'..=b'Z' . UpperChar, . /// `AsciiLower` | `AsciiUpper` . FullChar, . /// '0..=9' -- line 81 ---------------------------------------- -- line 85 ---------------------------------------- . /// 'A..=F' . UpperHexLetter, . /// '0..=9' | 'a..=f' | 'A..=F' . HexDigit, . Otherwise, . } . . impl<'tcx> LateLintPass<'tcx> for ManualIsAsciiCheck { 2,180,052 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 747,014 ( 0.01%) if !matches!( 484,456 ( 0.00%) expr.kind, 16,765 ( 0.00%) ExprKind::Match(_, [_, ..], _) | ExprKind::MethodCall(_, _, [_], _) . ) { . return; . } . 54,474 ( 0.00%) if !self.msrv.meets(cx, msrvs::IS_ASCII_DIGIT) { 210,114 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (7,782x) . return; . } . 31,704 ( 0.00%) if is_in_const_context(cx) && !self.msrv.meets(cx, msrvs::IS_ASCII_DIGIT_CONST) { 2,757,940 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_const_context (7,782x) 2,592 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (96x) . return; . } . 59,892 ( 0.00%) let (arg, span, range) = if let ExprKind::Match(recv, [arm, ..], _) = expr.kind 18,969 ( 0.00%) && let Some(macro_call) = matching_root_macro_call(cx, expr.span, sym::matches_macro) 507,912 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::matching_root_macro_call (2,709x) . { 24 ( 0.00%) let recv = peel_ref_operators(cx, recv); 114 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::peel_ref_operators (6x) 12 ( 0.00%) let range = check_pat(&arm.pat.kind); 462 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_is_ascii_check.rs:clippy_lints::manual_is_ascii_check::check_pat (6x) . (recv, macro_call.span, range) 25,365 ( 0.00%) } else if let ExprKind::MethodCall(path, receiver, [arg], ..) = expr.kind 5,073 ( 0.00%) && path.ident.name == sym::contains 21 ( 0.00%) && let Some(higher::Range { . start: Some(start), . end: Some(end), . ty: range_ty, . span: _, 84 ( 0.00%) }) = higher::Range::hir(cx, receiver) 945 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (21x) . && let RangeLimits::Closed = range_ty.limits() . && !matches!(cx.typeck_results().expr_ty(arg).peel_refs().kind(), ty::Param(_)) . { . let arg = peel_ref_operators(cx, arg); . let range = check_expr_range(start, end); . (arg, expr.span, range) . } else { . return; . }; . 6 ( 0.00%) let ty_sugg = get_ty_sugg(cx, arg); . check_is_ascii(cx, span, arg, &range, ty_sugg); 1,937,824 ( 0.02%) } . } . . fn get_ty_sugg<'tcx>(cx: &LateContext<'tcx>, arg: &Expr<'_>) -> Option<(Span, Ty<'tcx>)> { . let local_hid = arg.res_local_id()?; 7 ( 0.00%) if let Node::Param(Param { ty_span, span, .. }) = cx.tcx.parent_hir_node(local_hid) 244 ( 0.00%) => ???:::parent_hir_node (2x) . // `ty_span` and `span` are the same for inferred type, thus a type suggestion must be given 1 ( 0.00%) && ty_span == span . { 4 ( 0.00%) let arg_type = cx.typeck_results().expr_ty(arg); 40 ( 0.00%) => ???:::expr_ty (1x) 3 ( 0.00%) return Some((*ty_span, arg_type)); . } . None . } . . fn check_is_ascii( . cx: &LateContext<'_>, . span: Span, . recv: &Expr<'_>, . range: &CharRange, . ty_sugg: Option<(Span, Ty<'_>)>, . ) { 30 ( 0.00%) let sugg = match range { . CharRange::UpperChar => "is_ascii_uppercase", . CharRange::LowerChar => "is_ascii_lowercase", . CharRange::FullChar => "is_ascii_alphabetic", . CharRange::Digit => "is_ascii_digit", . CharRange::HexDigit => "is_ascii_hexdigit", . CharRange::Otherwise | CharRange::LowerHexLetter | CharRange::UpperHexLetter => return, . }; . let mut app = Applicability::MachineApplicable; -- line 165 ---------------------------------------- -- line 175 ---------------------------------------- . span, . "manual check for common ascii range", . |diag| { . diag.multipart_suggestion("try", suggestion, app); . }, . ); . } . 55 ( 0.00%) fn check_pat(pat_kind: &PatKind<'_>) -> CharRange { 99 ( 0.00%) match pat_kind { . PatKind::Or(pats) => { 14 ( 0.00%) let ranges = pats.iter().map(|p| check_pat(&p.kind)).collect::>(); 100 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_is_ascii_check.rs:clippy_lints::manual_is_ascii_check::check_pat'2 (5x) . 6 ( 0.00%) if ranges.len() == 2 && ranges.contains(&CharRange::UpperChar) && ranges.contains(&CharRange::LowerChar) { . CharRange::FullChar . } else if ranges.len() == 3 . && ranges.contains(&CharRange::Digit) . && ranges.contains(&CharRange::LowerHexLetter) . && ranges.contains(&CharRange::UpperHexLetter) . { . CharRange::HexDigit . } else { . CharRange::Otherwise . } . }, . PatKind::Range(Some(start), Some(end), RangeEnd::Included) => check_range(start, end), . _ => CharRange::Otherwise, . } 66 ( 0.00%) } . . fn check_expr_range(start: &Expr<'_>, end: &Expr<'_>) -> CharRange { . if let ExprKind::Lit(start_lit) = &start.kind . && let ExprKind::Lit(end_lit) = &end.kind . { . check_lit_range(start_lit, end_lit) . } else { . CharRange::Otherwise -- line 211 ---------------------------------------- 59 ( 0.00%) -------------------------------------------------------------------------------- -- 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 { 2,180,052 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 484,456 ( 0.00%) if let ExprKind::Binary(ref op, l, r) = expr.kind 6,736 ( 0.00%) && matches!( 13,472 ( 0.00%) op.node, . BinOpKind::And | BinOpKind::BitAnd | BinOpKind::Or | BinOpKind::BitOr . ) 7,884 ( 0.00%) && self.msrv.meets(cx, msrvs::RANGE_CONTAINS) 35,478 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (1,314x) 5,256 ( 0.00%) && !is_in_const_context(cx) 467,176 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_const_context (1,314x) . { 9,114 ( 0.00%) check_possible_range_contains(cx, op.node, l, r, expr, expr.span); 2,082,166 ( 0.02%) => site/frontend/rust-clippy/clippy_lints/src/ranges.rs:clippy_lints::ranges::check_possible_range_contains (1,302x) . } . 1,453,914 ( 0.01%) if let Some(range) = higher::Range::hir(cx, expr) { 11,260,262 ( 0.09%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (242,228x) . check_exclusive_range_plus_one(cx, expr, &range); . check_inclusive_range_minus_one(cx, expr, &range); . check_reversed_empty_range(cx, expr, &range); . } 1,937,824 ( 0.02%) } . } . 14,211 ( 0.00%) fn check_possible_range_contains( . cx: &LateContext<'_>, . op: BinOpKind, . left: &Expr<'_>, . right: &Expr<'_>, . expr: &Expr<'_>, . span: Span, . ) { 15,790 ( 0.00%) let combine_and = match op { . BinOpKind::And | BinOpKind::BitAnd => true, . BinOpKind::Or | BinOpKind::BitOr => false, . _ => return, . }; . // value, name, order (higher/lower), inclusiveness 51,115 ( 0.00%) if let (Some(l), Some(r)) = (check_range_bounds(cx, left), check_range_bounds(cx, right)) { 1,293,473 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/ranges.rs:clippy_lints::ranges::check_range_bounds (2,604x) . // we only lint comparisons on the same name and with different . // direction 30 ( 0.00%) if l.id != r.id || l.ord == r.ord { . return; . } 24 ( 0.00%) let ord = Constant::partial_cmp(cx.tcx, cx.typeck_results().expr_ty(l.expr), &l.val, &r.val); 165 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::partial_cmp (3x) 120 ( 0.00%) => ???:::expr_ty (3x) 6 ( 0.00%) 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 { . (r.val_span, l.val_span, r.inc, l.inc) . }; . // we only lint inclusive lower bounds 18 ( 0.00%) if !l_inc { . return; . } 14 ( 0.00%) let (range_type, range_op) = if u_inc { . ("RangeInclusive", "..=") . } else { . ("Range", "..") . }; 1 ( 0.00%) let mut applicability = Applicability::MachineApplicable; 1 ( 0.00%) let name = snippet_with_applicability(cx, l.name_span, "_", &mut applicability); . let lo = snippet_with_applicability(cx, l_span, "_", &mut applicability); . let hi = snippet_with_applicability(cx, u_span, "_", &mut applicability); 6 ( 0.00%) let space = if lo.ends_with('.') { " " } else { "" }; 15 ( 0.00%) span_lint_and_sugg( 269,807 ( 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, . MANUAL_RANGE_CONTAINS, . span, 3 ( 0.00%) format!("manual `{range_type}::contains` implementation"), . "use", 16 ( 0.00%) format!("({lo}{space}{range_op}{hi}).contains(&{name})"), . applicability, . ); . } else if !combine_and && ord == Some(l.ord) { . // For floating-point types, `q < lo || q > hi` evaluates to `false` for NaN, . // but `!(lo..=hi).contains(&q)` evaluates to `true` for NaN, so not linting. . if matches!(cx.typeck_results().expr_ty(l.expr).kind(), ty::Float(_)) { . return; . } -- line 268 ---------------------------------------- -- line 291 ---------------------------------------- . MANUAL_RANGE_CONTAINS, . span, . format!("manual `!{range_type}::contains` implementation"), . "use", . format!("!({lo}{space}{range_op}{hi}).contains(&{name})"), . applicability, . ); . } 3,104 ( 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 3,106 ( 0.00%) if let ExprKind::Binary(ref lhs_op, _left, new_lhs) = left.kind 1,224 ( 0.00%) && op == lhs_op.node 2,770 ( 0.00%) && 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 554 ( 0.00%) src.matches('(').count() == src.matches(')').count() . }) . { 1,385 ( 0.00%) check_possible_range_contains(cx, op, new_lhs, right, expr, new_span); 46,069 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/ranges.rs:clippy_lints::ranges::check_possible_range_contains'2 (277x) . } 12,632 ( 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 22,106 ( 0.00%) fn check_range_bounds<'a>(cx: &'a LateContext<'_>, ex: &'a Expr<'_>) -> Option> { 6,316 ( 0.00%) if let ExprKind::Binary(ref op, l, r) = ex.kind { 25,607 ( 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() { 6,385 ( 0.00%) if let Some(c) = ConstEvalCtxt::new(cx).eval(r) { 1,164,790 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval (867x) 48,552 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::new (867x) 474 ( 0.00%) return Some(RangeBounds { . val: c, . expr: r, . id, 79 ( 0.00%) name_span: l.span, 158 ( 0.00%) val_span: r.span, . ord: ordering, . inc: inclusive, . }); . } . } else if let Some(id) = r.res_local_id() 85 ( 0.00%) && let Some(c) = ConstEvalCtxt::new(cx).eval(l) 1,140 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval (11x) 616 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::new (11x) . { 14 ( 0.00%) return Some(RangeBounds { . val: c, . expr: l, . id, 2 ( 0.00%) name_span: r.span, 4 ( 0.00%) val_span: l.span, . ord: ordering.reverse(), . inc: inclusive, . }); . } . } . None 25,264 ( 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, . ) { 182 ( 0.00%) if let higher::Range { 232 ( 0.00%) start, . end: Some(end), . ty, 232 ( 0.00%) span, 182 ( 0.00%) } = *range 928 ( 0.00%) && span.can_be_used_for_suggestions() 9,196 ( 0.00%) => ???:::can_be_used_for_suggestions (232x) . && 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 { 2 ( 0.00%) matches!( 4 ( 0.00%) get_parent_expr(cx, expr), 119 ( 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::Index(..), . .. . }) . ) . } . 11 ( 0.00%) fn is_for_loop_arg(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { . let mut cur_expr = expr; 9 ( 0.00%) while let Some(parent_expr) = get_parent_expr(cx, cur_expr) { 238 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (2x) 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 8 ( 0.00%) } . . fn is_empty_range(limits: RangeLimits, ordering: Ordering) -> bool { . match limits { . RangeLimits::HalfOpen => ordering != Ordering::Less, . RangeLimits::Closed => ordering == Ordering::Greater, . } . } . 116 ( 0.00%) if let higher::Range { . start: Some(start), . end: Some(end), 90 ( 0.00%) ty: range_ty, 90 ( 0.00%) span, 116 ( 0.00%) } = *range 270 ( 0.00%) && let ty = cx.typeck_results().expr_ty(start) 3,600 ( 0.00%) => ???:::expr_ty (90x) 360 ( 0.00%) && let ty::Int(_) | ty::Uint(_) = ty.kind() 360 ( 0.00%) && let ecx = ConstEvalCtxt::new(cx) 5,040 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::new (90x) 912 ( 0.00%) && let Some(start_idx) = ecx.eval(start) 12,335 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval (90x) 444 ( 0.00%) && let Some(end_idx) = ecx.eval(end) 7,933 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval (66x) 540 ( 0.00%) && let Some(ordering) = Constant::partial_cmp(cx.tcx, ty, &start_idx, &end_idx) 2,475 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::partial_cmp (45x) 75 ( 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` 6 ( 0.00%) } else if ordering != Ordering::Equal || is_for_loop_arg(cx, expr) { 292 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/ranges.rs:clippy_lints::ranges::check_reversed_empty_range::is_for_loop_arg (1x) . 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, . ); . } . }, . ); . } 111 ( 0.00%) } 2,775 ( 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:: (111x) . } . . fn y_plus_one<'tcx>(expr: &Expr<'tcx>) -> Option<&'tcx Expr<'tcx>> { 196 ( 0.00%) match expr.kind { . ExprKind::Binary( . Spanned { . node: BinOpKind::Add, .. . }, 8 ( 0.00%) lhs, 8 ( 0.00%) rhs, . ) => { . if is_integer_literal(lhs, 1) { . Some(rhs) 7 ( 0.00%) } else if is_integer_literal(rhs, 1) { . Some(lhs) . } else { . None . } . }, . _ => None, . } . } . . fn y_minus_one<'tcx>(expr: &Expr<'tcx>) -> Option<&'tcx Expr<'tcx>> { 30 ( 0.00%) match expr.kind { . ExprKind::Binary( . Spanned { . node: BinOpKind::Sub, .. . }, . lhs, . rhs, . ) if is_integer_literal(rhs, 1) => Some(lhs), . _ => None, -- line 674 ---------------------------------------- 268,354 ( 0.00%) -------------------------------------------------------------------------------- -- 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<'_>) { 726,688 ( 0.01%) if let Some(VecArgs::Repeat(repeat_expr, len_expr)) = VecArgs::hir(cx, expr) 8,736,024 ( 0.07%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (242,228x) 22 ( 0.00%) && matching_root_macro_call(cx, expr.span, sym::vec_macro).is_some() 778 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::matching_root_macro_call (2x) 8 ( 0.00%) && fn_def_id(cx, repeat_expr).is_some_and(|did| cx.tcx.is_diagnostic_item(sym::vec_with_capacity, did)) 70 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::fn_def_id (2x) . && !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(), . "vec![x; n]", . "only the last `Vec` will have the capacity", -- line 90 ---------------------------------------- -- line 95 ---------------------------------------- . snippet(cx, repeat_expr.span, "..") . ), . ); . } . } . . /// Checks `iter::repeat(Vec::with_capacity(x))` . fn check_repeat_fn(cx: &LateContext<'_>, expr: &Expr<'_>, msrv: Msrv) { 484,452 ( 0.00%) if !expr.span.from_expansion() 720,005 ( 0.01%) && fn_def_id(cx, expr).is_some_and(|did| cx.tcx.is_diagnostic_item(sym::iter_repeat, did)) 8,730,923 ( 0.07%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::fn_def_id (164,455x) 1,845,400 ( 0.02%) => ???:::is_diagnostic_item (28,330x) . && 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 { 2,664,508 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { . check_vec_macro(cx, expr); 242,228 ( 0.00%) check_repeat_fn(cx, expr, self.msrv); 1,937,824 ( 0.02%) } . } 2 ( 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/structural_impls.rs -------------------------------------------------------------------------------- Ir -- line 326 ---------------------------------------- . } . } . . impl<'tcx> TypeFoldable> for Ty<'tcx> { . fn try_fold_with>>( . self, . folder: &mut F, . ) -> Result { 1,852 ( 0.00%) folder.try_fold_ty(self) 17,668 ( 0.00%) => ???:>::try_fold_ty (1x) . } . 305 ( 0.00%) fn fold_with>>(self, folder: &mut F) -> Self { 163,971 ( 0.00%) folder.fold_ty(self) 448 ( 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: as rustc_type_ir::fold::TypeFolder>::fold_ty (32x) 21 ( 0.00%) } . } . . impl<'tcx> TypeVisitable> for Ty<'tcx> { . fn visit_with>>(&self, visitor: &mut V) -> V::Result { 27,599 ( 0.00%) visitor.visit_ty(*self) 462 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/useless_asref.rs:>::visit_ty'2 (22x) . } . } . . impl<'tcx> TypeSuperFoldable> for Ty<'tcx> { . fn try_super_fold_with>>( . self, . folder: &mut F, . ) -> Result { -- line 352 ---------------------------------------- -- line 389 ---------------------------------------- . | ty::Placeholder(..) . | ty::Never . | ty::Foreign(..) => return Ok(self), . }; . . Ok(if *self.kind() == kind { self } else { folder.cx().mk_ty_from_kind(kind) }) . } . 239,022 ( 0.00%) fn super_fold_with>>(self, folder: &mut F) -> Self { 159,348 ( 0.00%) let kind = match *self.kind() { . ty::RawPtr(ty, mutbl) => ty::RawPtr(ty.fold_with(folder), mutbl), 2,654 ( 0.00%) ty::Array(typ, sz) => ty::Array(typ.fold_with(folder), sz.fold_with(folder)), 2 ( 0.00%) ty::Slice(typ) => ty::Slice(typ.fold_with(folder)), 10,780 ( 0.00%) ty::Adt(tid, args) => ty::Adt(tid, args.fold_with(folder)), 5,039 ( 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/generic_args.rs:<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::generic_args::GenericArg> as rustc_type_ir::fold::TypeFoldable>::fold_with::> (15x) 110 ( 0.00%) ty::Dynamic(trait_ty, region) => { . ty::Dynamic(trait_ty.fold_with(folder), region.fold_with(folder)) 55 ( 0.00%) } 451 ( 0.00%) ty::Tuple(ts) => ty::Tuple(ts.fold_with(folder)), 82,688 ( 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/generic_args.rs:<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::Ty> as rustc_type_ir::fold::TypeFoldable>::fold_with::> (84x) 1,934 ( 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/generic_args.rs:<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::Ty> as rustc_type_ir::fold::TypeFoldable>::fold_with::>'2 (3x) 172 ( 0.00%) ty::FnDef(def_id, args) => ty::FnDef(def_id, args.fold_with(folder)), . ty::FnPtr(sig_tys, hdr) => ty::FnPtr(sig_tys.fold_with(folder), hdr), 43 ( 0.00%) ty::UnsafeBinder(f) => ty::UnsafeBinder(f.fold_with(folder)), 165,578 ( 0.00%) ty::Ref(r, ty, mutbl) => ty::Ref(r.fold_with(folder), ty.fold_with(folder), mutbl), . ty::Coroutine(did, args) => ty::Coroutine(did, args.fold_with(folder)), . ty::CoroutineWitness(did, args) => ty::CoroutineWitness(did, args.fold_with(folder)), . ty::Closure(did, args) => ty::Closure(did, args.fold_with(folder)), . ty::CoroutineClosure(did, args) => ty::CoroutineClosure(did, args.fold_with(folder)), 549 ( 0.00%) ty::Alias(is_rigid, data) => ty::Alias(is_rigid, data.fold_with(folder)), . ty::Pat(ty, pat) => ty::Pat(ty.fold_with(folder), pat.fold_with(folder)), . . ty::Bool . | ty::Char . | ty::Str . | ty::Int(_) . | ty::Uint(_) . | ty::Float(_) -- line 423 ---------------------------------------- -- line 425 ---------------------------------------- . | ty::Infer(_) . | ty::Param(..) . | ty::Bound(..) . | ty::Placeholder(..) . | ty::Never . | ty::Foreign(..) => return self, . }; . 239,012 ( 0.00%) if *self.kind() == kind { self } else { folder.cx().mk_ty_from_kind(kind) } 1,323 ( 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 (58x) 239,022 ( 0.00%) } . } . . impl<'tcx> TypeSuperVisitable> for Ty<'tcx> { . fn super_visit_with>>(&self, visitor: &mut V) -> V::Result { 88 ( 0.00%) match self.kind() { . ty::RawPtr(ty, _mutbl) => ty.visit_with(visitor), . ty::Array(typ, sz) => { . try_visit!(typ.visit_with(visitor)); . sz.visit_with(visitor) . } . ty::Slice(typ) => typ.visit_with(visitor), 22 ( 0.00%) ty::Adt(_, args) => args.visit_with(visitor), . ty::Dynamic(trait_ty, reg) => { . try_visit!(trait_ty.visit_with(visitor)); . reg.visit_with(visitor) . } . ty::Tuple(ts) => ts.visit_with(visitor), . ty::FnDef(_, args) => args.visit_with(visitor), . ty::FnPtr(sig_tys, _) => sig_tys.visit_with(visitor), . ty::UnsafeBinder(f) => f.visit_with(visitor), -- line 454 ---------------------------------------- -- line 591 ---------------------------------------- . } . } . . impl<'tcx> TypeFoldable> for ty::Const<'tcx> { . fn try_fold_with>>( . self, . folder: &mut F, . ) -> Result { 6 ( 0.00%) folder.try_fold_const(self) 4,329 ( 0.00%) => ???:>::try_fold_const (3x) . } . . fn fold_with>>(self, folder: &mut F) -> Self { . folder.fold_const(self) . } . } . . impl<'tcx> TypeVisitable> for ty::Const<'tcx> { -- line 607 ---------------------------------------- -- line 771 ---------------------------------------- . ) -> Result { . ty::util::try_fold_list(self, folder, |tcx, v| tcx.$mk(v)) . } . . fn fold_with>>( . self, . folder: &mut F, . ) -> Self { 110 ( 0.00%) ty::util::fold_list(self, folder, |tcx, v| tcx.$mk(v)) 8,360 ( 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/util.rs:rustc_middle::ty::util::fold_list::, &rustc_middle::ty::list::RawList<(), rustc_type_ir::binder::Binder>>, rustc_type_ir::binder::Binder>, <&rustc_middle::ty::list::RawList<(), rustc_type_ir::binder::Binder>> as rustc_type_ir::fold::TypeFoldable>::fold_with>::{closure#0}> (55x) . } . } . )* . } . } . . list_fold! { . &'tcx ty::List> : mk_poly_existential_predicates, -- line 787 ---------------------------------------- 61,636 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/needless_arbitrary_self_type.rs -------------------------------------------------------------------------------- Ir -- line 60 ---------------------------------------- . declare_lint_pass!(NeedlessArbitrarySelfType => [NEEDLESS_ARBITRARY_SELF_TYPE]); . . enum Mode { . Ref(Option), . Value, . } . . impl EarlyLintPass for NeedlessArbitrarySelfType { 70,195 ( 0.00%) fn check_param(&mut self, cx: &EarlyContext<'_>, p: &Param) { . // Bail out if the parameter it's not a receiver or was not written by the user 22,952 ( 0.00%) if !p.is_self() || p.span.from_expansion() { . return; . } . 16,092 ( 0.00%) let (path, binding_mode, mutbl) = match &p.ty.kind { . TyKind::Path(None, path) if let PatKind::Ident(BindingMode(ByRef::No, mutbl), _, _) = p.pat.kind => { . (path, Mode::Value, mutbl) . }, . TyKind::Ref(lifetime, mut_ty) 6,687 ( 0.00%) if let TyKind::Path(None, path) = &mut_ty.ty.kind . && let PatKind::Ident(BindingMode::NONE, _, _) = p.pat.kind => . { . (path, Mode::Ref(*lifetime), mut_ty.mutbl) . }, . _ => return, . }; . . let span = p.span.to(p.ty.span); -- line 87 ---------------------------------------- -- line 116 ---------------------------------------- . let mut sugg = vec![(p.ty.span.with_lo(p.span.hi()), String::new())]; . if !add.is_empty() { . sugg.push((p.span.shrink_to_lo(), add)); . } . diag.multipart_suggestion("remove the type", sugg, applicability); . }, . ); . } 70,195 ( 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/zip.rs -------------------------------------------------------------------------------- Ir -- line 62 ---------------------------------------- . /// assert!(iter.next().is_none()); . /// ``` . #[stable(feature = "iter_zip", since = "1.59.0")] . pub fn zip(a: A, b: B) -> Zip . where . A: IntoIterator, . B: IntoIterator, . { 5,930 ( 0.00%) ZipImpl::new(a.into_iter(), b.into_iter()) . } . . #[stable(feature = "rust1", since = "1.0.0")] . impl Iterator for Zip . where . A: Iterator, . B: Iterator, . { -- line 78 ---------------------------------------- -- line 144 ---------------------------------------- . Self: Iterator + TrustedRandomAccessNoCoerce; . } . . // Work around limitations of specialization, requiring `default` impls to be repeated . // in intermediary impls. . macro_rules! zip_impl_general_defaults { . () => { . default fn new(a: A, b: B) -> Self { 75 ( 0.00%) Zip { . a, . b, . index: 0, // unused . len: 0, // unused . } . } . . #[inline] . default fn next(&mut self) -> Option<(A::Item, B::Item)> { 1,002 ( 0.00%) let x = self.a.next()?; . let y = self.b.next()?; 816 ( 0.00%) Some((x, y)) . } . . #[inline] . default fn nth(&mut self, n: usize) -> Option { . self.super_nth(n) . } . . #[inline] -- line 172 ---------------------------------------- -- line 287 ---------------------------------------- . . impl ZipImpl for Zip . where . A: TrustedRandomAccess + Iterator, . B: TrustedRandomAccess + Iterator, . { . fn new(a: A, b: B) -> Self { . let len = cmp::min(a.size(), b.size()); 216 ( 0.00%) Zip { a, b, index: 0, len } . } . . #[inline] . fn next(&mut self) -> Option<(A::Item, B::Item)> { 167,203 ( 0.00%) if self.index < self.len { . let i = self.index; . // since get_unchecked executes code which can panic we increment the counters beforehand . // so that the same index won't be accessed twice, as required by TrustedRandomAccess 23,387 ( 0.00%) self.index += 1; . // SAFETY: `i` is smaller than `self.len`, thus smaller than `self.a.len()` and `self.b.len()` . unsafe { 3,826 ( 0.00%) Some((self.a.__iterator_get_unchecked(i), self.b.__iterator_get_unchecked(i))) . } . } else { . None . } . } . . #[inline] . fn size_hint(&self) -> (usize, Option) { -- line 315 ---------------------------------------- 31,351 ( 0.00%) -------------------------------------------------------------------------------- -- 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),* $(,)?)) => { 19,698,711 ( 0.16%) rustc_lint::EarlyLintPass::$name(&mut $self.$field, $($arg),*); 5,908,632 ( 0.05%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/inline_trait_bounds.rs:::check_fn (6,666x) 160,130 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/multiple_bound_locations.rs:::check_fn (6,666x) . }; . } . . /// 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),*);)*]) => ( 8,274,081 ( 0.07%) $(#[inline(always)] fn $name(&mut self, cx: &rustc_lint::EarlyContext<'_>, $($param: $arg),*) { . $crate::expand_combined_early_lint_pass_method!($fields, self, $name, (cx, $($param),*)); 1,458,969 ( 0.01%) })* . ) . } . . /// 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 ---------------------------------------- 4,974 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/operators/cmp_owned.rs -------------------------------------------------------------------------------- Ir -- line 7 ---------------------------------------- . use rustc_hir::{BinOpKind, Expr, ExprKind, UnOp}; . use rustc_lint::LateContext; . use rustc_middle::ty::Ty; . . use super::CMP_OWNED; . . pub(super) fn check(cx: &LateContext<'_>, e: &Expr<'_>, op: BinOpKind, lhs: &Expr<'_>, rhs: &Expr<'_>) { . if op.is_comparison() { 23,015 ( 0.00%) check_op(cx, e, lhs, rhs, true); 426,858 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/operators/cmp_owned.rs:clippy_lints::operators::cmp_owned::check_op (4,603x) 27,618 ( 0.00%) check_op(cx, e, rhs, lhs, false); 290,086 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/operators/cmp_owned.rs:clippy_lints::operators::cmp_owned::check_op (4,603x) . } . } . . #[derive(Default)] . struct EqImpl { . ty_eq_other: bool, . other_eq_ty: bool, . } -- line 24 ---------------------------------------- -- line 30 ---------------------------------------- . . fn symmetric_partial_eq<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>, other: Ty<'tcx>) -> Option { . cx.tcx.lang_items().eq_trait().map(|def_id| EqImpl { . ty_eq_other: implements_trait(cx, ty, def_id, &[other.into()]), . other_eq_ty: implements_trait(cx, other, def_id, &[ty.into()]), . }) . } . 82,854 ( 0.00%) fn check_op(cx: &LateContext<'_>, outer: &Expr<'_>, expr: &Expr<'_>, other: &Expr<'_>, left: bool) { 9,206 ( 0.00%) if !outer.span.eq_ctxt(expr.span) { . return; . } . . let typeck = cx.typeck_results(); 45,150 ( 0.00%) let (arg, arg_span) = match expr.kind { 1,588 ( 0.00%) ExprKind::MethodCall(_, arg, [], _) . if typeck 6,120 ( 0.00%) .type_dependent_def_id(expr.hir_id) 39,015 ( 0.00%) => ???:::type_dependent_def_id (765x) 3,060 ( 0.00%) .and_then(|id| cx.tcx.trait_of_assoc(id)) 144,855 ( 0.00%) => ???:::trait_of_assoc (765x) 1,940 ( 0.00%) .is_some_and(|id| matches!(cx.tcx.get_diagnostic_name(id), Some(sym::ToString | sym::ToOwned))) => 25,793 ( 0.00%) => ???:::get_diagnostic_name (485x) . { . (arg, arg.span) . }, 880 ( 0.00%) ExprKind::Call(path, [arg]) 65 ( 0.00%) if path . .res(cx) . .opt_def_id() 259 ( 0.00%) .is_some_and(|did| match cx.tcx.get_diagnostic_name(did) { 2,856 ( 0.00%) => ???:::get_diagnostic_name (37x) . Some(sym::from_str_method) => true, 70 ( 0.00%) Some(sym::from_fn) => !is_copy(cx, typeck.expr_ty(expr)), 17,731 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::is_copy (14x) 560 ( 0.00%) => ???:::expr_ty (14x) . _ => false, . }) => . { . (arg, arg.span) . }, . _ => return, . }; . -- line 67 ---------------------------------------- -- line 126 ---------------------------------------- . } else { . (span, format!("{other_snippet}{cmp_snippet}{expr_snip}")) . } . }; . . diag.span_suggestion(span, "try", hint, applicability); . }, . ); 73,648 ( 0.00%) } 56,765 ( 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 { 53,442 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) { 29,690 ( 0.00%) let attrs = cx.tcx.hir_attrs(item.hir_id()); 366,333 ( 0.00%) => ???:::hir_attrs (5,938x) 15,575 ( 0.00%) if let ItemKind::Fn { ident, body, .. } = item.kind { 8,631 ( 0.00%) inline_always::check(cx, item.span, ident.name, attrs, Some(body)); 43,346 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/attrs/inline_always.rs:clippy_lints::attrs::inline_always::check (1,233x) . } 4,705 ( 0.00%) repr_attributes::check(cx, item.span, attrs, self.msrv); 41,566 ( 0.00%) } . . fn check_impl_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx ImplItem<'_>) { 19,964 ( 0.00%) if let ImplItemKind::Fn(_, body) = item.kind { 27,398 ( 0.00%) inline_always::check( 179,383 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/attrs/inline_always.rs:clippy_lints::attrs::inline_always::check (3,914x) . cx, 3,914 ( 0.00%) item.span, 3,914 ( 0.00%) item.ident.name, 15,656 ( 0.00%) cx.tcx.hir_attrs(item.hir_id()), 253,307 ( 0.00%) => ???:::hir_attrs (3,914x) . Some(body), . ); . } . } . . fn check_trait_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx TraitItem<'_>) { 2,526 ( 0.00%) if let TraitItemKind::Fn(_, kind) = item.kind { 7,416 ( 0.00%) let body = match kind { . TraitFn::Required(_) => None, . TraitFn::Provided(body) => Some(body), . }; 17,304 ( 0.00%) inline_always::check(cx, item.span, item.ident.name, cx.tcx.hir_attrs(item.hir_id()), body); 75,958 ( 0.00%) => ???:::hir_attrs (1,236x) 47,633 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/attrs/inline_always.rs:clippy_lints::attrs::inline_always::check (1,236x) . } . } . } . . pub struct EarlyAttributes { . msrv: MsrvStack, . } . . impl EarlyAttributes { . pub fn new(conf: &'static Conf) -> Self { 104 ( 0.00%) Self { msrv: conf.msrv.into() } . } . } . . impl EarlyLintPass for EarlyAttributes { 48,120 ( 0.00%) fn check_attribute(&mut self, cx: &EarlyContext<'_>, attr: &Attribute) { 24,060 ( 0.00%) deprecated_cfg_attr::check(cx, attr, &self.msrv); 389,140 ( 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 (8,020x) 24,060 ( 0.00%) deprecated_cfg_attr::check_clippy(cx, attr); 291,568 ( 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 (8,020x) . non_minimal_cfg::check(cx, attr); 32,080 ( 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); . } . 151,900 ( 0.00%) fn check_attribute(&mut self, cx: &EarlyContext<'_>, attr: &Attribute) { 45,570 ( 0.00%) check_clippy_attr(cx.sess(), attr); 803,806 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/attrs.rs:clippy_utils::attrs::check_clippy_attr:: (15,190x) 75,950 ( 0.00%) if let Some(items) = &attr.meta_item_list() 449,598 ( 0.00%) => ???:::meta_item_list (15,190x) 10,356 ( 0.00%) && let Some(name) = attr.name() 8,973 ( 0.00%) => ???:::name (997x) . { 2,670 ( 0.00%) if matches!(name, sym::allow) && self.msrv.meets(msrvs::LINT_REASONS_STABILIZATION) { 12,816 ( 0.00%) => /rust/deps/smallvec-1.15.1/src/lib.rs:::meets (534x) 1,602 ( 0.00%) allow_attributes::check(cx, attr); 590,546 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/attrs/allow_attributes.rs:clippy_lints::attrs::allow_attributes::check (534x) . } 2,675 ( 0.00%) if matches!(name, sym::allow | sym::expect) && self.msrv.meets(msrvs::LINT_REASONS_STABILIZATION) { 12,840 ( 0.00%) => /rust/deps/smallvec-1.15.1/src/lib.rs:::meets (535x) . allow_attributes_without_reason::check(cx, name, items, attr); . } . if is_lint_level(name) { . blanket_clippy_restriction_lints::check(cx, name, items); . } 1,994 ( 0.00%) if items.is_empty() || !attr.has_name(sym::deprecated) { . return; . } . for item in items { 8 ( 0.00%) if let MetaItemInner::MetaItem(mi) = &item 8 ( 0.00%) && let MetaItemKind::NameValue(lit) = &mi.kind 20 ( 0.00%) && mi.has_name(sym::since) 32 ( 0.00%) => ???:::has_name (4x) . { 8 ( 0.00%) deprecated_semver::check(cx, item.span(), lit); 532 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/attrs/deprecated_semver.rs:clippy_lints::attrs::deprecated_semver::check (2x) . } . } . } . . if attr.has_name(sym::should_panic) { . should_panic_without_expect::check(cx, attr); . } . 2,995 ( 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 `= \"..\"`", . ); . } 121,520 ( 0.00%) } . . fn check_item(&mut self, cx: &EarlyContext<'_>, item: &'_ ast::Item) { 14,988 ( 0.00%) match item.kind { 2,367 ( 0.00%) ast::ItemKind::ExternCrate(..) | ast::ItemKind::Use(..) => useless_attribute::check(cx, item, &item.attrs), 24,727 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/attrs/useless_attribute.rs:clippy_lints::attrs::useless_attribute::check (789x) . _ => {}, . } . 24,980 ( 0.00%) mixed_attributes_style::check(cx, item.span, &item.attrs); 2,061,856 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/attrs/mixed_attributes_style.rs:clippy_lints::attrs::mixed_attributes_style::check (4,996x) . } . 3,074,580 ( 0.03%) fn check_attributes(&mut self, cx: &EarlyContext<'_>, attrs: &[Attribute]) { 922,374 ( 0.01%) self.msrv.check_attributes(attrs); 1,254,561 ( 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 (307,458x) . duplicated_attributes::check(cx, attrs); 614,916 ( 0.01%) msrvs::check_attrs(cx.sess(), attrs); 5,829,732 ( 0.05%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:clippy_utils::msrvs::check_attrs:: (307,458x) 2,459,664 ( 0.02%) } . . fn check_attributes_post(&mut self, _cx: &EarlyContext<'_>, attrs: &[Attribute]) { 1,229,832 ( 0.01%) self.msrv.check_attributes_post(attrs); 1,254,561 ( 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 (307,458x) . } . } 148 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_range_patterns.rs -------------------------------------------------------------------------------- Ir -- line 34 ---------------------------------------- . pub MANUAL_RANGE_PATTERNS, . complexity, . "manually writing range patterns using a combined OR pattern (`|`)" . } . . declare_lint_pass!(ManualRangePatterns => [MANUAL_RANGE_PATTERNS]); . . fn expr_as_i128(expr: &PatExpr<'_>) -> Option { 150 ( 0.00%) if let PatExprKind::Lit { lit, negated } = expr.kind 44 ( 0.00%) && let LitKind::Int(num, _) = lit.node . { . // Intentionally not handling numbers greater than i128::MAX (for u128 literals) for now. . let n = i128::try_from(num.get()).ok()?; 70 ( 0.00%) Some(if negated { -n } else { n }) . } else { . None . } . } . . #[derive(Copy, Clone)] . struct Num { . val: i128, . span: Span, . } . . impl Num { . fn new(expr: &PatExpr<'_>) -> Option { . Some(Self { . val: expr_as_i128(expr)?, 10 ( 0.00%) span: expr.span, . }) . } . . fn dummy(val: i128) -> Self { 612 ( 0.00%) Self { val, span: DUMMY_SP } . } . . fn min(self, other: Self) -> Self { 80 ( 0.00%) if self.val < other.val { self } else { other } . } . } . . impl LateLintPass<'_> for ManualRangePatterns { 467,376 ( 0.00%) fn check_pat(&mut self, cx: &LateContext<'_>, pat: &'_ rustc_hir::Pat<'_>) { . // a pattern like 1 | 2 seems fine, lint if there are at least 3 alternatives . // or more then one range (exclude triggering on stylistic using OR with one element . // like described https://github.com/rust-lang/rust-clippy/issues/11825) 117,300 ( 0.00%) if let PatKind::Or(pats) = pat.kind 834 ( 0.00%) && (pats.len() >= 3 || (pats.len() > 1 && pats.iter().any(|p| matches!(p.kind, PatKind::Range(..))))) 408 ( 0.00%) && !pat.span.in_external_macro(cx.sess().source_map()) . { . let mut min = Num::dummy(i128::MAX); . let mut max = Num::dummy(i128::MIN); 102 ( 0.00%) let mut range_kind = RangeEnd::Included; . let mut numbers_found = FxHashSet::default(); . let mut ranges_found = Vec::new(); . . for pat in pats { 480 ( 0.00%) if let PatKind::Expr(lit) = pat.kind . && let Some(num) = Num::new(lit) . { . numbers_found.insert(num.val); . 60 ( 0.00%) min = min.min(num); 50 ( 0.00%) if num.val >= max.val { 30 ( 0.00%) max = num; 30 ( 0.00%) range_kind = RangeEnd::Included; . } . } else if let PatKind::Range(Some(left), Some(right), end) = pat.kind . && let Some(left) = Num::new(left) . && let Some(mut right) = Num::new(right) . { . if let RangeEnd::Excluded = end { . right.val -= 1; . } -- line 108 ---------------------------------------- -- line 114 ---------------------------------------- . } . ranges_found.push(left.val..=right.val); . } else { . return; . } . } . . let mut num = min.val; 66 ( 0.00%) while num <= max.val { . if numbers_found.contains(&num) { . num += 1; . } . // Given a list of (potentially overlapping) ranges like: . // 1..=5, 3..=7, 6..=10 . // We want to find the range with the highest end that still contains the current number . else if let Some(range) = ranges_found . .iter() -- line 130 ---------------------------------------- -- line 132 ---------------------------------------- . .max_by_key(|range| range.end()) . { . num = range.end() + 1; . } else { . return; . } . } . 8 ( 0.00%) span_lint_and_then( 279,358 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then::::check_pat::{closure#3}> (1x) . cx, . MANUAL_RANGE_PATTERNS, . pat.span, . "this OR pattern can be rewritten using a range", 10 ( 0.00%) |diag| { 8 ( 0.00%) if let Some(min) = min.span.get_text(cx) 8 ( 0.00%) && let Some(max) = max.span.get_text(cx) . { . diag.span_suggestion( 1 ( 0.00%) pat.span, . "try", 10 ( 0.00%) format!("{min}{range_kind}{max}"), . Applicability::MachineApplicable, . ); . } . }, . ); . } 467,376 ( 0.00%) } . } 911 ( 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; . 443,288 ( 0.00%) pub(super) fn check(cx: &EarlyContext<'_>, pat: &Pat) { 110,822 ( 0.00%) if let PatKind::Struct(_, ref npat, ref pfields, _) = pat.kind { . let mut wilds = 0; 5,856 ( 0.00%) let type_name = npat . .segments . .last() . .expect("A path must have at least one segment") . .ident . .name; . 10,360 ( 0.00%) for field in pfields { 28,640 ( 0.00%) if let PatKind::Wild = field.pat.kind { . wilds += 1; . } . } 2,590 ( 0.00%) if !pfields.is_empty() && wilds == pfields.len() { . if !pat.span.in_external_macro(cx.sess().source_map()) { . #[expect(clippy::collapsible_span_lint_calls, reason = "rust-clippy#7797")] . span_lint_and_then( . cx, . UNNEEDED_FIELD_PATTERN, . pat.span, . "all the struct fields are matched to a wildcard pattern, consider using `..`", . |diag| { . diag.help(format!("try with `{type_name} {{ .. }}` instead")); . }, . ); . } . return; . } 5,180 ( 0.00%) if wilds > 0 { . for field in pfields { 207 ( 0.00%) if let PatKind::Wild = field.pat.kind 80 ( 0.00%) && !field.span.in_external_macro(cx.sess().source_map()) . { . wilds -= 1; 58 ( 0.00%) if wilds > 0 { . span_lint( . cx, . UNNEEDED_FIELD_PATTERN, . field.span, . "you matched a field with a wildcard pattern, consider using `..` instead", . ); . } else { . #[expect(clippy::collapsible_span_lint_calls, reason = "rust-clippy#7797")] 144 ( 0.00%) span_lint_and_then( 12,816 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then:: (18x) . cx, . UNNEEDED_FIELD_PATTERN, . field.span, . "you matched a field with a wildcard pattern, consider using `..` instead", 90 ( 0.00%) |diag| { . diag.help(format!( . "try with `{type_name} {{ {}, .. }}`", . pfields . .iter() . .filter_map(|f| match f.pat.kind { . PatKind::Wild => None, . _ => f.span.get_text(cx), . }) -- line 67 ---------------------------------------- -- line 69 ---------------------------------------- . )); . }, . ); . } . } . } . } . } 443,288 ( 0.00%) } 3,038 ( 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)] 2,180,052 ( 0.02%) 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`" 487,971 ( 0.00%) let (inner_expr, span, suggested_type) = if let ExprKind::Array([inner_expr]) = expr.kind 1,210 ( 0.00%) && !expr.span.from_expansion() . { 25 ( 0.00%) (inner_expr, expr.span, SuggestedType::Array) 5,438 ( 0.00%) } else if let Some(macro_call) = root_macro_call_first_node(cx, expr) 9,128 ( 0.00%) && let Some(VecArgs::Vec([expr])) = VecArgs::hir(cx, expr) 97,622 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (1,811x) . { . (expr, macro_call.span, SuggestedType::Vec) . } else { . return; . }; . 180 ( 0.00%) let Some(range) = Range::hir(cx, inner_expr) else { 1,392 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (30x) . return; . }; . . let Some(snippet) = span.get_text(cx) else { . return; . }; . // `is_from_proc_macro` will skip any `vec![]`. Let's not! . if !snippet.starts_with(suggested_type.starts_with()) || !snippet.ends_with(suggested_type.ends_with()) { -- line 99 ---------------------------------------- -- line 188 ---------------------------------------- . format!("if you wanted {suggested_type} of len {end_snippet}, try"), . format!("{start_snippet}; {end_snippet}"), . applicability, . ); . } . } . }, . ); 1,937,824 ( 0.02%) } . } 1,871 ( 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/char/mod.rs -------------------------------------------------------------------------------- Ir -- line 386 ---------------------------------------- . fn next(&mut self) -> Option { . self.0.next() . } . . fn size_hint(&self) -> (usize, Option) { . self.0.size_hint() . } . 36,288 ( 0.00%) fn fold(self, init: Acc, fold: Fold) -> Acc . where . Fold: FnMut(Acc, Self::Item) -> Acc, . { . self.0.fold(init, fold) 41,472 ( 0.00%) } . . fn count(self) -> usize { . self.0.count() . } . . fn last(self) -> Option { . self.0.last() . } -- line 407 ---------------------------------------- -- line 536 ---------------------------------------- . . #[derive(Debug, Clone)] . struct CaseMappingIter(core::array::IntoIter); . . impl CaseMappingIter { . #[inline] . fn new(chars: [char; 3]) -> CaseMappingIter { . let mut iter = chars.into_iter(); 36,288 ( 0.00%) if chars[2] == '\0' { . iter.next_back(); . if chars[1] == '\0' { . iter.next_back(); . . // Deliberately don't check `chars[0]`, . // as '\0' lowercases to itself . } . } 15,552 ( 0.00%) CaseMappingIter(iter) . } . } . . impl Iterator for CaseMappingIter { . type Item = char; . . fn next(&mut self) -> Option { . self.0.next() -- line 561 ---------------------------------------- 17,234 ( 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . // match call to unwrap 520,533 ( 0.00%) if let ExprKind::MethodCall(unwrap_fun, write_call, [], _) = expr.kind 7,965 ( 0.00%) && unwrap_fun.ident.name == sym::unwrap . // match call to write_fmt 1,762 ( 0.00%) && let ExprKind::MethodCall(write_fun, write_recv, [write_arg], _) = *look_in_block(cx, &write_call.kind) 64 ( 0.00%) && 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) { . Some(sym::io_stdout) => ("stdout", ""), . Some(sym::io_stderr) => ("stderr", "e"), . _ => return, -- line 69 ---------------------------------------- -- line 105 ---------------------------------------- . EXPLICIT_WRITE, . expr.span, . format!("use of `{used}.unwrap()`"), . "try", . format!("{prefix}{sugg_mac}!({inputs_snippet})"), . applicability, . ); . } 1,937,824 ( 0.02%) } . } . . /// 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> { 969 ( 0.00%) if let ExprKind::Block(block, _label @ None) = kind . && let Block { . stmts: [Stmt { kind: StmtKind::Let(local), .. }], . expr: Some(expr_end_of_block), . rules: BlockCheckMode::DefaultBlock, . .. . } = block . . // Find id of the local that expr_end_of_block resolves to -- line 127 ---------------------------------------- 323 ( 0.00%) -------------------------------------------------------------------------------- -- 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) { 494,007 ( 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() 1 ( 0.00%) .take_while(|pat| matches!(pat.kind, PatKind::Wild)) . .enumerate() . .last() . && !pat.span.in_external_macro(cx.sess().source_map()) . { . span_lint(cx, left_pat.span.until(patterns[rest_index].span), left_index == 0); . } . . if let Some((right_index, right_pat)) = patterns[rest_index + 1..] -- line 24 ---------------------------------------- -- 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, . ); . } 55,402 ( 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() 1,200 ( 0.00%) .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. . && cx.get_lint_level_spec(crate::rest_when_destructuring_struct::REST_PATTERN_ACCESSIBLE_FIELD).is_allow() . && !pat.span.in_external_macro(cx.sess().source_map()) . { . // Unlike the tuples above, structs have patfields rather than patterns, and separate out the . // `..` into a separate parameter. Also, the `..` can only be at the end of the pattern. -- line 50 ---------------------------------------- 1,000 ( 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)] 1,937,824 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 484,456 ( 0.00%) 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 123 ---------------------------------------- . ), . }; . Some(format!( . "if let {}::{entry_kind} = {map_str}.entry({key_str}) {then_str} else {else_str}", . map_ty.entry_path(), . )) . } else { . // if .. { insert } else { insert } 201 ( 0.00%) let ((then_str, then_entry), (else_str, else_entry)) = if contains_expr.negated { . ( . then_search.snippet_vacant(cx, then_expr.span, &mut app), . else_search.snippet_occupied(cx, else_expr.span, &mut app), . ) . } else { . ( . then_search.snippet_occupied(cx, then_expr.span, &mut app), . else_search.snippet_vacant(cx, else_expr.span, &mut app), -- line 139 ---------------------------------------- -- 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() . ), . ); . } 1,937,824 ( 0.02%) } . } . . #[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; 8,221 ( 0.00%) let expr = peel_hir_expr_while(expr, |e| match e.kind { 67 ( 0.00%) ExprKind::Unary(UnOp::Not, e) => { . negated = !negated; . Some(e) . }, . _ => None, . }); . 5,755 ( 0.00%) if let ExprKind::MethodCall(_, map, [arg], _) = expr.kind 102 ( 0.00%) && let Expr { . kind: ExprKind::AddrOf(_, _, key), . span: key_span, . .. . } = arg 12 ( 0.00%) && key_span.eq_ctxt(expr.span) . { 24 ( 0.00%) let id = cx.typeck_results().type_dependent_def_id(expr.hir_id)?; 306 ( 0.00%) => ???:::type_dependent_def_id (6x) . let expr = ContainsExpr { . negated, . map, 6 ( 0.00%) key, 6 ( 0.00%) call_ctxt: expr.span.ctxt(), . }; 42 ( 0.00%) match cx.tcx.get_diagnostic_name(id) { 426 ( 0.00%) => ???:::get_diagnostic_name (6x) . Some(sym::btreemap_contains_key) => Some((MapType::BTree, expr)), . Some(sym::hashmap_contains_key) => Some((MapType::Hash, expr)), . _ => None, . } . } else { . None . } . } -- line 294 ---------------------------------------- 2,812 ( 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 726,684 ( 0.01%) if !expr.span.from_expansion() . // Avoid cases already linted by `field_reassign_with_default` 198,018 ( 0.00%) && !self.reassigned_linted.contains(&expr.span) 1,046 ( 0.00%) && let ExprKind::Call(path, []) = expr.kind 11,506 ( 0.00%) && !in_automatically_derived(cx.tcx, expr.hir_id) 832,495 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::in_automatically_derived (1,046x) 3,138 ( 0.00%) && let ExprKind::Path(ref qpath) = path.kind 5,230 ( 0.00%) && let Some(def_id) = cx.qpath_res(qpath, path.hir_id).opt_def_id() 64,370 ( 0.00%) => ???:::qpath_res (1,046x) 5,220 ( 0.00%) && cx.tcx.is_diagnostic_item(sym::default_fn, def_id) 82,138 ( 0.00%) => ???:::is_diagnostic_item (1,044x) 2,440 ( 0.00%) && !is_update_syntax_base(cx, expr) 68,094 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/default.rs:clippy_lints::default::is_update_syntax_base (488x) . // Detect and ignore ::default() because these calls do explicitly name the type. 1,034 ( 0.00%) && let QPath::Resolved(None, _path) = qpath 58 ( 0.00%) && let expr_ty = cx.typeck_results().expr_ty(expr) 1,160 ( 0.00%) => ???:::expr_ty (29x) 58 ( 0.00%) && let ty::Adt(def, ..) = expr_ty.kind() 130 ( 0.00%) && !is_from_proc_macro(cx, expr) 18,190 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/check_proc_macro.rs:clippy_utils::check_proc_macro::is_from_proc_macro:: (26x) . { 156 ( 0.00%) let replacement = with_forced_trimmed_paths!(format!("{}::default()", cx.tcx.def_path_str(def.did()))); 104 ( 0.00%) => ???:::new (26x) 338 ( 0.00%) span_lint_and_sugg( 41,751 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_sugg:: (26x) . cx, . DEFAULT_TRAIT_ACCESS, 26 ( 0.00%) expr.span, 52 ( 0.00%) format!("calling `{replacement}` is more clear than this expression"), . "try", 104 ( 0.00%) replacement, . Applicability::Unspecified, // First resolve the TODO above . ); . } 1,937,824 ( 0.02%) } . . #[expect(clippy::too_many_lines)] 196,128 ( 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 { 87,168 ( 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 54,374 ( 0.00%) let (local, variant, binding_name, binding_type, span) = if let StmtKind::Let(local) = stmt.kind . // only take `let ...` statements 47,712 ( 0.00%) && let Some(expr) = local.init 109,627 ( 0.00%) && !in_automatically_derived(cx.tcx, expr.hir_id) 15,908,966 ( 0.13%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::in_automatically_derived (15,661x) 31,112 ( 0.00%) && !expr.span.from_expansion() . // only take bindings to identifiers 78,933 ( 0.00%) && let PatKind::Binding(_, binding_id, ident, _) = local.pat.kind . // only when assigning `... = Default::default()` 65,045 ( 0.00%) && is_expr_default(cx, expr) 165,515 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_expr_default (13,009x) 1,278 ( 0.00%) && let binding_type = cx.typeck_results().node_type(binding_id) 17,466 ( 0.00%) => ???:::node_type (426x) 877 ( 0.00%) && let ty::Adt(adt, args) = *binding_type.kind() 25 ( 0.00%) && adt.is_struct() 25 ( 0.00%) && let variant = adt.non_enum_variant() 200 ( 0.00%) => ???:::non_enum_variant (25x) . && !variant.field_list_has_applicable_non_exhaustive() 125 ( 0.00%) && let module_did = cx.tcx.parent_module(stmt.hir_id) 4,403 ( 0.00%) => ???:::parent_module (25x) . && variant . .fields . .iter() 25 ( 0.00%) .all(|field| field.vis.is_accessible_from(module_did, cx.tcx)) . && let all_fields_are_copy = variant . .fields . .iter() 45 ( 0.00%) .all(|field| { 110,322 ( 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 core::iter::traits::iterator::Iterator>::all::<::check_block::{closure#1}> (9x) 17 ( 0.00%) is_copy(cx, cx.tcx.type_of(field.did).instantiate(cx.tcx, args).skip_norm_wip()) 102,417 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::is_copy (17x) . }) 48 ( 0.00%) && (!has_drop(cx, binding_type) || all_fields_are_copy) 4,181 ( 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/sty.rs:clippy_utils::ty::has_drop (9x) . { 18 ( 0.00%) (local, variant, ident.name, binding_type, expr.span) . } else { . continue; . }; . 9 ( 0.00%) let init_ctxt = local.span.ctxt(); . . // find all "later statement"'s where the fields of the binding set as . // Default::default() get reassigned, unless the reassignment refers to the original binding . let mut first_assign = None; . let mut assigned_fields = Vec::new(); . let mut cancel_lint = false; . for consecutive_statement in &block.stmts[stmt_idx + 1..] { . // find out if and which field was set by this `consecutive_statement` 13 ( 0.00%) if let Some((field_ident, assign_rhs)) = field_reassigned_by_stmt(consecutive_statement, binding_name) { . // interrupt and cancel lint if assign_rhs references the original binding 18 ( 0.00%) if contains_name(binding_name, assign_rhs, cx) || init_ctxt != consecutive_statement.span.ctxt() { 701 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::contains_name (3x) . cancel_lint = true; . break; . } . . // if the field was previously assigned, replace the assignment, otherwise insert the assignment . if let Some(prev) = assigned_fields . .iter_mut() . .find(|(field_name, _)| field_name == &field_ident.name) . { . *prev = (field_ident.name, assign_rhs); . } else { . assigned_fields.push((field_ident.name, assign_rhs)); . } . . // also set first instance of error for help message 3 ( 0.00%) if first_assign.is_none() { . first_assign = Some(consecutive_statement); . } . } . // interrupt if no field was assigned, since we only want to look at consecutive statements . else { . break; . } . } . . // if there are incorrectly assigned fields, do a span_lint_and_note to suggest . // construction using `Ty { fields, ..Default::default() }` 9 ( 0.00%) if !assigned_fields.is_empty() && !cancel_lint { . // if all fields of the struct are not assigned, add `.. Default::default()` to the suggestion. . let ext_with_default = !variant . .fields . .iter() . .all(|field| assigned_fields.iter().any(|(a, _)| a == &field.name)); . 3 ( 0.00%) let mut app = Applicability::Unspecified; 3 ( 0.00%) let field_list = assigned_fields . .into_iter() 3 ( 0.00%) .map(|(field, rhs)| { . // extract and store the assigned value for help message 18 ( 0.00%) let value_snippet = snippet_with_context(cx, rhs.span, init_ctxt, "..", &mut app).0; 24 ( 0.00%) format!("{field}: {value_snippet}") . }) . .collect::>() 9 ( 0.00%) .join(", "); 336 ( 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::> (3x) . . // give correct suggestion if generics are involved (see #6944) 6 ( 0.00%) let binding_type = if let ty::Adt(adt_def, args) = binding_type.kind() 9 ( 0.00%) && !args.is_empty() . { . let adt_def_ty_name = cx.tcx.item_name(adt_def.did()); . let generic_args = args.iter().collect::>(); . let tys_str = generic_args . .iter() . .map(ToString::to_string) . .collect::>() . .join(", "); . format!("{adt_def_ty_name}::<{tys_str}>") . } else { . binding_type.to_string() . }; . 6 ( 0.00%) let sugg = if ext_with_default { 3 ( 0.00%) if field_list.is_empty() { . format!("{binding_type}::default()") . } else { 18 ( 0.00%) format!("{binding_type} {{ {field_list}, ..Default::default() }}") . } . } else { . format!("{binding_type} {{ {field_list} }}") . }; . . // span lint once per statement that binds default . span_lint_and_note( . cx, . FIELD_REASSIGN_WITH_DEFAULT, 6 ( 0.00%) first_assign.unwrap().span, . "field assignment outside of initializer for an instance created with Default::default()", 9 ( 0.00%) Some(local.span), 12 ( 0.00%) format!("consider initializing the variable with `{sugg}` and removing relevant reassignments"), . ); . self.reassigned_linted.insert(span); . } 6 ( 0.00%) } 174,336 ( 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>)> { 24 ( 0.00%) if let StmtKind::Semi(later_expr) = this.kind . // only take assignments 17 ( 0.00%) && 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 . // the same binding as the previous statement 9 ( 0.00%) && let ExprKind::Field(binding, field_ident) = assign_lhs.kind 15 ( 0.00%) && let ExprKind::Path(QPath::Resolved(_, path)) = binding.kind 6 ( 0.00%) && let Some(second_binding_name) = path.segments.last() 3 ( 0.00%) && second_binding_name.ident.name == binding_name . { 3 ( 0.00%) Some((field_ident, assign_rhs)) . } else { . None . } . } . . /// Returns whether `expr` is the update syntax base: `Foo { a: 1, .. base }` 976 ( 0.00%) fn is_update_syntax_base<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) -> bool { 1,464 ( 0.00%) if let Some(parent) = get_parent_expr(cx, expr) 64,134 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (488x) 56 ( 0.00%) && let ExprKind::Struct(_, _, StructTailExpr::Base(base)) = parent.kind . { . base.hir_id == expr.hir_id . } else { . false . } 976 ( 0.00%) } 107,593 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/types/option_option.rs -------------------------------------------------------------------------------- Ir -- line 4 ---------------------------------------- . use clippy_utils::source::snippet; . use rustc_hir::def_id::DefId; . use rustc_hir::{self as hir, QPath}; . use rustc_lint::LateContext; . use rustc_span::symbol::sym; . . use super::OPTION_OPTION; . 99,720 ( 0.00%) pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, qpath: &QPath<'_>, def_id: DefId) -> bool { 58,170 ( 0.00%) if cx.tcx.is_diagnostic_item(sym::Option, def_id) 473,538 ( 0.00%) => ???:::is_diagnostic_item (8,310x) 780 ( 0.00%) && let Some(arg) = qpath_generic_tys(qpath).next() 7,410 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::qpath_generic_tys (390x) . && arg.basic_res().opt_def_id() == Some(def_id) . { . span_lint_and_then( . cx, . OPTION_OPTION, . hir_ty.span, . // use just `T` here, as the inner type is not what's problematic . "use of `Option>`", -- line 22 ---------------------------------------- -- line 29 ---------------------------------------- . "consider using `{inner_opt}`, or a custom enum if you need to distinguish all 3 cases" . )); . }, . ); . true . } else { . false . } 58,170 ( 0.00%) } 8,700 ( 0.00%) -------------------------------------------------------------------------------- -- 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 { 2,422,280 ( 0.02%) 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. 1,228,051 ( 0.01%) if let Some(macro_call) = matching_root_macro_call(cx, expr.span, sym::format_macro) 60,443,663 ( 0.50%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::matching_root_macro_call (242,228x) 17,329 ( 0.00%) && first_node_in_macro(cx, expr).is_some_and(|p_expn| p_expn != macro_call.expn) 248,028 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::first_node_in_macro:: (5,637x) 1,672 ( 0.00%) && let Some(format_args) = self.format_args.get(cx, expr, macro_call.expn) 635,934 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:::get (209x) . { 209 ( 0.00%) let mut applicability = Applicability::MachineApplicable; . let call_site = macro_call.span; . . match (format_args.arguments.all_args(), &format_args.template[..]) { 720 ( 0.00%) ([], []) => span_useless_format_empty(cx, call_site, "String::new()".to_owned(), applicability), . ([], [_]) => { . // Simulate macro expansion, converting {{ and }} to { and }. 16 ( 0.00%) let Some(snippet) = format_args.span.get_text(cx) else { . return; . }; 40 ( 0.00%) let s_expand = snippet.replace("{{", "{").replace("}}", "}"); 2,782 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/str.rs:::replace::<&str> (4x) 50 ( 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 (2x) 6 ( 0.00%) let sugg = format!("{s_expand}.to_string()"); . span_useless_format(cx, call_site, sugg, applicability); . }, 120 ( 0.00%) ([arg], [piece]) => { 32 ( 0.00%) if let Some(value) = find_format_arg_expr(expr, arg) 10,296 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::find_format_arg_expr (8x) 16 ( 0.00%) && let FormatArgsPiece::Placeholder(placeholder) = piece 8 ( 0.00%) && placeholder.format_trait == FormatTrait::Display 21 ( 0.00%) && placeholder.format_options == FormatOptions::default() 135 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/format.rs:::eq (3x) 3 ( 0.00%) && match cx.typeck_results().expr_ty(value).peel_refs().kind() { 120 ( 0.00%) => ???:::expr_ty (3x) 9 ( 0.00%) ty::Adt(adt, _) => Some(adt.did()) == cx.tcx.lang_items().string(), 120 ( 0.00%) => ???:::lang_items (3x) . ty::Str => true, . _ => false, . } . { . let is_new_string = match value.kind { . ExprKind::Binary(..) => true, . ExprKind::MethodCall(path, ..) => path.ident.name == sym::to_string, . _ => false, -- line 93 ---------------------------------------- -- line 101 ---------------------------------------- . format!("{}.to_string()", sugg.maybe_paren()) . }; . span_useless_format(cx, call_site, sugg, applicability); . } . }, . _ => {}, . } . } 1,937,824 ( 0.02%) } . } . . 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!`", . "consider using `String::new()`", . sugg, . applicability, . ); . } . . fn span_useless_format(cx: &LateContext<'_>, span: Span, sugg: String, applicability: Applicability) { 26 ( 0.00%) span_lint_and_sugg( 579,690 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_sugg:: (2x) . cx, . USELESS_FORMAT, . span, . "useless use of `format!`", . "consider using `.to_string()`", . sugg, . applicability, . ); -- line 133 ---------------------------------------- 242,247 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memchr-2.8.2/src/arch/generic/memchr.rs -------------------------------------------------------------------------------- Ir -- line 163 ---------------------------------------- . // Search a possibly unaligned chunk at `start`. This covers any part . // of the haystack prior to where aligned loads can start. . if let Some(cur) = self.search_chunk(start, topos) { . return Some(cur); . } . // Set `cur` to the first V-aligned pointer greater than `start`. . let mut cur = start.add(V::BYTES - (start.as_usize() & V::ALIGN)); . debug_assert!(cur > start && end.sub(V::BYTES) >= start); 34,045 ( 0.00%) if len >= Self::LOOP_SIZE { 76 ( 0.00%) while cur <= end.sub(Self::LOOP_SIZE) { . debug_assert_eq!(0, cur.as_usize() % V::BYTES); . . let a = V::load_aligned(cur); . let b = V::load_aligned(cur.add(1 * V::BYTES)); . let c = V::load_aligned(cur.add(2 * V::BYTES)); . let d = V::load_aligned(cur.add(3 * V::BYTES)); . let eqa = self.v1.cmpeq(a); . let eqb = self.v1.cmpeq(b); . let eqc = self.v1.cmpeq(c); . let eqd = self.v1.cmpeq(d); . let or1 = eqa.or(eqb); . let or2 = eqc.or(eqd); . let or3 = or1.or(or2); 57 ( 0.00%) if or3.movemask_will_have_non_zero() { . let mask = eqa.movemask(); . if mask.has_non_zero() { . return Some(cur.add(topos(mask))); . } . . let mask = eqb.movemask(); . if mask.has_non_zero() { . return Some(cur.add(1 * V::BYTES).add(topos(mask))); -- line 194 ---------------------------------------- -- line 204 ---------------------------------------- . return Some(cur.add(3 * V::BYTES).add(topos(mask))); . } . cur = cur.add(Self::LOOP_SIZE); . } . } . // Handle any leftovers after the aligned loop above. We use unaligned . // loads here, but I believe we are guaranteed that they are aligned . // since `cur` is aligned. 28,688 ( 0.00%) while cur <= end.sub(V::BYTES) { . debug_assert!(end.distance(cur) >= V::BYTES); . if let Some(cur) = self.search_chunk(cur, topos) { . return Some(cur); . } . cur = cur.add(V::BYTES); . } . // Finally handle any remaining bytes less than the size of V. In this . // case, our pointer may indeed be unaligned and the load may overlap . // with the previous one. But that's okay since we know the previous . // load didn't lead to a match (otherwise we wouldn't be here). 16,526 ( 0.00%) if cur < end { . debug_assert!(end.distance(cur) < V::BYTES); . cur = cur.sub(V::BYTES - end.distance(cur)); . debug_assert_eq!(end.distance(cur), V::BYTES); . return self.search_chunk(cur, topos); . } . None . } . -- line 231 ---------------------------------------- -- line 415 ---------------------------------------- . #[inline(always)] . unsafe fn search_chunk( . &self, . cur: *const u8, . mask_to_offset: impl Fn(V::Mask) -> usize, . ) -> Option<*const u8> { . let chunk = V::load_unaligned(cur); . let mask = self.v1.cmpeq(chunk).movemask(); 45,772 ( 0.00%) if mask.has_non_zero() { . Some(cur.add(mask_to_offset(mask))) . } else { . None . } . } . } . . /// Finds all occurrences of two bytes in a haystack. -- line 431 ---------------------------------------- -- line 1147 ---------------------------------------- . #[inline(always)] . pub(crate) unsafe fn fwd_byte_by_byte bool>( . start: *const u8, . end: *const u8, . confirm: F, . ) -> Option<*const u8> { . debug_assert!(start <= end); . let mut ptr = start; 18,059 ( 0.00%) while ptr < end { . if confirm(*ptr) { . return Some(ptr); . } . ptr = ptr.offset(1); . } . None . } . -- line 1163 ---------------------------------------- 35,440 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/serde_api.rs -------------------------------------------------------------------------------- Ir -- line 19 ---------------------------------------- . pub SERDE_API_MISUSE, . correctness, . "various things that will negatively affect your serde experience" . } . . declare_lint_pass!(SerdeApi => [SERDE_API_MISUSE]); . . impl<'tcx> LateLintPass<'tcx> for SerdeApi { 41,566 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) { 14,050 ( 0.00%) if let ItemKind::Impl(Impl { . of_trait: Some(of_trait), 3,822 ( 0.00%) items, . .. 4,348 ( 0.00%) }) = item.kind . { 3,822 ( 0.00%) let did = of_trait.trait_ref.path.res.def_id(); . if paths::SERDE_DE_VISITOR.matches(cx, did) { . let mut seen_str = None; . let mut seen_string = None; . for item in items { . match cx.tcx.item_name(item.owner_id) { . sym::visit_str => seen_str = Some(cx.tcx.def_span(item.owner_id)), . sym::visit_string => seen_string = Some(cx.tcx.def_span(item.owner_id)), . _ => {}, -- line 42 ---------------------------------------- -- line 49 ---------------------------------------- . cx, . SERDE_API_MISUSE, . span, . "you should not implement `visit_string` without also implementing `visit_str`", . ); . } . } . } 47,504 ( 0.00%) } . } 1,911 ( 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 484,456 ( 0.00%) if let ExprKind::Index(array, index, _) = &expr.kind 1,784 ( 0.00%) && (!self.suppress_restriction_lint_in_const || !cx.tcx.hir_is_inside_const_context(expr.hir_id)) 4,460 ( 0.00%) && let expr_ty = cx.typeck_results().expr_ty(array) 35,848 ( 0.00%) => ???:::expr_ty (892x) . && 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) . }) 1,396 ( 0.00%) && !is_from_proc_macro(cx, expr) . { 3,490 ( 0.00%) let note = "the suggestion might not be applicable in constant blocks"; 1,396 ( 0.00%) let ty = cx.typeck_results().expr_ty(array).peel_refs(); 28,088 ( 0.00%) => ???:::expr_ty (698x) 1,396 ( 0.00%) let allowed_in_tests = self.allow_indexing_slicing_in_tests && is_in_test(cx.tcx, expr.hir_id); 4,442 ( 0.00%) if let Some(range) = higher::Range::hir(cx, index) { 82,150 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (698x) . // Ranged indexes, i.e., &x[n..m], &x[n..], &x[..n] and &x[..] 254 ( 0.00%) if let ty::Array(_, s) = ty.kind() { 105 ( 0.00%) let size: u128 = if let Some(size) = s.try_to_target_usize(cx.tcx) { . size.into() . } else { . return; . }; . 280 ( 0.00%) let const_range = to_const_range(cx, range, size); 6,780 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/indexing_slicing.rs:clippy_lints::indexing_slicing::to_const_range (35x) . 70 ( 0.00%) if let (Some(start), _) = const_range 99 ( 0.00%) && start > size . { . span_lint( . cx, . OUT_OF_BOUNDS_INDEXING, . range.start.map_or(expr.span, |start| start.span), . "range is out of bounds", . ); . return; . } . 70 ( 0.00%) if let (_, Some(end)) = const_range 124 ( 0.00%) && end > size . { . span_lint( . cx, . OUT_OF_BOUNDS_INDEXING, . range.end.map_or(expr.span, |end| end.span), . "range is out of bounds", . ); . return; -- line 159 ---------------------------------------- -- 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; . } . } . 519 ( 0.00%) let help_msg = match (range.start, range.end) { 104 ( 0.00%) (None, Some(_)) => "consider using `.get(..n)`or `.get_mut(..n)` instead", 51 ( 0.00%) (Some(_), None) => "consider using `.get(n..)` or .get_mut(n..)` instead", 160 ( 0.00%) (Some(_), Some(_)) => "consider using `.get(n..m)` or `.get_mut(n..m)` instead", . (None, None) => return, // [..] is ok. . }; . 166 ( 0.00%) if allowed_in_tests { . return; . } . 1,079 ( 0.00%) span_lint_and_then(cx, INDEXING_SLICING, expr.span, "slicing may panic", |diag| { 124,968 ( 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}> (83x) . 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] 1,142 ( 0.00%) if let ty::Array(..) = ty.kind() { . // Index is a const block. 210 ( 0.00%) if let ExprKind::ConstBlock(..) = index.kind { . return; . } . // Index is a constant uint. 945 ( 0.00%) if let Some(constant) = ConstEvalCtxt::new(cx).eval(index) { 16,614 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval (105x) 5,880 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::new (105x) . // only `usize` index is legal in rust array index . // leave other type to rustc 352 ( 0.00%) if let Constant::Int(off) = constant . && off <= usize::MAX as u128 352 ( 0.00%) && let ty::Uint(utype) = cx.typeck_results().expr_ty(index).kind() 3,520 ( 0.00%) => ???:::expr_ty (88x) 88 ( 0.00%) && *utype == ty::UintTy::Usize 176 ( 0.00%) && let ty::Array(_, s) = ty.kind() 352 ( 0.00%) && let Some(size) = s.try_to_target_usize(cx.tcx) . { . // get constant offset and check whether it is in bounds . let off = usize::try_from(off).unwrap(); . let size = usize::try_from(size).unwrap(); . . if off >= size { . 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; 88 ( 0.00%) } 2,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:: (88x) . } . 966 ( 0.00%) if allowed_in_tests { . return; . } . 6,762 ( 0.00%) span_lint_and_then(cx, INDEXING_SLICING, expr.span, "indexing may panic", |diag| { 951,485 ( 0.01%) => /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}> (483x) . 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); . } . }); . } . } 1,937,824 ( 0.02%) } . } . . /// 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. 420 ( 0.00%) fn to_const_range(cx: &LateContext<'_>, range: higher::Range<'_>, array_size: u128) -> (Option, Option) { 35 ( 0.00%) let ecx = ConstEvalCtxt::new(cx); 1,960 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::new (35x) 45 ( 0.00%) let s = range.start.map(|expr| ecx.eval(expr)); 1,394 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval (10x) 70 ( 0.00%) let start = match s { 24 ( 0.00%) Some(Some(Constant::Int(x))) => Some(x), . Some(_) => None, . None => Some(0), . }; . 43 ( 0.00%) let e = range.end.map(|expr| ecx.eval(expr)); 1,160 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval (8x) 52 ( 0.00%) let end = match e { 8 ( 0.00%) Some(Some(Constant::Int(x))) => { 16 ( 0.00%) if range.ty.limits() == RangeLimits::Closed { . Some(x + 1) . } else { . Some(x) . } . }, . Some(_) => None, . None => Some(array_size), . }; . 350 ( 0.00%) (start, end) 280 ( 0.00%) } . . /// 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 { 1,354 ( 0.00%) if let ty::Adt(_, _) = array_ty.kind() 1,988 ( 0.00%) && let Some(get_output_ty) = get_adt_inherent_method(cx, ty, sym::get).map(|m| { 647,736 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::get_adt_inherent_method (497x) . cx.tcx 580 ( 0.00%) .fn_sig(m.def_id) . .skip_binder() . .output() . .skip_binder() . }) 580 ( 0.00%) && let ty::Adt(def, args) = get_output_ty.kind() 2,030 ( 0.00%) && cx.tcx.is_diagnostic_item(sym::Option, def.0.did) 29,870 ( 0.00%) => ???:::is_diagnostic_item (290x) 290 ( 0.00%) && let Some(option_generic_param) = args.first() 870 ( 0.00%) && let generic_ty = option_generic_param.expect_ty().peel_refs() 1,450 ( 0.00%) => ???:::expect_ty (290x) . // FIXME: ideally this would handle type params and projections properly, for now just assume it's the same type 870 ( 0.00%) && (cx.typeck_results().expr_ty(index_expr).peel_refs() == generic_ty.peel_refs() 11,600 ( 0.00%) => ???:::expr_ty (290x) . || matches!(generic_ty.peel_refs().kind(), ty::Param(_) | ty::Alias(_, _))) . { . true . } else { . false . } . } 17,045 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/matches/infallible_destructuring_match.rs -------------------------------------------------------------------------------- Ir -- line 3 ---------------------------------------- . use clippy_utils::source::snippet_with_applicability; . use clippy_utils::{peel_blocks, strip_pat_refs}; . use rustc_errors::Applicability; . use rustc_hir::{ExprKind, LetStmt, MatchSource, PatKind, QPath}; . use rustc_lint::LateContext; . . use super::INFALLIBLE_DESTRUCTURING_MATCH; . 140,420 ( 0.00%) pub(crate) fn check(cx: &LateContext<'_>, local: &LetStmt<'_>) -> bool { . // turn this: . // . // let local = match target { . // Variant(binding arg) => { arg } . // }; . // . // into this: . // . // let Variant(binding local) = target; 40,120 ( 0.00%) if !local.span.from_expansion() 45,666 ( 0.00%) && let Some(expr) = local.init 31,033 ( 0.00%) && let ExprKind::Match(target, [arm], MatchSource::Normal) = expr.kind 1 ( 0.00%) && arm.guard.is_none() 3 ( 0.00%) && let PatKind::TupleStruct(QPath::Resolved(None, variant_name), [arg_lhs], _) = arm.pat.kind . && let PatKind::Binding(binding, arg_lhs, ..) = strip_pat_refs(arg_lhs).kind . && let arg_rhs = peel_blocks(arm.body) . && Some(arg_lhs) == arg_rhs.res_local_id() . { . let mut applicability = Applicability::MachineApplicable; . span_lint_and_sugg( . cx, . INFALLIBLE_DESTRUCTURING_MATCH, -- line 33 ---------------------------------------- -- line 41 ---------------------------------------- . snippet_with_applicability(cx, local.pat.span, "..", &mut applicability), . snippet_with_applicability(cx, target.span, "..", &mut applicability), . ), . applicability, . ); . return true; . } . false 160,480 ( 0.00%) } 20,060 ( 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 34 ---------------------------------------- . #[stable(feature = "rust1", since = "1.0.0")] . impl<'a> Iterator for Chars<'a> { . type Item = char; . . #[inline] . fn next(&mut self) -> Option { . // SAFETY: `str` invariant says `self.iter` is a valid UTF-8 string and . // the resulting `ch` is a valid Unicode Scalar Value. 32 ( 0.00%) unsafe { next_code_point(&mut self.iter).map(|ch| char::from_u32_unchecked(ch)) } 320 ( 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:core::str::validations::next_code_point::> (32x) . } . . #[inline] . fn count(self) -> usize { . super::count::count_chars(self.as_str()) . } . . #[inline] 24 ( 0.00%) fn advance_by(&mut self, mut remainder: usize) -> Result<(), NonZero> { . const CHUNK_SIZE: usize = 32; . 48 ( 0.00%) if remainder >= CHUNK_SIZE { . let mut chunks = self.iter.as_slice().as_chunks::().0.iter(); . let mut bytes_skipped: usize = 0; . . while remainder > CHUNK_SIZE . && let Some(chunk) = chunks.next() . { . bytes_skipped += CHUNK_SIZE; . -- line 62 ---------------------------------------- -- line 79 ---------------------------------------- . if !super::validations::utf8_is_cont_byte(b) { . break; . } . // SAFETY: We just peeked at the byte, therefore it exists . unsafe { self.iter.advance_by(1).unwrap_unchecked() }; . } . } . 1,184 ( 0.00%) while (remainder > 0) && (self.iter.len() > 0) { . remainder -= 1; 284 ( 0.00%) let b = self.iter.as_slice()[0]; . let slurp = super::validations::utf8_char_width(b); . // SAFETY: utf8 validity requires that the string must contain . // the continuation bytes (if any) . unsafe { self.iter.advance_by(slurp).unwrap_unchecked() }; . } . . NonZero::new(remainder).map_or(Ok(()), Err) 24 ( 0.00%) } . . #[inline] . fn size_hint(&self) -> (usize, Option) { . let len = self.iter.len(); . (len.div_ceil(4), Some(len)) . } . . #[inline] -- line 105 ---------------------------------------- -- 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(); 247,990 ( 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> { 10,987 ( 0.00%) self.0.next_back() 681,323 ( 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:>::next_back (10,974x) . } . } . . $(#[$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 { 3,322 ( 0.00%) self.finished = true; . 2,643 ( 0.00%) if self.allow_trailing_empty || self.end - self.start > 0 { . // SAFETY: `self.start` and `self.end` always lie on unicode boundaries. 539 ( 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> { 24,862 ( 0.00%) if self.finished { . return None; . } . 4,053 ( 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 { 344 ( 0.00%) let elt = haystack.get_unchecked(self.start..a); 351 ( 0.00%) self.start = b; . Some(elt) 335 ( 0.00%) }, 1,585 ( 0.00%) None => self.get_end(), . } . } . . #[inline] . fn next_inclusive(&mut self) -> Option<&'a str> { 140,676 ( 0.00%) if self.finished { . return None; . } . 2,580 ( 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 { 1,068 ( 0.00%) let elt = haystack.get_unchecked(self.start..b); 1,068 ( 0.00%) self.start = b; . Some(elt) 1,068 ( 0.00%) }, 9,062 ( 0.00%) None => self.get_end(), . } . } . . #[inline] 76,909 ( 0.00%) fn next_back(&mut self) -> Option<&'a str> . where . P::Searcher<'a>: ReverseSearcher<'a>, . { 21,974 ( 0.00%) if self.finished { . return None; . } . 11,032 ( 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; . } . } . } . } . 16,548 ( 0.00%) 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 { 33 ( 0.00%) let elt = haystack.get_unchecked(b..self.end); 33 ( 0.00%) self.end = a; . Some(elt) . }, . // SAFETY: `self.start` and `self.end` always lie on unicode boundaries. . None => unsafe { 5,483 ( 0.00%) self.finished = true; 10,966 ( 0.00%) Some(haystack.get_unchecked(self.start..self.end)) . }, . } 87,929 ( 0.00%) } . . #[inline] . fn next_back_inclusive(&mut self) -> Option<&'a str> . where . P::Searcher<'a>: ReverseSearcher<'a>, . { . if self.finished { . return None; -- line 737 ---------------------------------------- -- line 1053 ---------------------------------------- . f.debug_tuple("MatchIndicesInternal").field(&self.0).finish() . } . } . . impl<'a, P: Pattern> MatchIndicesInternal<'a, P> { . #[inline] . fn next(&mut self) -> Option<(usize, &'a str)> { . self.0 12 ( 0.00%) .next_match() 1,082 ( 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 (4x) . // SAFETY: `Searcher` guarantees that `start` and `end` lie on unicode boundaries. . .map(|(start, end)| unsafe { (start, self.0.haystack().get_unchecked(start..end)) }) . } . . #[inline] . fn next_back(&mut self) -> Option<(usize, &'a str)> . where . P::Searcher<'a>: ReverseSearcher<'a>, -- line 1069 ---------------------------------------- -- 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] 10,584 ( 0.00%) fn next(&mut self) -> Option<&'a str> { . self.0.next() 13,608 ( 0.00%) } . . #[inline] . fn size_hint(&self) -> (usize, Option) { . self.0.size_hint() . } . . #[inline] . fn last(mut self) -> Option<&'a str> { -- line 1179 ---------------------------------------- 222,492 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/ptr/ptr_eq.rs -------------------------------------------------------------------------------- Ir -- line 3 ---------------------------------------- . use clippy_utils::std_or_core; . use clippy_utils::sugg::Sugg; . use rustc_errors::Applicability; . use rustc_hir::{BinOpKind, Expr, ExprKind}; . use rustc_lint::LateContext; . use rustc_middle::ty::{self, Ty}; . use rustc_span::Span; . 43,485 ( 0.00%) pub(super) fn check<'tcx>( . cx: &LateContext<'tcx>, . op: BinOpKind, . left: &'tcx Expr<'_>, . right: &'tcx Expr<'_>, . span: Span, . ) { . if span.from_expansion() { . return; . } . . // Remove one level of usize conversion if any 4,080 ( 0.00%) let (left, right, usize_peeled) = match (expr_as_cast_to_usize(cx, left), expr_as_cast_to_usize(cx, right)) { . (Some(lhs), Some(rhs)) => (lhs, rhs, true), . _ => (left, right, false), . }; . . // This lint concerns raw pointers 16,320 ( 0.00%) let (left_ty, right_ty) = (cx.typeck_results().expr_ty(left), cx.typeck_results().expr_ty(right)); 163,248 ( 0.00%) => ???:::expr_ty (4,080x) 2,040 ( 0.00%) if !left_ty.is_raw_ptr() || !right_ty.is_raw_ptr() { . return; . } . . let ((left_var, left_casts_peeled), (right_var, right_casts_peeled)) = . (peel_raw_casts(cx, left, left_ty), peel_raw_casts(cx, right, right_ty)); . . if !(usize_peeled || left_casts_peeled || right_casts_peeled) { . return; -- line 38 ---------------------------------------- -- line 50 ---------------------------------------- . PTR_EQ, . span, . format!("use `{top_crate}::ptr::eq` when comparing raw pointers"), . "try", . format!("{invert}{top_crate}::ptr::eq({left_snip}, {right_snip})"), . app, . ); . } 23,192 ( 0.00%) } . . // If the given expression is a cast to a usize, return the lhs of the cast . // E.g., `foo as *const _ as usize` returns `foo as *const _`. . fn expr_as_cast_to_usize<'tcx>(cx: &LateContext<'tcx>, cast_expr: &'tcx Expr<'_>) -> Option<&'tcx Expr<'tcx>> { 8,160 ( 0.00%) if !cast_expr.span.from_expansion() 18,428 ( 0.00%) && cx.typeck_results().expr_ty(cast_expr) == cx.tcx.types.usize 163,248 ( 0.00%) => ???:::expr_ty (4,080x) . && let ExprKind::Cast(expr, _) = cast_expr.kind . { . Some(expr) . } else { . None . } . } . -- line 72 ---------------------------------------- 2,040 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/methods/manual_c_str_literals.rs -------------------------------------------------------------------------------- Ir -- line 55 ---------------------------------------- . }, . ); . } . } . . /// Checks if the callee is a "relevant" `CStr` function considered by this lint. . /// Returns the function name. . fn is_c_str_function(cx: &LateContext<'_>, func: &Expr<'_>) -> Option { 67,140 ( 0.00%) if let ExprKind::Path(QPath::TypeRelative(cstr, fn_name)) = &func.kind 39,051 ( 0.00%) && let TyKind::Path(QPath::Resolved(_, ty_path)) = &cstr.kind 14,766 ( 0.00%) && cx.tcx.lang_items().c_str() == ty_path.res.opt_def_id() 295,320 ( 0.00%) => ???:::lang_items (7,383x) . { . Some(fn_name.ident.name) . } else { . None . } . } . . /// Checks calls to the `CStr` constructor functions: . /// - `CStr::from_bytes_with_nul(..)` . /// - `CStr::from_bytes_with_nul_unchecked(..)` . /// - `CStr::from_ptr(..)` 117,502 ( 0.00%) pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, func: &Expr<'_>, args: &[Expr<'_>], msrv: Msrv) { . if let Some(fn_name) = is_c_str_function(cx, func) . && let [arg] = args . && cx.tcx.sess.edition() >= Edition2021 . && msrv.meets(cx, msrvs::C_STR_LITERALS) . { . match fn_name { . sym::from_bytes_with_nul | sym::from_bytes_with_nul_unchecked . if !arg.span.from_expansion() -- line 85 ---------------------------------------- -- line 87 ---------------------------------------- . && let LitKind::ByteStr(_, StrStyle::Cooked) | LitKind::Str(_, StrStyle::Cooked) = lit.node => . { . check_from_bytes(cx, expr, arg, lit.node, fn_name); . }, . sym::from_ptr => check_from_ptr(cx, expr, arg), . _ => {}, . } . } 134,288 ( 0.00%) } . . /// Checks `CStr::from_ptr(b"foo\0".as_ptr().cast())` . fn check_from_ptr(cx: &LateContext<'_>, expr: &Expr<'_>, arg: &Expr<'_>) { . if let ExprKind::MethodCall(method, lit, [], _) = peel_ptr_cast(arg).kind . && method.ident.name == sym::as_ptr . && !lit.span.from_expansion() . && let ExprKind::Lit(lit) = lit.kind . && let LitKind::ByteStr(_, StrStyle::Cooked) = lit.node -- line 103 ---------------------------------------- 59,064 ( 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/count.rs -------------------------------------------------------------------------------- Ir -- line 20 ---------------------------------------- . . use core::intrinsics::unlikely; . . const USIZE_SIZE: usize = size_of::(); . const UNROLL_INNER: usize = 4; . . #[inline] . pub(super) fn count_chars(s: &str) -> usize { 70,378 ( 0.00%) if cfg!(feature = "optimize_for_size") || s.len() < USIZE_SIZE * UNROLL_INNER { . // Avoid entering the optimized implementation for strings where the . // difference is not likely to matter, or where it might even be slower. . // That said, a ton of thought was not spent on the particular threshold . // here, beyond "this value seems to make sense". 91,374 ( 0.00%) char_count_general_case(s.as_bytes()) 1,119 ( 0.00%) => ???:core::str::count::char_count_general_case (12x) . } else { 12,150 ( 0.00%) do_count_chars(s) 15,594 ( 0.00%) => ???:core::str::count::do_count_chars (76x) . } . } . . fn do_count_chars(s: &str) -> usize { . // For correctness, `CHUNK_SIZE` must be: . // . // - Less than or equal to 255, otherwise we'll overflow bytes in `counts`. . // - A multiple of `UNROLL_INNER`, otherwise our `break` inside the -- line 43 ---------------------------------------- 34,636 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/memchr-2.8.2/src/arch/x86_64/avx2/memchr.rs -------------------------------------------------------------------------------- Ir -- line 176 ---------------------------------------- . /// Note that callers may pass a pair of pointers such that `start >= end`. . /// In that case, `None` will always be returned. . #[inline] . pub unsafe fn find_raw( . &self, . start: *const u8, . end: *const u8, . ) -> Option<*const u8> { 22,118 ( 0.00%) if start >= end { . return None; . } . let len = end.distance(start); 18,420 ( 0.00%) if len < __m256i::BYTES { 4,802 ( 0.00%) return if len < __m128i::BYTES { . // SAFETY: We require the caller to pass valid start/end . // pointers. . generic::fwd_byte_by_byte(start, end, |b| { 25,668 ( 0.00%) b == self.sse2.needle1() . }) . } else { . // SAFETY: We require the caller to pass valid start/end . // pointers. . self.find_raw_sse2(start, end) . }; . } . // SAFETY: Building a `One` means it's safe to call both 'sse2' and -- line 201 ---------------------------------------- 35,487 ( 0.00%) -------------------------------------------------------------------------------- -- 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) { 21,267 ( 0.00%) param.uses = Vec::new(); 28,356 ( 0.00%) let key = (param.fn_id, param.idx); . self.by_fn.remove(&key); . // FIXME(rust/#120456) - is `swap_remove` correct? 14,178 ( 0.00%) self.by_id.swap_remove(&id); 785,490 ( 0.01%) => /rust/deps/indexmap-2.14.0/src/map.rs:>::swap_remove:: (7,089x) . } . } . . fn get_by_id_mut(&mut self, id: HirId) -> Option<&mut Param> { 318,980 ( 0.00%) self.params.get_mut(*self.by_id.get(&id)?) 1,550,066 ( 0.01%) => /rust/deps/indexmap-2.14.0/src/map.rs:>::get:: (79,732x) . } . . 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 { 21,408 ( 0.00%) self.try_disable_lint_for_param(param, &mut eval_stack); 49,952 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/only_used_in_recursion.rs:::try_disable_lint_for_param (7,136x) . } . } . . // Use by calling `flag_for_linting`. . fn try_disable_lint_for_param(&self, param: &Param, eval_stack: &mut Vec) -> bool { 14,272 ( 0.00%) if !param.apply_lint.get() { . true 7,136 ( 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 . } 7,136 ( 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 { 49,632 ( 0.00%) fn check_body(&mut self, cx: &LateContext<'tcx>, body: &Body<'tcx>) { 18,612 ( 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. 57,490 ( 0.00%) let (fn_id, fn_kind, skip_params) = match cx.tcx.parent_hir_node(body.value.hir_id) { 472,160 ( 0.00%) => ???:::parent_hir_node (4,061x) 2,732 ( 0.00%) Node::Item(i) => (i.owner_id.to_def_id(), FnKind::Fn, 0), . Node::TraitItem(&TraitItem { . kind: TraitItemKind::Fn(ref sig, _), 1,144 ( 0.00%) owner_id, . .. . }) => ( . owner_id.to_def_id(), . FnKind::TraitFn, . usize::from(sig.decl.implicit_self().has_implicit_self()), 286 ( 0.00%) ), . Node::ImplItem(&ImplItem { . kind: ImplItemKind::Fn(ref sig, _), 1,903 ( 0.00%) owner_id, 1,903 ( 0.00%) impl_kind, . .. . }) => { 6,975 ( 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); 1,274 ( 0.00%) let trait_ref = cx.tcx.impl_trait_ref(impl_id).instantiate_identity().skip_norm_wip(); 46,997 ( 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:: (637x) . ( . 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, . }; 7,110 ( 0.00%) body.params . .iter() . .enumerate() . .skip(skip_params) 28,760 ( 0.00%) .filter_map(|(idx, p)| match p.pat.kind { 71,544 ( 0.00%) PatKind::Binding(_, id, ident, None) if !ident.as_str().starts_with('_') => { 229,824 ( 0.00%) => ???:::as_str (7,182x) . Some((id, Param::new(fn_id, fn_kind, idx, ident))) . }, . _ => None, . }) . .for_each(|(id, param)| self.params.insert(param, id)); 3,555 ( 0.00%) if self.entered_body.is_none() { 7,062 ( 0.00%) self.entered_body = Some(body.value.hir_id); . } 49,632 ( 0.00%) } . 1,695,596 ( 0.01%) 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(); 7,141 ( 0.00%) let span = e.span; . let mut e = e; . loop { 48,220 ( 0.00%) match get_expr_use_or_unification_node(cx.tcx, e) { 1,582,944 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_expr_use_or_unification_node (7,618x) . None | Some((Node::Stmt(_), _)) => return, 83,745 ( 0.00%) Some((Node::Expr(parent), child_id)) => match parent.kind { . // Recursive call. Track which index the parameter is used in. 28 ( 0.00%) ExprKind::Call(callee, args) 42,837 ( 0.00%) if callee.res(cx).opt_def_id().is_some_and(|id| { 5,603 ( 0.00%) id == param.fn_id && has_matching_args(param.fn_kind, typeck.node_args(callee.hir_id)) 1,716 ( 0.00%) => ???:::node_args (44x) 20,300 ( 0.00%) }) => . { . if let Some(idx) = args.iter().position(|arg| arg.hir_id == child_id) { 13 ( 0.00%) param.uses.push(Usage::new(span, idx)); . } . return; . }, . ExprKind::MethodCall(_, receiver, args, _) 26,130 ( 0.00%) if typeck.type_dependent_def_id(parent.hir_id).is_some_and(|id| { 102,606 ( 0.00%) => ???:::type_dependent_def_id (2,010x) . 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; . }, . // Assignment to a parameter is fine. 80 ( 0.00%) ExprKind::Assign(lhs, _, _) | ExprKind::AssignOp(_, lhs, _) if lhs.hir_id == child_id => { . return; . }, . // Parameter update e.g. `x = x + 1` . ExprKind::Assign(lhs, rhs, _) | ExprKind::AssignOp(_, lhs, rhs) 32 ( 0.00%) 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) 1,672 ( 0.00%) if typeck.expr_ty(lhs).is_primitive() && typeck.expr_ty(rhs).is_primitive() => 16,720 ( 0.00%) => ???:::expr_ty (418x) . { . e = parent; . continue; . }, 355 ( 0.00%) ExprKind::Unary(_, arg) if typeck.expr_ty(arg).is_primitive() => { 2,840 ( 0.00%) => ???:::expr_ty (71x) . e = parent; . continue; . }, . ExprKind::AddrOf(..) | ExprKind::Cast(..) => { . e = parent; . continue; . }, . // Only allow field accesses without auto-deref -- line 423 ---------------------------------------- -- line 428 ---------------------------------------- . _ => (), . }, . _ => (), . } . self.params.remove_by_id(id); . return; . } . } 1,937,824 ( 0.02%) } . 43,428 ( 0.00%) fn check_body_post(&mut self, cx: &LateContext<'tcx>, body: &Body<'tcx>) { 3,864 ( 0.00%) if self.entered_body == Some(body.value.hir_id) { 3,531 ( 0.00%) self.entered_body = None; . self.params.flag_for_linting(); . for param in &self.params.params { 14,272 ( 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(); . } 49,632 ( 0.00%) } . } . . fn has_matching_args(kind: FnKind, args: GenericArgsRef<'_>) -> bool { 120 ( 0.00%) 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), . GenericArgKind::Const(c) => matches!(c.kind(), ConstKind::Param(c) if c.index as usize == idx), . }), 32 ( 0.00%) FnKind::ImplTraitFn(expected_args) => std::ptr::from_ref(args) as usize == expected_args, . } . } 132,434 ( 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_errors/src/diagnostic.rs -------------------------------------------------------------------------------- Ir -- line 129 ---------------------------------------- . self(dcx, level) . } . } . . /// Type used to emit diagnostic through a closure instead of implementing the `Diagnostic` trait. . pub struct DiagDecorator)>(pub F); . . impl<'a, F: FnOnce(&mut Diag<'_, ()>)> Diagnostic<'a, ()> for DiagDecorator { 22,490 ( 0.00%) fn into_diag(self, dcx: DiagCtxtHandle<'a>, level: Level) -> Diag<'a, ()> { . let mut diag = Diag::new(dcx, level, ""); 16,679 ( 0.00%) (self.0)(&mut diag); 7,721 ( 0.00%) diag 14,769 ( 0.00%) } . } . . /// Trait implemented by error types. This should not be implemented manually. Instead, use . /// `#[derive(Subdiagnostic)]` -- see [rustc_macros::Subdiagnostic]. . #[rustc_diagnostic_item = "Subdiagnostic"] . pub trait Subdiagnostic { . /// Add a subdiagnostic to an existing diagnostic. . fn add_to_diag(self, diag: &mut Diag<'_, G>); -- line 149 ---------------------------------------- -- line 296 ---------------------------------------- . /// With `-Ztrack_diagnostics` enabled, . /// we print where in rustc this error was emitted. . pub emitted_at: DiagLocation, . } . . impl DiagInner { . #[track_caller] . pub fn new>(level: Level, message: M) -> Self { 34,160 ( 0.00%) DiagInner::new_with_messages(level, vec![(message.into(), Style::NoStyle)]) 19,240 ( 0.00%) => ???:::new_with_messages (520x) . } . . #[track_caller] . pub fn new_with_messages(level: Level, messages: Vec<(DiagMessage, Style)>) -> Self { . DiagInner { . level, . lint_id: None, . messages, -- line 312 ---------------------------------------- -- line 358 ---------------------------------------- . Level::ForceWarning => { . assert!(self.is_lint.is_some()); . true . } . _ => false, . } . } . 9,955 ( 0.00%) pub(crate) fn sub(&mut self, level: Level, message: impl Into, span: MultiSpan) { 68,506 ( 0.00%) let sub = Subdiag { level, messages: vec![(message.into(), Style::NoStyle)], span }; 3,416 ( 0.00%) self.children.push(sub); 6,335 ( 0.00%) } . . pub(crate) fn arg(&mut self, name: impl Into, arg: impl IntoDiagArg) { . let name = name.into(); . let value = arg.into_diag_arg(&mut self.long_ty_path); . // This assertion is to avoid subdiagnostics overwriting an existing diagnostic arg. . debug_assert!( . !self.args.contains_key(&name) || self.args.get(&name) == Some(&value), . "arg {} already exists", -- line 377 ---------------------------------------- -- line 525 ---------------------------------------- . $(#[$attrs:meta])* . pub fn $f:ident(&mut $self:ident, $($name:ident: $ty:ty),* $(,)?) -> &mut Self { . $($body:tt)* . } . } => { . // The original function. . $(#[$attrs])* . #[doc = concat!("See [`Diag::", stringify!($f), "()`].")] 20,352 ( 0.00%) pub fn $f(&mut $self, $($name: $ty),*) -> &mut Self { . $($body)* 18,240 ( 0.00%) } . . // The `with_*` variant. . $(#[$attrs])* . #[doc = concat!("See [`Diag::", stringify!($f), "()`].")] . pub fn $with_f(mut $self, $($name: $ty),*) -> Self { . $self.$f($($name),*); . $self . } -- line 543 ---------------------------------------- -- line 554 ---------------------------------------- . pub fn with_dcx(mut self, dcx: DiagCtxtHandle<'_>) -> Diag<'_, G> { . Diag { dcx, diag: self.diag.take(), _marker: PhantomData } . } . . /// Creates a new `Diag` with an already constructed diagnostic. . #[track_caller] . pub(crate) fn new_diagnostic(dcx: DiagCtxtHandle<'a>, diag: DiagInner) -> Self { . debug!("Created new diagnostic"); 13,620 ( 0.00%) Self { dcx, diag: Some(Box::new(diag)), _marker: PhantomData } 23,790 ( 0.00%) => ???:0x0000000000173dc0 (366x) . } . . /// Delay emission of this diagnostic as a bug. . /// . /// This can be useful in contexts where an error indicates a bug but . /// typically this only happens when other compilation errors have already . /// happened. In those cases this can be used to defer emission of this . /// diagnostic as a bug in the compiler only if no other errors have been -- line 570 ---------------------------------------- -- line 716 ---------------------------------------- . StringPart::normal("`"), . ]); . self . } . . with_fn! { with_note, . /// Add a note attached to this diagnostic. . pub fn note(&mut self, msg: impl Into) -> &mut Self { 8 ( 0.00%) self.sub(Level::Note, msg, MultiSpan::new()); 402 ( 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:>::sub:: (4x) . self . } } . . pub fn highlighted_note(&mut self, msg: Vec) -> &mut Self { . self.sub_with_highlights(Level::Note, msg, MultiSpan::new()); . self . } . -- line 732 ---------------------------------------- -- line 748 ---------------------------------------- . with_fn! { with_span_note, . /// Prints the span with a note above it. . /// This is like [`Diag::note()`], but it gets its own span. . pub fn span_note( . &mut self, . sp: impl Into, . msg: impl Into, . ) -> &mut Self { 12 ( 0.00%) self.sub(Level::Note, msg, sp.into()); 468 ( 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:>::sub:: (3x) . self . } } . . /// Prints the span with a note above it. . /// This is like [`Diag::note_once()`], but it gets its own span. . pub fn span_note_once>( . &mut self, . sp: S, -- line 764 ---------------------------------------- -- line 784 ---------------------------------------- . ) -> &mut Self { . self.sub(Level::Warning, msg, sp.into()); . self . } . . with_fn! { with_help, . /// Add a help message attached to this diagnostic. . pub fn help(&mut self, msg: impl Into) -> &mut Self { 10,302 ( 0.00%) self.sub(Level::Help, msg, MultiSpan::new()); 502,014 ( 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:>::sub:: (3,416x) . self . } } . . /// This is like [`Diag::help()`], but it's only printed once. . pub fn help_once(&mut self, msg: impl Into) -> &mut Self { . self.sub(Level::OnceHelp, msg, MultiSpan::new()); . self . } -- line 800 ---------------------------------------- -- line 818 ---------------------------------------- . with_fn! { with_span_help, . /// Prints the span with some help above it. . /// This is like [`Diag::help()`], but it gets its own span. . pub fn span_help( . &mut self, . sp: impl Into, . msg: impl Into, . ) -> &mut Self { 11 ( 0.00%) self.sub(Level::Help, msg, sp.into()); 156 ( 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:>::sub:: (1x) . self . } } . . /// Disallow attaching suggestions to this diagnostic. . /// Any suggestions attached e.g. with the `span_suggestion_*` methods . /// (before and after the call to `disable_suggestions`) will be ignored. . pub fn disable_suggestions(&mut self) -> &mut Self { . self.suggestions = Suggestions::Disabled; -- line 834 ---------------------------------------- -- line 846 ---------------------------------------- . } . self . } . . /// Helper for pushing to `self.suggestions`. . /// . /// A new suggestion is added if suggestions are enabled for this diagnostic. . /// Otherwise, they are ignored. 19,912 ( 0.00%) fn push_suggestion(&mut self, suggestion: CodeSuggestion) { . for subst in &suggestion.substitutions { . for part in &subst.parts { 5,654 ( 0.00%) let span = part.span; 5,654 ( 0.00%) let call_site = span.ctxt().outer_expn_data().call_site; 22,616 ( 0.00%) if span.in_derive_expansion() && span.overlaps_or_adjacent(call_site) { 616,286 ( 0.01%) => ???:::in_derive_expansion (5,654x) . // Ignore if spans is from derive macro. . return; . } . } . } . 9,956 ( 0.00%) if let Suggestions::Enabled(suggestions) = &mut self.suggestions { . suggestions.push(suggestion); . } 19,912 ( 0.00%) } . . with_fn! { with_multipart_suggestion, . /// Show a suggestion that has multiple parts to it, always as its own subdiagnostic. . /// In other words, multiple changes need to be applied as part of this suggestion. . pub fn multipart_suggestion( . &mut self, . msg: impl Into, . suggestion: Vec<(Span, String)>, . applicability: Applicability, . ) -> &mut Self { 10,791 ( 0.00%) self.multipart_suggestion_with_style( 1,668 ( 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:>::multipart_suggestion_with_style::<&str> (1x) . msg, . suggestion, . applicability, . SuggestionStyle::ShowAlways, . ) . } } . . /// [`Diag::multipart_suggestion()`] but you can set the [`SuggestionStyle`]. 25,480 ( 0.00%) pub fn multipart_suggestion_with_style( . &mut self, . msg: impl Into, . mut suggestion: Vec<(Span, String)>, . applicability: Applicability, . style: SuggestionStyle, . ) -> &mut Self { . let mut seen = crate::FxHashSet::default(); 44,930 ( 0.00%) suggestion.retain(|(span, msg)| seen.insert((span.lo(), span.hi(), msg.clone()))); 292,889 ( 0.00%) => ???:::clone (5,126x) . 5,883 ( 0.00%) let parts = suggestion . .into_iter() . .map(|(span, snippet)| SubstitutionPart { snippet, span }) . .collect::>(); . 1,961 ( 0.00%) assert!(!parts.is_empty()); . debug_assert_eq!( . parts.iter().find(|part| part.span.is_empty() && part.snippet.is_empty()), . None, . "Span must not be empty and have no suggestion", . ); . debug_assert_eq!( . parts.array_windows().find(|[a, b]| a.span.overlaps(b.span)), . None, . "suggestion must not have overlapping parts", . ); . 25,454 ( 0.00%) self.push_suggestion(CodeSuggestion { 19,232 ( 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:>::push_suggestion (13x) 7,844 ( 0.00%) substitutions: vec![Substitution { parts }], 52 ( 0.00%) msg: msg.into(), . style, . applicability, . }); . self 15,688 ( 0.00%) } . . /// Prints out a message with for a multipart suggestion without showing the suggested code. . /// . /// This is intended to be used for suggestions that are obvious in what the changes need to . /// be from the message, showing the span label inline would be visually unpleasant . /// (marginally overlapping spans or multiline spans) and showing the snippet window wouldn't . /// improve understandability. . pub fn tool_only_multipart_suggestion( -- line 931 ---------------------------------------- -- line 962 ---------------------------------------- . /// See [`CodeSuggestion`] for more information. . pub fn span_suggestion( . &mut self, . sp: Span, . msg: impl Into, . suggestion: impl ToString, . applicability: Applicability, . ) -> &mut Self { 2,941 ( 0.00%) self.span_suggestion_with_style( 4,481 ( 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_suggestion_with_style:: (7x) . sp, . msg, . suggestion, . applicability, . SuggestionStyle::ShowCode, . ); . self . } } -- line 978 ---------------------------------------- -- line 986 ---------------------------------------- . suggestion: impl ToString, . applicability: Applicability, . style: SuggestionStyle, . ) -> &mut Self { . debug_assert!( . !(sp.is_empty() && suggestion.to_string().is_empty()), . "Span must not be empty and have no suggestion" . ); 6,178 ( 0.00%) self.push_suggestion(CodeSuggestion { 33,843 ( 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:>::push_suggestion (87x) 2,025 ( 0.00%) substitutions: vec![Substitution { 3,168 ( 0.00%) parts: vec![SubstitutionPart { snippet: suggestion.to_string(), span: sp }], . }], 1,764 ( 0.00%) msg: msg.into(), . style, . applicability, . }); . self . } } . . with_fn! { with_span_suggestion_verbose, . /// Always show the suggested change. . pub fn span_suggestion_verbose( . &mut self, . sp: Span, . msg: impl Into, . suggestion: impl ToString, . applicability: Applicability, . ) -> &mut Self { 330 ( 0.00%) self.span_suggestion_with_style( 639 ( 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_suggestion_with_style:: (1x) . sp, . msg, . suggestion, . applicability, . SuggestionStyle::ShowAlways, . ); . self . } } -- line 1022 ---------------------------------------- -- line 1185 ---------------------------------------- . pub fn subdiagnostic(&mut self, subdiagnostic: impl Subdiagnostic) -> &mut Self { . subdiagnostic.add_to_diag(self); . self . } . . with_fn! { with_span, . /// Add a span. . pub fn span(&mut self, sp: impl Into) -> &mut Self { 11,802 ( 0.00%) self.span = sp.into(); . if let Some(span) = self.span.primary_span() { 1,686 ( 0.00%) self.sort_span = span; . } . self . } } . . pub fn is_lint( . &mut self, . name: String, . has_future_breakage: bool, -- line 1203 ---------------------------------------- -- line 1222 ---------------------------------------- . ) -> &mut Self { . self.lint_id = Some(id); . self . } } . . with_fn! { with_primary_message, . /// Add a primary message. . pub fn primary_message(&mut self, msg: impl Into) -> &mut Self { 20,991 ( 0.00%) self.messages[0] = (msg.into(), Style::NoStyle); . self . } } . . with_fn! { with_arg, . /// Add an argument. . pub fn arg( . &mut self, . name: impl Into, -- line 1238 ---------------------------------------- -- line 1241 ---------------------------------------- . self.deref_mut().arg(name, arg); . self . } } . . /// Convenience function for internal use, clients should use one of the . /// public methods above. . /// . /// Used by `proc_macro_server` for implementing `server::Diagnostic`. 30,906 ( 0.00%) pub fn sub(&mut self, level: Level, message: impl Into, span: MultiSpan) { 19,367 ( 0.00%) self.deref_mut().sub(level, message, span); 78,003 ( 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:::sub::<&str> (520x) 27,472 ( 0.00%) } . . /// Convenience function for internal use, clients should use one of the . /// public methods above. . fn sub_with_highlights(&mut self, level: Level, messages: Vec, span: MultiSpan) { . let messages = messages.into_iter().map(|m| (m.content.into(), m.style)).collect(); . let sub = Subdiag { level, messages, span }; . self.children.push(sub); . } -- line 1259 ---------------------------------------- 56,344 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/crate_in_macro_def.rs -------------------------------------------------------------------------------- Ir -- line 48 ---------------------------------------- . pub CRATE_IN_MACRO_DEF, . suspicious, . "using `crate` in a macro definition" . } . . declare_lint_pass!(CrateInMacroDef => [CRATE_IN_MACRO_DEF]); . . impl EarlyLintPass for CrateInMacroDef { 14,988 ( 0.00%) fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) { 9,992 ( 0.00%) if let ItemKind::MacroDef(_, macro_def) = &item.kind . && item.attrs.iter().any(is_macro_export) 22 ( 0.00%) && let Some(span) = contains_unhygienic_crate_reference(¯o_def.body.tokens) 190,641 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/crate_in_macro_def.rs:clippy_lints::crate_in_macro_def::contains_unhygienic_crate_reference (4x) . { 26 ( 0.00%) span_lint_and_sugg( 496,974 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_sugg:: (2x) . cx, . CRATE_IN_MACRO_DEF, . span, . "`crate` references the macro call's crate", . "to reference the macro definition's crate, use", . String::from("$crate"), . Applicability::MachineApplicable, . ); . } 19,984 ( 0.00%) } . } . . fn is_macro_export(attr: &Attribute) -> bool { 34 ( 0.00%) if let AttrKind::Normal(normal) = &attr.kind 10 ( 0.00%) && let [segment] = normal.item.path.segments.as_slice() . { . segment.ident.name == sym::macro_export . } else { . false . } . } . 7,888 ( 0.00%) fn contains_unhygienic_crate_reference(tts: &TokenStream) -> Option { . let mut prev_is_dollar = false; . let mut iter = tts.iter(); . while let Some(curr) = iter.next() { 14,790 ( 0.00%) if !prev_is_dollar . && let Some(span) = is_crate_keyword(curr) . && let Some(next) = iter.peek() 8 ( 0.00%) && is_token(next, &TokenKind::PathSep) 32 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/crate_in_macro_def.rs:clippy_lints::crate_in_macro_def::is_token (2x) . { 4 ( 0.00%) return Some(span); . } 5,851 ( 0.00%) if let TokenTree::Delimited(.., tts) = &curr { 3,928 ( 0.00%) let span = contains_unhygienic_crate_reference(tts); 190,179 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/crate_in_macro_def.rs:clippy_lints::crate_in_macro_def::contains_unhygienic_crate_reference'2 (8x) 1,964 ( 0.00%) if span.is_some() { . return span; . } . } 17,490 ( 0.00%) prev_is_dollar = is_token(curr, &TokenKind::Dollar); 138 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/crate_in_macro_def.rs:clippy_lints::crate_in_macro_def::is_token (12x) . } . None 7,888 ( 0.00%) } . . fn is_crate_keyword(tt: &TokenTree) -> Option { 21,356 ( 0.00%) if let TokenTree::Token( . Token { 5,766 ( 0.00%) kind: TokenKind::Ident(kw::Crate, _), . span, . }, . _, . ) = tt . { 2 ( 0.00%) Some(*span) . } else { . None . } . } . 17,496 ( 0.00%) fn is_token(tt: &TokenTree, kind: &TokenKind) -> bool { 11,664 ( 0.00%) if let TokenTree::Token(Token { kind: other, .. }, _) = tt { . kind == other . } else { . false . } 23,328 ( 0.00%) } 3,534 ( 0.00%) -------------------------------------------------------------------------------- -- 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 { 1,937,824 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 484,456 ( 0.00%) if expr.span.from_expansion() { . return; . } . 164,455 ( 0.00%) let ctxt = expr.span.ctxt(); 356,310 ( 0.00%) if let ExprKind::AddrOf(BorrowKind::Ref, mutability, addressee) = expr.kind 10,960 ( 0.00%) && addressee.span.ctxt() == ctxt 11,304 ( 0.00%) && let ExprKind::Index(indexed, range, _) = addressee.kind 227 ( 0.00%) && cx . .typeck_results() 348 ( 0.00%) .expr_ty_adjusted(range) 12,462 ( 0.00%) => ???:::expr_ty_adjusted (174x) . .is_lang_item(cx, LangItem::RangeFull) . { 380 ( 0.00%) let (expr_ty, expr_ref_count, _) = peel_and_count_ty_refs(cx.typeck_results().expr_ty(expr)); 1,520 ( 0.00%) => ???:::expr_ty (38x) 722 ( 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 (38x) 380 ( 0.00%) let (indexed_ty, indexed_ref_count, _) = peel_and_count_ty_refs(cx.typeck_results().expr_ty(indexed)); 1,520 ( 0.00%) => ???:::expr_ty (38x) 412 ( 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 (38x) 38 ( 0.00%) let parent_expr = get_parent_expr(cx, expr); 4,606 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (38x) . let needs_parens_for_prefix = 120 ( 0.00%) parent_expr.is_some_and(|parent| cx.precedence(parent) > ExprPrecedence::Prefix); 3,157 ( 0.00%) => ???:::precedence (30x) . 38 ( 0.00%) if expr_ty == indexed_ty { 13 ( 0.00%) if expr_ref_count > indexed_ref_count { . // Indexing takes self by reference and can't return a reference to that . // reference as it's a local variable. The only way this could happen is if . // `self` contains a reference to the `Self` type. If this occurs then the . // lint no longer applies as it's essentially a field access, which is not . // redundant. . return; . } . let deref_count = indexed_ref_count - expr_ref_count; -- line 104 ---------------------------------------- -- line 134 ---------------------------------------- . let snip = snippet_with_context(cx, indexed.span, ctxt, "..", &mut app).0; . let sugg = if (deref_count != 0 || !reborrow_str.is_empty()) && needs_parens_for_prefix { . format!("({reborrow_str}{}{snip})", "*".repeat(deref_count)) . } else { . format!("{reborrow_str}{}{snip}", "*".repeat(deref_count)) . }; . diag.span_suggestion(expr.span, help_msg, sugg, app); . }); 152 ( 0.00%) } else if let Some(target_id) = cx.tcx.lang_items().deref_target() 1,520 ( 0.00%) => ???:::lang_items (38x) 241 ( 0.00%) && let Ok(deref_ty) = cx.tcx.try_normalize_erasing_regions( 752,023 ( 0.01%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/ty/normalize_erasing_regions.rs:::try_normalize_erasing_regions:: (38x) 76 ( 0.00%) cx.typing_env(), 1,140 ( 0.00%) => ???:::typing_env (38x) . Unnormalized::new_wip(Ty::new_projection_from_args( 76 ( 0.00%) cx.tcx, . ty::IsRigid::No, . target_id, 190 ( 0.00%) cx.tcx.mk_args(&[GenericArg::from(indexed_ty)]), 3,552 ( 0.00%) => ???:::mk_args (38x) . )), . ) . && deref_ty == expr_ty . { . let (lint, msg) = DEREF_BY_SLICING_LINT; 273 ( 0.00%) span_lint_and_then(cx, lint, expr.span, msg, |diag| { 18,529 ( 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}> (13x) . let mut app = Applicability::MachineApplicable; . let snip = snippet_with_context(cx, indexed.span, ctxt, "..", &mut app).0; . let sugg = if needs_parens_for_prefix { . 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); . }); . } . } 1,937,824 ( 0.02%) } . } 680,368 ( 0.01%) -------------------------------------------------------------------------------- -- 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%) } . 1,937,824 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 1,949,122 ( 0.02%) if let ExprKind::Call(fun, [arg]) = expr.kind 11,298 ( 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), . } 485,204 ( 0.00%) } else if let ExprKind::Loop(block, _, _, span) = expr.kind { 748 ( 0.00%) self.loop_stack.push((block.hir_id.owner, span)); . } 1,937,824 ( 0.02%) } . . fn check_expr_post(&mut self, _: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 1,695,596 ( 0.01%) 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 ---------------------------------------- 11,298 ( 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), . } . 23,224 ( 0.00%) fn get_ascii_type<'a>(cx: &LateContext<'a>, kind: rustc_hir::ExprKind<'_>) -> Option<(Span, MatchType<'a>)> { 14,827 ( 0.00%) if let MethodCall(path, expr, _, _) = kind { 160 ( 0.00%) let is_lower = match path.ident.name { 640 ( 0.00%) 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) . || ty.is_str() . || ty.is_slice() . || matches!(ty.opt_diag_name(cx), Some(sym::OsStr | sym::OsString)) . { . return Some((expr.span, ToAscii(is_lower, ty_raw))); . } 20 ( 0.00%) } else if let Lit(expr) = kind { 4 ( 0.00%) return Some((expr.span, Literal(expr.node))); . } . None 23,224 ( 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 { 1,937,824 ( 0.02%) 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 484,456 ( 0.00%) if let Binary(op, left, right) = &expr.kind 14,662 ( 0.00%) && (op.node == BinOpKind::Eq || op.node == BinOpKind::Ne) 49,295 ( 0.00%) && let Some((left_span, left_val)) = get_ascii_type(cx, left.kind) 68,129 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_ignore_case_cmp.rs:clippy_lints::manual_ignore_case_cmp::get_ascii_type (2,899x) 60 ( 0.00%) && let Some((right_span, right_val)) = get_ascii_type(cx, right.kind) 92 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_ignore_case_cmp.rs:clippy_lints::manual_ignore_case_cmp::get_ascii_type (4x) . && 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 { . ToAscii(_, ty) if needs_ref_to_cmp(cx, ty) => "&", -- line 96 ---------------------------------------- -- line 117 ---------------------------------------- . expr.span, . "consider using `.eq_ignore_ascii_case()` instead", . format!("{neg}{left_snip}.eq_ignore_ascii_case({deref}{right_snip})"), . app, . ); . }, . ); . } 1,937,824 ( 0.02%) } . } 15,757 ( 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/vec_cache.rs -------------------------------------------------------------------------------- Ir -- line 70 ---------------------------------------- . . // SAFETY: Buckets must be managed solely by functions here (i.e., get/put on SlotIndex) and . // `self` comes from SlotIndex::from_index . #[inline] . unsafe fn get(&self, buckets: &[AtomicPtr>; 21]) -> Option<(V, u32)> { . let bucket = &buckets[self.bucket_idx]; . let ptr = bucket.load(Ordering::Acquire); . // Bucket is not yet initialized: then we obviously won't find this entry in that bucket. 164,399 ( 0.00%) if ptr.is_null() { . return None; . } . debug_assert!(self.index_in_bucket < self.bucket_idx.capacity()); . // SAFETY: `bucket` was allocated (so <= isize in total bytes) to hold `entries`, so this . // must be inbounds. . let slot = unsafe { ptr.add(self.index_in_bucket) }; . . // SAFETY: initialized bucket has zeroed all memory within the bucket, so we are valid for . // AtomicU32 access. . let index_and_lock = unsafe { &(*slot).index_and_lock }; . let current = index_and_lock.load(Ordering::Acquire); 328,768 ( 0.00%) let index = match current { . 0 => return None, . // Treat "initializing" as actually just not initialized at all. . // The only reason this is a separate state is that `complete` calls could race and . // we can't allow that, but from load perspective there's no difference. . 1 => return None, 159,518 ( 0.00%) _ => current - 2, . }; . . // SAFETY: . // * slot is a valid pointer (buckets are always valid for the index we get). . // * value is initialized since we saw a >= 2 index above. . // * `V: Copy`, so safe to read. 109,132 ( 0.00%) let value = unsafe { (*slot).value }; . Some((value, index)) . } . . fn bucket_ptr(&self, bucket: &AtomicPtr>) -> *mut Slot { . let ptr = bucket.load(Ordering::Acquire); . if ptr.is_null() { Self::initialize_bucket(bucket, self.bucket_idx) } else { ptr } . } . -- line 111 ---------------------------------------- -- line 293 ---------------------------------------- . V: Copy, . I: Idx + Copy, . { . #[inline(always)] . pub fn lookup(&self, key: &K) -> Option<(V, I)> { . let key = u32::try_from(key.index()).unwrap(); . let slot_idx = SlotIndex::from_index(key); . match unsafe { slot_idx.get(&self.buckets) } { 84,121 ( 0.00%) Some((value, idx)) => Some((value, I::new(idx as usize))), 264 ( 0.00%) None => None, . } 1,414 ( 0.00%) } . . #[inline] . pub fn complete(&self, key: K, value: V, index: I) { . let key = u32::try_from(key.index()).unwrap(); . let slot_idx = SlotIndex::from_index(key); . if slot_idx.put(&self.buckets, value, index.index() as u32) { . let present_idx = self.len.fetch_add(1, Ordering::Relaxed); . let slot = SlotIndex::from_index(u32::try_from(present_idx).unwrap()); -- line 312 ---------------------------------------- -- line 444 ---------------------------------------- . #[inline(always)] . const fn from_flat_index(flat: usize) -> (Self, usize) { . if flat > u32::MAX as usize { . panic!(); . } . . // If the index is in bucket 0, the conversion is trivial. . // This also avoids calling `ilog2` when `flat == 0`. 326,331 ( 0.00%) if flat < Self::BUCKET_0_CAPACITY { . return (Self::Bucket00, flat); . } . . // General-case conversion for a non-zero bucket index. . // . // | bucket | slot . // flat | ilog2 | index | offset . // ------------------------------ . // 4096 | 12 | 1 | 0 . // 4097 | 12 | 1 | 1 . // ... . // 8191 | 12 | 1 | 4095 . // 8192 | 13 | 2 | 0 . let highest_bit_pos = flat.ilog2() as usize; . let bucket_index = 217,098 ( 0.00%) BucketIndex::from_raw(highest_bit_pos - Self::NONZERO_BUCKET_SHIFT_ADJUST); . . // Clear the highest-set bit (which selects the bucket) to get the . // slot offset within this bucket. 324,039 ( 0.00%) let slot_offset = flat - (1 << highest_bit_pos); . . (bucket_index, slot_offset) . } . . #[inline(always)] . fn iter_all() -> impl ExactSizeIterator { . (0usize..BUCKETS).map(BucketIndex::from_raw) . } -- line 480 ---------------------------------------- 283,243 ( 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.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 { 934,174 ( 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 { 2,026 ( 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 { 859,943 ( 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] 29,338 ( 0.00%) fn next(&mut self) -> Option { 1,794 ( 0.00%) self.iter.find(&mut self.predicate) 29,318 ( 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 { 5,874 ( 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, . { 198 ( 0.00%) self.iter.try_fold(init, filter_try_fold(&mut self.predicate, fold)) 1,700 ( 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>> (16x) . } . . #[inline] . fn fold(self, init: Acc, fold: Fold) -> Acc . where . Fold: FnMut(Acc, Self::Item) -> Acc, . { 17,968 ( 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 ---------------------------------------- 424,849 ( 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 { 23,372 ( 0.00%) if typeck.hir_owner == id.owner { 81,084 ( 0.00%) let def = typeck.type_dependent_def(id); 34,973 ( 0.00%) => ???:::type_dependent_def (635x) . 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)] 27,073 ( 0.00%) fn f(qpath: &QPath<'_>, id: HirId, typeck: &TypeckResults<'_>) -> Res { 61,650 ( 0.00%) match *qpath { 85,116 ( 0.00%) QPath::Resolved(_, p) => p.res, 125,228 ( 0.00%) QPath::TypeRelative(..) if let Some((kind, id)) = typeck.ty_based_def(id) => Res::Def(kind, id), . QPath::TypeRelative(..) => Res::Err, . } 47,997 ( 0.00%) } 2 ( 0.00%) match self.opt_qpath() { 69,880 ( 0.00%) Some((qpath, id)) if let Some(typeck) = typeck.typeck_res() => f(qpath, id, typeck), 306 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/res.rs:clippy_utils::res::MaybeQPath::res::f (10x) 87 ( 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 { 2,221 ( 0.00%) match self.opt_qpath() { 5,004 ( 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 { 256 ( 0.00%) match self.opt_qpath() { 123 ( 0.00%) Some((&QPath::TypeRelative(_, seg), id)) if seg.ident.name == name => typeck.ty_based_def(id), . _ => None, . } 1 ( 0.00%) } . . /// If this is a type-relative path gets the definition it resolves to and . /// its final segment. . /// . /// Only inherent associated items require a type-relative path. . #[inline] . #[cfg_attr(debug_assertions, track_caller)] . fn ty_rel_def_with_seg<'tcx>(self, typeck: &impl MaybeTypeckRes<'tcx>) -> Option<(DefRes, &'a PathSegment<'a>)> { -- line 276 ---------------------------------------- -- 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> { 174,120 ( 0.00%) match &self.kind { 81,522 ( 0.00%) ExprKind::Path(qpath) => Some((qpath, self.hir_id)), . _ => None, . } . } . } . impl<'tcx> MaybeQPath<'tcx> for &'tcx PatExpr<'_> { . #[inline] . fn opt_qpath(self) -> Option> { 2 ( 0.00%) match &self.kind { 2 ( 0.00%) PatExprKind::Path(qpath) => Some((qpath, self.hir_id)), . PatExprKind::Lit { .. } => None, . } . } . } . impl<'tcx, AmbigArg> MaybeQPath<'tcx> for &'tcx hir::Ty<'_, AmbigArg> { . #[inline] . fn opt_qpath(self) -> Option> { . match &self.kind { -- line 311 ---------------------------------------- -- 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() 1,051,267 ( 0.01%) && let Res::Local(id) = p.res 2,525 ( 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::::{closure#0}>>'2 (101x) . { . 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> { 84,140 ( 0.00%) match *self { 348,961 ( 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> { 3,777,018 ( 0.03%) match &self.kind { 402 ( 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::::expr_usage_requires_vec::{closure#0}, ()>>'2 (2x) . 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> { 5,370 ( 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 { 28,983 ( 0.00%) self.opt_def_id().and_then(|id| tcx.tcx().get_diagnostic_name(id)) 5,838 ( 0.00%) => ???:::get_diagnostic_name (80x) . } . . /// 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() 194,078 ( 0.00%) .is_some_and(|id| tcx.tcx().is_diagnostic_item(name, id)) 61,290 ( 0.00%) => ???:::is_diagnostic_item (596x) . } . . /// 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() 9,100 ( 0.00%) .is_some_and(|id| tcx.tcx().lang_items().get(item) == Some(id)) 120 ( 0.00%) => ???:::lang_items (3x) . } . . /// If this definition is an impl block gets its type. . #[inline] 1,978 ( 0.00%) fn opt_impl_ty<'tcx>(self, tcx: &impl HasTyCtxt<'tcx>) -> Option>> { 1,052 ( 0.00%) match self.opt_def(tcx) { 10,287 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/res.rs:::opt_def:: (79x) 147 ( 0.00%) Some((DefKind::Impl { .. }, id)) => Some(tcx.tcx().type_of(id)), . _ => None, . } 1,939 ( 0.00%) } . . /// Gets the parent of this definition if it has one. . #[inline] 968 ( 0.00%) fn opt_parent<'tcx>(self, tcx: &impl HasTyCtxt<'tcx>) -> Option { . self.opt_def_id().and_then(|id| tcx.tcx().opt_parent(id)) 1,936 ( 0.00%) } . . /// Checks if this definition is an impl block. . #[inline] . fn is_impl<'tcx>(self, tcx: &impl HasTyCtxt<'tcx>) -> bool { 258 ( 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 { 9,106 ( 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] 291 ( 0.00%) fn assoc_parent<'tcx>(self, tcx: &impl HasTyCtxt<'tcx>) -> Option { 60 ( 0.00%) match self.opt_def(tcx) { . Some((DefKind::AssocConst { .. } | DefKind::AssocFn | DefKind::AssocTy, id)) => tcx.tcx().opt_parent(id), . _ => None, . } 388 ( 0.00%) } . . /// If this definition is an associated function of an impl or trait gets the . /// `DefId` of its parent. . #[inline] 2 ( 0.00%) fn assoc_fn_parent<'tcx>(self, tcx: &impl HasTyCtxt<'tcx>) -> Option { 266 ( 0.00%) match self.opt_def(tcx) { . Some((DefKind::AssocFn, id)) => tcx.tcx().opt_parent(id), . _ => None, . } 4 ( 0.00%) } . } . impl MaybeDef for DefId { . #[inline] . fn opt_def_id(self) -> Option { . Some(self) . } . . #[inline] 1,727 ( 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)) 1,192 ( 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)> { 125 ( 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)> { 18,048 ( 0.00%) match self { 5,979 ( 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)> { 140 ( 0.00%) self.and_then(|x| T::opt_def(x, tcx)) 7,890 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/res.rs:::opt_def:: (70x) . } . } . impl MaybeDef for EarlyBinder<'_, T> { . #[inline] . fn opt_def_id(self) -> Option { . self.skip_binder().opt_def_id() . } . -- line 672 ---------------------------------------- 950,892 ( 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/iter/adapters/peekable.rs -------------------------------------------------------------------------------- Ir -- line 17 ---------------------------------------- . pub struct Peekable { . iter: I, . /// Remember a peeked value, even if it was None. . peeked: Option>, . } . . impl Peekable { . pub(in crate::iter) const fn new(iter: I) -> Peekable { 6,826 ( 0.00%) Peekable { iter, peeked: None } . } . } . . // Peekable must remember if a None has been seen in the `.peek()` method. . // It ensures that `.peek(); .peek();` or `.peek(); .next();` only advances the . // underlying iterator at most once. This does not by itself make the iterator . // fused. . #[stable(feature = "rust1", since = "1.0.0")] . impl Iterator for Peekable { . type Item = I::Item; . . #[inline] . fn next(&mut self) -> Option { 65,644 ( 0.00%) match self.peeked.take() { 14,475 ( 0.00%) Some(v) => v, 95,241 ( 0.00%) None => self.iter.next(), 5,179,145 ( 0.04%) => /rust/deps/pulldown-cmark-0.11.3/src/parse.rs: as core::iter::traits::iterator::Iterator>::next (31,747x) . } . } . . #[inline] . #[rustc_inherit_overflow_checks] . fn count(mut self) -> usize { . match self.peeked.take() { . Some(None) => 0, -- line 49 ---------------------------------------- -- line 210 ---------------------------------------- . /// // After the iterator is finished, so is `peek()` . /// assert_eq!(iter.peek(), None); . /// assert_eq!(iter.next(), None); . /// ``` . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . pub fn peek(&mut self) -> Option<&I::Item> { . let iter = &mut self.iter; 2,677 ( 0.00%) self.peeked.get_or_insert_with(|| iter.next()).as_ref() 175,439 ( 0.00%) => /rust/deps/pulldown-cmark-0.11.3/src/parse.rs: as core::iter::traits::iterator::Iterator>::next (965x) . } . . /// Returns a mutable reference to the next() value without advancing the iterator. . /// . /// Like [`next`], if there is a value, it is wrapped in a `Some(T)`. . /// But if the iteration is over, `None` is returned. . /// . /// Because `peek_mut()` returns a reference, and many iterators iterate over -- line 226 ---------------------------------------- 98,977 ( 0.00%) -------------------------------------------------------------------------------- -- 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)] 2,180,052 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . let from_expansion = expr.span.from_expansion(); . 745,647 ( 0.01%) if let ExprKind::Match(ex, arms, source) = expr.kind { 18,852 ( 0.00%) if is_direct_expn_of(expr.span, sym::matches).is_some() 173,951 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_direct_expn_of (2,709x) . && let [arm, _] = arms . { 48 ( 0.00%) redundant_pattern_match::check_match(cx, expr, ex, arms); 278 ( 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 (6x) 6 ( 0.00%) redundant_pattern_match::check_matches_true(cx, expr, arm, ex); . } 16,254 ( 0.00%) if expr.span.in_external_macro(cx.tcx.sess.source_map()) { . return; . } . 4,788 ( 0.00%) if source == MatchSource::Normal && !is_span_match(cx, expr.span) { . return; . } 23,120 ( 0.00%) if matches!(source, MatchSource::Normal | MatchSource::ForLoopDesugar) { 12,684 ( 0.00%) significant_drop_in_scrutinee::check_match(cx, expr, ex, arms, source); 1,861,212 ( 0.02%) => /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 (1,812x) . } . 13,872 ( 0.00%) collapsible_match::check_match(cx, ex, arms, self.msrv); 162,451,544 ( 1.35%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/collapsible_match.rs:clippy_lints::matches::collapsible_match::check_match (2,312x) 4,624 ( 0.00%) if !from_expansion { . // These don't depend on a relationship between multiple arms 7,945 ( 0.00%) match_wild_err_arm::check(cx, ex, arms); 815,452 ( 0.01%) => /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 (1,589x) 7,945 ( 0.00%) wild_in_or_pats::check(cx, ex, arms); 10,358,103 ( 0.09%) => /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 (1,589x) . } . 6,936 ( 0.00%) if let MatchSource::TryDesugar(_) = source { 1,467 ( 0.00%) try_err::check(cx, expr, ex); 85,828 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/try_err.rs:clippy_lints::matches::try_err::check (500x) . } . . if !from_expansion 1,589 ( 0.00%) && let mut has_cfg = false 1,589 ( 0.00%) && let mut has_comments = false 67,151 ( 0.00%) && walk_intra_arm_text(cx, expr.span, ex.span, arms, |s| { 53,392 ( 0.00%) let mut iter = tokenize_with_text(s).filter(|(t, ..)| match t { . TokenKind::Whitespace => false, . TokenKind::LineComment { .. } | TokenKind::BlockComment { .. } => { 244 ( 0.00%) has_comments = true; . false . }, . _ => true, . }); . while let Some((t, ..)) = iter.next() { . if matches!(t, TokenKind::Pound) . && matches!(iter.next(), Some((TokenKind::OpenBracket, ..))) 2 ( 0.00%) && matches!(iter.next(), Some((TokenKind::Ident, "cfg", _))) . { 4 ( 0.00%) has_cfg = true; . } . } 54,288 ( 0.00%) }) . && !has_cfg . { 1,120 ( 0.00%) if source == MatchSource::Normal { 7,840 ( 0.00%) let is_match_like_matches = self.msrv.meets(cx, msrvs::MATCHES_MACRO) 30,240 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (1,120x) 5,600 ( 0.00%) && match_like_matches::check_match(cx, expr, ex, arms); 50,911,706 ( 0.42%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/match_like_matches.rs:clippy_lints::matches::match_like_matches::check_match (1,120x) . // 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. 2,240 ( 0.00%) if !(is_match_like_matches 7,616 ( 0.00%) || (is_lint_allowed(cx, MATCH_SAME_ARMS, expr.hir_id) 1,100,710 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_lint_allowed (1,088x) 5,586 ( 0.00%) && arms.iter().all(|arm| cx.tcx.hir_attrs(arm.hir_id).is_empty()))) 358,751 ( 0.00%) => ???:::hir_attrs (5,586x) . { . match_same_arms::check(cx, arms); . } . 8,960 ( 0.00%) redundant_pattern_match::check_match(cx, expr, ex, arms); 27,927 ( 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 (1,120x) 7,840 ( 0.00%) single_match::check(cx, ex, arms, expr, has_comments); 5,321,075 ( 0.04%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/single_match.rs:clippy_lints::matches::single_match::check (1,120x) 6,720 ( 0.00%) match_bool::check(cx, ex, arms, expr); 85,194 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/match_bool.rs:clippy_lints::matches::match_bool::check (1,120x) 5,600 ( 0.00%) overlapping_arms::check(cx, ex, arms); 388,049 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/overlapping_arms.rs:clippy_lints::matches::overlapping_arms::check (1,120x) 5,600 ( 0.00%) match_wild_enum::check(cx, ex, arms); 3,972,895 ( 0.03%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/match_wild_enum.rs:clippy_lints::matches::match_wild_enum::check (1,120x) 6,720 ( 0.00%) match_as_ref::check(cx, ex, arms, expr); 58,386 ( 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 (1,120x) 6,720 ( 0.00%) needless_match::check_match(cx, ex, arms, expr); 595,478 ( 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 (1,120x) 5,600 ( 0.00%) match_str_case_mismatch::check(cx, ex, arms); 76,050 ( 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 (1,120x) 5,600 ( 0.00%) redundant_guards::check(cx, arms, self.msrv); 102,406 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/redundant_guards.rs:clippy_lints::matches::redundant_guards::check (1,120x) . 4,480 ( 0.00%) if !is_in_const_context(cx) { 396,013 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_const_context (1,120x) 7,777 ( 0.00%) manual_unwrap_or::check_match(cx, expr, ex, arms); 178,081 ( 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 (1,111x) 6,666 ( 0.00%) manual_map::check_match(cx, expr, ex, arms); 75,468 ( 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 (1,111x) 6,666 ( 0.00%) manual_filter::check_match(cx, ex, arms, expr); 114,142 ( 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 (1,111x) 7,777 ( 0.00%) manual_ok_err::check_match(cx, expr, ex, arms); 103,198 ( 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 (1,111x) . } . 2,240 ( 0.00%) if self.infallible_destructuring_match_linted { . self.infallible_destructuring_match_linted = false; . } else { 6,720 ( 0.00%) match_single_binding::check(cx, ex, arms, expr); 32,564 ( 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 (1,120x) . } . } . match_ref_pats::check(cx, ex, arms.iter().map(|el| el.pat), expr); . } 1,449,102 ( 0.01%) } else if let Some(if_let) = higher::IfLet::hir(cx, expr) { 1,845,019 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (239,519x) 9,990 ( 0.00%) if expr.span.in_external_macro(cx.tcx.sess.source_map()) { . return; . } . collapsible_match::check_if_let( . cx, 7,992 ( 0.00%) if_let.let_span.ctxt(), 1,998 ( 0.00%) if_let.let_pat, 1,998 ( 0.00%) if_let.if_then, 1,998 ( 0.00%) if_let.if_else, 1,998 ( 0.00%) if_let.let_expr, 1,998 ( 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); 6,011 ( 0.00%) if !from_expansion { 3,964 ( 0.00%) if let Some(else_expr) = if_let.if_else { 688 ( 0.00%) if self.msrv.meets(cx, msrvs::MATCHES_MACRO) { 2,322 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (86x) 602 ( 0.00%) match_like_matches::check_if_let( 1,263,024 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/match_like_matches.rs:clippy_lints::matches::match_like_matches::check_if_let (86x) . cx, . expr, . if_let.let_pat, . if_let.let_expr, . if_let.if_then, . else_expr, . ); . } 516 ( 0.00%) if !is_in_const_context(cx) { 29,630 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_const_context (86x) . manual_unwrap_or::check_if_let( . cx, . expr, . if_let.let_pat, . if_let.let_expr, . if_let.if_then, . else_expr, . ); -- line 1183 ---------------------------------------- -- line 1185 ---------------------------------------- . manual_filter::check_if_let( . cx, . expr, . if_let.let_pat, . if_let.let_expr, . if_let.if_then, . else_expr, . ); 860 ( 0.00%) manual_ok_err::check_if_let( 11,260 ( 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_if_let (86x) . cx, . expr, . if_let.let_pat, . if_let.let_expr, . if_let.if_then, . else_expr, . ); . } -- line 1201 ---------------------------------------- -- 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, . ); 5,946 ( 0.00%) needless_match::check_if_let(cx, expr, &if_let); 5,531,274 ( 0.05%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/needless_match.rs:clippy_lints::matches::needless_match::check_if_let (1,982x) . } . } else { 1,187,605 ( 0.01%) if expr.span.in_external_macro(cx.tcx.sess.source_map()) { . return; . } . if let Some(while_let) = higher::WhileLet::hir(expr) { 1,302 ( 0.00%) significant_drop_in_scrutinee::check_while_let(cx, expr, while_let.let_expr, while_let.if_then); 897,414 ( 0.01%) => /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_while_let (434x) . } 1,496 ( 0.00%) if !from_expansion { . redundant_pattern_match::check(cx, expr); . } . } 1,937,824 ( 0.02%) } . . fn check_local(&mut self, cx: &LateContext<'tcx>, local: &'tcx LetStmt<'_>) { 20,061 ( 0.00%) self.infallible_destructuring_match_linted |= 80,241 ( 0.00%) local.els.is_none() && infallible_destructuring_match::check(cx, local); 578,912 ( 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 (20,060x) . } . . fn check_pat(&mut self, cx: &LateContext<'tcx>, pat: &'tcx Pat<'_>) { 175,266 ( 0.00%) rest_pat_in_fully_bound_struct::check(cx, pat); 1,901,305 ( 0.02%) => /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 (58,422x) . } . } . . /// 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 { 9,534 ( 0.00%) if let Some(src) = match_sp.get_source_range(cx) 3,178 ( 0.00%) && let scrutinee_sp = scrutinee_sp.source_callsite().data() 85,770 ( 0.00%) => ???:::source_callsite (1,589x) . && 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) 1,589 ( 0.00%) && let Some(block_text) = src_text.get(block_start..src.range.end) 3,178 ( 0.00%) && let Some(stripped_text) = block_text.trim_start_matches(is_whitespace).strip_prefix('{') 56,638 ( 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:: (1,589x) . && let arms_start = block_start + (block_text.len() - stripped_text.len()) . && let Some(arms_end) = stripped_text 3,366 ( 0.00%) .trim_end_matches(|c| is_whitespace(c) || c == ')') 29,172 ( 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}> (1,122x) . .strip_suffix('}') 2,244 ( 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| { 5,664 ( 0.00%) let arm_sp: rustc_span::SpanData = arm.span.source_callsite().data(); 135,996 ( 0.00%) => ???:::source_callsite (5,664x) 16,992 ( 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; 33,984 ( 0.00%) if range.start <= arm_range.start . && arm_range.end <= range.end . && let Some(src) = src_text.get(range.start..arm_range.start) . { 22,656 ( 0.00%) f(src); 2,790,320 ( 0.02%) => site/frontend/rust-clippy/clippy_lints/src/matches/mod.rs:::check_expr::{closure#0} (5,664x) . Some(arm_range.end..range.end) . } else { . None . } . }) . && let Some(src) = src_text.get(range) . { 1,122 ( 0.00%) f(src); 510,717 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/matches/mod.rs:::check_expr::{closure#0} (1,122x) . true . } else { . false . } . } . . /// Checks if `pat` contains OR patterns that cannot be nested due to a too low MSRV. 3,366 ( 0.00%) fn pat_contains_disallowed_or(cx: &LateContext<'_>, pat: &Pat<'_>, msrv: Msrv) -> bool { 561 ( 0.00%) let mut contains_or = false; . pat.walk(|p| { 3,423 ( 0.00%) let is_or = matches!(p.kind, PatKind::Or(_)); 1,141 ( 0.00%) contains_or |= is_or; . !is_or . }); 1,122 ( 0.00%) contains_or && !msrv.meets(cx, msrvs::OR_PATTERNS) 2,244 ( 0.00%) } 139,435 ( 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. 45,987 ( 0.00%) __rust_no_alloc_shim_is_unstable_v2(); 5 ( 0.00%) => ???:std::exception::~exception() (5x) . 704,018 ( 0.01%) __rust_alloc(layout.size(), layout.alignment()) 175 ( 0.00%) => ???:__rustc::__rust_alloc (5x) . } . } . . /// 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) { 762,116 ( 0.01%) unsafe { __rust_dealloc(ptr, layout.size(), layout.alignment()) } 190 ( 0.00%) => ???:__rustc::__rdl_dealloc (5x) . } . . /// 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 { 44,073 ( 0.00%) unsafe { __rust_realloc(ptr, layout.size(), layout.alignment(), new_size) } 1,240 ( 0.00%) => ???:__rustc::__rust_realloc (5x) . } . . /// 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 276 ---------------------------------------- . #[inline] . #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces . pub unsafe fn alloc_zeroed(layout: Layout) -> *mut u8 { . unsafe { . // Make sure we don't accidentally allow omitting the allocator shim in . // stable code until it is actually stabilized. . __rust_no_alloc_shim_is_unstable_v2(); . 852 ( 0.00%) __rust_alloc_zeroed(layout.size(), layout.alignment()) 19,772 ( 0.00%) => ???:__rustc::__rust_alloc_zeroed (213x) . } . } . . 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> { 100,662 ( 0.00%) match layout.size() { . 0 => Ok(layout.dangling_ptr().cast_slice(0)), . // SAFETY: `layout` is non-zero in size, . size => unsafe { 49,741 ( 0.00%) let raw_ptr = if zeroed { alloc_zeroed(layout) } else { alloc(layout) }; 49,732 ( 0.00%) => ???:std::exception::~exception() (49,732x) . 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) { 86,103 ( 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 ---------------------------------------- 421,240 ( 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/profiling.rs -------------------------------------------------------------------------------- Ir -- line 96 ---------------------------------------- . use parking_lot::RwLock; . use smallvec::SmallVec; . use tracing::warn; . . use crate::fx::FxHashMap; . use crate::outline; . use crate::sync::AtomicU64; . 366,060 ( 0.00%) bitflags::bitflags! { . #[derive(Clone, Copy)] . struct EventFilter: u16 { . const GENERIC_ACTIVITIES = 1 << 0; . const QUERY_PROVIDERS = 1 << 1; . /// Store detailed instant events, including timestamp and thread ID, . /// per each query cache hit. Note that this is quite expensive. . const QUERY_CACHE_HITS = 1 << 2; . const QUERY_BLOCKED = 1 << 3; -- line 112 ---------------------------------------- -- line 432 ---------------------------------------- . |profiler| profiler.query_cache_hit_event_kind, . query_invocation_id, . ); . } . } . . // We check both kinds of query cache hit events at once, to reduce overhead in the . // common case (with self-profile disabled). 183,030 ( 0.00%) if self.event_filter_mask.intersects(EventFilter::QUERY_CACHE_HIT_COMBINED) { . hint::cold_path(); . cold_call(self, query_invocation_id); . } . } . . /// Start profiling a query being blocked on a concurrent execution. . /// Profiling continues until the TimingGuard returned from this call is . /// dropped. -- line 448 ---------------------------------------- 1,187 ( 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/sync/lock.rs -------------------------------------------------------------------------------- Ir -- line 48 ---------------------------------------- . } . } . . impl<'a, T: 'a> Drop for LockGuard<'a, T> { . #[inline] . fn drop(&mut self) { . // SAFETY (union access): We get `self.mode` from the lock operation so it is consistent . // with the `lock.mode` state. This means we access the right union fields. 1,333,835 ( 0.01%) match self.mode { . Mode::NoSync => { . let cell = unsafe { &self.lock.mode_union.no_sync }; . debug_assert!(cell.get()); . cell.set(false); 480 ( 0.00%) } . // SAFETY (unlock): We know that the lock is locked as this type is a proof of that. . Mode::Sync => unsafe { self.lock.mode_union.sync.unlock() }, . } . } . } . . union ModeUnion { . /// Indicates if the cell is locked. Only used if `Lock.mode` is `NoSync`. -- line 69 ---------------------------------------- -- line 143 ---------------------------------------- . #[cold] . fn lock_held() -> ! { . panic!("lock was already held") . } . . // SAFETY: This is safe since the union fields are used in accordance with `mode` . // which also must match `self.mode` due to the safety precondition. . unsafe { 2,408,990 ( 0.02%) match mode { . Mode::NoSync => { 2,457,096 ( 0.02%) if self.mode_union.no_sync.replace(LOCKED) == LOCKED { . hint::cold_path(); . lock_held() . } . } . Mode::Sync => self.mode_union.sync.lock(), . } . } . LockGuard { lock: self, marker: PhantomData, mode } . } . . #[inline(always)] . #[track_caller] . pub fn lock(&self) -> LockGuard<'_, T> { 1,204,495 ( 0.01%) unsafe { self.lock_assume(self.mode) } . } . } . . unsafe impl DynSend for Lock {} . unsafe impl DynSync for Lock {} . . impl Lock { . #[inline(always)] -- line 175 ---------------------------------------- 1,229,629 ( 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_span/src/def_id.rs -------------------------------------------------------------------------------- Ir -- line 12 ---------------------------------------- . use rustc_macros::{BlobDecodable, Decodable, Encodable, StableHash}; . use rustc_serialize::{Decodable, Encodable}; . . use crate::{SpanDecoder, SpanEncoder, Symbol}; . . pub type StableCrateIdMap = . indexmap::IndexMap>; . 4,367 ( 0.00%) rustc_index::newtype_index! { . #[orderable] . #[debug_format = "crate{}"] . pub struct CrateNum {} . } . . /// Item definitions in the currently-compiled crate would have the `CrateNum` . /// `LOCAL_CRATE` in their `DefId`. . pub const LOCAL_CRATE: CrateNum = CrateNum::ZERO; -- line 28 ---------------------------------------- -- line 211 ---------------------------------------- . } . . impl fmt::LowerHex for StableCrateId { . fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { . fmt::LowerHex::fmt(&self.0, f) . } . } . 163,839 ( 0.00%) rustc_index::newtype_index! { . /// A DefIndex is an index into the hir-map for a crate, identifying a . /// particular definition. It should really be considered an interned . /// shorthand for a particular DefPath. . #[orderable] . #[debug_format = "DefIndex({})"] . pub struct DefIndex { . /// The crate root is always assigned index 0 by the AST Map code, . /// thanks to `NodeCollector::new`. -- line 227 ---------------------------------------- -- line 228 ---------------------------------------- . const CRATE_DEF_INDEX = 0; . } . } . . /// A `DefId` identifies a particular *definition*, by combining a crate . /// index and a def index. . /// . /// You can create a `DefId` from a `LocalDefId` using `local_def_id.to_def_id()`. 236,237 ( 0.00%) #[derive(Clone, PartialEq, Eq, Copy)] . // On below-64 bit systems we can simply use the derived `Hash` impl . #[cfg_attr(not(target_pointer_width = "64"), derive(Hash))] . #[repr(C)] . #[rustc_pass_by_value] . // We guarantee field order. Note that the order is essential here, see below why. . pub struct DefId { . // cfg-ing the order of fields so that the `DefIndex` which is high entropy always ends up in . // the lower bits no matter the endianness. This allows the compiler to turn that `Hash` impl . // into a direct call to `u64::hash(_)`. . #[cfg(not(all(target_pointer_width = "64", target_endian = "big")))] 26,267 ( 0.00%) pub index: DefIndex, . pub krate: CrateNum, . #[cfg(all(target_pointer_width = "64", target_endian = "big"))] . pub index: DefIndex, . } . . // To ensure correctness of incremental compilation, . // `DefId` must not implement `Ord` or `PartialOrd`. . // See https://github.com/rust-lang/rust/issues/90317. -- line 255 ---------------------------------------- -- line 272 ---------------------------------------- . // is used throughout rustc, has problems distributing the entropy from the high bits, so reversing . // the order would lead to a large number of collisions and thus far worse performance. . // . // On 64-bit big-endian systems, this compiles to a 64-bit rotation by 32 bits, which is still . // faster than another `FxHash` round. . #[cfg(target_pointer_width = "64")] . impl Hash for DefId { . fn hash(&self, h: &mut H) { 22,860 ( 0.00%) (((self.krate.as_u32() as u64) << 32) | (self.index.as_u32() as u64)).hash(h) . } . } . . impl DefId { . /// Makes a local `DefId` from the given `DefIndex`. . #[inline] . pub fn local(index: DefIndex) -> DefId { . DefId { krate: LOCAL_CRATE, index } -- line 288 ---------------------------------------- -- line 388 ---------------------------------------- . fn index(self) -> usize { . self.local_def_index.index() . } . } . . impl LocalDefId { . #[inline] . pub fn to_def_id(self) -> DefId { 6 ( 0.00%) DefId { krate: LOCAL_CRATE, index: self.local_def_index } . } . . #[inline] . pub fn is_top_level_module(self) -> bool { . self == CRATE_DEF_ID . } . } . -- line 404 ---------------------------------------- 6,196 ( 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 { 1,937,824 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 562,663 ( 0.00%) if !expr.span.from_expansion() 37,838 ( 0.00%) && let ExprKind::Call(nonnull_new_unchecked, [arg]) = expr.kind 9,340 ( 0.00%) && let ExprKind::Call(box_into_raw, [arg]) = arg.kind . && nonnull_new_unchecked 127 ( 0.00%) .ty_rel_def_if_named(cx, sym::new_unchecked) . .opt_parent(cx) 635 ( 0.00%) .opt_impl_ty(cx) 2,032 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/res.rs: as clippy_utils::res::MaybeDef>::opt_impl_ty:: (127x) . .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); . }, . ); . } 1,937,824 ( 0.02%) } . } 329,418 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/non_canonical_impls.rs -------------------------------------------------------------------------------- Ir -- line 125 ---------------------------------------- . partial_ord_trait: Option, . ord_trait: Option, . clone_trait: Option, . copy_trait: Option, . } . . impl NonCanonicalImpls { . pub(crate) fn new(tcx: TyCtxt<'_>) -> Self { 2 ( 0.00%) let lang_items = tcx.lang_items(); 40 ( 0.00%) => ???:::lang_items (1x) . Self { . partial_ord_trait: lang_items.partial_ord_trait(), 3 ( 0.00%) ord_trait: tcx.get_diagnostic_item(sym::Ord), 106 ( 0.00%) => ???:::get_diagnostic_item (1x) . clone_trait: lang_items.clone_trait(), . copy_trait: lang_items.copy_trait(), . } . } . } . . /// The traits that this lint looks at . enum Trait { . Clone, . PartialOrd, . } . . impl LateLintPass<'_> for NonCanonicalImpls { 41,566 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) { 16,224 ( 0.00%) if let ItemKind::Impl(impl_) = item.kind . // Both `PartialOrd` and `Clone` have one required method, and `PartialOrd` can have 5 methods in total 4,348 ( 0.00%) && (1..=5).contains(&impl_.items.len()) . && let Some(of_trait) = impl_.of_trait 7,230 ( 0.00%) && let Some(trait_did) = of_trait.trait_ref.trait_def_id() 18,798 ( 0.00%) => ???:::trait_def_id (1,446x) . // Check this early to hopefully bail out as soon as possible 498 ( 0.00%) && let trait_ = if Some(trait_did) == self.clone_trait { . Trait::Clone 35 ( 0.00%) } else if Some(trait_did) == self.partial_ord_trait { . Trait::PartialOrd . } else { . return; . } 2,272 ( 0.00%) && !cx.tcx.is_automatically_derived(item.owner_id.to_def_id()) 39,722 ( 0.00%) => ???:::is_automatically_derived (284x) . { . let mut assoc_fns = impl_ . .items . .iter() 6 ( 0.00%) .map(|id| cx.tcx.hir_impl_item(*id)) 203 ( 0.00%) => ???:::hir_impl_item (3x) . .filter_map(|assoc| { 12 ( 0.00%) if let ImplItemKind::Fn(_, body_id) = assoc.kind 9 ( 0.00%) && let body = cx.tcx.hir_body(body_id) 200 ( 0.00%) => ???:::hir_body (3x) 12 ( 0.00%) && let ExprKind::Block(block, ..) = body.value.kind 15 ( 0.00%) && !block.span.in_external_macro(cx.sess().source_map()) . { . Some((assoc, body, block)) . } else { . None . } . }); . 21 ( 0.00%) let trait_impl = cx.tcx.impl_trait_ref(item.owner_id).skip_binder(); 533 ( 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:: (7x) . 14 ( 0.00%) match trait_ { . Trait::Clone => { . if let Some(copy_trait) = self.copy_trait . && implements_trait(cx, trait_impl.self_ty(), copy_trait, &[]) . { . for (assoc, body, _) in assoc_fns { . check_clone_on_copy(cx, assoc, body.value); . } . } . }, . Trait::PartialOrd => { . // If `Self` and `Rhs` are not the same type, then a corresponding `Ord` impl is not possible, . // since it doesn't have an `Rhs` 17 ( 0.00%) if let [lhs, rhs] = trait_impl.args.as_slice() 7 ( 0.00%) && lhs == rhs 28 ( 0.00%) && let Some(ord_trait) = self.ord_trait 63 ( 0.00%) && implements_trait(cx, trait_impl.self_ty(), ord_trait, &[]) 408,006 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::implements_trait (7x) . && let Some((assoc, body, block)) = . assoc_fns.find(|(assoc, _, _)| assoc.ident.name == sym::partial_cmp) . { 15 ( 0.00%) check_partial_ord_on_ord(cx, assoc, item, body, block); 1,845 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/non_canonical_impls.rs:clippy_lints::non_canonical_impls::check_partial_ord_on_ord (3x) . } . }, . } . } 47,504 ( 0.00%) } . } . . fn is_deref_self(expr: &Expr<'_>) -> bool { . if let ExprKind::Unary(UnOp::Deref, deref) = expr.kind . && let ExprKind::Path(qpath) = deref.kind . && last_path_segment(&qpath).ident.name == kw::SelfLower . { . return true; -- line 217 ---------------------------------------- -- line 283 ---------------------------------------- . . match expr.kind { . ExprKind::Ret(Some(ret)) if is_deref_self(ret) => IsCanonical::WithReturn, . _ if is_deref_self(expr) => IsCanonical::WithoutReturn, . _ => IsCanonical::No, . } . } . 39 ( 0.00%) fn check_partial_ord_on_ord<'tcx>( . cx: &LateContext<'tcx>, . impl_item: &ImplItem<'_>, . item: &Item<'_>, . body: &Body<'_>, . block: &Block<'tcx>, . ) { . // If the `cmp` call likely needs to be fully qualified in the suggestion . // (like `std::cmp::Ord::cmp`). It's unfortunate we must put this here but we can't . // access `cmp_expr` in the suggestion without major changes, as we lint in `else`. . 3 ( 0.00%) let mut needs_fully_qualified = false; 3 ( 0.00%) if block.stmts.is_empty() . && let Some(expr) = block.expr . && expr_is_cmp(cx, expr, impl_item, &mut needs_fully_qualified) . { . return; . } . // Fix #12683, allow [`needless_return`] here . else if block.expr.is_none() . && let Some(stmt) = block.stmts.first() -- line 311 ---------------------------------------- -- line 352 ---------------------------------------- . (block.span, "{ Some(self.cmp(other)) }".to_owned()), . (other.pat.span, "other".to_owned()), . ], . }; . . diag.multipart_suggestion("change this to", suggs, Applicability::Unspecified); . }, . ); 24 ( 0.00%) } . . /// Return true if `expr_kind` is a `cmp` call. 30 ( 0.00%) fn expr_is_cmp<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'tcx>, . impl_item: &ImplItem<'_>, . needs_fully_qualified: &mut bool, . ) -> bool { 9 ( 0.00%) let typeck = cx.tcx.typeck(impl_item.owner_id.def_id); 441 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/query/plumbing.rs:::typeck:: (3x) 33 ( 0.00%) match expr.kind { . ExprKind::Call( . Expr { 3 ( 0.00%) kind: ExprKind::Path(some_path), . hir_id: some_hir_id, . .. . }, 3 ( 0.00%) [cmp_expr], . ) => { 21 ( 0.00%) typeck.qpath_res(some_path, *some_hir_id).ctor_parent(cx).is_lang_item(cx, LangItem::OptionSome) 45 ( 0.00%) => ???:::qpath_res (3x) . // Fix #11178, allow `Self::cmp(self, ..)` 6 ( 0.00%) && self_cmp_call(cx, typeck, cmp_expr, needs_fully_qualified) . }, . ExprKind::MethodCall(_, recv, [], _) => { . typeck . .type_dependent_def(expr.hir_id) . .assoc_parent(cx) . .is_diag_item(cx, sym::Into) . && self_cmp_call(cx, typeck, recv, needs_fully_qualified) . }, . _ => false, . } 24 ( 0.00%) } . . /// Returns whether this is any of `self.cmp(..)`, `Self::cmp(self, ..)` or `Ord::cmp(self, ..)`. 15 ( 0.00%) fn self_cmp_call<'tcx>( . cx: &LateContext<'tcx>, . typeck: &TypeckResults<'tcx>, . cmp_expr: &'tcx Expr<'tcx>, . needs_fully_qualified: &mut bool, . ) -> bool { 9 ( 0.00%) match cmp_expr.kind { . ExprKind::Call(path, [_, _]) => path.res(typeck).is_diag_item(cx, sym::ord_cmp_method), 9 ( 0.00%) ExprKind::MethodCall(_, recv, [_], ..) => { 21 ( 0.00%) let ExprKind::Path(path) = recv.kind else { . return false; . }; 6 ( 0.00%) if last_path_segment(&path).ident.name != kw::SelfLower { 36 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::last_path_segment (3x) . return false; . } . . // We can set this to true here no matter what as if it's a `MethodCall` and goes to the . // `else` branch, it must be a method named `cmp` that isn't `Ord::cmp` 3 ( 0.00%) *needs_fully_qualified = true; . . typeck 12 ( 0.00%) .type_dependent_def_id(cmp_expr.hir_id) 153 ( 0.00%) => ???:::type_dependent_def_id (3x) 9 ( 0.00%) .is_some_and(|def_id| cx.tcx.is_diagnostic_item(sym::ord_cmp_method, def_id)) . }, . _ => false, . } 18 ( 0.00%) } 10,749 ( 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. 902,155 ( 0.01%) #[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 || { 707,456 ( 0.01%) let token = cursor.advance_token(); 35,952 ( 0.00%) => ???:::advance_token (468x) 677,325 ( 0.01%) 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. . 14,610 ( 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 ---------------------------------------- 14,449 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/derive/mod.rs -------------------------------------------------------------------------------- Ir -- line 188 ---------------------------------------- . DERIVED_HASH_WITH_MANUAL_EQ, . DERIVE_ORD_XOR_PARTIAL_ORD, . DERIVE_PARTIAL_EQ_WITHOUT_EQ, . EXPL_IMPL_CLONE_ON_COPY, . UNSAFE_DERIVE_DESERIALIZE, . ]); . . impl<'tcx> LateLintPass<'tcx> for Derive { 41,566 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) { 14,050 ( 0.00%) if let ItemKind::Impl(Impl { . of_trait: Some(of_trait), 1,911 ( 0.00%) self_ty, . .. 4,348 ( 0.00%) }) = item.kind 3,822 ( 0.00%) && let Res::Def(_, def_id) = *self_ty.basic_res() . && let Some(local_def_id) = def_id.as_local() . { 1,878 ( 0.00%) let adt_hir_id = cx.tcx.local_def_id_to_hir_id(local_def_id); . let trait_ref = &of_trait.trait_ref; 3,756 ( 0.00%) let ty = cx.tcx.type_of(item.owner_id).instantiate_identity().skip_norm_wip(); 9,390 ( 0.00%) let is_automatically_derived = cx.tcx.is_automatically_derived(item.owner_id.to_def_id()); 251,853 ( 0.00%) => ???:::is_automatically_derived (1,878x) . 15,024 ( 0.00%) derived_hash_with_manual_eq::check(cx, item.span, trait_ref, ty, adt_hir_id, is_automatically_derived); 18,780 ( 0.00%) derive_ord_xor_partial_ord::check(cx, item, trait_ref, ty, adt_hir_id, is_automatically_derived); 776,787 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/derive/derive_ord_xor_partial_ord.rs:clippy_lints::derive::derive_ord_xor_partial_ord::check (1,878x) . 3,756 ( 0.00%) if is_automatically_derived { 9,639 ( 0.00%) unsafe_derive_deserialize::check(cx, item, trait_ref, ty, adt_hir_id); 66,299 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/derive/unsafe_derive_deserialize.rs:clippy_lints::derive::unsafe_derive_deserialize::check (1,377x) 11,016 ( 0.00%) derive_partial_eq_without_eq::check(cx, item.span, trait_ref, ty, adt_hir_id); 4,263,365 ( 0.04%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/derive/derive_partial_eq_without_eq.rs:clippy_lints::derive::derive_partial_eq_without_eq::check (1,377x) . } else { 2,505 ( 0.00%) expl_impl_clone_on_copy::check(cx, item, trait_ref, ty, adt_hir_id); 43,587 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/derive/expl_impl_clone_on_copy.rs:clippy_lints::derive::expl_impl_clone_on_copy::check (501x) . } . } 47,504 ( 0.00%) } . } 4,257 ( 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/dep_graph/mod.rs -------------------------------------------------------------------------------- Ir -- line 66 ---------------------------------------- . }) . } . . /// Access dependencies from current implicit context. . fn read_deps(op: OP) . where . OP: for<'a> FnOnce(TaskDepsRef<'a>), . { 1,281,210 ( 0.01%) ty::tls::with_context_opt(|icx| { 141,238 ( 0.00%) let Some(icx) = icx else { return }; 70,619 ( 0.00%) op(icx.task_deps) 1,464,240 ( 0.01%) }) . } . . impl<'tcx> TyCtxt<'tcx> { . #[inline] . pub fn dep_kind_vtable(self, dk: DepKind) -> &'tcx DepKindVTable<'tcx> { . &self.dep_kind_vtables[dk.as_usize()] . } . -- line 85 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 66,094 ( 0.00%) fn check_generics(&mut self, cx: &EarlyContext<'_>, generics: &Generics) { . for param in &generics.params { . builtin_type_shadow::check(cx, param); . } 75,536 ( 0.00%) } . 498,699 ( 0.00%) fn check_pat(&mut self, cx: &EarlyContext<'_>, pat: &Pat) { 166,233 ( 0.00%) unneeded_field_pattern::check(cx, pat); 1,157,662 ( 0.01%) => /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 (55,411x) 166,233 ( 0.00%) redundant_pattern::check(cx, pat); 1,219,066 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/misc_early/redundant_pattern.rs:clippy_lints::misc_early::redundant_pattern::check (55,411x) 166,233 ( 0.00%) redundant_at_rest_pattern::check(cx, pat); 166,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 (55,411x) . unneeded_wildcard_pattern::check(cx, pat); 443,288 ( 0.00%) } . 1,416,289 ( 0.01%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { . // `check_lit` only lints integer literals and suffixed float literals. 429,004 ( 0.00%) if let ExprKind::Lit(lit) = expr.kind 22,887 ( 0.00%) && match lit.kind { . token::LitKind::Integer => true, . token::LitKind::Float => lit.suffix.is_some(), . _ => false, . } 20,457 ( 0.00%) && !expr.span.in_external_macro(cx.sess().source_map()) . { . MiscEarlyLints::check_lit(cx, lit, expr.span); . } 1,618,616 ( 0.01%) } . } . . 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. 12,624 ( 0.00%) let lit_snip = match snippet_opt(cx, span) { 6,312 ( 0.00%) Some(snip) if snip.starts_with(|c: char| c.is_ascii_digit()) => snip, . _ => return, . }; . 6,312 ( 0.00%) let lit_kind = LitKind::from_token_lit(lit); 1,388,280 ( 0.01%) => ???:::from_token_lit (6,312x) 37,872 ( 0.00%) if let Ok(LitKind::Int(value, lit_int_type)) = lit_kind { 25,017 ( 0.00%) let suffix = match lit_int_type { . LitIntType::Signed(ty) => ty.name_str(), . LitIntType::Unsigned(ty) => ty.name_str(), . LitIntType::Unsuffixed => "", . }; 63,120 ( 0.00%) literal_suffix::check(cx, span, &lit_snip, suffix, "integer"); 1,087,594 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/misc_early/literal_suffix.rs:clippy_lints::misc_early::literal_suffix::check (6,312x) 3,609 ( 0.00%) if lit_snip.starts_with("0x") { 16,824 ( 0.00%) mixed_case_hex_literals::check(cx, span, suffix, &lit_snip); 210,830 ( 0.00%) => /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 (2,103x) 16,494 ( 0.00%) } else if lit_snip.starts_with("0b") || lit_snip.starts_with("0o") { . // nothing to do 2,936 ( 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 ---------------------------------------- 94,966 ( 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/collections/btree/map.rs -------------------------------------------------------------------------------- Ir -- line 199 ---------------------------------------- . // is live, it's unnecessary to store the allocator in each node. . pub(super) alloc: ManuallyDrop, . // For dropck; the `Box` avoids making the `Unpin` impl more strict than before . _marker: PhantomData>, . } . . #[stable(feature = "btree_drop", since = "1.7.0")] . unsafe impl<#[may_dangle] K, #[may_dangle] V, A: Allocator + Clone> Drop for BTreeMap { 6 ( 0.00%) fn drop(&mut self) { . drop(unsafe { ptr::read(self) }.into_iter()) 7 ( 0.00%) } . } . . // FIXME: This implementation is "wrong", but changing it would be a breaking change. . // (The bounds of the automatic `UnwindSafe` implementation have been like this since Rust 1.50.) . // Maybe we can fix it nonetheless with a crater run, or if the `UnwindSafe` . // traits are deprecated, or disarmed (no longer causing hard errors) in the future. . #[stable(feature = "btree_unwindsafe", since = "1.64.0")] . impl core::panic::UnwindSafe for BTreeMap -- line 217 ---------------------------------------- -- line 1037 ---------------------------------------- . /// . /// map.insert(37, "b"); . /// assert_eq!(map.insert(37, "c"), Some("b")); . /// assert_eq!(map[&37], "c"); . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_confusables("push", "put", "set")] . #[cfg_attr(not(test), rustc_diagnostic_item = "btreemap_insert")] 315 ( 0.00%) pub fn insert(&mut self, key: K, value: V) -> Option . where . K: Ord, . { . match self.entry(key) { . Occupied(mut entry) => Some(entry.insert(value)), 175 ( 0.00%) Vacant(entry) => { 280 ( 0.00%) entry.insert(value); 35 ( 0.00%) None . } . } 315 ( 0.00%) } . . /// 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. . /// . /// # Examples -- line 1064 ---------------------------------------- -- line 1493 ---------------------------------------- . /// count.entry(x).and_modify(|curr| *curr += 1).or_insert(1); . /// } . /// . /// assert_eq!(count["a"], 3); . /// assert_eq!(count["b"], 2); . /// assert_eq!(count["c"], 1); . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] 721 ( 0.00%) pub fn entry(&mut self, key: K) -> Entry<'_, K, V, A> . where . K: Ord, . { . let (map, dormant_map) = DormantMutRef::new(self); 12,474 ( 0.00%) match map.root { 2 ( 0.00%) None => Vacant(VacantEntry { 4 ( 0.00%) key, . handle: None, . dormant_map, . alloc: (*map.alloc).clone(), . _marker: PhantomData, . }), . Some(ref mut root) => match root.borrow_mut().search_tree(&key) { . Found(handle) => Occupied(OccupiedEntry { . handle, . dormant_map, . alloc: (*map.alloc).clone(), . _marker: PhantomData, . }), 510 ( 0.00%) GoDown(handle) => Vacant(VacantEntry { 510 ( 0.00%) key, . handle: Some(handle), . dormant_map, . alloc: (*map.alloc).clone(), . _marker: PhantomData, . }), 102 ( 0.00%) }, . } 927 ( 0.00%) } . . /// Splits the collection into two at the given key. Returns everything after the given key, . /// including the key. If the key is not present, the split will occur at the nearest . /// greater key, or return an empty map if no such key exists. . /// . /// # Examples . /// . /// ``` -- line 1538 ---------------------------------------- -- line 1728 ---------------------------------------- . } . } . . #[stable(feature = "rust1", since = "1.0.0")] . impl<'a, K: 'a, V: 'a> Iterator for Iter<'a, K, V> { . type Item = (&'a K, &'a V); . . fn next(&mut self) -> Option<(&'a K, &'a V)> { 8,475 ( 0.00%) if self.length == 0 { . None . } else { 5,576 ( 0.00%) self.length -= 1; . Some(unsafe { self.range.next_unchecked() }) . } . } . . fn size_hint(&self) -> (usize, Option) { . (self.length, Some(self.length)) . } . -- line 1747 ---------------------------------------- -- line 1878 ---------------------------------------- . #[stable(feature = "rust1", since = "1.0.0")] . impl IntoIterator for BTreeMap { . type Item = (K, V); . type IntoIter = IntoIter; . . /// Gets an owning iterator over the entries of the map, sorted by key. . fn into_iter(self) -> IntoIter { . let mut me = ManuallyDrop::new(self); 10 ( 0.00%) if let Some(root) = me.root.take() { . let full_range = root.into_dying().full_range(); . 14 ( 0.00%) IntoIter { . range: full_range, . length: me.length, . alloc: unsafe { ManuallyDrop::take(&mut me.alloc) }, . } . } else { . IntoIter { . range: LazyLeafRange::none(), . length: 0, -- line 1897 ---------------------------------------- -- line 1912 ---------------------------------------- . // don't have to care about panics this time (they'll abort). . while let Some(kv) = self.0.dying_next() { . // SAFETY: we consume the dying handle immediately. . unsafe { kv.drop_key_val() }; . } . } . } . 20,253 ( 0.00%) while let Some(kv) = self.dying_next() { 5,750 ( 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:>::dying_next (104x) . let guard = DropGuard(self); . // SAFETY: we don't touch the tree before consuming the dying handle. . unsafe { kv.drop_key_val() }; . mem::forget(guard); . } . } . } . . impl IntoIter { . /// Core of a `next` method returning a dying KV handle, . /// invalidated by further calls to this function and some others. 23,448 ( 0.00%) fn dying_next( . &mut self, . ) -> Option, marker::KV>> { 8,793 ( 0.00%) if self.length == 0 { . self.range.deallocating_end(self.alloc.clone()); 5 ( 0.00%) None . } else { 5,852 ( 0.00%) self.length -= 1; 11,704 ( 0.00%) Some(unsafe { self.range.deallocating_next_unchecked(self.alloc.clone()) }) . } 23,448 ( 0.00%) } . . /// Core of a `next_back` method returning a dying KV handle, . /// invalidated by further calls to this function and some others. . fn dying_next_back( . &mut self, . ) -> Option, marker::KV>> { . if self.length == 0 { . self.range.deallocating_end(self.alloc.clone()); -- line 1950 ---------------------------------------- -- line 1957 ---------------------------------------- . } . . #[stable(feature = "rust1", since = "1.0.0")] . impl Iterator for IntoIter { . type Item = (K, V); . . fn next(&mut self) -> Option<(K, V)> { . // SAFETY: we consume the dying handle immediately. 108 ( 0.00%) self.dying_next().map(unsafe { |kv| kv.into_key_val() }) 2,012 ( 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:>::dying_next (36x) . } . . fn size_hint(&self) -> (usize, Option) { . (self.length, Some(self.length)) . } . } . . #[stable(feature = "rust1", since = "1.0.0")] -- line 1973 ---------------------------------------- -- line 2062 ---------------------------------------- . Keys { inner: Default::default() } . } . } . . #[stable(feature = "rust1", since = "1.0.0")] . impl<'a, K, V> Iterator for Values<'a, K, V> { . type Item = &'a V; . 2,789 ( 0.00%) fn next(&mut self) -> Option<&'a V> { . self.inner.next().map(|(_, v)| v) 5,578 ( 0.00%) } . . fn size_hint(&self) -> (usize, Option) { . self.inner.size_hint() . } . . fn last(mut self) -> Option<&'a V> { . self.next_back() . } -- line 2080 ---------------------------------------- -- line 2696 ---------------------------------------- . /// println!("{key}: {value}"); . /// } . /// . /// let (first_key, first_value) = map.iter().next().unwrap(); . /// assert_eq!((*first_key, *first_value), (1, "a")); . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . pub fn iter(&self) -> Iter<'_, K, V> { 10 ( 0.00%) if let Some(root) = &self.root { . let full_range = root.reborrow().full_range(); . . Iter { range: full_range, length: self.length } . } else { . Iter { range: LazyLeafRange::none(), length: 0 } . } . } . -- line 2712 ---------------------------------------- 3,912 ( 0.00%) -------------------------------------------------------------------------------- -- 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; . 2,180,052 ( 0.02%) pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>) { 484,456 ( 0.00%) if expr.span.from_expansion() { 12,677 ( 0.00%) if let Some(macro_call) = root_macro_call_first_node(cx, expr) 12,677 ( 0.00%) && let Some(diag_name) = cx.tcx.get_diagnostic_name(macro_call.def_id) 142,222 ( 0.00%) => ???:::get_diagnostic_name (1,811x) . { . let result = match diag_name { 8,120 ( 0.00%) sym::assert_eq_macro | sym::debug_assert_eq_macro => "succeed", . sym::assert_ne_macro | sym::debug_assert_ne_macro => "fail", . _ => return, . }; 1,890 ( 0.00%) let Some((lhs, rhs, _)) = find_assert_eq_args(cx, expr, macro_call.expn) else { 716,091 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::find_assert_eq_args (210x) . return; . }; . if is_unit_expr(lhs) || is_unit_expr(rhs) { . return; . } 210 ( 0.00%) if !cx.typeck_results().expr_ty(lhs).is_unit() { 8,424 ( 0.00%) => ???:::expr_ty (210x) . return; . } . span_lint( . cx, . UNIT_CMP, . macro_call.span, . format!( . "`{}` of unit values detected. This will always {result}", . cx.tcx.item_name(macro_call.def_id) . ), . ); . } . return; . } . 328,910 ( 0.00%) if let ExprKind::Binary(ref cmp, left, _) = expr.kind { 3,946 ( 0.00%) let op = cmp.node; 2,819 ( 0.00%) if op.is_comparison() && cx.typeck_results().expr_ty(left).is_unit() { 112,796 ( 0.00%) => ???:::expr_ty (2,819x) . 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() . ), . ); . } . } 1,937,824 ( 0.02%) } 8,340 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/methods/unwrap_expect_used.rs -------------------------------------------------------------------------------- Ir -- line 22 ---------------------------------------- . (Variant::Unwrap, true) => "unwrap_err", . (Variant::Unwrap, false) => "unwrap", . (Variant::Expect, true) => "expect_err", . (Variant::Expect, false) => "expect", . } . } . . fn lint(self) -> &'static Lint { 4,213 ( 0.00%) match self { . Variant::Unwrap => UNWRAP_USED, . Variant::Expect => EXPECT_USED, . } . } . } . . /// Lint usage of `unwrap` or `unwrap_err` for `Result` and `unwrap()` for `Option` (and their . /// `expect` counterparts). . #[allow(clippy::too_many_arguments)] 4,668 ( 0.00%) pub(super) fn check( . cx: &LateContext<'_>, . expr: &Expr<'_>, . recv: &Expr<'_>, . is_err: bool, . allow_unwrap_in_consts: bool, . allow_unwrap_in_tests: bool, . unwrap_allowed_ids: &rustc_data_structures::fx::FxHashSet, . unwrap_allowed_aliases: &[rustc_hir::def_id::DefId], . variant: Variant, . ) { 1,167 ( 0.00%) let ty = cx.typeck_results().expr_ty(recv).peel_refs(); 15,672 ( 0.00%) => ???:::expr_ty (389x) . 3,662 ( 0.00%) let (kind, none_value, none_prefix) = match ty.opt_diag_name(cx) { 574 ( 0.00%) Some(sym::Option) if !is_err => ("an `Option`", "None", ""), . Some(sym::Result) 192 ( 0.00%) if let ty::Adt(_, substs) = ty.kind() 480 ( 0.00%) && let Some(t_or_e_ty) = substs[usize::from(!is_err)].as_type() => . { 294 ( 0.00%) if is_never_like(t_or_e_ty) { . return; . } . 192 ( 0.00%) ("a `Result`", if is_err { "Ok" } else { "Err" }, "an ") . }, . _ => return, . }; . 766 ( 0.00%) let method_suffix = if is_err { "_err" } else { "" }; . 3,062 ( 0.00%) if let ty::Adt(adt, _) = ty.kind() . && unwrap_allowed_ids.contains(&adt.did()) . { . return; . } . . for &def_id in unwrap_allowed_aliases { . let alias_ty = cx.tcx.type_of(def_id).instantiate_identity().skip_norm_wip(); . if let (ty::Adt(adt, substs), ty::Adt(alias_adt, alias_substs)) = (ty.kind(), alias_ty.kind()) -- line 78 ---------------------------------------- -- line 98 ---------------------------------------- . } . } . if all_match { . return; . } . } . } . 766 ( 0.00%) if allow_unwrap_in_tests && is_in_test(cx.tcx, expr.hir_id) { . return; . } . 3,064 ( 0.00%) if allow_unwrap_in_consts && is_inside_always_const_context(cx.tcx, expr.hir_id) { 436,016 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_inside_always_const_context (383x) . return; . } . 2,681 ( 0.00%) span_lint_and_then( 634,777 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then:: (383x) . cx, . variant.lint(), 383 ( 0.00%) expr.span, 2,298 ( 0.00%) format!("used `{}()` on {kind} value", variant.method_name(is_err)), 3,447 ( 0.00%) |diag| { . diag.note(format!("if this value is {none_prefix}`{none_value}`, it will panic")); . . if variant == Variant::Unwrap && is_lint_allowed(cx, EXPECT_USED, expr.hir_id) { . diag.help(format!( . "consider using `expect{method_suffix}()` to provide a better panic message" . )); . } . }, . ); 3,112 ( 0.00%) } . . #[expect(clippy::too_many_arguments, clippy::fn_params_excessive_bools)] 117,502 ( 0.00%) pub(super) fn check_call( . cx: &LateContext<'_>, . expr: &Expr<'_>, . func: &Expr<'_>, . args: &[Expr<'_>], . allow_unwrap_in_consts: bool, . allow_unwrap_in_tests: bool, . allow_expect_in_consts: bool, . allow_expect_in_tests: bool, . unwrap_allowed_ids: &rustc_data_structures::fx::FxHashSet, . unwrap_allowed_aliases: &[rustc_hir::def_id::DefId], . ) { . let Some(recv) = args.first() else { . return; . }; 147,125 ( 0.00%) let Some((DefKind::AssocFn, def_id)) = cx.typeck_results().type_dependent_def(func.hir_id) else { 736,764 ( 0.01%) => ???:::type_dependent_def (15,737x) . return; . }; . 7,053 ( 0.00%) match cx.tcx.item_name(def_id) { . sym::unwrap => { . check( . cx, . expr, . recv, . false, . allow_unwrap_in_consts, . allow_unwrap_in_tests, -- line 159 ---------------------------------------- -- line 198 ---------------------------------------- . allow_expect_in_tests, . unwrap_allowed_ids, . unwrap_allowed_aliases, . Variant::Expect, . ); . }, . _ => (), . } 134,288 ( 0.00%) } 19,665 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/types/redundant_allocation.rs -------------------------------------------------------------------------------- Ir -- line 7 ---------------------------------------- . use rustc_hir::{self as hir, QPath, TyKind}; . use rustc_hir_analysis::lower_ty; . use rustc_lint::LateContext; . use rustc_middle::ty::TypeVisitableExt as _; . use rustc_span::symbol::sym; . . use super::{REDUNDANT_ALLOCATION, utils}; . 99,720 ( 0.00%) pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, hir_ty: &hir::Ty<'tcx>, qpath: &QPath<'tcx>, def_id: DefId) -> bool { 8,310 ( 0.00%) let mut applicability = Applicability::MaybeIncorrect; 83,076 ( 0.00%) let outer_sym = match cx.tcx.get_diagnostic_name(def_id) { 458,701 ( 0.00%) => ???:::get_diagnostic_name (8,310x) 16,626 ( 0.00%) _ if Some(def_id) == cx.tcx.lang_items().owned_box() => "Box", 332,400 ( 0.00%) => ???:::lang_items (8,310x) . Some(sym::Rc) => "Rc", . Some(sym::Arc) => "Arc", . _ => return false, . }; . . if let Some(span) = utils::match_borrows_parameter(cx, qpath) { . let generic_snippet = snippet_with_applicability(cx, span, "..", &mut applicability); . span_lint_and_then( -- line 26 ---------------------------------------- -- line 33 ---------------------------------------- . diag.note(format!( . "`{generic_snippet}` is already a pointer, `{outer_sym}<{generic_snippet}>` allocates a pointer on the heap" . )); . }, . ); . return true; . } . 12 ( 0.00%) let Some(ty) = qpath_generic_tys(qpath).next() else { 114 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::qpath_generic_tys (6x) . return false; . }; . let Some(id) = ty.basic_res().opt_def_id() else { . return false; . }; 16 ( 0.00%) let (inner_sym, ty) = match cx.tcx.get_diagnostic_name(id) { 106 ( 0.00%) => ???:::get_diagnostic_name (2x) . Some(sym::Arc) => ("Arc", ty), . Some(sym::Rc) => ("Rc", ty), 4 ( 0.00%) _ if Some(id) == cx.tcx.lang_items().owned_box() => ("Box", ty), 80 ( 0.00%) => ???:::lang_items (2x) . _ => return false, . }; . . let TyKind::Path(inner_qpath) = &ty.kind else { . return false; . }; . let inner_span = match qpath_generic_tys(inner_qpath).next() { . Some(hir_ty) => { -- line 58 ---------------------------------------- -- line 99 ---------------------------------------- . )); . diag.help(format!( . "consider using just `{outer_sym}<{generic_snippet}>` or `{inner_sym}<{generic_snippet}>`" . )); . }, . ); . } . true 66,480 ( 0.00%) } 8,356 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/cognitive_complexity.rs -------------------------------------------------------------------------------- Ir -- line 62 ---------------------------------------- . decl: &'tcx FnDecl<'_>, . expr: &'tcx Expr<'_>, . body_span: Span, . ) { . if body_span.from_expansion() { . return; . } . 3,663 ( 0.00%) let mut cc = 1u64; 3,663 ( 0.00%) let mut returns = 0u64; 3,663 ( 0.00%) let mut prev_expr: Option<&ExprKind<'tcx>> = None; . let _: Option = for_each_expr_without_closures(expr, |e| { 1,981,441 ( 0.02%) match e.kind { . ExprKind::If(_, _, _) => { . cc += 1; . }, 4,758 ( 0.00%) ExprKind::Match(_, arms, _) => { 4,758 ( 0.00%) if arms.len() > 1 { 3,744 ( 0.00%) cc += 1; . } . cc += arms.iter().filter(|arm| arm.guard.is_some()).count() as u64; . }, 23,226 ( 0.00%) ExprKind::Ret(_) if !matches!(prev_expr, Some(ExprKind::Ret(_))) => { 3,318 ( 0.00%) returns += 1; . }, . _ => {}, . } 419,452 ( 0.00%) prev_expr = Some(&e.kind); . ControlFlow::Continue(()) . }); . 10,989 ( 0.00%) let ret_ty = cx.typeck_results().node_type(expr.hir_id); 150,243 ( 0.00%) => ???:::node_type (3,663x) 3,422 ( 0.00%) let ret_adjust = if ret_ty.is_diag_item(cx, sym::Result) { 305 ( 0.00%) returns . } else { . #[expect(clippy::integer_division)] 6,716 ( 0.00%) (returns / 2) . }; . . // prevent degenerate cases where unreachable code contains `return` statements 18,315 ( 0.00%) if cc >= ret_adjust { 7,310 ( 0.00%) cc -= ret_adjust; . } . 7,326 ( 0.00%) if cc > self.limit.limit() { 34 ( 0.00%) let fn_span = match kind { . FnKind::ItemFn(ident, _, _) | FnKind::Method(ident, _) => ident.span, . FnKind::Closure => { . let header_span = body_span.with_hi(decl.output.span().lo()); . if let Some(range) = header_span.map_range(cx, |_, src, range| { . let mut idxs = src.get(range.clone())?.match_indices('|'); . Some(range.start + idxs.next()?.0..range.start + idxs.next()?.0 + 1) . }) { . range.with_ctxt(header_span.ctxt()) -- line 115 ---------------------------------------- -- line 118 ---------------------------------------- . } . }, . }; . . span_lint_and_help( . cx, . COGNITIVE_COMPLEXITY, . fn_span, 119 ( 0.00%) format!( . "the function has a cognitive complexity of ({cc}/{})", . self.limit.limit() . ), 17 ( 0.00%) None, . "you could split it up into multiple smaller functions", . ); . } . } . } . . impl<'tcx> LateLintPass<'tcx> for CognitiveComplexity { 85,740 ( 0.00%) fn check_fn( . &mut self, . cx: &LateContext<'tcx>, . kind: FnKind<'tcx>, . decl: &'tcx FnDecl<'_>, . body: &'tcx Body<'_>, . span: Span, . def_id: LocalDefId, . ) { . #[allow(deprecated)] 5,716 ( 0.00%) if cx.tcx.get_attrs(def_id, sym::test).next().is_none() { 62,876 ( 0.00%) let expr = if kind.asyncness().is_async() { 60,293 ( 0.00%) => ???:::asyncness (5,716x) . match get_async_fn_body(cx.tcx, body) { . Some(b) => b, . None => { . return; . }, . } . } else { 5,716 ( 0.00%) body.value . }; . 28,580 ( 0.00%) self.check(cx, kind, decl, expr, span); . } 45,728 ( 0.00%) } . . fn check_attributes(&mut self, cx: &LateContext<'tcx>, attrs: &'tcx [Attribute]) { . self.limit.push_attrs(cx.sess(), attrs, sym::cognitive_complexity); . } . fn check_attributes_post(&mut self, cx: &LateContext<'tcx>, attrs: &'tcx [Attribute]) { . self.limit.pop_attrs(cx.sess(), attrs, sym::cognitive_complexity); . } . } -- line 170 ---------------------------------------- 275,218 ( 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); 682,742 ( 0.01%) let mut other_attrs = ThinVec::::with_capacity(if doc_only { 0 } else { size_hint }); . for (attr, item_id) in attrs { 6 ( 0.00%) if let Some((doc_str, fragment_kind)) = attr.doc_str_and_fragment_kind() { 32,517 ( 0.00%) let doc = beautify_doc_string(doc_str, fragment_kind.comment_kind()); 1,345,682 ( 0.01%) => ???:rustc_ast::util::comments::beautify_doc_string (10,839x) 43,356 ( 0.00%) let attr_span = attr.span(); 21,846 ( 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(); . 334,148 ( 0.00%) unindent_doc_fragments(&mut doc_fragments); 9,845,636 ( 0.08%) => ???:rustc_resolve::rustdoc::unindent_doc_fragments (334,148x) . 2,004,888 ( 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 ---------------------------------------- 36,124 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/vec_init_then_push.rs -------------------------------------------------------------------------------- Ir -- line 57 ---------------------------------------- . lhs_is_let: bool, . let_ty_span: Option, . name: Symbol, . err_span: Span, . found: u128, . last_push_expr: HirId, . } . impl VecPushSearcher { 105 ( 0.00%) fn display_err(&self, cx: &LateContext<'_>) { . let required_pushes_before_extension = match self.init { 75 ( 0.00%) _ if self.found == 0 => return, . VecInitKind::WithConstCapacity(x) if x > self.found => return, . VecInitKind::WithConstCapacity(x) => x, . VecInitKind::WithExprCapacity(_) => return, . _ => 3, . }; . . let mut needs_mut = false; . let res = for_each_local_use_after_expr(cx, self.local_id, self.last_push_expr, |e| { -- line 75 ---------------------------------------- -- line 142 ---------------------------------------- . cx, . VEC_INIT_THEN_PUSH, . self.err_span, . "calls to `push` immediately after creation", . "consider using the `vec![]` macro", . s, . Applicability::HasPlaceholders, . ); 120 ( 0.00%) } . } . . impl<'tcx> LateLintPass<'tcx> for VecInitThenPush { . fn check_block(&mut self, _: &LateContext<'tcx>, _: &'tcx Block<'tcx>) { 21,792 ( 0.00%) self.searcher = None; . } . 140,427 ( 0.00%) fn check_local(&mut self, cx: &LateContext<'tcx>, local: &'tcx LetStmt<'tcx>) { 60,183 ( 0.00%) if let Some(init_expr) = local.init 140,944 ( 0.00%) && let PatKind::Binding(BindingMode::MUT, id, name, None) = local.pat.kind 3,528 ( 0.00%) && !local.span.in_external_macro(cx.sess().source_map()) 5,590 ( 0.00%) && let Some(init) = get_vec_init_kind(cx, init_expr) 66,360 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:clippy_utils::higher::get_vec_init_kind (1,118x) 38 ( 0.00%) && !matches!(init, VecInitKind::WithExprCapacity(_)) . { 240 ( 0.00%) self.searcher = Some(VecPushSearcher { . local_id: id, . init, . lhs_is_let: true, 22 ( 0.00%) let_ty_span: local.ty.map(|ty| ty.span), . name: name.name, . err_span: local.span, . found: 0, 16 ( 0.00%) last_push_expr: init_expr.hir_id, . }); . } 160,488 ( 0.00%) } . . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 726,596 ( 0.01%) if self.searcher.is_none() 406 ( 0.00%) && let ExprKind::Assign(left, right, _) = expr.kind 1,357 ( 0.00%) && let ExprKind::Path(QPath::Resolved(None, path)) = left.kind 218 ( 0.00%) && let [name] = &path.segments 327 ( 0.00%) && let Res::Local(id) = path.res 872 ( 0.00%) && !expr.span.in_external_macro(cx.sess().source_map()) 13,103 ( 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 (109x) 547 ( 0.00%) && let Some(init) = get_vec_init_kind(cx, right) 4,113 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:clippy_utils::higher::get_vec_init_kind (109x) . && !matches!(init, VecInitKind::WithExprCapacity(_)) . { 14 ( 0.00%) self.searcher = Some(VecPushSearcher { . local_id: id, . init, . lhs_is_let: false, . let_ty_span: None, 1 ( 0.00%) name: name.ident.name, . err_span: expr.span, . found: 0, 1 ( 0.00%) last_push_expr: expr.hir_id, . }); . } 242,228 ( 0.00%) } . . fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx Stmt<'_>) { 63,574 ( 0.00%) if let Some(searcher) = self.searcher.take() { 33 ( 0.00%) if let StmtKind::Expr(expr) | StmtKind::Semi(expr) = stmt.kind 10 ( 0.00%) && !stmt.span.from_expansion() 13 ( 0.00%) && let ExprKind::MethodCall(name, self_arg, [_], _) = expr.kind 2 ( 0.00%) && 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), . found: searcher.found + 1, . last_push_expr: expr.hir_id, . ..searcher . }); . } else { 14 ( 0.00%) searcher.display_err(cx); 280 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/vec_init_then_push.rs:::display_err (14x) . } . } 31,696 ( 0.00%) } . . fn check_block_post(&mut self, cx: &LateContext<'tcx>, _: &'tcx Block<'tcx>) { 43,598 ( 0.00%) if let Some(searcher) = self.searcher.take() { 2 ( 0.00%) searcher.display_err(cx); 20 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/vec_init_then_push.rs:::display_err (1x) . } . } . } 9,883 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/lifetimes.rs -------------------------------------------------------------------------------- Ir -- line 136 ---------------------------------------- . . impl Lifetimes { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl<'tcx> LateLintPass<'tcx> for Lifetimes { 53,442 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) { 13,466 ( 0.00%) if let ItemKind::Fn { . ref sig, 1,233 ( 0.00%) generics, 3,699 ( 0.00%) body: id, . .. 11,876 ( 0.00%) } = item.kind . { 7,398 ( 0.00%) check_fn_inner(cx, sig, Some(id), None, generics, item.span, true, self.msrv, || { . is_from_proc_macro(cx, item) . }); . } else if let ItemKind::Impl(impl_) = &item.kind 4,348 ( 0.00%) && !item.span.from_expansion() 1,176 ( 0.00%) && !is_from_proc_macro(cx, item) . { . report_extra_impl_lifetimes(cx, impl_); . } 47,504 ( 0.00%) } . 15,984 ( 0.00%) fn check_poly_trait_ref(&mut self, cx: &LateContext<'tcx>, poly_trait_ref: &'tcx PolyTraitRef<'tcx>) { 3,552 ( 0.00%) if !poly_trait_ref.span.from_expansion() { 3,124 ( 0.00%) report_extra_trait_object_lifetimes(cx, poly_trait_ref.bound_generic_params, &poly_trait_ref.trait_ref); . } 14,208 ( 0.00%) } . 28,777 ( 0.00%) fn check_impl_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx ImplItem<'_>) { 28,186 ( 0.00%) if let ImplItemKind::Fn(ref sig, id) = item.kind { 11,742 ( 0.00%) let report_extra_lifetimes = trait_ref_of_method(cx, item.owner_id).is_none(); 602,292 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::trait_ref_of_method (3,914x) 3,914 ( 0.00%) check_fn_inner( . cx, . sig, . Some(id), . None, 7,828 ( 0.00%) item.generics, 3,914 ( 0.00%) item.span, . report_extra_lifetimes, 3,914 ( 0.00%) self.msrv, . || is_from_proc_macro(cx, item), . ); . } 32,888 ( 0.00%) } . 8,841 ( 0.00%) fn check_trait_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx TraitItem<'_>) { 5,052 ( 0.00%) if let TraitItemKind::Fn(ref sig, ref body) = item.kind { 13,596 ( 0.00%) let (body, trait_sig) = match *body { . TraitFn::Required(sig) => (None, Some(sig)), . TraitFn::Provided(id) => (Some(id), None), . }; 2,472 ( 0.00%) check_fn_inner( . cx, . sig, . body, . trait_sig, 2,472 ( 0.00%) item.generics, 1,236 ( 0.00%) item.span, . true, 1,236 ( 0.00%) self.msrv, . || is_from_proc_macro(cx, item), . ); . } 10,104 ( 0.00%) } . } . . #[expect(clippy::too_many_arguments)] . fn check_fn_inner<'tcx>( . cx: &LateContext<'tcx>, . sig: &'tcx FnSig<'_>, . body: Option, . trait_sig: Option<&[Option]>, . generics: &'tcx Generics<'_>, . span: Span, . report_extra_lifetimes: bool, . msrv: Msrv, . is_from_proc_macro: impl FnOnce() -> bool, . ) { 54,862 ( 0.00%) if span.in_external_macro(cx.sess().source_map()) || has_where_lifetimes(cx, generics) { 143,557 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/lifetimes.rs:clippy_lints::lifetimes::has_where_lifetimes (2,795x) . return; . } . 10,510 ( 0.00%) let types = generics . .params . .iter() 7,396 ( 0.00%) .filter(|param| matches!(param.kind, GenericParamKind::Type { .. })); . . for typ in types { 1,217 ( 0.00%) if !typ.span.eq_ctxt(span) { . return; . } . . for pred in generics.bounds_for_param(typ.def_id) { 1,212 ( 0.00%) if pred.origin == PredicateOrigin::WhereClause { . // has_where_lifetimes checked that this predicate contains no lifetime. . continue; . } . 1,181 ( 0.00%) for bound in pred.bounds { . let mut visitor = RefVisitor::new(cx); 3,597 ( 0.00%) walk_param_bound(&mut visitor, bound); 27,543 ( 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:: (84x) . if visitor.lts.iter().any(|lt| matches!(lt.kind, LifetimeKind::Param(_))) { . return; . } 2,398 ( 0.00%) if let GenericBound::Trait(ref trait_ref) = *bound { 3,597 ( 0.00%) let params = &trait_ref . .trait_ref . .path . .segments . .last() . .expect("a path must have at least one segment") . .args; 3,597 ( 0.00%) if let Some(params) = *params { 420 ( 0.00%) let lifetimes = params.args.iter().filter_map(|arg| match arg { . GenericArg::Lifetime(lt) => Some(lt), . _ => None, . }); 144 ( 0.00%) for bound in lifetimes { . if bound.kind != LifetimeKind::Static && !bound.is_elided() { . return; . } . } . } . } 2,056 ( 0.00%) } 10,409 ( 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:: (1,028x) . } . } . 65,843 ( 0.00%) let elidable = could_use_elision(cx, sig.decl, body, trait_sig, generics.params, msrv); 8,621,622 ( 0.07%) => site/frontend/rust-clippy/clippy_lints/src/lifetimes.rs:clippy_lints::lifetimes::could_use_elision (2,790x) . let has_elidable_lts = elidable . .as_ref() . .is_some_and(|(_, usages)| !usages.iter().any(|usage| !usage.ident.span.eq_ctxt(span))); . . // Only check is_from_proc_macro if we're about to emit a lint (it's an expensive check) 11,803 ( 0.00%) if (has_elidable_lts || report_extra_lifetimes) && is_from_proc_macro() { . return; . } . 3,865 ( 0.00%) if let Some((elidable_lts, usages)) = elidable 14 ( 0.00%) && has_elidable_lts . { . // async functions have usages whose spans point at the lifetime declaration which messes up . // suggestions . let include_suggestions = !sig.header.is_async(); 42 ( 0.00%) report_elidable_lifetimes(cx, generics, &elidable_lts, &usages, include_suggestions); 1,020,627 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/lifetimes.rs:clippy_lints::lifetimes::report_elidable_lifetimes (6x) . } . 1,365 ( 0.00%) if report_extra_lifetimes { 19,150 ( 0.00%) self::report_extra_lifetimes(cx, sig.decl, generics); 620,299 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/lifetimes.rs:clippy_lints::lifetimes::report_extra_lifetimes (1,365x) . } . } . 78,825 ( 0.00%) fn could_use_elision<'tcx>( . cx: &LateContext<'tcx>, . func: &'tcx FnDecl<'_>, . body: Option, . trait_sig: Option<&[Option]>, . named_generics: &'tcx [GenericParam<'_>], . msrv: Msrv, . ) -> Option<(Vec, Vec)> { . // There are two scenarios where elision works: -- line 301 ---------------------------------------- -- line 307 ---------------------------------------- . // check named LTs . let allowed_lts = allowed_lts_from(named_generics); . . // these will collect all the lifetimes for references in arg/return types . let mut input_visitor = RefVisitor::new(cx); . let mut output_visitor = RefVisitor::new(cx); . . // extract lifetimes in input argument types 5,255 ( 0.00%) for arg in func.inputs { . input_visitor.visit_ty_unambig(arg); . } . // extract lifetimes in output type 15,418 ( 0.00%) if let Return(ty) = func.output { . output_visitor.visit_ty_unambig(ty); . } . for lt in named_generics { . input_visitor.visit_generic_param(lt); . } . 21,020 ( 0.00%) if input_visitor.abort() || output_visitor.abort() { 2 ( 0.00%) return None; . } . 21,012 ( 0.00%) let input_lts = input_visitor.lts; 26,265 ( 0.00%) let output_lts = output_visitor.lts; . 31,622 ( 0.00%) if let Some(&[trait_sig]) = trait_sig 624 ( 0.00%) && non_elidable_self_type(cx, func, trait_sig, msrv) 2,791 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/lifetimes.rs:clippy_lints::lifetimes::non_elidable_self_type (104x) . { . return None; . } . 10,506 ( 0.00%) if let Some(body_id) = body { 25,818 ( 0.00%) let body = cx.tcx.hir_body(body_id); 290,888 ( 0.00%) => ???:::hir_body (4,303x) . 8,320 ( 0.00%) let first_ident = body.params.first().and_then(|param| param.pat.simple_ident()); 25,818 ( 0.00%) if non_elidable_self_type(cx, func, first_ident, msrv) { 98,764 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/lifetimes.rs:clippy_lints::lifetimes::non_elidable_self_type (4,303x) . return None; . } . . let mut checker = BodyLifetimeChecker::new(cx); 12,909 ( 0.00%) if checker.visit_expr(body.value).is_break() { . return None; . } . } . . // check for lifetimes from higher scopes . for lt in input_lts.iter().chain(output_lts.iter()) { . if let Some(id) = named_lifetime(lt) 58 ( 0.00%) && !allowed_lts.contains(&id) . { . return None; . } . } . . // check for higher-ranked trait bounds 10,352 ( 0.00%) if !input_visitor.nested_elision_site_lts.is_empty() || !output_visitor.nested_elision_site_lts.is_empty() { . let allowed_lts: FxHashSet<_> = allowed_lts.iter().map(|id| cx.tcx.item_name(id.to_def_id())).collect(); 3 ( 0.00%) for lt in input_visitor.nested_elision_site_lts { . if allowed_lts.contains(<.ident.name) { . return None; . } . } 3 ( 0.00%) for lt in output_visitor.nested_elision_site_lts { . if allowed_lts.contains(<.ident.name) { . return None; . } . } . } . . // A lifetime can be newly elided if: . // - It occurs only once among the inputs. . // - If there are multiple input lifetimes, then the newly elided lifetime does not occur among the . // outputs (because eliding such an lifetime would create an ambiguity). . let elidable_lts = named_lifetime_occurrences(&input_lts) . .into_iter() . .filter_map(|(def_id, occurrences)| { 66 ( 0.00%) if occurrences == 1 38 ( 0.00%) && (input_lts.len() == 1 || !output_lts.iter().any(|lt| named_lifetime(lt) == Some(def_id))) . { . Some(def_id) . } else { . None . } . }) . .collect::>(); . 5,176 ( 0.00%) if elidable_lts.is_empty() { 5,169 ( 0.00%) return None; . } . 42 ( 0.00%) let usages = itertools::chain(input_lts, output_lts).collect(); . 126 ( 0.00%) Some((elidable_lts, usages)) 73,550 ( 0.00%) } . . fn allowed_lts_from(named_generics: &[GenericParam<'_>]) -> FxIndexSet { . named_generics . .iter() . .filter_map(|par| { 22,188 ( 0.00%) if let GenericParamKind::Lifetime { .. } = par.kind { . Some(par.def_id) . } else { . None . } . }) . .collect() . } . . // elision doesn't work for explicit self types before Rust 1.81, see rust-lang/rust#69064 17,628 ( 0.00%) fn non_elidable_self_type<'tcx>(cx: &LateContext<'tcx>, func: &FnDecl<'tcx>, ident: Option, msrv: Msrv) -> bool { 8,814 ( 0.00%) if let Some(ident) = ident 4,258 ( 0.00%) && ident.name == kw::SelfLower 8,031 ( 0.00%) && !func.implicit_self().has_implicit_self() 21,416 ( 0.00%) => ???:::implicit_self (2,677x) . && let Some(self_ty) = func.inputs.first() . && !msrv.meets(cx, msrvs::EXPLICIT_SELF_TYPE_ELISION) . { . let mut visitor = RefVisitor::new(cx); . visitor.visit_ty_unambig(self_ty); . . !visitor.all_lts().is_empty() . } else { . false . } 22,035 ( 0.00%) } . . /// Number of times each named lifetime occurs in the given slice. Returns a vector to preserve . /// relative order. . #[must_use] . fn named_lifetime_occurrences(lts: &[Lifetime]) -> Vec<(LocalDefId, usize)> { . let mut occurrences = Vec::new(); . for lt in lts { . if let Some(curr_def_id) = named_lifetime(lt) { . if let Some(pair) = occurrences . .iter_mut() . .find(|(prev_def_id, _)| *prev_def_id == curr_def_id) . { 28 ( 0.00%) pair.1 += 1; . } else { . occurrences.push((curr_def_id, 1)); . } . } . } 16,584 ( 0.00%) occurrences . } . . fn named_lifetime(lt: &Lifetime) -> Option { 50,996 ( 0.00%) match lt.kind { 12,700 ( 0.00%) LifetimeKind::Param(id) if !lt.is_anonymous() => Some(id), . _ => None, . } . } . . struct RefVisitor<'a, 'tcx> { . cx: &'a LateContext<'tcx>, . lts: Vec, . nested_elision_site_lts: Vec, . unelided_trait_object_lifetime: bool, . } . . impl<'a, 'tcx> RefVisitor<'a, 'tcx> { . fn new(cx: &'a LateContext<'tcx>) -> Self { 111,364 ( 0.00%) Self { . cx, . lts: Vec::new(), . nested_elision_site_lts: Vec::new(), . unelided_trait_object_lifetime: false, . } . } . . fn all_lts(&self) -> Vec { -- line 477 ---------------------------------------- -- line 488 ---------------------------------------- . } . . impl<'tcx> Visitor<'tcx> for RefVisitor<'_, 'tcx> { . // for lifetimes as parameters of generics . fn visit_lifetime(&mut self, lifetime: &'tcx Lifetime) { . self.lts.push(*lifetime); . } . 23,148 ( 0.00%) fn visit_poly_trait_ref(&mut self, poly_tref: &'tcx PolyTraitRef<'tcx>) { 2,572 ( 0.00%) let trait_ref = &poly_tref.trait_ref; 7,716 ( 0.00%) if let Some(id) = trait_ref.trait_def_id() 33,436 ( 0.00%) => ???:::trait_def_id (2,572x) 5,144 ( 0.00%) && lang_items::FN_TRAITS . .iter() 15,402 ( 0.00%) .any(|&item| self.cx.tcx.lang_items().get(item) == Some(id)) 308,040 ( 0.00%) => ???:::lang_items (7,701x) . { . let mut sub_visitor = RefVisitor::new(self.cx); . sub_visitor.visit_trait_ref(trait_ref); 6 ( 0.00%) self.nested_elision_site_lts.append(&mut sub_visitor.all_lts()); . } else { . walk_poly_trait_ref(self, poly_tref); . } 20,576 ( 0.00%) } . 216,056 ( 0.00%) fn visit_ty(&mut self, ty: &'tcx Ty<'_, AmbigArg>) { 135,033 ( 0.00%) match ty.kind { 2 ( 0.00%) TyKind::FnPtr(&FnPtrTy { decl, .. }) => { 1 ( 0.00%) let mut sub_visitor = RefVisitor::new(self.cx); . sub_visitor.visit_fn_decl(decl); 1 ( 0.00%) self.nested_elision_site_lts.append(&mut sub_visitor.all_lts()); . }, 264 ( 0.00%) TyKind::TraitObject(bounds, lt) => { . if !lt.is_elided() { 2 ( 0.00%) self.unelided_trait_object_lifetime = true; . } . for bound in bounds { 176 ( 0.00%) self.visit_poly_trait_ref(bound); 19,420 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/lifetimes.rs:::visit_poly_trait_ref (88x) . } . }, 242,262 ( 0.00%) _ => walk_ty(self, ty), 1,918,459 ( 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_ty:: (18,600x) . } 712 ( 0.00%) } . } . . /// Are any lifetimes mentioned in the `where` clause? If so, we don't try to . /// reason about elision. 42,096 ( 0.00%) fn has_where_lifetimes<'tcx>(cx: &LateContext<'tcx>, generics: &'tcx Generics<'_>) -> bool { . for predicate in generics.predicates { 6,150 ( 0.00%) match *predicate.kind { . WherePredicateKind::RegionPredicate(..) => return true, . WherePredicateKind::BoundPredicate(ref pred) => { . // a predicate like F: Trait or F: for<'a> Trait<'a> . let mut visitor = RefVisitor::new(cx); . // walk the type F, it may not contain LT refs 1,230 ( 0.00%) walk_unambig_ty(&mut visitor, pred.bounded_ty); 1,230 ( 0.00%) if !visitor.all_lts().is_empty() { . return true; . } . // if the bounds define new lifetimes, they are fine to occur 2,460 ( 0.00%) let allowed_lts = allowed_lts_from(pred.bound_generic_params); . // now walk the bounds 1,230 ( 0.00%) for bound in pred.bounds { . walk_param_bound(&mut visitor, bound); . } . // and check that all lifetimes are allowed 24 ( 0.00%) for lt in visitor.all_lts() { . if let Some(id) = named_lifetime(<) . && !allowed_lts.contains(&id) . { . return true; . } . } . }, . } . } . false 42,096 ( 0.00%) } . . #[expect(clippy::struct_excessive_bools)] . struct Usage { . lifetime: Lifetime, . in_where_predicate: bool, . in_bounded_ty: bool, . in_generics_arg: bool, . lifetime_elision_impossible: bool, -- line 571 ---------------------------------------- -- line 583 ---------------------------------------- . . impl<'cx, 'tcx, F> LifetimeChecker<'cx, 'tcx, F> . where . F: NestedFilter<'tcx>, . { . fn new(cx: &'cx LateContext<'tcx>, generic_params: &'tcx [GenericParam<'_>]) -> LifetimeChecker<'cx, 'tcx, F> { . let map = generic_params . .iter() 20,828 ( 0.00%) .filter_map(|par| match par.kind { . GenericParamKind::Lifetime { . kind: LifetimeParamKind::Explicit, 113 ( 0.00%) } => Some((par.def_id, Vec::new())), . _ => None, . }) . .collect(); . 23,920 ( 0.00%) Self { . cx, . map, . where_predicate_depth: 0, . bounded_ty_depth: 0, . generic_args_depth: 0, . lifetime_elision_impossible: false, . phantom: std::marker::PhantomData, . } -- line 607 ---------------------------------------- -- line 613 ---------------------------------------- . &mut self, . hir_id: HirId, . bounded_ty: &'tcx Ty<'tcx>, . bounds: &'tcx [GenericBound<'tcx>], . bound_generic_params: &'tcx [GenericParam<'tcx>], . ) { . try_visit!(self.visit_id(hir_id)); . 4,134 ( 0.00%) self.bounded_ty_depth += 1; . try_visit!(self.visit_ty_unambig(bounded_ty)); 4,134 ( 0.00%) self.bounded_ty_depth -= 1; . . walk_list!(self, visit_param_bound, bounds); . walk_list!(self, visit_generic_param, bound_generic_params); . } . } . . impl<'tcx, F> Visitor<'tcx> for LifetimeChecker<'_, 'tcx, F> . where . F: NestedFilter<'tcx>, . { . type MaybeTyCtxt = TyCtxt<'tcx>; . type NestedFilter = F; . . // for lifetimes as parameters of generics . fn visit_lifetime(&mut self, lifetime: &'tcx Lifetime) { 33,219 ( 0.00%) if let LifetimeKind::Param(def_id) = lifetime.kind 39,563 ( 0.00%) && let Some(usages) = self.map.get_mut(&def_id) 1,214 ( 0.00%) => /rust/deps/indexmap-2.14.0/src/map.rs:, rustc_hash::FxBuildHasher>>::get_mut:: (89x) . { . usages.push(Usage { . lifetime: *lifetime, 545 ( 0.00%) in_where_predicate: self.where_predicate_depth != 0, 594 ( 0.00%) in_bounded_ty: self.bounded_ty_depth != 0, 573 ( 0.00%) in_generics_arg: self.generic_args_depth != 0, 266 ( 0.00%) lifetime_elision_impossible: self.lifetime_elision_impossible, . }); . } . } . 8,322 ( 0.00%) fn visit_where_predicate(&mut self, predicate: &'tcx WherePredicate<'tcx>) { 1,387 ( 0.00%) self.where_predicate_depth += 1; 1,387 ( 0.00%) if let &WherePredicateKind::BoundPredicate(WhereBoundPredicate { 1,378 ( 0.00%) bounded_ty, 2,756 ( 0.00%) bounds, 2,756 ( 0.00%) bound_generic_params, . origin: _, 2,774 ( 0.00%) }) = predicate.kind . { . self.visit_where_bound_predicate(predicate.hir_id, bounded_ty, bounds, bound_generic_params); . } else { 18 ( 0.00%) walk_where_predicate(self, predicate); 5,046 ( 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::> (9x) . } 1,387 ( 0.00%) self.where_predicate_depth -= 1; 8,322 ( 0.00%) } . 2,454 ( 0.00%) fn visit_generic_args(&mut self, generic_args: &'tcx GenericArgs<'tcx>) -> Self::Result { 2,854 ( 0.00%) self.generic_args_depth += 1; . walk_generic_args(self, generic_args); 4,516 ( 0.00%) self.generic_args_depth -= 1; 2,454 ( 0.00%) } . . fn visit_fn_decl(&mut self, fd: &'tcx FnDecl<'tcx>) -> Self::Result { 3,199 ( 0.00%) self.lifetime_elision_impossible = !is_candidate_for_elision(fd); . walk_fn_decl(self, fd); 2,815 ( 0.00%) self.lifetime_elision_impossible = false; . } . . fn maybe_tcx(&mut self) -> Self::MaybeTyCtxt { 5,690 ( 0.00%) self.cx.tcx . } . } . . /// Check if `fd` supports function elision with an anonymous (or elided) lifetime, . /// and has a lifetime somewhere in its output type. . fn is_candidate_for_elision(fd: &FnDecl<'_>) -> bool { . struct V; . . impl Visitor<'_> for V { . type Result = ControlFlow; . . fn visit_lifetime(&mut self, lifetime: &Lifetime) -> Self::Result { 344 ( 0.00%) ControlFlow::Break(lifetime.is_elided() || lifetime.is_anonymous()) . } . } . 14,067 ( 0.00%) if fd.lifetime_elision_allowed() 1,765 ( 0.00%) && let Return(ret_ty) = fd.output 1,765 ( 0.00%) && walk_unambig_ty(&mut V, ret_ty).is_break() . { . // The first encountered input lifetime will either be one on `self`, or will be the only lifetime. 192 ( 0.00%) fd.inputs . .iter() . .find_map(|ty| walk_unambig_ty(&mut V, ty).break_value()) . .unwrap() . } else { . false . } . } . -- line 711 ---------------------------------------- -- line 717 ---------------------------------------- . let mut checker = LifetimeChecker::::new(cx, generic_params); . . for param in generic_params { . walk_generic_param(&mut checker, param); . } . . walk_trait_ref(&mut checker, trait_ref); . 6,248 ( 0.00%) for (def_id, usages) in checker.map { . if usages . .iter() . .all(|usage| usage.in_where_predicate && !usage.in_bounded_ty && !usage.in_generics_arg) . { . span_lint( . cx, . EXTRA_UNUSED_LIFETIMES, . cx.tcx.def_span(def_id), . "this lifetime isn't used in the type", . ); . } . } . } . 38,300 ( 0.00%) fn report_extra_lifetimes<'tcx>(cx: &LateContext<'tcx>, func: &'tcx FnDecl<'_>, generics: &'tcx Generics<'_>) { 7,660 ( 0.00%) let mut checker = LifetimeChecker::::new(cx, generics.params); . 11,490 ( 0.00%) walk_generics(&mut checker, generics); 378,447 ( 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::> (3,830x) . walk_fn_decl(&mut checker, func); . 15,354 ( 0.00%) for (def_id, usages) in checker.map { . if usages . .iter() . .all(|usage| usage.in_where_predicate && !usage.in_bounded_ty && !usage.in_generics_arg) . { . span_lint( . cx, . EXTRA_UNUSED_LIFETIMES, . cx.tcx.def_span(def_id), . "this lifetime isn't used in the function definition", . ); . } . } 30,640 ( 0.00%) } . . fn report_extra_impl_lifetimes<'tcx>(cx: &LateContext<'tcx>, impl_: &'tcx Impl<'_>) { 1,764 ( 0.00%) let mut checker = LifetimeChecker::::new(cx, impl_.generics.params); . 2,352 ( 0.00%) walk_generics(&mut checker, impl_.generics); 35,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:rustc_hir::intravisit::walk_generics::> (588x) 1,764 ( 0.00%) if let Some(of_trait) = impl_.of_trait { . walk_trait_ref(&mut checker, &of_trait.trait_ref); . } 588 ( 0.00%) walk_unambig_ty(&mut checker, impl_.self_ty); 3,297 ( 0.00%) for &item in impl_.items { . walk_impl_item_ref(&mut checker, item); . } . 79 ( 0.00%) for (&def_id, usages) in &checker.map { . if usages . .iter() . .all(|usage| usage.in_where_predicate && !usage.in_bounded_ty && !usage.in_generics_arg) . { . span_lint( . cx, . EXTRA_UNUSED_LIFETIMES, . cx.tcx.def_span(def_id), . "this lifetime isn't used in the impl", . ); . } . } . 195 ( 0.00%) report_elidable_impl_lifetimes(cx, impl_, &checker.map); . } . . // An `impl` lifetime is elidable if it satisfies the following conditions: . // - It is used exactly once. . // - That single use is not in a `WherePredicate`. . fn report_elidable_impl_lifetimes<'tcx>( . cx: &LateContext<'tcx>, . impl_: &'tcx Impl<'_>, . map: &FxIndexMap>, . ) { 2,940 ( 0.00%) let (elidable_lts, usages): (Vec<_>, Vec<_>) = map . .iter() . .filter_map(|(def_id, usages)| { 294 ( 0.00%) if let [ . Usage { . lifetime, . in_where_predicate: false, . lifetime_elision_impossible: false, . .. . }, . ] = usages.as_slice() . { . Some((def_id, lifetime)) . } else { . None . } . }) 1,176 ( 0.00%) .unzip(); 27,342 ( 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:>, clippy_lints::lifetimes::report_elidable_impl_lifetimes::{closure#0}> as core::iter::traits::iterator::Iterator>::unzip::<&rustc_span::def_id::LocalDefId, &rustc_hir::hir::Lifetime, alloc::vec::Vec, alloc::vec::Vec> (588x) . 588 ( 0.00%) if elidable_lts.is_empty() { . return; . } . 192 ( 0.00%) report_elidable_lifetimes(cx, impl_.generics, &elidable_lts, &usages, true); 223,095 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/lifetimes.rs:clippy_lints::lifetimes::report_elidable_lifetimes (32x) . } . . #[derive(Copy, Clone)] . enum ElidableUsage { . /// Used in a ref (`&'a T`), can be removed . Ref(Span), . /// Used as a generic param (`T<'a>`) or an impl lifetime (`impl T + 'a`), can be replaced . /// with `'_` . Other(Span), . } . . /// Generate diagnostic messages for elidable lifetimes. 585 ( 0.00%) fn report_elidable_lifetimes( . cx: &LateContext<'_>, . generics: &Generics<'_>, . elidable_lts: &[LocalDefId], . usages: &[Lifetime], . include_suggestions: bool, . ) { . let lts = elidable_lts . .iter() . // In principle, the result of the call to `Node::ident` could be `unwrap`ped, as `DefId` should refer to a . // `Node::GenericParam`. 164 ( 0.00%) .filter_map(|&def_id| cx.tcx.hir_node_by_def_id(def_id).ident()) 28 ( 0.00%) => ???:::ident (2x) . .format(", "); . . let elidable_usages: Vec = usages . .iter() . .filter(|usage| named_lifetime(usage).is_some_and(|id| elidable_lts.contains(&id))) 564 ( 0.00%) .map(|usage| match cx.tcx.parent_hir_node(usage.hir_id) { 5,272 ( 0.00%) => ???:::parent_hir_node (47x) . Node::Ty(Ty { . kind: TyKind::Ref(..), .. . }) => ElidableUsage::Ref(usage.ident.span), . _ => ElidableUsage::Other(usage.ident.span), . }) . .collect(); . . let lint = if elidable_usages . .iter() 45 ( 0.00%) .any(|usage| matches!(usage, ElidableUsage::Other(_))) . { . ELIDABLE_LIFETIME_NAMES . } else { . NEEDLESS_LIFETIMES . }; . 273 ( 0.00%) span_lint_and_then( 1,034,498 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then::, alloc::string::String, clippy_lints::lifetimes::report_elidable_lifetimes::{closure#6}> (39x) . cx, . lint, . elidable_lts . .iter() 41 ( 0.00%) .map(|<| cx.tcx.def_span(lt)) . .chain(usages.iter().filter_map(|usage| { 102 ( 0.00%) if let LifetimeKind::Param(def_id) = usage.kind . && elidable_lts.contains(&def_id) . { 47 ( 0.00%) return Some(usage.ident.span); . } . . None . })) . .collect_vec(), 117 ( 0.00%) format!("the following explicit lifetimes could be elided: {lts}"), 312 ( 0.00%) |diag| { 4 ( 0.00%) if !include_suggestions { . return; . } . 18 ( 0.00%) if let Some(suggestions) = elision_suggestions(cx, generics, elidable_lts, &elidable_usages) { 3,850 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/lifetimes.rs:clippy_lints::lifetimes::elision_suggestions (2x) . diag.multipart_suggestion("elide the lifetimes", suggestions, Applicability::MachineApplicable); . } . }, . ); 312 ( 0.00%) } . 26 ( 0.00%) fn elision_suggestions( . cx: &LateContext<'_>, . generics: &Generics<'_>, . elidable_lts: &[LocalDefId], . usages: &[ElidableUsage], . ) -> Option> { 4 ( 0.00%) let explicit_params = generics . .params . .iter() . .filter(|param| !param.is_elided_lifetime() && !param.is_impl_trait()) . .collect::>(); . 6 ( 0.00%) let mut suggestions = if elidable_lts.len() == explicit_params.len() { . // if all the params are elided remove the whole generic block . // . // fn x<'a>() {} . // ^^^^ 10 ( 0.00%) vec![(generics.span, String::new())] . } else { . // 1. Start from the last elidable lifetime . // 2. While the lifetimes preceding it are also elidable, construct spans going from the current . // lifetime to the comma before it . // 3. Once this chain of elidable lifetimes stops, switch to constructing spans going from the . // current lifetime to the comma _after_ it . let mut end: Option = None; . elidable_lts -- line 922 ---------------------------------------- -- line 947 ---------------------------------------- . }; . . Some((span, String::new())) . }) . .collect::>>()? . }; . . suggestions.extend(usages.iter().map(|&usage| { 8 ( 0.00%) match usage { . ElidableUsage::Ref(span) => { . // expand `&'a T` to `&'a T` . // ^^ ^^^ 8 ( 0.00%) let span = cx.sess().source_map().span_extend_while_whitespace(span); 2,568 ( 0.00%) => ???:::span_extend_while_whitespace (4x) . . (span, String::new()) . }, . ElidableUsage::Other(span) => { . // `T<'a>` and `impl Foo + 'a` should be replaced by `'_` . (span, String::from("'_")) . }, . } . })); . 8 ( 0.00%) Some(suggestions) 18 ( 0.00%) } . . struct BodyLifetimeChecker<'tcx> { . tcx: TyCtxt<'tcx>, . } . . impl<'tcx> BodyLifetimeChecker<'tcx> { . fn new(cx: &LateContext<'tcx>) -> Self { 4,303 ( 0.00%) Self { tcx: cx.tcx } . } . } . . impl<'tcx> Visitor<'tcx> for BodyLifetimeChecker<'tcx> { . type Result = ControlFlow<()>; . type NestedFilter = middle_nested_filter::OnlyBodies; . . fn maybe_tcx(&mut self) -> Self::MaybeTyCtxt { . self.tcx . } . // for lifetimes as parameters of generics . fn visit_lifetime(&mut self, lifetime: &'tcx Lifetime) -> ControlFlow<()> { 265 ( 0.00%) if !lifetime.is_anonymous() && lifetime.ident.name != kw::StaticLifetime { . return ControlFlow::Break(()); . } . ControlFlow::Continue(()) . } . } 129,312 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/swap_ptr_to_ref.rs -------------------------------------------------------------------------------- Ir -- line 35 ---------------------------------------- . pub SWAP_PTR_TO_REF, . suspicious, . "call to `mem::swap` using pointer derived references" . } . . declare_lint_pass!(SwapPtrToRef => [SWAP_PTR_TO_REF]); . . impl LateLintPass<'_> for SwapPtrToRef { 1,937,824 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'_>, e: &Expr<'_>) { 548,860 ( 0.00%) if let ExprKind::Call(fn_expr, [arg1, arg2]) = e.kind 12,084 ( 0.00%) && fn_expr.basic_res().is_diag_item(cx, sym::mem_swap) . && let ctxt = e.span.ctxt() . && let (from_ptr1, arg1_span) = is_ptr_to_ref(cx, arg1, ctxt) . && let (from_ptr2, arg2_span) = is_ptr_to_ref(cx, arg2, ctxt) . && (from_ptr1 || from_ptr2) . { . span_lint_and_then( . cx, . SWAP_PTR_TO_REF, -- line 53 ---------------------------------------- -- line 63 ---------------------------------------- . "use ptr::swap", . format!("core::ptr::swap({snip1}, {snip2})"), . app, . ); . } . }, . ); . } 1,937,824 ( 0.02%) } . } . . /// Checks if the expression converts a mutable pointer to a mutable reference. If it is, also . /// returns the span of the pointer expression if it's suitable for making a suggestion. . fn is_ptr_to_ref(cx: &LateContext<'_>, e: &Expr<'_>, ctxt: SyntaxContext) -> (bool, Option) { . if let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Mut, borrowed_expr) = e.kind . && let ExprKind::Unary(UnOp::Deref, derefed_expr) = borrowed_expr.kind . && cx.typeck_results().expr_ty(derefed_expr).is_raw_ptr() -- line 79 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx rustc_hir::Expr<'tcx>) { 562,663 ( 0.00%) if !expr.span.from_expansion() 36,179 ( 0.00%) && let hir::ExprKind::MethodCall(path, recv, [map_arg], ..) = expr.kind 8,574 ( 0.00%) && !map_arg.span.from_expansion() 17,518 ( 0.00%) && let hir::ExprKind::Path(fun) = map_arg.kind 7,194 ( 0.00%) && let Some(sym::Option | sym::Result) = cx.typeck_results().expr_ty(recv).opt_diag_name(cx) 89,716 ( 0.00%) => ???:::expr_ty (2,238x) . { 84 ( 0.00%) let (constructor_path, constructor_item) = if let hir::ExprKind::Call(constructor, [arg, ..]) = recv.kind 40 ( 0.00%) && let hir::ExprKind::Path(constructor_path) = constructor.kind 16 ( 0.00%) && !constructor.span.from_expansion() 16 ( 0.00%) && !arg.span.from_expansion() . { . (constructor_path, arg) . } else { . return; . }; 16 ( 0.00%) let constructor_symbol = match constructor_path { . hir::QPath::Resolved(_, path) => { 16 ( 0.00%) if let Some(path_segment) = path.segments.last() { 16 ( 0.00%) path_segment.ident.name . } else { . return; . } . }, . hir::QPath::TypeRelative(_, path) => path.ident.name, . }; . match constructor_symbol { 48 ( 0.00%) sym::Some | sym::Ok if path.ident.name == sym::map => (), . sym::Err if path.ident.name == sym::map_err => (), . _ => return, . } . . let mut app = Applicability::MachineApplicable; . let fun_snippet = snippet_with_applicability(cx, fun.span(), "_", &mut app); . let constructor_snippet = snippet_with_applicability(cx, constructor_path.span(), "_", &mut app); . let constructor_arg_snippet = snippet_with_applicability(cx, constructor_item.span, "_", &mut app); -- line 75 ---------------------------------------- -- line 81 ---------------------------------------- . "unnecessary `{}` on constructor `{constructor_snippet}(_)`", . path.ident.name . ), . "try", . format!("{constructor_snippet}({fun_snippet}({constructor_arg_snippet}))"), . app, . ); . } 1,937,824 ( 0.02%) } . } 328,926 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs -------------------------------------------------------------------------------- Ir -- line 420 ---------------------------------------- . /// "I am initialized", . /// ); . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . pub fn with(&'static self, f: F) -> R . where . F: FnOnce(&T) -> R, . { 1,477,336 ( 0.01%) match self.try_with(f) { . Ok(r) => r, . Err(err) => panic_access_error(err), . } . } . . /// Acquires a reference to the value in this TLS key. . /// . /// This will lazily initialize the value if this thread has not referenced -- line 436 ---------------------------------------- -- line 455 ---------------------------------------- . /// ); . /// ``` . #[stable(feature = "thread_local_try_with", since = "1.26.0")] . #[inline] . pub fn try_with(&'static self, f: F) -> Result . where . F: FnOnce(&T) -> R, . { 3,010,208 ( 0.03%) let thread_local = unsafe { (self.inner)(None).as_ref().ok_or(AccessError)? }; 7,725 ( 0.00%) => ???:>>,)>>::call_once (2,575x) 1,686,376 ( 0.01%) Ok(f(thread_local)) . } . . /// Acquires a reference to the value in this TLS key, initializing it with . /// `init` if it wasn't already initialized on this thread. . /// . /// If `init` was used to initialize the thread local variable, `None` is . /// passed as the first argument to `f`. If it was already initialized, . /// `Some(init)` is passed to `f`. -- line 472 ---------------------------------------- 13,652 ( 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%) } . 4,649,376 ( 0.04%) fn check(&mut self, cx: &LateContext<'_>, span: Span, derive_src: Option) { 581,172 ( 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); . } . } . } 4,649,376 ( 0.04%) } . } . . 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 { 75,950 ( 0.00%) self.check(cx, *span, None); 273,420 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (15,190x) . } . } 7 ( 0.00%) } . . fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 1,211,140 ( 0.01%) self.check(cx, expr.span, None); 4,360,104 ( 0.04%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (242,228x) . // `$t + $t` can have the context of $t, check also the span of the binary operator 491,192 ( 0.00%) if let ExprKind::Binary(op, ..) = expr.kind { 26,944 ( 0.00%) self.check(cx, op.span, None); 121,248 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (6,736x) . } . } . . fn check_stmt(&mut self, cx: &LateContext<'_>, stmt: &Stmt<'_>) { 126,784 ( 0.00%) self.check(cx, stmt.span, None); 570,528 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (31,696x) . } . . fn check_ty(&mut self, cx: &LateContext<'_>, ty: &Ty<'_, AmbigArg>) { 210,156 ( 0.00%) self.check(cx, ty.span, None); 945,702 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (52,539x) . } . . fn check_pat(&mut self, cx: &LateContext<'_>, pat: &Pat<'_>) { 233,688 ( 0.00%) self.check(cx, pat.span, None); 1,051,596 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (58,422x) . } . 59,380 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) { 23,752 ( 0.00%) self.check(cx, item.span, self.derive_src); 106,884 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (5,938x) 29,690 ( 0.00%) self.check(cx, item.vis_span, None); 106,884 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (5,938x) . 17,814 ( 0.00%) if matches!( 5,938 ( 0.00%) item.kind, . ItemKind::Struct(..) | ItemKind::Enum(..) | ItemKind::Union(..) 30 ( 0.00%) ) && macro_backtrace(item.span).all(|m| !matches!(m.kind, MacroKind::Derive)) . { 742 ( 0.00%) self.derive_src = Some(item.owner_id); . } 47,504 ( 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<'_>) { 20,555 ( 0.00%) self.check(cx, item.span, None); 73,998 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (4,111x) 9,733 ( 0.00%) if let ImplItemImplKind::Inherent { vis_span, .. } = item.impl_kind { 6,044 ( 0.00%) self.check(cx, vis_span, None); 27,198 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (1,511x) . } . } . . fn check_trait_item(&mut self, cx: &LateContext<'_>, item: &TraitItem<'_>) { 5,052 ( 0.00%) self.check(cx, item.span, None); 22,734 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (1,263x) . } . . fn check_path(&mut self, cx: &LateContext<'_>, path: &Path<'_>, _: HirId) { 622,400 ( 0.01%) self.check(cx, path.span, None); 2,800,800 ( 0.02%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (155,600x) . } . } 1,113 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/returns/let_and_return.rs -------------------------------------------------------------------------------- Ir -- line 8 ---------------------------------------- . use rustc_errors::Applicability; . use rustc_hir::{Block, Expr, PatKind, StmtKind}; . use rustc_lint::{LateContext, LintContext as _}; . use rustc_middle::ty::GenericArgKind; . use rustc_span::edition::Edition; . . use super::LET_AND_RETURN; . 152,544 ( 0.00%) pub(super) fn check_block<'tcx>(cx: &LateContext<'tcx>, block: &'tcx Block<'_>) { . // we need both a let-binding stmt and an expr 65,376 ( 0.00%) if let Some(retexpr) = block.expr 20,497 ( 0.00%) && let Some(stmt) = block.stmts.last() 11,672 ( 0.00%) && let StmtKind::Let(local) = &stmt.kind 8,136 ( 0.00%) && local.ty.is_none() 3,961 ( 0.00%) && local.els.is_none() 27,720 ( 0.00%) && cx.tcx.hir_attrs(local.hir_id).is_empty() 254,844 ( 0.00%) => ???:::hir_attrs (3,960x) 15,496 ( 0.00%) && let Some(initexpr) = &local.init 11,622 ( 0.00%) && let PatKind::Binding(_, local_id, _, _) = local.pat.kind 1 ( 0.00%) && retexpr.res_local_id() == Some(local_id) 3 ( 0.00%) && (cx.sess().edition() >= Edition::Edition2024 || !last_statement_borrows(cx, initexpr)) 5 ( 0.00%) && !initexpr.span.in_external_macro(cx.sess().source_map()) 117 ( 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 (1x) 4 ( 0.00%) && !retexpr.span.in_external_macro(cx.sess().source_map()) 117 ( 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 (1x) 3 ( 0.00%) && !local.span.from_expansion() 6 ( 0.00%) && !span_contains_non_whitespace(cx, stmt.span.between(retexpr.span), false) 197 ( 0.00%) => ???:::between (1x) . { . span_lint_hir_and_then( . cx, 2 ( 0.00%) LET_AND_RETURN, 2 ( 0.00%) retexpr.hir_id, 1 ( 0.00%) retexpr.span, . "returning the result of a `let` binding from a block", 2 ( 0.00%) |err| { 1 ( 0.00%) err.span_label(local.span, "unnecessary `let` binding"); . 2 ( 0.00%) let mut app = Applicability::MachineApplicable; 8 ( 0.00%) let (src, _) = snippet_with_context(cx, initexpr.span, local.span.ctxt(), "..", &mut app); . 5 ( 0.00%) let sugg = if binary_expr_needs_parentheses(initexpr) { 26 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::binary_expr_needs_parentheses (1x) . if has_enclosing_paren(&src) { . src.to_string() . } else { . format!("({src})") . } 4 ( 0.00%) } else if !cx.typeck_results().expr_adjustments(retexpr).is_empty() { 36 ( 0.00%) => ???:::expr_adjustments (1x) . if has_enclosing_paren(&src) { . format!("{src} as _") . } else { . format!("({src}) as _") . } . } else { . src.to_string() . }; . err.multipart_suggestion( . "return the expression directly", 10 ( 0.00%) vec![(local.span, String::new()), (retexpr.span, sugg)], . app, . ); . }, . ); . } 152,544 ( 0.00%) } . fn last_statement_borrows<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) -> bool { . for_each_expr(cx.tcx, expr, |e| { 20 ( 0.00%) if let Some(def_id) = fn_def_id(cx, e) 35 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::fn_def_id (1x) . && cx . .tcx . .fn_sig(def_id) . .instantiate_identity() . .skip_norm_wip() . .skip_binder() . .output() . .walk() -- line 79 ---------------------------------------- 4,075 ( 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 539,892 ( 0.00%) if let ExprKind::Call(iter_expr, []) = &expr.kind 10,390 ( 0.00%) && let ExprKind::Path(QPath::TypeRelative(ty, _)) = &iter_expr.kind 2,688 ( 0.00%) && let TyKind::Path(ty_path) = &ty.kind 2,780 ( 0.00%) && let QPath::Resolved(None, path) = ty_path 1,482 ( 0.00%) && let def::Res::Def(_, def_id) = &path.res 4,770 ( 0.00%) && cx.tcx.is_diagnostic_item(sym::IterEmpty, *def_id) 32,005 ( 0.00%) => ???:::is_diagnostic_item (477x) . && 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, . ); . } 1,937,824 ( 0.02%) } . } . . fn make_sugg( . cx: &LateContext<'_>, . ty_path: &QPath<'_>, . ctxt: SyntaxContext, . applicability: &mut Applicability, . path: &str, -- line 67 ---------------------------------------- 477 ( 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { . // Cheap kind check before the costlier const context query. 242,228 ( 0.00%) if matches!( 484,456 ( 0.00%) expr.kind, . ExprKind::If(..) | ExprKind::Match(..) | ExprKind::MethodCall(..) | ExprKind::Call(..) 102,896 ( 0.00%) ) && !expr.span.from_expansion() 138,536 ( 0.00%) && !is_in_const_context(cx) 12,461,499 ( 0.10%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_const_context (34,634x) . { . let suggestion = is_if_elseif_else_pattern(cx, expr) 59,596 ( 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); . } . } 1,937,824 ( 0.02%) } . 152,544 ( 0.00%) fn check_block(&mut self, cx: &LateContext<'tcx>, block: &'tcx Block<'tcx>) { . // Cheap `if`-statement check before the costlier const context query. 21,792 ( 0.00%) if !block . .stmts . .iter() 60,730 ( 0.00%) .any(|stmt| matches!(stmt.kind, StmtKind::Expr(e) if matches!(e.kind, ExprKind::If(..)))) . { . return; . } . 8,656 ( 0.00%) if is_in_const_context(cx) || !self.msrv.meets(cx, msrvs::CLAMP) { 285,817 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_const_context (788x) 21,222 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (786x) . return; . } . for suggestion in is_two_if_pattern(cx, block) { . maybe_emit_suggestion(cx, &suggestion); . } 174,336 ( 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 227 ---------------------------------------- . Float, . Ord, . } . . impl TypeClampability { . fn is_clampable<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option { . if ty.is_floating_point() { . Some(TypeClampability::Float) 63 ( 0.00%) } else if cx . .tcx 42 ( 0.00%) .get_diagnostic_item(sym::Ord) 2,226 ( 0.00%) => ???:::get_diagnostic_item (21x) 126 ( 0.00%) .is_some_and(|id| implements_trait(cx, ty, id, &[])) 463,281 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::implements_trait (21x) . { . Some(TypeClampability::Ord) . } else { . None . } . } . . fn is_float(self) -> bool { -- line 246 ---------------------------------------- -- line 269 ---------------------------------------- . r#else: Some(else_if), . }) = If::hir(expr) . && let Some(If { . cond: else_if_cond, . then: else_if_then, . r#else: Some(else_body), . }) = If::hir(peel_blocks(else_if)) . { 126 ( 0.00%) let params = is_clamp_meta_pattern( 472,638 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_clamp.rs:clippy_lints::manual_clamp::is_clamp_meta_pattern (21x) . cx, 42 ( 0.00%) expr.span.ctxt(), 72 ( 0.00%) &BinaryOp::new(peel_blocks(cond))?, 42 ( 0.00%) &BinaryOp::new(peel_blocks(else_if_cond))?, . peel_blocks(then), . peel_blocks(else_if_then), 105 ( 0.00%) None, . )?; . // Contents of the else should be the resolved input. . if !eq_expr_value(cx, expr.span.ctxt(), params.input, peel_blocks(else_body)) { . return None; . } . Some(ClampSuggestion { . params, . span: expr.span, -- line 292 ---------------------------------------- -- 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> { 86,926 ( 0.00%) if let ExprKind::MethodCall(seg_second, receiver, [arg_second], _) = expr.kind 9,966 ( 0.00%) && let ExprKind::MethodCall(seg_first, input, [arg_first], _) = &receiver.kind . // Match method names before the costlier type queries. 816 ( 0.00%) && let Some((min, max)) = match (seg_first.ident.name, seg_second.ident.name) { 1,088 ( 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 341 ---------------------------------------- . /// . /// ```no_run . /// # let (input, min_value, max_value) = (0, -3, 12); . /// # use std::cmp::{max, min}; . /// min(max(input, min_value), max_value) . /// # ; . /// ``` . fn is_call_max_min_pattern<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) -> Option> { 35 ( 0.00%) fn segment<'tcx>(cx: &LateContext<'_>, func: &Expr<'tcx>) -> Option> { 24 ( 0.00%) match func.kind { 2 ( 0.00%) ExprKind::Path(QPath::Resolved(None, path)) => { 6 ( 0.00%) let def = path.res.opt_def(cx)?; 14 ( 0.00%) match cx.tcx.get_diagnostic_name(def.1) { 140 ( 0.00%) => ???:::get_diagnostic_name (2x) . Some(sym::cmp_min) => Some(FunctionType::CmpMin), . Some(sym::cmp_max) => Some(FunctionType::CmpMax), . _ if def.assoc_fn_parent(cx).is_diag_item(cx, sym::Ord) => { . Some(FunctionType::OrdOrFloat(path.segments.last().expect("infallible"))) . }, . _ => None, . } . }, . ExprKind::Path(QPath::TypeRelative(ty, seg)) => { 6 ( 0.00%) matches!(ty.basic_res(), Res::PrimTy(PrimTy::Float(_))).then(|| FunctionType::OrdOrFloat(seg)) . }, . _ => None, . } 35 ( 0.00%) } . . enum FunctionType<'tcx> { . CmpMin, . CmpMax, . OrdOrFloat(&'tcx PathSegment<'tcx>), . } . 126,126 ( 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> { 28,157 ( 0.00%) if let ExprKind::Call(inner_fn, [first, second]) = &inner_call.kind 25 ( 0.00%) && let Some(inner_seg) = segment(cx, inner_fn) 315 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_clamp.rs:clippy_lints::manual_clamp::is_call_max_min_pattern::segment (5x) . && 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), . ) { . (true, false) => (second, first), -- line 391 ---------------------------------------- -- line 412 ---------------------------------------- . max, . is_float, . }, . span, . make_assignment: None, . hir_with_ignore_attr: None, . }) . } else { 14,014 ( 0.00%) None . } 112,112 ( 0.00%) } . 218,798 ( 0.00%) if let ExprKind::Call(outer_fn, [first, second]) = &expr.kind { 133,133 ( 0.00%) check(cx, outer_fn, first, second, expr.span).or_else(|| check(cx, outer_fn, second, first, expr.span)) 280,769 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_clamp.rs:clippy_lints::manual_clamp::is_call_max_min_pattern::check (14,014x) . } 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> { 41,311 ( 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>| { 974 ( 0.00%) if let PatKind::Binding(_, var_hir_id, _, None) = &a.pat.kind 3 ( 0.00%) && 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)?; . let (second, second_hir_id, second_expr) = minmax_values(second_arm)?; -- line 456 ---------------------------------------- -- line 497 ---------------------------------------- . /// let mut x = input; . /// if x < min { x = min; } . /// if x > max { x = max; } . /// ``` . fn is_two_if_pattern<'tcx>(cx: &LateContext<'tcx>, block: &'tcx Block<'tcx>) -> Vec> { . block_stmt_with_last(block) . .tuple_windows() . .filter_map(|(maybe_set_first, maybe_set_second)| { 24,747 ( 0.00%) if let StmtKind::Expr(first_expr) = *maybe_set_first 6,031 ( 0.00%) && let StmtKind::Expr(second_expr) = *maybe_set_second . && let Some(If { . cond: first_cond, . then: first_then, . r#else: None, . }) = If::hir(first_expr) . && let Some(If { . cond: second_cond, . then: second_then, . r#else: None, . }) = If::hir(second_expr) 180 ( 0.00%) && let ExprKind::Assign(maybe_input_first_path, maybe_min_max_first, _) = 360 ( 0.00%) peel_blocks_with_stmt(first_then).kind 1,682 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::peel_blocks_with_stmt (90x) . && let ExprKind::Assign(maybe_input_second_path, maybe_min_max_second, _) = . peel_blocks_with_stmt(second_then).kind . && let ctxt = first_expr.span.ctxt() . && second_expr.span.ctxt() == ctxt . && eq_expr_value(cx, ctxt, maybe_input_first_path, maybe_input_second_path) . && let Some(first_bin) = BinaryOp::new(first_cond) . && let Some(second_bin) = BinaryOp::new(second_cond) . && let Some(input_min_max) = is_clamp_meta_pattern( -- line 526 ---------------------------------------- -- line 540 ---------------------------------------- . max: input_min_max.max, . is_float: input_min_max.is_float, . }, . span: first_expr.span.to(second_expr.span), . make_assignment: Some(maybe_input_first_path), . hir_with_ignore_attr: Some(first_expr.hir_id), . }) . } else { 3,935 ( 0.00%) None . } . }) . .collect() . } . . /// Targets patterns like . /// . /// ```no_run -- line 556 ---------------------------------------- -- line 568 ---------------------------------------- . then, . r#else: Some(else_if), . }) = If::hir(expr) . && let Some(If { . cond: else_if_cond, . then: else_if_then, . r#else: None, . }) = If::hir(peel_blocks(else_if)) 9 ( 0.00%) && let ExprKind::Assign(maybe_input_first_path, maybe_min_max_first, _) = peel_blocks_with_stmt(then).kind . && let ExprKind::Assign(maybe_input_second_path, maybe_min_max_second, _) = . peel_blocks_with_stmt(else_if_then).kind . { . let ctxt = expr.span.ctxt(); . let params = is_clamp_meta_pattern( . cx, . ctxt, . &BinaryOp::new(peel_blocks(cond))?, -- line 584 ---------------------------------------- -- line 608 ---------------------------------------- . left: &'tcx Expr<'tcx>, . right: &'tcx Expr<'tcx>, . } . . impl<'tcx> BinaryOp<'tcx> { . fn new(e: &'tcx Expr<'tcx>) -> Option> { . match &e.kind { . ExprKind::Binary(op, left, right) => Some(BinaryOp { 45 ( 0.00%) op: op.node, 45 ( 0.00%) left, . right, . }), . _ => None, . } . } . . fn flip(&self) -> Self { . Self { 23 ( 0.00%) op: match self.op { . BinOpKind::Le => BinOpKind::Ge, . BinOpKind::Lt => BinOpKind::Gt, . BinOpKind::Ge => BinOpKind::Le, . BinOpKind::Gt => BinOpKind::Lt, . other => other, . }, . left: self.right, . right: self.left, -- line 634 ---------------------------------------- -- line 651 ---------------------------------------- . /// - `Range` . /// - `RangeInclusive` . /// . /// And all other range types are not accepted. For the purposes of `clamp` it's irrelevant . /// whether the range is inclusive or not, the output is the same. . /// . /// - The result of each if statement must be equal to the argument unique to that if statement. The . /// result can not be the shared argument in either case. 189 ( 0.00%) fn is_clamp_meta_pattern<'tcx>( . cx: &LateContext<'tcx>, . ctxt: SyntaxContext, . first_bin: &BinaryOp<'tcx>, . second_bin: &BinaryOp<'tcx>, . first_expr: &'tcx Expr<'tcx>, . second_expr: &'tcx Expr<'tcx>, . // This parameters is exclusively for the match pattern. . // It exists because the variable bindings used in that pattern . // refer to the variable bound in the match arm, not the variable . // bound outside of it. Fortunately due to context we know this has to . // be the input variable, not the min or max. . input_hir_ids: Option<(HirId, HirId)>, . ) -> Option> { . #[expect(clippy::too_many_arguments)] 56 ( 0.00%) fn check<'tcx>( . cx: &LateContext<'tcx>, . ctxt: SyntaxContext, . first_bin: &BinaryOp<'tcx>, . second_bin: &BinaryOp<'tcx>, . first_expr: &'tcx Expr<'tcx>, . second_expr: &'tcx Expr<'tcx>, . input_hir_ids: Option<(HirId, HirId)>, . is_float: bool, . ) -> Option> { 56 ( 0.00%) match (&first_bin.op, &second_bin.op) { . (BinOpKind::Ge | BinOpKind::Gt, BinOpKind::Le | BinOpKind::Lt) => { . let (min, max) = (second_expr, first_expr); 6 ( 0.00%) let refers_to_input = match input_hir_ids { . Some((first_hir_id, second_hir_id)) => { . peel_blocks(first_bin.left).res_local_id() == Some(first_hir_id) . && peel_blocks(second_bin.left).res_local_id() == Some(second_hir_id) . }, 16 ( 0.00%) None => eq_expr_value(cx, ctxt, first_bin.left, second_bin.left), 3,306 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:clippy_utils::hir_utils::eq_expr_value (2x) . }; 4 ( 0.00%) (refers_to_input . && eq_expr_value(cx, ctxt, first_bin.right, first_expr) . && eq_expr_value(cx, ctxt, second_bin.right, second_expr)) . .then_some(InputMinMax { . input: first_bin.left, . min, . max, . is_float, . }) . }, . _ => None, . } 64 ( 0.00%) } . // First filter out any expressions with side effects . let exprs = [ . first_bin.left, . first_bin.right, . second_bin.left, . second_bin.right, . first_expr, . second_expr, . ]; 105 ( 0.00%) let clampability = TypeClampability::is_clampable(cx, cx.typeck_results().expr_ty(first_expr))?; 840 ( 0.00%) => ???:::expr_ty (21x) . let is_float = clampability.is_float(); 78 ( 0.00%) if exprs.iter().any(|e| peel_blocks(e).can_have_side_effects()) { 916 ( 0.00%) => ???:::can_have_side_effects (39x) . return None; . } . let first_bin = try_normalize_unsigned_eq_to_ord(cx, first_bin, first_expr).unwrap_or(*first_bin); . let second_bin = try_normalize_unsigned_eq_to_ord(cx, second_bin, second_expr).unwrap_or(*second_bin); . let (first_bin, second_bin) = (&first_bin, &second_bin); . if !(is_ord_op(first_bin.op) && is_ord_op(second_bin.op)) { . return None; . } . let cases = [ . (*first_bin, *second_bin), . (first_bin.flip(), second_bin.flip()), . (first_bin.flip(), *second_bin), 4 ( 0.00%) (*first_bin, second_bin.flip()), . ]; . . cases.into_iter().find_map(|(first, second)| { 51 ( 0.00%) check( 1,764 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_clamp.rs:clippy_lints::manual_clamp::is_clamp_meta_pattern::check (4x) . cx, . ctxt, . &first, . &second, . first_expr, . second_expr, . input_hir_ids, . is_float, . ) . .or_else(|| { 46 ( 0.00%) check( 1,764 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_clamp.rs:clippy_lints::manual_clamp::is_clamp_meta_pattern::check (4x) . cx, . ctxt, . &second, . &first, . second_expr, . first_expr, . input_hir_ids.map(|(l, r)| (r, l)), . is_float, . ) . }) . }) 168 ( 0.00%) } . . fn block_stmt_with_last<'tcx>(block: &'tcx Block<'tcx>) -> impl Iterator> { . block . .stmts . .iter() . .map(|s| MaybeBorrowedStmtKind::Borrowed(&s.kind)) . .chain( . block . .expr . .as_ref() . .map(|e| MaybeBorrowedStmtKind::Owned(StmtKind::Expr(e))), . ) . } . . fn is_ord_op(op: BinOpKind) -> bool { 5 ( 0.00%) matches!(op, BinOpKind::Ge | BinOpKind::Gt | BinOpKind::Le | BinOpKind::Lt) . } . . /// For unsigned integer types, `x == 0` is equivalent to `x < 1`. This normalizes such `==` . /// comparisons to `<` when the result expression evaluates to 1, enabling clamp detection for . /// patterns like: . /// . /// ```ignore . /// if x == 0 { x = 1; } else if x > y { x = y; } . /// ``` . fn try_normalize_unsigned_eq_to_ord<'tcx>( . cx: &LateContext<'tcx>, . bin: &BinaryOp<'tcx>, . result_expr: &'tcx Expr<'tcx>, . ) -> Option> { 2 ( 0.00%) if bin.op != BinOpKind::Eq { . return None; . } . . // both sides of the expression have the same type, so checking either of them is sufficient . if !matches!(cx.typeck_results().expr_ty(bin.left).kind(), rustc_middle::ty::Uint(_)) { . return None; . } . -- line 797 ---------------------------------------- -- line 819 ---------------------------------------- . #[derive(Debug)] . enum MaybeBorrowedStmtKind<'a> { . Borrowed(&'a StmtKind<'a>), . Owned(StmtKind<'a>), . } . . impl Clone for MaybeBorrowedStmtKind<'_> { . fn clone(&self) -> Self { 18,168 ( 0.00%) match self { . Self::Borrowed(t) => Self::Borrowed(t), . Self::Owned(StmtKind::Expr(e)) => Self::Owned(StmtKind::Expr(e)), . Self::Owned(_) => unreachable!("Owned should only ever contain a StmtKind::Expr."), . } . } . } . . impl<'a> Deref for MaybeBorrowedStmtKind<'a> { -- line 835 ---------------------------------------- 408,047 ( 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<'_>) { 11,876 ( 0.00%) check_item(cx, item.hir_id()); 1,054,715 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/utils/author.rs:clippy_lints::utils::author::check_item (5,938x) . } . . fn check_impl_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::ImplItem<'_>) { 8,222 ( 0.00%) check_item(cx, item.hir_id()); 1,195,335 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/utils/author.rs:clippy_lints::utils::author::check_item (4,111x) . } . . fn check_trait_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::TraitItem<'_>) { 2,526 ( 0.00%) check_item(cx, item.hir_id()); 276,484 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/utils/author.rs:clippy_lints::utils::author::check_item (1,263x) . } . 81,711 ( 0.00%) fn check_arm(&mut self, cx: &LateContext<'tcx>, arm: &'tcx hir::Arm<'_>) { 18,158 ( 0.00%) check_node(cx, arm.hir_id, |v| { . v.arm(&v.bind("arm", arm)); . }); 72,632 ( 0.00%) } . 2,180,052 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) { 484,456 ( 0.00%) check_node(cx, expr.hir_id, |v| { . v.expr(&v.bind("expr", expr)); . }); 1,937,824 ( 0.02%) } . 285,264 ( 0.00%) fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx hir::Stmt<'_>) { 185,362 ( 0.00%) match stmt.kind { 46,036 ( 0.00%) StmtKind::Expr(e) | StmtKind::Semi(e) if has_attr(cx, e.hir_id) => return, . _ => {}, . } 63,392 ( 0.00%) check_node(cx, stmt.hir_id, |v| { . v.stmt(&v.bind("stmt", stmt)); . }); 253,568 ( 0.00%) } . } . 101,808 ( 0.00%) fn check_item(cx: &LateContext<'_>, hir_id: HirId) { 56,560 ( 0.00%) if let Some(body) = cx.tcx.hir_maybe_body_owned_by(hir_id.expect_owner().def_id) { 1,734,044 ( 0.01%) => ???:::hir_maybe_body_owned_by (11,312x) . check_node_with_body( . cx, . hir_id, 5,694 ( 0.00%) |v| { . v.expr(&v.bind("expr", body.value)); . }, . Some(body), . ); . } 90,496 ( 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<'_>>, . ) { 275,753 ( 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 { 360,493 ( 0.00%) let attrs = cx.tcx.hir_attrs(hir_id); 15,706,556 ( 0.13%) => ???:::hir_attrs (242,228x) 15,850 ( 0.00%) get_builtin_attr(attrs, sym::author).count() > 0 . } -------------------------------------------------------------------------------- -- 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 { 19,357 ( 0.00%) ControlFlow::Continue(output) . } . . #[inline] . fn branch(self) -> ControlFlow { 742,342 ( 0.01%) match self { . ControlFlow::Continue(c) => ControlFlow::Continue(c), 3,758 ( 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 { 1,454,289 ( 0.01%) 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 { 1,765 ( 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, . { 360,399 ( 0.00%) match self { 10,390 ( 0.00%) ControlFlow::Continue(..) => None, 456,620 ( 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 300 ---------------------------------------- . /// ``` . #[inline] . #[stable(feature = "control_flow_enum", since = "1.83.0")] . #[rustc_const_unstable(feature = "const_control_flow", issue = "148739")] . pub const fn continue_value(self) -> Option . where . Self: [const] Destruct, . { 150 ( 0.00%) match self { . ControlFlow::Continue(x) => Some(x), . ControlFlow::Break(..) => None, . } . } . . /// Converts the `ControlFlow` into a `Result` which is `Ok` if the . /// `ControlFlow` was `Continue` and `Err` if otherwise. . /// -- line 316 ---------------------------------------- -- 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, . { 164 ( 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, . { 48 ( 0.00%) match self { . ControlFlow::Continue(v) => R::from_output(v), 25,886 ( 0.00%) ControlFlow::Break(v) => v, . } . } . } 605,620 ( 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_ast/src/mut_visit.rs -------------------------------------------------------------------------------- Ir -- line 40 ---------------------------------------- . } . . impl MutVisitable for Box . where . T: MutVisitable, . { . type Extra = T::Extra; . fn visit_mut(&mut self, visitor: &mut V, extra: Self::Extra) { 15,765 ( 0.00%) (**self).visit_mut(visitor, extra) . } . } . . impl MutVisitable for Option . where . T: MutVisitable, . { . type Extra = T::Extra; . fn visit_mut(&mut self, visitor: &mut V, extra: Self::Extra) { 185,180 ( 0.00%) if let Some(this) = self { . this.visit_mut(visitor, extra) . } . } . } . . impl MutVisitable for Spanned . where . T: MutVisitable, -- line 66 ---------------------------------------- -- line 162 ---------------------------------------- . macro_rules! visit_visitable_with { . (mut $visitor:expr, $expr:expr, $extra:expr $(,)?) => { . MutVisitable::visit_mut($expr, $visitor, $extra) . }; . } . . macro_rules! walk_walkable { . ($visitor:expr, $expr:expr, mut) => { 98,742 ( 0.00%) MutWalkable::walk_mut($expr, $visitor) 162,769 ( 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_mut'2 (5,704x) . }; . } . . macro_rules! impl_visitable { . (|&mut $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 178 ---------------------------------------- -- line 185 ---------------------------------------- . }; . } . . macro_rules! impl_walkable { . ($(<$K:ident: $Kb:ident>)? |&mut $self:ident: $self_ty:ty, . $vis:ident: &mut $vis_ty:ident| $block:block) => { . #[allow(unused_parens, non_local_definitions)] . impl<$($K: $Kb,)? $vis_ty: MutVisitor> MutWalkable<$vis_ty> for $self_ty { 2,420 ( 0.00%) fn walk_mut(&mut $self, $vis: &mut $vis_ty) -> V::Result { . $block 1,936 ( 0.00%) } . } . }; . } . . macro_rules! impl_visitable_noop { . ( $($ty:ty,)*) => { . $( . impl_visitable!(|&mut self: $ty, _vis: &mut V, _extra: ()| {}); -- line 203 ---------------------------------------- -- line 236 ---------------------------------------- . . macro_rules! impl_visitable_calling_walkable { . ( . $( fn $method:ident($ty:ty $(, $extra_name:ident: $extra_ty:ty)?); )* . ) => { . $(fn $method(&mut self, node: &mut $ty $(, $extra_name:$extra_ty)?) { . impl_visitable!(|&mut self: $ty, visitor: &mut V, extra: ($($extra_ty)?)| { . let ($($extra_name)?) = extra; 28,664 ( 0.00%) visitor.$method(self $(, $extra_name)?); 530,703 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/unnested_or_patterns.rs:::visit_pat'2 (5,342x) . }); . walk_walkable!(self, node, mut) . })* . } . } . . macro_rules! define_named_walk { . ((mut) $Visitor:ident -- line 252 ---------------------------------------- -- line 279 ---------------------------------------- . . fn $name( . vis: &mut V, . values: &mut ThinVec<$Ty>, . $( . $param: $ParamTy, . )* . ) { 52,506 ( 0.00%) values.flat_map_in_place(|value| vis.$flat_map_fn(value$(,$param)*)); 568,542 ( 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/flat_map_in_place.rs: as rustc_data_structures::flat_map_in_place::FlatMapInPlace>::flat_map_in_place::::{closure#0}, smallvec::SmallVec<[rustc_ast::ast::PatField; 1]>> (1,380x) . } . )+ . } . } . . generate_flat_map_visitor_fns! { . visit_items, Box, flat_map_item; . visit_foreign_items, Box, flat_map_foreign_item; -- line 295 ---------------------------------------- -- line 301 ---------------------------------------- . visit_variants, Variant, flat_map_variant; . visit_assoc_items, Box, flat_map_assoc_item, ctxt: AssocCtxt; . visit_where_predicates, WherePredicate, flat_map_where_predicate; . visit_params, Param, flat_map_param; . visit_field_defs, FieldDef, flat_map_field_def; . visit_arms, Arm, flat_map_arm; . } . 57,060 ( 0.00%) pub fn walk_flat_map_pat_field( . vis: &mut T, . mut fp: PatField, . ) -> SmallVec<[PatField; 1]> { . vis.visit_pat_field(&mut fp); 79,884 ( 0.00%) smallvec![fp] 45,648 ( 0.00%) } . . macro_rules! generate_walk_flat_map_fns { . ($($fn_name:ident($Ty:ty$(,$extra_name:ident: $ExtraTy:ty)*) => $visit_fn_name:ident;)+) => {$( . pub fn $fn_name(vis: &mut V, mut value: $Ty$(,$extra_name: $ExtraTy)*) -> SmallVec<[$Ty; 1]> { . vis.$visit_fn_name(&mut value$(,$extra_name)*); . smallvec![value] . } . )+}; -- line 323 ---------------------------------------- 48,276 ( 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/util.rs -------------------------------------------------------------------------------- Ir -- line 1398 ---------------------------------------- . /// . /// Note that this method can return false even if `ty` has a destructor . /// attached; even if that is the case then the adt has been marked with . /// the attribute `rustc_insignificant_dtor`. . /// . /// Note that this method is used to check for change in drop order for . /// 2229 drop reorder migration analysis. . #[inline] 11 ( 0.00%) pub fn has_significant_drop(self, tcx: TyCtxt<'tcx>, typing_env: ty::TypingEnv<'tcx>) -> bool { . // Avoid querying in simple cases. 1,134 ( 0.00%) match needs_drop_components(tcx, self) { . Err(AlwaysRequiresDrop) => true, 567 ( 0.00%) Ok(components) => { . let query_ty = match *components { 1,440 ( 0.00%) [] => return false, . // If we've got a single component, call the query with that . // to increase the chance that we hit the query cache. 419 ( 0.00%) [component_ty] => component_ty, . _ => self, . }; . . // FIXME . // We should be canonicalizing, or else moving this to a method of inference . // context, or *something* like that, . // but for now just avoid passing inference variables . // to queries that can't cope with them. . // Instead, conservatively return "true" (may change drop order). 468 ( 0.00%) if query_ty.has_infer() { . return true; . } . . // This doesn't depend on regions, so try to minimize distinct . // query keys used. . // FIX: Use try_normalize to avoid crashing. If it fails, return true. . tcx.try_normalize_erasing_regions(typing_env, Unnormalized::new_wip(query_ty)) . .map(|erased| tcx.has_significant_drop_raw(typing_env.as_query_input(erased))) . .unwrap_or(true) . } . } 8 ( 0.00%) } . . /// Returns `true` if equality for this type is both reflexive and structural. . /// . /// Reflexive equality for a type is indicated by an `Eq` impl for that type. . /// . /// Primitive types (`u32`, `str`) have structural equality by definition. For composite data . /// types, equality for the type as a whole is structural when it is the same as equality . /// between all components (fields, array elements, etc.) of that type. For ADTs, structural -- line 1445 ---------------------------------------- -- line 1499 ---------------------------------------- . /// # Examples . /// . /// - `u8` -> `u8` . /// - `&'a mut u8` -> `u8` . /// - `&'a &'b u8` -> `u8` . /// - `&'a *const &'b u8 -> *const &'b u8` . pub fn peel_refs(self) -> Ty<'tcx> { . let mut ty = self; 359,004 ( 0.00%) while let ty::Ref(_, inner_ty, _) = ty.kind() { 15,476 ( 0.00%) ty = *inner_ty; . } 1 ( 0.00%) ty . } . } . . /// Returns a list of types such that the given type needs drop if and only if . /// *any* of the returned types need drop. Returns `Err(AlwaysRequiresDrop)` if . /// this type always needs drop. . // . // FIXME(zetanumbers): consider replacing this with only . // `needs_drop_components_with_async` . #[inline] . pub fn needs_drop_components<'tcx>( . tcx: TyCtxt<'tcx>, . ty: Ty<'tcx>, . ) -> Result; 2]>, AlwaysRequiresDrop> { 2,275 ( 0.00%) needs_drop_components_with_async(tcx, ty, Asyncness::No) 96 ( 0.00%) => ???:rustc_middle::ty::util::needs_drop_components_with_async (1x) . } . . /// Returns a list of types such that the given type needs drop if and only if . /// *any* of the returned types need drop. Returns `Err(AlwaysRequiresDrop)` if . /// this type always needs drop. . pub fn needs_drop_components_with_async<'tcx>( . tcx: TyCtxt<'tcx>, . ty: Ty<'tcx>, -- line 1533 ---------------------------------------- -- line 1597 ---------------------------------------- . } . } . . /// Does the equivalent of . /// ```ignore (illustrative) . /// let v = self.iter().map(|p| p.fold_with(folder)).collect::>(); . /// folder.tcx().intern_*(&v) . /// ``` 440 ( 0.00%) pub fn fold_list<'tcx, F, L, T>( . list: L, . folder: &mut F, . intern: impl FnOnce(TyCtxt<'tcx>, &[T]) -> L, . ) -> L . where . F: TypeFolder>, . L: AsRef<[T]>, . T: TypeFoldable> + PartialEq + Copy, . { . let slice = list.as_ref(); . let mut iter = slice.iter().copied(); . // Look for the first element that changed . match iter.by_ref().enumerate().find_map(|(i, t)| { 275 ( 0.00%) let new_t = t.fold_with(folder); . if new_t != t { Some((i, new_t)) } else { None } . }) { . Some((i, new_t)) => { . // An element changed, prepare to intern the resulting list . let mut new_list = SmallVec::<[_; 8]>::with_capacity(slice.len()); . new_list.extend_from_slice(&slice[..i]); . new_list.push(new_t); . for t in iter { 29,525 ( 0.00%) new_list.push(t.fold_with(folder)) . } 23,354 ( 0.00%) intern(folder.cx(), &new_list) . } . None => list, . } 495 ( 0.00%) } . . /// Does the equivalent of . /// ```ignore (illustrative) . /// let v = self.iter().map(|p| p.try_fold_with(folder)).collect::>(); . /// folder.tcx().intern_*(&v) . /// ``` . pub fn try_fold_list<'tcx, F, L, T>( . list: L, -- line 1642 ---------------------------------------- 53,928 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/ifs/if_same_then_else.rs -------------------------------------------------------------------------------- Ir -- line 2 ---------------------------------------- . use clippy_utils::diagnostics::span_lint_and_note; . use clippy_utils::higher::has_let_expr; . use rustc_hir::{Block, Expr}; . use rustc_lint::LateContext; . use rustc_span::SyntaxContext; . . use super::IF_SAME_THEN_ELSE; . 40,914 ( 0.00%) pub(super) fn check(cx: &LateContext<'_>, conds: &[&Expr<'_>], blocks: &[&Block<'_>]) -> bool { . let mut eq = SpanlessEq::new(cx); . blocks . .array_windows::<2>() . .enumerate() . .fold(true, |all_eq, (i, &[lhs, rhs])| { 3,073 ( 0.00%) if eq.eq_block(SyntaxContext::root(), lhs, rhs) 532,273 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:::eq_block (439x) . && !has_let_expr(conds[i]) . && conds.get(i + 1).is_none_or(|e| !has_let_expr(e)) . { . span_lint_and_note( . cx, . IF_SAME_THEN_ELSE, . lhs.span, . "this `if` has identical blocks", -- line 24 ---------------------------------------- -- line 25 ---------------------------------------- . Some(rhs.span), . "same as this", . ); . all_eq . } else { . false . } . }) 45,848 ( 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/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 { 403,617 ( 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. 10,492 ( 0.00%) if index == 0 { . return true; . } . 15,714 ( 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. 5 ( 0.00%) index == self.len() . } else { 1 ( 0.00%) 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 . /// exceed a given number of bytes. Note that this is done purely at the character level . /// and can still visually split graphemes, even though the underlying characters aren't -- line 403 ---------------------------------------- -- line 507 ---------------------------------------- . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "str_as_bytes", since = "1.39.0")] . #[must_use] . #[inline(always)] . #[allow(unused_attributes)] . pub const fn as_bytes(&self) -> &[u8] { . // SAFETY: const sound because we transmute two types with the same layout 2 ( 0.00%) unsafe { mem::transmute(self) } . } . . /// Converts a mutable string slice to a mutable byte slice. . /// . /// # Safety . /// . /// The caller must ensure that the content of the slice is valid UTF-8 . /// before the borrow ends and the underlying `str` is used. -- line 523 ---------------------------------------- -- 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()] 7,402 ( 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)), 3,497 ( 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 1071 ---------------------------------------- . /// assert_eq!(Some('\u{0306}'), chars.next()); . /// . /// assert_eq!(None, chars.next()); . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[inline] . #[rustc_diagnostic_item = "str_chars"] . pub fn chars(&self) -> Chars<'_> { 112 ( 0.00%) Chars { iter: self.as_bytes().iter() } . } . . /// Returns an iterator over the [`char`]s of a string slice, and their . /// positions. . /// . /// As a string slice consists of valid UTF-8, we can iterate through a . /// string slice by [`char`]. This method returns an iterator of both . /// these [`char`]s, as well as their byte positions. -- line 1087 ---------------------------------------- -- 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 { 2,196 ( 0.00%) pat.is_contained_in(self) 10,127 ( 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 (42x) . } . . /// 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 { 402,507 ( 0.00%) pat.into_searcher(self).next_match().map(|(i, _)| i) 25,480,206 ( 0.21%) => /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 (134,169x) . } . . /// 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> { 6,795 ( 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>, . { 55,013 ( 0.00%) 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] 10,067 ( 0.00%) pub fn split_once(&self, delimiter: P) -> Option<(&'_ str, &'_ str)> { 977 ( 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. 1,317 ( 0.00%) unsafe { Some((self.get_unchecked(..start), self.get_unchecked(end..))) } 6,569 ( 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 2115 ---------------------------------------- . /// assert_eq!(v, [(1, "abc"), (4, "abc")]); . /// . /// let v: Vec<_> = "ababa".match_indices("aba").collect(); . /// assert_eq!(v, [(0, "aba")]); // only the first `aba` . /// ``` . #[stable(feature = "str_match_indices", since = "1.5.0")] . #[inline] . pub fn match_indices(&self, pat: P) -> MatchIndices<'_, P> { 64 ( 0.00%) MatchIndices(MatchIndicesInternal(pat.into_searcher(self))) . } . . /// Returns an iterator over the disjoint matches of a pattern within `self`, . /// yielded in reverse order along with the index of the match. . /// . /// For matches of `pat` within `self` that overlap, only the indices . /// corresponding to the last match are returned. . /// -- line 2131 ---------------------------------------- -- 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 { 739,926 ( 0.01%) self.trim_matches(char::is_whitespace) 5,471,712 ( 0.05%) => /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> (334,236x) . } . . /// 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 { 79,692 ( 0.00%) self.trim_start_matches(char::is_whitespace) 18,067 ( 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::<::is_whitespace> (623x) . } . . /// 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 2257 ---------------------------------------- . /// assert!(Some('ת') == s.trim_end().chars().rev().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_end"] . pub fn trim_end(&self) -> &str { 1,591 ( 0.00%) self.trim_end_matches(char::is_whitespace) 83 ( 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::<::is_whitespace> (1x) . } . . /// Returns a string slice with leading whitespace removed. . /// . /// 'Whitespace' is defined according to the terms of the Unicode Derived . /// Core Property `White_Space`. . /// . /// # Text directionality -- line 2273 ---------------------------------------- -- 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")] 1,086,792 ( 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) } 1,086,792 ( 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")] 156,590 ( 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()) } 78,295 ( 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")] 1,653 ( 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) } 1,653 ( 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 { 70,116 ( 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 ---------------------------------------- 435,227 ( 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_hir/src/definitions.rs -------------------------------------------------------------------------------- Ir -- line 244 ---------------------------------------- . SyntheticCoroutineBody, . /// Additional static data referred to by a static. . NestedStatic, . } . . impl Definitions { . #[inline(always)] . pub fn def_key(&self, id: LocalDefId) -> DefKey { 62,846 ( 0.00%) self.def_id_to_key[id] . } . . // Log debug version of `local_def_index` (just a number), as tracing of this function . // is called too early and cause errors if `LocalDefId` is logged (#157238). . #[instrument(level = "trace", skip(self, id), fields(def_index=?id.local_def_index), ret)] . #[inline(always)] . pub fn def_path_hash(&self, id: LocalDefId) -> DefPathHash { . DefPathHash::new(self.stable_crate_id, self.def_path_hashes[id]) -- line 260 ---------------------------------------- 66,430 ( 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 { 1,416,289 ( 0.01%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 1,297,977 ( 0.01%) match &expr.kind { . // ((..)) . // ^^^^^^ expr . // ^^^^ inner . ExprKind::Paren(inner) 4,260 ( 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 14,056 ( 0.00%) ExprKind::Call(_, args) | ExprKind::MethodCall(MethodCall { args, .. }) 73,212 ( 0.00%) if let [arg] = &**args 37,242 ( 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, . ); . }, . _ => {}, . } 1,618,616 ( 0.01%) } . } . . /// 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 ---------------------------------------- 12,414 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/misc_early/redundant_at_rest_pattern.rs -------------------------------------------------------------------------------- Ir . use clippy_utils::diagnostics::span_lint_and_sugg; . use rustc_ast::{Pat, PatKind}; . use rustc_errors::Applicability; . use rustc_lint::{EarlyContext, LintContext as _}; . . use super::REDUNDANT_AT_REST_PATTERN; . . pub(super) fn check(cx: &EarlyContext<'_>, pat: &Pat) { 110,822 ( 0.00%) if let PatKind::Slice(slice) = &pat.kind 42 ( 0.00%) && let [one] = &**slice 15 ( 0.00%) && let PatKind::Ident(annotation, ident, Some(rest)) = &one.kind . && let PatKind::Rest = rest.kind . && !pat.span.in_external_macro(cx.sess().source_map()) . { . span_lint_and_sugg( . cx, . REDUNDANT_AT_REST_PATTERN, . pat.span, . "using a rest pattern to bind an entire slice to a local", . "this is better represented with just the binding", . format!("{}{ident}", annotation.prefix_str()), . Applicability::MachineApplicable, . ); . } 55,411 ( 0.00%) } 210 ( 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 968,914 ( 0.01%) if let Some(args) = VecArgs::hir(cx, expr) 8,736,024 ( 0.07%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (242,228x) 72 ( 0.00%) && let VecArgs::Repeat(inner_expr, len) = args 4 ( 0.00%) && 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). 484,463 ( 0.00%) else if let ExprKind::Repeat(inner_expr, const_arg) = expr.kind 21 ( 0.00%) && let ConstArgKind::Anon(anon_const) = const_arg.kind 35 ( 0.00%) && let length_expr = cx.tcx.hir_body(anon_const.body).value 589 ( 0.00%) => ???:::hir_body (7x) 14 ( 0.00%) && !length_expr.span.from_expansion() 14 ( 0.00%) && let ExprKind::Lit(literal) = length_expr.kind 20 ( 0.00%) && let LitKind::Int(Pu128(0), _) = literal.node . { . inner_check(cx, expr, inner_expr, false); . } 1,211,140 ( 0.01%) } . } . . 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 ---------------------------------------- 12 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/loops/utils.rs -------------------------------------------------------------------------------- Ir -- line 6 ---------------------------------------- . use rustc_hir::intravisit::{Visitor, walk_expr, walk_local}; . use rustc_hir::{AssignOpKind, BorrowKind, Expr, ExprKind, HirId, HirIdMap, LetStmt, Mutability, PatKind}; . use rustc_lint::LateContext; . use rustc_middle::hir::nested_filter; . use rustc_middle::ty::{self, Ty}; . use rustc_span::Spanned; . use rustc_span::symbol::{Symbol, sym}; . 10,925 ( 0.00%) #[derive(Debug, PartialEq, Eq)] . enum IncrementVisitorVarState { . Initial, // Not examined yet . IncrOnce, // Incremented exactly once, may be a loop counter . DontWarn, . } . . /// Scan a for loop for variables that are incremented exactly once and not used after that. . pub(super) struct IncrementVisitor<'a, 'tcx> { . cx: &'a LateContext<'tcx>, // context reference . states: HirIdMap, // incremented variables . depth: u32, // depth of conditional expressions . } . . impl<'a, 'tcx> IncrementVisitor<'a, 'tcx> { . pub(super) fn new(cx: &'a LateContext<'tcx>) -> Self { 3,030 ( 0.00%) Self { . cx, . states: HirIdMap::default(), . depth: 0, . } . } . . pub(super) fn into_results(self) -> impl Iterator { . self.states.into_iter().filter_map(|(id, state)| { -- line 38 ---------------------------------------- -- line 42 ---------------------------------------- . None . } . }) . } . } . . impl<'tcx> Visitor<'tcx> for IncrementVisitor<'_, 'tcx> { . fn visit_local(&mut self, l: &'tcx LetStmt<'tcx>) { 2,250 ( 0.00%) if let Some(init) = l.init { 1,498 ( 0.00%) self.visit_expr(init); 253,048 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/loops/utils.rs:::visit_expr (199x) 2,247 ( 0.00%) if let Some(els) = l.els { . self.depth += 1; . self.visit_block(els); . self.depth -= 1; . } . } . } . 93,720 ( 0.00%) fn visit_expr(&mut self, expr: &'tcx Expr<'_>) { . // If node is a variable . if let Some(def_id) = expr.res_local_id() { 17,744 ( 0.00%) if let Some(parent) = get_parent_expr(self.cx, expr) { 1,218 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (10x) 4,240 ( 0.00%) let state = self.states.entry(def_id).or_insert(IncrementVisitorVarState::Initial); 4,240 ( 0.00%) if *state == IncrementVisitorVarState::IncrOnce { 2 ( 0.00%) *state = IncrementVisitorVarState::DontWarn; . return; . } . 31,347 ( 0.00%) match parent.kind { 136 ( 0.00%) ExprKind::AssignOp(op, lhs, rhs) if lhs.hir_id == expr.hir_id => { 46 ( 0.00%) *state = if op.node == AssignOpKind::AddAssign 25 ( 0.00%) && is_integer_literal(rhs, 1) 60 ( 0.00%) && *state == IncrementVisitorVarState::Initial . && self.depth == 0 . { . IncrementVisitorVarState::IncrOnce . } else { . // Assigned some other value or assigned multiple times . IncrementVisitorVarState::DontWarn . }; . }, 648 ( 0.00%) ExprKind::Assign(lhs, _, _) if lhs.hir_id == expr.hir_id => { . *state = IncrementVisitorVarState::DontWarn; . }, . ExprKind::AddrOf(BorrowKind::Ref, Mutability::Mut, _) => { . *state = IncrementVisitorVarState::DontWarn; . }, . _ => (), . } . } . 8,870 ( 0.00%) walk_expr(self, expr); 49,549 ( 0.00%) } else if is_loop(expr) || is_conditional(expr) { 1,742 ( 0.00%) self.depth += 1; 871 ( 0.00%) walk_expr(self, expr); 1,646,181 ( 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::'2 (258x) 55,030 ( 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:: (11x) 871 ( 0.00%) self.depth -= 1; . } else if let ExprKind::Continue(_) = expr.kind { . // If we see a `continue` block, then we increment depth so that the IncrementVisitor . // state will be set to DontWarn if we see the variable being modified anywhere afterwards. 33 ( 0.00%) self.depth += 1; . } else { . walk_expr(self, expr); . } 6,335 ( 0.00%) } . } . . enum InitializeVisitorState<'hir> { . Initial, // Not examined yet . Declared(Symbol, Option>), // Declared but not (yet) initialized . Initialized { . name: Symbol, . ty: Option>, -- line 113 ---------------------------------------- -- line 124 ---------------------------------------- . var_id: HirId, . state: InitializeVisitorState<'tcx>, . depth: u32, // depth of conditional expressions . past_loop: bool, . } . . impl<'a, 'tcx> InitializeVisitor<'a, 'tcx> { . pub(super) fn new(cx: &'a LateContext<'tcx>, end_expr: &'tcx Expr<'tcx>, var_id: HirId) -> Self { 18 ( 0.00%) Self { . cx, . end_expr, . var_id, . state: InitializeVisitorState::Initial, . depth: 0, . past_loop: false, . } . } . . pub(super) fn get_result(&self) -> Option<(Symbol, Option>, &'tcx Expr<'tcx>)> { 4 ( 0.00%) if let InitializeVisitorState::Initialized { name, ty, initializer } = self.state { . Some((name, ty, initializer)) . } else { . None . } . } . } . . impl<'tcx> Visitor<'tcx> for InitializeVisitor<'_, 'tcx> { . type NestedFilter = nested_filter::OnlyBodies; . 36 ( 0.00%) fn visit_local(&mut self, l: &'tcx LetStmt<'_>) { . // Look for declarations of the variable 8 ( 0.00%) if l.pat.hir_id == self.var_id 3 ( 0.00%) && let PatKind::Binding(.., ident, _) = l.pat.kind . { . let ty = l.ty.map(|_| self.cx.typeck_results().pat_ty(l.pat)); . 5 ( 0.00%) self.state = l.init.map_or(InitializeVisitorState::Declared(ident.name, ty), |init| { . InitializeVisitorState::Initialized { . initializer: init, . ty, . name: ident.name, . } . }); . } . . walk_local(self, l); 32 ( 0.00%) } . 120 ( 0.00%) fn visit_expr(&mut self, expr: &'tcx Expr<'_>) { 72 ( 0.00%) if matches!(self.state, InitializeVisitorState::DontWarn) { . return; . } 40 ( 0.00%) if expr.hir_id == self.end_expr.hir_id { 4 ( 0.00%) self.past_loop = true; . return; . } . // No need to visit expressions before the variable is . // declared 36 ( 0.00%) if matches!(self.state, InitializeVisitorState::Initial) { . return; . } . . // If node is the desired variable, see how it's used 3 ( 0.00%) if expr.res_local_id() == Some(self.var_id) { 2 ( 0.00%) if self.past_loop { . self.state = InitializeVisitorState::DontWarn; . return; . } . . if let Some(parent) = get_parent_expr(self.cx, expr) { . match parent.kind { . ExprKind::AssignOp(_, lhs, _) if lhs.hir_id == expr.hir_id => { . self.state = InitializeVisitorState::DontWarn; -- line 197 ---------------------------------------- -- line 234 ---------------------------------------- . ExprKind::AddrOf(BorrowKind::Ref, Mutability::Mut, _) => { . self.state = InitializeVisitorState::DontWarn; . }, . _ => (), . } . } . . walk_expr(self, expr); 7 ( 0.00%) } else if !self.past_loop && is_loop(expr) { . self.state = InitializeVisitorState::DontWarn; . } else if is_conditional(expr) { 2 ( 0.00%) self.depth += 1; 1 ( 0.00%) walk_expr(self, expr); 578 ( 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:: (1x) 1 ( 0.00%) self.depth -= 1; . } else { . walk_expr(self, expr); . } 102 ( 0.00%) } . . fn maybe_tcx(&mut self) -> Self::MaybeTyCtxt { . self.cx.tcx . } . } . . fn is_loop(expr: &Expr<'_>) -> bool { . matches!(expr.kind, ExprKind::Loop(..)) . } . . fn is_conditional(expr: &Expr<'_>) -> bool { 18 ( 0.00%) matches!(expr.kind, ExprKind::If(..) | ExprKind::Match(..)) . } . . /// If `arg` was the argument to a `for` loop, return the "cleanest" way of writing the . /// actual `Iterator` that the loop uses. . pub(super) fn make_iterator_snippet(cx: &LateContext<'_>, arg: &Expr<'_>, applicability: &mut Applicability) -> String { . let impls_iterator = cx . .tcx . .get_diagnostic_item(sym::Iterator) -- line 271 ---------------------------------------- 114,104 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/operators/numeric_arithmetic.rs -------------------------------------------------------------------------------- Ir -- line 9 ---------------------------------------- . pub struct Context { . expr_id: Option, . /// This field is used to check whether expressions are constants, such as in enum discriminants . /// and consts . const_span: Option, . } . impl Context { . fn skip_expr(&self, e: &hir::Expr<'_>) -> bool { 9,875 ( 0.00%) self.expr_id.is_some() || self.const_span.is_some_and(|span| span.contains(e.span)) 970 ( 0.00%) => ???:::contains (10x) . } . 48,202 ( 0.00%) pub fn check_binary<'tcx>( . &mut self, . cx: &LateContext<'tcx>, . expr: &'tcx hir::Expr<'_>, . op: hir::BinOpKind, . l: &'tcx hir::Expr<'_>, . r: &'tcx hir::Expr<'_>, . ) { 7,850 ( 0.00%) if self.skip_expr(expr) { . return; . } 13,632 ( 0.00%) match op { . hir::BinOpKind::And . | hir::BinOpKind::Or . | hir::BinOpKind::BitAnd . | hir::BinOpKind::BitOr . | hir::BinOpKind::BitXor . | hir::BinOpKind::Eq . | hir::BinOpKind::Lt . | hir::BinOpKind::Le . | hir::BinOpKind::Ne . | hir::BinOpKind::Ge . | hir::BinOpKind::Gt => return, . _ => (), . } . 7,650 ( 0.00%) let (l_ty, r_ty) = (cx.typeck_results().expr_ty(l), cx.typeck_results().expr_ty(r)); 68,108 ( 0.00%) => ???:::expr_ty (1,700x) 8 ( 0.00%) if l_ty.peel_refs().is_floating_point() && r_ty.peel_refs().is_floating_point() { . span_lint(cx, FLOAT_ARITHMETIC, expr.span, "floating-point arithmetic detected"); 16 ( 0.00%) self.expr_id = Some(expr.hir_id); . } 55,088 ( 0.00%) } . 342 ( 0.00%) pub fn check_negate<'tcx>(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>, arg: &'tcx hir::Expr<'_>) { 77 ( 0.00%) if self.skip_expr(expr) { . return; . } 171 ( 0.00%) let ty = cx.typeck_results().expr_ty(arg); 2,280 ( 0.00%) => ???:::expr_ty (57x) 285 ( 0.00%) if ConstEvalCtxt::new(cx).eval_local(expr, expr.span.ctxt()).is_none() && ty.is_floating_point() { 18,452 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval_local (57x) 3,192 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::new (57x) . span_lint(cx, FLOAT_ARITHMETIC, expr.span, "floating-point arithmetic detected"); . self.expr_id = Some(expr.hir_id); . } 399 ( 0.00%) } . . pub fn expr_post(&mut self, id: hir::HirId) { . if Some(id) == self.expr_id { 8 ( 0.00%) self.expr_id = None; . } . } . . pub fn enter_body(&mut self, cx: &LateContext<'_>, body: &hir::Body<'_>) { 31,020 ( 0.00%) let body_owner = cx.tcx.hir_body_owner(body.id()); 1,175,941 ( 0.01%) => ???:::hir_body_owner (6,204x) 12,408 ( 0.00%) let body_owner_def_id = cx.tcx.hir_body_owner_def_id(body.id()); 822,013 ( 0.01%) => ???:::hir_body_owner_def_id (6,204x) . 37,224 ( 0.00%) match cx.tcx.hir_body_owner_kind(body_owner_def_id) { 589,849 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/hir/map.rs:::hir_body_owner_kind:: (6,204x) . hir::BodyOwnerKind::Static(_) | hir::BodyOwnerKind::Const { .. } => { 2,440 ( 0.00%) let body_span = cx.tcx.hir_span_with_body(body_owner); 37,332 ( 0.00%) => ???:::hir_span_with_body (488x) . 1,324 ( 0.00%) if let Some(span) = self.const_span 1,392 ( 0.00%) && span.contains(body_span) 36,276 ( 0.00%) => ???:::contains (348x) . { . return; . } 910 ( 0.00%) self.const_span = Some(body_span); . }, . hir::BodyOwnerKind::Fn | hir::BodyOwnerKind::Closure | hir::BodyOwnerKind::GlobalAsm => (), . } . } . . pub fn body_post(&mut self, cx: &LateContext<'_>, body: &hir::Body<'_>) { 18,612 ( 0.00%) let body_owner = cx.tcx.hir_body_owner(body.id()); 1,175,941 ( 0.01%) => ???:::hir_body_owner (6,204x) 18,612 ( 0.00%) let body_span = cx.tcx.hir_span_with_body(body_owner); 471,859 ( 0.00%) => ???:::hir_span_with_body (6,204x) . 13,049 ( 0.00%) if let Some(span) = self.const_span 2,564 ( 0.00%) && span.contains(body_span) 67,763 ( 0.00%) => ???:::contains (641x) . { . return; . } 5,702 ( 0.00%) self.const_span = None; . } . } 35,135 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/types/type_complexity.rs -------------------------------------------------------------------------------- Ir -- line 4 ---------------------------------------- . use rustc_hir::{self as hir, AmbigArg, GenericParamKind, TyKind}; . use rustc_lint::LateContext; . use rustc_span::Span; . . use super::TYPE_COMPLEXITY; . . pub(super) fn check(cx: &LateContext<'_>, ty: &hir::Ty<'_>, type_complexity_threshold: u64) -> bool { . let score = { 29,052 ( 0.00%) let mut visitor = TypeComplexityVisitor { score: 0, nest: 1 }; . visitor.visit_ty_unambig(ty); 14,277 ( 0.00%) visitor.score . }; . 29,052 ( 0.00%) if score > type_complexity_threshold { . span_lint( . cx, . TYPE_COMPLEXITY, 2 ( 0.00%) ty.span, . "very complex type used. Consider factoring parts into `type` definitions", . ); . true . } else { . false . } . } . -- line 29 ---------------------------------------- -- line 32 ---------------------------------------- . /// total complexity score of the type . score: u64, . /// current nesting level . nest: u64, . } . . impl<'tcx> Visitor<'tcx> for TypeComplexityVisitor { . fn visit_infer(&mut self, inf_id: hir::HirId, _inf_span: Span, _kind: InferKind<'tcx>) -> Self::Result { 6 ( 0.00%) self.score += 1; . self.visit_id(inf_id); . } . 83,736 ( 0.00%) fn visit_ty(&mut self, ty: &'tcx hir::Ty<'_, AmbigArg>) { 188,406 ( 0.00%) let (add_score, sub_nest) = match ty.kind { . // &x and *x have only small overhead; don't mess with nesting level . TyKind::Ptr(..) | TyKind::Ref(..) => (1, 0), . . // the "normal" components of a type: named types, arrays/tuples 48,381 ( 0.00%) TyKind::Path(..) | TyKind::Slice(..) | TyKind::Tup(..) | TyKind::Array(..) => (10 * self.nest, 1), . . // function types bring a lot of overhead 20 ( 0.00%) TyKind::FnPtr(fn_ptr) if fn_ptr.abi == ExternAbi::Rust => (50 * self.nest, 1), 94 ( 0.00%) => ???:::eq (2x) . 58 ( 0.00%) TyKind::TraitObject(param_bounds, _) => { . let has_lifetime_parameters = param_bounds.iter().any(|bound| { . bound . .bound_generic_params . .iter() . .any(|param| matches!(param.kind, GenericParamKind::Lifetime { .. })) . }); . if has_lifetime_parameters { . // complex trait bounds like A<'a, 'b> . (50 * self.nest, 1) . } else { . // simple trait bounds like A + B 232 ( 0.00%) (20 * self.nest, 0) . } . }, . . _ => (0, 0), . }; 20,934 ( 0.00%) self.score += add_score; 20,934 ( 0.00%) self.nest += sub_nest; 41,868 ( 0.00%) walk_ty(self, ty); 1,369,281 ( 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_ty:: (14,277x) 20,934 ( 0.00%) self.nest -= sub_nest; 83,736 ( 0.00%) } . } 62,743 ( 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/accum.rs -------------------------------------------------------------------------------- Ir -- line 47 ---------------------------------------- . macro_rules! integer_sum_product { . (@impls $zero:expr, $one:expr, #[$attr:meta], $($a:ty)*) => ($( . #[$attr] . impl Sum for $a { . fn sum>(iter: I) -> Self { . iter.fold( . $zero, . #[rustc_inherit_overflow_checks] 179,979 ( 0.00%) |a, b| a + b, . ) . } . } . . #[$attr] . impl Product for $a { . fn product>(iter: I) -> Self { . iter.fold( -- line 63 ---------------------------------------- 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_middle/src/ty/adt.rs -------------------------------------------------------------------------------- Ir -- line 26 ---------------------------------------- . AsyncDestructor, Destructor, FieldDef, GenericClauses, Ty, TyCtxt, VariantDef, VariantDiscr, . }; . use crate::mir::interpret::ErrorHandled; . use crate::ty::util::{Discr, IntTypeExt}; . use crate::ty::{self, ConstKind}; . . #[derive(Clone, Copy, PartialEq, Eq, Hash, StableHash, TyEncodable, TyDecodable)] . pub struct AdtFlags(u16); 8,943 ( 0.00%) bitflags::bitflags! { . impl AdtFlags: u16 { . const NO_ADT_FLAGS = 0; . /// Indicates whether the ADT is an enum. . const IS_ENUM = 1 << 0; . /// Indicates whether the ADT is a union. . const IS_UNION = 1 << 1; . /// Indicates whether the ADT is a struct. . const IS_STRUCT = 1 << 2; -- line 42 ---------------------------------------- -- line 180 ---------------------------------------- . . #[derive(Copy, Clone, PartialEq, Eq, Hash, StableHash)] . #[rustc_pass_by_value] . pub struct AdtDef<'tcx>(pub Interned<'tcx, AdtDefData>); . . impl<'tcx> AdtDef<'tcx> { . #[inline] . pub fn did(self) -> DefId { 198,256 ( 0.00%) self.0.0.did . } . . #[inline] . pub fn variants(self) -> &'tcx IndexSlice { . &self.0.0.variants . } . . #[inline] . pub fn variant(self, idx: VariantIdx) -> &'tcx VariantDef { 6 ( 0.00%) &self.0.0.variants[idx] . } . . #[inline] . pub fn flags(self) -> AdtFlags { 488 ( 0.00%) self.0.0.flags . } . . #[inline] . pub fn repr(self) -> ReprOptions { 15 ( 0.00%) self.0.0.repr . } . . pub fn field_representing_type_info( . self, . tcx: TyCtxt<'tcx>, . args: ty::GenericArgsRef<'tcx>, . ) -> Option>> { . if !self.is_field_representing_type() { -- line 216 ---------------------------------------- 17,041 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/redundant_static_lifetimes.rs -------------------------------------------------------------------------------- Ir -- line 43 ---------------------------------------- . impl RedundantStaticLifetimes { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl RedundantStaticLifetimes { . // Recursively visit types 1,690 ( 0.00%) fn visit_type(ty: &Ty, cx: &EarlyContext<'_>, reason: &'static str) { 1,228 ( 0.00%) match ty.kind { . // Be careful of nested structures (arrays and tuples) . TyKind::Array(ref ty, _) | TyKind::Slice(ref ty) => { 19 ( 0.00%) Self::visit_type(ty, cx, reason); . }, . TyKind::Tup(ref tup) => { . for tup_ty in tup { 20 ( 0.00%) Self::visit_type(tup_ty, cx, reason); 100 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/redundant_static_lifetimes.rs:::visit_type'2 (4x) . } . }, . // This is what we are looking for ! . TyKind::Ref(ref optional_lifetime, ref borrow_type) => { . // Match the 'static lifetime 12 ( 0.00%) if let Some(lifetime) = *optional_lifetime { . match borrow_type.ty.kind { . TyKind::Path(..) | TyKind::Slice(..) | TyKind::Array(..) | TyKind::Tup(..) . if lifetime.ident.name == kw::StaticLifetime => . { . let snip = snippet(cx, borrow_type.ty.span, ""); . let sugg = format!("&{}{snip}", borrow_type.mutbl.prefix_str()); . span_lint_and_then(cx, REDUNDANT_STATIC_LIFETIMES, lifetime.ident.span, reason, |diag| { . diag.span_suggestion( -- line 73 ---------------------------------------- -- line 76 ---------------------------------------- . sugg, . Applicability::MachineApplicable, //snippet . ); . }); . }, . _ => {}, . } . } 30 ( 0.00%) Self::visit_type(&borrow_type.ty, cx, reason); 160 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/redundant_static_lifetimes.rs:::visit_type'2 (5x) . }, . _ => {}, . } 1,352 ( 0.00%) } . } . . impl EarlyLintPass for RedundantStaticLifetimes { . fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) { 44,964 ( 0.00%) if !self.msrv.meets(msrvs::STATIC_IN_CONST) { 119,904 ( 0.00%) => /rust/deps/smallvec-1.15.1/src/lib.rs:::meets (4,996x) . return; . } . . if !item.span.from_expansion() { 16,935 ( 0.00%) if let ItemKind::Const(ConstItem { ty: ref var_type, .. }) = item.kind { 580 ( 0.00%) Self::visit_type(var_type, cx, "constants have by default a `'static` lifetime"); . // Don't check associated consts because `'static` cannot be elided on those (issue . // #2438) . } . 14 ( 0.00%) if let ItemKind::Static(StaticItem { ty: ref var_type, .. }) = item.kind { 42 ( 0.00%) Self::visit_type(var_type, cx, "statics have by default a `'static` lifetime"); . } . } . } . . extract_msrv_attr!(); . } 5,333 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/impl_hash_with_borrow_str_and_bytes.rs -------------------------------------------------------------------------------- Ir -- line 71 ---------------------------------------- . . declare_lint_pass!(ImplHashWithBorrowStrBytes => [ . IMPL_HASH_BORROW_WITH_STR_AND_BYTES, . ]); . . impl LateLintPass<'_> for ImplHashWithBorrowStrBytes { . /// We are emitting this lint at the Hash impl of a type that implements all . /// three of `Hash`, `Borrow` and `Borrow<[u8]>`. 41,566 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) { 14,050 ( 0.00%) if let ItemKind::Impl(imp) = item.kind 4,348 ( 0.00%) && let Some(of_trait) = imp.of_trait 5,733 ( 0.00%) && let ty = cx.tcx.type_of(item.owner_id).instantiate_identity().skip_norm_wip() 9,555 ( 0.00%) && let Some(hash_id) = cx.tcx.get_diagnostic_item(sym::Hash) 202,566 ( 0.00%) => ???:::get_diagnostic_item (1,911x) 17,199 ( 0.00%) && Res::Def(DefKind::Trait, hash_id) == of_trait.trait_ref.path.res 63,279 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/def.rs:::eq (1,911x) 540 ( 0.00%) && let Some(borrow_id) = cx.tcx.get_diagnostic_item(sym::Borrow) 11,448 ( 0.00%) => ???:::get_diagnostic_item (108x) . // since we are in the `Hash` impl, we don't need to check for that. . // we need only to check for `Borrow` and `Borrow<[u8]>` 1,188 ( 0.00%) && implements_trait(cx, ty, borrow_id, &[cx.tcx.types.str_.into()]) 1,325,244 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::implements_trait (108x) . && implements_trait(cx, ty, borrow_id, &[Ty::new_slice(cx.tcx, cx.tcx.types.u8).into()]) . { . span_lint_and_then( . cx, . IMPL_HASH_BORROW_WITH_STR_AND_BYTES, . of_trait.trait_ref.path.span, . "the semantics of `Borrow` around `Hash` can't be satisfied when both `Borrow` and `Borrow<[u8]>` are implemented", . |diag| { -- line 96 ---------------------------------------- -- line 99 ---------------------------------------- . "however, the hash implementations of a string (`str`) and the bytes of a string `[u8]` do not behave the same ..." . ); . diag.note("... as (`hash(\"abc\") != hash(\"abc\".as_bytes())`"); . diag.help("consider either removing one of the `Borrow` implementations (`Borrow` or `Borrow<[u8]>`) ..."); . diag.help("... or not implementing `Hash` for this type"); . }, . ); . } 47,504 ( 0.00%) } . } 2,127 ( 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 { 2,688 ( 0.00%) if let hir::TyKind::Path(ref qpath) = ty.kind { 896 ( 0.00%) is_ty_alias(qpath) 19,811 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_ty_alias (896x) . } else { . false . } . } . . impl LateLintPass<'_> for DefaultConstructedUnitStructs { 1,695,596 ( 0.01%) fn check_expr<'tcx>(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>) { 541,970 ( 0.00%) if let ExprKind::Call(fn_expr, &[]) = expr.kind . // make sure we have a call to `Default::default` 9,208 ( 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 7,168 ( 0.00%) && !is_alias(*base) 8,520 ( 0.00%) && let Res::Def(_, def_id) = cx.qpath_res(qpath, fn_expr.hir_id) 66,496 ( 0.00%) => ???:::qpath_res (852x) 4,260 ( 0.00%) && cx.tcx.is_diagnostic_item(sym::default_fn, def_id) 73,290 ( 0.00%) => ???:::is_diagnostic_item (852x) . // make sure we have a struct with no fields (unit struct) 1,744 ( 0.00%) && let ty::Adt(def, ..) = cx.typeck_results().expr_ty(expr).kind() 17,452 ( 0.00%) => ???:::expr_ty (436x) 66 ( 0.00%) && def.is_struct() 106 ( 0.00%) && let var @ ty::VariantDef { ctor: Some((hir::def::CtorKind::Const, _)), .. } = def.non_enum_variant() 240 ( 0.00%) => ???:::non_enum_variant (30x) 2 ( 0.00%) && !var.is_field_list_non_exhaustive() 7 ( 0.00%) && !expr.span.from_expansion() && !qpath.span().from_expansion() 145 ( 0.00%) => ???:::span (1x) . // do not suggest replacing an expression by a type name with placeholders 4 ( 0.00%) && !base.is_suggestable_infer_ty() 63 ( 0.00%) => ???:::is_suggestable_infer_ty (1x) . { 5 ( 0.00%) let mut removals = vec![(expr.span.with_lo(qpath.qself_span().hi()), String::new())]; . if expr.span.check_text(cx, |s| s.starts_with('<')) { . // Remove `<`, '>` has already been removed by the existing removal expression. . removals.push((expr.span.with_hi(qpath.qself_span().lo()), String::new())); . } 9 ( 0.00%) span_lint_and_then( 379,319 ( 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#1}> (1x) . cx, . DEFAULT_CONSTRUCTED_UNIT_STRUCTS, . expr.span, . "use of `default` to create a unit struct", 4 ( 0.00%) |diag| { . diag.multipart_suggestion( . "remove this call to `default`", . removals, . Applicability::MachineApplicable, . ); . }, . ); . } 1,937,824 ( 0.02%) } . } 3,540 ( 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 484,456 ( 0.00%) if e.span.from_expansion() { . // Issue #11268 . return; . } . 788,703 ( 0.01%) match e.kind { 33,570 ( 0.00%) ExprKind::Call(fn_expr, arguments) => { 33,572 ( 0.00%) if let ExprKind::Path(ref path) = fn_expr.kind . && arguments.iter().any(is_mut_ref_arg) . { 4,140 ( 0.00%) check_arguments( . cx, . &mut arguments.iter(), 920 ( 0.00%) cx.typeck_results().expr_ty(fn_expr), 18,412 ( 0.00%) => ???:::expr_ty (460x) . #[allow(trivial_casts)] 920 ( 0.00%) &|| { . rustc_hir_pretty::qpath_to_string( . &(&cx.tcx as &dyn intravisit::HirTyCtxt<'_>) as &dyn PpAnn, . path, . ) . }, . "function", . ); . } . }, 98 ( 0.00%) ExprKind::MethodCall(path, receiver, arguments, _) 34,977 ( 0.00%) if iter::once(receiver).chain(arguments.iter()).any(is_mut_ref_arg) 441 ( 0.00%) && let Some(def_id) = cx.typeck_results().type_dependent_def_id(e.hir_id) => 2,499 ( 0.00%) => ???:::type_dependent_def_id (49x) . { 245 ( 0.00%) let args = cx.typeck_results().node_args(e.hir_id); 1,906 ( 0.00%) => ???:::node_args (49x) 49 ( 0.00%) let method_type = cx.tcx.type_of(def_id).instantiate(cx.tcx, args).skip_norm_wip(); 441 ( 0.00%) check_arguments( . cx, . &mut iter::once(receiver).chain(arguments.iter()), . method_type, 49 ( 0.00%) &|| path.ident.as_str().to_owned(), . "method", . ); . }, . _ => (), . } 1,937,824 ( 0.02%) } . } . . /// 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 { 109,690 ( 0.00%) matches!(argument.kind, ExprKind::AddrOf(BorrowKind::Ref, Mutability::Mut, _)) . } . 6,108 ( 0.00%) fn check_arguments<'tcx>( . cx: &LateContext<'tcx>, . arguments: &mut dyn Iterator>, . type_definition: Ty<'tcx>, . name: &dyn Fn() -> String, . fn_kind: &str, . ) { . if type_definition.is_fn() { 1,506 ( 0.00%) let parameters = type_definition.fn_sig(cx.tcx).skip_binder().inputs(); 672,432 ( 0.01%) => ???:::fn_sig (502x) . for (argument, parameter) in iter::zip(arguments, parameters) { 11,572 ( 0.00%) if let ty::Ref(_, _, Mutability::Not) | ty::RawPtr(_, Mutability::Not) = parameter.kind() 186 ( 0.00%) && let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Mut, arg) = argument.kind . { . let applicability = Applicability::MachineApplicable; . . let span_to_remove = { . let span_until_arg = argument.span.until(arg.span); . if let Some(Some(ref_pos)) = span_until_arg.with_source_text(cx, |src| { . src . // we don't use `strip_prefix` here, because `argument` might be enclosed in parens, in -- line 111 ---------------------------------------- -- line 128 ---------------------------------------- . format!("the {fn_kind} `{}` doesn't need a mutable reference", name()), . |diag| { . diag.span_suggestion_verbose(span_to_remove, "remove this `mut`", String::new(), applicability); . }, . ); . } . } . } 4,072 ( 0.00%) } 4,364 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/len_without_is_empty.rs -------------------------------------------------------------------------------- Ir -- line 39 ---------------------------------------- . pub LEN_WITHOUT_IS_EMPTY, . style, . "traits or impls with a public `len` method but no corresponding `is_empty` method" . } . . declare_lint_pass!(LenWithoutIsEmpty => [LEN_WITHOUT_IS_EMPTY]); . . impl<'tcx> LateLintPass<'tcx> for LenWithoutIsEmpty { 41,566 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) { 11,876 ( 0.00%) if let ItemKind::Trait { 164 ( 0.00%) ident, 82 ( 0.00%) items: trait_items, . .. . } = item.kind 82 ( 0.00%) && !item.span.from_expansion() . { 123 ( 0.00%) check_trait_items(cx, item, ident, trait_items); . } 47,504 ( 0.00%) } . 28,777 ( 0.00%) fn check_impl_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx ImplItem<'_>) { 4,111 ( 0.00%) if item.ident.name == sym::len 28 ( 0.00%) && let ImplItemKind::Fn(sig, _) = &item.kind 56 ( 0.00%) && sig.decl.implicit_self().has_implicit_self() 112 ( 0.00%) => ???:::implicit_self (14x) 28 ( 0.00%) && sig.decl.inputs.len() == 1 84 ( 0.00%) && cx.effective_visibilities.is_exported(item.owner_id.def_id) 783 ( 0.00%) => ???:::is_exported (14x) 8 ( 0.00%) && matches!(sig.decl.output, FnRetTy::Return(_)) 28 ( 0.00%) && let Some(imp) = get_parent_as_impl(cx.tcx, item.hir_id()) 608 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_as_impl (4x) 4 ( 0.00%) && imp.of_trait.is_none() 16 ( 0.00%) && let TyKind::Path(ty_path) = &imp.self_ty.kind 16 ( 0.00%) && let Some(ty_id) = cx.qpath_res(ty_path, imp.self_ty.hir_id).opt_def_id() 92 ( 0.00%) => ???:::qpath_res (4x) . && let Some(local_id) = ty_id.as_local() . && let ty_hir_id = cx.tcx.local_def_id_to_hir_id(local_id) 16 ( 0.00%) && let Some(output) = LenOutput::new( 180 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/len_without_is_empty.rs:::new (4x) . cx, . cx.tcx . .fn_sig(item.owner_id) . .instantiate_identity() . .skip_norm_wip() . .skip_binder(), . ) . { 28 ( 0.00%) let (name, kind) = match cx.tcx.hir_node(ty_hir_id) { 276 ( 0.00%) => ???:::hir_node (4x) . Node::ForeignItem(x) => (x.ident.name, "extern type"), 24 ( 0.00%) Node::Item(x) => match x.kind { 20 ( 0.00%) ItemKind::Struct(ident, ..) => (ident.name, "struct"), . ItemKind::Enum(ident, ..) => (ident.name, "enum"), . ItemKind::Union(ident, ..) => (ident.name, "union"), . _ => (x.kind.ident().unwrap().name, "type"), . }, . _ => return, . }; 60 ( 0.00%) check_for_is_empty( 589,491 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/len_without_is_empty.rs:clippy_lints::len_without_is_empty::check_for_is_empty (4x) . cx, 4 ( 0.00%) sig.span, 8 ( 0.00%) sig.decl.implicit_self(), 32 ( 0.00%) => ???:::implicit_self (4x) . output, . ty_id, . name, . kind, . item.hir_id(), . ty_hir_id, . ); . } 32,888 ( 0.00%) } . } . . fn check_trait_items(cx: &LateContext<'_>, visited_trait: &Item<'_>, ident: Ident, trait_items: &[TraitItemId]) { . fn is_named_self(cx: &LateContext<'_>, item: TraitItemId, name: Symbol) -> bool { . cx.tcx.item_name(item.owner_id) == name . && matches!( . cx.tcx.fn_arg_idents(item.owner_id), . [Some(Ident { -- line 111 ---------------------------------------- -- line 119 ---------------------------------------- . fn fill_trait_set(traitt: DefId, set: &mut DefIdSet, cx: &LateContext<'_>) { . if set.insert(traitt) { . for supertrait in supertrait_def_ids(cx.tcx, traitt) { . fill_trait_set(supertrait, set, cx); . } . } . } . 205 ( 0.00%) if cx.effective_visibilities.is_exported(visited_trait.owner_id.def_id) 2,322 ( 0.00%) => ???:::is_exported (41x) . && trait_items.iter().any(|&i| is_named_self(cx, i, sym::len)) . { . let mut current_and_super_traits = DefIdSet::default(); . fill_trait_set(visited_trait.owner_id.to_def_id(), &mut current_and_super_traits, cx); . let is_empty_method_found = current_and_super_traits . .items() . .flat_map(|&i| UnordItems::new(cx.tcx.associated_items(i).filter_by_name_unhygienic(sym::is_empty))) . .any(|i| i.is_method() && cx.tcx.fn_sig(i.def_id).skip_binder().inputs().skip_binder().len() == 1); -- line 135 ---------------------------------------- -- line 143 ---------------------------------------- . "trait `{}` has a `len` method but no (possibly inherited) `is_empty` method", . ident.name . ), . ); . } . } . } . 5 ( 0.00%) fn extract_future_output<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option<&'tcx PathSegment<'tcx>> { 10 ( 0.00%) if let ty::Alias( . _, . ty::AliasTy { . kind: ty::Opaque { def_id }, . .. . }, . ) = *ty.kind() . && let Some(Node::OpaqueTy(opaque)) = cx.tcx.hir_get_if_local(def_id) . && let OpaqueTyOrigin::AsyncFn { .. } = opaque.origin -- line 160 ---------------------------------------- -- line 165 ---------------------------------------- . && let Some(ty) = constraint.ty() . && let TyKind::Path(QPath::Resolved(_, path)) = ty.kind . && let [segment] = path.segments . { . return Some(segment); . } . . None 5 ( 0.00%) } . . fn is_first_generic_integral<'tcx>(segment: &'tcx PathSegment<'tcx>) -> bool { . if let Some(generic_args) = segment.args . && let [GenericArg::Type(ty), ..] = &generic_args.args . && let TyKind::Path(QPath::Resolved(_, path)) = ty.kind . && let [segment, ..] = &path.segments . && matches!(segment.res, Res::PrimTy(PrimTy::Uint(_) | PrimTy::Int(_))) . { -- line 181 ---------------------------------------- -- line 188 ---------------------------------------- . #[derive(Debug, Clone, Copy)] . enum LenOutput { . Integral, . Option(DefId), . Result(DefId), . } . . impl LenOutput { 36 ( 0.00%) fn new<'tcx>(cx: &LateContext<'tcx>, sig: FnSig<'tcx>) -> Option { 20 ( 0.00%) if let Some(segment) = extract_future_output(cx, sig.output()) { 16 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/len_without_is_empty.rs:clippy_lints::len_without_is_empty::extract_future_output (4x) . let res = segment.res; . . if matches!(res, Res::PrimTy(PrimTy::Uint(_) | PrimTy::Int(_))) { . return Some(Self::Integral); . } . . if let Res::Def(_, def_id) = res . && let Some(res) = match cx.tcx.get_diagnostic_name(def_id) { -- line 205 ---------------------------------------- -- line 210 ---------------------------------------- . && is_first_generic_integral(segment) . { . return Some(res); . } . . return None; . } . 16 ( 0.00%) match *sig.output().kind() { 4 ( 0.00%) ty::Int(_) | ty::Uint(_) => Some(Self::Integral), . ty::Adt(adt, subs) => match cx.tcx.get_diagnostic_name(adt.did()) { . Some(sym::Option) => subs.type_at(0).is_integral().then(|| Self::Option(adt.did())), . Some(sym::Result) => subs.type_at(0).is_integral().then(|| Self::Result(adt.did())), . _ => None, . }, . _ => None, . } 28 ( 0.00%) } . . fn matches_is_empty_output<'tcx>(self, cx: &LateContext<'tcx>, is_empty_output: Ty<'tcx>) -> bool { 5 ( 0.00%) if let Some(segment) = extract_future_output(cx, is_empty_output) { 4 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/len_without_is_empty.rs:clippy_lints::len_without_is_empty::extract_future_output (1x) . return match (self, segment.res) { . (_, Res::PrimTy(PrimTy::Bool)) => true, . (Self::Option(_), Res::Def(_, def_id)) if cx.tcx.is_diagnostic_item(sym::Option, def_id) => true, . (Self::Result(_), Res::Def(_, def_id)) if cx.tcx.is_diagnostic_item(sym::Result, def_id) => true, . _ => false, . }; . } . 3 ( 0.00%) match (self, is_empty_output.kind()) { . (_, &ty::Bool) => true, . (Self::Option(id), &ty::Adt(adt, subs)) if id == adt.did() => subs.type_at(0).is_bool(), . (Self::Result(id), &ty::Adt(adt, subs)) if id == adt.did() => subs.type_at(0).is_bool(), . _ => false, . } . } . } . -- line 247 ---------------------------------------- -- line 265 ---------------------------------------- . . /// Checks if the given signature matches the expectations for `is_empty` . fn check_is_empty_sig<'tcx>( . cx: &LateContext<'tcx>, . is_empty_sig: FnSig<'tcx>, . len_self_kind: ImplicitSelfKind, . len_output: LenOutput, . ) -> bool { 2 ( 0.00%) if let [is_empty_self_arg, is_empty_output] = &**is_empty_sig.inputs_and_output 1 ( 0.00%) && len_output.matches_is_empty_output(cx, *is_empty_output) . { 7 ( 0.00%) match (is_empty_self_arg.kind(), len_self_kind) { . // if `len` takes `&self`, `is_empty` should do so as well . (ty::Ref(_, _, Mutability::Not), ImplicitSelfKind::RefImm) . // if `len` takes `&mut self`, `is_empty` may take that _or_ `&self` (#16190) . | (ty::Ref(_, _, Mutability::Mut | Mutability::Not), ImplicitSelfKind::RefMut) => true, . // if len takes `self`, `is_empty` should do so as well . // XXX: we might want to relax this to allow `&self` and `&mut self` . (_, ImplicitSelfKind::Imm | ImplicitSelfKind::Mut) if !is_empty_self_arg.is_ref() => true, . _ => false, -- line 284 ---------------------------------------- -- line 285 ---------------------------------------- . } . } else { . false . } . } . . /// Checks if the given type has an `is_empty` method with the appropriate signature. . #[expect(clippy::too_many_arguments)] 48 ( 0.00%) fn check_for_is_empty( . cx: &LateContext<'_>, . len_span: Span, . len_self_kind: ImplicitSelfKind, . len_output: LenOutput, . impl_ty: DefId, . item_name: Symbol, . item_kind: &str, . len_method_hir_id: HirId, . ty_decl_hir_id: HirId, . ) { . // Implementor may be a type alias, in which case we need to get the `DefId` of the aliased type to . // find the correct inherent impls. 4 ( 0.00%) let impl_ty = if let Some(adt) = cx.tcx.type_of(impl_ty).skip_binder().ty_adt_def() { . adt.did() . } else { . return; . }; . . let is_empty = cx . .tcx . .inherent_impls(impl_ty) . .iter() 16 ( 0.00%) .flat_map(|&id| cx.tcx.associated_items(id).filter_by_name_unhygienic(sym::is_empty)) 340 ( 0.00%) => ???:::filter_by_name_unhygienic (4x) . .find(|item| item.is_fn()); . 12 ( 0.00%) let (msg, is_empty_span, is_empty_expected_sig) = match is_empty { . None => ( 21 ( 0.00%) format!("{item_kind} `{item_name}` has a public `len` method, but no `is_empty` method"), . None, . None, . ), 8 ( 0.00%) Some(is_empty) if !cx.effective_visibilities.is_exported(is_empty.def_id.expect_local()) => ( 57 ( 0.00%) => ???:::is_exported (1x) . format!("{item_kind} `{item_name}` has a public `len` method, but a private `is_empty` method"), . Some(cx.tcx.def_span(is_empty.def_id)), . None, . ), . Some(is_empty) 2 ( 0.00%) if !(is_empty.is_method() 3 ( 0.00%) && check_is_empty_sig( . cx, . cx.tcx 2 ( 0.00%) .fn_sig(is_empty.def_id) . .instantiate_identity() . .skip_norm_wip() . .skip_binder(), . len_self_kind, . len_output, . )) => . { . ( -- line 343 ---------------------------------------- -- line 346 ---------------------------------------- . ), . Some(cx.tcx.def_span(is_empty.def_id)), . Some(expected_is_empty_sig(len_output, len_self_kind)), . ) . }, . Some(_) => return, . }; . 33 ( 0.00%) if !fulfill_or_allowed(cx, LEN_WITHOUT_IS_EMPTY, [len_method_hir_id, ty_decl_hir_id]) { 5,466 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::fulfill_or_allowed::<[rustc_hir_id::HirId; 2]> (3x) 48 ( 0.00%) span_lint_and_then(cx, LEN_WITHOUT_IS_EMPTY, len_span, msg, |db| { 570,831 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then:: (3x) 6 ( 0.00%) if let Some(span) = is_empty_span { . db.span_note(span, "`is_empty` defined here"); . } 6 ( 0.00%) if let Some(expected_sig) = is_empty_expected_sig { . db.note(expected_sig); . } . }); . } 32 ( 0.00%) } 152 ( 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) { 424,196 ( 0.00%) if let ExprKind::If(_, _, Some(ref els)) = item.kind 1,462 ( 0.00%) && let ExprKind::If(_, _, None) = els.kind 9 ( 0.00%) && !item.span.in_external_macro(cx.sess().source_map()) . { . #[expect(clippy::collapsible_span_lint_calls, reason = "rust-clippy#7797")] 18 ( 0.00%) span_lint_and_then( 2,115 ( 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#0}> (3x) . cx, . ELSE_IF_WITHOUT_ELSE, 3 ( 0.00%) els.span, . "`if` expression with an `else if`, but without a final `else`", . |diag| { . diag.help("add an `else` block here"); . }, . ); . } . } . } -- line 66 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 1,937,824 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 506,508 ( 0.00%) if let ExprKind::If(cond, then, Some(otherwise)) = expr.kind 2,220 ( 0.00%) && let ExprKind::Path(_) = cond.kind 102 ( 0.00%) && let ExprKind::Block( . Block { 141 ( 0.00%) stmts: [stmt], . expr: Some(then_expr), . .. . }, . .., 8 ( 0.00%) ) = then.kind 2 ( 0.00%) && let ExprKind::Block( . Block { 3 ( 0.00%) stmts: [], . expr: Some(else_expr), . .. . }, . .., . ) = otherwise.kind . && let StmtKind::Semi(assignment) = stmt.kind . && let ExprKind::Assign(mut_c, possible_false, _) = assignment.kind . && let ExprKind::Path(_) = mut_c.kind -- line 77 ---------------------------------------- -- line 98 ---------------------------------------- . expr.span, . "use", . format!("{negate}{std_or_core}::mem::take(&mut {taken})"), . app, . ); . }, . ); . } 1,937,824 ( 0.02%) } . } . . 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/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<'_, '_> { 43,940 ( 0.00%) fn check_single_char_names(&self) { 21,970 ( 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(); 982 ( 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( 5 ( 0.00%) self.cx, . MANY_SINGLE_CHAR_NAMES, . span, 15 ( 0.00%) format!("{num_single_char_names} bindings with single-character names in scope"), . ); . } 65,910 ( 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 { 252,182 ( 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, '_> { 317,259 ( 0.00%) fn visit_pat(&mut self, pat: &'tcx Pat) { 262,268 ( 0.00%) match pat.kind { 112,212 ( 0.00%) PatKind::Ident(_, ident, _) => { 56,106 ( 0.00%) if !pat.span.from_expansion() { 24,024 ( 0.00%) self.check_ident(ident); . } . }, . PatKind::Struct(_, _, ref fields, _) => { . for field in fields { 6,178 ( 0.00%) if !field.is_shorthand { 4,104 ( 0.00%) self.visit_pat(&field.pat); 68,152 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::visit_pat'2 (105x) . } . } . }, . // just go through the first pattern, as either all patterns . // bind the same bindings or rustc would have errored much earlier 446 ( 0.00%) PatKind::Or(ref pats) => self.visit_pat(&pats[0]), . _ => walk_pat(self, pat), . } 236,864 ( 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() 210,792 ( 0.00%) .any(|&name| interned_name.starts_with(name) || interned_name.ends_with(name)) . } . . impl SimilarNamesNameVisitor<'_, '_, '_> { 1,986 ( 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); . } 2,648 ( 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 == '_') { . span_lint( 1 ( 0.00%) self.0.cx, . JUST_UNDERSCORES_AND_DIGITS, 1 ( 0.00%) ident.span, . "consider choosing a more descriptive name", . ); . return; . } 23,371 ( 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(); 46,628 ( 0.00%) if count < 3 { 9,338 ( 0.00%) if count == 1 { 2,648 ( 0.00%) self.check_short_ident(ident); 38,398 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::check_short_ident (446x) . } . return; . } . for existing_name in &self.0.names { 126,514 ( 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 108,841 ( 0.00%) if count == 3 && existing_name.len == 3 { . continue; . } . 147,222 ( 0.00%) let dissimilar = match existing_name.len.cmp(&count) { 6,478 ( 0.00%) Ordering::Greater => existing_name.len - count != 1 || levenstein_not_1(interned_name, existing_str), 173,720 ( 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), . }; . 35,092 ( 0.00%) if dissimilar { . continue; . } . 1,211 ( 0.00%) span_lint_and_then( 125,470 ( 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}> (170x) 173 ( 0.00%) self.0.cx, . SIMILAR_NAMES, 173 ( 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, 18,472 ( 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"); 477,362 ( 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)) { 93,489 ( 0.00%) if interned_chars . .zip(existing_chars) . .filter(|&ie| !eq_or_numeric(ie)) . .count() . != 1 . { . return true; . } . } else { . let second_last_i = interned_chars . .next_back() . .expect("we know we have at least three chars"); . let second_last_e = existing_chars . .next_back() . .expect("we know we have at least three chars"); 42 ( 0.00%) if !eq_or_numeric((second_last_i, second_last_e)) . || second_last_i == '_' . || !interned_chars.zip(existing_chars).all(eq_or_numeric) . { . // allowed similarity foo_x, foo_y . // or too many chars differ (foo_x, boo_y) or (foox, booy) . return true; . } . } -- line 333 ---------------------------------------- -- 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> { 147,231 ( 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 65,436 ( 0.00%) SimilarNamesNameVisitor(self).visit_pat(&local.pat); 20,860,727 ( 0.17%) => site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::visit_pat (16,146x) 130,872 ( 0.00%) } 106,641 ( 0.00%) fn visit_block(&mut self, blk: &'tcx Block) { 1,213 ( 0.00%) self.single_char_names.push(vec![]); . . self.apply(|this| walk_block(this, blk)); . 23,698 ( 0.00%) self.check_single_char_names(); 44,407 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::check_single_char_names (3,646x) . self.single_char_names.pop(); 94,592 ( 0.00%) } 54,855 ( 0.00%) fn visit_arm(&mut self, arm: &'tcx Arm) { 579 ( 0.00%) self.single_char_names.push(vec![]); . . self.apply(|this| { 24,380 ( 0.00%) SimilarNamesNameVisitor(this).visit_pat(&arm.pat); 1,230,030 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::visit_pat (3,635x) 18,285 ( 0.00%) if let Some(body) = &arm.body { . this.apply(|this| walk_expr(this, body)); . } . }); . 12,190 ( 0.00%) self.check_single_char_names(); 46,580 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::check_single_char_names (3,635x) . self.single_char_names.pop(); 48,760 ( 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) { 7,462 ( 0.00%) if item.span.in_external_macro(cx.sess().source_map()) { . return; . } . 2,462 ( 0.00%) if let ItemKind::Fn(ast::Fn { . ref sig, . body: Some(ref blk), . .. 4,924 ( 0.00%) }) = item.kind . { 6,155 ( 0.00%) do_check(self, cx, &item.attrs, &sig.decl, blk); 30,132,980 ( 0.25%) => site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:clippy_lints::non_expressive_names::do_check (1,231x) . } . } . . fn check_impl_item(&mut self, cx: &EarlyContext<'_>, item: &AssocItem) { 18,317 ( 0.00%) if item.span.in_external_macro(cx.sess().source_map()) { . return; . } . 2,795 ( 0.00%) if let AssocItemKind::Fn(ast::Fn { . ref sig, . body: Some(ref blk), . .. 8,385 ( 0.00%) }) = item.kind . { 11,180 ( 0.00%) do_check(self, cx, &item.attrs, &sig.decl, blk); 8,731,606 ( 0.07%) => site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:clippy_lints::non_expressive_names::do_check (2,795x) . } . } . } . 44,286 ( 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)) { 32,208 ( 0.00%) let mut visitor = SimilarNamesLocalVisitor { . names: Vec::new(), . cx, . threshold: lint.single_char_binding_names_threshold, 12,078 ( 0.00%) single_char_names: vec![vec![]], . }; . . // initialize with function arguments . for arg in &decl.inputs { 36,040 ( 0.00%) SimilarNamesNameVisitor(&mut visitor).visit_pat(&arg.pat); 3,988,901 ( 0.03%) => site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::visit_pat (9,010x) . } . // walk all other bindings . walk_block(&mut visitor, blk); . 4,026 ( 0.00%) visitor.check_single_char_names(); 64,402 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/non_expressive_names.rs:::check_single_char_names (4,026x) . } 32,208 ( 0.00%) } . . /// Precondition: `a_name.chars().count() < b_name.chars().count()`. . #[must_use] 17,546 ( 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(); 76,839 ( 0.00%) while let (Some(a), Some(b)) = (a_chars.next(), b_chars.next()) { 76,104 ( 0.00%) if a == b { . continue; . } . if let Some(b2) = b_chars.next() { . // check if there's just one character inserted 50,237 ( 0.00%) return a != b2 || a_chars.ne(b_chars); . } . // tuple . // ntuple . return true; . } . // for item in items . true 35,092 ( 0.00%) } 411,209 ( 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 { 968,912 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &'_ Expr<'_>) { 488,236 ( 0.00%) if let ExprKind::Lit(lit) = expr.kind 39,120 ( 0.00%) && let LitKind::Str(_, _) | LitKind::Char(_) = lit.node . { 7,560 ( 0.00%) check_str(cx, lit.span, expr.hir_id); . } 1,211,140 ( 0.01%) } . } . . 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) { 15,120 ( 0.00%) if !span_is_local(span) { 495,152 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::span_is_local (3,780x) . 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 ---------------------------------------- 7,560 ( 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/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 8 ( 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. 19,739 ( 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). . 3,016,324 ( 0.03%) let result = crate::intrinsics::read_via_copy(dest); 4,234,682 ( 0.04%) 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 { 77,859 ( 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 ---------------------------------------- 318,370 ( 0.00%) -------------------------------------------------------------------------------- -- 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; . 2,663,584 ( 0.02%) 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 916,972 ( 0.01%) if is_child_of_cast(cx, expr) { . return; . } . 241,569 ( 0.00%) if let Some(CastChainInfo { . left_cast, . start_ty, . end_ty, 1,207,845 ( 0.01%) }) = expr_cast_chain_tys(cx, expr) 5,949,366 ( 0.05%) => site/frontend/rust-clippy/clippy_lints/src/casts/cast_slice_different_sizes.rs:clippy_lints::casts::cast_slice_different_sizes::expr_cast_chain_tys (241,569x) . && 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, . ); . }, . ); . } . } 1,937,152 ( 0.02%) } . . fn is_child_of_cast(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { 484,288 ( 0.00%) let parent = cx.tcx.parent_hir_node(expr.hir_id); 28,763,616 ( 0.24%) => ???:::parent_hir_node (242,144x) 1,181,436 ( 0.01%) let expr = match parent { 14,642 ( 0.00%) Node::Block(block) => { 43,926 ( 0.00%) if let Some(parent_expr) = block.expr { . parent_expr . } else { . return false; . } . }, 351,796 ( 0.00%) Node::Expr(expr) => expr, . _ => return false, . }; . 190,540 ( 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> { 900 ( 0.00%) match ty.kind() { 9 ( 0.00%) ty::RawPtr(slice_ty, mutbl) => match slice_ty.kind() { 2 ( 0.00%) ty::Slice(ty) => Some(TypeAndMut { ty: *ty, mutbl: *mutbl }), . _ => None, . }, . _ => None, . } . } . . struct CastChainInfo<'tcx> { . /// The left most part of the cast chain, or in other words, the first cast in the chain -- line 98 ---------------------------------------- -- 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 1,932,560 ( 0.02%) fn expr_cast_chain_tys<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'tcx>) -> Option> { 241,121 ( 0.00%) if let ExprKind::Cast(cast_expr, _cast_to_hir_ty) = expr.peel_blocks().kind { 1,347 ( 0.00%) let cast_to = cx.typeck_results().expr_ty(expr); 18,024 ( 0.00%) => ???:::expr_ty (449x) . 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 5 ( 0.00%) if let Some(prev_info) = expr_cast_chain_tys(cx, cast_expr) { 24 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/casts/cast_slice_different_sizes.rs:clippy_lints::casts::cast_slice_different_sizes::expr_cast_chain_tys'2 (1x) . Some(CastChainInfo { . end_ty: to_slice_ty, . ..prev_info . }) . } else { 3 ( 0.00%) let cast_from = cx.typeck_results().expr_ty(cast_expr); 40 ( 0.00%) => ???:::expr_ty (1x) . 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 { 241,121 ( 0.00%) None . } 1,932,560 ( 0.02%) } 725,284 ( 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(); . 343,789 ( 0.00%) if start > end || end > slice.len() { . return false; . } . 180,920 ( 0.00%) 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 { 251,950 ( 0.00%) (start == 0 || bytes.as_ptr().add(start).read().is_utf8_char_boundary()) 169,656 ( 0.00%) && (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 { 486,091 ( 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 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> { 116,192 ( 0.00%) 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 { 4,313 ( 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> { 2,419 ( 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 ---------------------------------------- -- line 447 ---------------------------------------- . #[inline] . unsafe fn get_unchecked_mut(self, slice: *mut str) -> *mut Self::Output { . // SAFETY: the caller has to uphold the safety contract for `get_unchecked_mut`. . unsafe { (0..self.end).get_unchecked_mut(slice) } . } . #[inline] . fn index(self, slice: &str) -> &Self::Output { . let end = self.end; 138 ( 0.00%) match self.get(slice) { . Some(s) => s, . None => super::slice_error_fail(slice, 0, end), . } . } . #[inline] . fn index_mut(self, slice: &mut str) -> &mut Self::Output { . if slice.is_char_boundary(self.end) { . // SAFETY: just checked that `end` is on a char boundary, -- line 463 ---------------------------------------- -- line 485 ---------------------------------------- . /// Panics if `begin` does not point to the starting byte offset of . /// a character (as defined by `is_char_boundary`), or if `begin > len`. . #[stable(feature = "str_checked_slicing", since = "1.20.0")] . #[rustc_const_unstable(feature = "const_index", issue = "143775")] . const unsafe impl SliceIndex for ops::RangeFrom { . type Output = str; . #[inline] . fn get(self, slice: &str) -> Option<&Self::Output> { 310 ( 0.00%) if slice.is_char_boundary(self.start) { . // SAFETY: just checked that `start` 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 501 ---------------------------------------- -- line 630 ---------------------------------------- . unsafe { self.into_slice_range().get_unchecked(slice) } . } . #[inline] . unsafe fn get_unchecked_mut(self, slice: *mut str) -> *mut Self::Output { . // SAFETY: the caller must uphold the safety contract for `get_unchecked_mut`. . unsafe { self.into_slice_range().get_unchecked_mut(slice) } . } . #[inline] 3 ( 0.00%) fn index(self, slice: &str) -> &Self::Output { 6 ( 0.00%) let Self { mut start, mut end, exhausted } = self; . let len = slice.len(); 6 ( 0.00%) if end < len { 3 ( 0.00%) end = end + 1; 6 ( 0.00%) start = if exhausted { end } else { start }; 12 ( 0.00%) if start <= end && slice.is_char_boundary(start) && slice.is_char_boundary(end) { . // SAFETY: just checked that `start` and `end` are on a char boundary, . // 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. . unsafe { return &*(start..end).get_unchecked(slice) } . } . } . . super::slice_error_fail(slice, start, end) 9 ( 0.00%) } . #[inline] . fn index_mut(self, slice: &mut str) -> &mut Self::Output { . let Self { mut start, mut end, exhausted } = self; . let len = slice.len(); . if end < len { . end = end + 1; . start = if exhausted { end } else { start }; . if start <= end && slice.is_char_boundary(start) && slice.is_char_boundary(end) { -- line 661 ---------------------------------------- -- line 735 ---------------------------------------- . } . #[inline] . unsafe fn get_unchecked_mut(self, slice: *mut str) -> *mut Self::Output { . // SAFETY: the caller must uphold the safety contract for `get_unchecked_mut`. . unsafe { (0..=self.end).get_unchecked_mut(slice) } . } . #[inline] . fn index(self, slice: &str) -> &Self::Output { 6 ( 0.00%) (0..=self.end).index(slice) 75 ( 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: as core::slice::index::SliceIndex>::index (3x) . } . #[inline] . fn index_mut(self, slice: &mut str) -> &mut Self::Output { . (0..=self.end).index_mut(slice) . } . } . . /// Implements substring slicing with syntax `&self[..= last]` or `&mut -- line 751 ---------------------------------------- 204,147 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/unwrap.rs -------------------------------------------------------------------------------- Ir -- line 136 ---------------------------------------- . }, . /// `x` . Pure { local_id: HirId }, . } . . /// Identical to derived impl, but ignores `span` on [`Local::WithFieldAccess`] . impl PartialEq for Local { . fn eq(&self, other: &Self) -> bool { 2 ( 0.00%) match (self, other) { . ( . Self::WithFieldAccess { . local_id: self_local_id, . field_indices: self_field_indices, . .. . }, . Self::WithFieldAccess { . local_id: other_local_id, -- line 152 ---------------------------------------- -- 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(), . } . } . 105 ( 0.00%) fn is_potentially_local_place(&self, place: &Place<'_>) -> bool { 42 ( 0.00%) match self { . Self::WithFieldAccess { . local_id, . field_indices, . .. . } => { . let field_projections = place . .projections . .iter() 3 ( 0.00%) .filter(|proj| matches!(proj.kind, ProjectionKind::Field(_, _))) . .collect::>(); 4 ( 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` 4 ( 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, . } . }) . }, 15 ( 0.00%) Self::Pure { local_id } => is_potentially_local_place(*local_id, place), . } 105 ( 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) { 82 ( 0.00%) (sym::Option, sym::is_some) => Some((UnwrappableKind::Option, true)), 28 ( 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, . } . } . 71,456 ( 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>, . ) { 38,505 ( 0.00%) match expr.kind { 994 ( 0.00%) ExprKind::Binary(op, left, right) 13,092 ( 0.00%) if matches!( 8,424 ( 0.00%) (invert, op.node), . (false, BinOpKind::And | BinOpKind::BitAnd) | (true, BinOpKind::Or | BinOpKind::BitOr) . ) => . { 3,479 ( 0.00%) inner(cx, if_expr, left, branch, invert, false, out); 22,131 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unwrap.rs:clippy_lints::unwrap::collect_unwrap_info::inner'2 (455x) . inner(cx, if_expr, right, branch, invert, false, out); . }, 1,152 ( 0.00%) ExprKind::Unary(UnOp::Not, expr) => inner(cx, if_expr, expr, branch, !invert, false, out), 1,301 ( 0.00%) ExprKind::MethodCall(method_name, receiver, [], _) 3,915 ( 0.00%) if let Some(local) = extract_local(cx, receiver) 21,251 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unwrap.rs:clippy_lints::unwrap::extract_local (317x) 276 ( 0.00%) && let ty = cx.typeck_results().expr_ty(receiver) 10,200 ( 0.00%) => ???:::expr_ty (255x) . && let name = method_name.ident.name 374 ( 0.00%) && let Some((kind, unwrappable)) = option_or_result_call(cx, ty, name) => . { . let safe_to_unwrap = unwrappable != invert; . 491 ( 0.00%) out.push(UnwrapInfo { . local, . if_expr, . check: expr, . check_name: name, . branch, . safe_to_unwrap, . kind, . is_entire_condition, . }); . }, . _ => {}, . } 40,456 ( 0.00%) } . . let mut out = vec![]; 18,428 ( 0.00%) inner(cx, if_expr, expr, branch, invert, is_entire_condition, &mut out); 143,382 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unwrap.rs:clippy_lints::unwrap::collect_unwrap_info::inner (2,649x) 13,821 ( 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`]) 98,080 ( 0.00%) fn extract_local(cx: &LateContext<'_>, mut expr: &Expr<'_>) -> Option { 12,260 ( 0.00%) let span = expr.span; . let mut field_indices = vec![]; 69,430 ( 0.00%) while let ExprKind::Field(recv, _) = expr.kind 11,382 ( 0.00%) && let Some(field_idx) = cx.typeck_results().opt_field_index(expr.hir_id) 63,670 ( 0.00%) => ???:::opt_field_index (1,626x) . { . field_indices.push(field_idx); . expr = recv; . } . let local_id = expr.res_local_id()?; 9,827 ( 0.00%) if field_indices.is_empty() { 25,755 ( 0.00%) Some(Local::Pure { local_id }) . } else { 4,968 ( 0.00%) Some(Local::WithFieldAccess { . local_id, 4,968 ( 0.00%) field_indices, . span, . }) . } 99,322 ( 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) 108 ( 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) { 107 ( 0.00%) if let ty::BorrowKind::Mutable = bk 45 ( 0.00%) && self.local.is_potentially_local_place(&cat.place) 25 ( 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) { 78 ( 0.00%) if self.local.is_potentially_local_place(&cat.place) { 230 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unwrap.rs:::is_potentially_local_place (3x) 2 ( 0.00%) self.is_mutated = true; . } . } . . 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> { 41,463 ( 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(); 32,557 ( 0.00%) for unwrap_info in collect_unwrap_info(self.cx, if_expr, cond, branch, else_branch, true) { 112 ( 0.00%) let mut delegate = MutationVisitor { . is_mutated: false, . local: &unwrap_info.local, 56 ( 0.00%) tcx: self.cx.tcx, . }; . . let vis = ExprUseVisitor::for_clippy(self.cx, cond.hir_id.owner.def_id, &mut delegate); 84 ( 0.00%) vis.walk_expr(cond).into_ok(); 49,469 ( 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 (19x) 84 ( 0.00%) vis.walk_expr(branch).into_ok(); 3,082,086 ( 0.03%) => /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 (19x) . 56 ( 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; . } 300 ( 0.00%) self.unwrappables.push(unwrap_info); . } 13,821 ( 0.00%) walk_expr(self, branch); 7,486,016 ( 0.06%) => /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 (2,639x) 1,226 ( 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:: (10x) . self.unwrappables.truncate(prev_len); 36,856 ( 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) { 29,792 ( 0.00%) if let ExprKind::MethodCall(path, recv, [], _) = expr.kind { 1,200 ( 0.00%) match path.ident.name { 4,796 ( 0.00%) sym::as_ref => (recv, Some(AsRefKind::AsRef)), 1 ( 0.00%) sym::as_mut => (recv, Some(AsRefKind::AsMut)), . _ => (expr, None), . } . } else { . (expr, None) . } . } . . impl<'tcx> Visitor<'tcx> for UnwrappableVariablesVisitor<'_, 'tcx> { . type NestedFilter = nested_filter::OnlyBodies; . 1,808,595 ( 0.02%) fn visit_expr(&mut self, expr: &'tcx Expr<'_>) { . // Skip checking inside closures since they are visited through `Unwrap::check_fn()` already. 1,358,483 ( 0.01%) if matches!(expr.kind, ExprKind::Closure(_)) { . return; . } . if let Some(higher::If { cond, then, r#else }) = higher::If::hir(expr) { 12,642 ( 0.00%) walk_expr(self, cond); 890 ( 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:: (5x) 25,284 ( 0.00%) self.visit_branch(expr, cond, then, false); 1,091 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unwrap.rs:::visit_branch (5x) 8,428 ( 0.00%) if let Some(else_inner) = r#else { 5,109 ( 0.00%) self.visit_branch(expr, cond, else_inner, true); 1,035 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unwrap.rs:::visit_branch (5x) . } . } else { . // find `unwrap[_err]()` or `expect("...")` calls: 11,917 ( 0.00%) if let ExprKind::MethodCall(method_name, self_arg, ..) = expr.kind 11,917 ( 0.00%) && let (self_arg, as_ref_kind) = consume_option_as_ref(self_arg) 121,623 ( 0.00%) && let Some(local) = extract_local(self.cx, self_arg) 2,777 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unwrap.rs:clippy_lints::unwrap::extract_local (47x) 66,841 ( 0.00%) && matches!(method_name.ident.name, sym::unwrap | sym::expect | sym::unwrap_err) 108 ( 0.00%) && 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 4 ( 0.00%) && let span_ctxt = expr.span.ctxt() 3 ( 0.00%) && unwrappable.branch.span.ctxt() == span_ctxt . && unwrappable.check.span.ctxt() == span_ctxt . && !expr.span.in_external_macro(self.cx.tcx.sess.source_map()) . { . if call_to_unwrap == unwrappable.safe_to_unwrap { . let unwrappable_variable_str = unwrappable.local.snippet(self.cx); . . span_lint_hir_and_then( . self.cx, -- line 459 ---------------------------------------- -- 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"); . }, . ); . } . } 589,422 ( 0.00%) walk_expr(self, expr); 24,263,339 ( 0.20%) => /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:: (3,677x) . } 1,604,496 ( 0.01%) } . . fn maybe_tcx(&mut self) -> Self::MaybeTyCtxt { 3,713 ( 0.00%) self.cx.tcx . } . } . . impl<'tcx> LateLintPass<'tcx> for Unwrap { 40,012 ( 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; . } . 18,315 ( 0.00%) let mut v = UnwrappableVariablesVisitor { . unwrappables: Vec::new(), . cx, 3,663 ( 0.00%) msrv: self.msrv, . }; . 14,652 ( 0.00%) walk_fn(&mut v, kind, decl, body.id(), fn_id); 26,020,215 ( 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_fn:: (3,663x) 28,580 ( 0.00%) } . } 58,094 ( 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 1,454,562 ( 0.01%) pub fn hir(expr: &Expr<'tcx>) -> Option { 485,148 ( 0.00%) if let ExprKind::DropTemps(e) = expr.kind 2,058 ( 0.00%) && let ExprKind::Match(iterexpr, [arm], MatchSource::ForLoopDesugar) = e.kind 1,176 ( 0.00%) && let ExprKind::Call(_, [arg]) = iterexpr.kind 2,352 ( 0.00%) && let ExprKind::Loop(block, label, ..) = arm.body.kind 882 ( 0.00%) && let [stmt] = block.stmts 882 ( 0.00%) && let hir::StmtKind::Expr(e) = stmt.kind 1,470 ( 0.00%) && let ExprKind::Match(_, [_, some_arm], _) = e.kind 1,764 ( 0.00%) && let hir::PatKind::Struct(_, [field], _) = some_arm.pat.kind . { 3,234 ( 0.00%) return Some(Self { 294 ( 0.00%) pat: field.pat, . arg, 294 ( 0.00%) body: some_arm.body, 588 ( 0.00%) loop_id: arm.body.hir_id, 588 ( 0.00%) span: expr.span.ctxt().outer_expn_data().call_site, . label, . }); . } 242,133 ( 0.00%) None 1,454,562 ( 0.01%) } . } . . /// 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 { 2,897,953 ( 0.02%) if let ExprKind::If(cond, then, r#else) = expr.kind 261,739 ( 0.00%) && !has_let_expr(cond) 221,552 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/higher.rs:clippy_utils::higher::has_let_expr (6,965x) . { . 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 758,372 ( 0.01%) pub fn hir(cx: &LateContext<'_>, expr: &Expr<'hir>) -> Option { 1,574,664 ( 0.01%) if let ExprKind::If( . &Expr { . kind: . ExprKind::Let(&hir::LetExpr { 20,668 ( 0.00%) pat: let_pat, . init: let_expr, 10,334 ( 0.00%) span: let_span, . .. . }), . .. . }, 10,334 ( 0.00%) if_then, 10,334 ( 0.00%) if_else, 28,960 ( 0.00%) ) = expr.kind . { 20,668 ( 0.00%) let mut iter = cx.tcx.hir_parent_iter(expr.hir_id); 47,104 ( 0.00%) if let Some((_, Node::Block(Block { stmts: [], .. }))) = iter.next() 27,824 ( 0.00%) && let Some(( . _, . Node::Expr(Expr { . kind: ExprKind::Loop(_, _, LoopSource::While, _), . .. . }), 6,088 ( 0.00%) )) = iter.next() . { . // while loop desugar 3,472 ( 0.00%) return None; . } 34,392 ( 0.00%) return Some(Self { . let_pat, . let_expr, . if_then, . if_else, . let_span, . }); . } 748,038 ( 0.01%) None 758,372 ( 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 74,841 ( 0.00%) pub fn parse(cx: &LateContext<'_>, expr: &Expr<'hir>) -> Option { 49,894 ( 0.00%) match expr.kind { 3,992 ( 0.00%) ExprKind::Match(expr, arms, source) => Some(Self::Match(expr, arms, source)), 24,448 ( 0.00%) _ => IfLet::hir(cx, expr).map( 306,953 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (24,448x) . |IfLet { . let_expr, . let_pat, . if_then, . if_else, . let_span, . }| { Self::IfLet(let_expr, let_pat, if_then, if_else, let_span) }, . ), . } 99,788 ( 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 { 24,209 ( 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`. 4,874,200 ( 0.04%) pub fn hir(cx: &LateContext<'_>, expr: &'a Expr<'_>) -> Option> { 974,840 ( 0.01%) let span = expr.range_span()?; 11,439,351 ( 0.10%) => ???:::range_span (487,420x) 3,970 ( 0.00%) let (ty, start, end) = match expr.kind { 120 ( 0.00%) ExprKind::Call(path, [arg1, arg2]) 280 ( 0.00%) if let ExprKind::Path(qpath) = path.kind 240 ( 0.00%) && cx.tcx.qpath_is_lang_item(qpath, hir::LangItem::RangeInclusiveNew) => 5,160 ( 0.00%) => ???:::qpath_is_lang_item (40x) . { . (RangeTy::OpsInclusive, Some(arg1), Some(arg2)) . }, 5,500 ( 0.00%) ExprKind::Struct(&qpath, fields, StructTailExpr::None) => match (cx.tcx.qpath_lang_item(qpath)?, fields) { 67,100 ( 0.00%) => ???:::qpath_lang_item (550x) 240 ( 0.00%) (hir::LangItem::RangeFull, []) => (RangeTy::OpsFull, None, None), 213 ( 0.00%) (hir::LangItem::RangeFrom, [start]) if start.ident.name == sym::start => { 71 ( 0.00%) (RangeTy::OpsFrom, Some(start.expr), None) . }, . (hir::LangItem::RangeFromCopy, [start]) if start.ident.name == sym::start => { . (RangeTy::RangeFrom, Some(start.expr), None) 120 ( 0.00%) }, 843 ( 0.00%) (hir::LangItem::Range, [start, end] | [end, start]) 562 ( 0.00%) if start.ident.name == sym::start && end.ident.name == sym::end => . { 562 ( 0.00%) (RangeTy::OpsRange, Some(start.expr), Some(end.expr)) 281 ( 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)) 78 ( 0.00%) }, 468 ( 0.00%) (hir::LangItem::RangeTo, [end]) if end.ident.name == sym::end => (RangeTy::OpsTo, None, Some(end.expr)), . _ => return None, . }, . _ => return None, . }; . 2,360 ( 0.00%) Some(Range { ty, start, end, span }) 3,899,950 ( 0.03%) } . } . . /// 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!`. 5,112,212 ( 0.04%) pub fn hir(cx: &LateContext<'_>, expr: &'a Expr<'_>) -> Option> { 1,547,281 ( 0.01%) if let ExprKind::Call(fun, args) = expr.kind 173,536 ( 0.00%) && let ExprKind::Path(ref qpath) = fun.kind 519,858 ( 0.00%) && is_expn_of(fun.span, sym::vec).is_some() 12,793,276 ( 0.11%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_expn_of (86,643x) 1,190 ( 0.00%) && let Some(fun_def_id) = cx.qpath_res(qpath, fun.hir_id).opt_def_id() 14,054 ( 0.00%) => ???:::qpath_res (238x) 2,252 ( 0.00%) && let Some(name) = cx.tcx.get_diagnostic_name(fun_def_id) 20,328 ( 0.00%) => ???:::get_diagnostic_name (238x) . { . return match (name, args) { 30 ( 0.00%) (sym::vec_from_elem, [elem, size]) => { . // `vec![elem; size]` case 30 ( 0.00%) Some(VecArgs::Repeat(elem, size)) 10 ( 0.00%) }, 90 ( 0.00%) (sym::box_assume_init_into_vec_unsafe, [write_box_via_move]) 225 ( 0.00%) if let ExprKind::Call(_, [_box, elems]) = write_box_via_move.kind 135 ( 0.00%) && let ExprKind::Array(elems) = elems.kind => . { . // `vec![a, b, c]` case 90 ( 0.00%) Some(VecArgs::Vec(elems)) 45 ( 0.00%) }, 774 ( 0.00%) (sym::vec_new, []) => Some(VecArgs::Vec(&[])), 86,405 ( 0.00%) _ => None, . }; . } . 86,405 ( 0.00%) None 5,112,212 ( 0.04%) } . } . . /// 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 { 3,197 ( 0.00%) if let ExprKind::Loop( . Block { . expr: . Some(Expr { . kind: ExprKind::If(condition, body, _), . .. . }), . .. . }, . label, . LoopSource::While, 451 ( 0.00%) span, 1,383 ( 0.00%) ) = expr.kind 1,804 ( 0.00%) && !has_let_expr(condition) 7,798 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/higher.rs:clippy_utils::higher::has_let_expr (451x) . { . 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 { 1,180,912 ( 0.01%) if let ExprKind::Loop( . &Block { . expr: . Some(&Expr { . kind: . ExprKind::If( . &Expr { . kind: . ExprKind::Let(&hir::LetExpr { 2,170 ( 0.00%) pat: let_pat, 868 ( 0.00%) init: let_expr, . span: let_span, . .. . }), . .. . }, 434 ( 0.00%) if_then, . _, . ), . .. . }), . .. . }, 868 ( 0.00%) label, . LoopSource::While, . _, 10,961 ( 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. 62,916 ( 0.00%) pub fn get_vec_init_kind<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) -> Option { 23,356 ( 0.00%) if let ExprKind::Call(func, args) = expr.kind { 26,897 ( 0.00%) match func.kind { 45 ( 0.00%) ExprKind::Path(QPath::TypeRelative(ty, name)) 21,794 ( 0.00%) if cx.typeck_results().node_type(ty.hir_id).is_diag_item(cx, sym::Vec) => 142,991 ( 0.00%) => ???:::node_type (3,487x) . { 254 ( 0.00%) if name.ident.name == sym::new { 74 ( 0.00%) 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()?; 56 ( 0.00%) return match ConstEvalCtxt::new(cx).eval_local(arg, expr.span.ctxt()) { 1,544 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval_local (8x) 448 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::new (8x) . Some(Constant::Int(num)) => Some(VecInitKind::WithConstCapacity(num)), 24 ( 0.00%) _ => Some(VecInitKind::WithExprCapacity(arg.hir_id)), . }; . } . }, . ExprKind::Path(QPath::Resolved(_, path)) 24,536 ( 0.00%) if cx.tcx.is_diagnostic_item(sym::default_fn, path.res.opt_def_id()?) 133,720 ( 0.00%) => ???:::is_diagnostic_item (1,887x) 2 ( 0.00%) && cx.typeck_results().expr_ty(expr).is_diag_item(cx, sym::Vec) => 80 ( 0.00%) => ???:::expr_ty (2x) . { . return Some(VecInitKind::Default); . }, . _ => (), . } . } . None 80,892 ( 0.00%) } . . /// Checks that a condition doesn't have a `let` expression, to keep `If` and `While` from accepting . /// `if let` and `while let`. 439,260 ( 0.00%) pub const fn has_let_expr<'tcx>(cond: &'tcx Expr<'tcx>) -> bool { 648,428 ( 0.01%) match &cond.kind { . ExprKind::Let(_) => true, 151,645 ( 0.00%) ExprKind::Binary(_, lhs, rhs) => has_let_expr(lhs) || has_let_expr(rhs), 543,385 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/higher.rs:clippy_utils::higher::has_let_expr'2 (27,508x) . _ => false, . } 439,260 ( 0.00%) } 2,005,324 ( 0.02%) -------------------------------------------------------------------------------- -- 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<'_>) { 20,555 ( 0.00%) self.format_trait_impl = is_format_trait_impl(cx, impl_item); 139,393 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/format_impl.rs:clippy_lints::format_impl::is_format_trait_impl (4,111x) . } . . fn check_impl_item_post(&mut self, cx: &LateContext<'_>, impl_item: &ImplItem<'_>) { . // Assume no nested Impl of Debug and Display within each other 16,444 ( 0.00%) if is_format_trait_impl(cx, impl_item).is_some() { 139,393 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/format_impl.rs:clippy_lints::format_impl::is_format_trait_impl (4,111x) 323 ( 0.00%) self.format_trait_impl = None; . } . } . 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 736,921 ( 0.01%) if let Some(format_trait_impl) = self.format_trait_impl { 61,422 ( 0.00%) let linter = FormatImplExpr { . cx, 10,237 ( 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(); . } 1,937,824 ( 0.02%) } . } . . 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) { 19,933 ( 0.00%) if self.format_trait_impl.name == sym::Display 67 ( 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() ? 67 ( 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 175 ---------------------------------------- . self.expr.span, . "using `self.to_string` in `fmt::Display` implementation will cause infinite recursion", . ); . } . } . . fn check_self_in_format_args(&self) { . // Check each arg in format calls - do we ever use Display on self (directly or via deref)? 1,380 ( 0.00%) if let Some(outer_macro) = root_macro_call_first_node(self.cx, self.expr) . && let macro_def_id = outer_macro.def_id 920 ( 0.00%) && is_format_macro(self.cx, macro_def_id) 26,501 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::is_format_macro (230x) 1,816 ( 0.00%) && let Some(format_args) = self.format_args.get(self.cx, self.expr, outer_macro.expn) 326,425 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:::get (227x) . { . for piece in &format_args.template { 1,221 ( 0.00%) if let FormatArgsPiece::Placeholder(placeholder) = piece 356 ( 0.00%) && let trait_name = match placeholder.format_trait { . FormatTrait::Display => sym::Display, . FormatTrait::Debug => sym::Debug, . FormatTrait::LowerExp => sym::LowerExp, . FormatTrait::UpperExp => sym::UpperExp, . FormatTrait::Octal => sym::Octal, . FormatTrait::Pointer => sym::Pointer, . FormatTrait::Binary => sym::Binary, . FormatTrait::LowerHex => sym::LowerHex, . FormatTrait::UpperHex => sym::UpperHex, . } 442 ( 0.00%) && trait_name == self.format_trait_impl.name 132 ( 0.00%) && let Ok(index) = placeholder.argument.index . && let Some(arg) = format_args.arguments.all_args().get(index) 528 ( 0.00%) && let Some(arg_expr) = find_format_arg_expr(self.expr, arg) 121,875 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::find_format_arg_expr (132x) . { . self.check_format_arg_self(arg_expr); . } . } . } . } . . fn check_format_arg_self(&self, arg: &Expr<'_>) { . // Handle multiple dereferencing of references e.g. &&self . // Handle dereference of &self -> self that is equivalent (i.e. via *self in fmt() impl) . // Since the argument to fmt is itself a reference: &self 396 ( 0.00%) let reference = peel_ref_operators(self.cx, arg); 2,560 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::peel_ref_operators (132x) . // Is the reference self? 146 ( 0.00%) if reference.res_local_id().map(|x| self.cx.tcx.hir_name(x)) == Some(kw::SelfLower) { 6,435 ( 0.00%) => ???:::hir_name (73x) . let FormatTraitNames { name, .. } = self.format_trait_impl; . span_lint( . self.cx, . RECURSIVE_FORMAT_IMPL, . self.expr.span, . format!("using `self` as `{name}` in `impl {name}` will cause infinite recursion"), . ); . } . } . . fn check_print_in_format_impl(&self) { 1,150 ( 0.00%) if let Some(macro_call) = root_macro_call_first_node(self.cx, self.expr) 920 ( 0.00%) && let Some(name) = self.cx.tcx.get_diagnostic_name(macro_call.def_id) 20,010 ( 0.00%) => ???:::get_diagnostic_name (230x) . { . let replacement = match name { 1,610 ( 0.00%) sym::print_macro | sym::eprint_macro => "write", . sym::println_macro | sym::eprintln_macro => "writeln", . _ => return, . }; . . let name = name.as_str().strip_suffix("_macro").unwrap(); . . span_lint_and_sugg( . self.cx, -- line 242 ---------------------------------------- -- line 250 ---------------------------------------- . format!("{replacement}!(..)") . }, . Applicability::HasPlaceholders, . ); . } . } . } . 8,222 ( 0.00%) fn is_format_trait_impl(cx: &LateContext<'_>, impl_item: &ImplItem<'_>) -> Option { 8,222 ( 0.00%) if impl_item.ident.name == sym::fmt 2,584 ( 0.00%) && let ImplItemKind::Fn(_, body_id) = impl_item.kind 1,292 ( 0.00%) && let Some(Impl { . of_trait: Some(of_trait), . .. 3,230 ( 0.00%) }) = get_parent_as_impl(cx.tcx, impl_item.hir_id()) 104,168 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_as_impl (646x) 1,938 ( 0.00%) && let Some(did) = of_trait.trait_ref.trait_def_id() 8,398 ( 0.00%) => ???:::trait_def_id (646x) 3,230 ( 0.00%) && let Some(name) = cx.tcx.get_diagnostic_name(did) 56,202 ( 0.00%) => ???:::get_diagnostic_name (646x) . && matches!(name, sym::Debug | sym::Display) . { 2,584 ( 0.00%) let body = cx.tcx.hir_body(body_id); 43,538 ( 0.00%) => ???:::hir_body (646x) 646 ( 0.00%) let formatter_name = body . .params . .get(1) 646 ( 0.00%) .and_then(|param| param.pat.simple_ident()) . .map(|ident| ident.name); . . Some(FormatTraitNames { name, formatter_name }) . } else { . None . } 8,222 ( 0.00%) } 31,092 ( 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/edition.rs -------------------------------------------------------------------------------- Ir . use std::fmt; . use std::str::FromStr; . . use rustc_macros::{BlobDecodable, Encodable, StableHash}; . . /// The edition of the compiler. (See [RFC 2052](https://github.com/rust-lang/rfcs/blob/master/text/2052-epochs.md).) 612,740 ( 0.01%) #[derive(Clone, Copy, Hash, PartialEq, PartialOrd, Debug, Encodable, BlobDecodable, Eq)] . #[derive(StableHash)] . pub enum Edition { . // When adding new editions, be sure to do the following: . // . // - update the `ALL_EDITIONS` const . // - update the `EDITION_NAME_LIST` const . // - add a `rust_####()` function to the session . // - update the enum in Cargo's sources as well -- line 15 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/drop_forget_ref.rs -------------------------------------------------------------------------------- Ir -- line 73 ---------------------------------------- . declare_lint_pass!(DropForgetRef => [DROP_NON_DROP, FORGET_NON_DROP, MEM_FORGET]); . . const DROP_NON_DROP_SUMMARY: &str = "call to `std::mem::drop` with a value that does not implement `Drop`. \ . Dropping such a type only extends its contained lifetimes"; . const FORGET_NON_DROP_SUMMARY: &str = "call to `std::mem::forget` with a value that does not implement `Drop`. \ . Forgetting such a type is the same as dropping it"; . . impl<'tcx> LateLintPass<'tcx> for DropForgetRef { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 551,190 ( 0.00%) if let ExprKind::Call(path, [arg]) = expr.kind 33,893 ( 0.00%) && let ExprKind::Path(ref qpath) = path.kind 45,188 ( 0.00%) && let Some(def_id) = cx.qpath_res(qpath, path.hir_id).opt_def_id() 486,129 ( 0.00%) => ???:::qpath_res (11,297x) 55,975 ( 0.00%) && let Some(fn_name) = cx.tcx.get_diagnostic_name(def_id) 836,436 ( 0.01%) => ???:::get_diagnostic_name (11,195x) . { 1,323 ( 0.00%) let arg_ty = cx.typeck_results().expr_ty(arg); 17,640 ( 0.00%) => ???:::expr_ty (441x) 2,205 ( 0.00%) let is_copy = is_copy(cx, arg_ty); 460,287 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::is_copy (441x) 789 ( 0.00%) let drop_is_single_call_in_arm = is_single_call_in_arm(cx, arg, expr); . let (lint, msg, note_span) = match fn_name { . // early return for uplifted lints: dropping_references, dropping_copy_types, forgetting_references, . // forgetting_copy_types 1,764 ( 0.00%) sym::mem_drop if arg_ty.is_ref() && !drop_is_single_call_in_arm => return, . sym::mem_forget if arg_ty.is_ref() => return, . sym::mem_drop if is_copy && !drop_is_single_call_in_arm => return, . sym::mem_forget if is_copy => return, . sym::mem_drop if arg_ty.is_lang_item(cx, LangItem::ManuallyDrop) => return, . sym::mem_drop . if !(arg_ty.needs_drop(cx.tcx, cx.typing_env()) . || is_must_use_func_call(cx, arg) . || opt_must_use_path(cx, arg_ty).is_some() -- line 101 ---------------------------------------- -- line 127 ---------------------------------------- . let note = format!("argument has type `{arg_ty}`"); . if let Some(span) = note_span { . diag.span_note(span, note); . } else { . diag.note(note); . } . }); . } 1,937,824 ( 0.02%) } . } . . // dropping returned value of a function like in the following snippet is considered idiomatic, see . // #9482 for examples match { . // => drop(fn_with_side_effect_and_returning_some_value()), . // .. . // } . fn is_single_call_in_arm<'tcx>(cx: &LateContext<'tcx>, arg: &'tcx Expr<'_>, drop_expr: &'tcx Expr<'_>) -> bool { 1,323 ( 0.00%) if matches!(arg.kind, ExprKind::Call(..) | ExprKind::MethodCall(..)) 435 ( 0.00%) && let Node::Arm(Arm { body, .. }) = cx.tcx.parent_hir_node(drop_expr.hir_id) 9,816 ( 0.00%) => ???:::parent_hir_node (87x) . { . return body.hir_id == drop_expr.hir_id; . } . false . } 33,978 ( 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>) { 60,262 ( 0.00%) let from_expn = s.span.from_expansion(); . if from_expn { 7,922 ( 0.00%) self.expn_depth += 1; . } . walk_stmt(self, s); . if from_expn { 8,343 ( 0.00%) self.expn_depth -= 1; . } . } . 1,823,896 ( 0.02%) fn visit_expr(&mut self, e: &'tcx Expr<'tcx>) { 227,987 ( 0.00%) let ctxt = e.span.ctxt(); . 455,974 ( 0.00%) if let ExprKind::Block(block, _) = e.kind 36,440 ( 0.00%) && let BlockCheckMode::UnsafeBlock(UnsafeSource::UserProvided) = block.rules . && !ctxt.is_root() 21 ( 0.00%) && 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(); 766,774 ( 0.01%) } else if ctxt.is_root() && self.expn_depth > 0 { . let unsafe_block = self.macro_unsafe_blocks.last().copied(); . 6,030 ( 0.00%) match (self.lint.metavar_expns.entry(e.span), unsafe_block) { 13,940 ( 0.00%) (Entry::Vacant(e), None) => { 2,788 ( 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) => { 681 ( 0.00%) if let MetavarState::ReferencedInUnsafe { .. } = *e.get() { . e.insert(MetavarState::ReferencedInSafe); . } . }, . (Entry::Occupied(mut e), Some(unsafe_block)) => { . if let MetavarState::ReferencedInUnsafe { unsafe_blocks } = e.get_mut() . && !unsafe_blocks.contains(&unsafe_block) . { . unsafe_blocks.push(unsafe_block); . } . }, . } . . // NB: No need to visit descendant nodes. They're guaranteed to represent the same . // metavariable . } else { 674,916 ( 0.01%) walk_expr(self, e); 29,579,356 ( 0.25%) => /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:: (6,204x) . } 1,823,896 ( 0.02%) } . } . . impl<'tcx> LateLintPass<'tcx> for ExprMetavarsInUnsafe { 55,836 ( 0.00%) fn check_body(&mut self, cx: &LateContext<'tcx>, body: &rustc_hir::Body<'tcx>) { 49,632 ( 0.00%) if is_lint_allowed(cx, MACRO_METAVARS_IN_UNSAFE, body.value.hir_id) { 8,286,982 ( 0.07%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_lint_allowed (6,204x) . 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 . 37,224 ( 0.00%) let mut vis = BodyVisitor { . macro_unsafe_blocks: Vec::new(), . #[expect(clippy::bool_to_int_with_if)] // obfuscates the meaning 12,408 ( 0.00%) expn_depth: if body.value.span.from_expansion() { 1 } else { 0 }, . cx, . lint: self . }; . vis.visit_body(body); 43,428 ( 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() 2,788 ( 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 { 112,310 ( 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%) } . } 959,105 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/derive/derive_ord_xor_partial_ord.rs -------------------------------------------------------------------------------- Ir -- line 3 ---------------------------------------- . use rustc_hir::{self as hir, HirId}; . use rustc_lint::LateContext; . use rustc_middle::ty::Ty; . use rustc_span::sym; . . use super::DERIVE_ORD_XOR_PARTIAL_ORD; . . /// Implementation of the `DERIVE_ORD_XOR_PARTIAL_ORD` lint. 28,170 ( 0.00%) pub(super) fn check<'tcx>( . cx: &LateContext<'tcx>, . item: &hir::Item<'_>, . trait_ref: &hir::TraitRef<'_>, . ty: Ty<'tcx>, . adt_hir_id: HirId, . ord_is_automatically_derived: bool, . ) { 11,268 ( 0.00%) if let Some(ord_trait_def_id) = cx.tcx.get_diagnostic_item(sym::Ord) 199,068 ( 0.00%) => ???:::get_diagnostic_item (1,878x) 7,512 ( 0.00%) && let Some(partial_ord_trait_def_id) = cx.tcx.lang_items().partial_ord_trait() 75,120 ( 0.00%) => ???:::lang_items (1,878x) 7,512 ( 0.00%) && let Some(def_id) = &trait_ref.trait_def_id() 24,414 ( 0.00%) => ???:::trait_def_id (1,878x) 30 ( 0.00%) && *def_id == ord_trait_def_id 120 ( 0.00%) && let item_hir_id = cx.tcx.local_def_id_to_hir_id(item.owner_id) 30 ( 0.00%) && !fulfill_or_allowed(cx, DERIVE_ORD_XOR_PARTIAL_ORD, [adt_hir_id]) . { . // Look for the PartialOrd implementations for `ty` 1,170 ( 0.00%) cx.tcx.for_each_relevant_impl(partial_ord_trait_def_id, ty, |impl_id| { 367,947 ( 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/trait_def.rs:::for_each_relevant_impl::<(), clippy_lints::derive::derive_ord_xor_partial_ord::check::{closure#0}> (30x) 240 ( 0.00%) let partial_ord_is_automatically_derived = cx.tcx.is_automatically_derived(impl_id); 15,777 ( 0.00%) => ???:::is_automatically_derived (60x) . 180 ( 0.00%) if partial_ord_is_automatically_derived == ord_is_automatically_derived { . return; . } . 135 ( 0.00%) let trait_ref = cx.tcx.impl_trait_ref(impl_id); 5,227 ( 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) . . // Only care about `impl PartialOrd for Foo` . // For `impl PartialOrd for A, input_types is [A, B] 108 ( 0.00%) if trait_ref.instantiate_identity().skip_norm_wip().args.type_at(1) == ty { . let mess = if partial_ord_is_automatically_derived { . "you are implementing `Ord` explicitly but have derived `PartialOrd`" . } else { . "you are deriving `Ord` but have implemented `PartialOrd` explicitly" . }; . . span_lint_hir_and_then(cx, DERIVE_ORD_XOR_PARTIAL_ORD, item_hir_id, item.span, mess, |diag| { . if let Some(local_def_id) = impl_id.as_local() { . let hir_id = cx.tcx.local_def_id_to_hir_id(local_def_id); . diag.span_note(cx.tcx.hir_span(hir_id), "`PartialOrd` implemented here"); . } . }); . } 480 ( 0.00%) }); . } 15,024 ( 0.00%) } 7,596 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/inherent_to_string.rs -------------------------------------------------------------------------------- Ir -- line 91 ---------------------------------------- . declare_lint_pass!(InherentToString => [ . INHERENT_TO_STRING, . INHERENT_TO_STRING_SHADOW_DISPLAY, . ]); . . impl<'tcx> LateLintPass<'tcx> for InherentToString { . fn check_impl_item(&mut self, cx: &LateContext<'tcx>, impl_item: &'tcx ImplItem<'_>) { . // Check if item is a method called `to_string` and has a parameter 'self' 8,222 ( 0.00%) if let ImplItemKind::Fn(ref signature, _) = impl_item.kind . // #11201 7,828 ( 0.00%) && let header = signature.header . && header.is_safe() 27,384 ( 0.00%) && header.abi == ExternAbi::Rust 183,864 ( 0.00%) => ???:::eq (3,912x) . && impl_item.ident.name == sym::to_string 5 ( 0.00%) && let decl = signature.decl 15 ( 0.00%) && decl.implicit_self().has_implicit_self() 40 ( 0.00%) => ???:::implicit_self (5x) 10 ( 0.00%) && decl.inputs.len() == 1 3 ( 0.00%) && impl_item.generics.params.iter().all(|p| matches!(p.kind, GenericParamKind::Lifetime { .. })) 2 ( 0.00%) && !impl_item.span.from_expansion() . // Check if return type is String 7 ( 0.00%) && return_ty(cx, impl_item.owner_id).is_lang_item(cx, LangItem::String) 107 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::return_ty (1x) . // Filters instances of to_string which are required by a trait 4 ( 0.00%) && trait_ref_of_method(cx, impl_item.owner_id).is_none() 145 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::trait_ref_of_method (1x) . { 4 ( 0.00%) show_lint(cx, impl_item); 862,829 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/inherent_to_string.rs:clippy_lints::inherent_to_string::show_lint (1x) . } 4,111 ( 0.00%) } . } . 10 ( 0.00%) fn show_lint(cx: &LateContext<'_>, item: &ImplItem<'_>) { 1 ( 0.00%) let display_trait_id = cx . .tcx 3 ( 0.00%) .get_diagnostic_item(sym::Display) 106 ( 0.00%) => ???:::get_diagnostic_item (1x) . .expect("Failed to get trait ID of `Display`!"); . . // Get the real type of 'self' . let self_type = cx.tcx.fn_sig(item.owner_id).skip_binder().input(0); . let self_type = self_type.skip_binder().peel_refs(); . . // Emit either a warning or an error 8 ( 0.00%) if implements_trait(cx, self_type, display_trait_id, &[]) { 549,523 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::implements_trait (1x) . span_lint_and_help( . cx, . INHERENT_TO_STRING_SHADOW_DISPLAY, . item.span, . format!( . "type `{self_type}` implements inherent method `to_string(&self) -> String` which shadows the implementation of `Display`" . ), . None, . format!("remove the inherent method from type `{self_type}`"), . ); . } else { . span_lint_and_help( . cx, . INHERENT_TO_STRING, . item.span, 3 ( 0.00%) format!("implementation of inherent method `to_string(&self) -> String` for type `{self_type}`"), 1 ( 0.00%) None, 2 ( 0.00%) format!("implement trait `Display` for type `{self_type}` instead"), . ); . } 8 ( 0.00%) } 50,886 ( 0.00%) -------------------------------------------------------------------------------- -- 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 { 1,937,824 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &Expr<'tcx>) { 1,625,900 ( 0.01%) match expr.kind { . // `.get().()` 28,112 ( 0.00%) ExprKind::MethodCall(method, get_call, [], _) 95,580 ( 0.00%) if let Some((recv, nz_ty, nonzero_did, get_span)) = nonzero_get(cx, get_call) 124,544 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/needless_nonzero_get.rs:clippy_lints::needless_nonzero_get::nonzero_get (7,965x) . // 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) 26,944 ( 0.00%) if matches!(op.node, BinOpKind::Div | BinOpKind::Rem) 420 ( 0.00%) && let Some((recv, nz_ty, _, get_span)) = nonzero_get(cx, get_call) 640 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/needless_nonzero_get.rs:clippy_lints::needless_nonzero_get::nonzero_get (42x) . && 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) 600 ( 0.00%) if matches!(op.node, AssignOpKind::DivAssign | AssignOpKind::RemAssign) 10 ( 0.00%) && let Some((recv, nz_ty, _, get_span)) = nonzero_get(cx, get_call) 15 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/needless_nonzero_get.rs:clippy_lints::needless_nonzero_get::nonzero_get (1x) . && 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()); . }, . . _ => {}, . } 1,937,824 ( 0.02%) } . } . . /// Returns the receiver, its `NonZero` type and definition, and the `get` identifier span when . /// `expr` is an inherent `NonZero::get()` call. 40,040 ( 0.00%) fn nonzero_get<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'tcx>, . ) -> Option<(&'tcx Expr<'tcx>, Ty<'tcx>, DefId, Span)> { 19,265 ( 0.00%) let ExprKind::MethodCall(get, recv, [], get_span) = expr.kind else { . return None; . }; 915 ( 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)) 48,048 ( 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 ---------------------------------------- 24,024 ( 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 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 511,400 ( 0.00%) if let ExprKind::Binary(op, lhs, rhs) = expr.kind 19,846 ( 0.00%) && let (lt, gt) = match op.node { . BinOpKind::Lt => (lhs, rhs), . BinOpKind::Gt => (rhs, lhs), . _ => return, . } 277 ( 0.00%) && let ctxt = expr.span.ctxt() 1,106 ( 0.00%) && let (op_lhs, op_rhs, other, commutative) = match (<.kind, >.kind) { 8 ( 0.00%) (&ExprKind::Binary(op, lhs, rhs), _) if op.node == BinOpKind::Add && ctxt == lt.span.ctxt() => { . (lhs, rhs, gt, true) . }, 21 ( 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() 12 ( 0.00%) && let ty = typeck.expr_ty(op_lhs) 160 ( 0.00%) => ???:::expr_ty (4x) 8 ( 0.00%) && matches!(ty.kind(), ty::Uint(_)) 16 ( 0.00%) && ty == typeck.expr_ty(op_rhs) 160 ( 0.00%) => ???:::expr_ty (4x) 20 ( 0.00%) && ty == typeck.expr_ty(other) 160 ( 0.00%) => ???:::expr_ty (4x) 24 ( 0.00%) && !expr.span.in_external_macro(cx.tcx.sess.source_map()) 468 ( 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 (4x) 43 ( 0.00%) && (eq_expr_value(cx, ctxt, op_lhs, other) || (commutative && eq_expr_value(cx, ctxt, op_rhs, other))) 3,204 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:clippy_utils::hir_utils::eq_expr_value (5x) . { . span_lint( . cx, . PANICKING_OVERFLOW_CHECKS, . expr.span, . "you are trying to use classic C overflow conditions that will fail in Rust", . ); . } 1,937,824 ( 0.02%) } . } 1,715 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/enum_clike.rs -------------------------------------------------------------------------------- Ir -- line 29 ---------------------------------------- . correctness, . "C-like enums that are `repr(isize/usize)` and have values that don't fit into an `i32`" . } . . declare_lint_pass!(UnportableVariant => [ENUM_CLIKE_UNPORTABLE_VARIANT]); . . impl<'tcx> LateLintPass<'tcx> for UnportableVariant { . #[expect(clippy::cast_possible_wrap)] 47,504 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) { 29,690 ( 0.00%) if cx.tcx.data_layout.pointer_size().bits() != 64 { . return; . } . if let ItemKind::Enum(_, _, def) = &item.kind { 135 ( 0.00%) for var in def.variants { 4,074 ( 0.00%) if let Some(anon_const) = &var.disr_expr { 160 ( 0.00%) let def_id = cx.tcx.hir_body_owner_def_id(anon_const.body); 5,200 ( 0.00%) => ???:::hir_body_owner_def_id (40x) . let mut ty = cx . .tcx . .type_of(def_id.to_def_id()) . .instantiate_identity() . .skip_norm_wip(); 200 ( 0.00%) let constant = cx.tcx.const_eval_poly(def_id.to_def_id()).ok(); 394,184 ( 0.00%) => ???:::const_eval_poly (40x) 480 ( 0.00%) if let Some(Constant::Int(val)) = constant.and_then(|c| mir_to_const(cx.tcx, c, ty)) { 1,720 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:clippy_utils::consts::mir_to_const (40x) 120 ( 0.00%) if let ty::Adt(adt, _) = ty.kind() . && adt.is_enum() . { . ty = adt.repr().discr_type().to_ty(cx.tcx); . } 200 ( 0.00%) match ty.kind() { . ty::Int(IntTy::Isize) => { 40 ( 0.00%) let val = ((val as i128) << 64) >> 64; . if i32::try_from(val).is_ok() { . continue; . } . }, . ty::Uint(UintTy::Usize) if val > u128::from(u32::MAX) => {}, . _ => continue, . } . span_lint( -- line 67 ---------------------------------------- -- line 69 ---------------------------------------- . ENUM_CLIKE_UNPORTABLE_VARIANT, . var.span, . "C-like enum variant discriminant is not portable to 32-bit targets", . ); . } . } . } . } 47,504 ( 0.00%) } . } 40 ( 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 { 1,937,824 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 484,456 ( 0.00%) if expr.span.from_expansion() { . return; . } . 14,960 ( 0.00%) let Some((cond, keyword, desc)) = higher::If::hir(expr) . .map(|hif| (hif.cond, "if", "an `if` condition")) 4,300 ( 0.00%) .or(if let ExprKind::Match(match_ex, _, MatchSource::Normal) = expr.kind { . Some((match_ex, "match", "a `match` scrutinee")) . } else { . None . }) . else { . return; . }; 11,220 ( 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`", . ); . 7,480 ( 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, . ); . } . } . } 1,937,824 ( 0.02%) } . } 10,472 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/needless_late_init.rs -------------------------------------------------------------------------------- Ir -- line 68 ---------------------------------------- . . pub struct NeedlessLateInit<'tcx> { . check_grouped_late_init: bool, . grouped_late_inits: Vec<(HirId, HirIdMap>)>, . } . . impl<'tcx> NeedlessLateInit<'tcx> { . pub fn new(conf: &'static Conf) -> Self { 4 ( 0.00%) Self { . check_grouped_late_init: conf.check_grouped_late_init, . grouped_late_inits: Vec::default(), . } . } . 16 ( 0.00%) fn check_if_or_match( . &mut self, . cx: &LateContext<'tcx>, . local_stmt: &'tcx LetStmt<'tcx>, . block: &'tcx Block<'tcx>, . binding_id: HirId, . usage: Usage<'tcx>, . exprs: impl IntoIterator>, . ) { . let mut assigns: Vec> = Vec::new(); . for expr in exprs { 6 ( 0.00%) let ty = cx.typeck_results().expr_ty(expr); 80 ( 0.00%) => ???:::expr_ty (2x) 6 ( 0.00%) if ty.is_never() { . continue; . } 2 ( 0.00%) if !ty.is_unit() { . return; . } . 16 ( 0.00%) let Some(assign_group) = LocalAssignGroup::new(cx, expr) else { 1,074 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/needless_late_init.rs:::new (2x) . return; . }; . . if let Some(last_group) = assigns.last() . && !assign_group.is_parallel(last_group) . { . return; . } -- line 109 ---------------------------------------- -- line 178 ---------------------------------------- . "move the declaration `{binding_name}` here and remove the assignments from the {descriptor}", . ), . suggestions, . applicability, . ); . }, . ); . } 8 ( 0.00%) } . } . . fn contains_let(cond: &Expr<'_>) -> bool { . for_each_expr_without_closures(cond, |e| { . if matches!(e.kind, ExprKind::Let(_)) { . ControlFlow::Break(()) . } else { . ControlFlow::Continue(()) -- line 194 ---------------------------------------- -- line 214 ---------------------------------------- . struct LocalAssign<'tcx> { . lhs_id: HirId, . rhs: &'tcx Expr<'tcx>, . span: Span, . } . . impl<'tcx> LocalAssign<'tcx> { . fn new(expr: &'tcx Expr<'tcx>, span: Span) -> Option { 8 ( 0.00%) if expr.span.from_expansion() { . return None; . } . 10 ( 0.00%) if let ExprKind::Assign(lhs, rhs, _) = expr.kind 4 ( 0.00%) && !lhs.span.from_expansion() . { . return Some(Self { . lhs_id: lhs.res_local_id()?, . rhs, . span, . }); . } . -- line 235 ---------------------------------------- -- line 239 ---------------------------------------- . . #[derive(Debug)] . struct Usage<'tcx> { . span: Span, . expr: &'tcx Expr<'tcx>, . needs_semi: bool, . } . 64 ( 0.00%) fn first_usage<'tcx>( . cx: &LateContext<'tcx>, . binding_id: HirId, . local_stmt_id: HirId, . block: &'tcx Block<'tcx>, . ) -> Option> { 48 ( 0.00%) let significant_drop = needs_ordered_drop(cx, cx.typeck_results().node_type(binding_id)); 93,834 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::needs_ordered_drop (8x) 328 ( 0.00%) => ???:::node_type (8x) . 8 ( 0.00%) block . .stmts . .iter() . .skip_while(|stmt| stmt.hir_id != local_stmt_id) . .skip(1) . .take_while(|stmt| !significant_drop || !stmt_needs_ordered_drop(cx, stmt)) 30 ( 0.00%) .find(|&stmt| is_local_used(cx, stmt, binding_id)) 40 ( 0.00%) .and_then(|stmt| match stmt.kind { . StmtKind::Expr(expr) => Some(Usage { . span: stmt.span, . expr, . needs_semi: true, . }), . StmtKind::Semi(expr) => Some(Usage { . span: stmt.span, . expr, . needs_semi: false, . }), . _ => None, . }) . .or_else(|| { 2 ( 0.00%) block . .expr 4 ( 0.00%) .filter(|expr| is_local_used(cx, *expr, binding_id)) . .map(|expr| Usage { . span: expr.span, . expr, . needs_semi: true, . }) . }) 64 ( 0.00%) } . . fn local_snippet_without_semicolon<'a>( . cx: &LateContext<'_>, . local: &LetStmt<'_>, . applicability: &mut Applicability, . ) -> Cow<'a, str> { . let span = local.span.with_hi(match local.ty { . // let : ; -- line 293 ---------------------------------------- -- line 300 ---------------------------------------- . . snippet_with_applicability(cx, span, "..", applicability) . } . . #[derive(Debug)] . struct LocalAssignGroup<'tcx>(Vec>); . . impl<'tcx> LocalAssignGroup<'tcx> { 16 ( 0.00%) fn new(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) -> Option { 14 ( 0.00%) match expr.kind { . ExprKind::Block(Block { expr: Some(expr), .. }, _) 1 ( 0.00%) if let Some(assign) = LocalAssign::new(expr, expr.span) => . { . Some(LocalAssignGroup(vec![assign])) . }, . ExprKind::Block(Block { expr: None, stmts, .. }, _) => { . let mut assign_group = Vec::new(); . // Avoid cases when the assignee is used or reassigned in the subsequent assignments . let mut used_locals = HirIdSet::default(); 2 ( 0.00%) for stmt in stmts.iter().rev() { 6 ( 0.00%) if let StmtKind::Semi(expr) | StmtKind::Expr(expr) = stmt.kind 2 ( 0.00%) && let Some(assign) = LocalAssign::new(expr, stmt.span) . && !used_locals.contains(&assign.lhs_id) . { . used_locals.insert(assign.lhs_id); . for_each_expr(cx.tcx, assign.rhs, |e| { . if let Some(id) = e.res_local_id() { . used_locals.insert(id); . } . ControlFlow::<()>::Continue(()) . }); . assign_group.push(assign); . continue; . } . . break; . } 1 ( 0.00%) if assign_group.is_empty() { . None . } else { 4 ( 0.00%) Some(LocalAssignGroup(assign_group)) . } 3 ( 0.00%) }, 38 ( 0.00%) => ???:__rustc::__rdl_dealloc (1x) . ExprKind::Assign(..) if let Some(assign) = LocalAssign::new(expr, expr.span) => { . Some(LocalAssignGroup(vec![assign])) . }, 1 ( 0.00%) _ => None, . } 16 ( 0.00%) } . . /// Checks if the assignments in `self` and `other` are parallel, i.e. they have the same number . /// of assignments and the same assignees in the same order. . fn is_parallel(&self, other: &Self) -> bool { . self.0.len() == other.0.len() && self.0.iter().zip(other.0.iter()).all(|(a, b)| a.lhs_id == b.lhs_id) . } . } . -- line 356 ---------------------------------------- -- line 357 ---------------------------------------- . #[derive(Debug)] . struct GroupedLateInit<'tcx> { . usage: Usage<'tcx>, . assigns: Vec>, . decls: HirIdMap<&'tcx LetStmt<'tcx>>, . } . . impl<'tcx> LateLintPass<'tcx> for NeedlessLateInit<'tcx> { 160,488 ( 0.00%) fn check_local(&mut self, cx: &LateContext<'tcx>, local: &'tcx LetStmt<'tcx>) { 40,122 ( 0.00%) let mut parents = cx.tcx.hir_parent_iter(local.hir_id); 20,935 ( 0.00%) if let LetStmt { . init: None, . pat: . Pat { . kind: PatKind::Binding(BindingMode::NONE, binding_id, _, None), . .. . }, . source: LocalSource::Normal, . .. 20,490 ( 0.00%) } = local 16 ( 0.00%) && let Some((_, Node::Stmt(local_stmt))) = parents.next() 16 ( 0.00%) && let Some((_, Node::Block(block))) = parents.next() 131 ( 0.00%) && let Some(usage) = first_usage(cx, *binding_id, local_stmt.hir_id, block) 99,811 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/needless_late_init.rs:clippy_lints::needless_late_init::first_usage (8x) . { 14 ( 0.00%) if self.check_grouped_late_init . && let Some((hir_id, late_inits)) = self.grouped_late_inits.last_mut() . && *hir_id == block.hir_id . && let Some(late_init) = late_inits.get_mut(&usage.expr.hir_id) . { . late_init.decls.insert(*binding_id, local); . return; . } . 56 ( 0.00%) match usage.expr.kind { . ExprKind::Assign(..) . if let Some(assign) = LocalAssign::new(usage.expr, usage.expr.span) . && assign.lhs_id == *binding_id => . { . let mut applicability = Applicability::MachineApplicable; . let let_snippet = local_snippet_without_semicolon(cx, local, &mut applicability); . let binding_name = cx.tcx.hir_name(*binding_id); . let mut msg_span = MultiSpan::from_spans(vec![local_stmt.span, assign.span]); -- line 398 ---------------------------------------- -- line 431 ---------------------------------------- . return; . } . exprs.push(then); . else_expr = else_; . } . exprs.push(else_expr); . self.check_if_or_match(cx, local, block, *binding_id, usage, exprs); . }, 2 ( 0.00%) ExprKind::Match(_, arms, MatchSource::Normal) => { 13 ( 0.00%) self.check_if_or_match(cx, local, block, *binding_id, usage, arms.iter().map(|arm| arm.body)); 1,460 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/needless_late_init.rs:::check_if_or_match::, ::check_local::{closure#1}>> (1x) 1 ( 0.00%) }, . _ => {}, . } . } 160,488 ( 0.00%) } . 174,336 ( 0.00%) fn check_block_post(&mut self, cx: &LateContext<'tcx>, block: &'tcx Block<'tcx>) { 43,584 ( 0.00%) if self.check_grouped_late_init . && let Some((_, late_inits)) = self.grouped_late_inits.pop_if(|(hir_id, _)| *hir_id == block.hir_id) . { . 'outer: for (_, late_init) in late_inits { . if late_init.decls.len() < late_init.assigns[0].0.len() { . continue; . } . . let mut suggestions = vec![]; -- line 456 ---------------------------------------- -- line 513 ---------------------------------------- . format!("move the declarations here and remove the assignments from the {descriptor}"), . suggestions, . applicability, . ); . }, . ); . } . } 174,336 ( 0.00%) } . } 136 ( 0.00%) -------------------------------------------------------------------------------- -- 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>) { 927,532 ( 0.01%) if let ExprKind::MethodCall(_method, receiver, args, _) = expr.kind { . for arg in args { 23,478 ( 0.00%) check_closure(cx, Some(receiver), arg); 2,603,017 ( 0.02%) => site/frontend/rust-clippy/clippy_lints/src/eta_reduction.rs:clippy_lints::eta_reduction::check_closure (7,826x) . } . } 83,154 ( 0.00%) if let ExprKind::Call(func, args) = expr.kind { 83,154 ( 0.00%) check_closure(cx, None, func); 498,924 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/eta_reduction.rs:clippy_lints::eta_reduction::check_closure (27,718x) . for arg in args { 147,702 ( 0.00%) check_closure(cx, None, arg); 899,617 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/eta_reduction.rs:clippy_lints::eta_reduction::check_closure (49,234x) . } . } . } . } . . #[expect(clippy::too_many_lines)] 678,224 ( 0.01%) fn check_closure<'tcx>(cx: &LateContext<'tcx>, outer_receiver: Option<&Expr<'tcx>>, expr: &Expr<'tcx>) { 169,818 ( 0.00%) let body = if let ExprKind::Closure(c) = expr.kind 774 ( 0.00%) && c.fn_decl.inputs.iter().all(|ty| matches!(ty.kind, TyKind::Infer(()))) 522 ( 0.00%) && matches!(c.fn_decl.output, FnRetTy::DefaultReturn(_)) 522 ( 0.00%) && !expr.span.from_expansion() . { 1,506 ( 0.00%) cx.tcx.hir_body(c.body) 22,659 ( 0.00%) => ???:::hir_body (251x) . } else { . return; . }; . 753 ( 0.00%) if body.value.span.from_expansion() { 10 ( 0.00%) if body.params.is_empty() 32 ( 0.00%) && let Some(VecArgs::Vec(&[])) = VecArgs::hir(cx, body.value) 827 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (7x) . { 20 ( 0.00%) let vec_crate = if is_no_std_crate(cx) { "alloc" } else { "std" }; 202 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_no_std_crate (2x) . // replace `|| vec![]` with `Vec::new` . span_lint_hir_and_then( . cx, 4 ( 0.00%) REDUNDANT_CLOSURE, 4 ( 0.00%) expr.hir_id, 2 ( 0.00%) expr.span, . "redundant closure", . |diag| { . diag.span_suggestion( . expr.span, . "replace the closure with `Vec::new`", 6 ( 0.00%) format!("{vec_crate}::vec::Vec::new"), . Applicability::MachineApplicable, . ); . }, . ); . } . // skip `foo(|| macro!())` . return; . } . 1,215 ( 0.00%) if is_adjusted(cx, body.value) { 10,780 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_adjusted (243x) . return; . } . . let typeck = cx.typeck_results(); 726 ( 0.00%) let closure = if let ty::Closure(_, closure_subs) = typeck.expr_ty(expr).kind() { 9,692 ( 0.00%) => ???:::expr_ty (242x) 242 ( 0.00%) closure_subs.as_closure() . } else { . return; . }; 1,452 ( 0.00%) let closure_sig = cx.tcx.signature_unclosure(closure.sig(), Safety::Safe).skip_binder(); 49,512 ( 0.00%) => ???:::signature_unclosure (242x) 12,100 ( 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 (242x) 1,358 ( 0.00%) match body.value.kind { 232 ( 0.00%) ExprKind::Call(callee, args) 58 ( 0.00%) if matches!( 29 ( 0.00%) callee.kind, . ExprKind::Path(QPath::Resolved(..) | QPath::TypeRelative(..)) . ) => . { 87 ( 0.00%) let callee_ty_raw = typeck.expr_ty(callee); 1,160 ( 0.00%) => ???:::expr_ty (29x) . let callee_ty = callee_ty_raw.peel_refs(); . if matches!(callee_ty.opt_diag_name(cx), Some(sym::Arc | sym::Rc)) 261 ( 0.00%) || !check_inputs(typeck, body.params, None, args) 1,259 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/eta_reduction.rs:clippy_lints::eta_reduction::check_inputs (29x) . { . return; . } . 7 ( 0.00%) let callee_ty_adjustments = typeck.expr_adjustments(callee); 240 ( 0.00%) => ???:::expr_adjustments (7x) 7 ( 0.00%) let callee_ty_adjusted = callee_ty_adjustments.last().map_or(callee_ty, |a| a.target); . 28 ( 0.00%) let sig = match *callee_ty_adjusted.kind() { 14 ( 0.00%) ty::FnDef(def, _) => { . // Rewriting `x(|| f())` to `x(f)` where f is marked `#[track_caller]` moves the `Location` 161 ( 0.00%) if find_attr!(cx.tcx, def, TrackCaller(..)) { 804 ( 0.00%) => ???:>::get_attrs (7x) . return; . } . . cx.tcx.fn_sig(def).skip_binder().skip_binder() . }, . ty::FnPtr(sig_tys, hdr) => sig_tys.with(hdr).skip_binder(), . ty::Closure(_, subs) => cx . .tcx -- line 167 ---------------------------------------- -- line 174 ---------------------------------------- . && let ty::Tuple(tys) = *subs.type_at(1).kind() . { . cx.tcx.mk_fn_sig_safe_rust_abi(tys, output) . } else { . return; . } . }, . }; 14 ( 0.00%) if let Some(outer) = outer_receiver 35 ( 0.00%) && ty_has_static(sig.output()) 1,416 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/eta_reduction.rs:clippy_lints::eta_reduction::ty_has_static (7x) . && let generic_args = typeck.node_args(outer.hir_id) . // HACK: Given a closure in `T.method(|| f())`, where `fn f() -> U where U: 'static`, `T.method(f)` . // will succeed iff `T: 'static`. But the region of `T` is always erased by `typeck.expr_ty()` when . // T is a generic type. For example, return type of `Option::as_deref()` is a generic. . // So we have a hack like this. . && !generic_args.is_empty() . { . return; . } 21 ( 0.00%) if check_sig(closure_sig, sig) 607 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/eta_reduction.rs:clippy_lints::eta_reduction::check_sig (7x) 28 ( 0.00%) && let generic_args = typeck.node_args(callee.hir_id) 253 ( 0.00%) => ???:::node_args (7x) . // Given some trait fn `fn f() -> ()` and some type `T: Trait`, `T::f` is not . // `'static` unless `T: 'static`. The cast `T::f as fn()` will, however, result . // in a type which is `'static`. . // For now ignore all callee types which reference a type parameter. 3 ( 0.00%) && !generic_args.types().any(|t| matches!(t.kind(), ty::Param(_))) . // Rule out `AsyncFn*`s, because while they can be called as `|x| f(x)`, . // they can't be passed directly into a place expecting an `Fn*` (#13892) 42 ( 0.00%) && let Ok((closure_kind, _)) = cx . .tcx . .infer_ctxt() 63 ( 0.00%) .build(cx.typing_mode()) 714 ( 0.00%) => ???:::build (7x) 105 ( 0.00%) => ???:::typing_mode (7x) 14 ( 0.00%) .err_ctxt() 63 ( 0.00%) => ???:::err_ctxt (7x) 35 ( 0.00%) .type_implements_fn_trait( 154,657 ( 0.00%) => ???:::type_implements_fn_trait (7x) 7 ( 0.00%) cx.param_env, . Binder::bind_with_vars(callee_ty_adjusted, List::empty()), . ty::PredicatePolarity::Positive, . ) . { . span_lint_hir_and_then( . cx, 14 ( 0.00%) REDUNDANT_CLOSURE, 14 ( 0.00%) expr.hir_id, 7 ( 0.00%) expr.span, . "redundant closure", . |diag| { 49 ( 0.00%) if let Some(mut snippet) = snippet_opt(cx, callee.span) { . let n_refs = callee_ty_adjustments . .iter() . .rev() . .fold(0, |acc, adjustment| match adjustment.kind { . Adjust::Deref(DerefAdjustKind::Overloaded(_)) => acc + 1, . Adjust::Deref(_) if acc > 0 => acc + 1, . _ => acc, . }); -- line 228 ---------------------------------------- -- line 242 ---------------------------------------- . ClosureKind::FnMut => snippet = format!("&mut {snippet}"), . ClosureKind::Fn if !callee_ty_raw.is_ref() => { . snippet = format!("&{snippet}"); . }, . _ => (), . } . } . 21 ( 0.00%) let replace_with = match callee_ty_adjusted.kind() { 35 ( 0.00%) ty::FnDef(def, _) => cx.tcx.def_descr(*def), 2,799 ( 0.00%) => ???:::def_descr (7x) . _ => "function", . }; . diag.span_suggestion( 7 ( 0.00%) expr.span, 21 ( 0.00%) format!("replace the closure with the {replace_with} itself"), 49 ( 0.00%) snippet, . Applicability::MachineApplicable, . ); . } . }, . ); 21 ( 0.00%) } 2,933 ( 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) 119 ( 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) . }, 444 ( 0.00%) ExprKind::MethodCall(path, self_, args, _) if check_inputs(typeck, body.params, Some(self_), args) => { 2,966 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/eta_reduction.rs:clippy_lints::eta_reduction::check_inputs (47x) 56 ( 0.00%) if let Some(method_def_id) = typeck.type_dependent_def_id(body.value.hir_id) 357 ( 0.00%) => ???:::type_dependent_def_id (7x) 83 ( 0.00%) && !find_attr!(cx.tcx, method_def_id, TrackCaller(..)) 16,954 ( 0.00%) => ???:>::get_attrs (7x) 21 ( 0.00%) && check_sig(closure_sig, cx.tcx.fn_sig(method_def_id).skip_binder().skip_binder()) 816 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/eta_reduction.rs:clippy_lints::eta_reduction::check_sig (7x) . { 12 ( 0.00%) let mut app = Applicability::MachineApplicable; 6 ( 0.00%) let generic_args = match path.args.and_then(GenericArgs::span_ext) { . Some(span) => format!("::{}", snippet_with_applicability(cx, span, "<..>", &mut app)), . None => String::new(), . }; . span_lint_hir_and_then( . cx, 12 ( 0.00%) REDUNDANT_CLOSURE_FOR_METHOD_CALLS, 12 ( 0.00%) expr.hir_id, 6 ( 0.00%) expr.span, . "redundant closure", 12 ( 0.00%) |diag| { . let args = typeck.node_args(body.value.hir_id); . let caller = self_.hir_id.owner.def_id; . let type_name = get_path_from_caller_to_method_type(cx.tcx, caller, method_def_id, args); . diag.span_suggestion( . expr.span, . "replace the closure with the method itself", . format!("{}::{}{}", type_name, path.ident.name, generic_args), . app, . ); . }, . ); . } . }, . _ => (), . } 678,224 ( 0.01%) } . 608 ( 0.00%) fn check_inputs( . typeck: &TypeckResults<'_>, . params: &[Param<'_>], . self_arg: Option<&Expr<'_>>, . args: &[Expr<'_>], . ) -> bool { 380 ( 0.00%) params.len() == self_arg.map_or(0, |_| 1) + args.len() . && params.iter().zip(self_arg.into_iter().chain(args)).all(|(p, arg)| { 178 ( 0.00%) matches!( 54 ( 0.00%) p.pat.kind, . PatKind::Binding(BindingMode::NONE, id, _, None) 15 ( 0.00%) if arg.res_local_id() == Some(id) . ) . // Only allow adjustments which change regions (i.e. re-borrowing). . && typeck 45 ( 0.00%) .expr_adjustments(arg) 591 ( 0.00%) => ???:::expr_adjustments (15x) . .last() 27 ( 0.00%) .is_none_or(|a| a.target == typeck.expr_ty(arg)) 360 ( 0.00%) => ???:::expr_ty (9x) . }) 608 ( 0.00%) } . 70 ( 0.00%) fn check_sig<'tcx>(closure_sig: FnSig<'tcx>, call_sig: FnSig<'tcx>) -> bool { 28 ( 0.00%) call_sig.safety().is_safe() && !has_late_bound_to_non_late_bound_regions(closure_sig, call_sig) 112 ( 0.00%) } . . /// 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. . /// . /// This is needed because rustc is unable to late bind early-bound regions in a function signature. . fn has_late_bound_to_non_late_bound_regions(from_sig: FnSig<'_>, to_sig: FnSig<'_>) -> bool { . fn check_region(from_region: Region<'_>, to_region: Region<'_>) -> bool { 5 ( 0.00%) from_region.is_bound() && !to_region.is_bound() . } . . fn check_subs(from_subs: &[GenericArg<'_>], to_subs: &[GenericArg<'_>]) -> bool { 26 ( 0.00%) if from_subs.len() != to_subs.len() { . return true; . } . for (from_arg, to_arg) in to_subs.iter().zip(from_subs) { 6 ( 0.00%) match (from_arg.kind(), to_arg.kind()) { . (GenericArgKind::Lifetime(from_region), GenericArgKind::Lifetime(to_region)) => { . if check_region(from_region, to_region) { . return true; . } . }, . (GenericArgKind::Type(from_ty), GenericArgKind::Type(to_ty)) => { 6 ( 0.00%) if check_ty(from_ty, to_ty) { 74 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/eta_reduction.rs:clippy_lints::eta_reduction::has_late_bound_to_non_late_bound_regions::check_ty'2 (3x) . return true; . } . }, . (GenericArgKind::Const(_), GenericArgKind::Const(_)) => (), . _ => return true, . } . } . false . } . 189 ( 0.00%) fn check_ty(from_ty: Ty<'_>, to_ty: Ty<'_>) -> bool { 247 ( 0.00%) match (from_ty.kind(), to_ty.kind()) { 26 ( 0.00%) (&ty::Adt(_, from_subs), &ty::Adt(_, to_subs)) => check_subs(from_subs, to_subs), . (&ty::Array(from_ty, _), &ty::Array(to_ty, _)) | (&ty::Slice(from_ty), &ty::Slice(to_ty)) => { . check_ty(from_ty, to_ty) . }, 16 ( 0.00%) (&ty::Ref(from_region, from_ty, _), &ty::Ref(to_region, to_ty, _)) => { 2 ( 0.00%) check_region(from_region, to_region) || check_ty(from_ty, to_ty) . }, . (&ty::Tuple(from_tys), &ty::Tuple(to_tys)) => { . from_tys.len() != to_tys.len() . || from_tys . .iter() . .zip(to_tys) . .any(|(from_ty, to_ty)| check_ty(from_ty, to_ty)) . }, . _ => from_ty.has_bound_regions(), . } 162 ( 0.00%) } . 28 ( 0.00%) assert_eq!(from_sig.inputs_and_output.len(), to_sig.inputs_and_output.len()); . from_sig . .inputs_and_output . .iter() . .zip(to_sig.inputs_and_output) 24 ( 0.00%) .any(|(from_ty, to_ty)| check_ty(from_ty, to_ty)) 856 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/eta_reduction.rs:clippy_lints::eta_reduction::has_late_bound_to_non_late_bound_regions::check_ty (24x) . } . 28 ( 0.00%) fn ty_has_static(ty: Ty<'_>) -> bool { 14 ( 0.00%) ty.walk() 49 ( 0.00%) => ???:::walk (7x) . .any(|arg| matches!(arg.kind(), GenericArgKind::Lifetime(re) if re.is_static())) 21 ( 0.00%) } 58,347 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/ptr/mut_from_ref.rs -------------------------------------------------------------------------------- Ir -- line 2 ---------------------------------------- . use clippy_utils::diagnostics::span_lint_and_then; . use clippy_utils::visitors::contains_unsafe_block; . use rustc_errors::MultiSpan; . use rustc_hir::intravisit::Visitor; . use rustc_hir::{self as hir, Body, FnRetTy, FnSig, GenericArg, Lifetime, Mutability, TyKind}; . use rustc_lint::LateContext; . use rustc_span::Span; . 31,320 ( 0.00%) pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, sig: &FnSig<'_>, body: Option<&Body<'tcx>>) { 15,363 ( 0.00%) let FnRetTy::Return(ty) = sig.decl.output else { return }; 220 ( 0.00%) for (out, mutability, out_span) in get_lifetimes(ty) { . if mutability != Some(Mutability::Mut) { . continue; . } 350 ( 0.00%) let out_region = cx.tcx.named_bound_var(out.hir_id); 568,645 ( 0.00%) => ???:::named_bound_var (70x) . // `None` if one of the types contains `&'a mut T` or `T<'a>`. . // Else, contains all the locations of `&'a T` types. 140 ( 0.00%) let args_immut_refs: Option> = sig . .decl . .inputs . .iter() . .flat_map(get_lifetimes) 155 ( 0.00%) .filter(|&(lt, _, _)| cx.tcx.named_bound_var(lt.hir_id) == out_region) 2,505 ( 0.00%) => ???:::named_bound_var (31x) . .map(|(_, mutability, span)| (mutability == Some(Mutability::Not)).then_some(span)) . .collect(); 80 ( 0.00%) if let Some(args_immut_refs) = args_immut_refs 40 ( 0.00%) && !args_immut_refs.is_empty() . && body.is_none_or(|body| sig.header.is_unsafe() || contains_unsafe_block(cx, body.value)) . { . span_lint_and_then( . cx, . MUT_FROM_REF, . out_span, . "mutable borrow from immutable input(s)", . |diag| { . let ms = MultiSpan::from_spans(args_immut_refs); . diag.span_note(ms, "immutable borrow here"); . }, . ); . } . } 31,320 ( 0.00%) } . . struct LifetimeVisitor<'tcx> { . result: Vec<(&'tcx Lifetime, Option, Span)>, . } . . impl<'tcx> Visitor<'tcx> for LifetimeVisitor<'tcx> { . fn visit_ty(&mut self, ty: &'tcx hir::Ty<'tcx, hir::AmbigArg>) { 10,177 ( 0.00%) if let TyKind::Ref(lt, ref m) = ty.kind { 465 ( 0.00%) self.result.push((lt, Some(m.mutbl), ty.span)); . } 10,136 ( 0.00%) hir::intravisit::walk_ty(self, ty); 340,150 ( 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:: (3,618x) . } . . fn visit_generic_arg(&mut self, generic_arg: &'tcx GenericArg<'tcx>) { 2,175 ( 0.00%) if let GenericArg::Lifetime(lt) = generic_arg { 66 ( 0.00%) self.result.push((lt, None, generic_arg.span())); . } . hir::intravisit::walk_generic_arg(self, generic_arg); . } . } . . /// Visit `ty` and collect the all the lifetimes appearing in it, implicit or not. . /// . /// The second field of the vector's elements indicate if the lifetime is attached to a . /// shared reference, a mutable reference, or neither. . fn get_lifetimes<'tcx>(ty: &'tcx hir::Ty<'tcx>) -> Vec<(&'tcx Lifetime, Option, Span)> { . use hir::intravisit::VisitorExt as _; . 11,529 ( 0.00%) let mut visitor = LifetimeVisitor { result: Vec::new() }; . visitor.visit_ty_unambig(ty); 15,147 ( 0.00%) visitor.result . } 442 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/methods/io_other_error.rs -------------------------------------------------------------------------------- Ir -- line 2 ---------------------------------------- . use clippy_utils::msrvs::{self, Msrv}; . use clippy_utils::res::{MaybeDef as _, MaybeQPath as _}; . use clippy_utils::{expr_or_init, sym}; . use rustc_errors::Applicability; . use rustc_hir::{Expr, ExprKind, QPath}; . use rustc_lint::LateContext; . . pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, path: &Expr<'_>, args: &[Expr<'_>], msrv: Msrv) { 33,572 ( 0.00%) if let [error_kind, error] = args 14,018 ( 0.00%) && !expr.span.from_expansion() 14,018 ( 0.00%) && !error_kind.span.from_expansion() 14,018 ( 0.00%) && let ExprKind::Path(QPath::TypeRelative(_, new_segment)) = path.kind 8,966 ( 0.00%) && path.ty_rel_def(cx).is_diag_item(cx, sym::io_error_new) . && let ExprKind::Path(QPath::Resolved(_, init_path)) = &expr_or_init(cx, error_kind).kind . && let [.., error_kind_ty, error_kind_variant] = init_path.segments . && cx.tcx.is_diagnostic_item(sym::io_errorkind, error_kind_ty.res.def_id()) . && error_kind_variant.ident.name == sym::Other . && msrv.meets(cx, msrvs::IO_ERROR_OTHER) . { . span_lint_and_then( . cx, -- line 22 ---------------------------------------- -- line 30 ---------------------------------------- . (new_segment.ident.span, "other".to_owned()), . (error_kind.span.until(error.span.source_callsite()), String::new()), . ], . Applicability::MachineApplicable, . ); . }, . ); . } 16,786 ( 0.00%) } 81,263 ( 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); 31,072 ( 0.00%) let mut preds = [Vec::new(), Vec::new(), Vec::new()]; . for (clause, _) in generics.clauses { 11,140 ( 0.00%) if let ClauseKind::Trait(poly_trait_pred) = clause.kind().skip_binder() { 31,192 ( 0.00%) => ???:::kind (2,228x) . let trait_pred = cx . .tcx 13,622 ( 0.00%) .instantiate_bound_regions_with_erased(clause.kind().rebind(poly_trait_pred)); 210,625 ( 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::> (1,946x) 27,244 ( 0.00%) => ???:::kind (1,946x) . for (i, tid) in trait_ids.iter().enumerate() { 8,058 ( 0.00%) if let Some(tid) = tid . && *tid == trait_pred.trait_ref.def_id . { . preds[i].push(trait_pred); . } . } . } . } 54,376 ( 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, _)| { 3,573 ( 0.00%) if let ClauseKind::Projection(pred) = clause.kind().skip_binder() { 8,470 ( 0.00%) => ???:::kind (605x) 959 ( 0.00%) let projection_pred = cx.tcx.instantiate_bound_regions_with_erased(clause.kind().rebind(pred)); 58,243 ( 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::> (137x) 1,918 ( 0.00%) => ???:::kind (137x) 137 ( 0.00%) if projection_pred.projection_term.args == trait_pred.trait_ref.args { 822 ( 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(); 19,420 ( 0.00%) if let Some(def_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id) { 198,452 ( 0.00%) => ???:::type_dependent_def_id (3,884x) . let fn_sig = cx.tcx.fn_sig(def_id).instantiate_identity().skip_norm_wip(); . let generics = cx.tcx.clauses_of(def_id); 50,492 ( 0.00%) let [fn_mut_preds, ord_preds, partial_ord_preds] = 3,884 ( 0.00%) get_trait_predicates_for_trait_ids(cx, generics, &[Some(fn_mut_trait), ord_trait, partial_ord_trait]); 3,884 ( 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<'_>]` 274 ( 0.00%) let inputs_output = cx.tcx.instantiate_bound_regions_with_erased(fn_sig.inputs_and_output()); 80,405 ( 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>> (137x) . inputs_output . .iter() . .rev() . .skip(1) . .rev() . .enumerate() . .for_each(|(i, inp)| { . for trait_pred in &fn_mut_preds { 576 ( 0.00%) if trait_pred.self_ty() == inp 1,096 ( 0.00%) && let Some(return_ty_pred) = get_projection_pred(cx, generics, *trait_pred) . { . if ord_preds . .iter() 6 ( 0.00%) .any(|ord| Some(ord.self_ty()) == return_ty_pred.term.as_type()) 21 ( 0.00%) => ???:::as_type (3x) . { . 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; . } . } . } . } . }); . } 685 ( 0.00%) args_to_check . } . . fn check_arg<'tcx>(cx: &LateContext<'tcx>, arg: &'tcx Expr<'tcx>) -> Option<(Span, Option)> { 12 ( 0.00%) if let ExprKind::Closure(&Closure { body, fn_decl_span, .. }) = arg.kind 12 ( 0.00%) && let ty::Closure(_def_id, args) = &cx.typeck_results().node_type(arg.hir_id).kind() 82 ( 0.00%) => ???:::node_type (2x) 2 ( 0.00%) && let ret_ty = args.as_closure().sig().output() 6 ( 0.00%) && let ty = cx.tcx.instantiate_bound_regions_with_erased(ret_ty) 54 ( 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:: (2x) . && 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 498,512 ( 0.00%) if let ExprKind::MethodCall(_, receiver, args, _) = expr.kind 12,182 ( 0.00%) && args.iter().any(|arg| { . matches!( . arg.peel_blocks().peel_borrows().peel_drop_temps().kind, . ExprKind::Path(_) | ExprKind::Closure(_) . ) . }) 19,420 ( 0.00%) && let Some(fn_mut_trait) = cx.tcx.lang_items().fn_mut_trait() 155,360 ( 0.00%) => ???:::lang_items (3,884x) . { 15,536 ( 0.00%) let ord_trait = cx.tcx.get_diagnostic_item(sym::Ord); 411,704 ( 0.00%) => ???:::get_diagnostic_item (3,884x) 7,768 ( 0.00%) let partial_ord_trait = cx.tcx.lang_items().partial_ord_trait(); 155,360 ( 0.00%) => ???:::lang_items (3,884x) . if (ord_trait, partial_ord_trait) == (None, None) { . return; . } . . let args = std::iter::once(receiver).chain(args.iter()).collect::>(); 7,768 ( 0.00%) let arg_indices = get_args_to_check(cx, expr, args.len(), fn_mut_trait, ord_trait, partial_ord_trait); 2 ( 0.00%) for (i, trait_name) in arg_indices { 2 ( 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"); . } . }, . ); . } . } . } 1,937,824 ( 0.02%) } . } 66,935 ( 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/flat_map_in_place.rs -------------------------------------------------------------------------------- Ir -- line 10 ---------------------------------------- . fn flat_map_in_place(&mut self, f: F) . where . F: FnMut(T) -> I, . I: IntoIterator; . } . . // Blanket impl for all vec-like types that impl `FlatMapInPlaceVec`. . impl FlatMapInPlace for V { 49,589 ( 0.00%) fn flat_map_in_place(&mut self, mut f: F) . where . F: FnMut(V::Elem) -> I, . I: IntoIterator, . { . struct LeakGuard<'a, V: FlatMapInPlaceVec>(&'a mut V); . . impl<'a, V: FlatMapInPlaceVec> Drop for LeakGuard<'a, V> { . fn drop(&mut self) { -- line 26 ---------------------------------------- -- line 31 ---------------------------------------- . } . } . . let guard = LeakGuard(self); . . let mut read_i = 0; . let mut write_i = 0; . unsafe { 54,317 ( 0.00%) while read_i < guard.0.len() { . // Move the read_i'th item out of the vector and map it to an iterator. . let e = ptr::read(guard.0.as_ptr().add(read_i)); . let iter = f(e).into_iter(); 11,412 ( 0.00%) read_i += 1; . 51,354 ( 0.00%) for e in iter { 68,472 ( 0.00%) if write_i < read_i { 11,412 ( 0.00%) ptr::write(guard.0.as_mut_ptr().add(write_i), e); . write_i += 1; . } else { . // If this is reached we ran out of space in the middle of the vector. . // However, the vector is in a valid state here, so we just do a somewhat . // inefficient insert. . guard.0.insert(write_i, e); . . read_i += 1; -- line 55 ---------------------------------------- -- line 59 ---------------------------------------- . } . . // `write_i` tracks the number of actually written new items. . guard.0.set_len(write_i); . . // `vec` is in a sane state again. Prevent the LeakGuard from leaking the data. . mem::forget(guard); . } 46,672 ( 0.00%) } . } . . /// A vec-like type must implement these operations to support `flat_map_in_place`. . /// . /// # Safety . /// . /// The memory safety of the unsafe block in `flat_map_in_place` relies on impls of this trait . /// implementing all the operations correctly. -- line 75 ---------------------------------------- 34,961 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/large_include_file.rs -------------------------------------------------------------------------------- Ir -- line 42 ---------------------------------------- . . pub struct LargeIncludeFile { . max_file_size: u64, . } . . impl LargeIncludeFile { . pub fn new(conf: &'static Conf) -> Self { . Self { 1 ( 0.00%) max_file_size: conf.max_include_file_size, . } . } . } . . impl LateLintPass<'_> for LargeIncludeFile { . fn check_expr(&mut self, cx: &LateContext<'_>, expr: &'_ Expr<'_>) { . if let ExprKind::Lit(lit) = &expr.kind . && let len = match &lit.node { -- line 58 ---------------------------------------- -- line 80 ---------------------------------------- . )); . }, . ); . } . } . } . . impl EarlyLintPass for LargeIncludeFile { 151,900 ( 0.00%) fn check_attribute(&mut self, cx: &EarlyContext<'_>, attr: &Attribute) { 45,567 ( 0.00%) if !attr.span.from_expansion() . // Currently, rustc limits the usage of macro at the top-level of attributes, . // so we don't need to recurse into each level. . && let AttrKind::Normal(ref normal) = attr.kind 2,112 ( 0.00%) && let Some(doc) = attr.doc_str() 7,916 ( 0.00%) => ???:::doc_str (528x) . && doc.as_str().len() as u64 > self.max_file_size . && let AttrArgs::Eq { expr: meta, .. } = &normal.item.args . && !attr.span.contains(meta.span) . // Since the `include_str` is already expanded at this point, we can only take the . // whole attribute snippet and then modify for our suggestion. . && let Some(snippet) = snippet_opt(cx, attr.span) . // We cannot remove this because a `#[doc = include_str!("...")]` attribute can . // occupy several lines. -- line 101 ---------------------------------------- -- line 118 ---------------------------------------- . |diag| { . diag.note(format!( . "the configuration allows a maximum size of {} bytes", . self.max_file_size . )); . }, . ); . } 121,520 ( 0.00%) } . } 22,346 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/extra_unused_type_parameters.rs -------------------------------------------------------------------------------- Ir -- line 66 ---------------------------------------- . /// Collection of any type parameters with trait bounds that appear in a where clause. . where_bounds: FxHashSet, . /// The entire `Generics` object of the function, useful for querying purposes. . generics: &'tcx Generics<'tcx>, . } . . impl<'cx, 'tcx> TypeWalker<'cx, 'tcx> { . fn new(cx: &'cx LateContext<'tcx>, generics: &'tcx Generics<'tcx>) -> Self { 3,054 ( 0.00%) let ty_params = generics . .params . .iter() 10,863 ( 0.00%) .filter_map(|param| match param.kind { 2,082 ( 0.00%) GenericParamKind::Type { synthetic, .. } if !synthetic => Some((param.def_id.into(), param.span)), . _ => None, . }) . .collect(); . 14,170 ( 0.00%) Self { . cx, . ty_params, . inline_bounds: FxHashMap::default(), . where_bounds: FxHashSet::default(), . generics, . } . } . -- line 91 ---------------------------------------- -- line 101 ---------------------------------------- . . fn emit_sugg(&self, spans: Vec, msg: String, help: &'static str) { . let suggestions: Vec<(Span, String)> = spans.iter().copied().zip(std::iter::repeat(String::new())).collect(); . span_lint_and_then(self.cx, EXTRA_UNUSED_TYPE_PARAMETERS, spans, msg, |diag| { . diag.multipart_suggestion(help, suggestions, Applicability::MaybeIncorrect); . }); . } . 12,216 ( 0.00%) fn emit_lint(&self) { 4,581 ( 0.00%) let explicit_params = self . .generics . .params . .iter() . .filter(|param| !param.is_elided_lifetime() && !param.is_impl_trait()) . .collect::>(); . . let extra_params = explicit_params . .iter() . .enumerate() . .filter(|(_, param)| self.ty_params.contains_key(¶m.def_id.to_def_id())) . .collect::>(); . 3,054 ( 0.00%) let (msg, help) = match extra_params.len() { . 0 => return, . 1 => ( . format!( . "type parameter `{}` goes unused in function definition", . extra_params[0].1.name.ident() . ), . "consider removing the parameter", . ), -- line 131 ---------------------------------------- -- line 183 ---------------------------------------- . let prev_span = self.get_bound_span(prev); . self.get_bound_span(param).with_lo(prev_span.hi()) . } . }) . .collect() . }; . self.emit_sugg(spans, msg, help); . } 12,216 ( 0.00%) } . } . . /// Given a generic bound, if the bound is for a trait that's not a `LangItem`, return the . /// `LocalDefId` for that trait. . fn bound_to_trait_def_id(bound: &GenericBound<'_>) -> Option { 2,172 ( 0.00%) bound.trait_ref()?.trait_def_id()?.as_local() 14,118 ( 0.00%) => ???:::trait_def_id (1,086x) . } . . impl<'tcx> Visitor<'tcx> for TypeWalker<'_, 'tcx> { . type NestedFilter = nested_filter::OnlyBodies; . 902 ( 0.00%) fn visit_ty(&mut self, t: &'tcx Ty<'tcx, AmbigArg>) { 14,290 ( 0.00%) if let Some((def_id, _)) = t.peel_refs().as_generic_param() { . self.ty_params.remove(&def_id); . } else { 31,157 ( 0.00%) walk_ty(self, t); 204 ( 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::'2 (2x) 190 ( 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:: (2x) . } 1,341 ( 0.00%) } . 7,462 ( 0.00%) fn visit_where_predicate(&mut self, predicate: &'tcx WherePredicate<'tcx>) { . let span = predicate.span; 4,264 ( 0.00%) if let WherePredicateKind::BoundPredicate(predicate) = predicate.kind { . // Collect spans for any bounds on type parameters. 5,330 ( 0.00%) if let Some((def_id, _)) = predicate.bounded_ty.peel_refs().as_generic_param() { 4,230 ( 0.00%) match predicate.origin { . PredicateOrigin::GenericParam => { . self.inline_bounds.insert(def_id, span); . }, . PredicateOrigin::WhereClause => { . self.where_bounds.insert(def_id); . }, . PredicateOrigin::ImplTrait => (), . } . . // If the bound contains non-public traits, err on the safe side and don't lint the . // corresponding parameter. 1,066 ( 0.00%) if !predicate . .bounds . .iter() . .filter_map(bound_to_trait_def_id) 5,267 ( 0.00%) .all(|id| self.cx.effective_visibilities.is_exported(id)) 59,565 ( 0.00%) => ???:::is_exported (1,045x) . { . self.ty_params.remove(&def_id); . } . } else { . // If the bounded type isn't a generic param, but is instead a concrete generic . // type, any params we find nested inside of it are being used as concrete types, . // and can therefore can be considered used. So, we're fine to walk the left-hand . // side of the where bound. . walk_unambig_ty(self, predicate.bounded_ty); . } 1,066 ( 0.00%) for bound in predicate.bounds { . walk_param_bound(self, bound); . } . } 8,528 ( 0.00%) } . . fn maybe_tcx(&mut self) -> Self::MaybeTyCtxt { 1,701 ( 0.00%) self.cx.tcx . } . } . . fn is_empty_body(cx: &LateContext<'_>, body: BodyId) -> bool { 16,350 ( 0.00%) matches!(cx.tcx.hir_body(body).value.kind, ExprKind::Block(b, _) if b.stmts.is_empty() && b.expr.is_none()) 76,917 ( 0.00%) => ???:::hir_body (1,113x) . } . . impl<'tcx> LateLintPass<'tcx> for ExtraUnusedTypeParameters { 41,566 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'tcx>) { 11,876 ( 0.00%) if let ItemKind::Fn { 1,233 ( 0.00%) generics, 2,226 ( 0.00%) body: body_id, . .. . } = item.kind 1,233 ( 0.00%) && !generics.params.is_empty() 1,147 ( 0.00%) && !is_empty_body(cx, body_id) 7,791 ( 0.00%) && (!self.avoid_breaking_exported_api || !cx.effective_visibilities.is_exported(item.owner_id.def_id)) 62,440 ( 0.00%) => ???:::is_exported (1,113x) 3,300 ( 0.00%) && !item.span.in_external_macro(cx.sess().source_map()) 2,200 ( 0.00%) && !is_from_proc_macro(cx, item) . { . let mut walker = TypeWalker::new(cx, generics); 2,200 ( 0.00%) walk_item(&mut walker, item); 9,446,313 ( 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_item:: (1,100x) 1,100 ( 0.00%) walker.emit_lint(); 226,138 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/extra_unused_type_parameters.rs:::emit_lint (1,100x) . } 47,504 ( 0.00%) } . 28,777 ( 0.00%) fn check_impl_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx ImplItem<'tcx>) { . // Only lint on inherent methods, not trait methods. 8,222 ( 0.00%) if let ImplItemKind::Fn(.., body_id) = item.kind 7,828 ( 0.00%) && !item.generics.params.is_empty() 15,440 ( 0.00%) && trait_ref_of_method(cx, item.owner_id).is_none() 476,620 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::trait_ref_of_method (3,088x) 1,464 ( 0.00%) && !is_empty_body(cx, body_id) 6,657 ( 0.00%) && (!self.avoid_breaking_exported_api || !cx.effective_visibilities.is_exported(item.owner_id.def_id)) 51,387 ( 0.00%) => ???:::is_exported (951x) 1,281 ( 0.00%) && !item.span.in_external_macro(cx.sess().source_map()) 854 ( 0.00%) && !is_from_proc_macro(cx, item) . { . let mut walker = TypeWalker::new(cx, item.generics); 854 ( 0.00%) walk_impl_item(&mut walker, item); 1,798,252 ( 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_impl_item:: (427x) 427 ( 0.00%) walker.emit_lint(); 47,868 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/extra_unused_type_parameters.rs:::emit_lint (427x) . } 32,888 ( 0.00%) } . } 48,526 ( 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 { 5,684 ( 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 { 606,981 ( 0.01%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 404,654 ( 0.00%) if let ExprKind::Assign(target, source, _) = &expr.kind { 1,218 ( 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"); . } 1,218 ( 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"); . } . } 809,308 ( 0.01%) } . } -------------------------------------------------------------------------------- -- 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; . 2,340,912 ( 0.02%) pub fn check(cx: &LateContext<'_>, attrs: &[Attribute]) -> bool { . let replacements: Vec<_> = collect_doc_replacements(attrs); . 668,832 ( 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 . } 2,675,328 ( 0.02%) } . . fn collect_doc_replacements(attrs: &[Attribute]) -> Vec<(Span, String)> { . attrs . .iter() . .filter_map(|attr| { 74,998 ( 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 { 16,286 ( 0.00%) None . } . }) . .collect() . } 11,148 ( 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, . { 3,187,583 ( 0.03%) 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. 50,336 ( 0.00%) let mut vector = match iterator.next() { 36,318 ( 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:, alloc::vec::Vec<(&rustc_hir::hir::Lifetime, core::option::Option, rustc_span::span_encoding::Span)>, clippy_lints::ptr::mut_from_ref::get_lifetimes>, clippy_lints::ptr::mut_from_ref::check::{closure#0}>, clippy_lints::ptr::mut_from_ref::check::{closure#1}>, core::option::Option> as core::iter::traits::iterator::Iterator>::next (70x) . None => return Vec::new(), 268 ( 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); . } 32,458 ( 0.00%) vector . } . }; . // must delegate to spec_extend() since extend() itself delegates . // to spec_from for empty Vecs 58,376 ( 0.00%) as SpecExtend>::spec_extend(&mut vector, iterator); 30 ( 0.00%) => ???:0x0000000000173dc0 (1x) 64,517 ( 0.00%) vector 3,536,778 ( 0.03%) } . } . . impl SpecFromIterNested for Vec . where . I: TrustedLen, . { 88,539 ( 0.00%) fn from_iter(iterator: I) -> Self { 6,967 ( 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 7,768 ( 0.00%) vector.spec_extend(iterator); 51,433 ( 0.00%) vector 95,287 ( 0.00%) } . } 46,694 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/needless_maybe_sized.rs -------------------------------------------------------------------------------- Ir -- line 45 ---------------------------------------- . trait_bound: &'tcx PolyTraitRef<'tcx>, . . predicate_pos: usize, . bound_pos: usize, . } . . /// Finds all of the [`Bound`]s that refer to a type parameter and are not from a macro expansion . fn type_param_bounds<'tcx>(generics: &'tcx Generics<'tcx>) -> impl Iterator> { 28,326 ( 0.00%) generics . .predicates . .iter() . .enumerate() . .filter_map(|(predicate_pos, predicate)| { 5,980 ( 0.00%) let WherePredicateKind::BoundPredicate(bound_predicate) = &predicate.kind else { . return None; . }; . 2,970 ( 0.00%) let (param, ident) = bound_predicate.bounded_ty.as_generic_param()?; . . Some( 4,428 ( 0.00%) bound_predicate . .bounds . .iter() . .enumerate() 7,925 ( 0.00%) .filter_map(move |(bound_pos, bound)| match bound { . GenericBound::Trait(trait_bound) => Some(Bound { . param, . ident, . trait_bound, . predicate_pos, . bound_pos, . }), . GenericBound::Outlives(_) | GenericBound::Use(..) => None, -- line 77 ---------------------------------------- -- line 80 ---------------------------------------- . ) . }) . .flatten() . } . . /// Searches the supertraits of the trait referred to by `trait_bound` recursively, returning the . /// path taken to find a `Sized` bound if one is found . fn path_to_sized_bound(cx: &LateContext<'_>, trait_bound: &PolyTraitRef<'_>) -> Option> { 154 ( 0.00%) fn search(cx: &LateContext<'_>, path: &mut Vec) -> bool { 44 ( 0.00%) let trait_def_id = *path.last().unwrap(); . 66 ( 0.00%) if Some(trait_def_id) == cx.tcx.lang_items().sized_trait() { 440 ( 0.00%) => ???:::lang_items (11x) . return true; . } . . for (clause, _) in cx . .tcx . .explicit_super_clauses_of(trait_def_id) . .iter_identity_copied() . .map(Unnormalized::skip_norm_wip) . { 55 ( 0.00%) if let ClauseKind::Trait(trait_predicate) = clause.kind().skip_binder() 154 ( 0.00%) => ???:::kind (11x) . && trait_predicate.polarity == PredicatePolarity::Positive . && !path.contains(&trait_predicate.def_id()) . { . path.push(trait_predicate.def_id()); 44 ( 0.00%) if search(cx, path) { 2,002 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/needless_maybe_sized.rs:clippy_lints::needless_maybe_sized::path_to_sized_bound::search'2 (11x) . return true; . } . path.pop(); . } . } . . false 176 ( 0.00%) } . 44 ( 0.00%) let mut path = vec![trait_bound.trait_ref.trait_def_id()?]; 143 ( 0.00%) => ???:::trait_def_id (11x) 22 ( 0.00%) search(cx, &mut path).then_some(path) 11,635 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/needless_maybe_sized.rs:clippy_lints::needless_maybe_sized::path_to_sized_bound::search (11x) . } . . impl LateLintPass<'_> for NeedlessMaybeSized { 84,978 ( 0.00%) fn check_generics(&mut self, cx: &LateContext<'_>, generics: &Generics<'_>) { 56,652 ( 0.00%) let Some(sized_trait) = cx.tcx.lang_items().sized_trait() else { 377,680 ( 0.00%) => ???:::lang_items (9,442x) . return; . }; . . let maybe_sized_params: DefIdMap<_> = type_param_bounds(generics) . .filter(|bound| { 4,272 ( 0.00%) bound.trait_bound.trait_ref.trait_def_id() == Some(sized_trait) 18,408 ( 0.00%) => ???:::trait_def_id (1,416x) 24 ( 0.00%) && matches!(bound.trait_bound.modifiers.polarity, BoundPolarity::Maybe(_)) . }) . .map(|bound| (bound.param, bound)) . .collect(); . . for bound in type_param_bounds(generics) { 4,220 ( 0.00%) if bound.trait_bound.modifiers == TraitBoundModifiers::NONE . && let Some(sized_bound) = maybe_sized_params.get(&bound.param) . && let Some(path) = path_to_sized_bound(cx, bound.trait_bound) . && !is_from_proc_macro(cx, bound.trait_bound) . { . span_lint_and_then( . cx, . NEEDLESS_MAYBE_SIZED, . sized_bound.trait_bound.span, -- line 143 ---------------------------------------- -- line 162 ---------------------------------------- . Applicability::MaybeIncorrect, . ); . }, . ); . . return; . } . } 75,536 ( 0.00%) } . } 9,604 ( 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 { 1,820,943 ( 0.02%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 987,285 ( 0.01%) if let ExprKind::FormatArgs(format_args) = &expr.kind 5,736 ( 0.00%) && !format_args.span.in_external_macro(cx.sess().source_map()) 1,273 ( 0.00%) && 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, . str, . format_args.span, . "r", . u8::try_from(count_hash).unwrap(), . "string", . ); . } . 48,700 ( 0.00%) if let ExprKind::Lit(lit) = expr.kind 60,875 ( 0.00%) && 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()); . } 1,618,616 ( 0.01%) } . } . . 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/operators/invalid_upcast_comparisons.rs -------------------------------------------------------------------------------- Ir -- line 20 ---------------------------------------- . rhs: &'tcx Expr<'_>, . span: Span, . ) { . let normalized = comparisons::normalize_comparison(cmp, lhs, rhs); . let Some((rel, normalized_lhs, normalized_rhs)) = normalized else { . return; . }; . 14,095 ( 0.00%) let lhs_bounds = numeric_cast_precast_bounds(cx, normalized_lhs); 69,054 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/operators/invalid_upcast_comparisons.rs:clippy_lints::operators::invalid_upcast_comparisons::numeric_cast_precast_bounds (2,819x) 8,457 ( 0.00%) let rhs_bounds = numeric_cast_precast_bounds(cx, normalized_rhs); 64,751 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/operators/invalid_upcast_comparisons.rs:clippy_lints::operators::invalid_upcast_comparisons::numeric_cast_precast_bounds (2,819x) . 25,371 ( 0.00%) upcast_comparison_bounds_err(cx, span, rel, lhs_bounds, normalized_lhs, normalized_rhs, false); 53,149 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/operators/invalid_upcast_comparisons.rs:clippy_lints::operators::invalid_upcast_comparisons::upcast_comparison_bounds_err (2,819x) 22,552 ( 0.00%) upcast_comparison_bounds_err(cx, span, rel, rhs_bounds, normalized_rhs, normalized_lhs, true); 53,527 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/operators/invalid_upcast_comparisons.rs:clippy_lints::operators::invalid_upcast_comparisons::upcast_comparison_bounds_err (2,819x) . } . 45,104 ( 0.00%) fn numeric_cast_precast_bounds(cx: &LateContext<'_>, expr: &Expr<'_>) -> Option<(FullInt, FullInt)> { 11,292 ( 0.00%) if let ExprKind::Cast(cast_exp, _) = expr.kind { 80 ( 0.00%) let pre_cast_ty = cx.typeck_results().expr_ty(cast_exp); 640 ( 0.00%) => ???:::expr_ty (16x) 64 ( 0.00%) let cast_ty = cx.typeck_results().expr_ty(expr); 652 ( 0.00%) => ???:::expr_ty (16x) . // if it's a cast from i32 to u32 wrapping will invalidate all these checks 32 ( 0.00%) if cx.layout_of(pre_cast_ty).ok().map(|l| l.size) == cx.layout_of(cast_ty).ok().map(|l| l.size) { . return None; . } 71 ( 0.00%) match pre_cast_ty.kind() { 24 ( 0.00%) ty::Int(int_ty) => Some(match int_ty { . IntTy::I8 => (FullInt::S(i128::from(i8::MIN)), FullInt::S(i128::from(i8::MAX))), . IntTy::I16 => (FullInt::S(i128::from(i16::MIN)), FullInt::S(i128::from(i16::MAX))), . IntTy::I32 => (FullInt::S(i128::from(i32::MIN)), FullInt::S(i128::from(i32::MAX))), . IntTy::I64 => (FullInt::S(i128::from(i64::MIN)), FullInt::S(i128::from(i64::MAX))), . IntTy::I128 => (FullInt::S(i128::MIN), FullInt::S(i128::MAX)), . IntTy::Isize => (FullInt::S(isize::MIN as i128), FullInt::S(isize::MAX as i128)), 2 ( 0.00%) }), 182 ( 0.00%) ty::Uint(uint_ty) => Some(match uint_ty { . UintTy::U8 => (FullInt::U(u128::from(u8::MIN)), FullInt::U(u128::from(u8::MAX))), . UintTy::U16 => (FullInt::U(u128::from(u16::MIN)), FullInt::U(u128::from(u16::MAX))), . UintTy::U32 => (FullInt::U(u128::from(u32::MIN)), FullInt::U(u128::from(u32::MAX))), . UintTy::U64 => (FullInt::U(u128::from(u64::MIN)), FullInt::U(u128::from(u64::MAX))), . UintTy::U128 => (FullInt::U(u128::MIN), FullInt::U(u128::MAX)), . UintTy::Usize => (FullInt::U(usize::MIN as u128), FullInt::U(usize::MAX as u128)), . }), . _ => None, . } . } else { . None . } 45,104 ( 0.00%) } . 33,828 ( 0.00%) fn upcast_comparison_bounds_err<'tcx>( . cx: &LateContext<'tcx>, . span: Span, . rel: Rel, . lhs_bounds: Option<(FullInt, FullInt)>, . lhs: &'tcx Expr<'_>, . rhs: &'tcx Expr<'_>, . invert: bool, . ) { 28,415 ( 0.00%) if let Some((lb, ub)) = lhs_bounds 135 ( 0.00%) && let Some(norm_rhs_val) = ConstEvalCtxt::new(cx).eval_full_int(rhs, span.ctxt()) 3,722 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval_full_int (15x) 840 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::new (15x) . { . match rel { . Rel::Eq => { . if norm_rhs_val < lb || ub < norm_rhs_val { . err_upcast_comparison(cx, span, lhs, false); . } . }, . Rel::Ne => { -- line 85 ---------------------------------------- -- line 98 ---------------------------------------- . if (invert && norm_rhs_val <= lb) || (!invert && ub <= norm_rhs_val) { . err_upcast_comparison(cx, span, lhs, true); . } else if (!invert && norm_rhs_val < lb) || (invert && ub < norm_rhs_val) { . err_upcast_comparison(cx, span, lhs, false); . } . }, . } . } 39,466 ( 0.00%) } . . fn err_upcast_comparison(cx: &LateContext<'_>, span: Span, expr: &Expr<'_>, always: bool) { . if let ExprKind::Cast(cast_val, _) = expr.kind { . let mut applicability = Applicability::MachineApplicable; . let (cast_val_snip, _) = snippet_with_context( . cx, . cast_val.span, . expr.span.ctxt(), -- line 114 ---------------------------------------- 11,472 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/attrs/duplicated_attributes.rs -------------------------------------------------------------------------------- Ir -- line 11 ---------------------------------------- . fn emit_if_duplicated( . cx: &EarlyContext<'_>, . attr: &MetaItem, . attr_paths: &mut FxHashMap, . complete_path: String, . ) { . match attr_paths.entry(complete_path) { . Entry::Vacant(v) => { 548 ( 0.00%) v.insert(attr.span); 541 ( 0.00%) }, . Entry::Occupied(o) => { . span_lint_and_then(cx, DUPLICATED_ATTRIBUTES, attr.span, "duplicated attribute", |diag| { . diag.span_note(*o.get(), "first defined here"); . diag.span_help(attr.span, "remove this attribute"); . }); . }, . } . } . 49,599 ( 0.00%) fn check_duplicated_attr( . cx: &EarlyContext<'_>, . attr: &MetaItem, . attr_paths: &mut FxHashMap, . parent: &mut Vec, . ) { 9,018 ( 0.00%) if attr.span.from_expansion() { . return; . } 4,740 ( 0.00%) let attr_path = if let Some(ident) = attr.ident() { 4,752 ( 0.00%) => ???:::ident (529x) 1,884 ( 0.00%) ident.name . } else { 18 ( 0.00%) Symbol::intern(&path_to_string(&attr.path)) 3,657 ( 0.00%) => ???:rustc_ast_pretty::pprust::path_to_string (3x) . }; 8,514 ( 0.00%) if let Some(ident) = attr.ident() { 4,752 ( 0.00%) => ???:::ident (529x) . let name = ident.name; . if name == sym::doc || name == sym::rustc_on_unimplemented || name == sym::reason { . // FIXME: Would be nice to handle `cfg_attr` as well. Only problem is to check that cfg . // conditions are the same. . // `#[rustc_on_unimplemented]` contains duplicated subattributes, that's expected. . return; . } . } 14 ( 0.00%) if let Some(value) = attr.value_str() { . emit_if_duplicated( . cx, . attr, . attr_paths, 105 ( 0.00%) format!("{}:{attr_path}={value}", parent.iter().join(":")), 72 ( 0.00%) => /home/moon/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/itertools-0.15.0/src/lib.rs: as itertools::Itertools>::join (3x) . ); 3,744 ( 0.00%) } else if let Some(sub_attrs) = attr.meta_item_list() { 2,878 ( 0.00%) => ???:::meta_item_list (522x) 395 ( 0.00%) parent.push(attr_path); 1,185 ( 0.00%) for sub_attr in sub_attrs { . if let Some(meta) = sub_attr.meta_item() { 2,514 ( 0.00%) check_duplicated_attr(cx, meta, attr_paths, parent); 672,640 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/attrs/duplicated_attributes.rs:clippy_lints::attrs::duplicated_attributes::check_duplicated_attr'2 (419x) . } . } . parent.pop(); . } else { 6,492 ( 0.00%) emit_if_duplicated(cx, attr, attr_paths, format!("{}:{attr_path}", parent.iter().join(":"))); 3,048 ( 0.00%) => /home/moon/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/itertools-0.15.0/src/lib.rs: as itertools::Itertools>::join (127x) . } 36,072 ( 0.00%) } . . pub fn check(cx: &EarlyContext<'_>, attrs: &[Attribute]) { . let mut attr_paths = FxHashMap::default(); . . for attr in attrs { 117,365 ( 0.00%) if let Some(meta) = attr.meta() { 1,264,234 ( 0.01%) => ???:::meta (15,293x) 20,450 ( 0.00%) check_duplicated_attr(cx, &meta, &mut attr_paths, &mut Vec::new()); 977,090 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/attrs/duplicated_attributes.rs:clippy_lints::attrs::duplicated_attributes::check_duplicated_attr (4,090x) . } . } . } 1,362 ( 0.00%) -------------------------------------------------------------------------------- -- 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<'_>) { 494,569 ( 0.00%) if let ExprKind::Ret(Some(e)) = expr.kind { 8,637 ( 0.00%) check(cx, e); 51,776 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/needless_question_mark.rs:clippy_lints::needless_question_mark::check (2,879x) . } . } . . fn check_body(&mut self, cx: &LateContext<'_>, body: &'_ Body<'_>) { 26,540 ( 0.00%) if let ExprKind::Block( . Block { . expr: . Some(Expr { . kind: ExprKind::DropTemps(async_body), . .. . }), . .. . }, . _, 22,782 ( 0.00%) ) = body.value.kind . { 75 ( 0.00%) 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<'_>) { 22,852 ( 0.00%) if let ExprKind::Call(path, [arg]) = expr.kind 6,160 ( 0.00%) && let Res::Def(DefKind::Ctor(..), ctor_id) = path.res(cx) . && let Some(variant_id) = cx.tcx.opt_parent(ctor_id) 1,445 ( 0.00%) && let variant = if cx.tcx.lang_items().option_some_variant() == Some(variant_id) { 19,680 ( 0.00%) => ???:::lang_items (492x) . "Some" 910 ( 0.00%) } else if cx.tcx.lang_items().result_ok_variant() == Some(variant_id) { 16,200 ( 0.00%) => ???:::lang_items (405x) . "Ok" . } else { . return; . } 376 ( 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, . ); . }, . ); . } 9,058 ( 0.00%) } 12,533 ( 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 { 682 ( 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 492,378 ( 0.00%) if let ExprKind::Binary(kind, lhs, rhs) = expr.kind 14,308 ( 0.00%) && let ExprKind::Binary(lhs_kind, lhs_lhs, lhs_rhs) = lhs.kind 4,044 ( 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`. 2,508 ( 0.00%) && let mut exprs = [lhs_lhs, lhs_rhs, rhs_lhs, rhs_rhs] 2,155 ( 0.00%) && exprs.iter_mut().partition_in_place(|i| i.res_local_id().is_some()) == 2 1,960 ( 0.00%) && !expr.span.in_external_macro(cx.sess().source_map()) . && ( 372 ( 0.00%) is_not_const(cx.tcx, cx.tcx.hir_enclosing_body_owner(expr.hir_id).into()) 50,709 ( 0.00%) => ???:::hir_enclosing_body_owner (62x) . || self.msrv.meets(cx, msrvs::CONST_FLOAT_CLASSIFY) . ) 248 ( 0.00%) && let [first, second, const_1, const_2] = exprs 434 ( 0.00%) && let ecx = ConstEvalCtxt::new(cx) 3,472 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::new (62x) . && let ctxt = expr.span.ctxt() 380 ( 0.00%) && let Some(const_1) = ecx.eval_local(const_1, ctxt) 12,670 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval_local (62x) 106 ( 0.00%) && let Some(const_2) = ecx.eval_local(const_2, ctxt) 2,156 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval_local (14x) 12 ( 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, . ); . }, . } . }); 26 ( 0.00%) } 650 ( 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:: (26x) 1,937,824 ( 0.02%) } . } 3,610 ( 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 3 ---------------------------------------- . use super::Utf8Error; . use crate::intrinsics::const_eval_select; . . /// Returns the initial codepoint accumulator for the first byte. . /// The first byte is special, only want bottom 5 bits for width 2, 4 bits . /// for width 3, and 3 bits for width 4. . #[inline] . const fn utf8_first_byte(byte: u8, width: u32) -> u32 { 8 ( 0.00%) (byte & (0x7F >> width)) as u32 . } . . /// Returns the value of `ch` updated with continuation byte `byte`. . #[inline] . const fn utf8_acc_cont_byte(ch: u32, byte: u8) -> u32 { 226 ( 0.00%) (ch << 6) | (byte & CONT_MASK) as u32 . } . . /// Checks whether the byte is a UTF-8 continuation byte (i.e., starts with the . /// bits `10`). . #[inline] . pub(super) const fn utf8_is_cont_byte(byte: u8) -> bool { 70 ( 0.00%) (byte as i8) < -64 . } . . /// Reads the next code point out of a byte iterator (assuming a . /// UTF-8-like encoding). . /// . /// # 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 2,654,315 ( 0.02%) let x = *bytes.next()?; 5,903,427 ( 0.05%) 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, . // so the iterator must produce a value here. . let y = unsafe { *bytes.next().unwrap_unchecked() }; . let mut ch = utf8_acc_cont_byte(init, y); 8 ( 0.00%) if x >= 0xE0 { . // [[x y z] w] case . // 5th bit in 0xE0 .. 0xEF is always clear, so `init` is still valid . // SAFETY: `bytes` produces an UTF-8-like string, . // so the iterator must produce a value here. . let z = unsafe { *bytes.next().unwrap_unchecked() }; . let y_z = utf8_acc_cont_byte((y & CONT_MASK) as u32, z); . ch = init << 12 | y_z; 8 ( 0.00%) if x >= 0xF0 { . // [x y z w] case . // use only the lower 3 bits of `init` . // SAFETY: `bytes` produces an UTF-8-like string, . // so the iterator must produce a value here. . let w = unsafe { *bytes.next().unwrap_unchecked() }; . ch = (init & 7) << 18 | utf8_acc_cont_byte(y_z, w); . } . } . . Some(ch) 32 ( 0.00%) } . . /// Reads the last code point out of a byte iterator (assuming a . /// UTF-8-like encoding). . /// . /// # Safety . /// . /// `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()? { 781,151 ( 0.01%) 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. 35 ( 0.00%) let z = unsafe { *bytes.next_back().unwrap_unchecked() }; . ch = utf8_first_byte(z, 2); 35 ( 0.00%) if utf8_is_cont_byte(z) { . // SAFETY: `bytes` produces an UTF-8-like string, . // so the iterator must produce a value here. 35 ( 0.00%) let y = unsafe { *bytes.next_back().unwrap_unchecked() }; . ch = utf8_first_byte(y, 3); 35 ( 0.00%) if utf8_is_cont_byte(y) { . // SAFETY: `bytes` produces an UTF-8-like string, . // so the iterator must produce a value here. . let x = unsafe { *bytes.next_back().unwrap_unchecked() }; . ch = utf8_first_byte(x, 4); . ch = utf8_acc_cont_byte(ch, y); . } . ch = utf8_acc_cont_byte(ch, z); . } -- line 108 ---------------------------------------- -- line 271 ---------------------------------------- . 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, // F . ]; . . /// Given a first byte, determines how many bytes are in this UTF-8 character. . #[unstable(feature = "str_internals", issue = "none")] . #[must_use] . #[inline] . pub const fn utf8_char_width(b: u8) -> usize { 284 ( 0.00%) UTF8_CHAR_WIDTH[b as usize] as usize . } . . /// Mask of the value bits of a continuation byte. . const CONT_MASK: u8 = 0b0011_1111; 3,308,368 ( 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_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(()) . } . 435,354 ( 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 { 123,408 ( 0.00%) self.cstore_untracked().def_key(id) 3,044,634 ( 0.03%) => ???:::def_key (41,136x) . } 507,913 ( 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> { 107,812 ( 0.00%) self.interners.intern_ty(st) 606 ( 0.00%) => ???:::intern_ty (6x) . } . . 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 2420 ---------------------------------------- . T::collect_and_apply(iter, |xs| self.mk_predefined_opaques_in_body(xs)) . } . . pub fn mk_clauses_from_iter(self, iter: I) -> T::Output . where . I: Iterator, . T: CollectAndApply, Clauses<'tcx>>, . { 412 ( 0.00%) T::collect_and_apply(iter, |xs| self.mk_clauses(xs)) 4,524 ( 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::, clippy_lints::derive::derive_partial_eq_without_eq::typing_env_for_derived_eq::{closure#1}>, core::iter::adapters::map::Map, clippy_lints::derive::derive_partial_eq_without_eq::typing_env_for_derived_eq::{closure#2}>, clippy_lints::derive::derive_partial_eq_without_eq::typing_env_for_derived_eq::{closure#3}>>, ::mk_clauses_from_iter, clippy_lints::derive::derive_partial_eq_without_eq::typing_env_for_derived_eq::{closure#1}>, core::iter::adapters::map::Map, clippy_lints::derive::derive_partial_eq_without_eq::typing_env_for_derived_eq::{closure#2}>, clippy_lints::derive::derive_partial_eq_without_eq::typing_env_for_derived_eq::{closure#3}>>, rustc_middle::ty::predicate::Clause>::{closure#0}> (40x) . } . . pub fn mk_type_list_from_iter(self, iter: I) -> T::Output . where . I: Iterator, . T: CollectAndApply, &'tcx List>>, . { . 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>>, . { 10,062 ( 0.00%) T::collect_and_apply(iter, |xs| self.mk_args(xs)) 708 ( 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::>>, clippy_lints::useless_conversion::into_iter_bound::{closure#0}>, ::mk_args_from_iter>>, clippy_lints::useless_conversion::into_iter_bound::{closure#0}>, rustc_middle::ty::generic_args::GenericArg>::{closure#0}> (4x) . } . . 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 2493 ---------------------------------------- . >, . { . T::collect_and_apply(iter, |xs| self.mk_outlives(xs)) . } . . /// Emit a lint at `span` from a lint struct (some type that implements `Diagnostic`, . /// typically generated by `#[derive(Diagnostic)]`). . #[track_caller] 10,817 ( 0.00%) pub fn emit_node_span_lint( . self, . lint: &'static Lint, . hir_id: HirId, . span: impl Into, . decorator: impl for<'a> Diagnostic<'a, ()>, . ) { 18,542 ( 0.00%) let level_spec = self.lint_level_spec_at_node(lint, hir_id); 19,292 ( 0.00%) => ???:::lint_level_spec_at_node (9x) 59,362 ( 0.00%) emit_lint_base(self.sess, lint, level_spec, Some(span.into()), decorator) 238,996,337 ( 1.98%) => /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}>, rustc_middle::lint::LevelSpec> (879x) 5,766 ( 0.00%) } . . /// 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 2518 ---------------------------------------- -- 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 { 5,386 ( 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 ---------------------------------------- 287,170 ( 0.00%) -------------------------------------------------------------------------------- -- 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, . ) { 16,300 ( 0.00%) if let FnRetTy::Return(hir_ty) = decl.output 77 ( 0.00%) && is_unit_ty(hir_ty) 4 ( 0.00%) && !hir_ty.span.from_expansion() 10 ( 0.00%) && 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 . // . // There could be more reasons to have it, and, in general, we shouldn't discourage the users from . // writing more type annotations than strictly necessary, because it can help readability and . // maintainability 4 ( 0.00%) if let FnKind::Closure = kind { . return; . } . . // unit never type fallback is no longer supported since Rust 2024. For more information, . // see 6 ( 0.00%) if cx.tcx.sess.edition() >= Edition::Edition2024 . && let ExprKind::Block(block, _) = body.value.kind . && let Some(expr) = block.expr . && is_never_expr(cx, expr).is_some() . { . return; . } . 10 ( 0.00%) lint_unneeded_unit_return(cx, hir_ty.span, span); 368,004 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unused_unit.rs:clippy_lints::unused_unit::lint_unneeded_unit_return (2x) . } 5,716 ( 0.00%) } . . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 1,222,504 ( 0.01%) if let ExprKind::Ret(Some(expr)) | ExprKind::Break(_, Some(expr)) = expr.kind 2 ( 0.00%) && is_unit_expr(expr) . && !expr.span.from_expansion() . { . span_lint_and_sugg( . cx, . UNUSED_UNIT, . expr.span, . "unneeded `()`", . "remove the `()`", . String::new(), . Applicability::MachineApplicable, . ); . } 242,228 ( 0.00%) } . 10,656 ( 0.00%) fn check_poly_trait_ref(&mut self, cx: &LateContext<'tcx>, poly: &'tcx PolyTraitRef<'tcx>) { 6,911 ( 0.00%) if let [segment] = &poly.trait_ref.path.segments 6,332 ( 0.00%) && matches!(segment.ident.name, sym::Fn | sym::FnMut | sym::FnOnce) 48 ( 0.00%) && let Some(args) = segment.args 16 ( 0.00%) && args.parenthesized == GenericArgsParentheses::ParenSugar 48 ( 0.00%) && let [constraint] = &args.constraints 16 ( 0.00%) && constraint.ident.name == sym::Output 80 ( 0.00%) && let AssocItemConstraintKind::Equality { term: Term::Ty(hir_ty) } = constraint.kind 48 ( 0.00%) && args.span_ext.hi() != poly.span.hi() 28 ( 0.00%) && !hir_ty.span.from_expansion() 42 ( 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); . } 12,432 ( 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. 72,844 ( 0.00%) fn check_block(&mut self, cx: &EarlyContext<'_>, block: &Block) { . if let Some(stmt) = block.stmts.last() 35,428 ( 0.00%) && let StmtKind::Expr(expr) = &stmt.kind 35,454 ( 0.00%) && let rustc_ast::ExprKind::Tup(inner) = &expr.kind 89 ( 0.00%) && inner.is_empty() 2 ( 0.00%) && let ctxt = block.span.ctxt() 4 ( 0.00%) && stmt.span.ctxt() == ctxt 6 ( 0.00%) && expr.span.ctxt() == ctxt 4 ( 0.00%) && expr.attrs.is_empty() . { 2 ( 0.00%) let sp = expr.span; 28 ( 0.00%) span_lint_and_sugg( 1,079,212 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_sugg:: (2x) . cx, . UNUSED_UNIT, . sp, . "unneeded unit expression", . "remove the final `()`", . String::new(), . Applicability::MachineApplicable, . ); . } 91,055 ( 0.00%) } . } . . fn is_unit_ty(ty: &Ty<'_>) -> bool { 9,837 ( 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 { . None . } . } . 26 ( 0.00%) fn lint_unneeded_unit_return(cx: &LateContext<'_>, ty_span: Span, span: Span) { . let (ret_span, appl) = 12 ( 0.00%) if let Some(Some(rpos)) = span.with_hi(ty_span.hi()).with_source_text(cx, position_before_rarrow) { 6,182 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/source.rs:::with_source_text::, &rustc_lint::context::LateContext, clippy_utils::source::position_before_rarrow> (2x) . ( . ty_span.with_lo(span.lo() + BytePos::from_usize(rpos)), . Applicability::MachineApplicable, . ) . } else { . (ty_span, Applicability::MaybeIncorrect) . }; . 30 ( 0.00%) span_lint_and_sugg( 361,197 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_sugg:: (2x) . cx, . UNUSED_UNIT, . ret_span, . "unneeded unit return type", . "remove the `-> ()`", . String::new(), . appl, . ); 14 ( 0.00%) } 91,860 ( 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/bool.rs -------------------------------------------------------------------------------- Ir -- line 29 ---------------------------------------- . /// // `a` is incremented twice because the value passed to `then_some` is . /// // evaluated eagerly. . /// assert_eq!(a, 2); . /// ``` . #[stable(feature = "bool_to_option", since = "1.62.0")] . #[rustc_const_unstable(feature = "const_bool", issue = "151531")] . #[inline] . pub const fn then_some(self, t: T) -> Option { 45,423 ( 0.00%) if self { Some(t) } else { None } . } . . /// Returns `Some(f())` if the `bool` is [`true`](../std/keyword.true.html), . /// or `None` otherwise. . /// . /// # Examples . /// . /// ``` -- line 45 ---------------------------------------- -- line 58 ---------------------------------------- . /// assert_eq!(a, 1); . /// ``` . #[doc(alias = "then_with")] . #[stable(feature = "lazy_bool_to_option", since = "1.50.0")] . #[rustc_diagnostic_item = "bool_then"] . #[rustc_const_unstable(feature = "const_bool", issue = "151531")] . #[inline] . pub const fn then T + [const] Destruct>(self, f: F) -> Option { 88,169 ( 0.00%) if self { Some(f()) } else { None } . } . . /// Returns `Ok(())` if the `bool` is [`true`](../std/keyword.true.html), . /// or `Err(err)` otherwise. . /// . /// Arguments passed to `ok_or` are eagerly evaluated; if you are . /// passing the result of a function call, it is recommended to use . /// [`ok_or_else`], which is lazily evaluated. -- line 74 ---------------------------------------- 83,305 ( 0.00%) -------------------------------------------------------------------------------- -- 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 { 2,180,052 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 5,433 ( 0.00%) let Some(macro_call) = root_macro_call_first_node(cx, expr) else { . return; . }; 9,057 ( 0.00%) let Some(VecArgs::Repeat(elem, len)) = VecArgs::hir(cx, expr) else { 97,622 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (1,811x) . return; . }; . let Some((symbol, func_span)) = ref_init(cx, elem) else { . return; . }; . . emit_lint(cx, symbol, macro_call.span, elem, len, func_span); 1,937,824 ( 0.02%) } . } . . 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 ---------------------------------------- -- line 114 ---------------------------------------- . Applicability::HasPlaceholders, . ); . }, . ); . } . . /// Checks whether the given `expr` is a call to `Arc::new`, `Rc::new`, or evaluates to a `Weak` . fn ref_init(cx: &LateContext<'_>, expr: &Expr<'_>) -> Option<(Symbol, Span)> { 4 ( 0.00%) if let ExprKind::Call(func, _args) = expr.kind . && let ExprKind::Path(ref func_path @ QPath::TypeRelative(ty, _)) = func.kind . && let TyKind::Path(ref ty_path) = ty.kind . && let Some(def_id) = cx.qpath_res(ty_path, ty.hir_id).opt_def_id() . { . if last_path_segment(func_path).ident.name == sym::new . && let Some(symbol) = cx . .tcx . .get_diagnostic_name(def_id) -- line 130 ---------------------------------------- 1,811 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/types/owned_cow.rs -------------------------------------------------------------------------------- Ir -- line 3 ---------------------------------------- . use clippy_utils::source::snippet_opt; . use clippy_utils::sym; . use rustc_errors::Applicability; . use rustc_hir as hir; . use rustc_hir::def_id::DefId; . use rustc_lint::LateContext; . use rustc_span::Span; . 75,357 ( 0.00%) pub(super) fn check(cx: &LateContext<'_>, qpath: &hir::QPath<'_>, def_id: DefId) -> bool { 66,984 ( 0.00%) if cx.tcx.is_diagnostic_item(sym::Cow, def_id) 469,762 ( 0.00%) => ???:::is_diagnostic_item (8,373x) . && let hir::QPath::Resolved(_, path) = qpath . && let [.., last_seg] = path.segments . && let Some(args) = last_seg.args . && let [_lt, carg] = args.args . && let hir::GenericArg::Type(cty) = carg . && let Some((span, repl)) = replacement(cx, cty.as_unambig_ty()) . { . span_lint_and_sugg( -- line 20 ---------------------------------------- -- line 24 ---------------------------------------- . "needlessly owned Cow type", . "use", . repl, . Applicability::Unspecified, . ); . return true; . } . false 66,984 ( 0.00%) } . . fn replacement(cx: &LateContext<'_>, cty: &hir::Ty<'_>) -> Option<(Span, String)> { . if cty.basic_res().is_lang_item(cx, hir::LangItem::String) { . return Some((cty.span, "str".into())); . } . if cty.basic_res().is_diag_item(cx, sym::Vec) { . return if let hir::TyKind::Path(hir::QPath::Resolved(_, path)) = cty.kind . && let [.., last_seg] = path.segments -- line 40 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 551,190 ( 0.00%) if let ExprKind::Call(path_expr, [arg]) = e.kind 66,762 ( 0.00%) && let ExprKind::Path(QPath::Resolved(None, path)) = path_expr.kind . && let Some(def_id) = path.res.opt_def_id() 49,616 ( 0.00%) && cx.tcx.is_diagnostic_item(sym::transmute, def_id) 659,818 ( 0.01%) => ???:::is_diagnostic_item (7,088x) . { . // 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); . } . } 1,937,824 ( 0.02%) } . } 14,176 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_utils/src/str_utils.rs -------------------------------------------------------------------------------- Ir -- line 63 ---------------------------------------- . /// assert_eq!(camel_case_start("AbcDef"), StrIndex::new(0, 0)); . /// assert_eq!(camel_case_start("abcDef"), StrIndex::new(3, 3)); . /// assert_eq!(camel_case_start("ABCD"), StrIndex::new(4, 4)); . /// assert_eq!(camel_case_start("abcd"), StrIndex::new(4, 4)); . /// assert_eq!(camel_case_start("\u{f6}\u{f6}cd"), StrIndex::new(4, 6)); . /// ``` . #[must_use] . pub fn camel_case_start(s: &str) -> StrIndex { 256 ( 0.00%) camel_case_start_from_idx(s, 0) 19,430 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/str_utils.rs:clippy_utils::str_utils::camel_case_start_from_idx (64x) . } . . /// Returns `StrIndex` of the last camel-case component of `s[idx..]`. . /// . /// ```no_run . /// # use clippy_utils::str_utils::{camel_case_start_from_idx, StrIndex}; . /// assert_eq!(camel_case_start_from_idx("AbcDef", 0), StrIndex::new(0, 0)); . /// assert_eq!(camel_case_start_from_idx("AbcDef", 1), StrIndex::new(3, 3)); . /// assert_eq!(camel_case_start_from_idx("AbcDefGhi", 0), StrIndex::new(0, 0)); . /// assert_eq!(camel_case_start_from_idx("AbcDefGhi", 1), StrIndex::new(3, 3)); . /// assert_eq!(camel_case_start_from_idx("Abcdefg", 1), StrIndex::new(7, 7)); . /// ``` 1,890 ( 0.00%) pub fn camel_case_start_from_idx(s: &str, start_idx: usize) -> StrIndex { . let char_count = s.chars().count(); . let range = 0..char_count; . let mut iter = range.rev().zip(s.char_indices().rev()); . if let Some((_, (_, first))) = iter.next() { . if !first.is_lowercase() { . return StrIndex::new(char_count, s.len()); . } . } else { . return StrIndex::new(char_count, s.len()); . } . . let mut down = true; . let mut last_index = StrIndex::new(char_count, s.len()); . for (char_index, (byte_index, c)) in iter { 3,419 ( 0.00%) if byte_index < start_idx { . break; . } 3,044 ( 0.00%) if down { . if c.is_uppercase() { . down = false; . last_index.byte_index = byte_index; . last_index.char_index = char_index; . } else if !c.is_lowercase() { . return last_index; . } . } else if c.is_lowercase() { -- line 110 ---------------------------------------- -- line 113 ---------------------------------------- . last_index.byte_index = byte_index; . last_index.char_index = char_index; . } else { . return last_index; . } . } . . last_index 1,512 ( 0.00%) } . . /// Get the indexes of camel case components of a string `s` . /// . /// ```no_run . /// # use clippy_utils::str_utils::{camel_case_indices, StrIndex}; . /// assert_eq!( . /// camel_case_indices("AbcDef"), . /// vec![StrIndex::new(0, 0), StrIndex::new(3, 3), StrIndex::new(6, 6)] . /// ); . /// assert_eq!( . /// camel_case_indices("abcDef"), . /// vec![StrIndex::new(3, 3), StrIndex::new(6, 6)] . /// ); . /// ``` 640 ( 0.00%) pub fn camel_case_indices(s: &str) -> Vec { . let mut result = Vec::new(); . let mut str_idx = camel_case_start(s); . 378 ( 0.00%) while str_idx.byte_index < s.len() { 125 ( 0.00%) let next_idx = str_idx.byte_index + 1; . result.push(str_idx); 750 ( 0.00%) str_idx = camel_case_start_from_idx(s, next_idx); 39,212 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/str_utils.rs:clippy_utils::str_utils::camel_case_start_from_idx (125x) . } . result.push(str_idx); . 192 ( 0.00%) result 512 ( 0.00%) } . . /// Split camel case string into a vector of its components . /// . /// ```no_run . /// # use clippy_utils::str_utils::{camel_case_split, StrIndex}; . /// assert_eq!(camel_case_split("AbcDef"), vec!["Abc", "Def"]); . /// ``` 704 ( 0.00%) pub fn camel_case_split(s: &str) -> Vec<&str> { 64 ( 0.00%) let mut offsets = camel_case_indices(s) 74,441 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/str_utils.rs:clippy_utils::str_utils::camel_case_indices (64x) . .iter() . .map(|e| e.byte_index) . .collect::>(); 128 ( 0.00%) if offsets[0] != 0 { . offsets.insert(0, 0); . } . 324 ( 0.00%) offsets.windows(2).map(|w| &s[w[0]..w[1]]).collect() 576 ( 0.00%) } . . /// Dealing with string comparison can be complicated, this struct ensures that both the . /// character and byte count are provided for correct indexing. . #[derive(Debug, Default, PartialEq, Eq)] . pub struct StrCount { . pub char_count: usize, . pub byte_count: usize, . } -- line 174 ---------------------------------------- -- line 184 ---------------------------------------- . /// ```no_run . /// # use clippy_utils::str_utils::{count_match_start, StrCount}; . /// assert_eq!(count_match_start("hello_mouse", "hello_penguin"), StrCount::new(6, 6)); . /// assert_eq!(count_match_start("hello_clippy", "bye_bugs"), StrCount::new(0, 0)); . /// assert_eq!(count_match_start("hello_world", "hello_world"), StrCount::new(11, 11)); . /// assert_eq!(count_match_start("T\u{f6}ffT\u{f6}ff", "T\u{f6}ff"), StrCount::new(4, 5)); . /// ``` . #[must_use] 1,408 ( 0.00%) pub fn count_match_start(str1: &str, str2: &str) -> StrCount { . // (char_index, char1) . let char_count = str1.chars().count(); . let iter1 = (0..=char_count).zip(str1.chars()); . // (byte_index, char2) . let iter2 = str2.char_indices(); . . iter1 . .zip(iter2) . .take_while(|((_, c1), (_, c2))| c1 == c2) . .last() . .map_or_else(StrCount::default, |((char_index, _), (byte_index, character))| { 54 ( 0.00%) StrCount::new(char_index + 1, byte_index + character.len_utf8()) . }) 1,152 ( 0.00%) } . . /// Returns the number of chars and bytes that match from the end . /// . /// ```no_run . /// # use clippy_utils::str_utils::{count_match_end, StrCount}; . /// assert_eq!(count_match_end("hello_cat", "bye_cat"), StrCount::new(4, 4)); . /// assert_eq!(count_match_end("if_item_thing", "enum_value"), StrCount::new(0, 0)); . /// assert_eq!(count_match_end("Clippy", "Clippy"), StrCount::new(6, 6)); . /// assert_eq!(count_match_end("MyT\u{f6}ff", "YourT\u{f6}ff"), StrCount::new(4, 5)); . /// ``` . #[must_use] 1,408 ( 0.00%) pub fn count_match_end(str1: &str, str2: &str) -> StrCount { . let char_count = str1.chars().count(); 256 ( 0.00%) if char_count == 0 { . return StrCount::default(); . } . . // (char_index, char1) . let iter1 = (0..char_count).rev().zip(str1.chars().rev()); . // (byte_index, char2) . let byte_count = str2.len(); . let iter2 = str2.char_indices().rev(); -- line 228 ---------------------------------------- -- line 229 ---------------------------------------- . . iter1 . .zip(iter2) . .take_while(|((_, c1), (_, c2))| c1 == c2) . .last() . .map_or_else(StrCount::default, |((char_index, _), (byte_index, _))| { . StrCount::new(char_count - char_index, byte_count - byte_index) . }) 1,152 ( 0.00%) } . . /// Returns a `snake_case` version of the input . /// ```no_run . /// use clippy_utils::str_utils::to_snake_case; . /// assert_eq!(to_snake_case("AbcDef"), "abc_def"); . /// assert_eq!(to_snake_case("ABCD"), "a_b_c_d"); . /// assert_eq!(to_snake_case("AbcDD"), "abc_d_d"); . /// assert_eq!(to_snake_case("Abc1DD"), "abc1_d_d"); . /// ``` 680 ( 0.00%) pub fn to_snake_case(name: &str) -> String { . let mut s = String::new(); . for (i, c) in name.chars().enumerate() { . if c.is_uppercase() { . // characters without capitalization are considered lowercase 380 ( 0.00%) if i != 0 { . s.push('_'); . } . s.extend(c.to_lowercase()); . } else { . s.push(c); . } . } 595 ( 0.00%) s 680 ( 0.00%) } . /// Returns a `CamelCase` version of the input . /// ```no_run . /// use clippy_utils::str_utils::to_camel_case; . /// assert_eq!(to_camel_case("abc_def"), "AbcDef"); . /// assert_eq!(to_camel_case("a_b_c_d"), "ABCD"); . /// assert_eq!(to_camel_case("abc_d_d"), "AbcDD"); . /// assert_eq!(to_camel_case("abc1_d_d"), "Abc1DD"); . /// ``` 30,843 ( 0.00%) pub fn to_camel_case(item_name: &str) -> String { . let mut s = String::new(); . let mut up = true; . for c in item_name.chars() { . if c.is_uppercase() { . // we only turn snake case text into CamelCase . return item_name.to_string(); . } 88,201 ( 0.00%) if c == '_' { . up = true; . continue; . } 54,186 ( 0.00%) if up { . up = false; . s.extend(c.to_uppercase()); . } else { . s.push(c); . } . } 9,594 ( 0.00%) s 30,843 ( 0.00%) } . . #[cfg(test)] . mod test { . use super::*; . . #[test] . fn camel_case_start_full() { . assert_eq!(camel_case_start("AbcDef"), StrIndex::new(0, 0)); -- line 298 ---------------------------------------- 2,497 ( 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/index_range.rs -------------------------------------------------------------------------------- Ir -- line 44 ---------------------------------------- . pub(crate) const fn end(&self) -> usize { . self.end . } . . #[inline] . pub(crate) const fn len(&self) -> usize { . // SAFETY: By invariant, this cannot wrap . // Using the intrinsic because a UB check here impedes LLVM optimization. (#131563) 2,633 ( 0.00%) unsafe { crate::intrinsics::unchecked_sub(self.end, self.start) } . } . . /// # Safety . /// - Can only be called when `start < end`, aka when `len > 0`. . #[inline] . const unsafe fn next_unchecked(&mut self) -> usize { . debug_assert!(self.start < self.end); . . let value = self.start; . // SAFETY: The range isn't empty, so this cannot overflow 28,026 ( 0.00%) self.start = unsafe { value.unchecked_add(1) }; . value . } . . /// # Safety . /// - Can only be called when `start < end`, aka when `len > 0`. . #[inline] . const unsafe fn next_back_unchecked(&mut self) -> usize { . debug_assert!(self.start < self.end); -- line 71 ---------------------------------------- -- line 114 ---------------------------------------- . let suffix = Self { start: mid, end: self.end }; . self.end = mid; . suffix . } . . #[inline] . const fn assume_range(&self) { . // SAFETY: This is the type invariant 10,582 ( 0.00%) unsafe { crate::hint::assert_unchecked(self.start <= self.end) } . } . } . . impl Iterator for IndexRange { . type Item = usize; . . #[inline] . fn next(&mut self) -> Option { 65,861 ( 0.00%) if self.len() > 0 { . // SAFETY: We just checked that the range is non-empty . unsafe { Some(self.next_unchecked()) } . } else { . None . } . } . . #[inline] -- line 139 ---------------------------------------- -- line 159 ---------------------------------------- . Self: Sized, . F: FnMut(B, Self::Item) -> R, . R: Try, . { . // `Range` needs to check `start < end`, but thanks to our type invariant . // we can loop on the stricter `start != end`. . . self.assume_range(); 25,105 ( 0.00%) while self.start != self.end { . // SAFETY: We just checked that the range is non-empty . let i = unsafe { self.next_unchecked() }; . accum = f(accum, i)?; . } . try { accum } . } . } . -- line 175 ---------------------------------------- 31,739 ( 0.00%) -------------------------------------------------------------------------------- -- 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); 101 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_no_std_crate (1x) . } . 968,912 ( 0.01%) fn check_expr_post(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 484,456 ( 0.00%) if self.has_no_std_attr { . return; . } . . if let ExprKind::Call(func, []) = &expr.kind . && let ExprKind::Path(QPath::Resolved(_, path)) = &func.kind . && let Some(def_id) = path.res.opt_def_id() . && is_entrypoint_fn(cx, def_id) . { -- line 49 ---------------------------------------- -- line 51 ---------------------------------------- . cx, . MAIN_RECURSION, . func.span, . format!("recursing into entrypoint `{}`", snippet(cx, func.span, "main")), . None, . "consider using another function for this recursion", . ); . } 1,211,140 ( 0.01%) } . } -------------------------------------------------------------------------------- -- 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), 38,426 ( 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> { 2,180,052 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 484,456 ( 0.00%) if expr.span.from_expansion() { . return; . } 840,675 ( 0.01%) if matches!(expr.kind, ExprKind::If(..)) && !is_else_clause(cx.tcx, expr) { 801,778 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_else_clause (4,600x) 40,914 ( 0.00%) let (conds, blocks) = if_sequence(expr); 1,009,724 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::if_sequence (4,546x) 27,276 ( 0.00%) ifs_same_cond::check(cx, &conds, &mut self.interior_mut); 451,415 ( 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 (4,546x) 18,184 ( 0.00%) same_functions_in_if_cond::check(cx, &conds); 507,960 ( 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 (4,546x) . let all_same = 59,098 ( 0.00%) !is_lint_allowed(cx, IF_SAME_THEN_ELSE, expr.hir_id) && if_same_then_else::check(cx, &conds, &blocks); 14,522,162 ( 0.12%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_lint_allowed (4,546x) 673,306 ( 0.01%) => /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 (4,546x) 9,868 ( 0.00%) if !all_same && conds.len() != blocks.len() { 2,695 ( 0.00%) branches_sharing_code::check(cx, &conds, &blocks, expr); 11,340,542 ( 0.09%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/ifs/branches_sharing_code.rs:clippy_lints::ifs::branches_sharing_code::check (385x) . } 3,178 ( 0.00%) } else if let ExprKind::Match(_, arms, _) = expr.kind { 17,479 ( 0.00%) branches_sharing_code::check_match(cx, expr, arms); 1,981,465 ( 0.02%) => /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 (1,589x) . } 1,888,744 ( 0.02%) } . } 13,638 ( 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 { 1,937,824 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 562,663 ( 0.00%) if !expr.span.from_expansion() 37,838 ( 0.00%) && let ExprKind::Call(func, [recv]) = expr.kind 12,797 ( 0.00%) && let ExprKind::Path(path) = &func.kind 21,325 ( 0.00%) && let Some(did) = cx.qpath_res(path, func.hir_id).opt_def_id() 168,651 ( 0.00%) => ???:::qpath_res (4,265x) 20,955 ( 0.00%) && match_libc_symbol(cx, did, sym::strlen) 314,325 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::match_libc_symbol (4,191x) . && 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); . }, . ); . } 1,937,824 ( 0.02%) } . } 341,705 ( 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 { 1,937,824 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 995,856 ( 0.01%) let (id, span) = match &expr.kind { 965,887 ( 0.01%) ExprKind::Path(path) if let Res::Def(_, id) = cx.qpath_res(path, expr.hir_id) => (id, expr.span), 3,195,985 ( 0.03%) => ???:::qpath_res (107,642x) . 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. 45,788 ( 0.00%) if let Some(parent_ty) = cx.typeck_results().expr_ty_adjusted_opt(e) 677,625 ( 0.01%) => ???:::expr_ty_adjusted_opt (11,447x) 57,235 ( 0.00%) && let Some(field_def_id) = get_field_def_id_by_name(parent_ty, ident.name) 222,218 ( 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 (11,447x) . { 5,149 ( 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), . ); . } 1,453,368 ( 0.01%) } . 467,376 ( 0.00%) fn check_pat(&mut self, cx: &LateContext<'tcx>, pat: &'tcx Pat<'_>) { 134,852 ( 0.00%) let PatKind::Struct(struct_path, pat_fields, _) = pat.kind else { . return; . }; 76,447 ( 0.00%) match cx.typeck_results().qpath_res(&struct_path, pat.hir_id) { 86,726 ( 0.00%) => ???:::qpath_res (4,502x) 58 ( 0.00%) Res::Def(DefKind::Struct, struct_def_id) => { 29 ( 0.00%) 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 . } . }) && let Some(&(path, disallowed_path)) = self.disallowed.get(&def_id) -- line 122 ---------------------------------------- -- line 126 ---------------------------------------- . DISALLOWED_FIELDS, . field.span, . format!("use of a disallowed field `{path}`"), . disallowed_path.diag_amendment(field.span), . ); . } . } . }, 8,946 ( 0.00%) Res::Def(DefKind::Variant, variant_def_id) => { 13,419 ( 0.00%) let enum_def_id = cx.tcx.parent(variant_def_id); 17,892 ( 0.00%) let variant = cx.tcx.adt_def(enum_def_id).variant_with_id(variant_def_id); 381,551 ( 0.00%) => ???:::variant_with_id (4,473x) . . 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), . ); . } . } . }, . _ => {}, . } 467,376 ( 0.00%) } . } 18,076 ( 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 142 ---------------------------------------- . } . . /// 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>, . { 1,480 ( 0.00%) if let SearchStep::Match(start, end) = self.into_searcher(haystack).next_back() { . debug_assert_eq!( . end, . haystack.len(), . "The first search step from ReverseSearcher \ . must include the last character" . ); . // SAFETY: `Searcher` is known to return valid indices. . unsafe { Some(haystack.get_unchecked(..start)) } -- line 158 ---------------------------------------- -- 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 { 218 ( 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)> { 32,739 ( 0.00%) loop { 6,685 ( 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 { 111,384 ( 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(); 6,549 ( 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` 17,216 ( 0.00%) let last_byte = unsafe { *self.utf8_encoded.get_unchecked(self.utf8_size() - 1) }; 177,172 ( 0.00%) 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. 135,760 ( 0.00%) self.finger += index + 1; 333,649 ( 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) { 132,669 ( 0.00%) if slice == &self.utf8_encoded[0..self.utf8_size()] { . return Some((found_char, self.finger)); . } . } . } . } else { . // found nothing, exit 2,623 ( 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) }; 33,096 ( 0.00%) if let Some(index) = memchr::memrchr(last_byte, bytes) { 280,374 ( 0.00%) => ???:core::slice::memchr::memrchr (5,516x) . // we searched a slice that was offset by self.finger, . // add self.finger to recoup the original index 33 ( 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; 132 ( 0.00%) if index >= shift { . let found_char = index - shift; 99 ( 0.00%) if let Some(slice) = haystack.get(found_char..(found_char + self.utf8_size())) { 33 ( 0.00%) if slice == &self.utf8_encoded[0..self.utf8_size()] { . // move finger to before the character found (i.e., at its start index) 33 ( 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 { 5,483 ( 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) . } 439 ( 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; 39,418 ( 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> { 941,198 ( 0.01%) StrSearcher::new(haystack, self) 7,062 ( 0.00%) => ???:::new (33x) . } . . /// 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] 880 ( 0.00%) fn is_contained_in(self, haystack: &str) -> bool { . if self.len() == 0 { . return true; . } . 222 ( 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, . } 704 ( 0.00%) } . . /// Removes the pattern from the front of haystack, if it matches. . #[inline] . fn strip_prefix_of(self, haystack: &str) -> Option<&str> { 31,509 ( 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>, . { 69,854 ( 0.00%) if self.is_suffix_of(haystack) { 1,512 ( 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] 942,589 ( 0.01%) fn next_match(&mut self) -> Option<(usize, usize)> { 269,320 ( 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) => { 269,321 ( 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. 134,661 ( 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, . ) . } . } . } 1,077,160 ( 0.01%) } . } . . 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 1245 ---------------------------------------- . otherwise => otherwise, . } . } . } . } . . #[inline] . fn next_match_back(&mut self) -> Option<(usize, usize)> { 4 ( 0.00%) match self.searcher { . StrSearcherImpl::Empty(..) => loop { . match self.next_back() { . SearchStep::Match(a, b) => return Some((a, b)), . SearchStep::Done => return None, . SearchStep::Reject(..) => {} . } . }, . StrSearcherImpl::TwoWay(ref mut searcher) => { 2 ( 0.00%) let is_long = searcher.memory == usize::MAX; . // write out `true` and `false`, like `next_match` 2 ( 0.00%) if is_long { . searcher.next_back::( . self.haystack.as_bytes(), . self.needle.as_bytes(), . true, . ) . } else { . searcher.next_back::( . self.haystack.as_bytes(), -- line 1272 ---------------------------------------- -- 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 { 4,944,459 ( 0.04%) (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; 134,660 ( 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. 2,045,170 ( 0.02%) let tail_byte = match haystack.get(self.position + needle_last) { . Some(&b) => b, . None => { 126,002 ( 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 3,024,931 ( 0.03%) if !self.byteset_contains(tail_byte) { 2,603,284 ( 0.02%) 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. 521,928 ( 0.00%) if needle[i] != unsafe { *haystack.get_unchecked(self.position + i) } { 79,539 ( 0.00%) self.position += i - self.crit_pos + 1; 202,358 ( 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. 5,877 ( 0.00%) if needle[i] != unsafe { *haystack.get_unchecked(self.position + i) } { 894 ( 0.00%) self.position += self.period; 59,062 ( 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 17,318 ( 0.00%) self.position += needle.len(); . if !long_period { 8,203 ( 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 1575 ---------------------------------------- . } . }; . . if S::use_early_reject() && old_end != self.end { . return S::rejecting(self.end, old_end); . } . . // Quickly skip by large portions unrelated to our substring 24 ( 0.00%) if !self.byteset_contains(front_byte) { . self.end -= needle.len(); . if !long_period { . self.memory_back = needle.len(); . } . continue 'search; . } . . // See if the left part of the needle matches -- line 1591 ---------------------------------------- -- line 1597 ---------------------------------------- . for i in (0..crit).rev() { . // SAFETY: On every iteration of `'search`, `haystack.get(self.end.wrapping_sub(needle.len()))` . // returned `Some`, so `self.end >= needle.len()` and `self.end - needle.len() < haystack.len()`. . // Since `self.end <= haystack.len()` and `i < needle.len()`, we have . // `self.end - needle.len() + i < self.end <= haystack.len()`, so . // `haystack.get_unchecked(self.end - needle.len() + i)` is safe. . // - The path that mutates `self.end` either re-enters `'search`, which re-runs the checks . // before reaching this loop again, or returns on match, so the invariant holds. 30 ( 0.00%) if needle[i] != unsafe { *haystack.get_unchecked(self.end - needle.len() + i) } { . self.end -= self.crit_pos_back - i; . if !long_period { . self.memory_back = needle.len(); . } . continue 'search; . } . } . -- line 1613 ---------------------------------------- -- line 1614 ---------------------------------------- . // See if the right part of the needle matches . let needle_end = if long_period { needle.len() } else { self.memory_back }; . for i in self.crit_pos_back..needle_end { . // SAFETY: The same `self.end - needle.len() + i < haystack.len()` argument as the . // left-part loop applies: the `haystack.get(self.end.wrapping_sub(needle.len()))` . // check at the top of `'search` established the bound for this iteration, and . // every mutation of `self.end` is followed by `continue 'search` (which re-runs . // the check) or a `return` (which exits before any further unsafe access). 10 ( 0.00%) if needle[i] != unsafe { *haystack.get_unchecked(self.end - needle.len() + i) } { . self.end -= self.period; . if !long_period { . self.memory_back = self.period; . } . continue 'search; . } . } . -- line 1630 ---------------------------------------- -- line 1759 ---------------------------------------- . false . } . #[inline] . fn rejecting(_a: usize, _b: usize) -> Self::Output { . None . } . #[inline] . fn matching(a: usize, b: usize) -> Self::Output { 34,125 ( 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}; . 76 ( 0.00%) let first_probe = needle[0]; 76 ( 0.00%) let last_byte_offset = needle.len() - 1; . . // the offset used for the 2nd vector 152 ( 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) = 228 ( 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 228 ( 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] 230 ( 0.00%) |idx, mask: u16, skip: bool| -> bool { . if skip { . return false; . } . . // and so is this. optimizations are weird. . let mut mask = mask; . . while mask != 0 { -- line 1867 ---------------------------------------- -- 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; 906 ( 0.00%) while i + last_byte_offset + UNROLL * Block::LEN < haystack.len() && !result { . let mut masks = [0u16; UNROLL]; . for j in 0..UNROLL { 142 ( 0.00%) masks[j] = test_chunk(i + j * Block::LEN); . } . for j in 0..UNROLL { . let mask = masks[j]; 1,304 ( 0.00%) if mask != 0 { . result |= check_mask(i + j * Block::LEN, mask, result); . } . } 142 ( 0.00%) i += UNROLL * Block::LEN; . } 539 ( 0.00%) while i + last_byte_offset + Block::LEN < haystack.len() && !result { . let mask = test_chunk(i); 247 ( 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. 46 ( 0.00%) let i = haystack.len() - last_byte_offset - Block::LEN; . let mask = test_chunk(i); 92 ( 0.00%) if mask != 0 { . result |= check_mask(i, mask, result); . } . . Some(result) . } . . /// Compares short slices for equality. . /// -- line 1939 ---------------------------------------- 7,749,383 ( 0.06%) -------------------------------------------------------------------------------- -- 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(')') . } . 2,772 ( 0.00%) fn check_for_parens(cx: &LateContext<'_>, e: &Expr<'_>, is_start: bool) { 462 ( 0.00%) if is_start . && let ExprKind::Lit(literal) = e.kind 160 ( 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; . } 739 ( 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 1,323 ( 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); . }, . ); . } 1,848 ( 0.00%) } . . impl<'tcx> LateLintPass<'tcx> for NeedlessParensOnRangeLiterals { . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 1,211,504 ( 0.01%) if let Some(higher::Range { start, end, .. }) = higher::Range::hir(cx, expr) { 11,260,262 ( 0.09%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (242,228x) 364 ( 0.00%) if let Some(start) = start { 345 ( 0.00%) check_for_parens(cx, start, true); 17,680 ( 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 (115x) . } 364 ( 0.00%) if let Some(end) = end { 464 ( 0.00%) check_for_parens(cx, end, false); 15,590 ( 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 (116x) . } . } . } . } 1,269 ( 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 { 823,689 ( 0.01%) 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 { 4,850 ( 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 { 41,939 ( 0.00%) move |acc, elt| g(acc, f(elt)) 10,419 ( 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 core::iter::traits::iterator::Iterator::find_map::check<&rustc_middle::ty::assoc::AssocItem, rustc_span::def_id::DefId, clippy_lints::methods::or_fun_call::check_unwrap_or_default::{closure#2}::{closure#1}>::{closure#0} as core::ops::function::FnMut<((), &rustc_middle::ty::assoc::AssocItem)>>::call_mut (11x) . } . . #[stable(feature = "rust1", since = "1.0.0")] . impl Iterator for Map . where . F: FnMut(I::Item) -> B, . { . type Item = B; . . #[inline] 6,951 ( 0.00%) fn next(&mut self) -> Option { 452,034 ( 0.00%) self.iter.next().map(&mut self.f) 887 ( 0.00%) => ???:::next (16x) 6,102 ( 0.00%) } . . #[inline] . fn size_hint(&self) -> (usize, Option) { . self.iter.size_hint() . } . 2,431,331 ( 0.02%) fn try_fold(&mut self, init: Acc, g: G) -> R . where . Self: Sized, . G: FnMut(Acc, Self::Item) -> R, . R: Try, . { 306 ( 0.00%) self.iter.try_fold(init, map_try_fold(&mut self.f, g)) 2,644 ( 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>> (16x) 1,940,987 ( 0.02%) } . 110,510 ( 0.00%) fn fold(self, init: Acc, g: G) -> Acc . where . G: FnMut(Acc, Self::Item) -> Acc, . { 2,172 ( 0.00%) self.iter.fold(init, map_fold(self.f, g)) 65 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/into_iter.rs: as core::iter::traits::iterator::Iterator>::fold::<(), core::iter::adapters::map::map_fold<(usize, rustc_span::span_encoding::Span), alloc::borrow::Cow, (), ::check_expr::{closure#2}::{closure#1}, core::iter::adapters::intersperse::intersperse_fold, ::check_expr::{closure#2}::{closure#1}>, (), core::iter::traits::iterator::Iterator::for_each::call, >>::extend, ::check_expr::{closure#2}::{closure#1}>>>::{closure#0}>::{closure#0}, , ::check_expr::{closure#2}::{closure#1}>> as core::iter::traits::iterator::Iterator>::fold<(), core::iter::traits::iterator::Iterator::for_each::call, >>::extend, ::check_expr::{closure#2}::{closure#1}>>>::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}> (1x) 101,355 ( 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 ---------------------------------------- 214,277 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_let_else.rs -------------------------------------------------------------------------------- Ir -- line 45 ---------------------------------------- . #[clippy::version = "1.67.0"] . pub MANUAL_LET_ELSE, . pedantic, . "manual implementation of a let...else statement" . } . . impl<'tcx> QuestionMark { . pub(crate) fn check_manual_let_else(&self, cx: &LateContext<'tcx>, stmt: &'tcx Stmt<'tcx>) { 20,061 ( 0.00%) if let StmtKind::Let(local) = stmt.kind 60,183 ( 0.00%) && let Some(init) = local.init 19,648 ( 0.00%) && local.els.is_none() 19,647 ( 0.00%) && local.ty.is_none() 39,108 ( 0.00%) && init.span.eq_ctxt(stmt.span) 97,365 ( 0.00%) && let Some(if_let_or_match) = IfLetOrMatch::parse(cx, init) 404,798 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::parse (19,151x) 1,288 ( 0.00%) && !stmt.span.in_external_macro(cx.sess().source_map()) 38,899 ( 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 (322x) 1,932 ( 0.00%) && self.msrv.meets(cx, msrvs::LET_ELSE) 8,694 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (322x) . { 644 ( 0.00%) match if_let_or_match { . IfLetOrMatch::IfLet(if_let_expr, let_pat, if_then, if_else, ..) => { 167 ( 0.00%) if let Some(ident_map) = expr_simple_identity_map(local.pat, let_pat, if_then) 5,968 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_let_else.rs:clippy_lints::manual_let_else::expr_simple_identity_map (19x) 6 ( 0.00%) && let Some(if_else) = if_else 12 ( 0.00%) && is_never_expr(cx, if_else).is_some() 177 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_never_expr (3x) 15 ( 0.00%) && let qm_allowed = is_lint_allowed(cx, QUESTION_MARK, stmt.hir_id) 3,654 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_lint_allowed (3x) 21 ( 0.00%) && (qm_allowed || pat_and_expr_can_be_question_mark(cx, let_pat, if_else).is_none()) 117 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::pat_and_expr_can_be_question_mark (3x) . { 18 ( 0.00%) emit_manual_let_else(cx, stmt.span, if_let_expr, &ident_map, let_pat, if_else); 3,789 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_let_else.rs:clippy_lints::manual_let_else::emit_manual_let_else (3x) . } . }, . IfLetOrMatch::Match(match_expr, arms, source) => { 303 ( 0.00%) if self.matches_behaviour == MatchLintBehaviour::Never { . return; . } 669 ( 0.00%) if source != MatchSource::Normal { . return; . } . // Any other number than two arms doesn't (necessarily) . // have a trivial mapping to let else. . if arms.len() != 2 { . return; . } . // Guards don't give us an easy mapping either . if arms.iter().any(|arm| arm.guard.is_some()) { . return; . } . let check_types = self.matches_behaviour == MatchLintBehaviour::WellKnownTypes; . let diverging_arm_opt = arms.iter().enumerate().find(|(_, arm)| { 565 ( 0.00%) is_never_expr(cx, arm.body).is_some() && pat_allowed_for_else(cx, arm.pat, check_types) 130,240 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_never_expr (133x) . }); . let Some((idx, diverging_arm)) = diverging_arm_opt else { . return; . }; . 77 ( 0.00%) let pat_arm = &arms[1 - idx]; . // If the non-diverging arm is the first one, its pattern can be reused in a let/else statement. . // However, if it arrives in second position, its pattern may cover some cases already covered . // by the diverging one. 28 ( 0.00%) if idx == 0 && !is_arms_disjointed(cx, diverging_arm, pat_arm) { 116 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_let_else.rs:clippy_lints::manual_let_else::is_arms_disjointed (1x) . return; . } . 105 ( 0.00%) let Some(ident_map) = expr_simple_identity_map(local.pat, pat_arm.pat, pat_arm.body) else { 7,650 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_let_else.rs:clippy_lints::manual_let_else::expr_simple_identity_map (11x) . return; . }; . 56 ( 0.00%) emit_manual_let_else(cx, stmt.span, match_expr, &ident_map, pat_arm.pat, diverging_arm.body); 11,150 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_let_else.rs:clippy_lints::manual_let_else::emit_manual_let_else (7x) . }, . } . } . } . } . . /// Checks if the patterns of the arms are disjointed. Currently, we only support patterns of simple . /// enum variants without nested patterns or bindings. . /// . /// TODO: Support more complex patterns. 4 ( 0.00%) fn is_arms_disjointed(cx: &LateContext<'_>, arm1: &Arm<'_>, arm2: &Arm<'_>) -> bool { 2 ( 0.00%) if arm1.guard.is_some() || arm2.guard.is_some() { . return false; . } . 12 ( 0.00%) is_enum_variant(cx, arm1.pat) && is_enum_variant(cx, arm2.pat) 97 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/manual_let_else.rs:clippy_lints::manual_let_else::is_enum_variant (2x) . } . . /// Returns `true` if the given pattern is a variant of an enum. 4 ( 0.00%) pub fn is_enum_variant(cx: &LateContext<'_>, pat: &Pat<'_>) -> bool { 14 ( 0.00%) let path = match pat.kind { . PatKind::Struct(ref qpath, fields, _) . if fields . .iter() . .all(|field| is_wild(field.pat) || matches!(field.pat.kind, PatKind::Binding(..))) => . { . (qpath, pat.hir_id) . }, 1 ( 0.00%) PatKind::TupleStruct(ref qpath, pats, _) 1 ( 0.00%) if pats . .iter() . .all(|pat| is_wild(pat) || matches!(pat.kind, PatKind::Binding(..))) => . { 2 ( 0.00%) (qpath, pat.hir_id) . }, 1 ( 0.00%) PatKind::Expr(e) if let Some((qpath, id)) = e.opt_qpath() => (qpath, id), . _ => return false, . }; . let res = path.res(cx); 8 ( 0.00%) matches!( 12 ( 0.00%) res, . Res::Def(DefKind::Variant, ..) | Res::Def(DefKind::Ctor(CtorOf::Variant, _), _) . ) 4 ( 0.00%) } . 50 ( 0.00%) fn emit_manual_let_else( . cx: &LateContext<'_>, . span: Span, . expr: &Expr<'_>, . ident_map: &FxHashMap, BindingMode)>, . pat: &Pat<'_>, . else_body: &Expr<'_>, . ) { 80 ( 0.00%) span_lint_and_then( 14,719 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then:: (10x) . cx, . MANUAL_LET_ELSE, . span, . "this could be rewritten as `let...else`", 70 ( 0.00%) |diag| { . // This is far from perfect, for example there needs to be: . // * renamings of the bindings for many `PatKind`s like slices, etc. . // * limitations in the existing replacement algorithms . // * unused binding collision detection with existing ones . // for this to be machine applicable. . let mut app = Applicability::HasPlaceholders; . let (sn_expr, _) = snippet_with_context(cx, expr.span, span.ctxt(), "", &mut app); . let (sn_else, else_is_mac_call) = snippet_with_context(cx, else_body.span, span.ctxt(), "", &mut app); -- line 176 ---------------------------------------- -- line 189 ---------------------------------------- . // https://rust-lang.github.io/rfcs/3137-let-else.html#let-pattern--if--else--else- . format!("let {sn_bl} = ({sn_expr}) else {else_bl};") . } else { . format!("let {sn_bl} = {sn_expr} else {else_bl};") . }; . diag.span_suggestion(span, "consider writing", sugg, app); . }, . ); 20 ( 0.00%) } . . /// Replaces the locals in the pattern . /// . /// For this example: . /// . /// ```ignore . /// let (a, FooBar { b, c }) = if let Bar { Some(a_i), b_i } = ex { (a_i, b_i) } else { return }; . /// ``` -- line 205 ---------------------------------------- -- line 336 ---------------------------------------- . let (sn_pat, _) = snippet_with_context(cx, pat.span, span.ctxt(), "", app); . sn_pat.into_owned() . } . . fn pat_allowed_for_else(cx: &LateContext<'_>, pat: &'_ Pat<'_>, check_types: bool) -> bool { . // Check whether the pattern contains any bindings, as the . // binding might potentially be used in the body. . // TODO: only look for *used* bindings. 11 ( 0.00%) let mut has_bindings = false; 22 ( 0.00%) pat.each_binding_or_first(&mut |_, _, _, _| has_bindings = true); 44 ( 0.00%) if has_bindings { . return false; . } . . // If we shouldn't check the types, exit early. . if !check_types { . return true; . } . . // Check whether any possibly "unknown" patterns are included, . // because users might not know which values some enum has. . // Well-known enums are excepted, as we assume people know them. . // We do a deep check, to be able to disallow Err(En::Foo(_)) . // for usage of the En::Foo variant, as we disallow En::Foo(_), . // but we allow Err(_). . let typeck_results = cx.typeck_results(); 11 ( 0.00%) let mut has_disallowed = false; 44 ( 0.00%) pat.walk_always(|pat| { . // Only do the check if the type is "spelled out" in the pattern 45 ( 0.00%) if !matches!( 61 ( 0.00%) pat.kind, . PatKind::Struct(..) . | PatKind::TupleStruct(..) . | PatKind::Expr(PatExpr { . kind: PatExprKind::Path(..), . .. . },) . ) { . return; . } 18 ( 0.00%) let ty = typeck_results.pat_ty(pat); 240 ( 0.00%) => ???:::pat_ty (6x) . // Option and Result are allowed, everything else isn't. 18 ( 0.00%) if !matches!(ty.opt_diag_name(cx), Some(sym::Option | sym::Result)) { . has_disallowed = true; . } . }); . !has_disallowed . } . . /// Checks if the passed block is a simple identity referring to bindings created by the pattern, . /// and if yes, returns a mapping between the relevant sub-pattern and the identifier it corresponds -- line 386 ---------------------------------------- -- line 398 ---------------------------------------- . /// local_pat: (foo_o, bar_o) . /// let_pat: (Some(foo), bar) . /// expr: (foo, bar) . /// ``` . /// . /// We build internal `sub_pats` so that it looks like `[foo_o, bar_o]` and `paths` so that it looks . /// like `[foo, bar]`. Then we turn that into `FxHashMap [(foo) -> (foo_o), (bar) -> (bar_o)]` which . /// we return. 240 ( 0.00%) fn expr_simple_identity_map<'a, 'hir>( . local_pat: &'a Pat<'hir>, . let_pat: &'_ Pat<'hir>, . expr: &'_ Expr<'hir>, . ) -> Option, BindingMode)>> { . let peeled = peel_blocks(expr); 403 ( 0.00%) let (sub_pats, paths) = match (local_pat.kind, peeled.kind) { . (PatKind::Tuple(pats, _), ExprKind::Tup(exprs)) | (PatKind::Slice(pats, ..), ExprKind::Array(exprs)) => { . (pats, exprs) . }, . (_, ExprKind::Path(_)) => (slice::from_ref(local_pat), slice::from_ref(peeled)), . _ => return None, . }; . . // There is some length mismatch, which indicates usage of .. in the patterns above e.g.: . // let (a, ..) = if let [a, b, _c] = ex { (a, b) } else { ... }; . // We bail in these cases as they should be rare. 24 ( 0.00%) if paths.len() != sub_pats.len() { . return None; . } . . let mut pat_bindings = FxHashMap::default(); 16 ( 0.00%) let_pat.each_binding_or_first(&mut |binding_mode, _hir_id, _sp, ident| { . pat_bindings.insert(ident, binding_mode); . }); 32 ( 0.00%) if pat_bindings.len() < paths.len() { . // This rebinds some bindings from the outer scope, or it repeats some copy-able bindings multiple . // times. We don't support these cases so we bail here. E.g.: . // let foo = 0; . // let (new_foo, bar, bar_copied) = if let Some(bar) = Some(0) { (foo, bar, bar) } else { .. }; 12 ( 0.00%) return None; . } . let mut ident_map = FxHashMap::default(); . for (sub_pat, path) in sub_pats.iter().zip(paths.iter()) { 80 ( 0.00%) if let ExprKind::Path(QPath::Resolved(_ty, path)) = path.kind 48 ( 0.00%) && let [path_seg] = path.segments 64 ( 0.00%) && let ident = path_seg.ident 32 ( 0.00%) && let Some(let_binding_mode) = pat_bindings.remove(&ident) . { 48 ( 0.00%) ident_map.insert(ident.name, (sub_pat, let_binding_mode)); . } else { . return None; . } . } 40 ( 0.00%) Some(ident_map) 270 ( 0.00%) } 118,986 ( 0.00%) -------------------------------------------------------------------------------- -- 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 { 1,624 ( 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<'_>) { 484,456 ( 0.00%) if let ExprKind::Assign(target, ..) = &expr.kind { . let mut base = target; 4,830 ( 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 ---------------------------------------- 812 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/operators/integer_division.rs -------------------------------------------------------------------------------- Ir . use clippy_utils::diagnostics::span_lint_and_then; . use clippy_utils::res::MaybeDef as _; . use rustc_hir as hir; . use rustc_lint::LateContext; . use rustc_span::symbol::sym; . . use super::INTEGER_DIVISION; . 47,152 ( 0.00%) pub(crate) fn check<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx hir::Expr<'_>, . op: hir::BinOpKind, . left: &'tcx hir::Expr<'_>, . right: &'tcx hir::Expr<'_>, . ) { 6,736 ( 0.00%) if op == hir::BinOpKind::Div 93 ( 0.00%) && cx.typeck_results().expr_ty(left).is_integral() 1,252 ( 0.00%) => ???:::expr_ty (31x) 72 ( 0.00%) && let right_ty = cx.typeck_results().expr_ty(right) 960 ( 0.00%) => ???:::expr_ty (24x) . && (right_ty.is_integral() || right_ty.is_diag_item(cx, sym::NonZero)) . { . #[expect(clippy::collapsible_span_lint_calls, reason = "rust-clippy#7797")] 46 ( 0.00%) span_lint_and_then(cx, INTEGER_DIVISION, expr.span, "integer division", |diag| { . diag.help("division of integers may cause loss of precision. consider using floats"); . }); . } 53,888 ( 0.00%) } 77 ( 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 232,803 ( 0.00%) 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, . ) -> *mut [T] { . let ptr = ptr as *mut T; . // SAFETY: The caller already checked these preconditions 2,584 ( 0.00%) let ptr = unsafe { crate::intrinsics::offset(ptr, offset) }; . crate::intrinsics::aggregate_raw_ptr(ptr, len) . } . . /// A helper trait used for indexing operations. . /// . /// Implementations of this trait have to promise that if the argument . /// to `get_unchecked(_mut)` is a safe reference, then so is the result. . #[stable(feature = "slice_get_slice", since = "1.28.0")] -- line 110 ---------------------------------------- -- 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> { 4,244,756 ( 0.04%) if self < slice.len() { . // SAFETY: `self` is checked to be in bounds. 79,895 ( 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> { 14,230 ( 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()); 10,252 ( 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. 3,827 ( 0.00%) unsafe { slice_get_unchecked(slice, self) } . } . . #[inline] . fn index(self, slice: &[T]) -> &T { . // N.B., use intrinsic indexing 3,868,338 ( 0.03%) &(*slice)[self] . } . . #[inline] . #[rustc_no_writable] . fn index_mut(self, slice: &mut [T]) -> &mut T { . // N.B., use intrinsic indexing 157,775 ( 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 391 ---------------------------------------- . ( . start: usize = self.start, . end: usize = self.end, . len: usize = slice.len() . ) => end >= start && end <= len . ); . // SAFETY: see comments for `get_unchecked` above. . unsafe { 61 ( 0.00%) let new_len = crate::intrinsics::unchecked_sub(self.end, self.start); . 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) 6,164 ( 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] { 1,584 ( 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 { 240 ( 0.00%) let new_len = crate::intrinsics::unchecked_sub(slice.len(), self.start); . &*get_offset_len_noubcheck(slice, self.start, new_len) . } . } . . #[inline] . #[rustc_no_writable] . fn index_mut(self, slice: &mut [T]) -> &mut [T] { . if self.start > slice.len() { -- line 557 ---------------------------------------- -- line 673 ---------------------------------------- . // SAFETY: the caller has to uphold the safety contract for `get_unchecked_mut`. . unsafe { self.into_slice_range().get_unchecked_mut(slice) } . } . . #[inline] . fn index(self, slice: &[T]) -> &[T] { . let Self { mut start, mut end, exhausted } = self; . let len = slice.len(); 6 ( 0.00%) if end < len { 3 ( 0.00%) end = end + 1; . start = if exhausted { end } else { start }; . if let Some(new_len) = usize::checked_sub(end, start) { . // SAFETY: `self` is checked to be valid and in bounds above. . unsafe { return &*get_offset_len_noubcheck(slice, start, new_len) } . } . } . slice_index_fail(start, end, slice.len()) . } -- line 690 ---------------------------------------- 452,203 ( 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 { 162,029 ( 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)] 45,500 ( 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) } 45,500 ( 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 414 ( 0.00%) unsafe { self.inner.try_reserve_exact(len, additional, T::LAYOUT) } 224 ( 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 (2x) . } . . /// 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. 1,599,154 ( 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] . fn with_capacity_in(capacity: usize, alloc: A, elem_layout: Layout) -> Self { 57 ( 0.00%) match Self::try_allocate_in(capacity, AllocInit::Uninitialized, alloc, elem_layout) { 324 ( 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_allocate_in (6x) 9 ( 0.00%) Ok(this) => { . unsafe { . // Make it more obvious that a subsequent Vec::reserve(capacity) will not allocate. . hint::assert_unchecked(!this.needs_to_grow(0, capacity, elem_layout)); . } . this . } . Err(err) => handle_error(err), . } . } . 81 ( 0.00%) fn try_allocate_in( . capacity: usize, . init: AllocInit, . alloc: A, . elem_layout: Layout, . ) -> Result { . // 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. 307,135 ( 0.00%) if layout.size() == 0 { 6 ( 0.00%) return Ok(Self::new_in(alloc, elem_layout.alignment())); . } . 12 ( 0.00%) let result = match init { . AllocInit::Uninitialized => alloc.allocate(layout), . #[cfg(not(no_global_oom_handling))] . AllocInit::Zeroed => alloc.allocate_zeroed(layout), . }; 274,693 ( 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::()`. 18 ( 0.00%) Ok(Self { . ptr: Unique::from(ptr.cast()), . cap: unsafe { Cap::new_unchecked(capacity) }, . alloc, . }) 63 ( 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 . #[cfg(not(no_global_oom_handling))] . #[inline] . unsafe fn grow_one(&mut self, elem_layout: Layout) { . // SAFETY: Precondition passed to caller 11,375 ( 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); . 46,294 ( 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`. 57,671 ( 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 137,695 ( 0.00%) let ptr = unsafe { self.finish_grow(cap, elem_layout)? }; 2,432 ( 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 (32x) . . // 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] 465,276 ( 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()) 348,958 ( 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 { 1,598,543 ( 0.01%) self.ptr.cast().as_non_null_ptr() . } . . #[inline] . const fn capacity(&self, elem_size: usize) -> usize { 32,171 ( 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)> { 1,693,946 ( 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] 92,591 ( 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); . } 92,592 ( 0.00%) } . 60,945 ( 0.00%) if self.needs_to_grow(len, additional, elem_layout) { . unsafe { 170,890 ( 0.00%) do_reserve_and_handle(self, len, additional, elem_layout); 3,144 ( 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:: (10x) . } . } . } . . /// # 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 132 ( 0.00%) unsafe fn try_reserve_exact( . &mut self, . len: usize, . additional: usize, . elem_layout: Layout, . ) -> Result<(), TryReserveError> { 44 ( 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(()) 44 ( 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 { 63,400 ( 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::()`. 34,569 ( 0.00%) self.ptr = Unique::from(ptr.cast()); 34,567 ( 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> { 44 ( 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 141,967 ( 0.00%) let ptr = unsafe { self.finish_grow(cap, elem_layout)? }; 4,382 ( 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 (44x) . . // 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 4,292 ( 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. 8,584 ( 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 ---------------------------------------- 6,120,285 ( 0.05%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/tabs_in_doc_comments.rs -------------------------------------------------------------------------------- Ir -- line 57 ---------------------------------------- . style, . "using tabs in doc comments is not recommended" . } . . declare_lint_pass!(TabsInDocComments => [TABS_IN_DOC_COMMENTS]); . . impl TabsInDocComments { . fn warn_if_tabs_in_doc(cx: &EarlyContext<'_>, attr: &ast::Attribute) { 41,439 ( 0.00%) if let ast::AttrKind::DocComment(_, comment) = attr.kind { . let comment = comment.as_str(); . . for (lo, hi) in get_chunks_of_tabs(comment) { . // +3 skips the opening delimiter . let new_span = Span::new( . attr.span.lo() + BytePos(3 + lo), . attr.span.lo() + BytePos(3 + hi), . attr.span.ctxt(), -- line 73 ---------------------------------------- -- line 83 ---------------------------------------- . Applicability::MaybeIncorrect, . ); . } . } . } . } . . impl EarlyLintPass for TabsInDocComments { 121,520 ( 0.00%) fn check_attribute(&mut self, cx: &EarlyContext<'_>, attribute: &ast::Attribute) { . Self::warn_if_tabs_in_doc(cx, attribute); 121,520 ( 0.00%) } . } . . /// . /// scans the string for groups of tabs and returns the start(inclusive) and end positions . /// (exclusive) of all groups . /// e.g. "sd\tasd\t\taa" will yield [(2, 3), (6, 8)] as . /// 012 3456 7 89 . /// ^-^ ^---^ -- line 101 ---------------------------------------- 11,059 ( 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 { 1,937,824 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 726,732 ( 0.01%) if let Some((outer_max, outer_c, oe)) = min_max(cx, expr) 8,729,649 ( 0.07%) => site/frontend/rust-clippy/clippy_lints/src/minmax.rs:clippy_lints::minmax::min_max (242,228x) 32 ( 0.00%) && let Some((inner_max, inner_c, ie)) = min_max(cx, oe) 172 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/minmax.rs:clippy_lints::minmax::min_max (8x) . && 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", . ); 8 ( 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) 1,453,368 ( 0.01%) } . } . . #[derive(PartialEq, Eq, Debug, Clone, Copy)] . enum MinMax { . Min, . Max, . } . 1,695,652 ( 0.01%) fn min_max<'a>(cx: &LateContext<'_>, expr: &'a Expr<'a>) -> Option<(MinMax, Constant, &'a Expr<'a>)> { 1,155,744 ( 0.01%) match expr.kind { 27,718 ( 0.00%) ExprKind::Call(path, args) => { 83,152 ( 0.00%) if let ExprKind::Path(ref qpath) = path.kind { . cx.typeck_results() 110,864 ( 0.00%) .qpath_res(qpath, path.hir_id) 1,069,456 ( 0.01%) => ???:::qpath_res (27,716x) . .opt_def_id() 165,424 ( 0.00%) .and_then(|def_id| match cx.tcx.get_diagnostic_name(def_id) { 1,797,020 ( 0.01%) => ???:::get_diagnostic_name (27,575x) 24 ( 0.00%) Some(sym::cmp_min) => fetch_const(cx, expr.span.ctxt(), None, args, MinMax::Min), 36 ( 0.00%) Some(sym::cmp_max) => fetch_const(cx, expr.span.ctxt(), None, args, MinMax::Max), . _ => None, . }) . } else { . None . } . }, 43,335 ( 0.00%) ExprKind::MethodCall(path, receiver, args @ [_], _) => { 5,073 ( 0.00%) let m = match path.ident.name { 20,303 ( 0.00%) sym::max => MinMax::Max, . sym::min => MinMax::Min, . _ => return None, . }; 15 ( 0.00%) if cx.typeck_results().expr_ty(receiver).is_floating_point() 200 ( 0.00%) => ???:::expr_ty (5x) 35 ( 0.00%) || cx.ty_based_def(expr).opt_parent(cx).is_diag_item(cx, sym::Ord) . { 30 ( 0.00%) fetch_const(cx, expr.span.ctxt(), Some(receiver), args, m) . } else { . None . } . }, . _ => None, . } 1,937,888 ( 0.02%) } . 208 ( 0.00%) 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>)> { . let mut args = receiver.into_iter().chain(args); . let first_arg = args.next()?; . let second_arg = args.next()?; . if args.next().is_some() { . return None; . } 104 ( 0.00%) let ecx = ConstEvalCtxt::new(cx); 1,456 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::new (26x) 676 ( 0.00%) match (ecx.eval_local(first_arg, ctxt), ecx.eval_local(second_arg, ctxt)) { 10,603 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval_local (52x) 18 ( 0.00%) (Some(c), None) => Some((m, c, second_arg)), 35 ( 0.00%) (None, Some(c)) => Some((m, c, first_arg)), . // otherwise ignore 18 ( 0.00%) _ => None, . } 234 ( 0.00%) } 28,044 ( 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")] 16 ( 0.00%) extern "rust-call" fn call(&self, args: Args) -> Self::Output; 449 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/manual_map.rs:clippy_lints::matches::manual_map::get_some_expr (8x) . } . . /// 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")] 6,290 ( 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")] 45,306 ( 0.00%) extern "rust-call" fn call_once(self, args: Args) -> Self::Output; 420 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/source.rs:::new (15x) . } . . 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 266 ---------------------------------------- . . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_trait_impl", issue = "143874")] . const impl FnMut for &F . where . F: [const] Fn, . { . extern "rust-call" fn call_mut(&mut self, args: A) -> F::Output { 137 ( 0.00%) (**self).call(args) 129,496 ( 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::{closure#0} (35x) . } . } . . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_trait_impl", issue = "143874")] . const impl FnOnce for &F . where . F: [const] Fn, -- line 282 ---------------------------------------- -- 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, . { 125,147 ( 0.00%) extern "rust-call" fn call_mut(&mut self, args: A) -> F::Output { 62,198 ( 0.00%) (*self).call_mut(args) 127,199 ( 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 { 5,488 ( 0.00%) (*self).call_mut(args) . } . } . } 536 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/methods/wrong_self_convention.rs -------------------------------------------------------------------------------- Ir -- line 34 ---------------------------------------- . NotEndsWith(&'static str), . IsSelfTypeCopy(bool), . ImplementsTrait(bool), . IsTraitItem(bool), . } . . impl Convention { . #[must_use] 160,951 ( 0.00%) fn check<'tcx>( . &self, . cx: &LateContext<'tcx>, . self_ty: Ty<'tcx>, . other: &str, . implements_trait: bool, . is_trait_item: bool, . ) -> bool { 114,965 ( 0.00%) match *self { 140 ( 0.00%) Self::Eq(this) => this == other, 35,314 ( 0.00%) Self::StartsWith(this) => other.starts_with(this) && this != other, 22,795 ( 0.00%) Self::EndsWith(this) => other.ends_with(this) && this != other, 128 ( 0.00%) Self::NotEndsWith(this) => !Self::EndsWith(this).check(cx, self_ty, other, implements_trait, is_trait_item), 880 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/wrong_self_convention.rs:::check'2 (16x) 96 ( 0.00%) Self::IsSelfTypeCopy(is_true) => is_true == is_copy(cx, self_ty), 47,573 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::is_copy (16x) 50 ( 0.00%) Self::ImplementsTrait(is_true) => is_true == implements_trait, 24 ( 0.00%) Self::IsTraitItem(is_true) => is_true == is_trait_item, . } 137,958 ( 0.00%) } . } . . impl fmt::Display for Convention { 7 ( 0.00%) fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> { 35 ( 0.00%) match *self { . Self::Eq(this) => write!(f, "`{this}`"), 20 ( 0.00%) Self::StartsWith(this) => write!(f, "`{this}*`"), . Self::EndsWith(this) => write!(f, "`*{this}`"), . Self::NotEndsWith(this) => write!(f, "`~{this}`"), 3 ( 0.00%) Self::IsSelfTypeCopy(is_true) => { 33 ( 0.00%) write!(f, "`self` type is{} `Copy`", if is_true { "" } else { " not" }) . }, . Self::ImplementsTrait(is_true) => { . let (negation, s_suffix) = if is_true { ("", "s") } else { (" does not", "") }; . write!(f, "method{negation} implement{s_suffix} a trait") . }, . Self::IsTraitItem(is_true) => { . let suffix = if is_true { " is" } else { " is not" }; . write!(f, "method{suffix} a trait item") . }, . } 14 ( 0.00%) } . } . 33,475 ( 0.00%) pub(super) fn check<'tcx>( . cx: &LateContext<'tcx>, . item_name: Symbol, . self_ty: Ty<'tcx>, . first_arg_ty: Ty<'tcx>, . first_arg_span: Span, . implements_trait: bool, . is_trait_item: bool, . ) { . let item_name_str = item_name.as_str(); . if let Some((conventions, self_kinds)) = &CONVENTIONS.iter().find(|(convs, _)| { . convs . .iter() 188,966 ( 0.00%) .all(|conv| conv.check(cx, self_ty, item_name_str, implements_trait, is_trait_item)) 1,131,269 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/methods/wrong_self_convention.rs:::check (22,977x) . }) { . // don't lint if it implements a trait but not willing to check `Copy` types conventions (see #7032) 126 ( 0.00%) if implements_trait 18 ( 0.00%) && !conventions . .iter() 18 ( 0.00%) .any(|conv| matches!(conv, Convention::IsSelfTypeCopy(_))) . { . return; . } 395 ( 0.00%) if !self_kinds.iter().any(|k| k.matches(cx, self_ty, first_arg_ty)) { 358,745 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/lib.rs:::matches (70x) . let suggestion = { 12 ( 0.00%) if conventions.len() > 1 { . // Don't mention `NotEndsWith` when there is also `StartsWith` convention present 6 ( 0.00%) let cut_ends_with_conv = conventions.iter().any(|conv| matches!(conv, Convention::StartsWith(_))) . && conventions . .iter() 6 ( 0.00%) .any(|conv| matches!(conv, Convention::NotEndsWith(_))); . . let s = conventions . .iter() 93 ( 0.00%) .filter(|conv| !(cut_ends_with_conv && matches!(conv, Convention::NotEndsWith(_)))) . .filter(|conv| !matches!(conv, Convention::ImplementsTrait(_) | Convention::IsTraitItem(_))) . .format(" and "); . 9 ( 0.00%) format!("methods with the following characteristics: ({s})") . } else { 7 ( 0.00%) format!("methods called {}", conventions[0]) . } . }; . . span_lint_and_help( . cx, . WRONG_SELF_CONVENTION, . first_arg_span, 28 ( 0.00%) format!( . "{suggestion} usually take {}", 4 ( 0.00%) self_kinds.iter().map(|k| k.description()).format(" or ") . ), 4 ( 0.00%) None, . "consider choosing a less ambiguous name", . ); . } . } 20,600 ( 0.00%) } 135 ( 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 { 1,416,289 ( 0.01%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 404,654 ( 0.00%) if expr.span.from_expansion() { . return; . } . 762,498 ( 0.01%) if let ExprKind::Binary(Spanned { node: op, .. }, ref left, ref right) = expr.kind { . let span_sugg = |lint: &'static Lint, expr: &Expr, sugg, appl| { 77 ( 0.00%) span_lint_and_sugg( 5,607 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_sugg:: (7x) . cx, . lint, 7 ( 0.00%) expr.span, . "operator precedence might not be obvious", . "consider parenthesizing your expression", . sugg, . appl, . ); . }; . . if !is_bit_op(op) { . return; . } 438 ( 0.00%) let mut applicability = Applicability::MachineApplicable; 1,191 ( 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))) => { 60 ( 0.00%) let sugg = format!( . "{} {} ({})", 6 ( 0.00%) snippet_with_applicability(cx, left.span, "..", &mut applicability), 24 ( 0.00%) op.as_str(), 36 ( 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 (6x) 6 ( 0.00%) 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 46,636 ( 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, . ); . }); . } 1,618,616 ( 0.01%) } . } . . fn get_bin_opt(expr: &Expr) -> Option { 1,752 ( 0.00%) match expr.kind { 53 ( 0.00%) ExprKind::Binary(Spanned { node: op, .. }, _, _) => Some(op), . _ => None, . } . } . . #[must_use] . fn is_bit_op(op: BinOpKind) -> bool { 11,866 ( 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 ---------------------------------------- 600 ( 0.00%) -------------------------------------------------------------------------------- -- 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 { 777 ( 0.00%) let TyKind::Path(qpath) = hir_ty.kind else { return None }; 518 ( 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(); . 8,466 ( 0.00%) visitor.visit_body(body); 4,696,324 ( 0.04%) => ???:::visit_body (4,200x) 12,644 ( 0.00%) visitor.returns . } . . fn has_conditional_return(body: &Body<'_>, expr: &Expr<'_>) -> bool { . match get_return_calls_in_body(body).as_slice() { 16,074 ( 0.00%) [] => false, 3,006 ( 0.00%) [return_expr] => return_expr.hir_id != expr.hir_id, . _ => true, . } . } . 5,895 ( 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); 2,620 ( 0.00%) if let Some(( . _, . Node::Item(Item { . kind: ItemKind::Impl(impl_), . owner_id, . .. . }), 655 ( 0.00%) )) = cx.tcx.hir_parent_iter(hir_id).next() . // We exclude `impl` blocks generated from rustc's proc macros. 3,900 ( 0.00%) && !cx.tcx.is_automatically_derived(owner_id.to_def_id()) 80,464 ( 0.00%) => ???:::is_automatically_derived (650x) . // It is a implementation of a trait. 1,341 ( 0.00%) && let Some(of_trait) = impl_.of_trait . { 645 ( 0.00%) of_trait.trait_ref.trait_def_id() 2,795 ( 0.00%) => ???:::trait_def_id (215x) . } else { . None . } 5,895 ( 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 160 ---------------------------------------- . /// So to avoid these FNs and FPs, we keep removing a layer of references from *both* sides . /// until both sides match the expected LHS and RHS type (or they don't). . fn matches_ty<'tcx>( . mut left: Ty<'tcx>, . mut right: Ty<'tcx>, . expected_left: Ty<'tcx>, . expected_right: Ty<'tcx>, . ) -> bool { 18 ( 0.00%) while let (&ty::Ref(_, lty, _), &ty::Ref(_, rty, _)) = (left.kind(), right.kind()) { 2 ( 0.00%) if lty == expected_left && rty == expected_right { . return true; . } . left = lty; . right = rty; . } . 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() 180 ( 0.00%) .get(cx.tcx.local_def_id_to_hir_id(method_def_id)) . else { . return; . }; . . // That has two arguments. 540 ( 0.00%) if let [self_arg, other_arg] = sig.inputs() 540 ( 0.00%) && let &ty::Ref(_, self_arg, _) = self_arg.kind() 720 ( 0.00%) && let &ty::Ref(_, other_arg, _) = other_arg.kind() . // The two arguments are of the same type. 720 ( 0.00%) && let Some(trait_def_id) = get_impl_trait_def_id(cx, method_def_id) 69,860 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unconditional_recursion.rs:clippy_lints::unconditional_recursion::get_impl_trait_def_id (180x) . // The trait is `PartialEq`. 24 ( 0.00%) && cx.tcx.is_diagnostic_item(sym::PartialEq, trait_def_id) 412 ( 0.00%) => ???:::is_diagnostic_item (4x) . { 20 ( 0.00%) let to_check_op = if name.name == sym::eq { . BinOpKind::Eq . } else { . BinOpKind::Ne . }; 12 ( 0.00%) let is_bad = match expr.kind { 10 ( 0.00%) ExprKind::Binary(op, left, right) if op.node == to_check_op => { . // Then we check if the LHS matches self_arg and RHS matches other_arg 12 ( 0.00%) let left_ty = cx.typeck_results().expr_ty_adjusted(left); 182 ( 0.00%) => ???:::expr_ty_adjusted (3x) 6 ( 0.00%) let right_ty = cx.typeck_results().expr_ty_adjusted(right); 182 ( 0.00%) => ???:::expr_ty_adjusted (3x) . matches_ty(left_ty, right_ty, self_arg, other_arg) . }, . ExprKind::MethodCall(segment, receiver, [arg], _) if segment.ident.name == name.name => { . let receiver_ty = cx.typeck_results().expr_ty_adjusted(receiver); . let arg_ty = cx.typeck_results().expr_ty_adjusted(arg); . . if let Some(fn_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id) . && let Some(trait_id) = cx.tcx.trait_of_assoc(fn_id) -- line 213 ---------------------------------------- -- line 223 ---------------------------------------- . }; . if is_bad { . span_error(cx, method_span, expr); . } . } . } . . fn check_to_string(cx: &LateContext<'_>, method_span: Span, method_def_id: LocalDefId, name: Ident, expr: &Expr<'_>) { 1 ( 0.00%) let args = cx . .tcx 2 ( 0.00%) .instantiate_bound_regions_with_erased(cx.tcx.fn_sig(method_def_id).skip_binder()) 1,022 ( 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) . .inputs(); . // That has one argument. 2 ( 0.00%) if let [_self_arg] = args . && let hir_id = cx.tcx.local_def_id_to_hir_id(method_def_id) 4 ( 0.00%) && let Some(( . _, . Node::Item(Item { . kind: ItemKind::Impl(impl_), . owner_id, . .. . }), 1 ( 0.00%) )) = cx.tcx.hir_parent_iter(hir_id).next() . // We exclude `impl` blocks generated from rustc's proc macros. 6 ( 0.00%) && !cx.tcx.is_automatically_derived(owner_id.to_def_id()) 108 ( 0.00%) => ???:::is_automatically_derived (1x) . // It is a implementation of a trait. 3 ( 0.00%) && let Some(of_trait) = impl_.of_trait . && let Some(trait_def_id) = of_trait.trait_ref.trait_def_id() . // The trait is `ToString`. . && cx.tcx.is_diagnostic_item(sym::ToString, trait_def_id) . { . let is_bad = match expr.kind { . ExprKind::MethodCall(segment, _receiver, &[_arg], _) if segment.ident.name == name.name => { . if let Some(fn_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id) . && let Some(trait_id) = cx.tcx.trait_of_assoc(fn_id) -- line 257 ---------------------------------------- -- line 266 ---------------------------------------- . }; . if is_bad { . span_error(cx, method_span, expr); . } . } . } . . fn is_default_method_on_current_ty<'tcx>(tcx: TyCtxt<'tcx>, qpath: QPath<'tcx>, implemented_ty_id: DefId) -> bool { 8 ( 0.00%) match qpath { . QPath::Resolved(_, path) => match path.segments { 9 ( 0.00%) [first, .., last] => last.ident.name == kw::Default && first.res.opt_def_id() == Some(implemented_ty_id), . _ => false, . }, . QPath::TypeRelative(ty, segment) => { 1 ( 0.00%) if segment.ident.name != kw::Default { . return false; . } . if matches!( . ty.kind, . TyKind::Path(QPath::Resolved( . _, . hir::Path { . res: Res::SelfTyAlias { .. }, -- line 288 ---------------------------------------- -- line 309 ---------------------------------------- . { . type NestedFilter = nested_filter::OnlyBodies; . type Result = ControlFlow<()>; . . fn maybe_tcx(&mut self) -> Self::MaybeTyCtxt { . self.cx.tcx . } . 117 ( 0.00%) fn visit_expr(&mut self, expr: &'tcx Expr<'tcx>) -> ControlFlow<()> { 39 ( 0.00%) walk_expr(self, expr)?; 1,064 ( 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:: (3x) . 30 ( 0.00%) if let ExprKind::Call(f, _) = expr.kind 12 ( 0.00%) && let ExprKind::Path(qpath) = f.kind 12 ( 0.00%) && is_default_method_on_current_ty(self.cx.tcx, qpath, self.implemented_ty_id) . && let Some(method_def_id) = f.res(self.cx).opt_def_id() . && let Some(trait_def_id) = self.cx.tcx.trait_of_assoc(method_def_id) . && self.cx.tcx.is_diagnostic_item(sym::Default, trait_def_id) . { . span_error(self.cx, self.method_span, expr); . return ControlFlow::Break(()); . } . ControlFlow::Continue(()) 104 ( 0.00%) } . } . . impl UnconditionalRecursion { 2,072 ( 0.00%) fn init_default_impl_for_type_if_needed(&mut self, cx: &LateContext<'_>) { 259 ( 0.00%) if self.default_impl_for_type.is_empty() 5 ( 0.00%) && let Some(default_trait_id) = cx.tcx.get_diagnostic_item(sym::Default) 106 ( 0.00%) => ???:::get_diagnostic_item (1x) . { . let impls = cx.tcx.trait_impls_of(default_trait_id); . for (ty, impl_def_ids) in impls.non_blanket_impls() { 1,004 ( 0.00%) let Some(self_def_id) = ty.def() else { continue }; 986 ( 0.00%) for &impl_def_id in impl_def_ids { 2,958 ( 0.00%) if !cx.tcx.is_automatically_derived(impl_def_id) && 1,760,841 ( 0.01%) => ???:::is_automatically_derived (493x) . 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| { 1,489 ( 0.00%) item.is_fn() && item.def_id.is_local() && item.name() == kw::Default 132 ( 0.00%) => ???:::name (22x) . }) 198 ( 0.00%) && let Some(body_node) = cx.tcx.hir_get_if_local(assoc_item.def_id) 3,306 ( 0.00%) => ???:::hir_get_if_local (22x) 88 ( 0.00%) && let Some(body_id) = body_node.body_id() 484 ( 0.00%) => ???:::body_id (22x) 66 ( 0.00%) && let body = cx.tcx.hir_body(body_id) 1,420 ( 0.00%) => ???:::hir_body (22x) . // We don't want to keep it if it has conditional return. 44 ( 0.00%) && let [return_expr] = get_return_calls_in_body(body).as_slice() 73 ( 0.00%) && let ExprKind::Call(call_expr, _) = return_expr.kind . // We need to use typeck here to infer the actual function being called. 35 ( 0.00%) && let body_def_id = cx.tcx.hir_enclosing_body_owner(call_expr.hir_id) 2,737 ( 0.00%) => ???:::hir_enclosing_body_owner (7x) 35 ( 0.00%) && let Some(body_owner) = cx.tcx.hir_maybe_body_owned_by(body_def_id) 1,197 ( 0.00%) => ???:::hir_maybe_body_owned_by (7x) 14 ( 0.00%) && let typeck = cx.tcx.typeck_body(body_owner.id()) 1,505 ( 0.00%) => ???:::typeck_body (7x) 42 ( 0.00%) && let Some(call_def_id) = typeck.type_dependent_def_id(call_expr.hir_id) 280 ( 0.00%) => ???:::type_dependent_def_id (7x) . { . self.default_impl_for_type.insert(self_def_id, call_def_id); . } . } . } . } 2,072 ( 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. 6,686 ( 0.00%) if decl.implicit_self().has_implicit_self() { 26,744 ( 0.00%) => ???:::implicit_self (3,343x) . return; . } . // We don't check trait implementations. 2,365 ( 0.00%) if get_impl_trait_def_id(cx, method_def_id).is_some() { 172,977 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unconditional_recursion.rs:clippy_lints::unconditional_recursion::get_impl_trait_def_id (473x) . return; . } . . let hir_id = cx.tcx.local_def_id_to_hir_id(method_def_id); 1,056 ( 0.00%) if let Some(( . _, . Node::Item(Item { . kind: ItemKind::Impl(impl_), . .. . }), 264 ( 0.00%) )) = cx.tcx.hir_parent_iter(hir_id).next() 2,590 ( 0.00%) && let Some(implemented_ty_id) = get_hir_ty_def_id(cx.tcx, *impl_.self_ty) . && { 777 ( 0.00%) self.init_default_impl_for_type_if_needed(cx); 4,228,534 ( 0.04%) => site/frontend/rust-clippy/clippy_lints/src/unconditional_recursion.rs:::init_default_impl_for_type_if_needed (259x) . true . } 518 ( 0.00%) && let Some(return_def_id) = self.default_impl_for_type.get(&implemented_ty_id) 3 ( 0.00%) && method_def_id.to_def_id() == *return_def_id . { 21 ( 0.00%) let mut c = CheckCalls { . cx, . implemented_ty_id, . method_span, . }; 6 ( 0.00%) let _ = walk_body(&mut c, body); 1,193 ( 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_body:: (3x) . } . } . } . . fn check_from(cx: &LateContext<'_>, method_span: Span, method_def_id: LocalDefId, expr: &Expr<'_>) { . let Some(sig) = cx . .typeck_results() . .liberated_fn_sigs() 103 ( 0.00%) .get(cx.tcx.local_def_id_to_hir_id(method_def_id)) . else { . return; . }; . . // Check if we are calling `Into::into` where the node args match with our `From::from` signature: . // From::from signature: fn(S1) -> S2 . // >::into(s1), node_args=[S1, S2] . // If they do match, then it must mean that it is the blanket impl, . // which calls back into our `From::from` again (`Into` is not specializable). . // rustc's unconditional_recursion already catches calling `From::from` directly 568 ( 0.00%) if let Some((fn_def_id, node_args)) = fn_def_id_with_node_args(cx, expr) 7,569 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::fn_def_id_with_node_args (103x) 111 ( 0.00%) && let [s1, s2] = **node_args . && let (Some(s1), Some(s2)) = (s1.as_type(), s2.as_type()) 15 ( 0.00%) && let Some(trait_def_id) = cx.tcx.trait_of_assoc(fn_def_id) 1,344 ( 0.00%) => ???:::trait_of_assoc (5x) 25 ( 0.00%) && cx.tcx.is_diagnostic_item(sym::Into, trait_def_id) 506 ( 0.00%) => ???:::is_diagnostic_item (5x) 20 ( 0.00%) && get_impl_trait_def_id(cx, method_def_id) == cx.tcx.get_diagnostic_item(sym::From) 714 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/unconditional_recursion.rs:clippy_lints::unconditional_recursion::get_impl_trait_def_id (2x) 212 ( 0.00%) => ???:::get_diagnostic_item (2x) 8 ( 0.00%) && s1 == sig.inputs()[0] . && s2 == sig.output() . { . span_error(cx, method_span, expr); . } . } . . impl<'tcx> LateLintPass<'tcx> for UnconditionalRecursion { 45,728 ( 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... 15,632 ( 0.00%) if let FnKind::Method(name, _) = kind 20,684 ( 0.00%) && let expr = expr_or_init(cx, body.value).peel_blocks() 109,200 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::expr_or_init (4,200x) . // Doesn't have a conditional return. 11,432 ( 0.00%) && !has_conditional_return(body, expr) . { . match name.name { 23,039 ( 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); . } 45,728 ( 0.00%) } . } 36,325 ( 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/char/methods.rs -------------------------------------------------------------------------------- Ir -- line 404 ---------------------------------------- . without modifying the original"] . #[inline] . pub const fn to_digit(self, radix: u32) -> Option { . assert!( . radix >= 2 && radix <= 36, . "to_digit: invalid radix -- radix must be in the range 2 to 36 inclusive" . ); . // check radix to remove letter handling code when radix is a known constant 2 ( 0.00%) let value = if self > '9' && radix > 10 { . // mask to convert ASCII letters to uppercase . const TO_UPPERCASE_MASK: u32 = !0b0010_0000; . // Converts an ASCII letter to its corresponding integer value: . // A-Z => 10-35, a-z => 10-35. Other characters produce values >= 36. . // . // Add Overflow Safety: . // By applying the mask after the subtraction, the first addendum is . // constrained such that it never exceeds u32::MAX - 0x20. . ((self as u32).wrapping_sub('A' as u32) & TO_UPPERCASE_MASK) + 10 . } else { . // convert digit to value, non-digits wrap to values > 36 . (self as u32).wrapping_sub('0' as u32) . }; . // FIXME(const-hack): once then_some is const fn, use it here 3 ( 0.00%) if value < radix { Some(value) } else { None } . } . . /// Returns an iterator that yields the hexadecimal Unicode escape of a . /// character as `char`s. . /// . /// This will escape characters with the Rust syntax of the form . /// `\u{NNNNNN}` where `NNNNNN` is a hexadecimal representation. . /// -- line 435 ---------------------------------------- -- 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 { 5,763 ( 0.00%) 'a'..='z' => true, 58 ( 0.00%) '\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. . /// . /// Titlecase letters (code points with the general category of `Lt`) are [described] in Chapter 4 -- line 914 ---------------------------------------- -- 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 { 393,810 ( 0.00%) 'A'..='Z' => true, 254,934 ( 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 1017 ---------------------------------------- . /// assert!(!'藏'.is_numeric()); . /// assert!(!'三'.is_numeric()); . /// ``` . #[must_use] . #[stable(feature = "rust1", since = "1.0.0")] . #[inline] . pub fn is_numeric(self) -> bool { . match self { 571,266 ( 0.00%) '0'..='9' => true, 1,689 ( 0.00%) '\0'..='\u{B1}' => false, . _ => unicode::N(self), . } . } . . /// Returns `true` if this `char` satisfies either [`is_alphabetic()`] or [`is_numeric()`]. . /// . /// [`is_alphabetic()`]: Self::is_alphabetic . /// [`is_numeric()`]: Self::is_numeric -- line 1034 ---------------------------------------- -- 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 { 11,608,616 ( 0.10%) match self { . ' ' | '\x09'..='\x0d' => true, 347,878 ( 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 { 570 ( 0.00%) ToLowercase(CaseMappingIter::new(conversions::to_lower(self))) 3,990 ( 0.00%) => ???:core::unicode::unicode_data::conversions::to_lower (190x) . } . . /// 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 { 14,982 ( 0.00%) ToUppercase(CaseMappingIter::new(conversions::to_upper(self))) 109,868 ( 0.00%) => ???:core::unicode::unicode_data::conversions::to_upper (4,994x) . } . . /// 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 2101 ---------------------------------------- . /// 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 { 24 ( 0.00%) matches!(*self, 'A'..='Z') . } . . /// Checks if the value is an ASCII lowercase character: . /// U+0061 'a' ..= U+007A 'z'. . /// . /// # Examples . /// . /// ``` -- line 2117 ---------------------------------------- -- 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 { 149,413 ( 0.00%) 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 { 56,818 ( 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 { 57,000 ( 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 ---------------------------------------- 36,062 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/operators/integer_division_remainder_used.rs -------------------------------------------------------------------------------- Ir -- line 2 ---------------------------------------- . use rustc_ast::BinOpKind; . use rustc_hir::Expr; . use rustc_lint::LateContext; . use rustc_middle::ty; . use rustc_span::Span; . . use super::INTEGER_DIVISION_REMAINDER_USED; . 53,888 ( 0.00%) pub(super) fn check(cx: &LateContext<'_>, op: BinOpKind, lhs: &Expr<'_>, rhs: &Expr<'_>, span: Span) { 20,208 ( 0.00%) if let BinOpKind::Div | BinOpKind::Rem = op 252 ( 0.00%) && let lhs_ty = cx.typeck_results().expr_ty(lhs) 1,692 ( 0.00%) => ???:::expr_ty (42x) 168 ( 0.00%) && let rhs_ty = cx.typeck_results().expr_ty(rhs) 1,680 ( 0.00%) => ???:::expr_ty (42x) . && let ty::Int(_) | ty::Uint(_) = lhs_ty.peel_refs().kind() . && let ty::Int(_) | ty::Uint(_) = rhs_ty.peel_refs().kind() . { . span_lint( . cx, . INTEGER_DIVISION_REMAINDER_USED, 72 ( 0.00%) span.source_callsite(), 1,240 ( 0.00%) => ???:::source_callsite (36x) 180 ( 0.00%) format!("use of `{}` has been disallowed in this context", op.as_str()), . ); . } 53,888 ( 0.00%) } 78 ( 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 { 2,180,052 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 242,228 ( 0.00%) let span = expr.span; 968,912 ( 0.01%) if !span.in_external_macro(cx.tcx.sess.source_map()) && 1,446,928 ( 0.01%) let Some(body_expr) = desugar_async_block(cx, expr) && 1,835,493 ( 0.02%) => site/frontend/rust-clippy/clippy_lints/src/redundant_async_block.rs:clippy_lints::redundant_async_block::desugar_async_block (180,866x) . 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, . ); . } 1,937,824 ( 0.02%) } . } . . /// If `expr` is a desugared `async` block, return the original expression if it does not capture . /// any variable by ref. 542,598 ( 0.00%) fn desugar_async_block<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) -> Option<&'tcx Expr<'tcx>> { 361,732 ( 0.00%) if let ExprKind::Closure(Closure { body, def_id, kind, .. }) = expr.kind 831 ( 0.00%) && let body = cx.tcx.hir_body(*body) 24,894 ( 0.00%) => ???:::hir_body (277x) 554 ( 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 . } 723,464 ( 0.01%) } 181,420 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/self_named_constructors.rs -------------------------------------------------------------------------------- Ir -- line 36 ---------------------------------------- . pub SELF_NAMED_CONSTRUCTORS, . style, . "method should not have the same name as the type it is implemented for" . } . . declare_lint_pass!(SelfNamedConstructors => [SELF_NAMED_CONSTRUCTORS]); . . impl<'tcx> LateLintPass<'tcx> for SelfNamedConstructors { 28,777 ( 0.00%) fn check_impl_item(&mut self, cx: &LateContext<'tcx>, impl_item: &'tcx ImplItem<'_>) { 8,222 ( 0.00%) match impl_item.kind { . ImplItemKind::Fn(ref sig, _) => { 11,742 ( 0.00%) if sig.decl.implicit_self().has_implicit_self() { 31,312 ( 0.00%) => ???:::implicit_self (3,914x) . return; . } . }, . _ => return, . } . 3,498 ( 0.00%) let parent = cx.tcx.hir_get_parent_item(impl_item.hir_id()).def_id; 81,683 ( 0.00%) => ???:::hir_get_parent_item (583x) 2,332 ( 0.00%) let item = cx.tcx.hir_expect_item(parent); 37,635 ( 0.00%) => ???:::hir_expect_item (583x) 1,166 ( 0.00%) let self_ty = cx.tcx.type_of(item.owner_id).instantiate_identity().skip_norm_wip(); 1,166 ( 0.00%) let ret_ty = return_ty(cx, impl_item.owner_id); 64,961 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::return_ty (583x) . . // Do not check trait impls 2,332 ( 0.00%) if matches!(item.kind, ItemKind::Impl(Impl { of_trait: Some(_), .. })) { . return; . } . . // Ensure method is constructor-like . if let Some(self_adt) = self_ty.ty_adt_def() { 602 ( 0.00%) if !contains_adt_constructor(ret_ty, self_adt) { 73,366 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::contains_adt_constructor (301x) . return; . } . } else if !ret_ty.contains(self_ty) { . return; . } . . if let Some(self_def) = self_ty.ty_adt_def() . && let Some(self_local_did) = self_def.did().as_local() 876 ( 0.00%) && let Node::Item(x) = cx.tcx.hir_node_by_def_id(self_local_did) 876 ( 0.00%) && let Some(type_ident) = x.kind.ident() 3,212 ( 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:::ident (292x) 584 ( 0.00%) && let type_name = type_ident.name.as_str().to_lowercase() 49,528 ( 0.00%) => ???:::to_lowercase (292x) 314 ( 0.00%) && (impl_item.ident.name.as_str() == type_name 603 ( 0.00%) || impl_item.ident.name.as_str().replace('_', "") == type_name) 107,784 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/str.rs:::replace:: (292x) . { . span_lint( . cx, . SELF_NAMED_CONSTRUCTORS, . impl_item.span, . format!("constructor `{}` has the same name as the type", impl_item.ident.name), . ); . } 32,888 ( 0.00%) } . } 9,314 ( 0.00%) -------------------------------------------------------------------------------- -- 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 { 145,688 ( 0.00%) fn check_block(&mut self, cx: &EarlyContext<'_>, block: &Block) { . for w in block.stmts.windows(2) { 52,006 ( 0.00%) if let (StmtKind::Expr(first), StmtKind::Expr(second) | StmtKind::Semi(second)) = (&w[0].kind, &w[1].kind) { 1,856 ( 0.00%) check_missing_else(cx, first, second); . } . } 145,688 ( 0.00%) } . 1,416,289 ( 0.01%) 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); 1,618,616 ( 0.01%) } . } . . /// Implementation of the `SUSPICIOUS_ASSIGNMENT_FORMATTING` lint. . fn check_assign(cx: &EarlyContext<'_>, expr: &Expr) { 606,981 ( 0.01%) if let ExprKind::Assign(ref lhs, ref rhs, _) = expr.kind 1,218 ( 0.00%) && !lhs.span.from_expansion() 1,212 ( 0.00%) && !rhs.span.from_expansion() . { 1,616 ( 0.00%) let eq_span = lhs.span.between(rhs.span); 43,228 ( 0.00%) => ???:::between (404x) 810 ( 0.00%) if let ExprKind::Unary(op, ref sub_rhs) = rhs.kind 4 ( 0.00%) && let Some(eq_snippet) = snippet_opt(cx, eq_span) . { . let op = op.as_str(); 8 ( 0.00%) let eqop_span = lhs.span.between(sub_rhs.span); 214 ( 0.00%) => ???:::between (2x) 2 ( 0.00%) if eq_snippet.ends_with('=') { . span_lint_and_note( . cx, . SUSPICIOUS_ASSIGNMENT_FORMATTING, . eqop_span, . format!( . "this looks like you are trying to use `.. {op}= ..`, but you \ . really are doing `.. = ({op} ..)`" . ), -- line 185 ---------------------------------------- -- line 188 ---------------------------------------- . ); . } . } . } . } . . /// Implementation of the `SUSPICIOUS_UNARY_OP_FORMATTING` lint. . fn check_unop(cx: &EarlyContext<'_>, expr: &Expr) { 403,842 ( 0.00%) if let ExprKind::Binary(ref binop, ref lhs, ref rhs) = expr.kind 32,043 ( 0.00%) && !lhs.span.from_expansion() && !rhs.span.from_expansion() . // span between BinOp LHS and RHS 15,780 ( 0.00%) && let binop_span = lhs.span.between(rhs.span) 422,115 ( 0.00%) => ???:::between (3,945x) . // if RHS is an UnOp 7,959 ( 0.00%) && let ExprKind::Unary(op, ref un_rhs) = rhs.kind . // from UnOp operator to UnOp operand 345 ( 0.00%) && let unop_operand_span = rhs.span.until(un_rhs.span) 7,280 ( 0.00%) => ???:::until (69x) 138 ( 0.00%) && let Some(binop_snippet) = snippet_opt(cx, binop_span) 138 ( 0.00%) && let Some(unop_operand_snippet) = snippet_opt(cx, unop_operand_span) 207 ( 0.00%) && let binop_str = binop.node.as_str() . // no space after BinOp operator and space after UnOp operator 69 ( 0.00%) && binop_snippet.ends_with(binop_str) && unop_operand_snippet.ends_with(' ') . { . let unop_str = op.as_str(); . let eqop_span = lhs.span.between(un_rhs.span); . span_lint_and_help( . cx, . SUSPICIOUS_UNARY_OP_FORMATTING, . eqop_span, . format!( -- line 216 ---------------------------------------- -- 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) { 409,912 ( 0.00%) if let ExprKind::If(_, then, Some(else_)) = &expr.kind 803 ( 0.00%) && (is_block(else_) || is_if(else_)) 2,855 ( 0.00%) && !then.span.from_expansion() && !else_.span.from_expansion() 1,756 ( 0.00%) && !expr.span.in_external_macro(cx.sess().source_map()) . . // workaround for rust-lang/rust#43081 1,756 ( 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) 1,756 ( 0.00%) && let else_span = then.span.between(else_.span) 46,973 ( 0.00%) => ???:::between (439x) . . // the snippet should look like " else \n " with maybe comments anywhere . // it’s bad when there is a ‘\n’ after the “else” 3,512 ( 0.00%) && let Some(else_snippet) = snippet_opt(cx, else_span) 196,702 ( 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> (439x) 3,512 ( 0.00%) && let Some((pre_else, post_else)) = else_snippet.split_once("else") 164,067 ( 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> (439x) 878 ( 0.00%) && !else_snippet.contains('/') 2,622 ( 0.00%) && let Some((_, post_else_post_eol)) = post_else.split_once('\n') 19,228 ( 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:: (437x) . { . // 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 273 ---------------------------------------- . ), . ); . } . } . . #[must_use] . fn has_unary_equivalent(bin_op: BinOpKind) -> bool { . // &, *, - 3 ( 0.00%) bin_op == BinOpKind::And || bin_op == BinOpKind::Mul || bin_op == BinOpKind::Sub . } . . 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) { 377,342 ( 0.00%) if let ExprKind::Array(ref array) = expr.kind { . for element in array { 8,118 ( 0.00%) if let ExprKind::Binary(ref op, ref lhs, _) = element.kind 6 ( 0.00%) && 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) . { . span_lint_and_note( -- line 301 ---------------------------------------- -- 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) { 4,088 ( 0.00%) if !first.span.from_expansion() && !second.span.from_expansion() . && matches!(first.kind, ExprKind::If(..)) 1,056 ( 0.00%) && (is_block(second) || is_if(second)) . . // Proc-macros can give weird spans. Make sure this is actually an `if`. 477 ( 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. 795 ( 0.00%) && let else_span = first.span.between(second.span) 17,063 ( 0.00%) => ???:::between (159x) 795 ( 0.00%) && let Some(else_snippet) = snippet_opt(cx, else_span) 636 ( 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 { 2,022 ( 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(..)) . } 13,020 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/attrs/mixed_attributes_style.rs -------------------------------------------------------------------------------- Ir -- line 2 ---------------------------------------- . use clippy_utils::diagnostics::span_lint; . use rustc_ast::{AttrKind, AttrStyle, Attribute, SyntheticAttr}; . use rustc_data_structures::fx::FxHashSet; . use rustc_lint::{EarlyContext, LintContext as _}; . use rustc_span::source_map::SourceMap; . use rustc_span::{SourceFile, Span, Symbol}; . use std::sync::Arc; . 22,171 ( 0.00%) #[derive(Hash, PartialEq, Eq)] . enum SimpleAttrKind { . Doc, . /// A normal attribute, with its name symbols. . Normal(Vec), . CfgTrace, . CfgAttrTrace, . } . . impl From<&AttrKind> for SimpleAttrKind { . fn from(value: &AttrKind) -> Self { 11,005 ( 0.00%) match value { . AttrKind::Normal(attr) => { 130 ( 0.00%) let path_symbols = attr . .item . .path . .segments . .iter() . .map(|seg| seg.ident.name) . .collect::>(); . Self::Normal(path_symbols) . }, 216 ( 0.00%) AttrKind::Synthetic(synthetic) => match &**synthetic { . SyntheticAttr::CfgTrace(_) => Self::CfgTrace, . SyntheticAttr::CfgAttrTrace(_) => Self::CfgAttrTrace, . }, . AttrKind::DocComment(..) => Self::Doc, . } . } . } . 49,960 ( 0.00%) pub(super) fn check(cx: &EarlyContext<'_>, item_span: Span, attrs: &[Attribute]) { . let mut inner_attr_kind: FxHashSet = FxHashSet::default(); . let mut outer_attr_kind: FxHashSet = FxHashSet::default(); . . let source_map = cx.sess().source_map(); 14,988 ( 0.00%) let item_src = source_map.lookup_source_file(item_span.lo()); 744,404 ( 0.01%) => ???:::lookup_source_file (4,996x) . . for attr in attrs { 20,049 ( 0.00%) if attr.span.from_expansion() || !attr_in_same_src_as_item(source_map, &item_src, attr.span) { . continue; . } . . let kind: SimpleAttrKind = (&attr.kind).into(); 4,506 ( 0.00%) match attr.style { . AttrStyle::Inner => { . if outer_attr_kind.contains(&kind) { . lint_mixed_attrs(cx, attrs); . return; . } . inner_attr_kind.insert(kind); . }, . AttrStyle::Outer => { 4,506 ( 0.00%) if inner_attr_kind.contains(&kind) { . lint_mixed_attrs(cx, attrs); . return; . } 9,012 ( 0.00%) outer_attr_kind.insert(kind); . }, . } . } 39,968 ( 0.00%) } . . fn lint_mixed_attrs(cx: &EarlyContext<'_>, attrs: &[Attribute]) { . let mut attrs_iter = attrs.iter().filter(|attr| !attr.span.from_expansion()); . let span = if let (Some(first), Some(last)) = (attrs_iter.next(), attrs_iter.next_back()) { . first.span.with_hi(last.span.hi()) . } else { . return; . }; -- line 79 ---------------------------------------- -- line 81 ---------------------------------------- . cx, . MIXED_ATTRIBUTES_STYLE, . span, . "item has both inner and outer attributes", . ); . } . . fn attr_in_same_src_as_item(source_map: &SourceMap, item_src: &Arc, attr_span: Span) -> bool { 13,364 ( 0.00%) let attr_src = source_map.lookup_source_file(attr_span.lo()); 497,809 ( 0.00%) => ???:::lookup_source_file (3,341x) . Arc::ptr_eq(item_src, &attr_src) . } 24,309 ( 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_hir_id/src/lib.rs -------------------------------------------------------------------------------- Ir -- line 76 ---------------------------------------- . /// `hir::Item`, `hir::TraitItem`, or `hir::ImplItem` (i.e., the closest "item-like"), . /// and the `local_id` which is unique within the given owner. . /// . /// This two-level structure makes for more stable values: One can move an item . /// around within the source code, or add or remove stuff before it, without . /// the `local_id` part of the `HirId` changing, which is a very useful property in . /// incremental compilation where we have to persist things through changes to . /// the code base. 3,114,253 ( 0.03%) #[derive(Copy, Clone, PartialEq, Eq, Hash, Encodable, Decodable, StableHash)] . #[rustc_pass_by_value] . pub struct HirId { 44,383 ( 0.00%) pub owner: OwnerId, . pub local_id: ItemLocalId, . } . . // To ensure correctness of incremental compilation, . // `HirId` must not implement `Ord` or `PartialOrd`. . // See https://github.com/rust-lang/rust/issues/90317. . impl !Ord for HirId {} . impl !PartialOrd for HirId {} -- line 95 ---------------------------------------- -- line 120 ---------------------------------------- . . #[inline] . pub fn is_owner(self) -> bool { . self.local_id.index() == 0 . } . . #[inline] . pub fn make_owner(owner: LocalDefId) -> Self { 22 ( 0.00%) Self { owner: OwnerId { def_id: owner }, local_id: ItemLocalId::ZERO } . } . } . . impl fmt::Display for HirId { . fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { . write!(f, "{self:?}") . } . } -- line 136 ---------------------------------------- -- line 138 ---------------------------------------- . rustc_data_structures::define_stable_id_collections!(HirIdMap, HirIdSet, HirIdMapEntry, HirId); . rustc_data_structures::define_id_collections!( . ItemLocalMap, . ItemLocalSet, . ItemLocalMapEntry, . ItemLocalId . ); . 23,566 ( 0.00%) rustc_index::newtype_index! { . /// An `ItemLocalId` uniquely identifies something within a given "item-like"; . /// that is, within a `hir::Item`, `hir::TraitItem`, or `hir::ImplItem`. There is no . /// guarantee that the numerical value of a given `ItemLocalId` corresponds to . /// the node's position within the owning item in any way, but there is a . /// guarantee that the `ItemLocalId`s within an owner occupy a dense range of . /// integers starting at zero, so a mapping that maps all or most nodes within . /// an "item-like" to something else can be implemented by a `Vec` instead of a . /// tree or hash map. -- line 154 ---------------------------------------- 13,656 ( 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 { 1,211,140 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 242,228 ( 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), . ); . } 1,453,368 ( 0.01%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_utils/src/macros.rs -------------------------------------------------------------------------------- Ir -- line 33 ---------------------------------------- . sym::std_panic_macro, . sym::todo_macro, . sym::unimplemented_macro, . sym::write_macro, . sym::writeln_macro, . ]; . . /// Returns true if a given Macro `DefId` is a format macro (e.g. `println!`) 15,281 ( 0.00%) pub fn is_format_macro(cx: &LateContext<'_>, macro_def_id: DefId) -> bool { 28,194 ( 0.00%) if let Some(name) = cx.tcx.get_diagnostic_name(macro_def_id) { 174,586 ( 0.00%) => ???:::get_diagnostic_name (2,183x) . FORMAT_MACRO_DIAG_ITEMS.contains(&name) . } else { . // Allow users to tag any macro as being format!-like . // TODO: consider deleting FORMAT_MACRO_DIAG_ITEMS and using just this method 1,820 ( 0.00%) get_unique_builtin_attr( 31,445 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/attrs.rs:clippy_utils::attrs::get_unique_builtin_attr:: (455x) . cx.sess(), . #[allow(deprecated)] 1,820 ( 0.00%) cx.tcx.get_all_attrs(macro_def_id), 231,946 ( 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:::get_all_attrs:: (455x) . sym::format_args, . ) . .is_some() . } 13,098 ( 0.00%) } . . /// A macro call, like `vec![1, 2, 3]`. . /// . /// Use `tcx.item_name(macro_call.def_id)` to get the macro name. . /// Even better is to check if it is a diagnostic item. . /// . /// This structure is similar to `ExpnData` but it precludes desugaring expansions. . #[derive(Debug)] -- line 63 ---------------------------------------- -- line 68 ---------------------------------------- . pub kind: MacroKind, . /// The expansion produced by the macro call . pub expn: ExpnId, . /// Span of the macro call site . pub span: Span, . } . . impl MacroCall { 1 ( 0.00%) pub fn is_local(&self) -> bool { 5 ( 0.00%) span_is_local(self.span) 3 ( 0.00%) } . } . . /// 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(); 520,628 ( 0.00%) if ctxt == SyntaxContext::root() { . return None; . } 965,250 ( 0.01%) let expn = ctxt.outer_expn(); 986,090 ( 0.01%) let data = expn.expn_data(); 746,109 ( 0.01%) span = data.call_site; 4,937,205 ( 0.04%) Some((expn, data)) . }) . } . . /// Checks whether the span is from the root expansion or a locally defined macro 19,575 ( 0.00%) pub fn span_is_local(span: Span) -> bool { 8,036 ( 0.00%) !span.from_expansion() || expn_is_local(span.ctxt().outer_expn()) 350,721 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::expn_is_local (2,009x) 5,718 ( 0.00%) } . . /// Checks whether the expansion is the root expansion or a locally defined macro 6,027 ( 0.00%) pub fn expn_is_local(expn: ExpnId) -> bool { . if expn == ExpnId::root() { . return true; . } 4,018 ( 0.00%) let data = expn.expn_data(); 2,009 ( 0.00%) let backtrace = expn_backtrace(data.call_site); . std::iter::once((expn, data)) . .chain(backtrace) 24,108 ( 0.00%) .find_map(|(_, data)| data.macro_def_id) . .is_none_or(DefId::is_local) 8,036 ( 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,139,223 ( 0.02%) expn_backtrace(span).filter_map(|(expn, data)| match data { . ExpnData { 552,258 ( 0.00%) kind: ExpnKind::Macro(kind, _), 564,377 ( 0.00%) macro_def_id: Some(def_id), 1,292,270 ( 0.01%) 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. 2,844,567 ( 0.02%) pub fn root_macro_call(span: Span) -> Option { . macro_backtrace(span).last() 2,068,776 ( 0.02%) } . . /// 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. 2,205,360 ( 0.02%) pub fn matching_root_macro_call(cx: &LateContext<'_>, span: Span, name: Symbol) -> Option { 844,725 ( 0.01%) root_macro_call(span).filter(|mc| cx.tcx.is_diagnostic_item(name, mc.def_id)) 49,940,878 ( 0.41%) => site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::root_macro_call (245,040x) 5,054,747 ( 0.04%) => ???:::is_diagnostic_item (70,929x) 1,715,280 ( 0.01%) } . . /// 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 { 4,963,261 ( 0.04%) if first_node_in_macro(cx, node) != Some(ExpnId::root()) { 8,847,291 ( 0.07%) => site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::first_node_in_macro:: (242,228x) . return None; . } 40,889 ( 0.00%) root_macro_call(node.span()) 569,354 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::root_macro_call (1,811x) . } . . /// 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 { 484,456 ( 0.00%) let span = node.span(); 484,456 ( 0.00%) first_node_in_macro(cx, node) 8,847,291 ( 0.07%) => site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::first_node_in_macro:: (242,228x) . .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. 19,438,731 ( 0.16%) 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. 10,799,295 ( 0.09%) 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(); 1,477,336 ( 0.01%) if let Some((cached_id, cached)) = LAST_FIRST_NODE_IN_MACRO.get() . && cached_id == hir_id . { . return cached; . } 94,785 ( 0.00%) let result = first_node_in_macro_uncached(cx, node); . LAST_FIRST_NODE_IN_MACRO.set(Some((hir_id, result))); . result 19,438,731 ( 0.16%) } . . 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()); 163,806 ( 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 327,612 ( 0.00%) let parent_span = cx.tcx.hir_span(parent_id); 12,588,167 ( 0.10%) => ???:::hir_span (81,903x) . let Some(parent_macro_call) = macro_backtrace(parent_span).next() else { . // the parent node is not in a macro . return Some(ExpnId::root()); . }; . 10,844 ( 0.00%) if parent_macro_call.expn.is_descendant_of(expn) { . // `node` is input to a macro call . return None; . } . . Some(parent_macro_call.expn) . } . . /* Specific Macro Utils */ . . /// Is `def_id` of `std::panic`, `core::panic` or any inner implementation macros 259 ( 0.00%) pub fn is_panic(cx: &LateContext<'_>, def_id: DefId) -> bool { 2,536 ( 0.00%) let Some(name) = cx.tcx.get_diagnostic_name(def_id) else { 21,023 ( 0.00%) => ???:::get_diagnostic_name (259x) . return false; . }; . matches!( . name, . sym::core_panic_macro . | sym::std_panic_macro . | sym::core_panic_2015_macro . | sym::std_panic_2015_macro . | sym::core_panic_2021_macro . ) 518 ( 0.00%) } . . /// Is `def_id` of `assert!` or `debug_assert!` . pub fn is_assert_macro(cx: &LateContext<'_>, def_id: DefId) -> bool { . let Some(name) = cx.tcx.get_diagnostic_name(def_id) else { . return false; . }; . matches!(name, sym::assert_macro | sym::debug_assert_macro) . } -- line 264 ---------------------------------------- -- line 282 ---------------------------------------- . Display(&'a Expr<'a>), . /// Anything else - `panic!("error {}: {}", a, b)`, `panic!("on edition 2021+")`. . /// . /// See [`FormatArgsStorage::get`] to examine the contents of the formatting. . Format(&'a Expr<'a>), . } . . impl<'a> PanicCall<'a> { 41,799 ( 0.00%) pub fn parse(expr: &'a Expr<'a>) -> Option { 27,866 ( 0.00%) let ExprKind::Call(callee, args) = &expr.kind else { . return None; . }; 7,440 ( 0.00%) let ExprKind::Path(QPath::Resolved(_, path)) = &callee.kind else { . return None; . }; 5,952 ( 0.00%) let name = path.segments.last().unwrap().ident.name; . 5,952 ( 0.00%) let [arg, rest @ ..] = args else { . return None; . }; . let result = match name { 8,806 ( 0.00%) sym::panic | sym::begin_panic | sym::panic_str_2015 => { 394 ( 0.00%) if arg.span.eq_ctxt(expr.span) || arg.span.is_dummy() { . Self::DefaultMessage . } else { . Self::Str2015(arg) . } . }, . sym::panic_display => { . let ExprKind::AddrOf(_, _, e) = &arg.kind else { . return None; -- line 312 ---------------------------------------- -- line 314 ---------------------------------------- . Self::Display(e) . }, . sym::panic_fmt => Self::Format(arg), . // Since Rust 1.52, `assert_{eq,ne}` macros expand to use: . // `core::panicking::assert_failed(.., left_val, right_val, None | Some(format_args!(..)));` . sym::assert_failed => { . // It should have 4 arguments in total (we already matched with the first argument, . // so we're just checking for 3) 2,460 ( 0.00%) if rest.len() != 3 { . return None; . } . // `msg_arg` is either `None` (no custom message) or `Some(format_args!(..))` (custom message) . let msg_arg = &rest[2]; 2,460 ( 0.00%) match msg_arg.kind { 912 ( 0.00%) ExprKind::Call(_, [fmt_arg]) => Self::Format(fmt_arg), . _ => Self::DefaultMessage, . } . }, . _ => return None, . }; . Some(result) 55,732 ( 0.00%) } . . pub fn is_default_message(&self) -> bool { . matches!(self, Self::DefaultMessage) . } . } . . /// Finds the arguments of an `assert!` or `debug_assert!` macro call within the macro expansion 3,096 ( 0.00%) pub fn find_assert_args<'a>( . cx: &LateContext<'_>, . expr: &'a Expr<'a>, . expn: ExpnId, . ) -> Option<(&'a Expr<'a>, PanicCall<'a>)> { . find_assert_args_inner(cx, expr, expn).map(|([e], p)| (e, p)) 2,322 ( 0.00%) } . . /// Finds the arguments of an `assert_eq!` or `debug_assert_eq!` macro call within the macro . /// expansion 14,760 ( 0.00%) pub fn find_assert_eq_args<'a>( . cx: &LateContext<'_>, . expr: &'a Expr<'a>, . expn: ExpnId, . ) -> Option<(&'a Expr<'a>, &'a Expr<'a>, PanicCall<'a>)> { . find_assert_args_inner(cx, expr, expn).map(|([a, b], p)| (a, b, p)) 11,070 ( 0.00%) } . . fn find_assert_args_inner<'a, const N: usize>( . cx: &LateContext<'_>, . expr: &'a Expr<'a>, . expn: ExpnId, . ) -> Option<([&'a Expr<'a>; N], PanicCall<'a>)> { 5,952 ( 0.00%) let macro_id = expn.expn_data().macro_def_id?; 5,952 ( 0.00%) let (expr, expn) = match cx.tcx.item_name(macro_id).as_str().strip_prefix("debug_") { . None => (expr, expn), . Some(inner_name) => find_assert_within_debug_assert(cx, expr, expn, Symbol::intern(inner_name))?, . }; . let mut args = ArrayVec::new(); 10,416 ( 0.00%) let panic_expn = for_each_expr_without_closures(expr, |e| { 201,210 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/visitors.rs:clippy_utils::visitors::for_each_expr_without_closures::::{closure#0}> (258x) 46,634 ( 0.00%) if args.is_full() { 68,177 ( 0.00%) match PanicCall::parse(e) { 2,322 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/macros.rs:::parse (258x) . Some(expn) => ControlFlow::Break(expn), . None => ControlFlow::Continue(Descend::Yes), . } 75,072 ( 0.00%) } else if is_assert_arg(cx, e, expn) { 284,130 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::is_assert_arg (1,230x) . args.push(e); . ControlFlow::Continue(Descend::No) . } else { . ControlFlow::Continue(Descend::Yes) . } . }); 258 ( 0.00%) let args = args.into_inner().ok()?; . Some((args, panic_expn?)) . } . . fn find_assert_within_debug_assert<'a>( . cx: &LateContext<'_>, . expr: &'a Expr<'a>, . expn: ExpnId, . assert_name: Symbol, . ) -> Option<(&'a Expr<'a>, ExpnId)> { . for_each_expr_without_closures(expr, |e| { 7,104 ( 0.00%) if !e.span.from_expansion() { . return ControlFlow::Continue(Descend::No); . } 3,552 ( 0.00%) let e_expn = e.span.ctxt().outer_expn(); 7,104 ( 0.00%) if e_expn == expn { . ControlFlow::Continue(Descend::Yes) 14,208 ( 0.00%) } else if e_expn.expn_data().macro_def_id.map(|id| cx.tcx.item_name(id)) == Some(assert_name) { . ControlFlow::Break((e, e_expn)) . } else { . ControlFlow::Continue(Descend::No) . } . }) . } . 84,456 ( 0.00%) fn is_assert_arg(cx: &LateContext<'_>, expr: &Expr<'_>, assert_expn: ExpnId) -> bool { 18,768 ( 0.00%) if !expr.span.from_expansion() { . return true; . } 20,265 ( 0.00%) let result = macro_backtrace(expr.span).try_for_each(|macro_call| { . if macro_call.expn == assert_expn { . ControlFlow::Break(false) . } else { . match cx.tcx.item_name(macro_call.def_id) { . // `cfg!(debug_assertions)` in `debug_assert!` . sym::cfg => ControlFlow::Continue(()), . // assert!(other_macro!(..)) . _ => ControlFlow::Break(true), . } . } . }); . match result { . ControlFlow::Break(is_assert_arg) => is_assert_arg, . ControlFlow::Continue(()) => true, . } 84,456 ( 0.00%) } . . /// 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`] 13,335 ( 0.00%) pub fn get(&self, cx: &LateContext<'_>, start: &Expr<'_>, expn_id: ExpnId) -> Option<&FormatArgs> { . let format_args_expr = for_each_expr_without_closures(start, |expr| { 14,371 ( 0.00%) let ctxt = expr.span.ctxt(); 119,327 ( 0.00%) if ctxt.outer_expn().is_descendant_of(expn_id) { . if macro_backtrace(expr.span) 18,855 ( 0.00%) .map(|macro_call| cx.tcx.item_name(macro_call.def_id)) . .any(|name| matches!(name, sym::const_format_args | sym::format_args | sym::format_args_nl)) . { . ControlFlow::Break(expr) . } else { . ControlFlow::Continue(Descend::Yes) . } . } else { . ControlFlow::Continue(Descend::No) . } . })?; . . debug_assert!(self.0.get().is_some(), "`FormatArgsStorage` not yet populated"); . 3,070 ( 0.00%) self.0.get()?.get(&format_args_expr.span.with_parent(None)) 7,620 ( 0.00%) } . . /// 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 4,628 ( 0.00%) pub fn find_format_arg_expr<'hir>(start: &'hir Expr<'hir>, target: &FormatArgument) -> Option<&'hir Expr<'hir>> { . let SpanData { 2,314 ( 0.00%) lo, 2,314 ( 0.00%) hi, 2,314 ( 0.00%) ctxt, . parent: _, 2,314 ( 0.00%) } = target.expr.span.data(); . . for_each_expr_without_closures(start, |expr| { . // When incremental compilation is enabled spans gain a parent during AST to HIR lowering, . // since we're comparing an AST span to a HIR one we need to ignore the parent field 12,811 ( 0.00%) let data = expr.span.data(); 34,878 ( 0.00%) if data.lo == lo && data.hi == hi && data.ctxt == ctxt { . ControlFlow::Break(expr) . } else { . ControlFlow::Continue(()) . } . }) 4,628 ( 0.00%) } . . /// Span of the `:` and format specifiers . /// . /// ```ignore . /// format!("{:.}"), format!("{foo:.}") . /// ^^ ^^ . /// ``` . pub fn format_placeholder_format_span(placeholder: &FormatPlaceholder) -> Option { -- line 499 ---------------------------------------- -- line 526 ---------------------------------------- . . /// Returns the [`Span`] of the value at `index` extended to the previous comma, e.g. for the value . /// `10` . /// . /// ```ignore . /// format("{}.{}", 10, 11) . /// // ^^^^ . /// ``` 288 ( 0.00%) pub fn format_arg_removal_span(format_args: &FormatArgs, index: usize) -> Option { 32 ( 0.00%) let ctxt = format_args.span.ctxt(); . 160 ( 0.00%) let current = hygiene::walk_chain(format_args.arguments.by_index(index)?.expr.span, ctxt); 1,728 ( 0.00%) => ???:rustc_span::hygiene::walk_chain (32x) . 64 ( 0.00%) let prev = if index == 0 { . format_args.span . } else { 28 ( 0.00%) hygiene::walk_chain(format_args.arguments.by_index(index - 1)?.expr.span, ctxt) 216 ( 0.00%) => ???:rustc_span::hygiene::walk_chain (4x) . }; . 64 ( 0.00%) Some(current.with_lo(prev.hi())) 288 ( 0.00%) } . . /// Where a format parameter is being used in the format string . #[derive(Debug, Copy, Clone, PartialEq, Eq)] . pub enum FormatParamUsage { . /// Appears as an argument, e.g. `format!("{}", foo)` . Argument, . /// Appears as a width, e.g. `format!("{:width$}", foo, width = 1)` . Width, -- line 554 ---------------------------------------- 3,268,572 ( 0.03%) -------------------------------------------------------------------------------- -- 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) { 404,654 ( 0.00%) if let ExprKind::Struct(ref se) = expr.kind 8,216 ( 0.00%) && self.msrv.meets(msrvs::FIELD_INIT_SHORTHAND) 49,296 ( 0.00%) => /rust/deps/smallvec-1.15.1/src/lib.rs:::meets (2,054x) . { 2,054 ( 0.00%) for field in &se.fields { 10,372 ( 0.00%) if !field.is_shorthand 13,930 ( 0.00%) && let ExprKind::Path(None, path) = &field.expr.kind 2,044 ( 0.00%) && let [segment] = path.segments.as_slice() 720 ( 0.00%) && segment.args.is_none() . && segment.ident == field.ident 2 ( 0.00%) && field.span.eq_ctxt(field.ident.span) 12 ( 0.00%) && !field.span.in_external_macro(cx.sess().source_map()) 234 ( 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 (2x) . { 32 ( 0.00%) span_lint_and_sugg( 500,564 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_sugg:: (2x) . cx, . REDUNDANT_FIELD_NAMES, 2 ( 0.00%) field.span, . "redundant field names in struct initialization", . "replace it with", . field.ident.to_string(), . Applicability::MachineApplicable, . ); . } . } . } 202,327 ( 0.00%) } . . extract_msrv_attr!(); . } 32,882 ( 0.00%) -------------------------------------------------------------------------------- -- 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 { 1,937,824 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 484,456 ( 0.00%) 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 4,530 ( 0.00%) && let ExprKind::Binary(ref cond_op, cond_left, cond_right) = cond.kind . { 4,202 ( 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) 706 ( 0.00%) && let ExprKind::Binary(ref cond_op, cond_left, cond_right) = cond.kind . { 190 ( 0.00%) check_manual_check( . cx, expr, cond_op, cond_left, cond_right, if_block, else_block, self.msrv, . ); . } 1,936,512 ( 0.02%) } . } . . #[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, . ) { 380 ( 0.00%) let ty = cx.typeck_results().expr_ty(left_hand); 7,612 ( 0.00%) => ???:::expr_ty (190x) . if ty.is_numeric() && !ty.is_signed() { 486 ( 0.00%) match condition.node { 90 ( 0.00%) BinOpKind::Gt | BinOpKind::Ge => check_gt( . cx, . condition.span, 18 ( 0.00%) expr.span, . left_hand, . right_hand, . if_block, . else_block, . msrv, 39 ( 0.00%) matches!( 72 ( 0.00%) clippy_utils::get_parent_expr(cx, expr), 2,268 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (18x) . Some(Expr { . kind: ExprKind::If(..), . .. . }) . ), . ), 192 ( 0.00%) BinOpKind::Lt | BinOpKind::Le => check_gt( . cx, . condition.span, 32 ( 0.00%) expr.span, . right_hand, . left_hand, . if_block, . else_block, . msrv, 41 ( 0.00%) matches!( 128 ( 0.00%) clippy_utils::get_parent_expr(cx, expr), 3,948 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (32x) . Some(Expr { . kind: ExprKind::If(..), . .. . }) . ), . ), . _ => {}, . } . } . } . . #[expect(clippy::too_many_arguments)] 650 ( 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, . ) { 360 ( 0.00%) if !big_expr.can_have_side_effects() && !little_expr.can_have_side_effects() { 1,816 ( 0.00%) => ???:::can_have_side_effects (90x) . check_subtraction( . cx, . condition_span, . expr_span, . big_expr, . little_expr, . if_block, . else_block, . msrv, . is_composited, . ); . } 400 ( 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); 8 ( 0.00%) if is_integer_literal(if_block, 0) { . // We need to check this case as well to prevent infinite recursion. 1 ( 0.00%) 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( . cx, . condition_span, -- line 226 ---------------------------------------- -- line 229 ---------------------------------------- . big_expr, . else_block, . if_block, . msrv, . is_composited, . ); . return; . } 3 ( 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 < 2,101 ( 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>> { 564 ( 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) . }, 11 ( 0.00%) ExprKind::Assign(target, value, _) => { 22 ( 0.00%) if let ExprKind::Binary(ref op1, left1, right1) = value.kind . && BinOpKind::Sub == op1.node . && SpanlessEq::new(cx).eq_expr(expr.span.ctxt(), left1, target) . && is_integer_literal(right1, 1) . { . Some(target) . } else { . None . } -- line 411 ---------------------------------------- 7,916 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/implied_bounds_in_impls.rs -------------------------------------------------------------------------------- Ir -- line 231 ---------------------------------------- . /// . /// For `impl Deref + DerefMut + Eq` this returns `[Deref, PartialEq]`. . /// The `Deref` comes from `DerefMut` because `trait DerefMut: Deref {}`, and `PartialEq` comes from . /// `Eq`. . fn collect_supertrait_bounds<'tcx>(cx: &LateContext<'tcx>, bounds: GenericBounds<'tcx>) -> Vec> { . bounds . .iter() . .filter_map(|bound| { 54 ( 0.00%) if let GenericBound::Trait(poly_trait) = bound . && let TraitBoundModifiers::NONE = poly_trait.modifiers 112 ( 0.00%) && let [.., path] = poly_trait.trait_ref.path.segments . && poly_trait.bound_generic_params.is_empty() . && let Some(trait_def_id) = path.res.opt_def_id() 16 ( 0.00%) && let clauses = cx.tcx.explicit_super_clauses_of(trait_def_id).skip_binder() . // If the trait has no supertrait, there is no need to collect anything from that bound 16 ( 0.00%) && !clauses.is_empty() . { 160 ( 0.00%) Some(ImplTraitBound { . span: bound.span(), . clauses, . trait_def_id, 16 ( 0.00%) args: path.args.map_or([].as_slice(), |p| p.args), . constraints: path.args.map_or([].as_slice(), |p| p.constraints), . }) . } else { 11 ( 0.00%) None . } . }) . .collect() . } . . /// Given a bound in an `impl Trait` type, looks for a trait in the set of supertraits (previously . /// collected in [`collect_supertrait_bounds`]) that matches (same trait and generic arguments). . fn find_bound_in_supertraits<'a, 'tcx>( . cx: &LateContext<'tcx>, . trait_def_id: DefId, . args: &'tcx [GenericArg<'tcx>], . bounds: &'a [ImplTraitBound<'tcx>], . ) -> Option<&'a ImplTraitBound<'tcx>> { . bounds.iter().find(|bound| { 22 ( 0.00%) bound.clauses.iter().any(|(clause, _)| { 116 ( 0.00%) if let ClauseKind::Trait(tr) = clause.kind().skip_binder() 406 ( 0.00%) => ???:::kind (29x) . && tr.def_id() == trait_def_id . { . is_same_generics( . cx.tcx, . tr.trait_ref.args, . bound.args, . args, . bound.trait_def_id, -- line 280 ---------------------------------------- -- line 282 ---------------------------------------- . ) . } else { . false . } . }) . }) . } . 483 ( 0.00%) fn check<'tcx>(cx: &LateContext<'tcx>, bounds: GenericBounds<'tcx>) { 138 ( 0.00%) if bounds.len() == 1 { . // Very often there is only a single bound, e.g. `impl Deref<..>`, in which case . // we can avoid doing a bunch of stuff unnecessarily; there will trivially be . // no duplicate bounds . return; . } . . let supertraits = collect_supertrait_bounds(cx, bounds); . . // Lint all bounds in the `impl Trait` type that we've previously also seen in the set of . // supertraits of each of the bounds. . // This involves some extra logic when generic arguments are present, since . // simply comparing trait `DefId`s won't be enough. We also need to compare the generics. . for (index, bound) in bounds.iter().enumerate() { 27 ( 0.00%) if let GenericBound::Trait(poly_trait) = bound 32 ( 0.00%) && let TraitBoundModifiers::NONE = poly_trait.modifiers 80 ( 0.00%) && let [.., path] = poly_trait.trait_ref.path.segments 48 ( 0.00%) && let implied_args = path.args.map_or([].as_slice(), |a| a.args) . && let implied_constraints = path.args.map_or([].as_slice(), |a| a.constraints) . && let Some(def_id) = poly_trait.trait_ref.path.res.opt_def_id() . && let Some(bound) = find_bound_in_supertraits(cx, def_id, implied_args, &supertraits) . // If the implied bound has a type binding that also exists in the implied-by trait, . // then we shouldn't lint. See #11880 for an example. . && let assocs = cx.tcx.associated_items(bound.trait_def_id) . && !implied_constraints.iter().any(|constraint| { . assocs -- line 316 ---------------------------------------- -- line 317 ---------------------------------------- . .filter_by_name_unhygienic(constraint.ident.name) . .next() . .is_some_and(AssocItem::is_type) . }) . { . emit_lint(cx, poly_trait, bounds, index, implied_constraints, bound); . } . } 552 ( 0.00%) } . . impl<'tcx> LateLintPass<'tcx> for ImpliedBoundsInImpls { . fn check_generics(&mut self, cx: &LateContext<'tcx>, generics: &rustc_hir::Generics<'tcx>) { 9,442 ( 0.00%) for predicate in generics.predicates { 4,485 ( 0.00%) if let WherePredicateKind::BoundPredicate(predicate) = predicate.kind . // In theory, the origin doesn't really matter, . // we *could* also lint on explicit where clauses written out by the user, . // not just impl trait desugared ones, but that contradicts with the lint name... . && let PredicateOrigin::ImplTrait = predicate.origin . { 265 ( 0.00%) check(cx, predicate.bounds); 9,873 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/implied_bounds_in_impls.rs:clippy_lints::implied_bounds_in_impls::check (53x) . } . } . } . . fn check_ty(&mut self, cx: &LateContext<'tcx>, ty: &rustc_hir::Ty<'tcx, AmbigArg>) { 105,094 ( 0.00%) if let TyKind::OpaqueDef(opaque_ty, ..) = ty.kind { 64 ( 0.00%) check(cx, opaque_ty.bounds); 6,373 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/implied_bounds_in_impls.rs:clippy_lints::implied_bounds_in_impls::check (16x) . } . } . } 87 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/module_style.rs -------------------------------------------------------------------------------- Ir -- line 109 ---------------------------------------- . mod_file: Arc, . mod_ident: Ident, . path_from_working_dir: Option, . contains_external: bool, . has_path_attr: bool, . is_cfg_test: bool, . } . 7 ( 0.00%) #[derive(Default)] . pub struct ModStyle { . working_dir: Option, . regular_mod_stack: Vec, . inline_mod_stack: Vec, . } . . impl ModStyle { . fn inside_cfg_test_inline_mod(&self) -> bool { -- line 125 ---------------------------------------- -- line 128 ---------------------------------------- . . fn get_relative_path_from_working_dir(&self, file: &SourceFile) -> Option { . try_trim_file_path_prefix(file, self.working_dir.as_ref()?).map(Path::to_path_buf) . } . } . . impl EarlyLintPass for ModStyle { . fn check_crate(&mut self, cx: &EarlyContext<'_>, _: &ast::Crate) { 3 ( 0.00%) self.working_dir = cx.sess().source_map().working_dir().local_path().map(Path::to_path_buf); . } . 49,960 ( 0.00%) fn check_item(&mut self, cx: &EarlyContext<'_>, item: &ast::Item) { 4,996 ( 0.00%) if cx.builder.lint_level_spec(MOD_MODULE_FILES).is_allow() 4,996 ( 0.00%) && cx.builder.lint_level_spec(SELF_NAMED_MODULE_FILES).is_allow() 4,996 ( 0.00%) && cx.builder.lint_level_spec(INLINE_MODULES).is_allow() . { . return; . } . if let ItemKind::Mod(_, mod_ident, ModKind::Loaded(_, inline_or_not, mod_spans, ..)) = &item.kind { . let has_path_attr = item.attrs.iter().any(|attr| attr.has_name(sym::path)); . let mod_file = cx.sess().source_map().lookup_source_file(mod_spans.inner_span.lo()); . let path_from_working_dir = self.get_relative_path_from_working_dir(&mod_file); . let current = ModState { -- line 150 ---------------------------------------- -- line 184 ---------------------------------------- . Inline::No { .. } => { . if !has_path_attr && let Some(last) = self.regular_mod_stack.last_mut() { . last.contains_external = true; . } . self.regular_mod_stack.push(current); . }, . } . } 39,968 ( 0.00%) } . 49,960 ( 0.00%) fn check_item_post(&mut self, cx: &EarlyContext<'_>, item: &ast::Item) { 4,996 ( 0.00%) if cx.builder.lint_level_spec(MOD_MODULE_FILES).is_allow() 4,996 ( 0.00%) && cx.builder.lint_level_spec(SELF_NAMED_MODULE_FILES).is_allow() 4,996 ( 0.00%) && cx.builder.lint_level_spec(INLINE_MODULES).is_allow() . { . return; . } . . if let ItemKind::Mod(.., ModKind::Loaded(_, inline_or_not, ..)) = &item.kind { . match inline_or_not { . Inline::Yes => { . self.inline_mod_stack.pop(); -- line 205 ---------------------------------------- -- line 212 ---------------------------------------- . if current.contains_external { . check_self_named_module(cx, path, ¤t.mod_file); . } . check_mod_module(cx, path, ¤t.mod_file); . } . }, . } . } 39,968 ( 0.00%) } . } . . fn check_self_named_module(cx: &EarlyContext<'_>, path: &Path, file: &SourceFile) { . if !path.ends_with("mod.rs") { . let mut mod_folder = path.with_extension(""); . span_lint_and_then( . cx, . SELF_NAMED_MODULE_FILES, -- line 228 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/ptr/cmp_null.rs -------------------------------------------------------------------------------- Ir -- line 2 ---------------------------------------- . use clippy_utils::diagnostics::span_lint_and_sugg; . use clippy_utils::res::{MaybeDef as _, MaybeResPath as _}; . use clippy_utils::sugg::Sugg; . use clippy_utils::{is_lint_allowed, sym}; . use rustc_errors::Applicability; . use rustc_hir::{BinOpKind, Expr, ExprKind}; . use rustc_lint::LateContext; . 34,788 ( 0.00%) pub(super) fn check<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'_>, . op: BinOpKind, . l: &Expr<'_>, . r: &Expr<'_>, . ) -> bool { 2,899 ( 0.00%) let mut applicability = Applicability::MachineApplicable; 20,308 ( 0.00%) let non_null_path_snippet = match ( 11,596 ( 0.00%) is_lint_allowed(cx, CMP_NULL, expr.hir_id), 7,931,942 ( 0.07%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_lint_allowed (2,899x) 2,899 ( 0.00%) is_null_path(cx, l), . is_null_path(cx, r), . ) { . (false, true, false) => Sugg::hir_with_context(cx, r, expr.span.ctxt(), "..", &mut applicability).maybe_paren(), . (false, false, true) => Sugg::hir_with_context(cx, l, expr.span.ctxt(), "..", &mut applicability).maybe_paren(), . _ => return false, . }; . let invert = if op == BinOpKind::Eq { "" } else { "!" }; . -- line 28 ---------------------------------------- -- line 31 ---------------------------------------- . CMP_NULL, . expr.span, . "comparing with null is better expressed by the `.is_null()` method", . "try", . format!("{invert}{non_null_path_snippet}.is_null()"), . applicability, . ); . true 23,192 ( 0.00%) } . . fn is_null_path(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { 11,689 ( 0.00%) if let ExprKind::Call(pathexp, []) = expr.kind { 8 ( 0.00%) matches!( 24 ( 0.00%) pathexp.basic_res().opt_diag_name(cx), 8 ( 0.00%) Some(sym::ptr_null | sym::ptr_null_mut) . ) . } else { . false . } . } 5,818 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/functions/must_use.rs -------------------------------------------------------------------------------- Ir -- line 15 ---------------------------------------- . use clippy_utils::visitors::for_each_expr_without_closures; . use clippy_utils::{is_entrypoint_fn, return_ty, trait_ref_of_method}; . use rustc_span::Symbol; . . use core::ops::ControlFlow; . . use super::{DOUBLE_MUST_USE, MUST_USE_CANDIDATE, MUST_USE_UNIT}; . 53,442 ( 0.00%) pub(super) fn check_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>) { 39,372 ( 0.00%) let attrs = cx.tcx.hir_attrs(item.hir_id()); 366,333 ( 0.00%) => ???:::hir_attrs (5,938x) 49,230 ( 0.00%) let attr = find_attr!(cx.tcx, item.hir_id(), MustUse { span, reason } => (span, reason)); 374,441 ( 0.00%) => ???:>::get_attrs (5,938x) 16,581 ( 0.00%) if let hir::ItemKind::Fn { . ref sig, . body: ref body_id, 1,233 ( 0.00%) ident, . .. . } = item.kind . { 4,932 ( 0.00%) let is_public = cx.effective_visibilities.is_exported(item.owner_id.def_id); 68,834 ( 0.00%) => ???:::is_exported (1,233x) 3,699 ( 0.00%) let fn_header_span = item.span.with_hi(sig.decl.output.span().hi()); 2,466 ( 0.00%) if let Some((attr_span, reason)) = attr { 360 ( 0.00%) check_needless_must_use( 39,489 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/functions/must_use.rs:clippy_lints::functions::must_use::check_needless_must_use (24x) . cx, . sig.decl, . item.owner_id, . item.span, . fn_header_span, . *attr_span, 48 ( 0.00%) *reason, . attrs, . sig, . ); 3,713 ( 0.00%) } else if is_public && !is_proc_macro(attrs) && !find_attr!(attrs, NoMangle(..)) { 286 ( 0.00%) check_must_use_candidate( 5,457,186 ( 0.05%) => site/frontend/rust-clippy/clippy_lints/src/functions/must_use.rs:clippy_lints::functions::must_use::check_must_use_candidate (22x) . cx, . sig.decl, 110 ( 0.00%) cx.tcx.hir_body(*body_id), 1,539 ( 0.00%) => ???:::hir_body (22x) . item.span, . ident.span, . item.owner_id, . "this function could have a `#[must_use]` attribute", . ); . } . } 47,504 ( 0.00%) } . . pub(super) fn check_impl_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::ImplItem<'_>) { 12,333 ( 0.00%) if let hir::ImplItemKind::Fn(ref sig, ref body_id) = item.kind { 15,656 ( 0.00%) let is_public = cx.effective_visibilities.is_exported(item.owner_id.def_id); 219,813 ( 0.00%) => ???:::is_exported (3,914x) 7,828 ( 0.00%) let fn_header_span = item.span.with_hi(sig.decl.output.span().hi()); 35,226 ( 0.00%) let attrs = cx.tcx.hir_attrs(item.hir_id()); 253,307 ( 0.00%) => ???:::hir_attrs (3,914x) 25,236 ( 0.00%) let attr = find_attr!(cx.tcx, item.hir_id(), MustUse { span, reason } => (span, reason)); 259,739 ( 0.00%) => ???:>::get_attrs (3,914x) . if let Some((attr_span, reason)) = attr { 39 ( 0.00%) check_needless_must_use( 2,949 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/functions/must_use.rs:clippy_lints::functions::must_use::check_needless_must_use (3x) . cx, . sig.decl, . item.owner_id, . item.span, . fn_header_span, . *attr_span, 6 ( 0.00%) *reason, . attrs, . sig, . ); 27,983 ( 0.00%) } else if is_public && !is_proc_macro(attrs) && trait_ref_of_method(cx, item.owner_id).is_none() { 322,636 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::trait_ref_of_method (2,107x) 11,752 ( 0.00%) check_must_use_candidate( 25,954,423 ( 0.22%) => site/frontend/rust-clippy/clippy_lints/src/functions/must_use.rs:clippy_lints::functions::must_use::check_must_use_candidate (904x) . cx, . sig.decl, 3,616 ( 0.00%) cx.tcx.hir_body(*body_id), 59,447 ( 0.00%) => ???:::hir_body (904x) . item.span, 1,808 ( 0.00%) item.ident.span, . item.owner_id, . "this method could have a `#[must_use]` attribute", . ); . } . } 4,111 ( 0.00%) } . . pub(super) fn check_trait_item<'tcx>(cx: &LateContext<'tcx>, item: &'tcx hir::TraitItem<'_>) { 3,789 ( 0.00%) if let hir::TraitItemKind::Fn(ref sig, ref eid) = item.kind { 4,944 ( 0.00%) let is_public = cx.effective_visibilities.is_exported(item.owner_id.def_id); 70,437 ( 0.00%) => ???:::is_exported (1,236x) 2,472 ( 0.00%) let fn_header_span = item.span.with_hi(sig.decl.output.span().hi()); . 11,124 ( 0.00%) let attrs = cx.tcx.hir_attrs(item.hir_id()); 75,958 ( 0.00%) => ???:::hir_attrs (1,236x) 11,822 ( 0.00%) let attr = find_attr!(cx.tcx, item.hir_id(), MustUse { span, reason } => (span, reason)); 77,596 ( 0.00%) => ???:>::get_attrs (1,236x) . if let Some((attr_span, reason)) = attr { 26 ( 0.00%) check_needless_must_use( 1,190 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/functions/must_use.rs:clippy_lints::functions::must_use::check_needless_must_use (2x) . cx, . sig.decl, . item.owner_id, . item.span, . fn_header_span, . *attr_span, 4 ( 0.00%) *reason, . attrs, . sig, . ); 5,508 ( 0.00%) } else if let hir::TraitFn::Provided(eid) = *eid { 572 ( 0.00%) let body = cx.tcx.hir_body(eid); 19,377 ( 0.00%) => ???:::hir_body (286x) 572 ( 0.00%) if attr.is_none() && is_public && !is_proc_macro(attrs) { 3,380 ( 0.00%) check_must_use_candidate( 181,595 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/functions/must_use.rs:clippy_lints::functions::must_use::check_must_use_candidate (260x) . cx, . sig.decl, . body, . item.span, 520 ( 0.00%) item.ident.span, . item.owner_id, . "this method could have a `#[must_use]` attribute", . ); . } . } . } 1,263 ( 0.00%) } . . // FIXME: needs to be an EARLY LINT. all attribute lints should be . #[expect(clippy::too_many_arguments)] 348 ( 0.00%) fn check_needless_must_use( . cx: &LateContext<'_>, . decl: &hir::FnDecl<'_>, . item_id: hir::OwnerId, . item_span: Span, . fn_header_span: Span, . attr_span: Span, . reason: Option, . attrs: &[Attribute], . sig: &FnSig<'_>, . ) { 58 ( 0.00%) if item_span.in_external_macro(cx.sess().source_map()) { . return; . } . if returns_unit(decl) { . span_lint_and_then( . cx, . MUST_USE_UNIT, . fn_header_span, . "this unit-returning function has a `#[must_use]` attribute", -- line 150 ---------------------------------------- -- line 156 ---------------------------------------- . // could be re-added. . if attrs.len() == 1 { . diag.span_suggestion(attr_span, "remove the attribute", "", Applicability::MachineApplicable); . } else { . diag.span_help(attr_span, "remove `must_use`"); . } . }, . ); 29 ( 0.00%) } else if reason.is_none() 261 ( 0.00%) && let Some(return_must_use_path) = opt_must_use_path(cx, return_ty(cx, item_id)) 31,512 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::opt_must_use_path (29x) 3,247 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::return_ty (29x) . { . // Ignore async functions unless Future::Output type is a must_use type . if sig.header.is_async() . && let Some(future_ty) = cx.tcx.get_impl_future_output_ty(return_ty(cx, item_id)) . && opt_must_use_path(cx, future_ty).is_none() . { . return; . } -- line 173 ---------------------------------------- -- line 197 ---------------------------------------- . diag.span_suggestion(attr_span, "remove the attribute", "", Applicability::MachineApplicable); . } else { . diag.span_help(attr_span, "remove `must_use`"); . } . diag.note("alternatively, you may add an explicit reason to the `must_use` attribute"); . }, . ); . } 232 ( 0.00%) } . 16,604 ( 0.00%) fn check_must_use_candidate<'tcx>( . cx: &LateContext<'tcx>, . decl: &'tcx hir::FnDecl<'_>, . body: &'tcx hir::Body<'_>, . item_span: Span, . ident_span: Span, . item_id: hir::OwnerId, . msg: &'static str, . ) { 3,558 ( 0.00%) if has_mutable_arg(cx, body) 2,031 ( 0.00%) || mutates_static(cx, body) 2,700 ( 0.00%) || item_span.in_external_macro(cx.sess().source_map()) 1 ( 0.00%) || returns_unit(decl) 3,035 ( 0.00%) || !cx.effective_visibilities.is_exported(item_id.def_id) 34,599 ( 0.00%) => ???:::is_exported (607x) 4,856 ( 0.00%) || opt_must_use_path(cx, return_ty(cx, item_id)).is_some() 2,956,004 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::opt_must_use_path (607x) 122,221 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::return_ty (607x) . || item_span.from_expansion() 2,964 ( 0.00%) || is_entrypoint_fn(cx, item_id.def_id.to_def_id()) 31,616 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_entrypoint_fn (494x) . { . return; . } 5,434 ( 0.00%) span_lint_and_then(cx, MUST_USE_CANDIDATE, ident_span, msg, |diag| { 555,248 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then:: (494x) . let indent = snippet_indent(cx, item_span).unwrap_or_default(); . diag.span_suggestion( . item_span.shrink_to_lo(), . "add the attribute", . format!("#[must_use]\n{indent}"), . Applicability::MachineApplicable, . ); . }); 9,488 ( 0.00%) } . . fn returns_unit(decl: &hir::FnDecl<'_>) -> bool { 58 ( 0.00%) match decl.output { . hir::FnRetTy::DefaultReturn(_) => true, 3,180 ( 0.00%) hir::FnRetTy::Return(ty) => match ty.kind { . hir::TyKind::Tup(tys) => tys.is_empty(), . hir::TyKind::Never => true, . _ => false, . }, . } . } . . fn has_mutable_arg(cx: &LateContext<'_>, body: &hir::Body<'_>) -> bool { . let mut tys = DefIdSet::default(); . body.params.iter().any(|param| is_mutable_pat(cx, param.pat, &mut tys)) . } . . fn is_mutable_pat(cx: &LateContext<'_>, pat: &hir::Pat<'_>, tys: &mut DefIdSet) -> bool { 2,852 ( 0.00%) if let hir::PatKind::Wild = pat.kind { . return false; // ignore `_` patterns . } 8,556 ( 0.00%) if cx.tcx.has_typeck_results(pat.hir_id.owner.def_id) { 341,510 ( 0.00%) => ???:::has_typeck_results (1,426x) 12,834 ( 0.00%) is_mutable_ty(cx, cx.tcx.typeck(pat.hir_id.owner.def_id).pat_ty(pat), tys) 20,136,730 ( 0.17%) => site/frontend/rust-clippy/clippy_lints/src/functions/must_use.rs:clippy_lints::functions::must_use::is_mutable_ty (1,426x) 205,822 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/query/plumbing.rs:::typeck:: (1,426x) 57,052 ( 0.00%) => ???:::pat_ty (1,426x) . } else { . false . } . } . 35,220 ( 0.00%) fn is_mutable_ty<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>, tys: &mut DefIdSet) -> bool { 27,260 ( 0.00%) match *ty.kind() { . // primitive types are never mutable . ty::Bool | ty::Char | ty::Int(_) | ty::Uint(_) | ty::Float(_) | ty::Str => false, 4,516 ( 0.00%) ty::Adt(adt, args) => { 22,340 ( 0.00%) tys.insert(adt.did()) && !ty.is_freeze(cx.tcx, cx.typing_env()) 24,557,016 ( 0.20%) => ???:::is_freeze (2,218x) 46,578 ( 0.00%) => ???:::typing_env (2,218x) 11,205 ( 0.00%) || matches!(cx.tcx.get_diagnostic_name(adt.did()), Some(sym::Rc | sym::Arc)) 132,120 ( 0.00%) => ???:::get_diagnostic_name (2,231x) . && args.types().any(|ty| is_mutable_ty(cx, ty, tys)) . }, 102 ( 0.00%) ty::Tuple(args) => args.iter().any(|ty| is_mutable_ty(cx, ty, tys)), 66,082 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/functions/must_use.rs:clippy_lints::functions::must_use::is_mutable_ty'2 (27x) 148 ( 0.00%) ty::Array(ty, _) | ty::Slice(ty) => is_mutable_ty(cx, ty, tys), 4,510 ( 0.00%) ty::RawPtr(ty, mutbl) | ty::Ref(_, ty, mutbl) => mutbl == hir::Mutability::Mut || is_mutable_ty(cx, ty, tys), . // calling something constitutes a side effect, so return true on all callables . // also never calls need not be used, so return true for them, too . _ => true, . } 28,176 ( 0.00%) } . . fn is_mutated_static(e: &hir::Expr<'_>) -> bool { . use hir::ExprKind::{Field, Index, Path}; . 928 ( 0.00%) match e.kind { 80 ( 0.00%) Path(QPath::Resolved(_, path)) => !matches!(path.res, Res::Local(_)), . Path(_) => true, . Field(inner, _) | Index(inner, _, _) => is_mutated_static(inner), . _ => false, . } . } . . fn mutates_static<'tcx>(cx: &LateContext<'tcx>, body: &'tcx hir::Body<'_>) -> bool { . for_each_expr_without_closures(body.value, |e| { . use hir::ExprKind::{AddrOf, Assign, AssignOp, Call, MethodCall}; . 67,756 ( 0.00%) match e.kind { 2,631 ( 0.00%) Call(_, args) => { . let mut tys = DefIdSet::default(); . for arg in args { 4,500 ( 0.00%) if cx.tcx.has_typeck_results(arg.hir_id.owner.def_id) 212,990 ( 0.00%) => ???:::has_typeck_results (900x) 10,800 ( 0.00%) && is_mutable_ty(cx, cx.tcx.typeck(arg.hir_id.owner.def_id).expr_ty(arg), &mut tys) 1,670,927 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/functions/must_use.rs:clippy_lints::functions::must_use::is_mutable_ty (900x) 128,628 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/query/plumbing.rs:::typeck:: (900x) 36,140 ( 0.00%) => ???:::expr_ty (900x) . && is_mutated_static(arg) . { . return ControlFlow::Break(()); . } . tys.clear(); . } . ControlFlow::Continue(()) . }, 3,320 ( 0.00%) MethodCall(_, receiver, args, _) => { . let mut tys = DefIdSet::default(); . for arg in std::iter::once(receiver).chain(args.iter()) { 5,845 ( 0.00%) if cx.tcx.has_typeck_results(arg.hir_id.owner.def_id) 278,614 ( 0.00%) => ???:::has_typeck_results (1,169x) 15,133 ( 0.00%) && is_mutable_ty(cx, cx.tcx.typeck(arg.hir_id.owner.def_id).expr_ty(arg), &mut tys) 3,580,038 ( 0.03%) => site/frontend/rust-clippy/clippy_lints/src/functions/must_use.rs:clippy_lints::functions::must_use::is_mutable_ty (1,169x) 168,311 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/query/plumbing.rs:::typeck:: (1,169x) 46,844 ( 0.00%) => ???:::expr_ty (1,169x) 2 ( 0.00%) && is_mutated_static(arg) . { . return ControlFlow::Break(()); . } . tys.clear(); . } . ControlFlow::Continue(()) 828 ( 0.00%) }, 5 ( 0.00%) Assign(target, ..) | AssignOp(_, target, _) | AddrOf(_, hir::Mutability::Mut, target) 123 ( 0.00%) if is_mutated_static(target) => . { . ControlFlow::Break(()) . }, . _ => ControlFlow::Continue(()), . } . }) . .is_some() . } -- line 334 ---------------------------------------- 147,135 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/itertools-0.15.0/src/tuple_impl.rs -------------------------------------------------------------------------------- Ir -- line 185 ---------------------------------------- . impl Iterator for TupleWindows . where . I: Iterator, . T: HomogeneousTuple + Clone, . T::Item: Clone, . { . type Item = T; . 14,163 ( 0.00%) fn next(&mut self) -> Option { . if T::num_items() == 1 { . return T::collect_from_iter_no_buf(&mut self.iter); . } 12,552 ( 0.00%) if let Some(new) = self.iter.next() { 8,806 ( 0.00%) if let Some(ref mut last) = self.last { . last.left_shift_push(new); 12,596 ( 0.00%) Some(last.clone()) . } else { . use std::iter::once; . let iter = once(new).chain(&mut self.iter); 4,716 ( 0.00%) self.last = T::collect_from_iter_no_buf(iter); 22,424 ( 0.00%) => /home/moon/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/itertools-0.15.0/src/tuple_impl.rs:<(clippy_lints::manual_clamp::MaybeBorrowedStmtKind, clippy_lints::manual_clamp::MaybeBorrowedStmtKind) as itertools::tuple_impl::TupleCollect>::collect_from_iter_no_buf::, &mut core::iter::adapters::chain::Chain, clippy_lints::manual_clamp::block_stmt_with_last::{closure#0}>, core::option::IntoIter>>> (786x) . self.last.clone() . } . } else { 786 ( 0.00%) None . } 23,605 ( 0.00%) } . . fn size_hint(&self) -> (usize, Option) { . let mut sh = self.iter.size_hint(); . // Adjust the size hint at the beginning . // OR when `num_items == 1` (but it does not change the size hint). . if self.last.is_none() { . sh = size_hint::sub_scalar(sh, T::num_items() - 1); . } -- line 218 ---------------------------------------- -- line 366 ---------------------------------------- . if i < s.len() { . s[i] = $Y; . i += 1; . } . )* . return None; . } . 786 ( 0.00%) fn collect_from_iter_no_buf(iter: I) -> Option . where I: IntoIterator . { . let mut iter = iter.into_iter(); . 4,716 ( 0.00%) Some(($( . { let $Y = iter.next()?; $Y }, . )*)) 786 ( 0.00%) } . . fn num_items() -> usize { . count_ident!($($Y)*) . } . . /// Shift all elements one position to the left and push the new item to the end. . fn left_shift_push(&mut self, mut item: A) { . use std::mem::replace; -- line 390 ---------------------------------------- 7,079 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/thread_local/native/mod.rs -------------------------------------------------------------------------------- Ir -- line 67 ---------------------------------------- . = $crate::thread::local_impl::EagerStorage::new(__RUST_STD_INTERNAL_INIT); . __RUST_STD_INTERNAL_VAL.get() . } . } else { . |_| { . #[thread_local] . $(#[$align_attr])* . static __RUST_STD_INTERNAL_VAL: $t = __RUST_STD_INTERNAL_INIT; 2,567,652 ( 0.02%) &__RUST_STD_INTERNAL_VAL . } . } . }) . } . }}, . . // used to generate the `LocalKey` value for `thread_local!` . (@key $t:ty, $(#[$align_attr:meta])*, $init:expr) => {{ -- line 83 ---------------------------------------- -- line 97 ---------------------------------------- . __RUST_STD_INTERNAL_VAL.get_or_init(__rust_std_internal_init, __rust_std_internal_init_fn) . } . } else { . |__rust_std_internal_init| { . #[thread_local] . $(#[$align_attr])* . static __RUST_STD_INTERNAL_VAL: $crate::thread::local_impl::LazyStorage<$t, !> . = $crate::thread::local_impl::LazyStorage::new(); 120 ( 0.00%) __RUST_STD_INTERNAL_VAL.get_or_init(__rust_std_internal_init, __rust_std_internal_init_fn) . } . } . }) . } . }}, . } . . #[rustc_macro_transparency = "semiopaque"] -- line 113 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 505,351 ( 0.00%) if let ExprKind::If(cond, then, r#else) = expr.kind 13,930 ( 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. 94 ( 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(); 217 ( 0.00%) if !eq.eq_expr(SyntaxContext::root(), divisor, divisor) { 43,960 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:::eq_expr (31x) . return; . } . . let mut division_spans = Vec::new(); 22 ( 0.00%) let mut first_use = None; . 242 ( 0.00%) let found_early_use = for_each_expr_without_closures(block, |e| { 87,529 ( 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}> (22x) 1,770 ( 0.00%) if let ExprKind::Binary(binop, lhs, rhs) = e.kind 8 ( 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) 2,093 ( 0.00%) } else if eq.eq_expr(SyntaxContext::root(), e, divisor) { 6,046 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:::eq_expr (24x) 22 ( 0.00%) if first_use.is_none() { 22 ( 0.00%) first_use = Some(UseKind::Other); . return ControlFlow::Break(()); . } . ControlFlow::<(), _>::Continue(Descend::Yes) . } else { . ControlFlow::<(), _>::Continue(Descend::Yes) . } . }); . 44 ( 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`"); . }); 31 ( 0.00%) } 1,937,824 ( 0.02%) } . } . . #[derive(Copy, Clone, Eq, PartialEq)] . enum UseKind { . Division, . Other, . } . . fn divisor_from_condition<'tcx>(cond: &'tcx Expr<'tcx>) -> Option<(&'tcx Expr<'tcx>, NonZeroBranch)> { 11,491 ( 0.00%) let ExprKind::Binary(binop, lhs, rhs) = cond.kind else { . return None; . }; . 13,500 ( 0.00%) match binop.node { . BinOpKind::Ne | BinOpKind::Lt if is_zero(lhs) => Some((rhs, NonZeroBranch::Then)), 49 ( 0.00%) BinOpKind::Ne | BinOpKind::Gt if is_zero(rhs) => Some((lhs, NonZeroBranch::Then)), . BinOpKind::Eq if is_zero(lhs) => Some((rhs, NonZeroBranch::Else)), 188 ( 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>> { 156 ( 0.00%) match branch { 48 ( 0.00%) NonZeroBranch::Then => match then.kind { . ExprKind::Block(block, _) => Some(block), . _ => None, . }, 29 ( 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 { 470 ( 0.00%) matches!(cx.typeck_results().expr_ty(expr).peel_refs().kind(), ty::Uint(_)) 3,760 ( 0.00%) => ???:::expr_ty (94x) . } 7,099 ( 0.00%) -------------------------------------------------------------------------------- -- 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; . 29,442 ( 0.00%) pub(super) fn check(cx: &EarlyContext<'_>, lit_span: Span, suffix: &str, lit_snip: &str) { . let num_end_idx = match lit_snip.strip_suffix(suffix) { 4,963 ( 0.00%) Some(p) if p.ends_with('_') => lit_snip.len() - (suffix.len() + 1), . Some(_) => lit_snip.len() - suffix.len(), . None => lit_snip.len(), . }; . 4,206 ( 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 { 23,452 ( 0.00%) b'a'..=b'f' => seen.0 = true, 14,148 ( 0.00%) b'A'..=b'F' => seen.1 = true, . _ => {}, . } 20,993 ( 0.00%) 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; . } . } 16,824 ( 0.00%) } 4,262 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/non_copy_const.rs -------------------------------------------------------------------------------- Ir -- line 181 ---------------------------------------- . (Self::Maybe, _) | (_, Self::Maybe) | (Self::No, Self::Yes) | (Self::Yes, Self::No) => Self::Maybe, . (Self::No, Self::No) => Self::No, . (Self::Yes, Self::Yes) => Self::Yes, . }) . } . . /// Merges the fields of a product type (e.g. a struct or tuple). . fn from_fields(mut iter: impl Iterator) -> Self { 7 ( 0.00%) iter.try_fold(Self::Yes, |x, y| match (x, y) { 6,515 ( 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:, ::is_ty_freeze::{closure#2}> as core::iter::traits::iterator::Iterator>::try_fold::::from_fields, ::is_ty_freeze::{closure#2}>>::{closure#0}, core::option::Option> (1x) . (Self::No, _) | (_, Self::No) => None, . (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 { 2,202 ( 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)) 15,692 ( 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. 29,364 ( 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) { 4,800 ( 0.00%) Entry::Occupied(e) => *e.get(), . Entry::Vacant(e) => { . let e = e.insert(IsFreeze::Yes); 282 ( 0.00%) if ty.is_freeze(tcx, typing_env) { 431,480 ( 0.00%) => ???:::is_freeze (46x) . return IsFreeze::Yes; . } 14 ( 0.00%) let is_freeze = match *ty.kind() { 4 ( 0.00%) 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, 2 ( 0.00%) ty::Adt(adt, args) if adt.is_enum() => IsFreeze::from_variants(adt.variants().iter().map(|v| { . IsFreeze::from_fields( . v.fields . .iter() . .map(|f| self.is_ty_freeze(tcx, typing_env, f.ty(tcx, args).skip_norm_wip())), . ) . })), . // Workaround for `ManuallyDrop`-like unions. . ty::Adt(adt, args) 1 ( 0.00%) if adt.is_union() . && adt.non_enum_variant().fields.iter().any(|f| { . tcx.layout_of(typing_env.as_query_input(f.ty(tcx, args).skip_norm_wip())) . .is_ok_and(|l| l.layout.size().bytes() == 0) . }) => . { . return IsFreeze::Yes; . }, . // Rust doesn't have the concept of an active union field so we have . // to treat all fields as active. 1 ( 0.00%) ty::Adt(adt, args) => IsFreeze::from_fields( 1 ( 0.00%) adt.non_enum_variant() 8 ( 0.00%) => ???:::non_enum_variant (1x) . .fields . .iter() 12 ( 0.00%) .map(|f| self.is_ty_freeze(tcx, typing_env, f.ty(tcx, args).skip_norm_wip())), 6,098 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/non_copy_const.rs:::is_ty_freeze'2 (1x) 363 ( 0.00%) => ???:::ty (1x) . ), . ty::Array(ty, _) | ty::Pat(ty, _) => self.is_ty_freeze(tcx, typing_env, ty), . ty::Tuple(tys) => { . IsFreeze::from_fields(tys.iter().map(|ty| self.is_ty_freeze(tcx, typing_env, ty))) . }, . // Treat type parameters as though they were `Freeze`. . ty::Param(_) | ty::Alias(..) => return IsFreeze::Yes, . // TODO: check other types. -- line 327 ---------------------------------------- -- line 331 ---------------------------------------- . }, . }; . if !is_freeze.is_freeze() { . self.freeze_tys.insert(ty, is_freeze); . } . is_freeze . }, . } 19,576 ( 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> { 41,566 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) { 11,876 ( 0.00%) if let ItemKind::Const(ident, .., ct_rhs) = item.kind 173 ( 0.00%) && !ident.is_special() 1,038 ( 0.00%) && let ty = cx.tcx.type_of(item.owner_id).instantiate_identity().skip_norm_wip() 1,733 ( 0.00%) && match self.is_ty_freeze(cx.tcx, cx.typing_env(), ty) { 266,873 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/non_copy_const.rs:::is_ty_freeze (173x) 3,633 ( 0.00%) => ???:::typing_env (173x) . 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(), . cx.tcx.typeck(item.owner_id), . GenericArgs::identity_for_item(cx.tcx, item.owner_id), . e . )), . }, . } 3 ( 0.00%) && !item.span.in_external_macro(cx.sess().source_map()) . // Only needed when compiling `std` . && !is_thread_local(cx, item) . { . span_lint_and_then( . cx, . DECLARE_INTERIOR_MUTABLE_CONST, . ident.span, . "named constant with interior mutability", -- line 744 ---------------------------------------- -- 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"); . } . }, . ); . } 47,504 ( 0.00%) } . 10,104 ( 0.00%) fn check_trait_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx TraitItem<'_>) { 2,526 ( 0.00%) if let TraitItemKind::Const(_, ct_rhs_opt) = item.kind 12 ( 0.00%) && let ty = cx.tcx.type_of(item.owner_id).instantiate_identity().skip_norm_wip() 42 ( 0.00%) && match self.is_ty_freeze(cx.tcx, cx.typing_env(), ty) { 267 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/non_copy_const.rs:::is_ty_freeze (3x) 63 ( 0.00%) => ???:::typing_env (3x) . 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 . }, . // FIXME: we just assume mgca rhs's are freeze . _ => const_item_rhs_to_expr(cx.tcx, ct_rhs).is_some_and(|e| { -- line 770 ---------------------------------------- -- line 784 ---------------------------------------- . { . span_lint( . cx, . DECLARE_INTERIOR_MUTABLE_CONST, . item.ident.span, . "named constant with interior mutability", . ); . } 10,104 ( 0.00%) } . 28,777 ( 0.00%) fn check_impl_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx ImplItem<'_>) { 8,222 ( 0.00%) if let ImplItemKind::Const(_, ct_rhs) = item.kind 204 ( 0.00%) && let ty = cx.tcx.type_of(item.owner_id).instantiate_identity().skip_norm_wip() 1,020 ( 0.00%) && match self.is_ty_freeze(cx.tcx, cx.typing_env(), ty) { 5,138 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/non_copy_const.rs:::is_ty_freeze (68x) 1,428 ( 0.00%) => ???:::typing_env (68x) . 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 . && let Some(of_trait) = impl_block.of_trait . && let Some(trait_id) = of_trait.trait_ref.trait_def_id() -- line 805 ---------------------------------------- -- line 843 ---------------------------------------- . { . span_lint( . cx, . DECLARE_INTERIOR_MUTABLE_CONST, . item.ident.span, . "named constant with interior mutability", . ); . } 32,888 ( 0.00%) } . 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 592,098 ( 0.00%) if let ExprKind::Path(qpath) = &e.kind . && let typeck = cx.typeck_results() 1,537,047 ( 0.01%) && let Res::Def(DefKind::Const { .. } | DefKind::AssocConst { .. }, did) = typeck.qpath_res(qpath, e.hir_id) 2,295,618 ( 0.02%) => ???:::qpath_res (107,642x) . // As of `1.80` constant contexts can't borrow any type with interior mutability 9,556 ( 0.00%) && !is_in_const_context(cx) 853,719 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_const_context (2,389x) 33,030 ( 0.00%) && !self.is_ty_freeze(cx.tcx, cx.typing_env(), typeck.expr_ty(e)).is_freeze() 342,190 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/non_copy_const.rs:::is_ty_freeze (2,202x) 88,116 ( 0.00%) => ???:::expr_ty (2,202x) 66,060 ( 0.00%) => ???:::typing_env (2,202x) . && 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"); . }, . ); . } 1,937,824 ( 0.02%) } . } . . struct ReplaceAssocFolder<'tcx> { . tcx: TyCtxt<'tcx>, . trait_id: DefId, . self_ty: Ty<'tcx>, . } . impl<'tcx> TypeFolder> for ReplaceAssocFolder<'tcx> { -- line 900 ---------------------------------------- 112,849 ( 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}; . 23,120 ( 0.00%) pub(super) fn check_match<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, arms: &'tcx [Arm<'_>], msrv: Msrv) { 5,065 ( 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); 37,980 ( 0.00%) check_arm( 162,014,223 ( 1.35%) => site/frontend/rust-clippy/clippy_lints/src/matches/collapsible_match.rs:clippy_lints::matches::collapsible_match::check_arm (3,798x) . cx, 3,798 ( 0.00%) arm.span.ctxt(), . true, 3,798 ( 0.00%) arm.pat, . expr, 3,798 ( 0.00%) arm.body, . arm.guard, . Some(els_arm.body), . msrv, . only_wildcards_after, . ); . } . } 18,496 ( 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, . ) { 15,984 ( 0.00%) check_arm(cx, ctxt, false, pat, let_expr, body, None, else_expr, msrv, false); 364,303,761 ( 3.03%) => site/frontend/rust-clippy/clippy_lints/src/matches/collapsible_match.rs:clippy_lints::matches::collapsible_match::check_arm (1,998x) . } . . #[expect(clippy::too_many_arguments, clippy::too_many_lines)] 86,940 ( 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); 26,833 ( 0.00%) if let Some(inner) = IfLetOrMatch::parse(cx, inner_expr) 306,542 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::parse (5,796x) 2,578 ( 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, ..) => { 392 ( 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" 25 ( 0.00%) && let Some(wild_idx) = arms.iter().rposition(|a| arm_is_wild_like(cx, a)) . { 24 ( 0.00%) let (then, els) = (&arms[1 - wild_idx], &arms[wild_idx]); 40 ( 0.00%) Some((scrutinee, then.pat, Some(els.body))) . } else { . None . } . }, . } 1,162 ( 0.00%) && outer_pat.span.eq_ctxt(inner_scrutinee.span) . // match expression must be a local binding . // match { .. } 2,324 ( 0.00%) && let Some(binding_id) = peel_ref_operators(cx, inner_scrutinee).res_local_id() 11,067 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::peel_ref_operators (581x) 2,805 ( 0.00%) && !pat_contains_disallowed_or(cx, inner_then_pat, msrv) 36,381 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/matches/mod.rs:clippy_lints::matches::pat_contains_disallowed_or (561x) . // the binding must come from the pattern of the containing match arm . // .... => match { .. } 4,201 ( 0.00%) && let (Some((binding_ident, binding_span)), is_innermost_parent_pat_struct) = 1,122 ( 0.00%) find_pat_binding_and_is_innermost_parent_pat_struct(outer_pat, binding_id) 71,564 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/matches/collapsible_match.rs:clippy_lints::matches::collapsible_match::find_pat_binding_and_is_innermost_parent_pat_struct (561x) . // the "else" branches must be equal 2,600 ( 0.00%) && match (outer_else_body, inner_else_body) { . (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), . } . // the binding must not be used in the if guard . && outer_guard.is_none_or(|e| !is_local_used(cx, e, binding_id)) . // ...or anywhere in the inner expression 520 ( 0.00%) && match inner { . IfLetOrMatch::IfLet(_, _, body, els, _) => { 2,600 ( 0.00%) !is_local_used(cx, body, binding_id) && els.is_none_or(|e| !is_local_used(cx, e, binding_id)) . }, . IfLetOrMatch::Match(_, arms, ..) => !arms.iter().any(|arm| is_local_used(cx, arm, binding_id)), . } . // Check if the inner expression contains any borrows/dereferences 2,080 ( 0.00%) && let ref_types = get_ref_operators(cx, inner_scrutinee) 19,240 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_ref_operators (520x) 4,160 ( 0.00%) && let Some(method) = build_ref_method_chain(ref_types) 16,120 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/matches/collapsible_match.rs:clippy_lints::matches::collapsible_match::build_ref_method_chain (520x) . { 3,120 ( 0.00%) let msg = format!( . "this `{}` can be collapsed into the outer `{}`", 4,160 ( 0.00%) if matches!(inner, IfLetOrMatch::Match(..)) { . "match" . } else { . "if let" . }, 3,120 ( 0.00%) if outer_is_match { "match" } else { "if let" }, . ); . // collapsing patterns need an explicit field name in struct pattern matching . // ex: Struct {x: Some(1)} 1,040 ( 0.00%) let replace_msg = if is_innermost_parent_pat_struct { 1,518 ( 0.00%) format!(", prefixed by `{binding_ident}: `") . } else { . String::new() . }; 4,160 ( 0.00%) span_lint_hir_and_then(cx, COLLAPSIBLE_MATCH, inner_expr.hir_id, inner_expr.span, msg, |diag| { 2,600 ( 0.00%) let mut help_span = MultiSpan::from_spans(vec![binding_span, inner_then_pat.span]); 74,880 ( 0.00%) => ???:::from_spans (520x) . help_span.push_span_label(binding_span, "replace this binding"); 2,080 ( 0.00%) help_span.push_span_label(inner_then_pat.span, format!("with this pattern{replace_msg}")); 520 ( 0.00%) if !method.is_empty() { . 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", . ); . }); 10,608 ( 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 280 ( 0.00%) && let Some(inner) = If::hir(inner_expr) 140 ( 0.00%) && outer_pat.span.eq_ctxt(inner.cond.span) 390 ( 0.00%) && match (outer_else_body, inner.r#else) { . (None, None) => true, . (None, Some(e)) | (Some(e), None) => is_unit_expr(e), 18 ( 0.00%) (Some(a), Some(b)) => SpanlessEq::new(cx).eq_expr(ctxt, a, b), 11,199 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:::eq_expr (6x) . } 168 ( 0.00%) && !pat_bindings_moved_or_mutated(cx, outer_pat, inner.cond) . { . span_lint_hir_and_then( . cx, 112 ( 0.00%) COLLAPSIBLE_MATCH, 112 ( 0.00%) inner_expr.hir_id, 56 ( 0.00%) inner_expr.span, . "this `if` can be collapsed into the outer `match`", . |diag| { 168 ( 0.00%) let outer_arrow_end = if let Some(outer_guard) = outer_guard { . outer_guard.span.shrink_to_hi() . } else { 56 ( 0.00%) outer_pat.span.shrink_to_hi() . }; 392 ( 0.00%) let (paren_start, inner_if_span, paren_end) = peel_parens(cx, inner_expr.span); 49,542 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/collapsible_if.rs:clippy_lints::collapsible_if::peel_parens (56x) 168 ( 0.00%) let inner_if = inner_if_span.split_at(2).0; 13,939 ( 0.00%) => ???:::split_at (56x) 280 ( 0.00%) let mut sugg = vec![(inner.then.span.shrink_to_lo(), "=> ".to_string())]; 112 ( 0.00%) if matches!(outer_then_body.kind, ExprKind::Block(..)) { 224 ( 0.00%) let outer_then_open_bracket = outer_then_body . .span 112 ( 0.00%) .split_at(1) 13,939 ( 0.00%) => ???:::split_at (56x) . .0 56 ( 0.00%) .with_leading_whitespace(cx) 224 ( 0.00%) .into_span(); 896 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/source.rs: as clippy_utils::source::IntoSpan>::into_span (56x) . let outer_then_closing_bracket = { 56 ( 0.00%) let end = outer_then_body.span.shrink_to_hi(); . end.with_lo(end.lo() - BytePos(1)) 56 ( 0.00%) .with_leading_whitespace(cx) 168 ( 0.00%) .into_span() 896 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/source.rs: as clippy_utils::source::IntoSpan>::into_span (56x) . }; 112 ( 0.00%) sugg.push((outer_arrow_end.to(outer_then_open_bracket), String::new())); 6,104 ( 0.00%) => ???:::to (56x) . sugg.push((outer_then_closing_bracket, String::new())); . } else { . sugg.push((outer_arrow_end.until(inner_if), " ".to_string())); . } . 168 ( 0.00%) if let Some(outer_guard) = outer_guard { . sugg.extend(parens_around(outer_guard)); . sugg.push((inner_if, "&&".to_string())); . } . 56 ( 0.00%) if !paren_start.is_empty() { . sugg.push((paren_start, String::new())); . } . 112 ( 0.00%) if !paren_end.is_empty() { . sugg.push((paren_end, String::new())); . } . 56 ( 0.00%) sugg.extend(parens_around(inner.cond)); 1,680 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/collapsible_if.rs:clippy_lints::collapsible_if::parens_around (56x) . 168 ( 0.00%) if let Some(else_inner) = inner.r#else { . let else_inner_span = inner.then.span.shrink_to_hi().to(else_inner.span); . sugg.push((else_inner_span, String::new())); . } . 224 ( 0.00%) diag.multipart_suggestion("collapse nested if block", sugg, Applicability::MachineApplicable); . }, . ); . } 46,368 ( 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 { 7,953 ( 0.00%) if arm.guard.is_some() { . return false; . } 32,531 ( 0.00%) matches!(arm.pat.kind, PatKind::Binding(..) | PatKind::Wild) || is_none_pattern(cx, arm.pat) 600 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_none_pattern (48x) . } . 3,366 ( 0.00%) fn find_pat_binding_and_is_innermost_parent_pat_struct(pat: &Pat<'_>, hir_id: HirId) -> (Option<(Ident, Span)>, bool) { 561 ( 0.00%) let mut binding = None; 1,122 ( 0.00%) let mut is_innermost_parent_pat_struct = false; 13,761 ( 0.00%) pat.walk_short(|p| match p.kind { . // ignore OR patterns . PatKind::Or(_) => false, . PatKind::Binding(_bm, _, ident, _) => { . let found = p.hir_id == hir_id; 532 ( 0.00%) if found { 4,160 ( 0.00%) binding = Some((ident, p.span)); . } . !found . }, . _ => { 3,315 ( 0.00%) is_innermost_parent_pat_struct = matches!(p.kind, PatKind::Struct(..)); . true . }, . }); 3,366 ( 0.00%) (binding, is_innermost_parent_pat_struct) 1,683 ( 0.00%) } . . /// Builds a chain of reference-manipulation method calls (e.g., `.as_ref()`, `.as_mut()`, . /// `.copied()`) based on reference operators 4,160 ( 0.00%) fn build_ref_method_chain(expr: Vec<&Expr<'_>>) -> Option { . let mut req_method_calls = String::new(); . . for ref_operator in expr { . match ref_operator.kind { . ExprKind::AddrOf(BorrowKind::Raw, _, _) => { . return None; . }, . ExprKind::AddrOf(_, m, _) if m.is_mut() => { -- line 254 ---------------------------------------- -- line 260 ---------------------------------------- . // Deref operator is the only operator that this function should have received . ExprKind::Unary(_, _) => { . req_method_calls.push_str(".copied()"); . }, . _ => (), . } . } . 2,600 ( 0.00%) Some(req_method_calls) 4,160 ( 0.00%) } . . /// Checks if any of the bindings in the `pat` are moved or mutated in the `expr`. It is invalid to . /// move or mutate bindings in `if` guards. . fn pat_bindings_moved_or_mutated<'tcx>(cx: &LateContext<'tcx>, pat: &Pat<'tcx>, expr: &'tcx Expr<'tcx>) -> bool { 392 ( 0.00%) let mut delegate = MovedVarDelegate { . moved: HirIdSet::default(), . }; 56 ( 0.00%) if ExprUseVisitor::for_clippy(cx, expr.hir_id.owner.def_id, &mut delegate) 168 ( 0.00%) .walk_expr(expr) 155,165 ( 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 (56x) . .is_err() . { . return true; . } . 504 ( 0.00%) let mut candidates = delegate.moved; 280 ( 0.00%) if let Some(mutated) = mutated_variables(expr, cx) { 161,941 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/usage.rs:clippy_utils::usage::mutated_variables (56x) 56 ( 0.00%) candidates.extend(mutated); 3,864 ( 0.00%) => /rust/deps/indexmap-2.14.0/src/set.rs: as core::iter::traits::collect::Extend>::extend::> (56x) . } . . !pat.walk_short(|pat| { 297 ( 0.00%) if let PatKind::Binding(_, hir_id, ..) = pat.kind . && candidates.contains(&hir_id) . { . return false; . } . true . }) . } . -- line 298 ---------------------------------------- 42,546 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/escape.rs -------------------------------------------------------------------------------- Ir -- line 50 ---------------------------------------- . "using `Box` where unnecessary" . } . . impl_lint_pass!(BoxedLocal => [BOXED_LOCAL]); . . /// Whether `ty` is a `Box` where `T` is not a trait object and is small enough to live on the . /// stack (large types are boxed to avoid stack overflows). . fn is_small_non_trait_box<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>, too_large_for_stack: u64) -> bool { 14,104 ( 0.00%) ty.boxed_ty().is_some_and(|boxed| { 50,856 ( 0.00%) => ???:::boxed_ty (7,052x) 7 ( 0.00%) !boxed.is_trait() && cx.layout_of(boxed).map_or(0, |l| l.size.bytes()) <= too_large_for_stack . }) . } . . struct EscapeDelegate { . set: HirIdSet, . } . . impl<'tcx> LateLintPass<'tcx> for BoxedLocal { 57,160 ( 0.00%) fn check_fn( . &mut self, . cx: &LateContext<'tcx>, . fn_kind: intravisit::FnKind<'tcx>, . _: &'tcx FnDecl<'_>, . body: &'tcx Body<'_>, . _: Span, . fn_def_id: LocalDefId, . ) { . // Skip closures 26,114 ( 0.00%) if matches!(fn_kind, intravisit::FnKind::Closure) { . return; . } . . if let Some(header) = fn_kind.header() 16,299 ( 0.00%) && header.abi != ExternAbi::Rust . { . return; . } . 5,433 ( 0.00%) let parent_id = cx . .tcx 5,433 ( 0.00%) .hir_get_parent_item(cx.tcx.local_def_id_to_hir_id(fn_def_id)) 778,785 ( 0.01%) => ???:::hir_get_parent_item (5,433x) . .def_id; . 5,433 ( 0.00%) let mut trait_self_ty = None; 58,335 ( 0.00%) match cx.tcx.def_kind(parent_id) { . // If the method is an impl for a trait, don't warn. . DefKind::Impl { of_trait: true } => return, . . // find `self` ty for this trait if relevant . DefKind::Trait => { 286 ( 0.00%) trait_self_ty = Some(TraitRef::identity(cx.tcx, parent_id.to_def_id()).self_ty()); . }, . . _ => {}, . } . 5,930 ( 0.00%) let typeck_results = cx.tcx.typeck_body(body.id()); 670,385 ( 0.01%) => ???:::typeck_body (2,965x) . . // Seed the set with the `Box` parameters that could be unboxed. The `ExprUseVisitor` walk . // below then removes any that escape by being moved or borrowed. 5,930 ( 0.00%) let set: HirIdSet = body . .params . .iter() . .filter_map(|param| { . // Only simple bindings (`x: Box<_>`) bind a local that the walk can track and report. 14,110 ( 0.00%) if !matches!(param.pat.kind, PatKind::Binding(..)) { . return None; . } . 21,156 ( 0.00%) let ty = typeck_results.pat_ty(param.pat); 282,092 ( 0.00%) => ???:::pat_ty (7,052x) 7,054 ( 0.00%) if !is_small_non_trait_box(cx, ty, self.too_large_for_stack) { . return None; . } . . // skip `self` parameters whose type contains `Self` (i.e.: `self: Box`), see #4804 3 ( 0.00%) if let Some(trait_self_ty) = trait_self_ty . && cx.tcx.hir_name(param.pat.hir_id) == kw::SelfLower . && ty.contains(trait_self_ty) . { . return None; . } . 2 ( 0.00%) Some(param.pat.hir_id) . }) . .collect(); . . // Without any candidate parameter, the expensive `ExprUseVisitor` walk can never lint. 2,965 ( 0.00%) if set.is_empty() { . return; . } . 6 ( 0.00%) let mut v = EscapeDelegate { set }; . . ExprUseVisitor::for_clippy(cx, fn_def_id, &mut v) 2 ( 0.00%) .consume_body(body) 37,516 ( 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:>::consume_body (1x) . .into_ok(); . 7 ( 0.00%) for node in v.set { . span_lint_hir( . cx, . BOXED_LOCAL, . node, . cx.tcx.hir_span(node), . "local variable doesn't need to be boxed here", . ); . } 45,728 ( 0.00%) } . } . . impl<'tcx> Delegate<'tcx> for EscapeDelegate { . fn consume(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId) { 12 ( 0.00%) if cmt.place.projections.is_empty() 2 ( 0.00%) && let PlaceBase::Local(lid) = cmt.place.base . { . // FIXME(rust/#120456) - is `swap_remove` correct? . self.set.swap_remove(&lid); . } . } . . fn use_cloned(&mut self, _: &PlaceWithHirId<'tcx>, _: HirId) {} . . fn borrow(&mut self, cmt: &PlaceWithHirId<'tcx>, _: HirId, _: ty::BorrowKind) { 10 ( 0.00%) if cmt.place.projections.is_empty() . && let PlaceBase::Local(lid) = cmt.place.base . { . // FIXME(rust/#120456) - is `swap_remove` correct? . self.set.swap_remove(&lid); . } . } . . fn mutate(&mut self, _: &PlaceWithHirId<'tcx>, _: HirId) {} -- line 180 ---------------------------------------- 26,324 ( 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 504,241 ( 0.00%) if let ExprKind::If(cond, then, None) = expr.kind 224 ( 0.00%) && let Some((c, op_node, l)) = get_const(cx, cond) 1,120 ( 0.00%) && let BinOpKind::Ne | BinOpKind::Lt = op_node 75 ( 0.00%) && let ExprKind::Block(block, None) = then.kind 43 ( 0.00%) && let Block { . stmts: 73 ( 0.00%) [ . Stmt { 14 ( 0.00%) kind: StmtKind::Expr(ex) | StmtKind::Semi(ex), . .. . }, . ], . expr: None, . .. . } . | Block { . stmts: [], . expr: Some(ex), . .. 43 ( 0.00%) } = block 45 ( 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, . ); . } 1,937,824 ( 0.02%) } . } . . 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>)> { 19,276 ( 0.00%) if let ExprKind::Binary(op, l, r) = expr.kind { 2,522 ( 0.00%) let ecx = ConstEvalCtxt::new(cx); 141,232 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::new (2,522x) 2,522 ( 0.00%) let ctxt = expr.span.ctxt(); 16,762 ( 0.00%) if let Some(Constant::Int(c)) = ecx.eval_local(r, ctxt) { 1,409,785 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval_local (2,522x) . return Some((c, op.node, l)); . } 11,494 ( 0.00%) if let Some(Constant::Int(c)) = ecx.eval_local(l, ctxt) { 444,517 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval_local (2,298x) . 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 ---------------------------------------- 23,532 ( 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}; . 3,191,821 ( 0.03%) #[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 ---------------------------------------- 1,570,530 ( 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/iter/range.rs -------------------------------------------------------------------------------- Ir -- line 1092 ---------------------------------------- . . NonZero::new(n - taken).map_or(Ok(()), Err) . } . } . . impl RangeIteratorImpl for ops::Range { . #[inline] . fn spec_next(&mut self) -> Option { 159,261 ( 0.00%) if self.start < self.end { . let old = self.start; . // SAFETY: just checked precondition . self.start = unsafe { Step::forward_unchecked(old, 1) }; . Some(old) . } else { . None . } . } -- line 1108 ---------------------------------------- -- line 1134 ---------------------------------------- . // Otherwise 0 is returned which always safe to use. . self.start = unsafe { Step::forward_unchecked(self.start, taken) }; . . NonZero::new(n - taken).map_or(Ok(()), Err) . } . . #[inline] . fn spec_next_back(&mut self) -> Option { 29,440 ( 0.00%) if self.start < self.end { . // SAFETY: just checked precondition . self.end = unsafe { Step::backward_unchecked(self.end, 1) }; . Some(self.end) . } else { . None . } . } . -- line 1150 ---------------------------------------- -- line 1523 ---------------------------------------- . } . . #[stable(feature = "inclusive_range", since = "1.26.0")] . impl Iterator for ops::RangeInclusive { . type Item = A; . . #[inline] . fn next(&mut self) -> Option { 142 ( 0.00%) if self.is_empty() { . return None; . } . . let (n, o) = Step::forward_overflowing(self.start.clone(), 1); . . self.exhausted = o; . Some(mem::replace(&mut self.start, n)) . } -- line 1539 ---------------------------------------- 79,902 ( 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 490,207 ( 0.00%) if let ExprKind::Unary(UnOp::Not, inner) = expr.kind 1,466 ( 0.00%) && let ExprKind::Binary(ref op, left, _) = inner.kind 1,107 ( 0.00%) && let BinOpKind::Le | BinOpKind::Ge | BinOpKind::Lt | BinOpKind::Gt = op.node 348 ( 0.00%) && !expr.span.in_external_macro(cx.sess().source_map()) . { 6 ( 0.00%) let ty = cx.typeck_results().expr_ty(left); 80 ( 0.00%) => ???:::expr_ty (2x) . . let implements_ord = { 10 ( 0.00%) if let Some(id) = cx.tcx.get_diagnostic_item(sym::Ord) { 212 ( 0.00%) => ???:::get_diagnostic_item (2x) 14 ( 0.00%) implements_trait(cx, ty, id, &[]) 48,613 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::implements_trait (2x) . } else { . return; . } . }; . . let implements_partial_ord = { 8 ( 0.00%) if let Some(id) = cx.tcx.lang_items().partial_ord_trait() { 80 ( 0.00%) => ???:::lang_items (2x) 12 ( 0.00%) implements_trait(cx, ty, id, &[ty.into()]) 54,463 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::implements_trait (2x) . } else { . return; . } . }; . 6 ( 0.00%) if implements_partial_ord && !implements_ord { . span_lint( . cx, . NEG_CMP_OP_ON_PARTIAL_ORD, . 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", . ); . } . } 1,937,824 ( 0.02%) } . } 1,594 ( 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. 969,468 ( 0.01%) let var = if let ExprKind::Assign(lhs, ..) | ExprKind::AssignOp(_, lhs, _) = expr.kind . && let Some(var) = lhs.res_local_id() 543 ( 0.00%) && expr.span.desugaring_kind().is_none() 17,372 ( 0.00%) => ???:::desugaring_kind (181x) . { . var . } else { . return; . }; 905 ( 0.00%) let mut visitor = ReadVisitor { . cx, . var, . write_expr: expr, . last_expr: expr, . }; . check_for_unsequenced_reads(&mut visitor); 242,228 ( 0.00%) } . fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx Stmt<'_>) { 167,158 ( 0.00%) match stmt.kind { 20,061 ( 0.00%) StmtKind::Let(local) => { 60,183 ( 0.00%) if let LetStmt { init: Some(e), .. } = local { 58,944 ( 0.00%) DivergenceVisitor { cx }.visit_expr(e); 38,561,436 ( 0.32%) => site/frontend/rust-clippy/clippy_lints/src/mixed_read_write_in_expression.rs:::visit_expr (19,648x) . } . }, 57,545 ( 0.00%) StmtKind::Expr(e) | StmtKind::Semi(e) => DivergenceVisitor { cx }.maybe_walk_expr(e), 6,719,253 ( 0.06%) => site/frontend/rust-clippy/clippy_lints/src/mixed_read_write_in_expression.rs:::maybe_walk_expr (11,509x) . StmtKind::Item(..) => {}, . } . } . } . . struct DivergenceVisitor<'a, 'tcx> { . cx: &'a LateContext<'tcx>, . } . . impl<'tcx> DivergenceVisitor<'_, 'tcx> { 713,380 ( 0.01%) fn maybe_walk_expr(&mut self, e: &'tcx Expr<'_>) { 1,128,868 ( 0.01%) match e.kind { . ExprKind::Closure(..) | ExprKind::If(..) | ExprKind::Loop(..) => {}, 3,894 ( 0.00%) ExprKind::Match(e, arms, _) => { 3,894 ( 0.00%) self.visit_expr(e); 1,742,936 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/mixed_read_write_in_expression.rs:::visit_expr (772x) 444,328 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/mixed_read_write_in_expression.rs:::visit_expr'2 (309x) . for arm in arms { 11,556 ( 0.00%) if let Some(if_expr) = arm.guard { 76 ( 0.00%) self.visit_expr(if_expr); 3,973 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/mixed_read_write_in_expression.rs:::visit_expr (11x) 18,475 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/mixed_read_write_in_expression.rs:::visit_expr'2 (25x) . } . // make sure top level arm expressions aren't linted 11,556 ( 0.00%) self.maybe_walk_expr(arm.body); 780,193 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/mixed_read_write_in_expression.rs:::maybe_walk_expr'2 (3,546x) . } . }, 971,376 ( 0.01%) _ => walk_expr(self, e), 24,224,259 ( 0.20%) => /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:: (27,772x) . } 23,448 ( 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"); . } . } . . fn stmt_might_diverge(stmt: &Stmt<'_>) -> bool { 954 ( 0.00%) !matches!(stmt.kind, StmtKind::Item(..)) . } . . impl<'tcx> Visitor<'tcx> for DivergenceVisitor<'_, 'tcx> { 891,205 ( 0.01%) fn visit_expr(&mut self, e: &'tcx Expr<'_>) { 884,635 ( 0.01%) match e.kind { . // fix #10776 6,072 ( 0.00%) ExprKind::Block(block, ..) => match (block.stmts, block.expr) { . (stmts, Some(e)) if stmts.iter().all(|stmt| !stmt_might_diverge(stmt)) => { . self.visit_expr(e); 58 ( 0.00%) }, . ([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), 18,476 ( 0.00%) ExprKind::Call(func, _) => { 36,952 ( 0.00%) let typ = self.cx.typeck_results().expr_ty(func); 467,676 ( 0.00%) => ???:::expr_ty (11,685x) . if typ.is_fn() { 110,760 ( 0.00%) let sig = typ.fn_sig(self.cx.tcx); 6,011,712 ( 0.05%) => ???:::fn_sig (11,674x) 147,680 ( 0.00%) if self.cx.tcx.instantiate_bound_regions_with_erased(sig).output().kind() == &ty::Never { 11,767,174 ( 0.10%) => /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::> (11,674x) . self.report_diverging_sub_expr(e); . } . } . }, . ExprKind::MethodCall(..) => { 6,673 ( 0.00%) let borrowed_table = self.cx.typeck_results(); 26,692 ( 0.00%) if borrowed_table.expr_ty(e).is_never() { 119,380 ( 0.00%) => ???:::expr_ty (2,981x) . self.report_diverging_sub_expr(e); . } . }, . _ => { . // do not lint expressions referencing objects of type `!`, as that required a . // diverging expression . // to begin with . }, . } 381,945 ( 0.00%) self.maybe_walk_expr(e); 21,178,281 ( 0.18%) => site/frontend/rust-clippy/clippy_lints/src/mixed_read_write_in_expression.rs:::maybe_walk_expr (19,648x) 3,724,850 ( 0.03%) => site/frontend/rust-clippy/clippy_lints/src/mixed_read_write_in_expression.rs:::maybe_walk_expr'2 (16,470x) 763,890 ( 0.01%) } . 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<'_, '_>) { 724 ( 0.00%) let mut cur_id = vis.write_expr.hir_id; . loop { 18,467 ( 0.00%) let parent_id = vis.cx.tcx.parent_hir_id(cur_id); 207,174 ( 0.00%) => ???:::parent_hir_id (3,108x) 2,990 ( 0.00%) if parent_id == cur_id { . break; . } . 34,264 ( 0.00%) let stop_early = match vis.cx.tcx.hir_node(parent_id) { 202,734 ( 0.00%) => ???:::hir_node (3,108x) 1,284 ( 0.00%) Node::Expr(expr) => check_expr(vis, expr), 1,506 ( 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 { 1,546 ( 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 ---------------------------------------- -- line 315 ---------------------------------------- . /// in the lint). . write_expr: &'tcx Expr<'tcx>, . /// The last (highest in the AST) expression we've checked, so we know not . /// to recheck it. . last_expr: &'tcx Expr<'tcx>, . } . . impl<'tcx> Visitor<'tcx> for ReadVisitor<'_, 'tcx> { 126 ( 0.00%) fn visit_expr(&mut self, expr: &'tcx Expr<'_>) { 36 ( 0.00%) if expr.hir_id == self.last_expr.hir_id { . return; . } . 6 ( 0.00%) if expr.res_local_id() == Some(self.var) . // Check that this is a read, not a write. . && !is_in_assignment_position(self.cx, expr) . { . span_lint_and_then( . self.cx, . MIXED_READ_WRITE_IN_EXPRESSION, . expr.span, . format!("unsequenced read of `{}`", self.cx.tcx.hir_name(self.var)), -- line 336 ---------------------------------------- -- line 337 ---------------------------------------- . |diag| { . diag.span_note( . self.write_expr.span, . "whether read occurs before this write depends on evaluation order", . ); . }, . ); . } 12 ( 0.00%) match expr.kind { . // We're about to descend a closure. Since we don't know when (or . // if) the closure will be evaluated, any reads in it might not . // occur here (or ever). Like above, bail to avoid false positives. . ExprKind::Closure{..} | . . // We want to avoid a false positive when a variable name occurs . // only to have its address taken, so we stop here. Technically, . // this misses some weird cases, eg. -- line 353 ---------------------------------------- -- line 359 ---------------------------------------- . // . // TODO: fix this . ExprKind::AddrOf(_, _, _) => { . return; . } . _ => {} . } . 6 ( 0.00%) walk_expr(self, expr); 246 ( 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 (6x) 144 ( 0.00%) } . } . . /// Returns `true` if `expr` is the LHS of an assignment, like `expr = ...`. . fn is_in_assignment_position(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { . if let Some(parent) = get_parent_expr(cx, expr) . && let ExprKind::Assign(lhs, ..) = parent.kind . { . return lhs.hir_id == expr.hir_id; -- line 376 ---------------------------------------- 306,267 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_utils/src/visitors.rs -------------------------------------------------------------------------------- Ir -- line 56 ---------------------------------------- . fn visit>(self, visitor: &mut V) -> V::Result; . } . impl<'tcx, T> Visitable<'tcx> for &'tcx [T] . where . &'tcx T: Visitable<'tcx>, . { . fn visit>(self, visitor: &mut V) -> V::Result { . for x in self { 6 ( 0.00%) try_visit!(x.visit(visitor)); . } . V::Result::output() 3 ( 0.00%) } . } . impl<'tcx, A, B> Visitable<'tcx> for (A, B) . where . A: Visitable<'tcx>, . B: Visitable<'tcx>, . { . fn visit>(self, visitor: &mut V) -> V::Result { . let (a, b) = self; -- line 75 ---------------------------------------- -- 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 { 19,900 ( 0.00%) visitor.$f(self) 434 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/visitors.rs: as rustc_hir::intravisit::Visitor>::visit_expr (1x) . } . } . }; . } . 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. 6,472 ( 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; . 577,026 ( 0.00%) fn visit_expr(&mut self, e: &'tcx Expr<'tcx>) -> Self::Result { 521,382 ( 0.00%) match (self.f)(e) { 1,837,305 ( 0.02%) ControlFlow::Continue(c) if c.descend() => walk_expr(self, e), 72,302 ( 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::::{closure#0}>> (345x) 3,552 ( 0.00%) ControlFlow::Break(b) => ControlFlow::Break(b), 888 ( 0.00%) ControlFlow::Continue(_) => ControlFlow::Continue(()), 40 ( 0.00%) } 241,446 ( 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(()) . } . } 58,674 ( 0.00%) let mut v = V { f }; 3 ( 0.00%) node.visit(&mut v).break_value() 9,717 ( 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:<&[rustc_hir::hir::Stmt] as clippy_utils::visitors::Visitable>::visit::> (3x) 6,411 ( 0.00%) } . . /// Calls the given function once for each expression contained. This will enter bodies, but not . /// nested items. 520 ( 0.00%) pub fn for_each_expr<'tcx, B, C: Continue>( . tcx: TyCtxt<'tcx>, . node: impl Visitable<'tcx>, . f: impl FnMut(&'tcx Expr<'tcx>) -> ControlFlow, . ) -> Option { . struct V<'tcx, F> { . tcx: TyCtxt<'tcx>, . f: F, . } -- line 155 ---------------------------------------- -- 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 . } . 221,649 ( 0.00%) fn visit_expr(&mut self, e: &'tcx Expr<'tcx>) -> Self::Result { 28,458 ( 0.00%) match (self.f)(e) { 850 ( 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::::{closure#0}>>'2 (34x) 278,293 ( 0.00%) ControlFlow::Continue(c) if c.descend() => walk_expr(self, e), 21,543 ( 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::::{closure#0}>> (33x) . ControlFlow::Break(b) => ControlFlow::Break(b), . ControlFlow::Continue(_) => ControlFlow::Continue(()), . } 200,851 ( 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(()) . } . } 8,217 ( 0.00%) let mut v = V { tcx, f }; . node.visit(&mut v).break_value() 1,040 ( 0.00%) } . . /// returns `true` if expr contains match expr desugared from try 16 ( 0.00%) fn contains_try(expr: &Expr<'_>) -> bool { . for_each_expr_without_closures(expr, |e| { 176 ( 0.00%) if matches!(e.kind, ExprKind::Match(_, _, hir::MatchSource::TryDesugar(_))) { . ControlFlow::Break(()) . } else { . ControlFlow::Continue(()) . } . }) . .is_some() 16 ( 0.00%) } . . pub fn find_all_ret_expressions<'hir, F>(_cx: &LateContext<'_>, expr: &'hir Expr<'hir>, callback: F) -> bool . where . F: FnMut(&'hir Expr<'hir>) -> bool, . { . struct RetFinder { . in_stmt: bool, . failed: bool, -- line 213 ---------------------------------------- -- line 240 ---------------------------------------- . impl std::ops::DerefMut for WithStmtGuard<'_, F> { . fn deref_mut(&mut self) -> &mut Self::Target { . self.val . } . } . . impl Drop for WithStmtGuard<'_, F> { . fn drop(&mut self) { 8 ( 0.00%) self.val.in_stmt = self.prev_in_stmt; . } . } . . impl<'hir, F: FnMut(&'hir Expr<'hir>) -> bool> Visitor<'hir> for RetFinder { . fn visit_stmt(&mut self, stmt: &'hir Stmt<'_>) { 9 ( 0.00%) intravisit::walk_stmt(&mut *self.inside_stmt(true), stmt); 1,180 ( 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::::lint_closure::{closure#0}>> (2x) . } . 434 ( 0.00%) fn visit_expr(&mut self, expr: &'hir Expr<'_>) { 124 ( 0.00%) if self.failed { . return; . } 128 ( 0.00%) if self.in_stmt { 75 ( 0.00%) match expr.kind { 2 ( 0.00%) ExprKind::Ret(Some(expr)) => self.inside_stmt(false).visit_expr(expr), 383 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/visitors.rs:::lint_closure::{closure#0}> as rustc_hir::intravisit::Visitor>::visit_expr'2 (1x) 70 ( 0.00%) _ => walk_expr(self, expr), . } . } else { 142 ( 0.00%) match expr.kind { 6 ( 0.00%) ExprKind::If(cond, then, else_opt) => { 6 ( 0.00%) self.inside_stmt(true).visit_expr(cond); 1,548 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/visitors.rs:::lint_closure::{closure#0}> as rustc_hir::intravisit::Visitor>::visit_expr'2 (2x) 6 ( 0.00%) self.visit_expr(then); 1,054 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/visitors.rs:::lint_closure::{closure#0}> as rustc_hir::intravisit::Visitor>::visit_expr'2 (2x) 8 ( 0.00%) if let Some(el) = else_opt { . self.visit_expr(el); . } . }, 3 ( 0.00%) ExprKind::Match(cond, arms, _) => { 3 ( 0.00%) self.inside_stmt(true).visit_expr(cond); 481 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/visitors.rs:::lint_closure::{closure#0}> as rustc_hir::intravisit::Visitor>::visit_expr'2 (1x) . for arm in arms { 6 ( 0.00%) self.visit_expr(arm.body); 594 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/visitors.rs:::lint_closure::{closure#0}> as rustc_hir::intravisit::Visitor>::visit_expr'2 (2x) . } . }, 10 ( 0.00%) ExprKind::Block(..) => walk_expr(self, expr), . ExprKind::Ret(Some(expr)) => self.visit_expr(expr), 40 ( 0.00%) _ => self.failed |= !(self.cb)(expr), . } . } 176 ( 0.00%) } . } . 64 ( 0.00%) !contains_try(expr) && { 4,577 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/visitors.rs:clippy_utils::visitors::contains_try (16x) 96 ( 0.00%) let mut ret_finder = RetFinder { . in_stmt: false, . failed: false, . cb: callback, . }; 32 ( 0.00%) ret_finder.visit_expr(expr); 6,197 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/visitors.rs:::lint_closure::{closure#0}> as rustc_hir::intravisit::Visitor>::visit_expr (16x) . !ret_finder.failed . } . } . . /// Checks if the given resolved path is used in the given body. . pub fn is_res_used(cx: &LateContext<'_>, res: Res, body: BodyId) -> bool { . for_each_expr(cx.tcx, cx.tcx.hir_body(body).value, |e| { . if let ExprKind::Path(p) = &e.kind -- line 303 ---------------------------------------- -- 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,625 ( 0.00%) for_each_expr(cx.tcx, visitable, |e| { 3,132,797 ( 0.03%) => site/frontend/rust-clippy/clippy_utils/src/visitors.rs:clippy_utils::visitors::for_each_expr::<(), (), &rustc_hir::hir::Expr, clippy_utils::visitors::is_local_used<&rustc_hir::hir::Expr>::{closure#0}> (520x) . 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. 1,527 ( 0.00%) fn is_const_evaluatable_helper<'tcx>(tcx: TyCtxt<'tcx>, typeck: &'tcx TypeckResults<'tcx>, e: &'tcx Expr<'_>) -> bool { 3,776 ( 0.00%) match e.kind { . ExprKind::Call( . &Expr { 43 ( 0.00%) kind: ExprKind::Path(ref p), . hir_id, . .. . }, . _, 128 ( 0.00%) ) if typeck 172 ( 0.00%) .qpath_res(p, hir_id) 1,853 ( 0.00%) => ???:::qpath_res (43x) . .opt_def_id() 215 ( 0.00%) .is_some_and(|id| is_stable_const_fn_at(tcx, CRATE_HIR_ID, id, Msrv::default())) => 14,901 ( 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 (43x) . { . true . }, . ExprKind::MethodCall(..) . if typeck 800 ( 0.00%) .type_dependent_def_id(e.hir_id) 8,208 ( 0.00%) => ???:::type_dependent_def_id (160x) 1,440 ( 0.00%) .is_some_and(|id| is_stable_const_fn_at(tcx, CRATE_HIR_ID, id, Msrv::default())) => 103,299 ( 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 (160x) . { . true . }, . ExprKind::Binary(_, lhs, rhs) 720 ( 0.00%) if typeck.expr_ty(lhs).peel_refs().is_primitive_ty() 5,760 ( 0.00%) => ???:::expr_ty (144x) 224 ( 0.00%) && typeck.expr_ty(rhs).peel_refs().is_primitive_ty() => 4,492 ( 0.00%) => ???:::expr_ty (112x) . { . true . }, 35 ( 0.00%) ExprKind::Unary(UnOp::Deref, e) if typeck.expr_ty(e).is_raw_ptr() => true, 280 ( 0.00%) => ???:::expr_ty (7x) 126 ( 0.00%) ExprKind::Unary(_, e) if typeck.expr_ty(e).peel_refs().is_primitive_ty() => true, 1,680 ( 0.00%) => ???:::expr_ty (42x) . ExprKind::Index(base, _, _) 4 ( 0.00%) if matches!(typeck.expr_ty(base).peel_refs().kind(), ty::Slice(_) | ty::Array(..)) => 40 ( 0.00%) => ???:::expr_ty (1x) . { . true . }, 102 ( 0.00%) ExprKind::Path(ref p) 407 ( 0.00%) if matches!( 719 ( 0.00%) typeck.qpath_res(p, e.hir_id), 1,582 ( 0.00%) => ???:::qpath_res (102x) . Res::Def( . DefKind::Const { .. } . | DefKind::AssocConst { .. } . | DefKind::AnonConst . | DefKind::ConstParam . | DefKind::Ctor(..) . | DefKind::Fn . | DefKind::AssocFn, -- line 373 ---------------------------------------- -- line 392 ---------------------------------------- . | ExprKind::Repeat(..) . | ExprKind::Struct(..) . | ExprKind::Tup(_) . | ExprKind::Type(..) . | ExprKind::UnsafeBinderCast(..) => true, . . _ => false, . } 1,745 ( 0.00%) } . . /// Checks if the given expression can be evaluated as a constant at the specified node 903 ( 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| { 4,010 ( 0.00%) if !is_const_evaluatable_helper(tcx, typeck, e) { 115,211 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/visitors.rs:clippy_utils::visitors::is_const_evaluatable_helper (301x) . ControlFlow::Break(()) . } else if matches!(e.kind, ExprKind::ConstBlock(_)) { . ControlFlow::Continue(Descend::No) . } else { . ControlFlow::Continue(Descend::Yes) . } . }) . .is_none() 903 ( 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 ---------------------------------------- -- line 602 ---------------------------------------- . }, . ExprKind::DropTemps(e) => for_each_value_source(e, f), . _ => f(e), . } . } . . /// Runs the given function for each path expression referencing the given local which occur after . /// the given expression. 156 ( 0.00%) pub fn for_each_local_use_after_expr<'tcx, B>( . cx: &LateContext<'tcx>, . local_id: HirId, . expr_id: HirId, . f: impl FnMut(&'tcx Expr<'tcx>) -> ControlFlow, . ) -> ControlFlow { . struct V<'cx, 'tcx, F, B> { . cx: &'cx LateContext<'tcx>, . local_id: HirId, -- line 618 ---------------------------------------- -- line 619 ---------------------------------------- . expr_id: HirId, . found: bool, . res: ControlFlow, . f: F, . } . impl<'tcx, F: FnMut(&'tcx Expr<'tcx>) -> ControlFlow, B> Visitor<'tcx> for V<'_, 'tcx, F, B> { . type NestedFilter = nested_filter::OnlyBodies; . fn maybe_tcx(&mut self) -> Self::MaybeTyCtxt { 16 ( 0.00%) self.cx.tcx . } . . fn visit_expr(&mut self, e: &'tcx Expr<'tcx>) { 5,618 ( 0.00%) if !self.found { 2,297 ( 0.00%) if e.hir_id == self.expr_id { 16,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::::expr_usage_requires_vec::{closure#0}, ()>>'2 (23x) 12 ( 0.00%) self.found = true; . } else { 8 ( 0.00%) walk_expr(self, e); . } . return; . } 1,046 ( 0.00%) if self.res.is_break() { . return; . } 105 ( 0.00%) if e.res_local_id() == Some(self.local_id) { 64 ( 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::::expr_usage_requires_vec::{closure#0}, ()>>'2 (1x) 71 ( 0.00%) self.res = (self.f)(e); 220 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/useless_vec.rs:::expr_usage_requires_vec::{closure#0} (1x) . } else { . walk_expr(self, e); . } 2 ( 0.00%) } . } . 36 ( 0.00%) if let Some(b) = get_enclosing_block(cx, local_id) { 5,958 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_enclosing_block (12x) 84 ( 0.00%) let mut v = V { . cx, . local_id, . expr_id, . found: false, . res: ControlFlow::Continue(()), . f, . }; . v.visit_block(b); 24 ( 0.00%) v.res . } else { . ControlFlow::Continue(()) . } 96 ( 0.00%) } . . // Calls the given function for every unconsumed temporary created by the expression. Note the . // function is only guaranteed to be called for types which need to be dropped, but it may be called . // for other types. . #[expect(clippy::too_many_lines)] . pub fn for_each_unconsumed_temporary<'tcx, B>( . cx: &LateContext<'tcx>, . e: &'tcx Expr<'tcx>, . mut f: impl FnMut(Ty<'tcx>) -> ControlFlow, . ) -> ControlFlow { . // Todo: Handle partially consumed values. 17,884 ( 0.00%) fn helper<'tcx, B>( . typeck: &'tcx TypeckResults<'tcx>, . consume: bool, . e: &'tcx Expr<'tcx>, . f: &mut impl FnMut(Ty<'tcx>) -> ControlFlow, . ) -> ControlFlow { 2,564 ( 0.00%) if !consume . || matches!( 3,834 ( 0.00%) typeck.expr_adjustments(e), 32,453 ( 0.00%) => ???:::expr_adjustments (882x) 4,108 ( 0.00%) [adjust, ..] if matches!(adjust.kind, Adjust::Borrow(_) | Adjust::Deref(_)) . ) . { 2,155 ( 0.00%) match e.kind { . ExprKind::Path(QPath::Resolved(None, p)) 579 ( 0.00%) if matches!(p.res, Res::Def(DefKind::Ctor(_, CtorKind::Const), _)) => . { . f(typeck.expr_ty(e))?; . }, . ExprKind::Path(_) . | ExprKind::Unary(UnOp::Deref, _) . | ExprKind::Index(..) . | ExprKind::Field(..) . | ExprKind::AddrOf(..) => (), . _ => f(typeck.expr_ty(e))?, . } . } 5,132 ( 0.00%) match e.kind { . ExprKind::AddrOf(_, _, e) 3 ( 0.00%) | ExprKind::Field(e, _) . | ExprKind::Unary(UnOp::Deref, e) . | ExprKind::Match(e, ..) . | ExprKind::Let(&LetExpr { init: e, .. }) => { 4 ( 0.00%) helper(typeck, false, e, f)?; . }, . ExprKind::Block(&Block { expr: Some(e), .. }, _) | ExprKind::Cast(e, _) | ExprKind::Unary(_, e) => { . helper(typeck, true, e, f)?; . }, 18 ( 0.00%) ExprKind::Call(callee, args) => { 30 ( 0.00%) helper(typeck, true, callee, f)?; 140 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/visitors.rs:clippy_utils::visitors::for_each_unconsumed_temporary::helper::<(), clippy_utils::leaks_droppable_temporary_with_limited_lifetime::{closure#0}>'2 (2x) . for arg in args { 30 ( 0.00%) helper(typeck, true, arg, f)?; 140 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/visitors.rs:clippy_utils::visitors::for_each_unconsumed_temporary::helper::<(), clippy_utils::leaks_droppable_temporary_with_limited_lifetime::{closure#0}>'2 (2x) . } . }, 573 ( 0.00%) ExprKind::MethodCall(_, receiver, args, _) => { 956 ( 0.00%) helper(typeck, true, receiver, f)?; 18,694 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/visitors.rs:clippy_utils::visitors::for_each_unconsumed_temporary::helper::<(), clippy_utils::leaks_droppable_temporary_with_limited_lifetime::{closure#0}>'2 (189x) . for arg in args { 5 ( 0.00%) helper(typeck, true, arg, f)?; 72 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/visitors.rs:clippy_utils::visitors::for_each_unconsumed_temporary::helper::<(), clippy_utils::visitors::any_temporaries_need_ordered_drop::{closure#0}>'2 (1x) . } . }, 2 ( 0.00%) ExprKind::Tup(args) | ExprKind::Array(args) => { . for arg in args { 925 ( 0.00%) helper(typeck, true, arg, f)?; 13,028 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/visitors.rs:clippy_utils::visitors::for_each_unconsumed_temporary::helper::<(), clippy_utils::leaks_droppable_temporary_with_limited_lifetime::{closure#0}>'2 (185x) . } . }, . ExprKind::Use(expr, _) => { . helper(typeck, true, expr, f)?; . }, . ExprKind::Index(borrowed, consumed, _) . | ExprKind::Assign(borrowed, consumed, _) . | ExprKind::AssignOp(_, borrowed, consumed) => { . helper(typeck, false, borrowed, f)?; . helper(typeck, true, consumed, f)?; . }, 2 ( 0.00%) ExprKind::Binary(_, lhs, rhs) => { 2 ( 0.00%) helper(typeck, true, lhs, f)?; . helper(typeck, true, rhs, f)?; . }, . ExprKind::Struct(_, fields, default) => { . for field in fields { . helper(typeck, true, field.expr, f)?; . } . if let StructTailExpr::Base(default) = default { . helper(typeck, false, default, f)?; -- line 748 ---------------------------------------- -- line 773 ---------------------------------------- . | ExprKind::Closure { .. } . | ExprKind::Path(_) . | ExprKind::Continue(_) . | ExprKind::InlineAsm(_) . | ExprKind::OffsetOf(..) . | ExprKind::Err(_) => (), . } . ControlFlow::Continue(()) 10,216 ( 0.00%) } 1,780 ( 0.00%) helper(cx.typeck_results(), true, e, &mut f) 324 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/visitors.rs:clippy_utils::visitors::for_each_unconsumed_temporary::helper::<(), clippy_utils::visitors::any_temporaries_need_ordered_drop::{closure#0}> (1x) . } . 2 ( 0.00%) pub fn any_temporaries_need_ordered_drop<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'tcx>) -> bool { 1 ( 0.00%) for_each_unconsumed_temporary(cx, e, |ty| { . if needs_ordered_drop(cx, ty) { . ControlFlow::Break(()) . } else { . ControlFlow::Continue(()) . } . }) . .is_break() 2 ( 0.00%) } . . /// Runs the given function for each path expression referencing the given local which occur after . /// the given expression. . pub fn for_each_local_assignment<'tcx, B>( . cx: &LateContext<'tcx>, . local_id: HirId, . f: impl FnMut(&'tcx Expr<'tcx>) -> ControlFlow, . ) -> ControlFlow { -- line 802 ---------------------------------------- 258,562 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/returns/mod.rs -------------------------------------------------------------------------------- Ir -- line 118 ---------------------------------------- . declare_lint_pass!(Return => [ . LET_AND_RETURN, . NEEDLESS_RETURN, . NEEDLESS_RETURN_WITH_QUESTION_MARK, . ]); . . impl<'tcx> LateLintPass<'tcx> for Return { . fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx Stmt<'_>) { 95,088 ( 0.00%) needless_return_with_question_mark::check_stmt(cx, stmt); 263,073 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/returns/needless_return_with_question_mark.rs:clippy_lints::returns::needless_return_with_question_mark::check_stmt (31,696x) . } . . fn check_block(&mut self, cx: &LateContext<'tcx>, block: &'tcx Block<'_>) { 65,376 ( 0.00%) let_and_return::check_block(cx, block); 1,206,368 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/returns/let_and_return.rs:clippy_lints::returns::let_and_return::check_block (21,792x) . } . . fn check_fn( . &mut self, . cx: &LateContext<'tcx>, . kind: FnKind<'tcx>, . _: &'tcx FnDecl<'tcx>, . body: &'tcx Body<'tcx>, -- line 138 ---------------------------------------- -------------------------------------------------------------------------------- -- 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)` 484,862 ( 0.00%) if let ExprKind::Assign(left, right, _) = expr.kind . && let Some(local_id) = left.res_local_id() 545 ( 0.00%) && let Some(size_expr) = Self::as_vec_initializer(cx, right) 5,045 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/slow_vector_initialization.rs:::as_vec_initializer (109x) . { 3 ( 0.00%) let vi = VecAllocation { . local_id, . allocation_expr: right, . size_expr, . }; . 5 ( 0.00%) Self::search_initialization(cx, vi, expr.hir_id); 628 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/slow_vector_initialization.rs:::search_initialization (1x) . } . } . . 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()` 83,472 ( 0.00%) if let StmtKind::Let(local) = stmt.kind 139,863 ( 0.00%) && let PatKind::Binding(BindingMode::MUT, local_id, _, None) = local.pat.kind 3,528 ( 0.00%) && let Some(init) = local.init 5,880 ( 0.00%) && let Some(size_expr) = Self::as_vec_initializer(cx, init) 158,050 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/slow_vector_initialization.rs:::as_vec_initializer (1,176x) . { 57 ( 0.00%) let vi = VecAllocation { . local_id, . allocation_expr: init, . size_expr, . }; . 95 ( 0.00%) Self::search_initialization(cx, vi, stmt.hir_id); 361,151 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/slow_vector_initialization.rs:::search_initialization (19x) . } . } . } . . 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 6,425 ( 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 3,176 ( 0.00%) if expr.span.from_expansion() && matching_root_macro_call(cx, expr.span, sym::vec_macro).is_none() { 35,538 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::matching_root_macro_call (101x) . return None; . } . 14,226 ( 0.00%) if let ExprKind::Call(func, [len_expr]) = expr.kind 72 ( 0.00%) && func.ty_rel_def(cx).is_diag_item(cx, sym::vec_with_capacity) . { . Some(InitializedSize::Initialized(len_expr)) 1,650 ( 0.00%) } else if let ExprKind::Call(func, []) = expr.kind 970 ( 0.00%) && func.ty_rel_def(cx).is_diag_item(cx, sym::vec_new) . { . Some(InitializedSize::Uninitialized) . } else { . None . } 6,425 ( 0.00%) } . . /// Search initialization for the given vector 180 ( 0.00%) fn search_initialization<'tcx>(cx: &LateContext<'tcx>, vec_alloc: VecAllocation<'tcx>, parent_node: HirId) { 60 ( 0.00%) let enclosing_body = get_enclosing_block(cx, parent_node); 5,458 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_enclosing_block (20x) . 20 ( 0.00%) if enclosing_body.is_none() { . return; . } . 140 ( 0.00%) let mut v = VectorInitializationVisitor { . cx, . vec_alloc, . slow_expression: None, . initialization_found: false, . }; . . v.visit_block(enclosing_body.unwrap()); . 40 ( 0.00%) if let Some(ref allocation_expr) = v.slow_expression { . Self::lint_initialization(cx, allocation_expr, &v.vec_alloc); . } 160 ( 0.00%) } . . fn lint_initialization<'tcx>( . cx: &LateContext<'tcx>, . initialization: &InitializationType<'tcx>, . vec_alloc: &VecAllocation<'_>, . ) { . match initialization { . InitializationType::Extend(e) | InitializationType::Resize(e) => { -- line 191 ---------------------------------------- -- line 240 ---------------------------------------- . . /// `true` if the initialization of the vector has been found on the visited block. . initialization_found: bool, . } . . impl<'tcx> VectorInitializationVisitor<'_, 'tcx> { . /// Checks if the given expression is extending a vector with `repeat(0).take(..)` . fn search_slow_extend_filling(&mut self, expr: &'tcx Expr<'_>) { 15 ( 0.00%) if self.initialization_found 2 ( 0.00%) && let ExprKind::MethodCall(path, self_arg, [extend_arg], _) = expr.kind 2 ( 0.00%) && self_arg.res_local_id() == Some(self.vec_alloc.local_id) 1 ( 0.00%) && path.ident.name == sym::extend . && self.is_repeat_take(extend_arg) . { . self.slow_expression = Some(InitializationType::Extend(expr)); . } . } . . /// Checks if the given expression is resizing a vector with 0 . fn search_slow_resize_filling(&mut self, expr: &'tcx Expr<'tcx>) { 42 ( 0.00%) if self.initialization_found 1 ( 0.00%) && let ExprKind::MethodCall(path, self_arg, [len_arg, fill_arg], _) = expr.kind 1 ( 0.00%) && self_arg.res_local_id() == Some(self.vec_alloc.local_id) 1 ( 0.00%) && path.ident.name == sym::resize . // Check that is filled with 0 . && is_integer_literal(fill_arg, 0) . { . let is_matching_resize = if let InitializedSize::Initialized(size_expr) = self.vec_alloc.size_expr { . // If we have a size expression, check that it is equal to what's passed to `resize` . SpanlessEq::new(self.cx).eq_expr(SyntaxContext::root(), len_arg, size_expr) . || matches!(len_arg.kind, ExprKind::MethodCall(path, ..) if path.ident.name == sym::capacity) . } else { -- line 271 ---------------------------------------- -- line 308 ---------------------------------------- . true . } else { . false . } . } . } . . impl<'tcx> Visitor<'tcx> for VectorInitializationVisitor<'_, 'tcx> { 8,256 ( 0.00%) fn visit_stmt(&mut self, stmt: &'tcx Stmt<'_>) { 2,064 ( 0.00%) if self.initialization_found { 36 ( 0.00%) match stmt.kind { 9 ( 0.00%) StmtKind::Expr(expr) | StmtKind::Semi(expr) => { . self.search_slow_extend_filling(expr); . self.search_slow_resize_filling(expr); . }, . _ => (), . } . 18 ( 0.00%) self.initialization_found = false; . } else { . walk_stmt(self, stmt); . } 3,360 ( 0.00%) } . . fn visit_block(&mut self, block: &'tcx Block<'_>) { 1,180 ( 0.00%) if self.initialization_found { 1 ( 0.00%) if let Some(s) = block.stmts.first() { 2 ( 0.00%) self.visit_stmt(s); 28 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/slow_vector_initialization.rs:::visit_stmt (1x) . } . 4 ( 0.00%) self.initialization_found = false; . } else { . walk_block(self, block); . } . } . . fn visit_expr(&mut self, expr: &'tcx Expr<'_>) { . // Skip all the expressions previous to the vector initialization 13,098 ( 0.00%) if self.vec_alloc.allocation_expr.hir_id == expr.hir_id { 20 ( 0.00%) self.initialization_found = true; . } . 14,702 ( 0.00%) walk_expr(self, expr); 306,817 ( 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:: (221x) 17,653 ( 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) . } . } 5,140 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/types/borrowed_box.rs -------------------------------------------------------------------------------- Ir -- line 4 ---------------------------------------- . use rustc_errors::Applicability; . use rustc_hir::{ . self as hir, GenericArg, GenericBounds, GenericParamKind, HirId, Lifetime, MutTy, Mutability, Node, QPath, TyKind, . }; . use rustc_lint::LateContext; . . use super::BORROWED_BOX; . 37,760 ( 0.00%) pub(super) fn check(cx: &LateContext<'_>, hir_ty: &hir::Ty<'_>, lt: &Lifetime, mut_ty: &MutTy<'_>) -> bool { . // Ignore `&mut Box` types; see issue #2907 for details. 9,440 ( 0.00%) if mut_ty.mutbl == Mutability::Not 6,525 ( 0.00%) && let TyKind::Path(ref qpath) = mut_ty.ty.kind 10,159 ( 0.00%) && let QPath::Resolved(None, path) = *qpath . && let Some(def_id) = path.res.opt_def_id() 4,125 ( 0.00%) && Some(def_id) == cx.tcx.lang_items().owned_box() 55,000 ( 0.00%) => ???:::lang_items (1,375x) . && let [bx] = path.segments . && let Some(params) = bx.args . && params.parenthesized == hir::GenericArgsParentheses::No . && let Some(inner) = params.args.iter().find_map(|arg| match arg { . GenericArg::Type(ty) => Some(ty), . _ => None, . }) . // Ignore `Box` types; see issue #1884 for details. -- line 26 ---------------------------------------- -- line 64 ---------------------------------------- . Applicability::Unspecified, . ); . }, . ); . true . } else { . false . } 37,760 ( 0.00%) } . . // Returns true if given type is `Any` trait. . fn is_any_trait(cx: &LateContext<'_>, t: &hir::Ty<'_>) -> bool { . if let TyKind::TraitObject(traits, ..) = t.kind . && let Some(any_did) = cx.tcx.get_diagnostic_item(sym::Any) . { . return traits . .iter() -- line 80 ---------------------------------------- 6,095 ( 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<'_>) { 12,408 ( 0.00%) if self.loaded_bodies.first().is_some_and(|&x| x == body.id()) { . self.consumed_locals.clear(); . self.loaded_bodies.clear(); . } . } . 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &'_ Expr<'_>) { 484,456 ( 0.00%) if let ExprKind::Assign(lhs, rhs, _) = &expr.kind 1,218 ( 0.00%) && !lhs.span.from_expansion() 1,212 ( 0.00%) && !rhs.span.from_expansion() 806 ( 0.00%) && let lhs_ty = cx.typeck_results().expr_ty(lhs) 16,168 ( 0.00%) => ???:::expr_ty (403x) 1,612 ( 0.00%) && let Some(inner_ty) = lhs_ty.boxed_ty() 3,270 ( 0.00%) => ???:::boxed_ty (403x) . // 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, . ); . }); . } . } 1,937,824 ( 0.02%) } . } . . 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 ---------------------------------------- 1,215 ( 0.00%) -------------------------------------------------------------------------------- -- 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) { 405,725 ( 0.00%) if let ExprKind::Range(Some(start), Some(end), RangeLimits::HalfOpen) = &e.kind 525 ( 0.00%) && is_incomplete_range(start, end) 10,954 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/almost_complete_range.rs:clippy_lints::almost_complete_range::is_incomplete_range (75x) . && !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, . ); . } . }, . ); . } 202,327 ( 0.00%) } . 332,466 ( 0.00%) fn check_pat(&mut self, cx: &EarlyContext<'_>, p: &Pat) { 110,840 ( 0.00%) if let PatKind::Range(Some(start), Some(end), kind) = &p.kind 6 ( 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, . ); . }, . ); . } 387,877 ( 0.00%) } . . extract_msrv_attr!(); . } . 150 ( 0.00%) fn is_incomplete_range(start: &Expr, end: &Expr) -> bool { 252 ( 0.00%) match (&start.peel_parens().kind, &end.peel_parens().kind) { 248 ( 0.00%) (&ExprKind::Lit(start_lit), &ExprKind::Lit(end_lit)) => { 186 ( 0.00%) matches!( 310 ( 0.00%) (LitKind::from_token_lit(start_lit), LitKind::from_token_lit(end_lit),), 8,956 ( 0.00%) => ???:::from_token_lit (62x) . ( . 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, . } 225 ( 0.00%) } 2,685 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/missing_const_for_thread_local.rs -------------------------------------------------------------------------------- Ir -- line 55 ---------------------------------------- . } . . #[inline] . fn is_thread_local_initializer( . cx: &LateContext<'_>, . fn_kind: intravisit::FnKind<'_>, . span: rustc_span::Span, . ) -> Option { 15,538 ( 0.00%) let macro_def_id = span.source_callee()?.macro_def_id?; 533,818 ( 0.00%) => ???:::source_callee (5,716x) . Some( 6,159 ( 0.00%) cx.tcx.is_diagnostic_item(sym::thread_local_macro, macro_def_id) 135,922 ( 0.00%) => ???:::is_diagnostic_item (2,053x) . && matches!(fn_kind, intravisit::FnKind::ItemFn(..)), . ) . } . . fn is_unreachable(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { 6 ( 0.00%) if let Some(macro_call) = macro_backtrace(expr.span).next() . && let Some(diag_name) = cx.tcx.get_diagnostic_name(macro_call.def_id) . { . return (matches!( . diag_name, . sym::core_panic_macro . | sym::std_panic_macro . | sym::core_panic_2015_macro . | sym::std_panic_2015_macro -- line 79 ---------------------------------------- -- line 85 ---------------------------------------- . ); . } . false . } . . #[inline] . fn initializer_can_be_made_const(cx: &LateContext<'_>, defid: rustc_span::def_id::DefId, msrv: Msrv) -> bool { . // Building MIR for `fn`s with unsatisfiable clauses results in ICE. 12 ( 0.00%) if !fn_has_unsatisfiable_clauses(cx, defid) 1,184 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::fn_has_unsatisfiable_clauses (2x) . && let mir = cx.tcx.optimized_mir(defid) 9 ( 0.00%) && let Ok(()) = is_min_const_fn(cx, mir, msrv) 272,102 ( 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_min_const_fn (2x) . { . return true; . } . false . } . . impl<'tcx> LateLintPass<'tcx> for MissingConstForThreadLocal { 57,160 ( 0.00%) fn check_fn( . &mut self, . cx: &LateContext<'tcx>, . fn_kind: intravisit::FnKind<'tcx>, . _: &'tcx rustc_hir::FnDecl<'tcx>, . body: &'tcx rustc_hir::Body<'tcx>, . span: rustc_span::Span, . local_defid: rustc_span::def_id::LocalDefId, . ) { . let defid = local_defid.to_def_id(); 11,432 ( 0.00%) if is_thread_local_initializer(cx, fn_kind, span).unwrap_or(false) . // Some implementations of `thread_local!` include an initializer fn. . // In the case of a const initializer, the init fn is also const, . // so we can skip the lint in that case. This occurs only on some . // backends due to conditional compilation: . // https://doc.rust-lang.org/src/std/sys/common/thread_local/mod.rs.html . // for details on this issue, see: . // https://github.com/rust-lang/rust-clippy/pull/12276 2 ( 0.00%) && !cx.tcx.is_const_fn(defid) 8 ( 0.00%) && let ExprKind::Block(block, _) = body.value.kind 6 ( 0.00%) && let Some(unpeeled) = block.expr 2 ( 0.00%) && let ret_expr = peel_blocks(unpeeled) . // A common pattern around threadlocal! is to make the value unreachable . // to force an initialization before usage . // https://github.com/rust-lang/rust-clippy/issues/12637 . // we ensure that this is reachable before we check in mir . && !is_unreachable(cx, ret_expr) 3 ( 0.00%) && initializer_can_be_made_const(cx, defid, self.msrv) . // we know that the function is const-qualifiable, so now . // we need only to get the initializer expression to span-lint it. . && let initializer_snippet = snippet(cx, ret_expr.span, "thread_local! { ... }") . && initializer_snippet != "thread_local! { ... }" . && self.msrv.meets(cx, msrvs::THREAD_LOCAL_CONST_INIT) . { . span_lint_and_sugg( . cx, -- line 138 ---------------------------------------- -- line 139 ---------------------------------------- . MISSING_CONST_FOR_THREAD_LOCAL, . unpeeled.span, . "initializer for `thread_local` value can be made `const`", . "replace with", . format!("const {{ {initializer_snippet} }}"), . Applicability::MachineApplicable, . ); . } 45,728 ( 0.00%) } . } 5,726 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/ifs/ifs_same_cond.rs -------------------------------------------------------------------------------- Ir -- line 8 ---------------------------------------- . . use super::IFS_SAME_COND; . . fn method_caller_is_mutable<'tcx>( . cx: &LateContext<'tcx>, . caller_expr: &Expr<'_>, . interior_mut: &mut InteriorMut<'tcx>, . ) -> bool { 45 ( 0.00%) let caller_ty = cx.typeck_results().expr_ty(caller_expr); 360 ( 0.00%) => ???:::expr_ty (9x) . 45 ( 0.00%) interior_mut.is_interior_mut_ty(cx, caller_ty) 7,008 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:::is_interior_mut_ty (9x) 2 ( 0.00%) || caller_ty.is_mutable_ptr() . // `find_binding_init` will return the binding iff its not mutable . || caller_expr.res_local_id() 7 ( 0.00%) .and_then(|hid| find_binding_init(cx, hid)) 1,451 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::find_binding_init (7x) . .is_none() . } . . /// Implementation of `IFS_SAME_COND`. 45,460 ( 0.00%) pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, conds: &[&Expr<'_>], interior_mut: &mut InteriorMut<'tcx>) { 40,914 ( 0.00%) for group in search_same( 255,937 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::search_same::<&rustc_hir::hir::Expr, clippy_lints::ifs::ifs_same_cond::check::{closure#0}, clippy_lints::ifs::ifs_same_cond::check::{closure#1}> (4,546x) . conds, 64 ( 0.00%) |e| hash_expr(cx, e), 36,124 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:clippy_utils::hir_utils::hash_expr (32x) . |lhs, rhs| { . // Ignore eq_expr side effects iff one of the expression kind is a method call . // and the caller is not a mutable, including inner mutable type. 70 ( 0.00%) if let ExprKind::MethodCall(_, caller, _, _) = lhs.kind { 7 ( 0.00%) if method_caller_is_mutable(cx, caller, interior_mut) { . false . } else { 6 ( 0.00%) SpanlessEq::new(cx).eq_expr(SyntaxContext::root(), lhs, rhs) 522 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:::eq_expr (1x) . } . } else { 104 ( 0.00%) eq_expr_value(cx, SyntaxContext::root(), lhs, rhs) 58,690 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:clippy_utils::hir_utils::eq_expr_value (26x) . } . }, . ) { . let spans: Vec<_> = group.into_iter().map(|expr| expr.span).collect(); . span_lint(cx, IFS_SAME_COND, spans, "these `if` branches have the same condition"); . } 36,368 ( 0.00%) } 20 ( 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 { 1,763,483 ( 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 { 1,294,595 ( 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 988 ---------------------------------------- . /// Takes amortized *O*(1) time. If the vector's length would exceed its . /// 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 = "rust1", since = "1.0.0")] . #[rustc_confusables("push_back", "put", "append")] . pub fn push(&mut self, value: T) { 200 ( 0.00%) let _ = self.push_mut(value); 2,877 ( 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:>::push_mut (8x) . } . . /// Appends an element to the back of a collection, returning a reference to it. . /// . /// # Panics . /// . /// Panics if the new capacity exceeds `isize::MAX` _bytes_. . /// -- line 1004 ---------------------------------------- -- line 1019 ---------------------------------------- . /// . /// Takes amortized *O*(1) time. If the vector's length would exceed its . /// 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"] 360 ( 0.00%) pub fn push_mut(&mut self, value: T) -> &mut T { . // Inform codegen that the length does not change across grow_one(). 184,769 ( 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. 458,459 ( 0.00%) if len == self.buf.capacity() { 74,280 ( 0.00%) self.buf.grow_one(); 93 ( 0.00%) => ???:>::grow_one (1x) . } . unsafe { . let end = self.as_mut_ptr().add(len); . ptr::write(end, value); 414,046 ( 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 . } 288 ( 0.00%) } . } . . impl Vec { . /// Constructs a new, empty `Vec`. . /// . /// The vector will not allocate until elements are pushed onto it. . /// . /// # Examples -- line 1050 ---------------------------------------- -- 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 . ); 15,268 ( 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 1303 ---------------------------------------- . capacity: usize, . alloc: A, . ) -> Self { . ub_checks::assert_unsafe_precondition!( . check_library_ub, . "Vec::from_parts_in requires that length <= capacity", . (length: usize = length, capacity: usize = capacity) => length <= capacity . ); 5,943 ( 0.00%) unsafe { Vec { buf: RawVec::from_nonnull_in(ptr, capacity, alloc), len: length } } . } . . /// Decomposes a `Vec` into its raw components: `(pointer, length, capacity, allocator)`. . /// . /// Returns the raw pointer to the underlying data, the length of the vector (in elements), . /// the allocated capacity of the data (in elements), and the allocator. These are the same . /// arguments in the same order as the arguments to [`from_raw_parts_in`]. . /// -- line 1319 ---------------------------------------- -- 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) { 22,886 ( 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. 18,736 ( 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. 227,125 ( 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); 91,511 ( 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 2,992,956 ( 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 527,368 ( 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 . ); . 92,095 ( 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(); 8,098 ( 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(); 4,049 ( 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 2341 ---------------------------------------- . . let len = self.len(); . if index > len { . assert_failed(index, len); . } . . // space for the new element . if len == self.buf.capacity() { 5 ( 0.00%) self.buf.grow_one(); 1,265 ( 0.00%) => ???:>::grow_one (5x) . } . . unsafe { . // infallible . // The spot to put the new value . let p = self.as_mut_ptr().add(index); . { . if index < len { -- line 2357 ---------------------------------------- -- line 2358 ---------------------------------------- . // Shift everything over to make space. (Duplicating the . // `index`th element into two consecutive places.) . ptr::copy(p, p.add(1), len - index); . } . // Write it in, overwriting the first copy of the `index`th . // element. . ptr::write(p, element); . } 5 ( 0.00%) self.set_len(len + 1); . &mut *p . } . } . . /// Removes and returns the element at position `index` within the vector, . /// shifting all elements after it to the left. . /// . /// Note: Because this shifts over the remaining elements, it has a -- line 2374 ---------------------------------------- -- line 2473 ---------------------------------------- . /// ``` . /// let mut vec = vec![1, 2, 3, 4, 5]; . /// let keep = [false, true, true, false, true]; . /// let mut iter = keep.iter(); . /// vec.retain(|_| *iter.next().unwrap()); . /// assert_eq!(vec, [2, 3, 5]); . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] 17,649 ( 0.00%) pub fn retain(&mut self, mut f: F) . where . F: FnMut(&T) -> bool, . { 87,142 ( 0.00%) self.retain_mut(|elem| f(elem)); 17,443 ( 0.00%) } . . /// Retains only the elements specified by the predicate, passing a mutable reference to it. . /// . /// In other words, remove all elements `e` such that `f(&mut e)` returns `false`. . /// This method operates in place, visiting each element exactly once in the . /// original order, and preserves the order of the retained elements. . /// . /// # Examples -- line 2494 ---------------------------------------- -- 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(); . 7,520 ( 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 2550 ---------------------------------------- . } . } . } . . let mut read = 0; . loop { . // SAFETY: read < original_len . let cur = unsafe { self.get_unchecked_mut(read) }; 104,585 ( 0.00%) if hint::unlikely(!f(cur)) { 1,903,369 ( 0.02%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/mod.rs:>::retain::<>::multipart_suggestion_with_style<&str>::{closure#0}>::{closure#0} (5,126x) . break; . } 48,464 ( 0.00%) read += 1; 107,180 ( 0.00%) if read == original_len { . // All elements are kept, return early. . return; . } . } . . // Critical section starts here and at least one element is going to be removed. . // Advance `g.read` early to avoid double drop if `drop_in_place` panicked. . let mut g = PanicGuard { v: self, read: read + 1, write: read, original_len }; . // SAFETY: previous `read` is always less than original_len. . unsafe { ptr::drop_in_place(&mut *g.v.as_mut_ptr().add(read)) }; . 187,556 ( 0.00%) while g.read < g.original_len { . // SAFETY: `read` is always less than original_len. . let cur = unsafe { &mut *g.v.as_mut_ptr().add(g.read) }; 94,514 ( 0.00%) if !f(cur) { . // Advance `read` early to avoid double drop if `drop_in_place` panicked. . g.read += 1; . // SAFETY: We never touch this element again after dropped. . unsafe { ptr::drop_in_place(cur) }; . } else { . // SAFETY: `read` > `write`, so the slots don't overlap. . // We use copy for move, and never touch the source element again. . unsafe { . let hole = g.v.as_mut_ptr().add(g.write); . ptr::copy_nonoverlapping(cur, hole, 1); . } 94,514 ( 0.00%) g.write += 1; . g.read += 1; . } . } . . // We are leaving the critical section and no panic happened, . // Commit the length change and forget the guard. . // SAFETY: `write` is always less than or equal to original_len. . unsafe { g.v.set_len(g.write) }; . mem::forget(g); 413 ( 0.00%) } . . /// Removes all but the first of consecutive elements in the vector that resolve to the same . /// key. . /// . /// If the vector is sorted, this removes all duplicates. . /// . /// # Examples . /// -- line 2607 ---------------------------------------- -- 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 { 200,596 ( 0.00%) if self.len == 0 { . None . } else { . unsafe { 133,500 ( 0.00%) self.len -= 1; . core::hint::assert_unchecked(self.len < self.capacity()); 259 ( 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(); 23,218 ( 0.00%) if count > 0 { . unsafe { . ptr::copy_nonoverlapping(other as *const T, self.as_mut_ptr().add(len), count) . }; . } 39,173 ( 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 { 12,141 ( 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 { 222,989 ( 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 { 116,024 ( 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. 67,018 ( 0.00%) fn clone(&self) -> Self { . let alloc = self.allocator().clone(); 1,042 ( 0.00%) <[T]>::to_vec_in(&**self, alloc) 84,903 ( 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) { 132 ( 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 { 11,301 ( 0.00%) >::from_iter(iter.into_iter()) 5,177,295 ( 0.04%) => /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, ::check_item_kind::{closure#0}>, ::check_item_kind::{closure#1}>, core::option::Option>>>::from_iter (10,370x) . } . } . . #[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(); 2,851 ( 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) { 475 ( 0.00%) >::spec_extend(self, iter.into_iter()) 14,630 ( 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<(rustc_span::span_encoding::Span, alloc::string::String), alloc::vec::into_iter::IntoIter<(rustc_span::span_encoding::Span, alloc::string::String)>>>::spec_extend (418x) . } . . #[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))] 2,824 ( 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); . // } 64,411 ( 0.00%) while let Some(element) = iterator.next() { 103,504 ( 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 (1,210x) . let len = self.len(); 81,334 ( 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 40,577 ( 0.00%) self.set_len(len + 1); . } . } 1,904 ( 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); 2,074 ( 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 . { 23,791 ( 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 57,640 ( 0.00%) self.as_mut_ptr().cast_slice(self.len).drop_in_place() . } . // RawVec handles deallocation 29,922 ( 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 ---------------------------------------- 1,009,106 ( 0.01%) -------------------------------------------------------------------------------- -- 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) { 484,456 ( 0.00%) if let hir::ExprKind::Lit(lit) = expr.kind 26,080 ( 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, . ); . }, . ); . } . } 1,937,824 ( 0.02%) } . } . . #[must_use] . fn max_digits(fty: FloatTy) -> u32 { . match fty { . FloatTy::F16 => f16::DIGITS, . FloatTy::F32 => f32::DIGITS, . FloatTy::F64 => f64::DIGITS, -- line 184 ---------------------------------------- 13,040 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/operators/identity_op.rs -------------------------------------------------------------------------------- Ir -- line 6 ---------------------------------------- . use rustc_hir::def::{DefKind, Res}; . use rustc_hir::{BinOpKind, Expr, ExprKind, Node, Path, QPath}; . use rustc_lint::LateContext; . use rustc_middle::ty; . use rustc_span::{Span, SyntaxContext, kw}; . . use super::IDENTITY_OP; . 47,352 ( 0.00%) pub(crate) fn check<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'_>, . op: BinOpKind, . left: &'tcx Expr<'_>, . right: &'tcx Expr<'_>, . ) { 18 ( 0.00%) if !is_allowed(cx, expr, op, left, right) { . return; . } . . // we need to know whether a ref is coerced to a value . // if a ref is coerced, then the suggested lint must deref it . // e.g. `let _: i32 = x+0` with `x: &i32` should be replaced with `let _: i32 = *x`. . // we do this by checking the _kind_ of the type of the expression . // if it's a ref, we then check whether it is erased, and that's it. . let (peeled_left_span, left_is_coerced_to_value) = { 3,856 ( 0.00%) let expr = peel_hir_expr_refs(left).0; 9,640 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::peel_hir_expr_refs (1,928x) 1,928 ( 0.00%) let span = expr.span; . let is_coerced = expr_is_erased_ref(cx, expr); . (span, is_coerced) . }; . . let (peeled_right_span, right_is_coerced_to_value) = { 1,928 ( 0.00%) let expr = peel_hir_expr_refs(right).0; 9,640 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::peel_hir_expr_refs (1,928x) 1,928 ( 0.00%) let span = expr.span; . let is_coerced = expr_is_erased_ref(cx, expr); . (span, is_coerced) . }; . 7,712 ( 0.00%) let ctxt = expr.span.ctxt(); 6,214 ( 0.00%) match op { . BinOpKind::Add | BinOpKind::BitOr | BinOpKind::BitXor => { 1,743 ( 0.00%) if is_redundant_op(cx, left, 0, ctxt) { 120,392 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/operators/identity_op.rs:clippy_lints::operators::identity_op::is_redundant_op (249x) . let paren = needs_parenthesis(cx, expr, right); . span_ineffective_operation(cx, expr.span, peeled_right_span, paren, right_is_coerced_to_value); . } else if is_redundant_op(cx, right, 0, ctxt) { . let paren = needs_parenthesis(cx, expr, left); . span_ineffective_operation(cx, expr.span, peeled_left_span, paren, left_is_coerced_to_value); . } . }, . BinOpKind::Shl | BinOpKind::Shr | BinOpKind::Sub if is_redundant_op(cx, right, 0, ctxt) => { . let paren = needs_parenthesis(cx, expr, left); . span_ineffective_operation(cx, expr.span, peeled_left_span, paren, left_is_coerced_to_value); . }, . BinOpKind::Mul => { 301 ( 0.00%) if is_redundant_op(cx, left, 1, ctxt) { 14,512 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/operators/identity_op.rs:clippy_lints::operators::identity_op::is_redundant_op (43x) . let paren = needs_parenthesis(cx, expr, right); . span_ineffective_operation(cx, expr.span, peeled_right_span, paren, right_is_coerced_to_value); . } else if is_redundant_op(cx, right, 1, ctxt) { . let paren = needs_parenthesis(cx, expr, left); . span_ineffective_operation(cx, expr.span, peeled_left_span, paren, left_is_coerced_to_value); . } . }, . BinOpKind::Div if is_redundant_op(cx, right, 1, ctxt) => { . let paren = needs_parenthesis(cx, expr, left); . span_ineffective_operation(cx, expr.span, peeled_left_span, paren, left_is_coerced_to_value); . }, . BinOpKind::BitAnd => { 728 ( 0.00%) if is_redundant_op(cx, left, -1, ctxt) { 31,983 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/operators/identity_op.rs:clippy_lints::operators::identity_op::is_redundant_op (104x) . let paren = needs_parenthesis(cx, expr, right); . span_ineffective_operation(cx, expr.span, peeled_right_span, paren, right_is_coerced_to_value); 312 ( 0.00%) } else if is_redundant_op(cx, right, -1, ctxt) { . let paren = needs_parenthesis(cx, expr, left); . span_ineffective_operation(cx, expr.span, peeled_left_span, paren, left_is_coerced_to_value); . } . }, 11 ( 0.00%) BinOpKind::Rem => check_remainder(cx, left, right, expr.span, left.span), . _ => (), . } 31,568 ( 0.00%) } . . fn expr_is_erased_ref(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { 21,208 ( 0.00%) match cx.typeck_results().expr_ty(expr).kind() { 154,372 ( 0.00%) => ???:::expr_ty (3,856x) 57 ( 0.00%) ty::Ref(r, ..) => r.is_erased(), . _ => false, . } . } . . #[derive(Copy, Clone)] . enum Parens { . Needed, . Unneeded, -- line 96 ---------------------------------------- -- line 106 ---------------------------------------- . /// to `if b { 1 } else { 2 } + if b { 3 } else { 4 }` where the `if` could be . /// interpreted as a statement. The same behavior happens for `match`, `loop`, . /// and blocks. . /// e.g. `2 * (0 + { a })` can be reduced to `2 * { a }` without the need for parenthesis, . /// but `1 * ({ a } + 4)` cannot be reduced to `{ a } + 4`, as a block at the start of a line . /// will be interpreted as a statement instead of an expression. . /// . /// See #8724, #13470 24 ( 0.00%) fn needs_parenthesis(cx: &LateContext<'_>, binary: &Expr<'_>, child: &Expr<'_>) -> Parens { 21 ( 0.00%) match child.kind { 2 ( 0.00%) ExprKind::Binary(_, lhs, _) | ExprKind::Cast(lhs, _) => { . // For casts and binary expressions, we want to add parenthesis if . // the parent HIR node is an expression, or if the parent HIR node . // is a Block or Stmt, and the new left hand side would need . // parenthesis be treated as a statement rather than an expression. 2 ( 0.00%) if let Some((_, parent)) = cx.tcx.hir_parent_iter(binary.hir_id).next() { 8 ( 0.00%) match parent { . Node::Expr(_) => return Parens::Needed, . Node::Block(_) | Node::Stmt(_) => { . // ensure we're checking against the leftmost expression of `child` . // . // ~~~~~~~~~~~ `binary` . // ~~~ `lhs` . // 0 + {4} * 2 . // ~~~~~~~ `child` 6 ( 0.00%) return needs_parenthesis(cx, binary, lhs); 21 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/operators/identity_op.rs:clippy_lints::operators::identity_op::needs_parenthesis'2 (1x) . }, . _ => return Parens::Unneeded, . } . } . }, . ExprKind::If(..) | ExprKind::Match(..) | ExprKind::Block(..) | ExprKind::Loop(..) => { . // For if, match, block, and loop expressions, we want to add parenthesis if . // the closest ancestor node that is not an expression is a block or statement. -- line 139 ---------------------------------------- -- line 156 ---------------------------------------- . }; . } . }, . _ => { . return Parens::Unneeded; . }, . } . Parens::Needed 24 ( 0.00%) } . . fn is_allowed<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'tcx>, . cmp: BinOpKind, . left: &Expr<'tcx>, . right: &Expr<'tcx>, . ) -> bool { . // Exclude case where the left or right side is associated function call returns a type which is . // `Self` that is not given explicitly, and the expression is not a let binding's init . // expression and the let binding has a type annotation, or a function's return value. 43,406 ( 0.00%) if (is_assoc_fn_without_type_instance(cx, left) || is_assoc_fn_without_type_instance(cx, right)) 177,688 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/operators/identity_op.rs:clippy_lints::operators::identity_op::is_assoc_fn_without_type_instance (7,892x) . && !is_expr_used_with_type_annotation(cx, expr) . { . return false; . } . . // This lint applies to integers and their references 11,838 ( 0.00%) cx.typeck_results().expr_ty(left).peel_refs().is_integral() 157,936 ( 0.00%) => ???:::expr_ty (3,946x) 5,793 ( 0.00%) && cx.typeck_results().expr_ty(right).peel_refs().is_integral() 77,288 ( 0.00%) => ???:::expr_ty (1,931x) . // `1 << 0` is a common pattern in bit manipulation code 1,931 ( 0.00%) && !(cmp == BinOpKind::Shl 837 ( 0.00%) && is_zero_integer_const(cx, right, expr.span.ctxt()) 12 ( 0.00%) && integer_const(cx, left, expr.span.ctxt()) == Some(1)) 777 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:clippy_utils::consts::integer_const (3x) . } . . fn check_remainder(cx: &LateContext<'_>, left: &Expr<'_>, right: &Expr<'_>, span: Span, arg: Span) { 22 ( 0.00%) let ecx = ConstEvalCtxt::new(cx); 616 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::new (11x) . let ctxt = span.ctxt(); 165 ( 0.00%) if match (ecx.eval_full_int(left, ctxt), ecx.eval_full_int(right, ctxt)) { 4,691 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval_full_int (22x) . (Some(FullInt::S(lv)), Some(FullInt::S(rv))) => lv.abs() < rv.abs(), . (Some(FullInt::U(lv)), Some(FullInt::U(rv))) => lv < rv, . _ => return, . } { . span_ineffective_operation(cx, span, arg, Parens::Unneeded, false); . } . } . 14,028 ( 0.00%) fn is_redundant_op(cx: &LateContext<'_>, e: &Expr<'_>, m: i8, ctxt: SyntaxContext) -> bool { 10,907 ( 0.00%) if let Some(Constant::Int(v)) = ConstEvalCtxt::new(cx).eval_local(e, ctxt).map(Constant::peel_refs) { 306,092 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval_local (1,169x) 65,464 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::new (1,169x) 1,362 ( 0.00%) let check = match *cx.typeck_results().expr_ty(e).peel_refs().kind() { 18,172 ( 0.00%) => ???:::expr_ty (454x) 755 ( 0.00%) ty::Int(ity) => unsext(cx.tcx, -1_i128, ity), 3,020 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::clip (151x) 1,818 ( 0.00%) ty::Uint(uty) => clip(cx.tcx, !0, uty), 6,778 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::clip (303x) . _ => return false, . }; 1,755 ( 0.00%) if match m { 323 ( 0.00%) 0 => v == 0, 228 ( 0.00%) -1 => v == check, 110 ( 0.00%) 1 => v == 1, . _ => unreachable!(), . } { . return true; . } . } . false 9,352 ( 0.00%) } . 22 ( 0.00%) fn span_ineffective_operation( . cx: &LateContext<'_>, . span: Span, . arg: Span, . parens: Parens, . is_ref_coerced_to_val: bool, . ) { 2 ( 0.00%) let mut applicability = Applicability::MachineApplicable; . let expr_snippet = snippet_with_applicability(cx, arg, "..", &mut applicability); 4 ( 0.00%) let expr_snippet = if is_ref_coerced_to_val { . format!("*{expr_snippet}") . } else { 6 ( 0.00%) expr_snippet.into_owned() . }; 5 ( 0.00%) let suggestion = match parens { 3 ( 0.00%) Parens::Needed => format!("({expr_snippet})"), 5 ( 0.00%) Parens::Unneeded => expr_snippet, . }; . 30 ( 0.00%) span_lint_and_sugg( 505,687 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_sugg:: (2x) . cx, . IDENTITY_OP, . span, . "this operation has no effect", . "consider reducing it to", . suggestion, . applicability, . ); 24 ( 0.00%) } . . fn is_expr_used_with_type_annotation<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) -> bool { 36 ( 0.00%) match get_expr_use_site(cx.tcx, cx.typeck_results(), expr.span.ctxt(), expr).use_node(cx) { 1,208 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_expr_use_site (2x) 52 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:::use_node (2x) . ExprUseNode::LetStmt(letstmt) => letstmt.ty.is_some(), . ExprUseNode::Return(_) => true, . _ => false, . } . } . . /// Check if the expression is an associated function without a type instance. . /// Example: -- line 261 ---------------------------------------- -- line 268 ---------------------------------------- . /// 0 . /// } . /// } . /// fn test() { . /// let _ = 0usize + &Default::default(); . /// let _ = 0usize + &Def::def(); . /// } . /// ``` 47,352 ( 0.00%) fn is_assoc_fn_without_type_instance<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'tcx>) -> bool { 31,658 ( 0.00%) if let ExprKind::Call(func, _) = peel_hir_expr_refs(expr).0.kind 39,492 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::peel_hir_expr_refs (7,892x) 570 ( 0.00%) && let ExprKind::Path(QPath::Resolved( . // If it's not None, don't need to go further. . None, . Path { . res: Res::Def(DefKind::AssocFn, def_id), . .. . }, 84 ( 0.00%) )) = func.kind . && let output_ty = cx . .tcx 6 ( 0.00%) .fn_sig(*def_id) . .instantiate_identity() . .skip_norm_wip() . .skip_binder() . .output() 6 ( 0.00%) && let ty::Param(ty::ParamTy { 4 ( 0.00%) name: kw::SelfUpper, .. . }) = output_ty.kind() . { . return true; . } . false 47,352 ( 0.00%) } 23,081 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/methods/chars_last_cmp.rs -------------------------------------------------------------------------------- Ir . use crate::methods::chars_cmp; . use clippy_utils::sym; . use rustc_lint::LateContext; . . use super::CHARS_LAST_CMP; . . /// Checks for the `CHARS_LAST_CMP` lint. . pub(super) fn check(cx: &LateContext<'_>, info: &crate::methods::BinaryExprInfo<'_>) -> bool { 40,800 ( 0.00%) if chars_cmp::check(cx, info, &[sym::chars, sym::last], CHARS_LAST_CMP, "ends_with") { 683,190 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/chars_cmp.rs:clippy_lints::methods::chars_cmp::check (4,080x) . true . } else { 32,640 ( 0.00%) chars_cmp::check(cx, info, &[sym::chars, sym::next_back], CHARS_LAST_CMP, "ends_with") 680,903 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/chars_cmp.rs:clippy_lints::methods::chars_cmp::check (4,080x) . } . } -------------------------------------------------------------------------------- -- Auto-annotated source: /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 -------------------------------------------------------------------------------- Ir -- line 53 ---------------------------------------- . } . . /// Indicates the confidence in the correctness of a suggestion. . /// . /// All suggestions are marked with an `Applicability`. Tools use the applicability of a suggestion . /// to determine whether it should be automatically applied or if the user should be consulted . /// before applying the suggestion. . #[derive(Copy, Clone, Debug, Hash, Encodable, Decodable, Serialize, Deserialize)] 6,482 ( 0.00%) #[derive(PartialEq, Eq, PartialOrd, Ord)] . pub enum Applicability { . /// The suggestion is definitely what the user intended, or maintains the exact meaning of the code. . /// This suggestion should be automatically applied. . /// . /// In case of multiple `MachineApplicable` suggestions (whether as part of . /// the same `multipart_suggestion` or not), all of them should be . /// automatically applied. . MachineApplicable, -- line 69 ---------------------------------------- -- line 144 ---------------------------------------- . fn from(id: StableLintExpectationId) -> LintExpectationId { . LintExpectationId::Stable(id) . } . } . . /// Setting for how to handle a lint. . /// . /// See: 188,091 ( 0.00%) #[derive(Clone, Copy, PartialEq, PartialOrd, Eq, Ord, Debug, Hash)] . #[derive(Encodable, Decodable, StableHash)] . pub enum Level { . /// The `allow` level will not issue any message. . Allow, . /// The `expect` level will suppress the lint message but in turn produce a message . /// if the lint wasn't issued in the expected scope. `Expect` should not be used as . /// an initial level for a lint. . /// -- line 160 ---------------------------------------- -- line 212 ---------------------------------------- . /// Converts an `Option` to a level. . pub fn from_opt_symbol(s: Option) -> Option { . s.and_then(Self::from_symbol) . } . . /// Converts a `Symbol` to a level. . pub fn from_symbol(s: Symbol) -> Option { . match s { 1,074 ( 0.00%) sym::allow => Some(Level::Allow), . sym::expect => Some(Level::Expect), . sym::warn => Some(Level::Warn), . sym::deny => Some(Level::Deny), . sym::forbid => Some(Level::Forbid), . _ => None, . } . } . -- line 228 ---------------------------------------- -- line 778 ---------------------------------------- . } . . /// Implements `LintPass for $ty` with the given list of `Lint` statics. . #[macro_export] . macro_rules! impl_lint_pass { . ($ty:ty => [$($lint:expr),* $(,)?]) => { . impl $crate::LintPass for $ty { . fn name(&self) -> &'static str { stringify!($ty) } 2,868 ( 0.00%) fn get_lints(&self) -> $crate::LintVec { vec![$($lint),*] } . } . impl $ty { . #[allow(unused)] . pub fn lint_vec() -> $crate::LintVec { vec![$($lint),*] } . } . }; . } . -- line 794 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/casts/cast_slice_from_raw_parts.rs -------------------------------------------------------------------------------- Ir -- line 13 ---------------------------------------- . use super::CAST_SLICE_FROM_RAW_PARTS; . . enum RawPartsKind { . Immutable, . Mutable, . } . . fn raw_parts_kind(cx: &LateContext<'_>, did: DefId) -> Option { 23,232 ( 0.00%) match cx.tcx.get_diagnostic_name(did)? { 740,119 ( 0.01%) => ???:::get_diagnostic_name (11,616x) . sym::slice_from_raw_parts => Some(RawPartsKind::Immutable), . sym::slice_from_raw_parts_mut => Some(RawPartsKind::Mutable), . _ => None, . } . } . 3,576 ( 0.00%) pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, cast_expr: &Expr<'_>, cast_to: Ty<'_>, msrv: Msrv) { 894 ( 0.00%) if let ty::RawPtr(ptrty, _) = cast_to.kind() 9 ( 0.00%) && let ty::Slice(_) = ptrty.kind() . && let ExprKind::Call(fun, [ptr_arg, len_arg]) = cast_expr.peel_blocks().kind . && let ExprKind::Path(ref qpath) = fun.kind . && let Some(fun_def_id) = cx.qpath_res(qpath, fun.hir_id).opt_def_id() . && let Some(rpk) = raw_parts_kind(cx, fun_def_id) . && let ctxt = expr.span.ctxt() . && cast_expr.span.ctxt() == ctxt . && msrv.meets(cx, msrvs::PTR_SLICE_RAW_PARTS) . && !expr.span.in_external_macro(cx.tcx.sess.source_map()) -- line 38 ---------------------------------------- -- line 51 ---------------------------------------- . CAST_SLICE_FROM_RAW_PARTS, . span, . format!("casting the result of `{func}` to {cast_to}"), . "replace with", . format!("{krate}::ptr::slice_{func}({ptr}, {len})"), . applicability, . ); . } 3,576 ( 0.00%) } . . /// Checks for implicit cast from slice reference to raw slice pointer. 1,937,152 ( 0.02%) pub(super) fn check_implicit_cast(cx: &LateContext<'_>, expr: &Expr<'_>) { 76,221 ( 0.00%) if let ExprKind::Call(fun, [ptr_arg, len_arg]) = expr.peel_blocks().kind 34,917 ( 0.00%) && let ExprKind::Path(ref qpath) = fun.kind 46,556 ( 0.00%) && let Some(fun_def_id) = cx.qpath_res(qpath, fun.hir_id).opt_def_id() 728,935 ( 0.01%) => ???:::qpath_res (11,639x) 34,848 ( 0.00%) && let Some(rpk) = raw_parts_kind(cx, fun_def_id) 10 ( 0.00%) && !matches!(get_parent_expr(cx, expr).map(|e| e.kind), Some(ExprKind::Cast(..))) 238 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (2x) 8 ( 0.00%) && let [deref, borrow] = cx.typeck_results().expr_adjustments(expr) 86 ( 0.00%) => ???:::expr_adjustments (2x) 4 ( 0.00%) && matches!(deref.kind, Adjust::Deref(..)) 8 ( 0.00%) && let Adjustment { . kind: Adjust::Borrow(AutoBorrow::RawPtr(..)), . target, . } = borrow . && let ty::RawPtr(pointee_ty, _) = target.kind() . && pointee_ty.is_slice() . && !expr.span.from_expansion() . { . let func = match rpk { -- line 78 ---------------------------------------- -- line 89 ---------------------------------------- . CAST_SLICE_FROM_RAW_PARTS, . expr.span, . format!("implicitly casting the result of `{func}` to `{target}`"), . "replace_with", . format!("{krate}::ptr::slice_{func}({ptr}, {len})"), . applicability, . ); . } 1,937,152 ( 0.02%) } 300,341 ( 0.00%) -------------------------------------------------------------------------------- -- 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 { 1,937,824 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>) { 485,022 ( 0.00%) if let hir::ExprKind::Closure(hir::Closure { . kind: hir::ClosureKind::Coroutine(hir::CoroutineKind::Desugared(hir::CoroutineDesugaring::Async, _)), . def_id, . .. 283 ( 0.00%) }) = expr.kind . && let Some(coroutine_layout) = cx.tcx.mir_coroutine_witnesses(*def_id) . { . self.check_interior_types(cx, coroutine_layout); . } 1,937,824 ( 0.02%) } . } . . 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: /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. 5,079 ( 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`. 3,250,287 ( 0.03%) 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. 653,185 ( 0.01%) 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 ---------------------------------------- 1,037,334 ( 0.01%) -------------------------------------------------------------------------------- -- 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 { 1,820,943 ( 0.02%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 404,654 ( 0.00%) if expr.span.from_expansion() { . return; . } . 469,680 ( 0.00%) if let Some(binops) = extract_related_binops(&expr.kind) { 837 ( 0.00%) check_binops(cx, &binops.iter().collect::>(), &mut self.linted_spans); 184,939 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::check_binops (279x) . . 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); . } . }); . 1,214 ( 0.00%) for op_type in op_types { . let ops: Vec<_> = binops.iter().filter(|b| b.op == op_type).collect(); . 1,131 ( 0.00%) check_binops(cx, &ops, &mut self.linted_spans); 150,191 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::check_binops (377x) . } . } 1,618,616 ( 0.01%) } . } . 5,904 ( 0.00%) fn check_binops(cx: &EarlyContext<'_>, binops: &[&BinaryOp<'_>], linted_spans: &mut FxHashSet) { . let binop_count = binops.len(); 1,312 ( 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(); . 684 ( 0.00%) for (i, BinaryOp { left, right, op, .. }) in binops.iter().enumerate() { 3,327 ( 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; 646 ( 0.00%) if let Some(previous_expected) = expected_ident_loc { 179 ( 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. 1,992 ( 0.00%) for id in skip_index(IdentIter::from(*left), ident_loc.index) { 46,319 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ast_utils/ident_iter.rs:>::from (323x) . paired_identifiers.insert(id); . } 323 ( 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; . }, . } . } . 131 ( 0.00%) let mut applicability = Applicability::MachineApplicable; . 393 ( 0.00%) if let Some(expected_loc) = expected_ident_loc { 786 ( 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); . } . } . }, . _ => {}, . } . } 5,248 ( 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 { 7,182 ( 0.00%) output = match &output.kind { 94 ( 0.00%) ExprKind::Paren(inner) | ExprKind::Unary(_, inner) => inner, . _ => { . return output; . }, . }; . } . } . . fn extract_related_binops(kind: &ExprKind) -> Option>> { 469,122 ( 0.00%) append_opt_vecs(chained_binops(kind), if_statement_binops(kind)) 4,312,549 ( 0.04%) => site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::if_statement_binops (156,374x) 3,441,015 ( 0.03%) => site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::append_opt_vecs:: (156,374x) . } . 1,127,714 ( 0.01%) fn if_statement_binops(kind: &ExprKind) -> Option>> { 1,117,335 ( 0.01%) match kind { 11,578 ( 0.00%) ExprKind::If(condition, _, _) => chained_binops(&condition.kind), 355 ( 0.00%) ExprKind::Paren(e) => if_statement_binops(&e.kind), . ExprKind::Block(block, _) => { 3,698 ( 0.00%) let mut output = None; 3,698 ( 0.00%) for stmt in &block.stmts { 36,268 ( 0.00%) match &stmt.kind { . StmtKind::Expr(e) | StmtKind::Semi(e) => { 66,192 ( 0.00%) output = append_opt_vecs(output, if_statement_binops(&e.kind)); 144,033 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::if_statement_binops'2 (4,660x) 103,464 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::append_opt_vecs:: (4,660x) . }, . _ => {}, . } . } 25,886 ( 0.00%) output . }, . _ => None, . } 1,266,992 ( 0.01%) } . 1,127,714 ( 0.01%) fn append_opt_vecs(target_opt: Option>, source_opt: Option>) -> Option> { 805,510 ( 0.01%) match (target_opt, source_opt) { 12 ( 0.00%) (Some(mut target), Some(source)) => { . target.reserve(source.len()); 44 ( 0.00%) for op in source { . target.push(op); . } 10 ( 0.00%) Some(target) 2 ( 0.00%) }, 1,220 ( 0.00%) (Some(v), None) | (None, Some(v)) => Some(v), 321,590 ( 0.00%) (None, None) => None, . } 1,288,816 ( 0.01%) } . . fn chained_binops(kind: &ExprKind) -> Option>> { 1,139,837 ( 0.01%) match kind { 55,478 ( 0.00%) ExprKind::Binary(_, left_outer, right_outer) => chained_binops_helper(left_outer, right_outer), 86,363 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::chained_binops_helper (2,293x) 1,469 ( 0.00%) ExprKind::Paren(e) | ExprKind::Unary(_, e) => chained_binops(&e.kind), 152,129 ( 0.00%) _ => None, . } . } . 79,370 ( 0.00%) fn chained_binops_helper<'expr>(left_outer: &'expr Expr, right_outer: &'expr Expr) -> Option>> { 60,980 ( 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), 42 ( 0.00%) ) => chained_binops_helper(left_e, right_e), . (ExprKind::Paren(left_e) | ExprKind::Unary(_, left_e), _) => chained_binops_helper(left_e, right_outer), 279 ( 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), 3,856 ( 0.00%) ) => match ( 3,374 ( 0.00%) chained_binops_helper(left_left, left_right), 53,257 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::chained_binops_helper'2 (281x) 2,892 ( 0.00%) chained_binops_helper(right_left, right_right), 9,264 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::chained_binops_helper'2 (281x) . ) { 5 ( 0.00%) (Some(mut left_ops), Some(right_ops)) => { . left_ops.reserve(right_ops.len()); 22 ( 0.00%) for op in right_ops { . left_ops.push(op); . } 4 ( 0.00%) Some(left_ops) . }, 597 ( 0.00%) (Some(mut left_ops), _) => { 398 ( 0.00%) left_ops.push(BinaryOp::new(*right_op, right_outer.span, (right_left, right_right))); 995 ( 0.00%) 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) . }, 3,102 ( 0.00%) (None, None) => Some(vec![ 564 ( 0.00%) BinaryOp::new(*left_op, left_outer.span, (left_left, left_right)), 564 ( 0.00%) BinaryOp::new(*right_op, right_outer.span, (right_left, right_right)), . ]), 482 ( 0.00%) }, 7,455 ( 0.00%) _ => None, . } 63,496 ( 0.00%) } . 179 ( 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 { . Self { 4 ( 0.00%) index: self.index + other.index, . } . } . } . . impl AddAssign for IdentLocation { . fn add_assign(&mut self, other: Self) { . *self = *self + other; . } -- line 466 ---------------------------------------- -- line 474 ---------------------------------------- . Multiple, . NonIdent, . } . . impl Add for IdentDifference { . type Output = IdentDifference; . . fn add(self, other: Self) -> Self::Output { 858 ( 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::*; . 6,415 ( 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 { 7,369 ( 0.00%) match (left_iterator.next(), right_iterator.next()) { 15,356 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ast_utils/ident_iter.rs:::next (1,736x) . (Some(left_ident), Some(right_ident)) => { 443 ( 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() 1,364 ( 0.00%) .filter_map(move |(i, a)| if i == index { None } else { Some(a) }) . } 1,007,459 ( 0.01%) -------------------------------------------------------------------------------- -- 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>) { 726,684 ( 0.01%) if cx.tcx.sess.edition() >= Edition2024 { . return; . } . 244,226 ( 0.00%) if let Some(higher::IfLet { 100 ( 0.00%) let_expr, 100 ( 0.00%) if_then, . if_else: Some(if_else), . .. 488,452 ( 0.00%) }) = higher::IfLet::hir(cx, expr) 1,858,564 ( 0.02%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (242,228x) 200 ( 0.00%) && let ctxt = expr.span.ctxt() 200 ( 0.00%) && 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, . "this Mutex will remain locked for the entire `if let`-block...", . ); -- line 74 ---------------------------------------- -- 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, . ); . } 242,228 ( 0.00%) } . } . . fn mutex_lock_call<'tcx>( . cx: &LateContext<'tcx>, . ctxt: SyntaxContext, . expr: &'tcx Expr<'_>, . op_mutex: Option<&'tcx Expr<'_>>, . ) -> ControlFlow<&'tcx Expr<'tcx>> { 824 ( 0.00%) if let ExprKind::MethodCall(path, self_arg, [], _) = &expr.kind 84 ( 0.00%) && path.ident.name == sym::lock . && let ty = cx.typeck_results().expr_ty(self_arg).peel_refs() . && ty.is_diag_item(cx, sym::Mutex) . && op_mutex.is_none_or(|op| eq_expr_value(cx, ctxt, self_arg, op)) . { . ControlFlow::Break(self_arg) . } else { . ControlFlow::Continue(()) . } -- line 107 ---------------------------------------- 4,118,276 ( 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_middle/src/ty/mod.rs -------------------------------------------------------------------------------- Ir -- line 469 ---------------------------------------- . pub before_feature_tys: Ty<'tcx>, . /// Tuple containing the types of closure captures after the feature `capture_disjoint_fields` . pub after_feature_tys: Ty<'tcx>, . } . . impl TyCtxt<'_> { . #[inline] . pub fn opt_parent(self, id: DefId) -> Option { 192,730 ( 0.00%) self.def_key(id).parent.map(|index| DefId { index, ..id }) 18,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/context.rs:::def_key:: (206x) . } . . #[inline] . #[track_caller] 8 ( 0.00%) pub fn parent(self, id: DefId) -> DefId { . match self.opt_parent(id) { . Some(id) => id, . // not `unwrap_or_else` to avoid breaking caller tracking . None => bug!("{id:?} doesn't have a parent"), . } 4 ( 0.00%) } . . #[inline] . #[track_caller] . pub fn opt_local_parent(self, id: LocalDefId) -> Option { . self.opt_parent(id.to_def_id()).map(DefId::expect_local) . } . . #[inline] . #[track_caller] 26,616 ( 0.00%) pub fn local_parent(self, id: impl Into) -> LocalDefId { . self.parent(id.into().to_def_id()).expect_local() 9,981 ( 0.00%) } . . /// Compare def-ids based on their position in def-id tree, ancestor def-ids are considered . /// larger than descendant def-ids, and two different def-ids are considered unordered if . /// neither of them is an ancestor of the other. . fn def_id_partial_cmp(self, lhs: DefId, rhs: DefId) -> Option { . // Def-ids from different crates are always unordered. . if lhs.krate != rhs.krate { . return None; -- line 508 ---------------------------------------- -- line 527 ---------------------------------------- . } . } . . pub fn is_descendant_of( . self, . descendant: impl Into, . ancestor: impl Into, . ) -> bool { 48 ( 0.00%) matches!( 48 ( 0.00%) self.def_id_partial_cmp(descendant.into(), ancestor.into()), 512 ( 0.00%) => ???:::def_id_partial_cmp (24x) . Some(Ordering::Less | Ordering::Equal) . ) . } . } . . impl Visibility { . pub fn is_public(self) -> bool { 8,433 ( 0.00%) matches!(self, Visibility::Public) . } . . pub fn map_id(self, f: impl FnOnce(Id) -> OutId) -> Visibility { . match self { . Visibility::Public => Visibility::Public, . Visibility::Restricted(id) => Visibility::Restricted(f(id)), . } . } -- line 552 ---------------------------------------- -- line 556 ---------------------------------------- . pub fn to_mod_id(self) -> Visibility { . self.map_id(LocalModId::to_mod_id) . } . } . . impl> Visibility { . /// Returns `true` if an item with this visibility is accessible from the given module. . pub fn is_accessible_from(self, module: impl Into, tcx: TyCtxt<'_>) -> bool { 74 ( 0.00%) match self { . // Public items are visible everywhere. . Visibility::Public => true, . Visibility::Restricted(id) => tcx.is_descendant_of(module, id), . } . } . . pub fn partial_cmp( . self, -- line 572 ---------------------------------------- -- line 635 ---------------------------------------- . // the types of AST nodes. . #[derive(Copy, Clone, PartialEq, Eq, Hash)] . pub struct CReaderCacheKey { . pub cnum: Option, . pub pos: usize, . } . . /// Use this rather than `TyKind`, whenever possible. 30 ( 0.00%) #[derive(Copy, Clone, PartialEq, Eq, Hash, StableHash)] . #[rustc_diagnostic_item = "Ty"] . #[rustc_pass_by_value] . pub struct Ty<'tcx>(Interned<'tcx, WithCachedTypeInfo>>); . . impl<'tcx> rustc_type_ir::inherent::IntoKind for Ty<'tcx> { . type Kind = TyKind<'tcx>; . . fn kind(self) -> TyKind<'tcx> { 4,957 ( 0.00%) *self.kind() . } . } . . impl<'tcx> rustc_type_ir::Flags for Ty<'tcx> { . fn flags(&self) -> TypeFlags { 15,554 ( 0.00%) self.0.flags . } . . fn outer_exclusive_binder(&self) -> DebruijnIndex { 60 ( 0.00%) self.0.outer_exclusive_binder . } . } . . /// The crate outlives map is computed during typeck and contains the . /// outlives of every item in the local crate. You should not use it . /// directly, because to do so will make your pass dependent on the . /// HIR of every item in the local crate. Instead, use . /// `tcx.inferred_outlives_of()` to get the outlives for a *particular* -- line 670 ---------------------------------------- -- line 771 ---------------------------------------- . res.pack() . } . } . . impl<'tcx> Term<'tcx> { . #[inline] . pub fn kind(self) -> TermKind<'tcx> { . let ptr = 274 ( 0.00%) unsafe { self.ptr.map_addr(|addr| NonZero::new_unchecked(addr.get() & !TAG_MASK)) }; . // SAFETY: use of `Interned::new_unchecked` here is ok because these . // pointers were originally created from `Interned` types in `pack()`, . // and this is just going in the other direction. . unsafe { 484 ( 0.00%) match self.ptr.addr().get() & TAG_MASK { . TYPE_TAG => TermKind::Ty(Ty(Interned::new_unchecked( . ptr.cast::>>().as_ref(), . ))), . CONST_TAG => TermKind::Const(ty::Const(Interned::new_unchecked( . ptr.cast::>>().as_ref(), . ))), . _ => core::intrinsics::unreachable(), . } -- line 792 ---------------------------------------- -- line 1211 ---------------------------------------- . /// Most of the time you only need to care about the `ParamEnv` . /// as the `TypingMode` is simply stored in the `InferCtxt`. . /// . /// However, there are some places which rely on trait solving . /// without using an `InferCtxt` themselves. For these to be . /// able to use the trait system they have to be able to initialize . /// such an `InferCtxt` with the right `typing_mode`, so they need . /// to track both. 4,223 ( 0.00%) #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, StableHash)] . #[derive(TypeVisitable, TypeFoldable)] . pub struct TypingEnv<'tcx> { . #[type_foldable(identity)] . #[type_visitable(ignore)] . typing_mode: TypingModeEqWrapper<'tcx>, . pub param_env: ParamEnv<'tcx>, . } . . impl<'tcx> TypingEnv<'tcx> { . pub fn new(param_env: ParamEnv<'tcx>, typing_mode: TypingMode<'tcx>) -> Self { 12,172 ( 0.00%) Self { typing_mode: TypingModeEqWrapper(typing_mode), param_env } . } . . pub fn typing_mode(&self) -> TypingMode<'tcx> { . self.typing_mode.0 . } . . /// Create a typing environment with no where-clauses in scope . /// where all opaque types and default associated items are revealed. -- line 1238 ---------------------------------------- -- line 1245 ---------------------------------------- . Self::new(ParamEnv::empty(), TypingMode::Codegen) . } . . /// Create a typing environment for use during analysis outside of a body. . /// . /// Using a typing environment inside of bodies is not supported as the body . /// may define opaque types. In this case the used functions have to be . /// converted to use proper canonical inputs instead. 33,945 ( 0.00%) pub fn non_body_analysis( . tcx: TyCtxt<'tcx>, . def_id: impl IntoQueryKey, . ) -> TypingEnv<'tcx> { . let def_id = def_id.into_query_key(); . Self::new(tcx.param_env(def_id), TypingMode::non_body_analysis()) 25,329 ( 0.00%) } . . /// Ideally we just use `TypingMode::PostTypeckUntilBorrowck`. . /// But that's not compatible with the old solver yet. . /// . /// FIXME: this should not be needed in the long term. . pub fn post_typeck_until_borrowck_for_mir_build( . tcx: TyCtxt<'tcx>, . def_id: LocalDefId, -- line 1267 ---------------------------------------- -- line 1333 ---------------------------------------- . // canonical queries in the trait solver, at which point we can readd this assert. . // . // As of writing this comment, this is only used when normalizing consts that mention . // params. . /* debug_assert!( . !value.has_placeholders(), . "{value:?} which has placeholder shouldn't be pseudo-canonicalized" . ); */ 4,410 ( 0.00%) PseudoCanonicalInput { typing_env: self, value } . } . } . . /// Similar to `CanonicalInput`, this carries the `typing_mode` and the environment . /// necessary to do any kind of trait solving inside of nested queries. . /// . /// Unlike proper canonicalization, this requires the `param_env` and the `value` to not . /// contain anything local to the `infcx` of the caller, so we don't actually canonicalize . /// anything. . /// . /// This should be created by using `infcx.pseudo_canonicalize_query(param_env, value)` . /// or by using `typing_env.as_query_input(value)`. . #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash)] . #[derive(StableHash, TypeVisitable, TypeFoldable)] . pub struct PseudoCanonicalInput<'tcx, T> { 1,402 ( 0.00%) pub typing_env: TypingEnv<'tcx>, 50 ( 0.00%) pub value: T, . } . . #[derive(Copy, Clone, Debug, StableHash, Encodable, Decodable)] . pub struct Destructor { . /// The `DefId` of the destructor method . pub did: DefId, . } . -- line 1366 ---------------------------------------- -- line 1368 ---------------------------------------- . #[derive(Copy, Clone, Debug, StableHash, Encodable, Decodable)] . pub struct AsyncDestructor { . /// The `DefId` of the `impl AsyncDrop` . pub impl_did: DefId, . } . . #[derive(Clone, Copy, PartialEq, Eq, StableHash, TyEncodable, TyDecodable)] . pub struct VariantFlags(u8); 25 ( 0.00%) bitflags::bitflags! { . impl VariantFlags: u8 { . const NO_VARIANT_FLAGS = 0; . /// Indicates whether the field list of this variant is `#[non_exhaustive]`. . const IS_FIELD_LIST_NON_EXHAUSTIVE = 1 << 0; . } . } . rustc_data_structures::external_bitflags_debug! { VariantFlags } . -- line 1384 ---------------------------------------- -- line 1456 ---------------------------------------- . pub fn is_field_list_non_exhaustive(&self) -> bool { . self.flags.intersects(VariantFlags::IS_FIELD_LIST_NON_EXHAUSTIVE) . } . . /// Returns `true` if the field list of this variant is `#[non_exhaustive]` . /// and the type has been defined in another crate. . #[inline] . pub fn field_list_has_applicable_non_exhaustive(&self) -> bool { 47 ( 0.00%) self.is_field_list_non_exhaustive() && !self.def_id.is_local() . } . . /// Computes the `Ident` of this variant by looking up the `Span` . pub fn ident(&self, tcx: TyCtxt<'_>) -> Ident { . Ident::new(self.name, tcx.def_ident_span(self.def_id).unwrap()) . } . . /// Was this variant obtained as part of recovering from a syntactic error? -- line 1472 ---------------------------------------- -- line 1477 ---------------------------------------- . . #[inline] . pub fn ctor_kind(&self) -> Option { . self.ctor.map(|(kind, _)| kind) . } . . #[inline] . pub fn ctor_def_id(&self) -> Option { 173,100 ( 0.00%) self.ctor.map(|(_, def_id)| def_id) . } . . /// Returns the one field in this variant. . /// . /// `panic!`s if there are no fields or multiple fields. . #[inline] . pub fn single_field(&self) -> &FieldDef { . assert!(self.fields.len() == 1); -- line 1493 ---------------------------------------- -- line 1790 ---------------------------------------- . pack: min_pack, . flags, . field_shuffle_seed, . scalable: elt, . } . } . . /// Look up the name of a definition across crates. This does not look at HIR. 232,540 ( 0.00%) pub fn opt_item_name(self, def_id: impl IntoQueryKey) -> Option { . let def_id = def_id.into_query_key(); . if let Some(cnum) = def_id.as_crate_root() { . Some(self.crate_name(cnum)) . } else { 99,660 ( 0.00%) let def_key = self.def_key(def_id); 2,678,445 ( 0.02%) => /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:: (33,215x) 199,320 ( 0.00%) match def_key.disambiguated_data.data { . // The name of a constructor is that of its parent. . rustc_hir::definitions::DefPathData::Ctor => self 20 ( 0.00%) .opt_item_name(DefId { krate: def_id.krate, index: def_key.parent.unwrap() }), 290 ( 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:::opt_item_name::'2 (5x) . _ => def_key.get_opt_name(), . } . } 199,320 ( 0.00%) } . . /// Look up the name of a definition across crates. This does not look at HIR. . /// . /// This method will ICE if the corresponding item does not have a name. In these cases, use . /// [`opt_item_name`] instead. . /// . /// [`opt_item_name`]: Self::opt_item_name . pub fn item_name(self, id: impl IntoQueryKey) -> Symbol { . let id = id.into_query_key(); 125,736 ( 0.00%) self.opt_item_name(id).unwrap_or_else(|| { 227,328 ( 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:::opt_item_name:: (1,776x) . bug!("item_name: no name for {:?}", self.def_path(id)); . }) . } . . /// Look up the name and span of a definition. . /// . /// See [`item_name`][Self::item_name] for more information. . pub fn opt_item_ident(self, def_id: impl IntoQueryKey) -> Option { -- line 1829 ---------------------------------------- -- line 1987 ---------------------------------------- . /// Gets all attributes with the given name. . #[deprecated = "Though there are valid usecases for this method, especially when your attribute is not a parsed attribute, usually you want to call rustc_hir::find_attr! instead."] . pub fn get_attrs( . self, . did: impl Into, . attr: Symbol, . ) -> impl Iterator { . #[expect(deprecated)] 11,432 ( 0.00%) self.get_all_attrs(did).iter().filter(move |a: &&hir::Attribute| a.has_name(attr)) 843,862 ( 0.01%) => /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:::get_all_attrs:: (5,716x) . } . . /// Gets all attributes. . /// . /// To see if an item has a specific attribute, you should use . /// [`rustc_hir::find_attr!`] so you can use matching. . #[deprecated = "Though there are valid usecases for this method, especially when your attribute is not a parsed attribute, usually you want to call rustc_hir::find_attr! instead."] 55,539 ( 0.00%) pub fn get_all_attrs(self, did: impl Into) -> &'tcx [hir::Attribute] { . let did: DefId = did.into(); . if let Some(did) = did.as_local() { 18,273 ( 0.00%) self.hir_attrs(self.local_def_id_to_hir_id(did)) 25,722 ( 0.00%) => ???:::hir_attrs (375x) . } else { . self.attrs_for_def(did) . } 49,368 ( 0.00%) } . . pub fn get_attrs_by_path( . self, . did: DefId, . attr: &[Symbol], . ) -> impl Iterator { . let filter_fn = move |a: &&hir::Attribute| a.path_matches(attr); . if let Some(did) = did.as_local() { -- line 2018 ---------------------------------------- -- line 2148 ---------------------------------------- . let parent = self.parent(def_id); . let def_kind = self.def_kind(parent); . Some((parent, def_kind)) . } . . /// Returns the trait item that is implemented by the given item `DefId`. . pub fn trait_item_of(self, def_id: impl IntoQueryKey) -> Option { . let def_id = def_id.into_query_key(); 2,548 ( 0.00%) self.opt_associated_item(def_id)?.trait_item_def_id() 78,659 ( 0.00%) => ???:::opt_associated_item (637x) . } . . /// If the given `DefId` is an associated item of a trait, . /// returns the `DefId` of the trait; otherwise, returns `None`. . pub fn trait_of_assoc(self, def_id: DefId) -> Option { . match self.assoc_parent(def_id) { . Some((id, DefKind::Trait)) => Some(id), . _ => None, -- line 2164 ---------------------------------------- -- line 2201 ---------------------------------------- . } . . pub fn impl_polarity(self, def_id: impl IntoQueryKey) -> ty::ImplPolarity { . let def_id = def_id.into_query_key(); . self.impl_trait_header(def_id).polarity . } . . /// Given an `impl_id`, return the trait it implements. 60,354 ( 0.00%) pub fn impl_trait_ref( . self, . def_id: impl IntoQueryKey, . ) -> ty::EarlyBinder<'tcx, ty::TraitRef<'tcx>> { . let def_id = def_id.into_query_key(); 10,838 ( 0.00%) self.impl_trait_header(def_id).trait_ref 41,794 ( 0.00%) } . . /// Given an `impl_id`, return the trait it implements. . /// Returns `None` if it is an inherent impl. . pub fn impl_opt_trait_ref( . self, . def_id: impl IntoQueryKey, . ) -> Option>> { . let def_id = def_id.into_query_key(); . self.impl_is_of_trait(def_id).then(|| self.impl_trait_ref(def_id)) . } . . /// Given the `DefId` of an impl, returns the `DefId` of the trait it implements. . pub fn impl_trait_id(self, def_id: impl IntoQueryKey) -> DefId { . let def_id = def_id.into_query_key(); 13,494 ( 0.00%) self.impl_trait_ref(def_id).skip_binder().def_id 403,762 ( 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:: (4,498x) . } . . /// Given the `DefId` of an impl, returns the `DefId` of the trait it implements. . /// Returns `None` if it is an inherent impl. . pub fn impl_opt_trait_id(self, def_id: impl IntoQueryKey) -> Option { . let def_id = def_id.into_query_key(); . self.impl_is_of_trait(def_id).then(|| self.impl_trait_id(def_id)) . } -- line 2238 ---------------------------------------- -- line 2305 ---------------------------------------- . } . . /// Checks whether this is a `const fn`. Returns `false` for non-functions. . /// . /// Even if this returns `true`, constness may still be unstable! . #[inline] . pub fn is_const_fn(self, def_id: impl IntoQueryKey) -> bool { . let def_id = def_id.into_query_key(); 1,646 ( 0.00%) matches!( 824 ( 0.00%) self.def_kind(def_id), . DefKind::Fn | DefKind::AssocFn | DefKind::Ctor(_, CtorKind::Fn) | DefKind::Closure 412 ( 0.00%) ) && matches!(self.constness(def_id), hir::Constness::Const { .. }) . } . . /// Whether this item is conditionally constant for the purposes of the . /// effects implementation. . /// . /// This roughly corresponds to all const functions and other callable . /// items, along with const impls and traits, and associated types within . /// those impls and traits. -- line 2324 ---------------------------------------- 7,142 ( 0.00%) -------------------------------------------------------------------------------- -- 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 31,527 ( 0.00%) pub fn current(self, cx: &LateContext<'_>) -> Option { 545,956 ( 0.00%) if SEEN_MSRV_ATTR.load(Ordering::Relaxed) { . self.for_attrs(cx.tcx, cx.last_node_with_lint_attrs) . } else { . self.0 . } 42,036 ( 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 { 34 ( 0.00%) if SEEN_MSRV_ATTR.load(Ordering::Relaxed) { . self.for_attrs(tcx, node) . } else { . self.0 . } . } . . fn for_attrs(self, tcx: TyCtxt<'_>, node: HirId) -> Option { . once(node) -- line 139 ---------------------------------------- -- 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 2,677,220 ( 0.02%) pub fn meets(self, cx: &LateContext<'_>, required: RustcVersion) -> bool { 2,142,234 ( 0.02%) self.current(cx).is_none_or(|msrv| msrv >= required) 2,141,776 ( 0.02%) } . /// 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) . } . 24 ( 0.00%) pub fn is_stable(self, cx: &LateContext<'_>, def_id: DefId) -> bool { 3 ( 0.00%) self.stability_met(cx, cx.tcx.lookup_stability(def_id).map(|stability| stability.level)) 24 ( 0.00%) } . . /// Checks whether `def_id` is `const` and const-stable since a version met by the MSRV. . /// . /// `def_id` must identify a function-like definition or an impl. . /// . /// Nothing in the crate being linted carries a const-stability attribute, so `const` fns and . /// impls defined there are treated as meeting any MSRV, mirroring . /// [`is_stable`](Self::is_stable). -- line 170 ---------------------------------------- -- line 192 ---------------------------------------- . self.is_const_stable(cx, def_id) . } else { . self.is_stable(cx, def_id) . } . } . . fn stability_met(self, cx: &LateContext<'_>, level: Option) -> bool { . level.is_none_or(|level| { 2 ( 0.00%) if let StabilityLevel::Stable { since, .. } = level { 4 ( 0.00%) let version = match since { . StableSince::Version(version) => version, . StableSince::Current => RustcVersion::CURRENT, . StableSince::Err(_) => return false, . }; . . self.meets(cx, version) . } else { . // Unstable fn. -- line 209 ---------------------------------------- -- line 232 ---------------------------------------- . } . . impl MsrvStack { . pub fn current(&self) -> Option { . self.stack.last().copied() . } . . pub fn meets(&self, required: RustcVersion) -> bool { 1,246,860 ( 0.01%) self.current().is_none_or(|msrv| msrv >= required) 249,372 ( 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); . } 1,632,456 ( 0.01%) } . . pub fn check_attributes_post(&mut self, attrs: &[Attribute]) { . if parse_attrs(attrs).is_some() { . self.stack.pop(); . } 1,632,456 ( 0.01%) } . } . . fn parse_attrs(attrs: &[impl AttributeExt]) -> Option { 675,896 ( 0.01%) let msrv_attr = attrs.iter().find(|attr| attr.path_matches(&[sym::clippy, sym::msrv]))?; 423,436 ( 0.00%) => ???:::path_matches (84,487x) . . let msrv = msrv_attr.value_str()?; . . parse_version(msrv) . } . 2,459,664 ( 0.02%) pub fn check_attrs(sess: &Session, attrs: &[impl AttributeExt]) { 61,172 ( 0.00%) let mut msrv_attrs = attrs.iter().filter(|attr| attr.path_matches(&[sym::clippy, sym::msrv])); 77,568 ( 0.00%) => ???:::path_matches (15,293x) . . 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")); . } 2,459,664 ( 0.02%) } 550,742 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/mut_key.rs -------------------------------------------------------------------------------- Ir -- line 70 ---------------------------------------- . impl_lint_pass!(MutableKeyType<'_> => [MUTABLE_KEY_TYPE]); . . pub struct MutableKeyType<'tcx> { . interior_mut: InteriorMut<'tcx>, . } . . impl<'tcx> LateLintPass<'tcx> for MutableKeyType<'tcx> { . fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'tcx>) { 11,876 ( 0.00%) if let hir::ItemKind::Fn { ref sig, .. } = item.kind { 4,932 ( 0.00%) self.check_sig(cx, item.owner_id.def_id, sig.decl); 625,313 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/mut_key.rs:::check_sig (1,233x) . } . } . . fn check_impl_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::ImplItem<'tcx>) { 8,222 ( 0.00%) if let hir::ImplItemKind::Fn(ref sig, ..) = item.kind 19,570 ( 0.00%) && trait_ref_of_method(cx, item.owner_id).is_none() 602,292 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::trait_ref_of_method (3,914x) . { 5,784 ( 0.00%) self.check_sig(cx, item.owner_id.def_id, sig.decl); 651,143 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/mut_key.rs:::check_sig (1,446x) . } . } . . fn check_trait_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::TraitItem<'tcx>) { 2,526 ( 0.00%) if let hir::TraitItemKind::Fn(ref sig, ..) = item.kind { 4,944 ( 0.00%) self.check_sig(cx, item.owner_id.def_id, sig.decl); 474,853 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/mut_key.rs:::check_sig (1,236x) . } . } . . fn check_local(&mut self, cx: &LateContext<'tcx>, local: &hir::LetStmt<'tcx>) { 60,183 ( 0.00%) if let hir::PatKind::Wild = local.pat.kind { . return; . } 137,550 ( 0.00%) self.check_ty_(cx, local.span, cx.typeck_results().pat_ty(local.pat)); 1,341,923 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/mut_key.rs:::check_ty_ (19,650x) 786,784 ( 0.01%) => ???:::pat_ty (19,650x) . } . } . . impl<'tcx> MutableKeyType<'tcx> { . pub fn new(tcx: TyCtxt<'tcx>, conf: &'static Conf) -> Self { . Self { 1 ( 0.00%) interior_mut: InteriorMut::without_pointers(tcx, &conf.ignore_interior_mutability), 1,137 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:::without_pointers (1x) . } . } . 43,065 ( 0.00%) fn check_sig(&mut self, cx: &LateContext<'tcx>, fn_def_id: LocalDefId, decl: &hir::FnDecl<'tcx>) { 3,915 ( 0.00%) let fn_sig = cx.tcx.fn_sig(fn_def_id).instantiate_identity().skip_norm_wip(); 19,455 ( 0.00%) for (hir_ty, ty) in iter::zip(decl.inputs, fn_sig.inputs().skip_binder()) { 46,385 ( 0.00%) self.check_ty_(cx, hir_ty.span, *ty); 581,009 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/mut_key.rs:::check_ty_ (9,277x) . } 19,575 ( 0.00%) self.check_ty_( 284,105 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/mut_key.rs:::check_ty_ (3,915x) . cx, . decl.output.span(), 11,745 ( 0.00%) cx.tcx.instantiate_bound_regions_with_erased(fn_sig.output()), 246,140 ( 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:: (3,915x) . ); 31,320 ( 0.00%) } . . // We want to lint 1. sets or maps with 2. not immutable key types and 3. no unerased . // generics (because the compiler cannot ensure immutability for unknown types). 262,736 ( 0.00%) fn check_ty_(&mut self, cx: &LateContext<'tcx>, span: Span, ty: Ty<'tcx>) { . let ty = ty.peel_refs(); . if let ty::Adt(def, args) = ty.kind() 109,516 ( 0.00%) && matches!( 87,640 ( 0.00%) cx.tcx.get_diagnostic_name(def.did()), 1,254,176 ( 0.01%) => ???:::get_diagnostic_name (21,910x) . Some(sym::HashMap | sym::BTreeMap | sym::HashSet | sym::BTreeSet) . ) . { 21 ( 0.00%) let subst_ty = args.type_at(0); 84 ( 0.00%) if let Some(chain) = self.interior_mut.interior_mut_ty_chain(cx, subst_ty) { 6,638 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:::interior_mut_ty_chain (21x) . span_lint_and_then(cx, MUTABLE_KEY_TYPE, span, "mutable key type", |diag| { . for ty in chain.iter().rev() { . diag.note(with_forced_trimmed_paths!(format!( . "... because it contains `{ty}`, which has interior mutability" . ))); . } . }); . } . } 197,052 ( 0.00%) } . } 22,051 ( 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/collections/btree/node.rs -------------------------------------------------------------------------------- Ir -- line 232 ---------------------------------------- . } . } . . impl NodeRef { . /// Creates a new internal (height > 0) `NodeRef` . fn new_internal(child: Root, alloc: A) -> Self { . let mut new_node = unsafe { InternalNode::new(alloc) }; . new_node.edges[0].write(child.node); 12 ( 0.00%) NodeRef::from_new_internal(new_node, NonZero::new(child.height + 1).unwrap()) . } . . /// Creates a new internal (height > 0) `NodeRef` from an existing internal node . fn from_new_internal( . internal: Box, A>, . height: NonZero, . ) -> Self { . // The allocator must be dropped, not leaked. See also `BTreeMap::alloc`. -- line 248 ---------------------------------------- -- line 282 ---------------------------------------- . impl NodeRef { . /// Finds the length of the node. This is the number of keys or values. . /// The number of edges is `len() + 1`. . /// Note that, despite being safe, calling this function can have the side effect . /// of invalidating mutable references that unsafe code has created. . pub(super) fn len(&self) -> usize { . // Crucially, we only access the `len` field here. If BorrowType is marker::ValMut, . // there might be outstanding mutable references to values that we must not invalidate. 22,118 ( 0.00%) unsafe { usize::from((*Self::as_leaf_ptr(self)).len) } . } . . /// Returns the number of levels that the node and leaves are apart. Zero . /// height means the node is a leaf itself. If you picture trees with the . /// root on top, the number says at which elevation the node appears. . /// If you picture trees with leaves on top, the number says how high . /// the tree extends above the node. . pub(super) fn height(&self) -> usize { -- line 298 ---------------------------------------- -- line 306 ---------------------------------------- . . /// Exposes the leaf portion of any leaf or internal node. . /// . /// Returns a raw ptr to avoid invalidating other references to this node. . fn as_leaf_ptr(this: &Self) -> *mut LeafNode { . // The node must be valid for at least the LeafNode portion. . // This is not a reference in the NodeRef type because we don't know if . // it should be unique or shared. 2,923 ( 0.00%) this.node.as_ptr() . } . } . . impl NodeRef { . /// Finds the parent of the current node. Returns `Ok(handle)` if the current . /// node actually has a parent, where `handle` points to the edge of the parent . /// that points to the current node. Returns `Err(self)` if the current node has . /// no parent, giving back the original `NodeRef`. -- line 322 ---------------------------------------- -- line 330 ---------------------------------------- . ) -> Result, marker::Edge>, Self> { . const { . assert!(BorrowType::TRAVERSAL_PERMIT); . } . . // We need to use raw pointers to nodes because, if BorrowType is marker::ValMut, . // there might be outstanding mutable references to values that we must not invalidate. . let leaf_ptr: *const _ = Self::as_leaf_ptr(&self); 1,436 ( 0.00%) unsafe { (*leaf_ptr).parent } . .as_ref() . .map(|parent| Handle { 946 ( 0.00%) node: NodeRef::from_internal(*parent, self.height + 1), 940 ( 0.00%) idx: unsafe { usize::from((*leaf_ptr).parent_idx.assume_init()) }, . _marker: PhantomData, . }) . .ok_or(self) . } . . pub(super) fn first_edge(self) -> Handle { . unsafe { Handle::new_edge(self, 0) } . } -- line 350 ---------------------------------------- -- line 388 ---------------------------------------- . let ptr = Self::as_leaf_ptr(&self); . // SAFETY: there can be no mutable references into this tree borrowed as `Immut`. . unsafe { &*ptr } . } . . /// Borrows a view into the keys stored in the node. . pub(super) fn keys(&self) -> &[K] { . let leaf = self.into_leaf(); 23,030 ( 0.00%) unsafe { leaf.keys.get_unchecked(..usize::from(leaf.len)).assume_init_ref() } . } . } . . impl NodeRef { . /// Similar to `ascend`, gets a reference to a node's parent node, but also . /// deallocates the current node in the process. This is unsafe because the . /// current node will still be accessible despite being deallocated. . pub(super) unsafe fn deallocate_and_ascend( -- line 404 ---------------------------------------- -- line 406 ---------------------------------------- . alloc: A, . ) -> Option, marker::Edge>> { . let height = self.height; . let node = self.node; . let ret = self.ascend().ok(); . unsafe { . alloc.deallocate( . node.cast(), 481 ( 0.00%) if height > 0 { . Layout::new::>() . } else { . Layout::new::>() . }, . ); . } . ret . } -- line 422 ---------------------------------------- -- line 567 ---------------------------------------- . } . } . . impl<'a, K: 'a, V: 'a> NodeRef, K, V, marker::LeafOrInternal> { . /// Sets the node's link to its parent edge, . /// without invalidating other references to the node. . fn set_parent_link(&mut self, parent: NonNull>, parent_idx: usize) { . let leaf = Self::as_leaf_ptr(self); 4,111 ( 0.00%) unsafe { (*leaf).parent = Some(parent) }; . unsafe { (*leaf).parent_idx.write(parent_idx as u16) }; . } . } . . impl NodeRef { . /// Clears the root's link to its parent edge. . fn clear_parent_link(&mut self) { . let mut root_node = self.borrow_mut(); -- line 583 ---------------------------------------- -- line 633 ---------------------------------------- . } . } . . impl NodeRef { . /// Mutably borrows the owned root node. Unlike `reborrow_mut`, this is safe . /// because the return value cannot be used to destroy the root, and there . /// cannot be other references to the tree. . pub(super) fn borrow_mut(&mut self) -> NodeRef, K, V, Type> { 3,456 ( 0.00%) NodeRef { height: self.height, node: self.node, _marker: PhantomData } . } . . /// Slightly mutably borrows the owned root node. . pub(super) fn borrow_valmut(&mut self) -> NodeRef, K, V, Type> { . NodeRef { height: self.height, node: self.node, _marker: PhantomData } . } . . /// Irreversibly transitions to a reference that permits traversal and offers -- line 649 ---------------------------------------- -- line 663 ---------------------------------------- . pub(super) unsafe fn push_with_handle<'b>( . &mut self, . key: K, . val: V, . ) -> Handle, K, V, marker::Leaf>, marker::KV> { . let len = self.len_mut(); . let idx = usize::from(*len); . assert!(idx < CAPACITY); 3 ( 0.00%) *len += 1; . unsafe { . self.key_area_mut(idx).write(key); . self.val_area_mut(idx).write(val); . Handle::new_kv( . NodeRef { height: self.height, node: self.node, _marker: PhantomData }, . idx, . ) . } -- line 679 ---------------------------------------- -- line 686 ---------------------------------------- . unsafe { self.push_with_handle(key, val).into_val_mut() } . } . } . . impl<'a, K: 'a, V: 'a> NodeRef, K, V, marker::Internal> { . /// Adds a key-value pair, and an edge to go to the right of that pair, . /// to the end of the node. . pub(super) fn push(&mut self, key: K, val: V, edge: Root) { 12 ( 0.00%) assert!(edge.height == self.height - 1); . . let len = self.len_mut(); . let idx = usize::from(*len); . assert!(idx < CAPACITY); 6 ( 0.00%) *len += 1; . unsafe { . self.key_area_mut(idx).write(key); . self.val_area_mut(idx).write(val); . self.edge_area_mut(idx + 1).write(edge.node); . Handle::new_edge(self.reborrow_mut(), idx + 1).correct_parent_link(); . } . } . } -- line 707 ---------------------------------------- -- line 723 ---------------------------------------- . impl NodeRef { . /// Checks whether a node is an `Internal` node or a `Leaf` node. . pub(super) fn force( . self, . ) -> ForceResult< . NodeRef, . NodeRef, . > { 37,144 ( 0.00%) if self.height == 0 { . ForceResult::Leaf(NodeRef { . height: self.height, . node: self.node, . _marker: PhantomData, . }) . } else { . ForceResult::Internal(NodeRef { . height: self.height, -- line 739 ---------------------------------------- -- line 804 ---------------------------------------- . Handle { node, idx, _marker: PhantomData } . } . . pub(super) fn left_edge(self) -> Handle, marker::Edge> { . unsafe { Handle::new_edge(self.node, self.idx) } . } . . pub(super) fn right_edge(self) -> Handle, marker::Edge> { 10,120 ( 0.00%) unsafe { Handle::new_edge(self.node, self.idx + 1) } . } . } . . impl PartialEq . for Handle, HandleType> . { . fn eq(&self, other: &Self) -> bool { . let Self { node, idx, _marker } = self; -- line 820 ---------------------------------------- -- line 862 ---------------------------------------- . /// . /// # Safety . /// . /// The reborrow must have ended, i.e., the reference returned by `new` and . /// all pointers and references derived from it, must not be used anymore. . pub(super) unsafe fn awaken<'a>( . self, . ) -> Handle, K, V, NodeType>, HandleType> { 9,681 ( 0.00%) Handle { node: unsafe { self.node.awaken() }, idx: self.idx, _marker: PhantomData } . } . } . . impl Handle, marker::Edge> { . /// Creates a new handle to an edge in `node`. . /// Unsafe because the caller must ensure that `idx <= node.len()`. . pub(super) unsafe fn new_edge(node: NodeRef, idx: usize) -> Self { . debug_assert!(idx <= node.len()); -- line 878 ---------------------------------------- -- line 888 ---------------------------------------- . } else { . Err(self) . } . } . . pub(super) fn right_kv( . self, . ) -> Result, marker::KV>, Self> { 15,998 ( 0.00%) if self.idx < self.node.len() { . Ok(unsafe { Handle::new_kv(self.node, self.idx) }) . } else { . Err(self) . } . } . } . . pub(super) enum LeftOrRight { -- line 904 ---------------------------------------- -- line 909 ---------------------------------------- . /// Given an edge index where we want to insert into a node filled to capacity, . /// computes a sensible KV index of a split point and where to perform the insertion. . /// The goal of the split point is for its key and value to end up in a parent node; . /// the keys, values and edges to the left of the split point become the left child; . /// the keys, values and edges to the right of the split point become the right child. . fn splitpoint(edge_idx: usize) -> (usize, LeftOrRight) { . debug_assert!(edge_idx <= CAPACITY); . // Rust issue #74834 tries to explain these symmetric rules. 1,468 ( 0.00%) match edge_idx { 1,478 ( 0.00%) 0..EDGE_IDX_LEFT_OF_CENTER => (KV_IDX_CENTER - 1, LeftOrRight::Left(edge_idx)), . EDGE_IDX_LEFT_OF_CENTER => (KV_IDX_CENTER, LeftOrRight::Left(edge_idx)), . EDGE_IDX_RIGHT_OF_CENTER => (KV_IDX_CENTER, LeftOrRight::Right(0)), 466 ( 0.00%) _ => (KV_IDX_CENTER + 1, LeftOrRight::Right(edge_idx - (KV_IDX_CENTER + 1 + 1))), . } . } . . impl<'a, K: 'a, V: 'a> Handle, K, V, marker::Leaf>, marker::Edge> { . /// Inserts a new key-value pair between the key-value pairs to the right and left of . /// this edge. This method assumes that there is enough space in the node for the new . /// pair to fit. . unsafe fn insert_fit( . mut self, . key: K, . val: V, . ) -> Handle, K, V, marker::Leaf>, marker::KV> { . debug_assert!(self.node.len() < CAPACITY); 2,923 ( 0.00%) let new_len = self.node.len() + 1; . . unsafe { 4,479 ( 0.00%) slice_insert(self.node.key_area_mut(..new_len), self.idx, key); 12,372 ( 0.00%) slice_insert(self.node.val_area_mut(..new_len), self.idx, val); 2,923 ( 0.00%) *self.node.len_mut() = new_len as u16; . 12,260 ( 0.00%) Handle::new_kv(self.node, self.idx) . } . } . } . . impl<'a, K: 'a, V: 'a> Handle, K, V, marker::Leaf>, marker::Edge> { . /// Inserts a new key-value pair between the key-value pairs to the right and left of . /// this edge. This method splits the node if there isn't enough room. . /// -- line 950 ---------------------------------------- -- line 954 ---------------------------------------- . self, . key: K, . val: V, . alloc: A, . ) -> ( . Option>, . Handle, marker::KV>, . ) { 2,923 ( 0.00%) if self.node.len() < CAPACITY { . // SAFETY: There is enough space in the node for insertion. . let handle = unsafe { self.insert_fit(key, val) }; . (None, handle.dormant()) . } else { 411 ( 0.00%) let (middle_kv_idx, insertion) = splitpoint(self.idx); 411 ( 0.00%) let middle = unsafe { Handle::new_kv(self.node, middle_kv_idx) }; . let mut result = middle.split(alloc); 2,051 ( 0.00%) let insertion_edge = match insertion { . LeftOrRight::Left(insert_idx) => unsafe { . Handle::new_edge(result.left.reborrow_mut(), insert_idx) . }, . LeftOrRight::Right(insert_idx) => unsafe { . Handle::new_edge(result.right.borrow_mut(), insert_idx) . }, . }; . // SAFETY: We just split the node, so there is enough space for . // insertion. . let handle = unsafe { insertion_edge.insert_fit(key, val).dormant() }; 2,143 ( 0.00%) (Some(result), handle) . } . } . } . . impl<'a, K, V> Handle, K, V, marker::Internal>, marker::Edge> { . /// Fixes the parent pointer and index in the child node that this edge . /// links to. This is useful when the ordering of edges has been changed, . fn correct_parent_link(self) { -- line 989 ---------------------------------------- -- line 997 ---------------------------------------- . . impl<'a, K: 'a, V: 'a> Handle, K, V, marker::Internal>, marker::Edge> { . /// Inserts a new key-value pair and an edge that will go to the right of that new pair . /// between this edge and the key-value pair to the right of this edge. This method assumes . /// that there is enough space in the node for the new pair to fit. . fn insert_fit(&mut self, key: K, val: V, edge: Root) { . debug_assert!(self.node.len() < CAPACITY); . debug_assert!(edge.height == self.node.height - 1); 10 ( 0.00%) let new_len = self.node.len() + 1; . . unsafe { 279 ( 0.00%) slice_insert(self.node.key_area_mut(..new_len), self.idx, key); . slice_insert(self.node.val_area_mut(..new_len), self.idx, val); 466 ( 0.00%) slice_insert(self.node.edge_area_mut(..new_len + 1), self.idx + 1, edge.node); 466 ( 0.00%) *self.node.len_mut() = new_len as u16; . . self.node.correct_childrens_parent_links(self.idx + 1..new_len + 1); . } . } . . /// Inserts a new key-value pair and an edge that will go to the right of that new pair . /// between this edge and the key-value pair to the right of this edge. This method splits . /// the node if there isn't enough room. . fn insert( . mut self, . key: K, . val: V, . edge: Root, . alloc: A, . ) -> Option> { 1,009 ( 0.00%) assert!(edge.height == self.node.height - 1); . 466 ( 0.00%) if self.node.len() < CAPACITY { . self.insert_fit(key, val, edge); . None . } else { . let (middle_kv_idx, insertion) = splitpoint(self.idx); . let middle = unsafe { Handle::new_kv(self.node, middle_kv_idx) }; . let mut result = middle.split(alloc); 122 ( 0.00%) let mut insertion_edge = match insertion { . LeftOrRight::Left(insert_idx) => unsafe { . Handle::new_edge(result.left.reborrow_mut(), insert_idx) . }, . LeftOrRight::Right(insert_idx) => unsafe { . Handle::new_edge(result.right.borrow_mut(), insert_idx) . }, . }; . insertion_edge.insert_fit(key, val, edge); 250 ( 0.00%) Some(result) . } . } . } . . impl<'a, K: 'a, V: 'a> Handle, K, V, marker::Leaf>, marker::Edge> { . /// Inserts a new key-value pair between the key-value pairs to the right and left of . /// this edge. This method splits the node if there isn't enough room, and tries to . /// insert the split off portion into the parent node recursively, until the root is reached. . /// . /// If the returned result is some `SplitResult`, the `left` field will be the root node. . /// The returned pointer points to the inserted value, which in the case of `SplitResult` . /// is in the `left` or `right` tree. 20,597 ( 0.00%) pub(super) fn insert_recursing( . self, . key: K, . value: V, . alloc: A, . split_root: impl FnOnce(SplitResult<'a, K, V, marker::LeafOrInternal>), . ) -> Handle, K, V, marker::Leaf>, marker::KV> { 12,124 ( 0.00%) let (mut split, handle) = match self.insert(key, value, alloc.clone()) { . // SAFETY: we have finished splitting and can now re-awaken the . // handle to the inserted element. . (None, handle) => return unsafe { handle.awaken() }, 535 ( 0.00%) (Some(split), handle) => (split.forget_node_type(), handle), . }; . . loop { . split = match split.left.ascend() { . Ok(parent) => { 1,822 ( 0.00%) match parent.insert(split.kv.0, split.kv.1, split.right, alloc.clone()) { . // SAFETY: we have finished splitting and can now re-awaken the . // handle to the inserted element. . None => return unsafe { handle.awaken() }, 70 ( 0.00%) Some(split) => split.forget_node_type(), . } . } . Err(root) => { 44 ( 0.00%) split_root(SplitResult { left: root, ..split }); . // SAFETY: we have finished splitting and can now re-awaken the . // handle to the inserted element. . return unsafe { handle.awaken() }; . } . }; . } 23,384 ( 0.00%) } . } . . impl . Handle, marker::Edge> . { . /// Finds the node pointed to by this edge. . /// . /// The method name assumes you picture trees with the root node on top. -- line 1098 ---------------------------------------- -- line 1107 ---------------------------------------- . // We need to use raw pointers to nodes because, if BorrowType is . // marker::ValMut, there might be outstanding mutable references to . // values that we must not invalidate. There's no worry accessing the . // height field because that value is copied. Beware that, once the . // node pointer is dereferenced, we access the edges array with a . // reference (Rust issue #73987) and invalidate any other references . // to or inside the array, should any be around. . let parent_ptr = NodeRef::as_internal_ptr(&self.node); 940 ( 0.00%) let node = unsafe { (*parent_ptr).edges.get_unchecked(self.idx).assume_init_read() }; . NodeRef { node, height: self.node.height - 1, _marker: PhantomData } . } . } . . impl<'a, K: 'a, V: 'a, NodeType> Handle, K, V, NodeType>, marker::KV> { . pub(super) fn into_kv(self) -> (&'a K, &'a V) { . debug_assert!(self.idx < self.node.len()); . let leaf = self.node.into_leaf(); -- line 1123 ---------------------------------------- -- line 1176 ---------------------------------------- . impl Handle, marker::KV> { . /// Extracts the key and value that the KV handle refers to. . /// # Safety . /// The node that the handle refers to must not yet have been deallocated. . pub(super) unsafe fn into_key_val(mut self) -> (K, V) { . debug_assert!(self.idx < self.node.len()); . let leaf = self.node.as_leaf_dying(); . unsafe { 35 ( 0.00%) let key = leaf.keys.get_unchecked_mut(self.idx).assume_init_read(); . let val = leaf.vals.get_unchecked_mut(self.idx).assume_init_read(); . (key, val) . } . } . . /// Drops the key and value that the KV handle refers to. . /// # Safety . /// The node that the handle refers to must not yet have been deallocated. -- line 1192 ---------------------------------------- -- line 1216 ---------------------------------------- . } . . impl<'a, K: 'a, V: 'a, NodeType> Handle, K, V, NodeType>, marker::KV> { . /// Helps implementations of `split` for a particular `NodeType`, . /// by taking care of leaf data. . fn split_leaf_data(&mut self, new_node: &mut LeafNode) -> (K, V) { . debug_assert!(self.idx < self.node.len()); . let old_len = self.node.len(); 1,416 ( 0.00%) let new_len = old_len - self.idx - 1; 472 ( 0.00%) new_node.len = new_len as u16; . unsafe { . let k = self.node.key_area_mut(self.idx).assume_init_read(); . let v = self.node.val_area_mut(self.idx).assume_init_read(); . . move_to_slice( 13 ( 0.00%) self.node.key_area_mut(self.idx + 1..old_len), 472 ( 0.00%) &mut new_node.keys[..new_len], . ); . move_to_slice( . self.node.val_area_mut(self.idx + 1..old_len), 472 ( 0.00%) &mut new_node.vals[..new_len], . ); . 868 ( 0.00%) *self.node.len_mut() = self.idx as u16; 168 ( 0.00%) (k, v) . } . } . } . . impl<'a, K: 'a, V: 'a> Handle, K, V, marker::Leaf>, marker::KV> { . /// Splits the underlying node into three parts: . /// . /// - The node is truncated to only contain the key-value pairs to the left of -- line 1248 ---------------------------------------- -- line 1288 ---------------------------------------- . pub(super) fn split( . mut self, . alloc: A, . ) -> SplitResult<'a, K, V, marker::Internal> { . let old_len = self.node.len(); . unsafe { . let mut new_node = InternalNode::new(alloc); . let kv = self.split_leaf_data(&mut new_node.data); 122 ( 0.00%) let new_len = usize::from(new_node.data.len); . move_to_slice( . self.node.edge_area_mut(self.idx + 1..old_len + 1), 61 ( 0.00%) &mut new_node.edges[..new_len + 1], . ); . . // SAFETY: self is `marker::Internal`, so `self.node.height` is positive . let height = NonZero::new_unchecked(self.node.height); . let right = NodeRef::from_new_internal(new_node, height); . 10 ( 0.00%) SplitResult { left: self.node, kv, right } . } . } . } . . /// Represents a session for evaluating and performing a balancing operation . /// around an internal key-value pair. . pub(super) struct BalancingContext<'a, K, V> { . parent: Handle, K, V, marker::Internal>, marker::KV>, -- line 1314 ---------------------------------------- -- line 1819 ---------------------------------------- . /// . /// # Safety . /// The slice has more than `idx` elements. . unsafe fn slice_insert(slice: &mut [MaybeUninit], idx: usize, val: T) { . unsafe { . let len = slice.len(); . debug_assert!(len > idx); . let slice_ptr = slice.as_mut_ptr(); 10,944 ( 0.00%) if len > idx + 1 { 4,465 ( 0.00%) ptr::copy(slice_ptr.add(idx), slice_ptr.add(idx + 1), len - idx - 1); . } . (*slice_ptr.add(idx)).write(val); . } . } . . /// Removes and returns a value from a slice of all initialized elements, leaving behind one . /// trailing uninitialized element. . /// -- line 1836 ---------------------------------------- -- line 1868 ---------------------------------------- . ptr::copy(slice_ptr, slice_ptr.add(distance), slice.len() - distance); . } . } . . /// Moves all values from a slice of initialized elements to a slice . /// of uninitialized elements, leaving behind `src` as all uninitialized. . /// Works like `dst.copy_from_slice(src)` but does not require `T` to be `Copy`. . fn move_to_slice(src: &mut [MaybeUninit], dst: &mut [MaybeUninit]) { 122 ( 0.00%) assert!(src.len() == dst.len()); . unsafe { . ptr::copy_nonoverlapping(src.as_ptr(), dst.as_mut_ptr(), src.len()); . } . } . . #[cfg(test)] . mod tests; 28,427 ( 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 551,190 ( 0.00%) if let ExprKind::Call(func, [arg]) = expr.kind 49,296 ( 0.00%) && let ExprKind::Path(QPath::TypeRelative(func_ty, func_name)) = func.kind 4,106 ( 0.00%) && func_name.ident.name == sym::new 734 ( 0.00%) && !expr.span.from_expansion() 786 ( 0.00%) && cx.typeck_results().node_type(func_ty.hir_id).is_diag_item(cx, sym::Arc) 5,407 ( 0.00%) => ???:::node_type (131x) 5 ( 0.00%) && let arg_ty = cx.typeck_results().expr_ty(arg) 40 ( 0.00%) => ???:::expr_ty (1x) . // make sure that the type is not and does not contain any type parameters 5 ( 0.00%) && arg_ty.walk().all(|arg| { 7 ( 0.00%) => ???:::walk (1x) 2 ( 0.00%) !matches!(arg.kind(), GenericArgKind::Type(ty) if matches!(ty.kind(), ty::Param(_))) 1 ( 0.00%) }) 12 ( 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) . && 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, &[])) . && let reason = match (is_send, is_sync) { . (false, false) => "neither `Send` nor `Sync`", . (false, true) => "not `Send`", . (true, false) => "not `Sync`", . _ => return, -- line 64 ---------------------------------------- -- 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`" . )); . }); . }, . ); . } 1,937,824 ( 0.02%) } . } 736 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/upper_case_acronyms.rs -------------------------------------------------------------------------------- Ir -- line 65 ---------------------------------------- . } . } else { . count = 0; . } . } . count == 2 . } . 5,161 ( 0.00%) fn check_ident(cx: &LateContext<'_>, ident: &Ident, hir_id: HirId, be_aggressive: bool) { 1,191 ( 0.00%) let s = ident.as_str(); 12,704 ( 0.00%) => ???:::as_str (397x) . . // By default, only warn for upper case identifiers with at least 3 characters. 794 ( 0.00%) let replacement = if s.len() > 2 && s.bytes().all(|c| c.is_ascii_uppercase()) { . let mut r = String::with_capacity(s.len()); . let mut s = s.chars(); . r.push(s.next().unwrap()); . r.extend(s.map(|c| c.to_ascii_lowercase())); 9 ( 0.00%) r 788 ( 0.00%) } else if be_aggressive . // Only lint if the ident starts with an upper case character. . && let unprefixed = s.trim_start_matches('_') . && unprefixed.starts_with(|c: char| c.is_ascii_uppercase()) . && contains_acronym(unprefixed) . { . let mut r = String::with_capacity(s.len()); . let mut s = s.chars(); . let mut prev_upper = false; -- line 91 ---------------------------------------- -- line 102 ---------------------------------------- . } . r . } else { . return; . }; . . span_lint_hir_and_then( . cx, 6 ( 0.00%) UPPER_CASE_ACRONYMS, . hir_id, 6 ( 0.00%) ident.span, 9 ( 0.00%) format!("name `{ident}` contains a capitalized acronym"), 3 ( 0.00%) |diag| { . diag.span_suggestion( 3 ( 0.00%) ident.span, . "consider making the acronym lowercase, except the initial letter", . replacement, . Applicability::MaybeIncorrect, . ); . }, . ); 3,176 ( 0.00%) } . . impl LateLintPass<'_> for UpperCaseAcronyms { 59,380 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'_>, it: &Item<'_>) { . // do not lint public items or in macros 17,814 ( 0.00%) if it.span.in_external_macro(cx.sess().source_map()) 31,052 ( 0.00%) || (self.avoid_breaking_exported_api && cx.effective_visibilities.is_exported(it.owner_id.def_id)) 238,746 ( 0.00%) => ???:::is_exported (4,436x) . { . return; . } 13,955 ( 0.00%) match it.kind { 676 ( 0.00%) ItemKind::TyAlias(ident, ..) | ItemKind::Struct(ident, ..) | ItemKind::Trait { ident, .. } => { 845 ( 0.00%) check_ident(cx, &ident, it.hir_id(), self.upper_case_acronyms_aggressive); 12,794 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/upper_case_acronyms.rs:clippy_lints::upper_case_acronyms::check_ident (169x) . }, 192 ( 0.00%) ItemKind::Enum(ident, _, ref enumdef) => { 288 ( 0.00%) check_ident(cx, &ident, it.hir_id(), self.upper_case_acronyms_aggressive); 3,649 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/upper_case_acronyms.rs:clippy_lints::upper_case_acronyms::check_ident (48x) . // check enum variants separately because again we only want to lint on private enums and . // the fn check_variant does not know about the vis of the enum of its variants 48 ( 0.00%) enumdef.variants.iter().for_each(|variant| { 1,080 ( 0.00%) check_ident(cx, &variant.ident, variant.hir_id, self.upper_case_acronyms_aggressive); 653,931 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/upper_case_acronyms.rs:clippy_lints::upper_case_acronyms::check_ident (180x) . }); . }, . _ => {}, . } 47,504 ( 0.00%) } . } 229 ( 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 102 ---------------------------------------- . /// Expression must be a `Vec<_>`. Type cannot change. . Impossible, . } . . impl UselessVec { . /// Checks if the surrounding environment requires this expression to actually be of type . /// `Vec<_>`, or if it can be changed to `&[]`/`[]` without causing type errors. . fn expr_usage_requires_vec(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) -> VecToArray { 350 ( 0.00%) match cx.tcx.parent_hir_node(expr.hir_id) { 4,028 ( 0.00%) => ???:::parent_hir_node (36x) . // search for `let foo = vec![_]` expressions where all uses of `foo` . // adjust to slices or call a method that exist on slices (e.g. len) . Node::LetStmt(LetStmt { . ty: None, . pat: . Pat { . kind: PatKind::Binding(_, id, ..), . .. . }, . .. . }) => { 189 ( 0.00%) let only_slice_uses = for_each_local_use_after_expr(cx, *id, expr.hir_id, |expr| { 188,483 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/visitors.rs:clippy_utils::visitors::for_each_local_use_after_expr::<(), ::expr_usage_requires_vec::{closure#0}> (12x) . // allow indexing into a vec and some set of allowed method calls that exist on slices, too 49 ( 0.00%) if let Some(parent) = get_parent_expr(cx, expr) 1,869 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (15x) 15 ( 0.00%) && (adjusts_to_slice(cx, expr) 46 ( 0.00%) || match parent.kind { . ExprKind::Index(..) => true, 27 ( 0.00%) ExprKind::MethodCall(path, _, [], _) => { . // If the given expression is a method call to a `Vec` method that also exists on . // slices, it means that this expression does not actually require a `Vec` and could . // just work with an array. . VEC_METHODS_SHADOWING_SLICE_METHODS.contains(&path.ident.name) . }, . _ => false, . }) . { . ControlFlow::Continue(()) . } else { . ControlFlow::Break(()) . } 105 ( 0.00%) }) . .is_continue(); . . if only_slice_uses { . VecToArray::Possible . } else { . VecToArray::Impossible . } . }, . // if the local pattern has a specified type, do not lint. 8 ( 0.00%) Node::LetStmt(LetStmt { ty: Some(_), .. }) if higher::VecArgs::hir(cx, expr).is_some() => { 742 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (2x) . VecToArray::Impossible . }, . // search for `for _ in vec![...]` . Node::Expr(expr) 48 ( 0.00%) if expr.span.is_desugaring(DesugaringKind::ForLoop) 768 ( 0.00%) => ???:::is_desugaring (8x) . && self.msrv.meets(cx, msrvs::ARRAY_INTO_ITERATOR) => . { . VecToArray::Possible . }, . // search for `&vec![_]` or `vec![_]` expressions where the adjusted type is `&[_]` . _ => { . if adjusts_to_slice(cx, expr) { . VecToArray::Possible -- line 164 ---------------------------------------- -- line 166 ---------------------------------------- . VecToArray::Impossible . } . }, . } . } . } . . impl<'tcx> LateLintPass<'tcx> for UselessVec { 2,180,052 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 968,984 ( 0.01%) if let Some(vec_args) = higher::VecArgs::hir(cx, expr.peel_borrows()) 8,879,216 ( 0.07%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (242,228x) . // The `vec![]` or `&vec![]` invocation span. 144 ( 0.00%) && let vec_span = expr.span.parent_callsite().unwrap_or(expr.span) 3,672 ( 0.00%) => ???:::parent_callsite (36x) . && !vec_span.from_expansion() . { 108 ( 0.00%) if self.allow_in_test && is_in_test(cx.tcx, expr.hir_id) { . return; . } . 71 ( 0.00%) match self.expr_usage_requires_vec(cx, expr) { . VecToArray::Possible => { . let suggest_ty = suggest_type(expr); . . // Size and `Copy` checks don't depend on the enclosing usage of the expression . // and don't need to be inserted into the state map. 2 ( 0.00%) let vec_snippet = match vec_args { . higher::VecArgs::Repeat(expr, len) => { 7 ( 0.00%) if is_copy(cx, cx.typeck_results().expr_ty(expr)) 74 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::is_copy (1x) 40 ( 0.00%) => ???:::expr_ty (1x) 10 ( 0.00%) && let Some(Constant::Int(length)) = ConstEvalCtxt::new(cx).eval(len) 56 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::new (1x) 45 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/consts.rs:::eval (1x) . && let Ok(length) = u64::try_from(length) . && size_of(cx, expr) . .checked_mul(length) . .is_some_and(|size| size <= self.too_large_for_stack) . { . suggest_ty.snippet( . cx, . Some(expr.span.source_callsite()), -- line 201 ---------------------------------------- -- line 228 ---------------------------------------- . entry.insert(VecState::Change { . suggest_ty, . vec_snippet, . expr_hir_id: expr.hir_id, . }); . } . }, . VecToArray::Impossible => { 420 ( 0.00%) self.span_to_state.insert(vec_span, VecState::NoChange); 37,497 ( 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:>::insert (35x) . }, . } . } 1,937,824 ( 0.02%) } . 8 ( 0.00%) fn check_crate_post(&mut self, cx: &LateContext<'tcx>) { 325 ( 0.00%) for (span, state) in mem::take(&mut self.span_to_state) { 35 ( 0.00%) if let VecState::Change { . suggest_ty, . vec_snippet, . expr_hir_id, 35 ( 0.00%) } = 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()); . // If the `vec!` macro contains comment, better not make the suggestion machine applicable as it . // would remove them. . let applicability = if span_contains_comment(cx, span) { . 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 ---------------------------------------- -- line 301 ---------------------------------------- . } . . fn size_of(cx: &LateContext<'_>, expr: &Expr<'_>) -> u64 { . let ty = cx.typeck_results().expr_ty_adjusted(expr); . cx.layout_of(ty).map_or(0, |l| l.size.bytes()) . } . . fn adjusts_to_slice(cx: &LateContext<'_>, e: &Expr<'_>) -> bool { 163 ( 0.00%) matches!(cx.typeck_results().expr_ty_adjusted(e).kind(), ty::Ref(_, ty, _) if ty.is_slice()) 1,497 ( 0.00%) => ???:::expr_ty_adjusted (22x) . } . . fn suggest_type(expr: &Expr<'_>) -> SuggestedType { 4 ( 0.00%) if let ExprKind::AddrOf(BorrowKind::Ref, mutability, _) = expr.kind { . // `expr` is `&vec![_]`, so suggest `&[_]` (or `&mut[_]` resp.) . SuggestedType::SliceRef(mutability) . } else { . // `expr` is the `vec![_]` expansion, so suggest `[_]` . SuggestedType::Array . } . } 291 ( 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 { 47,504 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>) { 8,132 ( 0.00%) if has_attr(cx, item.hir_id()) { . println!("{item:#?}"); . } 47,504 ( 0.00%) } . 1,937,824 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) { 727,696 ( 0.01%) if has_attr(cx, expr.hir_id) { . println!("{expr:#?}"); . } 1,937,824 ( 0.02%) } . 285,264 ( 0.00%) fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx hir::Stmt<'_>) { 153,666 ( 0.00%) match stmt.kind { 46,036 ( 0.00%) hir::StmtKind::Expr(e) | hir::StmtKind::Semi(e) if has_attr(cx, e.hir_id) => return, . _ => {}, . } 83,665 ( 0.00%) if has_attr(cx, stmt.hir_id) { . println!("{stmt:#?}"); . } 253,568 ( 0.00%) } . 10,104 ( 0.00%) fn check_trait_item(&mut self, cx: &LateContext<'_>, item: &TraitItem<'_>) { 1,676 ( 0.00%) if has_attr(cx, item.hir_id()) { . println!("{item:#?}"); . } 10,104 ( 0.00%) } . 32,888 ( 0.00%) fn check_impl_item(&mut self, cx: &LateContext<'_>, item: &hir::ImplItem<'_>) { 6,749 ( 0.00%) if has_attr(cx, item.hir_id()) { . println!("{item:#?}"); . } 32,888 ( 0.00%) } . } . . fn has_attr(cx: &LateContext<'_>, hir_id: hir::HirId) -> bool { 616,311 ( 0.01%) let attrs = cx.tcx.hir_attrs(hir_id); 2,748,505 ( 0.02%) => ???:::hir_attrs (43,205x) 6,343 ( 0.00%) get_builtin_attr(attrs, sym::dump).count() > 0 . } 12,686 ( 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. 19,368 ( 0.00%) #[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`. 58,887 ( 0.00%) 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); 19,629 ( 0.00%) let float = matches!(lit_kind, LitKind::Float(..)); 26,172 ( 0.00%) Some(NumericLiteral::new(unsuffixed, suffix, float)) 446,833 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/numeric_literal.rs:::new (6,543x) . } else { . None . } 52,344 ( 0.00%) } . . /// Parses a raw numeric literal string into its structured `NumericLiteral` parts. . #[must_use] 45,829 ( 0.00%) 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. 3,821 ( 0.00%) let radix = if unsigned_lit.starts_with("0x") { . Radix::Hexadecimal 1,491 ( 0.00%) } else if unsigned_lit.starts_with("0b") { . Radix::Binary 1,025 ( 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) . }; . 11,089 ( 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); . 98,205 ( 0.00%) Self { . radix, . prefix, . integer, . fraction, . exponent, . suffix, . } 58,923 ( 0.00%) } . . /// 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; . 13,094 ( 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()); 13,086 ( 0.00%) let suffix = match lit_kind { 26,016 ( 0.00%) 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 ---------------------------------------- 31,572 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/methods/clone_on_copy.rs -------------------------------------------------------------------------------- Ir -- line 13 ---------------------------------------- . . #[derive(Clone, Copy, Debug, PartialEq, Eq)] . enum ParentIsSuffixExpr { . Yes, . No, . Return, . } . 1,910 ( 0.00%) fn check_parent_is_suffix_expr(cx: &LateContext<'_>, expr: &Expr<'_>) -> ParentIsSuffixExpr { 2,483 ( 0.00%) match cx.tcx.parent_hir_node(expr.hir_id) { 23,302 ( 0.00%) => ???:::parent_hir_node (191x) . Node::Expr(parent) => match parent.kind { . // &*x is a nop, &x.clone() is not . ExprKind::AddrOf(..) => ParentIsSuffixExpr::Return, . // (*x).func() is useless, x.clone().func() can work in case func borrows self . ExprKind::MethodCall(_, self_arg, ..) . if expr.hir_id == self_arg.hir_id . && cx.typeck_results().expr_ty(expr) != cx.typeck_results().expr_ty_adjusted(expr) => . { -- line 30 ---------------------------------------- -- line 49 ---------------------------------------- . _ => ParentIsSuffixExpr::No, . }, . // local binding capturing a reference . Node::LetStmt(l) if matches!(l.pat.kind, PatKind::Binding(BindingMode(ByRef::Yes(..), _), ..)) => { . ParentIsSuffixExpr::Return . }, . _ => ParentIsSuffixExpr::No, . } 1,528 ( 0.00%) } . . /// Checks for the `CLONE_ON_COPY` lint. 5,824 ( 0.00%) pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, receiver: &Expr<'_>) { . if cx . .typeck_results() 3,328 ( 0.00%) .type_dependent_def_id(expr.hir_id) 42,460 ( 0.00%) => ???:::type_dependent_def_id (832x) 5,824 ( 0.00%) .and_then(|id| cx.tcx.trait_of_assoc(id)) 221,417 ( 0.00%) => ???:::trait_of_assoc (832x) 1,664 ( 0.00%) .zip(cx.tcx.lang_items().clone_trait()) 33,280 ( 0.00%) => ???:::lang_items (832x) . .is_none_or(|(x, y)| x != y) . { . return; . } 2,496 ( 0.00%) let arg_adjustments = cx.typeck_results().expr_adjustments(receiver); 35,893 ( 0.00%) => ???:::expr_adjustments (832x) . let arg_ty = arg_adjustments . .last() . .map_or_else(|| cx.typeck_results().expr_ty(receiver), |a| a.target); . 3,328 ( 0.00%) let ty = cx.typeck_results().expr_ty(expr); 33,328 ( 0.00%) => ???:::expr_ty (832x) 1,664 ( 0.00%) if let ty::Ref(_, inner, _) = arg_ty.kind() 2,496 ( 0.00%) && let ty::Ref(..) = inner.kind() . { . return; // don't report clone_on_copy . } . 3,328 ( 0.00%) if !is_copy(cx, ty) { 1,021,885 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::is_copy (832x) . return; . } 764 ( 0.00%) let check_res = check_parent_is_suffix_expr(cx, expr); 29,223 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/clone_on_copy.rs:clippy_lints::methods::clone_on_copy::check_parent_is_suffix_expr (191x) 382 ( 0.00%) if check_res == ParentIsSuffixExpr::Return { . return; . } . 191 ( 0.00%) let mut app = Applicability::MachineApplicable; 1,146 ( 0.00%) let snip = snippet_with_context(cx, receiver.span, expr.span.ctxt(), "_", &mut app).0; . . let deref_count = arg_adjustments . .iter() 382 ( 0.00%) .take_while(|adj| matches!(adj.kind, Adjust::Deref(_))) . .count(); 764 ( 0.00%) let (help, sugg) = if deref_count == 0 { . ("try removing the `clone` call", snip.into()) 382 ( 0.00%) } else if check_res == ParentIsSuffixExpr::Yes { . ("try dereferencing it", format!("({}{snip})", "*".repeat(deref_count))) . } else { 1,337 ( 0.00%) ("try dereferencing it", format!("{}{snip}", "*".repeat(deref_count))) . }; . 2,865 ( 0.00%) span_lint_and_sugg( 239,980 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_sugg:: (191x) . cx, . CLONE_ON_COPY, . expr.span, 955 ( 0.00%) with_forced_trimmed_paths!(format!( 764 ( 0.00%) => ???:::new (191x) . "using `clone` on type `{ty}` which implements the `Copy` trait" . )), . help, . sugg, . app, . ); 7,038 ( 0.00%) } . 117,502 ( 0.00%) pub(super) fn check_function(cx: &LateContext<'_>, expr: &Expr<'_>) { 50,358 ( 0.00%) let ExprKind::Call(func, args) = expr.kind else { return }; . 100,708 ( 0.00%) if let ExprKind::Path(qpath) = func.kind 100,704 ( 0.00%) && let Some(def_id) = cx.typeck_results().qpath_res(&qpath, func.hir_id).opt_def_id() 659,024 ( 0.01%) => ???:::qpath_res (16,784x) 149,875 ( 0.00%) && cx.tcx.trait_of_assoc(def_id) == cx.tcx.lang_items().clone_trait() 2,113,474 ( 0.02%) => ???:::trait_of_assoc (16,671x) 666,840 ( 0.01%) => ???:::lang_items (16,671x) . && let [arg] = args . && let ty = cx.typeck_results().expr_ty(expr) . { . if !is_copy(cx, ty) { . return; . } . . let check_res = check_parent_is_suffix_expr(cx, expr); -- line 131 ---------------------------------------- -- line 166 ---------------------------------------- . with_forced_trimmed_paths!(format!( . "using `clone` on type `{ty}` which implements the `Copy` trait" . )), . help, . sugg, . app, . ); . } 134,288 ( 0.00%) } 71,240 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/multiple_bound_locations.rs -------------------------------------------------------------------------------- Ir -- line 33 ---------------------------------------- . pub MULTIPLE_BOUND_LOCATIONS, . style, . "defining generic bounds in multiple locations" . } . . declare_lint_pass!(MultipleBoundLocations => [MULTIPLE_BOUND_LOCATIONS]); . . impl EarlyLintPass for MultipleBoundLocations { 46,662 ( 0.00%) fn check_fn(&mut self, cx: &EarlyContext<'_>, kind: FnKind<'_>, _: Span, _: NodeId) { 19,715 ( 0.00%) if let FnKind::Fn(_, _, Fn { generics, .. }) = kind 6,383 ( 0.00%) && !generics.params.is_empty() 1,277 ( 0.00%) && !generics.where_clause.predicates.is_empty() . { . let mut generic_params_with_bounds = FxHashMap::default(); . . for param in &generics.params { 42 ( 0.00%) if !param.bounds.is_empty() { . generic_params_with_bounds.insert(param.ident.as_str(), param.ident.span); . } . } . for clause in &generics.where_clause.predicates { 66 ( 0.00%) match &clause.kind { . WherePredicateKind::BoundPredicate(pred) => { 66 ( 0.00%) if (!pred.bound_generic_params.is_empty() || !pred.bounds.is_empty()) 165 ( 0.00%) && let Some(Some(bound_span)) = pred . .bounded_ty . .span 99 ( 0.00%) .with_source_text(cx, |src| generic_params_with_bounds.get(src)) 15,609 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/source.rs:::with_source_text::, &rustc_lint::context::EarlyContext, ::check_fn::{closure#0}> (33x) . { . emit_lint(cx, *bound_span, pred.bounded_ty.span); . } . }, . WherePredicateKind::RegionPredicate(pred) => { . if !pred.bounds.is_empty() . && let Some(bound_span) = generic_params_with_bounds.get(&pred.lifetime.ident.as_str()) . { . emit_lint(cx, *bound_span, pred.lifetime.ident.span); . } . }, . } . } 27 ( 0.00%) } 53,328 ( 0.00%) } . } . . fn emit_lint(cx: &EarlyContext<'_>, bound_span: Span, where_span: Span) { . span_lint( . cx, . MULTIPLE_BOUND_LOCATIONS, . vec![bound_span, where_span], . "bound is defined in more than one place", -- line 83 ---------------------------------------- 93 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/methods/should_implement_trait.rs -------------------------------------------------------------------------------- Ir -- line 5 ---------------------------------------- . use rustc_lint::LateContext; . use rustc_middle::ty::Ty; . use rustc_span::edition::Edition::{self, Edition2015, Edition2021}; . use rustc_span::{Symbol, kw}; . . use super::SHOULD_IMPLEMENT_TRAIT; . use super::lib::SelfKind; . 19,565 ( 0.00%) pub(super) fn check_impl_item<'tcx>( . cx: &LateContext<'tcx>, . impl_item: &'tcx ImplItem<'_>, . self_ty: Ty<'tcx>, . impl_implements_trait: bool, . first_arg_ty_opt: Option>, . sig: &FnSig<'_>, . ) { . // if this impl block implements a trait, lint in trait definition instead 12,440 ( 0.00%) if !impl_implements_trait && cx.effective_visibilities.is_exported(impl_item.owner_id.def_id) 74,790 ( 0.00%) => ???:::is_exported (1,370x) . // check missing trait implementations . && let Some(method_config) = TRAIT_METHODS.iter().find(|case| case.method_name == impl_item.ident.name) 31 ( 0.00%) && sig.decl.inputs.len() == method_config.param_count 3 ( 0.00%) && method_config.output_type.matches(&sig.decl.output) . // in case there is no first arg, since we already have checked the number of arguments . // it's should be always true . && first_arg_ty_opt . .is_none_or(|first_arg_ty| method_config.self_kind.matches(cx, self_ty, first_arg_ty)) . && sig.header.is_safe() . && matches!(sig.header.constness, hir::Constness::NotConst) . && !sig.header.is_async() . && sig.header.abi == ExternAbi::Rust -- line 34 ---------------------------------------- -- line 45 ---------------------------------------- . ), . None, . format!( . "consider implementing the trait `{}` or choosing a less ambiguous method name", . method_config.trait_name . ), . ); . } 22,360 ( 0.00%) } . . struct ShouldImplTraitCase { . trait_name: &'static str, . method_name: Symbol, . param_count: usize, . // implicit self kind expected (none, self, &self, ...) . self_kind: SelfKind, . // checks against the output type -- line 61 ---------------------------------------- -- line 139 ---------------------------------------- . Bool, . Any, . Ref, . } . . impl OutType { . fn matches(self, ty: &FnRetTy<'_>) -> bool { . let is_unit = |ty: &hir::Ty<'_>| matches!(ty.kind, hir::TyKind::Tup(&[])); 5 ( 0.00%) match (self, ty) { . (Self::Unit, &FnRetTy::DefaultReturn(_)) => true, . (Self::Unit, &FnRetTy::Return(ty)) if is_unit(ty) => true, . (Self::Bool, &FnRetTy::Return(ty)) if is_bool(ty) => true, . (Self::Any, &FnRetTy::Return(ty)) if !is_unit(ty) => true, . (Self::Ref, &FnRetTy::Return(ty)) => matches!(ty.kind, hir::TyKind::Ref(_, _)), . _ => false, . } . } -- line 155 ---------------------------------------- 7,694 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/unit_types/let_unit_value.rs -------------------------------------------------------------------------------- Ir -- line 11 ---------------------------------------- . use rustc_lint::{LateContext, LintContext as _}; . use rustc_middle::ty; . use rustc_span::Span; . . use super::LET_UNIT_VALUE; . . pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, format_args: &FormatArgsStorage, local: &'tcx LetStmt<'_>) { . // skip `let () = { ... }` 60,183 ( 0.00%) if let PatKind::Tuple(fields, ..) = local.pat.kind 296 ( 0.00%) && fields.is_empty() . { . return; . } . 60,183 ( 0.00%) if let Some(init) = local.init 39,296 ( 0.00%) && !local.pat.span.from_expansion() 45,645 ( 0.00%) && !local.span.in_external_macro(cx.sess().source_map()) 45,645 ( 0.00%) && !local.span.is_from_async_await() 1,551,930 ( 0.01%) => ???:::is_from_async_await (15,215x) 31,542 ( 0.00%) && cx.typeck_results().pat_ty(local.pat).is_unit() 609,248 ( 0.01%) => ???:::pat_ty (15,215x) . { . // skip `let awa = ()` 666 ( 0.00%) if let ExprKind::Tup([]) = init.kind { . return; . } . . // skip `let _: () = { ... }` 666 ( 0.00%) if let Some(ty) = local.ty . && let TyKind::Tup([]) = ty.kind . { . return; . } . . if (local.ty.is_some_and(|ty| !matches!(ty.kind, TyKind::Infer(()))) 444 ( 0.00%) || matches!(local.pat.kind, PatKind::Tuple([], ddpos) if ddpos.as_opt_usize().is_none())) . && expr_needs_inferred_result(cx, init) . { . if !matches!(local.pat.kind, PatKind::Wild) . && !matches!(local.pat.kind, PatKind::Tuple([], ddpos) if ddpos.as_opt_usize().is_none()) . { . span_lint_and_then( . cx, . LET_UNIT_VALUE, -- line 52 ---------------------------------------- -- line 58 ---------------------------------------- . "use a wildcard binding", . "_", . Applicability::MaybeIncorrect, // snippet . ); . }, . ); . } . } else { 444 ( 0.00%) if let ExprKind::Match(_, _, MatchSource::AwaitDesugar) = init.kind { . return; . } . 1,998 ( 0.00%) span_lint_and_then( 85,415,194 ( 0.71%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then:: (222x) . cx, . LET_UNIT_VALUE, . local.span, . "this let-binding has unit value", 1,110 ( 0.00%) |diag| { . let mut suggestions = Vec::new(); 666 ( 0.00%) let init_new_span = walk_span_to_context(init.span, local.span.ctxt()).unwrap(); 19,092 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::walk_span_to_context (222x) . . // Suggest omitting the `let` binding . let app = Applicability::MachineApplicable; . . // If this is a binding pattern, we need to add suggestions to remove any usages . // of the variable 666 ( 0.00%) if let PatKind::Binding(_, binding_hir_id, ..) = local.pat.kind 222 ( 0.00%) && let Some(body_id) = cx.enclosing_body.as_ref() . { 666 ( 0.00%) let body = cx.tcx.hir_body(*body_id); 15,318 ( 0.00%) => ???:::hir_body (222x) 222 ( 0.00%) let mut visitor = UnitVariableCollector::new(cx, format_args, binding_hir_id); . walk_body(&mut visitor, body); . 222 ( 0.00%) let mut has_in_format_capture = false; 688 ( 0.00%) suggestions.extend(visitor.spans.into_iter().filter_map(|span| match span { . VariableUsage::FormatCapture => { . has_in_format_capture = true; . None . }, 33 ( 0.00%) VariableUsage::Normal(span) => Some((span, "()".to_string())), . VariableUsage::FieldShorthand(span) => Some((span.shrink_to_hi(), ": ()".to_string())), . })); . 444 ( 0.00%) if has_in_format_capture { . // In a case like this: . // ``` . // let unit = returns_unit(); . // eprintln!("{unit}"); . // ``` . // we can't remove the `unit` binding and replace its uses with a `()`, . // because the `eprintln!` would break. . // -- line 109 ---------------------------------------- -- line 120 ---------------------------------------- . )); . diag.multipart_suggestion("replace variable usages with `()`", suggestions, app); . return; . } . } . . // let local = returns_unit(); . // ^^^^^^^^^^^^ remove this 888 ( 0.00%) suggestions.push((local.span.until(init_new_span), String::new())); 42,624 ( 0.00%) => ???:::until (222x) 1,554 ( 0.00%) let message = if suggestions.len() == 1 { . "omit the `let` binding" . } else { . "omit the `let` binding and replace variable usages with `()`" . }; 1,110 ( 0.00%) diag.multipart_suggestion(message, suggestions, app); . }, . ); . } . } . } . . struct UnitVariableCollector<'a, 'tcx> { . cx: &'a LateContext<'tcx>, -- line 142 ---------------------------------------- -- line 165 ---------------------------------------- . /// let unit = (); . /// Foo { unit }; . /// ``` . FieldShorthand(Span), . } . . impl<'a, 'tcx> UnitVariableCollector<'a, 'tcx> { . fn new(cx: &'a LateContext<'tcx>, format_args: &'a FormatArgsStorage, id: HirId) -> Self { 1,776 ( 0.00%) Self { . cx, . format_args, . id, . spans: Vec::new(), . macro_call: None, . } . } . } . . /** . * Collect all instances where a variable is used based on its `HirId`. . */ . impl<'tcx> Visitor<'tcx> for UnitVariableCollector<'_, 'tcx> { 801,207 ( 0.01%) fn visit_expr(&mut self, ex: &'tcx Expr<'tcx>) -> Self::Result { 89,875 ( 0.00%) if let Some(macro_call) = root_macro_call_first_node(self.cx, ex) 568 ( 0.00%) && is_format_macro(self.cx, macro_call.def_id) 17,040 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::is_format_macro (142x) . && let Some(format_args) = self.format_args.get(self.cx, ex, macro_call.expn) . { . let parent_macro_call = self.macro_call; . self.macro_call = Some(format_args); . walk_expr(self, ex); . self.macro_call = parent_macro_call; . return; . } . 412,163 ( 0.00%) if let ExprKind::Path(QPath::Resolved(None, path)) = ex.kind 162,014 ( 0.00%) && let Res::Local(id) = path.res 40,108 ( 0.00%) && id == self.id . { 33 ( 0.00%) if let Some(macro_call) = self.macro_call . && macro_call.arguments.all_args().iter().any(|arg| { . matches!(arg.kind, FormatArgumentKind::Captured(_)) && find_format_arg_expr(ex, arg).is_some() . }) . { . self.spans.push(VariableUsage::FormatCapture); . } else { 66 ( 0.00%) let parent = self.cx.tcx.parent_hir_node(ex.hir_id); 1,342 ( 0.00%) => ???:::parent_hir_node (11x) 22 ( 0.00%) match parent { . Node::ExprField(expr_field) if expr_field.is_shorthand => { . self.spans.push(VariableUsage::FieldShorthand(ex.span)); . }, . _ => { 11 ( 0.00%) self.spans.push(VariableUsage::Normal(path.span)); . }, . } . } . } . 267,069 ( 0.00%) walk_expr(self, ex); 19,473,230 ( 0.16%) => /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:: (222x) 712,184 ( 0.01%) } . } . . /// Checks sub-expressions which create the value returned by the given expression for whether . /// return value inference is needed. This checks through locals to see if they also need inference . /// at this point. . /// . /// e.g. . /// ```rust,ignore -- line 231 ---------------------------------------- 16,802 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/returns/needless_return_with_question_mark.rs -------------------------------------------------------------------------------- Ir -- line 5 ---------------------------------------- . use rustc_hir::LangItem::ResultErr; . use rustc_hir::{Expr, ExprKind, HirId, MatchSource, Node, Stmt, StmtKind}; . use rustc_lint::{LateContext, LintContext as _}; . use rustc_middle::ty::adjustment::Adjust; . . use super::NEEDLESS_RETURN_WITH_QUESTION_MARK; . . pub(super) fn check_stmt<'tcx>(cx: &LateContext<'tcx>, stmt: &'tcx Stmt<'_>) { 72,494 ( 0.00%) if let StmtKind::Semi(expr) = stmt.kind 26,739 ( 0.00%) && let ExprKind::Ret(Some(ret)) = expr.kind . // return Err(...)? desugars to a match . // over a Err(...).branch() . // which breaks down to a branch call, with the callee being . // the constructor of the Err variant 4,716 ( 0.00%) && let ExprKind::Match(maybe_cons, _, MatchSource::TryDesugar(_)) = ret.kind . && let ExprKind::Call(_, [maybe_result_err]) = maybe_cons.kind . && let ExprKind::Call(maybe_constr, _) = maybe_result_err.kind . && maybe_constr.res(cx).ctor_parent(cx).is_lang_item(cx, ResultErr) . . // Ensure this is not the final stmt, otherwise removing it would cause a compile error . && let block = cx.tcx.hir_body_owned_by(cx.tcx.hir_enclosing_body_owner(expr.hir_id)).value . && let ExprKind::Block(block, _) = peel_async_body(block).kind . && !is_inside_let_else(cx.tcx, expr) -- line 27 ---------------------------------------- -- line 36 ---------------------------------------- . NEEDLESS_RETURN_WITH_QUESTION_MARK, . expr.span.until(ret.span), . "unneeded `return` statement with `?` operator", . "remove it", . String::new(), . Applicability::MachineApplicable, . ); . } 31,696 ( 0.00%) } . . /// In async functions, the body is wrapped in a . /// `Block { expr: DropTemps(inner) }`. We peel through to `inner` so . /// we can check the actual stmts. . /// Returns `body_value` unchanged for non-async functions. . fn peel_async_body<'a>(body_value: &'a Expr<'a>) -> &'a Expr<'a> { . if let ExprKind::Block(block, _) = body_value.kind . && let Some(expr) = block.expr -- line 52 ---------------------------------------- 127,428 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/operators/manual_isolate_lowest_one.rs -------------------------------------------------------------------------------- Ir -- line 7 ---------------------------------------- . use rustc_errors::Applicability; . use rustc_hir::{Expr, ExprKind, UnOp}; . use rustc_lint::LateContext; . use rustc_middle::ty; . use rustc_span::Span; . . use super::MANUAL_ISOLATE_LOWEST_ONE; . 27,622 ( 0.00%) pub(super) fn check<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'tcx>, . op: BinOpKind, . lhs: &'tcx Expr<'tcx>, . rhs: &'tcx Expr<'tcx>, . msrv: Msrv, . ) { 4,576 ( 0.00%) if op != BinOpKind::BitAnd || expr.span.from_expansion() || lhs.span.from_expansion() || rhs.span.from_expansion() { . return; . } . . // x & x.wrapping_neg() 630 ( 0.00%) if let Some(base) = matching_wrapping_neg(lhs, rhs) 422 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/operators/manual_isolate_lowest_one.rs:clippy_lints::operators::manual_isolate_lowest_one::matching_wrapping_neg (105x) . // x.wrapping_neg() & x 105 ( 0.00%) .or_else(|| matching_wrapping_neg(rhs, lhs)) 426 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/operators/manual_isolate_lowest_one.rs:clippy_lints::operators::manual_isolate_lowest_one::matching_wrapping_neg (105x) . && is_primitive_int(cx, base) . { . maybe_emit_lint(cx, expr.span, base, msrv, false); . } else if let Some(base) = matching_neg(lhs, rhs) . // x & -x or -x & x . .or_else(|| matching_neg(rhs, lhs)) . && is_signed_int(cx, base) . { . maybe_emit_lint(cx, expr.span, base, msrv, false); 315 ( 0.00%) } else if let Some(base) = matching_nonzero_wrapping_neg(lhs, rhs) 426 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/operators/manual_isolate_lowest_one.rs:clippy_lints::operators::manual_isolate_lowest_one::matching_nonzero_wrapping_neg (105x) . // nz.get() & nz.get().wrapping_neg() or reversed 105 ( 0.00%) .or_else(|| matching_nonzero_wrapping_neg(rhs, lhs)) 422 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/operators/manual_isolate_lowest_one.rs:clippy_lints::operators::manual_isolate_lowest_one::matching_nonzero_wrapping_neg (105x) . && is_nonzero_int(cx, base) . { . maybe_emit_lint(cx, expr.span, base, msrv, true); 315 ( 0.00%) } else if let Some(base) = matching_nonzero_neg(lhs, rhs) 426 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/operators/manual_isolate_lowest_one.rs:clippy_lints::operators::manual_isolate_lowest_one::matching_nonzero_neg (105x) . // nz.get() & -nz.get() or reversed 105 ( 0.00%) .or_else(|| matching_nonzero_neg(rhs, lhs)) 422 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/operators/manual_isolate_lowest_one.rs:clippy_lints::operators::manual_isolate_lowest_one::matching_nonzero_neg (105x) . && is_nonzero_signed_int(cx, base) . { . maybe_emit_lint(cx, expr.span, base, msrv, true); . } 31,568 ( 0.00%) } . . fn maybe_emit_lint(cx: &LateContext<'_>, span: Span, base: &Expr<'_>, msrv: Msrv, add_get: bool) { . if !msrv.meets(cx, msrvs::ISOLATE_LOWEST_ONE) { . return; . } . . let mut applicability = Applicability::MachineApplicable; . let snippet = Sugg::hir_with_applicability(cx, base, "_", &mut applicability); -- line 61 ---------------------------------------- -- line 67 ---------------------------------------- . span, . "manual implementation of `isolate_lowest_one`", . "consider using `.isolate_lowest_one()`", . format!("{}.isolate_lowest_one(){get}", snippet.maybe_paren()), . applicability, . ); . } . 210 ( 0.00%) fn matching_wrapping_neg<'tcx>(base: &'tcx Expr<'tcx>, negated: &Expr<'tcx>) -> Option<&'tcx Expr<'tcx>> { . let receiver = wrapping_neg_receiver(negated)?; . is_same_local_path(base, receiver).then_some(base) 210 ( 0.00%) } . . fn matching_neg<'tcx>(base: &'tcx Expr<'tcx>, negated: &Expr<'tcx>) -> Option<&'tcx Expr<'tcx>> { 769 ( 0.00%) if let ExprKind::Unary(UnOp::Neg, inner) = negated.kind . && is_same_local_path(base, inner) . { . Some(base) . } else { . None . } . } . 210 ( 0.00%) fn matching_nonzero_wrapping_neg<'tcx>(base_get: &'tcx Expr<'tcx>, negated: &Expr<'tcx>) -> Option<&'tcx Expr<'tcx>> { . let base = get_receiver(base_get)?; . let receiver = wrapping_neg_receiver(negated)?; . let negated_base = get_receiver(receiver)?; . is_same_local_path(base, negated_base).then_some(base) 210 ( 0.00%) } . 210 ( 0.00%) fn matching_nonzero_neg<'tcx>(base_get: &'tcx Expr<'tcx>, negated: &Expr<'tcx>) -> Option<&'tcx Expr<'tcx>> { . let base = get_receiver(base_get)?; . if let ExprKind::Unary(UnOp::Neg, inner) = negated.kind { . let negated_base = get_receiver(inner)?; . is_same_local_path(base, negated_base).then_some(base) . } else { . None . } 210 ( 0.00%) } . . fn wrapping_neg_receiver<'tcx>(expr: &Expr<'tcx>) -> Option<&'tcx Expr<'tcx>> { 425 ( 0.00%) if let ExprKind::MethodCall(method_name, receiver, [], _) = expr.kind 1 ( 0.00%) && method_name.ident.name == sym::wrapping_neg . { . Some(receiver) . } else { . None . } . } . . fn get_receiver<'tcx>(expr: &Expr<'tcx>) -> Option<&'tcx Expr<'tcx>> { 850 ( 0.00%) if let ExprKind::MethodCall(method_name, receiver, [], _) = expr.kind 2 ( 0.00%) && method_name.ident.name == sym::get . && is_local_path(receiver) . { . Some(receiver) . } else { . None . } . } . -- line 127 ---------------------------------------- 315 ( 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 { 712,183 ( 0.01%) !self.eq(other) 109,369 ( 0.00%) => ???:::eq (2,327x) . } . } . . /// 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)] 1,032 ( 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 { 846 ( 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 { 198,275 ( 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 { 3,041 ( 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 { 2,069,692 ( 0.02%) 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 } 262,536 ( 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 } 100,078 ( 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 } 918 ( 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 } 2,525 ( 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] 3,054,825 ( 0.03%) 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)] 127,230 ( 0.00%) fn lt(&self, other: &Self) -> bool { *self < *other } . #[inline(always)] 211 ( 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 { 365,468 ( 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 { 58,924 ( 0.00%) PartialEq::eq(*self, *other) 3,868 ( 0.00%) => ???:::eq (148x) . } . #[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 ---------------------------------------- 171,294 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/bool_assert_comparison.rs -------------------------------------------------------------------------------- Ir -- line 33 ---------------------------------------- . pub BOOL_ASSERT_COMPARISON, . style, . "Using a boolean as comparison value in an assert_* macro when there is no need" . } . . declare_lint_pass!(BoolAssertComparison => [BOOL_ASSERT_COMPARISON]); . . fn extract_bool_lit(e: &Expr<'_>) -> Option { 1,290 ( 0.00%) if let ExprKind::Lit(Lit { . node: LitKind::Bool(b), .. . }) = e.kind . && !e.span.from_expansion() . { . Some(b) . } else { . None . } -- line 49 ---------------------------------------- -- line 68 ---------------------------------------- . .tcx . .normalize_erasing_regions(cx.typing_env(), Unnormalized::new_wip(proj)); . . nty.is_bool() . }) . } . . impl<'tcx> LateLintPass<'tcx> for BoolAssertComparison { 2,180,052 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 10,866 ( 0.00%) let Some(macro_call) = root_macro_call_first_node(cx, expr) else { . return; . }; 25,523 ( 0.00%) let eq_macro = match cx.tcx.get_diagnostic_name(macro_call.def_id) { 142,222 ( 0.00%) => ???:::get_diagnostic_name (1,811x) . Some(sym::assert_eq_macro | sym::debug_assert_eq_macro) => true, . Some(sym::assert_ne_macro | sym::debug_assert_ne_macro) => false, . _ => return, . }; 2,100 ( 0.00%) let Some((a, b, _)) = find_assert_eq_args(cx, expr, macro_call.expn) else { 716,091 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::find_assert_eq_args (210x) . return; . }; . 840 ( 0.00%) let a_span = a.span.source_callsite(); 5,040 ( 0.00%) => ???:::source_callsite (210x) 630 ( 0.00%) let b_span = b.span.source_callsite(); 5,040 ( 0.00%) => ???:::source_callsite (210x) . 840 ( 0.00%) let (lit_span, bool_value, non_lit_expr) = match (extract_bool_lit(a), extract_bool_lit(b)) { . // assert_eq!(true/false, b) . // ^^^^^^^^^^^^ . (Some(bool_value), None) => (a_span.until(b_span), bool_value, b), . // assert_eq!(a, true/false) . // ^^^^^^^^^^^^ . (None, Some(bool_value)) => (b_span.with_lo(a_span.hi()), bool_value, a), . // If there are two boolean arguments, we definitely don't understand . // what's going on, so better leave things as is... -- line 100 ---------------------------------------- -- line 148 ---------------------------------------- . . diag.multipart_suggestion( . format!("replace it with `{non_eq_mac}!(..)`"), . suggestions, . applicability, . ); . }, . ); 1,937,824 ( 0.02%) } . } 236 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/methods/ip_constant.rs -------------------------------------------------------------------------------- Ir -- line 3 ---------------------------------------- . use clippy_utils::sym; . use rustc_data_structures::smallvec::SmallVec; . use rustc_errors::Applicability; . use rustc_hir::{Expr, ExprKind, QPath, TyKind}; . use rustc_lint::LateContext; . . use super::IP_CONSTANT; . 117,502 ( 0.00%) pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, func: &Expr<'_>, args: &[Expr<'_>]) { 74,963 ( 0.00%) if let ExprKind::Path(QPath::TypeRelative(ty, p)) = func.kind 31,566 ( 0.00%) && let TyKind::Path(QPath::Resolved(_, func_path)) = ty.kind 7,383 ( 0.00%) && p.ident.name == sym::new . && let Some(func_def_id) = func_path.res.opt_def_id() 332 ( 0.00%) && matches!( 1,328 ( 0.00%) cx.tcx.get_diagnostic_name(func_def_id), 19,562 ( 0.00%) => ???:::get_diagnostic_name (332x) . Some(sym::Ipv4Addr | sym::Ipv6Addr) . ) . && let ecx = ConstEvalCtxt::new(cx) . && let ctxt = expr.span.ctxt() . && let Some(args) = args . .iter() . .map(|arg| { . if let Some(Constant::Int(constant @ (0 | 1 | 127 | 255))) = ecx.eval_local(arg, ctxt) { -- line 25 ---------------------------------------- -- line 43 ---------------------------------------- . // Remove everything before the type name . sugg.push((before_span, String::new())); . } . . span_lint_and_then(cx, IP_CONSTANT, expr.span, "hand-coded well-known IP address", |diag| { . diag.multipart_suggestion("use", sugg, Applicability::MachineApplicable); . }); . } 134,288 ( 0.00%) } 8,711 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/four_forward_slashes.rs -------------------------------------------------------------------------------- Ir -- line 36 ---------------------------------------- . pub FOUR_FORWARD_SLASHES, . suspicious, . "comments with 4 forward slashes (`////`) likely intended to be doc comments (`///`)" . } . . declare_lint_pass!(FourForwardSlashes => [FOUR_FORWARD_SLASHES]); . . impl<'tcx> LateLintPass<'tcx> for FourForwardSlashes { 53,442 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'tcx>) { 11,876 ( 0.00%) if item.span.from_expansion() { . return; . } . let sm = cx.sess().source_map(); . let mut span = cx . .tcx 17,052 ( 0.00%) .hir_attrs(item.hir_id()) 253,042 ( 0.00%) => ???:::hir_attrs (4,263x) . .iter() . // Only fold in OUTER doc comments. An inner doc (`//!`) inside the item's . // body lowers onto the item with `AttrStyle::Inner`; folding its span drags . // `end_line` down into the body, so the upward `////` scan then flags a . // regular comment there (see #16168). . .filter(|i| { 12,776 ( 0.00%) matches!( . i, . Attribute::Parsed(AttributeKind::DocComment { . style: AttrStyle::Outer, . .. . }) . ) . }) 10,323 ( 0.00%) .fold(item.span.shrink_to_lo(), |span, attr| span.to(attr.span())); 278,735 ( 0.00%) => ???:::to (2,020x) 34,104 ( 0.00%) let (Some(file), _, _, end_line, _) = sm.span_to_location_info(span) else { 6,600,422 ( 0.05%) => ???:::span_to_location_info (4,263x) . return; . }; . let mut bad_comments = vec![]; . for line in (0..end_line.saturating_sub(1)).rev() { 36,792 ( 0.00%) let Some(contents) = file.get_line(line).map(|c| c.trim().to_owned()) else { 1,770,131 ( 0.01%) => ???:::get_line (12,264x) . return; . }; . // Keep searching until we find the next item 22,504 ( 0.00%) if !contents.is_empty() && !contents.starts_with("//") && !contents.starts_with("#[") { . break; . } . 5,105 ( 0.00%) if contents.starts_with("////") && !matches!(contents.chars().nth(4), Some('/' | '!')) { . let bounds = file.line_bounds(line); . let line_span = Span::with_root_ctxt(bounds.start, bounds.end); . span = line_span.to(span); . bad_comments.push((line_span, contents)); . } . } . 4,243 ( 0.00%) if !bad_comments.is_empty() { . span_lint_and_then( . cx, . FOUR_FORWARD_SLASHES, . span, . "this item has comments with 4 forward slashes (`////`). These look like doc comments, but they aren't", . |diag| { . let msg = if bad_comments.len() == 1 { . "make this a doc comment by removing one `/`" -- line 96 ---------------------------------------- -- line 115 ---------------------------------------- . // will need normalization but it should be fine . .map(|(span, c)| (span, c.replacen("////", "///", 1) + "\n")) . .collect(), . Applicability::MachineApplicable, . ); . }, . ); . } 47,504 ( 0.00%) } . } . . /// Checks if `text` contains any CR not followed by a LF . fn contains_bare_cr(text: &str) -> bool { . text.bytes().tuple_windows().any(|(a, b)| a == b'\r' && b != b'\n') . } 23,335 ( 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/fold.rs -------------------------------------------------------------------------------- Ir -- line 97 ---------------------------------------- . . /// This cache only tracks the `DebruijnIndex` and assumes that it does not matter . /// for the delegate how often its methods get used. . cache: DelayedMap<(ty::DebruijnIndex, Ty<'tcx>), Ty<'tcx>>, . } . . impl<'tcx, D: BoundVarReplacerDelegate<'tcx>> BoundVarReplacer<'tcx, D> { . fn new(tcx: TyCtxt<'tcx>, delegate: D) -> Self { 306,034 ( 0.00%) BoundVarReplacer { tcx, current_index: ty::INNERMOST, delegate, cache: Default::default() } . } . } . . impl<'tcx, D> TypeFolder> for BoundVarReplacer<'tcx, D> . where . D: BoundVarReplacerDelegate<'tcx>, . { . fn cx(&self) -> TyCtxt<'tcx> { -- line 113 ---------------------------------------- -- line 116 ---------------------------------------- . . fn fold_binder>>( . &mut self, . t: ty::Binder<'tcx, T>, . ) -> ty::Binder<'tcx, T> { . self.current_index.shift_in(1); . let t = t.super_fold_with(self); . self.current_index.shift_out(1); 330 ( 0.00%) t . } . 301,612 ( 0.00%) fn fold_ty(&mut self, t: Ty<'tcx>) -> Ty<'tcx> { 150,806 ( 0.00%) match *t.kind() { . ty::Bound(ty::BoundVarIndexKind::Bound(debruijn), bound_ty) . if debruijn == self.current_index => . { . let ty = self.delegate.replace_ty(bound_ty); . debug_assert!(!ty.has_vars_bound_above(ty::INNERMOST)); . ty::shift_vars(self.tcx, ty, self.current_index.as_u32()) . } . _ => { 150,806 ( 0.00%) if !t.has_vars_bound_at_or_above(self.current_index) { . t 53,000 ( 0.00%) } else if let Some(&t) = self.cache.get(&(self.current_index, t)) { . t . } else { 79,500 ( 0.00%) let res = t.super_fold_with(self); 15,802,202 ( 0.13%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/ty/structural_impls.rs:>::super_fold_with::> (26,048x) . assert!(self.cache.insert((self.current_index, t), res)); . res . } . } . } 301,612 ( 0.00%) } . . fn fold_region(&mut self, r: ty::Region<'tcx>) -> ty::Region<'tcx> { 157,872 ( 0.00%) match r.kind() { . ty::ReBound(ty::BoundVarIndexKind::Bound(debruijn), br) 26,312 ( 0.00%) if debruijn == self.current_index => . { 102,684 ( 0.00%) let region = self.delegate.replace_region(br); 9,573,712 ( 0.08%) => ???:::replace_region (23,468x) 157,872 ( 0.00%) if let ty::ReBound(ty::BoundVarIndexKind::Bound(debruijn1), br) = region.kind() { . // If the callback returns a bound region, . // that region should always use the INNERMOST . // debruijn index. Then we adjust it to the . // correct depth. . assert_eq!(debruijn1, ty::INNERMOST); . ty::Region::new_bound(self.tcx, debruijn, br) . } else { . region -- line 164 ---------------------------------------- -- line 210 ---------------------------------------- . mut fld_r: F, . ) -> (T, FxIndexMap, ty::Region<'tcx>>) . where . F: FnMut(ty::BoundRegion<'tcx>) -> ty::Region<'tcx>, . T: TypeFoldable>, . { . let mut region_map = FxIndexMap::default(); . let real_fld_r = 312,847 ( 0.00%) |br: ty::BoundRegion<'tcx>| *region_map.entry(br).or_insert_with(|| fld_r(br)); . let value = self.instantiate_bound_regions_uncached(value, real_fld_r); 69,301 ( 0.00%) (value, region_map) . } . 168 ( 0.00%) pub fn instantiate_bound_regions_uncached( . self, . value: Binder<'tcx, T>, . mut replace_regions: F, . ) -> T . where . F: FnMut(ty::BoundRegion<'tcx>) -> ty::Region<'tcx>, . T: TypeFoldable>, . { . let value = value.skip_binder(); 19,956 ( 0.00%) if !value.has_escaping_bound_vars() { 71,441 ( 0.00%) value . } else { . let delegate = FnMutDelegate { . regions: &mut replace_regions, . types: &mut |b| bug!("unexpected bound ty in binder: {b:?}"), . consts: &mut |b| bug!("unexpected bound ct in binder: {b:?}"), . }; . let mut replacer = BoundVarReplacer::new(self, delegate); 114 ( 0.00%) value.fold_with(&mut replacer) 67,467 ( 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/generic_args.rs:<&rustc_middle::ty::list::RawList<(), rustc_middle::ty::Ty> as rustc_type_ir::fold::TypeFoldable>::fold_with::> (57x) 165 ( 0.00%) } 147 ( 0.00%) } . . /// Replaces all escaping bound vars. The `fld_r` closure replaces escaping . /// bound regions; the `fld_t` closure replaces escaping bound types and the `fld_c` . /// closure replaces escaping bound consts. . pub fn replace_escaping_bound_vars_uncached>>( . self, . value: T, . delegate: impl BoundVarReplacerDelegate<'tcx>, -- line 252 ---------------------------------------- -- line 275 ---------------------------------------- . pub fn liberate_late_bound_regions( . self, . all_outlive_scope: DefId, . value: ty::Binder<'tcx, T>, . ) -> T . where . T: TypeFoldable>, . { 42 ( 0.00%) self.instantiate_bound_regions_uncached(value, |br| { 25,716 ( 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_uncached::, ::liberate_late_bound_regions>::{closure#0}> (21x) 80 ( 0.00%) let kind = ty::LateParamRegionKind::from_bound(br.var, br.kind); 160 ( 0.00%) ty::Region::new_late_param(self, all_outlive_scope, kind) 80 ( 0.00%) }) . } . . pub fn shift_bound_var_indices(self, bound_vars: usize, value: T) -> T . where . T: TypeFoldable>, . { . let shift_bv = |bv: ty::BoundVar| bv + bound_vars; . self.replace_escaping_bound_vars_uncached( -- line 294 ---------------------------------------- -- line 312 ---------------------------------------- . ty::Const::new_bound(self, ty::INNERMOST, ty::BoundConst::new(shift_bv(c.var))) . }, . }, . ) . } . . /// Replaces any late-bound regions bound in `value` with `'erased`. Useful in codegen but also . /// method lookup and a few other places where precise region relationships are not required. 366,735 ( 0.00%) pub fn instantiate_bound_regions_with_erased(self, value: Binder<'tcx, T>) -> T . where . T: TypeFoldable>, . { 213,178 ( 0.00%) self.instantiate_bound_regions(value, |_| self.lifetimes.re_erased).0 291,932 ( 0.00%) } . . /// Anonymize all bound variables in `value`, this is mostly used to improve caching. . pub fn anonymize_bound_vars(self, value: Binder<'tcx, T>) -> Binder<'tcx, T> . where . T: TypeFoldable>, . { . struct Anonymize<'a, 'tcx> { . tcx: TyCtxt<'tcx>, -- line 333 ---------------------------------------- 129,672 ( 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 { 968,912 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &'_ Expr<'_>) { 551,190 ( 0.00%) if let ExprKind::Call(path, [arg]) = expr.kind 28,356 ( 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", . ); . } 1,211,140 ( 0.01%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/methods/unnecessary_fallible_conversions.rs -------------------------------------------------------------------------------- Ir -- line 72 ---------------------------------------- . _ => unreachable!(), . }; . . sugg.push((unwrap_span, String::new())); . sugg . } . } . 630 ( 0.00%) fn check<'tcx>( . cx: &LateContext<'tcx>, . expr: &Expr<'_>, . node_args: ty::GenericArgsRef<'tcx>, . kind: FunctionKind, . primary_span: Span, . ) { 360 ( 0.00%) if let &[self_ty, other_ty] = node_args.as_slice() . // useless_conversion already warns `T::try_from(T)`, so ignore it here 90 ( 0.00%) && self_ty != other_ty . && let Some(self_ty) = self_ty.as_type() 900 ( 0.00%) && let Some(from_into_trait) = cx.tcx.get_diagnostic_item(match kind { 9,540 ( 0.00%) => ???:::get_diagnostic_item (90x) . FunctionKind::TryFromFunction(_) => sym::From, . FunctionKind::TryIntoMethod | FunctionKind::TryIntoFunction(_) => sym::Into, . }) . // If `T: TryFrom` and `T: From` both exist, then that means that the `TryFrom` . // _must_ be from the blanket impl and cannot have been manually implemented . // (else there would be conflicting impls, even with #![feature(spec)]), so we don't even need to check . // what `>::Error` is: it's always `Infallible` 810 ( 0.00%) && implements_trait(cx, self_ty, from_into_trait, &[other_ty]) 1,092,661 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::implements_trait (90x) . && let Some(other_ty) = other_ty.as_type() . { . // Extend the span to include the unwrap/expect call: . // `foo.try_into().expect("..")` . // ^^^^^^^^^^^^^^^^^^^^^^^ . // . // `try_into().unwrap()` specifically can be trivially replaced with just `into()`, . // so that can be machine-applicable -- line 107 ---------------------------------------- -- line 138 ---------------------------------------- . |diag| { . with_forced_trimmed_paths!({ . diag.note(format!("converting `{source_ty}` to `{target_ty}` cannot fail")); . }); . diag.multipart_suggestion("use", sugg, applicability); . }, . ); . } 720 ( 0.00%) } . . /// Checks method call exprs: . /// - `0i32.try_into()` 100 ( 0.00%) pub(super) fn check_method(cx: &LateContext<'_>, expr: &Expr<'_>) { 75 ( 0.00%) if let ExprKind::MethodCall(path, ..) = expr.kind { 100 ( 0.00%) check( 482,587 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/methods/unnecessary_fallible_conversions.rs:clippy_lints::methods::unnecessary_fallible_conversions::check (25x) . cx, . expr, 175 ( 0.00%) cx.typeck_results().node_args(expr.hir_id), 975 ( 0.00%) => ???:::node_args (25x) 25 ( 0.00%) FunctionKind::TryIntoMethod, 50 ( 0.00%) path.ident.span, . ); . } 125 ( 0.00%) } . . /// Checks function call exprs: . /// - `>::try_from(0i32)` . /// - `<_ as TryInto>::try_into(0i32)` 117,502 ( 0.00%) pub(super) fn check_function(cx: &LateContext<'_>, expr: &Expr<'_>, callee: &Expr<'_>) { 50,356 ( 0.00%) if let ExprKind::Path(ref qpath) = callee.kind 117,488 ( 0.00%) && let Some(item_def_id) = cx.qpath_res(qpath, callee.hir_id).opt_def_id() 816,765 ( 0.01%) => ???:::qpath_res (16,784x) 83,355 ( 0.00%) && let Some(trait_def_id) = cx.tcx.trait_of_assoc(item_def_id) 2,279,216 ( 0.02%) => ???:::trait_of_assoc (16,671x) . { 14,036 ( 0.00%) let qpath_spans = match qpath { . QPath::Resolved(_, path) => { 472 ( 0.00%) if let [trait_seg, fn_seg] = path.segments { . Some(SpansKind::TraitFn { 64 ( 0.00%) trait_span: trait_seg.ident.span, 32 ( 0.00%) fn_span: fn_seg.ident.span, . }) . } else { . None . } . }, . QPath::TypeRelative(_, seg) => Some(SpansKind::Fn { 27,192 ( 0.00%) fn_span: seg.ident.span, . }), . }; . 260 ( 0.00%) check( 624,024 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/methods/unnecessary_fallible_conversions.rs:clippy_lints::methods::unnecessary_fallible_conversions::check (65x) . cx, . expr, 28,072 ( 0.00%) cx.typeck_results().node_args(callee.hir_id), 274,454 ( 0.00%) => ???:::node_args (7,018x) 76,873 ( 0.00%) match cx.tcx.get_diagnostic_name(trait_def_id) { 404,036 ( 0.00%) => ???:::get_diagnostic_name (7,018x) . Some(sym::TryFrom) => FunctionKind::TryFromFunction(qpath_spans), . Some(sym::TryInto) => FunctionKind::TryIntoFunction(qpath_spans), . _ => return, . }, 130 ( 0.00%) callee.span, . ); . } 134,288 ( 0.00%) } 79,858 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs -------------------------------------------------------------------------------- Ir -- line 12 ---------------------------------------- . Block, Closure, Destination, Expr, ExprKind, HirId, InlineAsm, InlineAsmOperand, Node, Pat, Stmt, StmtKind, . StructTailExpr, . }; . use rustc_lint::LateContext; . use rustc_span::{BytePos, Span}; . use std::iter::once; . use std::ops::ControlFlow; . 7,480 ( 0.00%) pub(super) fn check<'tcx>( . cx: &LateContext<'tcx>, . block: &Block<'tcx>, . loop_id: HirId, . span: Span, . for_loop: Option<&ForLoop<'_>>, . ) { 4,488 ( 0.00%) match never_loop_block(cx, block, &mut Vec::new(), loop_id) { 24,454,765 ( 0.20%) => site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::never_loop_block (748x) . NeverLoopResult::Diverging { . break_spans, . never_spans, . non_obvious_exprs, . } => { . span_lint_and_then(cx, NEVER_LOOP, span, "this loop never actually loops", |diag| { . if let Some(ForLoop { . arg: iterator, -- line 35 ---------------------------------------- -- line 78 ---------------------------------------- . . for span in non_obvious_spans { . diag.span_note(span, "this expression never returns"); . } . }); . }, . NeverLoopResult::MayContinueMainLoop | NeverLoopResult::Normal => (), . } 3,740 ( 0.00%) } . 306 ( 0.00%) pub(super) fn check_iterator_reduction<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'tcx>, . recv: &'tcx Expr<'tcx>, . closure: &'tcx Closure<'tcx>, . ) { 136 ( 0.00%) let closure_body = cx.tcx.hir_body(closure.body).value; 3,299 ( 0.00%) => ???:::hir_body (34x) 68 ( 0.00%) let body_ty = cx.typeck_results().expr_ty(closure_body); 1,360 ( 0.00%) => ???:::expr_ty (34x) 34 ( 0.00%) if body_ty.is_never() && !contains_return(closure_body) { . span_lint_and_then( . cx, . NEVER_LOOP, . expr.span, . "this iterator reduction never loops (closure always diverges)", . |diag| { . let mut app = Applicability::HasPlaceholders; . let recv_snip = snippet_with_context(cx, recv.span, expr.span.ctxt(), "", &mut app).0; . diag.note("if you only need one element, `if let Some(x) = iter.next()` is clearer"); . let sugg = format!("if let Some(x) = {recv_snip}.next() {{ ... }}"); . diag.span_suggestion_verbose(expr.span, "consider this pattern", sugg, app); . }, . ); . } 204 ( 0.00%) } . . fn contains_any_break_or_continue(block: &Block<'_>) -> bool { . for_each_expr_without_closures(block, |e| match e.kind { . ExprKind::Break(..) | ExprKind::Continue(..) => ControlFlow::Break(()), . ExprKind::InlineAsm(asm) if contains_label(asm) => ControlFlow::Break(()), . ExprKind::Loop(..) => ControlFlow::Continue(Descend::No), . _ => ControlFlow::Continue(Descend::Yes), . }) -- line 119 ---------------------------------------- -- line 131 ---------------------------------------- . /// * Has any (reachable) code path hit a `continue` of the main loop? . /// * Is the current code path diverging (that is, the next expression is not reachable) . /// * For each block label `'a` inside the main loop, has any (reachable) code path encountered a . /// `break 'a`? . /// . /// The first two bits of information are in this enum, and the last part is in the . /// `local_labels` variable, which contains a list of `(block_id, reachable)` pairs ordered by . /// scope. 415,191 ( 0.00%) #[derive(Clone, Debug)] . enum NeverLoopResult { . /// A continue may occur for the main loop. . MayContinueMainLoop, . /// We have not encountered any main loop continue, . /// but we are diverging (subsequent control flow is not reachable) . Diverging { . break_spans: Vec, . never_spans: Vec, -- line 147 ---------------------------------------- -- line 149 ---------------------------------------- . }, . /// We have not encountered any main loop continue, . /// and subsequent control flow is (possibly) reachable . Normal, . } . . #[must_use] . fn absorb_break(arg: &NeverLoopResult) -> NeverLoopResult { 4,713 ( 0.00%) match arg { . NeverLoopResult::Diverging { .. } | NeverLoopResult::Normal => NeverLoopResult::Normal, . NeverLoopResult::MayContinueMainLoop => NeverLoopResult::MayContinueMainLoop, . } . } . . // Combine two results for parts that are called in order. . #[must_use] . fn combine_seq(first: NeverLoopResult, second: impl FnOnce() -> NeverLoopResult) -> NeverLoopResult { 322,722 ( 0.00%) match first { 71,640 ( 0.00%) NeverLoopResult::Diverging { .. } | NeverLoopResult::MayContinueMainLoop => first, 12,943 ( 0.00%) NeverLoopResult::Normal => second(), 22,666,588 ( 0.19%) => site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::never_loop_expr::{closure#2} (609x) 520,437 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::never_loop_expr::{closure#3} (79x) . } 1,515 ( 0.00%) } 9,090 ( 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:: (1,515x) . . // Combine an iterator of results for parts that are called in order. . #[must_use] . fn combine_seq_many(iter: impl IntoIterator) -> NeverLoopResult { 227,448 ( 0.00%) for e in iter { 271,239 ( 0.00%) if let NeverLoopResult::Diverging { .. } | NeverLoopResult::MayContinueMainLoop = e { 64,044 ( 0.00%) return e; . } 6,015 ( 0.00%) } 510 ( 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:: (85x) 73,336 ( 0.00%) NeverLoopResult::Normal . } . . // Combine two results where only one of the part may have been executed. . #[must_use] 136,160 ( 0.00%) fn combine_branches(b1: NeverLoopResult, b2: NeverLoopResult) -> NeverLoopResult { 489,672 ( 0.00%) match (b1, b2) { . (NeverLoopResult::MayContinueMainLoop, _) | (_, NeverLoopResult::MayContinueMainLoop) => { . NeverLoopResult::MayContinueMainLoop . }, . (NeverLoopResult::Normal, _) | (_, NeverLoopResult::Normal) => NeverLoopResult::Normal, . ( . NeverLoopResult::Diverging { 708 ( 0.00%) break_spans: mut break_spans1, 708 ( 0.00%) never_spans: mut never_spans1, 708 ( 0.00%) non_obvious_exprs: mut non_obvious_exprs1, . }, . NeverLoopResult::Diverging { 177 ( 0.00%) break_spans: mut break_spans2, 177 ( 0.00%) never_spans: mut never_spans2, 177 ( 0.00%) non_obvious_exprs: mut non_obvious_exprs2, . }, . ) => { . break_spans1.append(&mut break_spans2); . never_spans1.append(&mut never_spans2); . non_obvious_exprs1.append(&mut non_obvious_exprs2); . NeverLoopResult::Diverging { 708 ( 0.00%) break_spans: break_spans1, 708 ( 0.00%) never_spans: never_spans1, 708 ( 0.00%) non_obvious_exprs: non_obvious_exprs1, . } . }, 67,195 ( 0.00%) } 108,800 ( 0.00%) } . 233,792 ( 0.00%) fn never_loop_block<'tcx>( . cx: &LateContext<'tcx>, . block: &Block<'tcx>, . local_labels: &mut Vec<(HirId, bool)>, . main_loop_id: HirId, . ) -> NeverLoopResult { 35,968 ( 0.00%) let iter = block . .stmts . .iter() . .filter_map(stmt_to_expr) 143,872 ( 0.00%) .chain(block.expr.map(|expr| (expr, None))); . combine_seq_many(iter.map(|(e, els)| { 184,944 ( 0.00%) let e = never_loop_expr(cx, e, local_labels, main_loop_id); 24,353,592 ( 0.20%) => site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::never_loop_expr (1,055x) . // els is an else block in a let...else binding 154,120 ( 0.00%) els.map_or(e.clone(), |els| { 5 ( 0.00%) combine_seq(e, || match never_loop_block(cx, els, local_labels, main_loop_id) { 186 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::never_loop_block'2 (1x) . // Returning MayContinueMainLoop here means that . // we will not evaluate the rest of the body . NeverLoopResult::MayContinueMainLoop => NeverLoopResult::MayContinueMainLoop, . // An else block always diverges, so the Normal case should not happen, . // but the analysis is approximate so it might return Normal anyway. . // Returning Normal here says that nothing more happens on the main path . NeverLoopResult::Diverging { .. } | NeverLoopResult::Normal => NeverLoopResult::Normal, . }) . }) . })) 143,872 ( 0.00%) } . . fn stmt_to_expr<'tcx>(stmt: &Stmt<'tcx>) -> Option<(&'tcx Expr<'tcx>, Option<&'tcx Block<'tcx>>)> { 68,306 ( 0.00%) match stmt.kind { . StmtKind::Semi(e) | StmtKind::Expr(e) => Some((e, None)), . // add the let...else expression (if present) 19,006 ( 0.00%) StmtKind::Let(local) => local.init.map(|init| (init, local.els)), . StmtKind::Item(..) => None, . } . } . 14,266 ( 0.00%) fn stmt_source_span(stmt: &Stmt<'_>) -> Span { 14,266 ( 0.00%) let call_span = stmt.span.source_callsite(); 247,378 ( 0.00%) => ???:::source_callsite (2,038x) . // if it is a macro call, the span will be missing the trailing semicolon 25 ( 0.00%) if stmt.span == call_span { . return call_span; . } . . // An expression without a trailing semi-colon (must have unit type). . if let StmtKind::Expr(..) = stmt.kind { . return call_span; . } . . call_span.with_hi(call_span.hi() + BytePos(1)) 26,494 ( 0.00%) } . . /// Returns a Vec of all the individual spans after the highlighted expression in a block 19,278 ( 0.00%) fn all_spans_after_expr(cx: &LateContext<'_>, expr: &Expr<'_>) -> Vec { 19,174 ( 0.00%) if let Node::Stmt(stmt) = cx.tcx.parent_hir_node(expr.hir_id) { 259,644 ( 0.00%) => ???:::parent_hir_node (2,142x) 16,304 ( 0.00%) if let Node::Block(block) = cx.tcx.parent_hir_node(stmt.hir_id) { 247,768 ( 0.00%) => ???:::parent_hir_node (2,038x) 4,076 ( 0.00%) return block . .stmts . .iter() . .skip_while(|inner| inner.hir_id != stmt.hir_id) . .map(stmt_source_span) 2,038 ( 0.00%) .chain(block.expr.map(|e| e.span)) . .collect(); . } . 32 ( 0.00%) return vec![stmt.span]; 624 ( 0.00%) } else if let Node::Block(_) = cx.tcx.parent_hir_node(expr.hir_id) { 11,876 ( 0.00%) => ???:::parent_hir_node (104x) 64 ( 0.00%) return vec![expr.span]; . } . 72 ( 0.00%) vec![] 14,994 ( 0.00%) } . . fn is_label_for_block(cx: &LateContext<'_>, dest: &Destination) -> bool { . dest.target_id 6,135 ( 0.00%) .is_ok_and(|hir_id| matches!(cx.tcx.hir_node(hir_id), Node::Block(_))) 140,601 ( 0.00%) => ???:::hir_node (2,045x) . } . . #[expect(clippy::too_many_lines)] 2,129,985 ( 0.02%) fn never_loop_expr<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'tcx>, . local_labels: &mut Vec<(HirId, bool)>, . main_loop_id: HirId, . ) -> NeverLoopResult { 709,995 ( 0.01%) let result = match expr.kind { . ExprKind::Unary(_, e) . | ExprKind::Cast(e, _) . | ExprKind::Type(e, _) . | ExprKind::Field(e, _) . | ExprKind::AddrOf(_, _, e) . | ExprKind::Repeat(e, _) . | ExprKind::DropTemps(e) . | ExprKind::UnsafeBinderCast(_, e, _) => never_loop_expr(cx, e, local_labels, main_loop_id), 17,727 ( 0.00%) ExprKind::Let(let_expr) => never_loop_expr(cx, let_expr.init, local_labels, main_loop_id), 525 ( 0.00%) ExprKind::Array(es) | ExprKind::Tup(es) => never_loop_expr_all(cx, es.iter(), local_labels, main_loop_id), . ExprKind::Use(expr, _) => never_loop_expr(cx, expr, local_labels, main_loop_id), 22,677 ( 0.00%) ExprKind::MethodCall(_, receiver, es, _) => { . never_loop_expr_all(cx, once(receiver).chain(es.iter()), local_labels, main_loop_id) . }, 150 ( 0.00%) ExprKind::Struct(_, fields, base) => { . let fields = never_loop_expr_all(cx, fields.iter().map(|f| f.expr), local_labels, main_loop_id); 200 ( 0.00%) if let StructTailExpr::Base(base) = base { . combine_seq(fields, || never_loop_expr(cx, base, local_labels, main_loop_id)) . } else { 550 ( 0.00%) fields . } . }, 34,608 ( 0.00%) ExprKind::Call(e, es) => never_loop_expr_all(cx, once(e).chain(es.iter()), local_labels, main_loop_id), 22,288 ( 0.00%) ExprKind::Binary(op, e1, _) if matches!(op.node, BinOpKind::And | BinOpKind::Or) => { . never_loop_expr(cx, e1, local_labels, main_loop_id) . }, . ExprKind::Binary(_, e1, e2) . | ExprKind::Assign(e1, e2, _) . | ExprKind::AssignOp(_, e1, e2) . | ExprKind::Index(e1, e2, _) => never_loop_expr_all(cx, [e1, e2].iter().copied(), local_labels, main_loop_id), 1,571 ( 0.00%) ExprKind::Loop(b, _, _, _) => { . // We don't attempt to track reachability after a loop, . // just assume there may have been a break somewhere 6,284 ( 0.00%) absorb_break(&never_loop_block(cx, b, local_labels, main_loop_id)) 38,567 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::never_loop_block'2 (5x) . }, 57,635 ( 0.00%) ExprKind::If(e, e2, e3) => { 57,635 ( 0.00%) let e1 = never_loop_expr(cx, e, local_labels, main_loop_id); 278,870 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::never_loop_expr'2 (609x) 184,432 ( 0.00%) combine_seq(e1, || { 115,270 ( 0.00%) let e2 = never_loop_expr(cx, e2, local_labels, main_loop_id); 22,174,728 ( 0.18%) => site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::never_loop_expr'2 (694x) 34,581 ( 0.00%) let e3 = e3.as_ref().map_or(NeverLoopResult::Normal, |e| { 14,154 ( 0.00%) never_loop_expr(cx, e, local_labels, main_loop_id) 893,268 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::never_loop_expr'2 (491x) . }); 23,054 ( 0.00%) combine_branches(e2, e3) 66,802 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::combine_branches (694x) 80,689 ( 0.00%) }) . }, 1,416 ( 0.00%) ExprKind::Match(e, arms, _) => { 3,540 ( 0.00%) let e = never_loop_expr(cx, e, local_labels, main_loop_id); 100,949 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::never_loop_expr'2 (79x) 8,496 ( 0.00%) combine_seq(e, || { 708 ( 0.00%) arms.iter().fold( . NeverLoopResult::Diverging { . break_spans: vec![], . never_spans: vec![], . non_obvious_exprs: vec![], . }, 38,310 ( 0.00%) |a, b| combine_branches(a, never_loop_expr(cx, b.body, local_labels, main_loop_id)), 14,700,569 ( 0.12%) => site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::never_loop_expr'2 (771x) 54,256 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::combine_branches (771x) . ) 5,664 ( 0.00%) }) . }, 15,664 ( 0.00%) ExprKind::Block(b, _) => { 31,328 ( 0.00%) if b.targeted_by_break { . local_labels.push((b.hir_id, false)); . } 93,984 ( 0.00%) let ret = never_loop_block(cx, b, local_labels, main_loop_id); 13,598 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::never_loop_block'2 (2x) 31,328 ( 0.00%) let jumped_to = b.targeted_by_break && local_labels.pop().unwrap().1; . match ret { . NeverLoopResult::Diverging { .. } if jumped_to => NeverLoopResult::Normal, . _ => ret, . } . }, 105 ( 0.00%) ExprKind::Continue(d) => { . let id = d . .target_id . .expect("target ID can only be missing in the presence of compilation errors"); 35 ( 0.00%) if id == main_loop_id { 58 ( 0.00%) NeverLoopResult::MayContinueMainLoop . } else { 36 ( 0.00%) NeverLoopResult::Diverging { 24 ( 0.00%) break_spans: all_spans_after_expr(cx, expr), 2,799 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::all_spans_after_expr (6x) . never_spans: vec![], . non_obvious_exprs: vec![], . } . } . }, 1,515 ( 0.00%) ExprKind::Ret(e) => { 1,515 ( 0.00%) let first = e.as_ref().map_or(NeverLoopResult::Normal, |e| { 572 ( 0.00%) never_loop_expr(cx, e, local_labels, main_loop_id) 69,266 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::never_loop_expr'2 (143x) . }); . combine_seq(first, || { . // checks if break targets a block instead of a loop . mark_block_as_reachable(expr, local_labels); 13,635 ( 0.00%) NeverLoopResult::Diverging { . break_spans: vec![], . never_spans: vec![], . non_obvious_exprs: vec![], . } . }) . }, 6,135 ( 0.00%) ExprKind::Break(dest, e) => { 2,045 ( 0.00%) let first = e.as_ref().map_or(NeverLoopResult::Normal, |e| { . never_loop_expr(cx, e, local_labels, main_loop_id) . }); . combine_seq(first, || { . // checks if break targets a block instead of a loop . mark_block_as_reachable(expr, local_labels); 26,585 ( 0.00%) NeverLoopResult::Diverging { 2,045 ( 0.00%) break_spans: if is_label_for_block(cx, &dest) { . vec![] . } else { 8,180 ( 0.00%) all_spans_after_expr(cx, expr) 1,144,957 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::all_spans_after_expr (2,045x) . }, . never_spans: vec![], . non_obvious_exprs: vec![], . } . }) . }, . ExprKind::Become(e) => combine_seq(never_loop_expr(cx, e, local_labels, main_loop_id), || { . NeverLoopResult::Diverging { -- line 417 ---------------------------------------- -- line 447 ---------------------------------------- . }, . })), . ExprKind::OffsetOf(_, _) . | ExprKind::Yield(_, _) . | ExprKind::Closure { .. } . | ExprKind::Path(_) . | ExprKind::ConstBlock(_) . | ExprKind::Lit(_) 59,679 ( 0.00%) | ExprKind::Err(_) => NeverLoopResult::Normal, . }; . 276,834 ( 0.00%) let result = combine_seq(result, || { 404,505 ( 0.00%) if cx.typeck_results().expr_ty(expr).is_never() { 41,112 ( 0.00%) => ???:::expr_ty (1,026x) 1,001 ( 0.00%) NeverLoopResult::Diverging { . break_spans: vec![], 273 ( 0.00%) never_spans: all_spans_after_expr(cx, expr), 51,616 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::all_spans_after_expr (91x) 182 ( 0.00%) non_obvious_exprs: vec![expr.hir_id], . } . } else { 269,488 ( 0.00%) NeverLoopResult::Normal . } . }); 425,906 ( 0.00%) if let NeverLoopResult::Diverging { .. } = result 72 ( 0.00%) && let Some(macro_call) = root_macro_call_first_node(cx, expr) 72 ( 0.00%) && let Some(sym::todo_macro) = cx.tcx.get_diagnostic_name(macro_call.def_id) 1,566 ( 0.00%) => ???:::get_diagnostic_name (18x) . { . // We return MayContinueMainLoop here because we treat `todo!()` . // as potentially containing any code, including a continue of the main loop. . // This effectively silences the lint whenever a loop contains this macro anywhere. . NeverLoopResult::MayContinueMainLoop . } else { 1,419,990 ( 0.01%) result . } 1,135,992 ( 0.01%) } . . fn never_loop_expr_all<'tcx, T: Iterator>>( . cx: &LateContext<'tcx>, . es: T, . local_labels: &mut Vec<(HirId, bool)>, . main_loop_id: HirId, . ) -> NeverLoopResult { 354,494 ( 0.00%) combine_seq_many(es.map(|e| never_loop_expr(cx, e, local_labels, main_loop_id))) 161,352 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/loops/never_loop.rs:clippy_lints::loops::never_loop::never_loop_expr'2 (701x) . } . . fn for_to_if_let_sugg(cx: &LateContext<'_>, iterator: &Expr<'_>, pat: &Pat<'_>) -> String { . let pat_snippet = snippet(cx, pat.span, "_"); . let iter_snippet = make_iterator_snippet(cx, iterator, &mut Applicability::Unspecified); . . format!("if let Some({pat_snippet}) = {iter_snippet}.next()") . } . . fn mark_block_as_reachable(expr: &Expr<'_>, local_labels: &mut [(HirId, bool)]) { 4,090 ( 0.00%) if let ExprKind::Break(Destination { target_id: Ok(t), .. }, _) = expr.kind . && let Some((_, reachable)) = local_labels.iter_mut().find(|(label, _)| *label == t) . { . *reachable = true; . } . } . . fn find_non_obvious_spans<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'tcx>) -> Vec { . let mut spans = vec![]; -- line 507 ---------------------------------------- 931,072 ( 0.01%) -------------------------------------------------------------------------------- -- 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 { 1,695,596 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 258 ( 0.00%) 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); 1,453,368 ( 0.01%) } . } . . #[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 { 9,442 ( 0.00%) match (self, b) { . (Finite, _) | (_, Finite) => Finite, . (MaybeInfinite, _) | (_, MaybeInfinite) => MaybeInfinite, . _ => Infinite, . } . } . . #[must_use] . fn or(self, b: Self) -> Self { 12 ( 0.00%) match (self, b) { . (Infinite, _) | (_, Infinite) => Infinite, . (MaybeInfinite, _) | (_, MaybeInfinite) => MaybeInfinite, . _ => Finite, . } . } . } . . impl From for Finiteness { . fn from(b: bool) -> Self { 1,327 ( 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), . ]; . 93,590 ( 0.00%) fn is_infinite(cx: &LateContext<'_>, expr: &Expr<'_>) -> Finiteness { 74,868 ( 0.00%) match expr.kind { 3,716 ( 0.00%) ExprKind::MethodCall(method, receiver, args, _) => { 49 ( 0.00%) for &(name, len, heuristic, cap) in &HEURISTICS { 33,963 ( 0.00%) if method.ident.name == name && args.len() == len { 147 ( 0.00%) return (match heuristic { . Always => Infinite, 32 ( 0.00%) First => is_infinite(cx, receiver), 5,047 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/infinite_iter.rs:clippy_lints::infinite_iter::is_infinite'2 (27x) 8 ( 0.00%) Any => is_infinite(cx, receiver).or(is_infinite(cx, &args[0])), 315 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/infinite_iter.rs:clippy_lints::infinite_iter::is_infinite'2 (2x) 112 ( 0.00%) All => is_infinite(cx, receiver).and(is_infinite(cx, &args[0])), 4,704 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/infinite_iter.rs:clippy_lints::infinite_iter::is_infinite'2 (32x) . }) . .and(cap); . } . } . if method.ident.name == sym::flat_map . && args.len() == 1 . && let ExprKind::Closure(&Closure { body, .. }) = args[0].kind . { . 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)), 2 ( 0.00%) ExprKind::AddrOf(BorrowKind::Ref, _, e) => is_infinite(cx, e), 441 ( 0.00%) ExprKind::Call(path, _) => { 1,323 ( 0.00%) if let ExprKind::Path(ref qpath) = path.kind { 2,646 ( 0.00%) cx.qpath_res(qpath, path.hir_id) 11,782 ( 0.00%) => ???:::qpath_res (440x) . .opt_def_id() 1,323 ( 0.00%) .is_some_and(|id| cx.tcx.is_diagnostic_item(sym::iter_repeat, id)) 25,278 ( 0.00%) => ???:::is_diagnostic_item (440x) . .into() . } else { . Finite . } . }, 4 ( 0.00%) ExprKind::Struct(..) => higher::Range::hir(cx, expr).is_some_and(|r| r.end.is_none()).into(), 898 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (2x) . _ => Finite, . } 65,513 ( 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 { 1,197,668 ( 0.01%) match expr.kind { 42,168 ( 0.00%) ExprKind::MethodCall(method, receiver, args, _) => { 14,056 ( 0.00%) let method_str = method.ident.name; . for &(name, len) in &COMPLETING_METHODS { 309,090 ( 0.00%) if method_str == name && args.len() == len { . return is_infinite(cx, receiver); . } . } . for &(name, len) in &POSSIBLY_COMPLETING_METHODS { 99,438 ( 0.00%) if method_str == name && args.len() == len { 88 ( 0.00%) return MaybeInfinite.and(is_infinite(cx, receiver)); 9,954 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/infinite_iter.rs:clippy_lints::infinite_iter::is_infinite (44x) . } . } 27,988 ( 0.00%) if method.ident.name == sym::last && args.is_empty() { 18 ( 0.00%) let not_double_ended = cx . .tcx 18 ( 0.00%) .get_diagnostic_item(sym::DoubleEndedIterator) 954 ( 0.00%) => ???:::get_diagnostic_item (9x) 90 ( 0.00%) .is_some_and(|id| !implements_trait(cx, cx.typeck_results().expr_ty(receiver), id, &[])); 93,534 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::implements_trait (9x) 360 ( 0.00%) => ???:::expr_ty (9x) 18 ( 0.00%) if not_double_ended { . return is_infinite(cx, receiver); . } 13,985 ( 0.00%) } else if method.ident.name == sym::collect { 52 ( 0.00%) let ty = cx.typeck_results().expr_ty(expr); 1,040 ( 0.00%) => ???:::expr_ty (26x) 112 ( 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); . } . } . }, 9,206 ( 0.00%) ExprKind::Binary(op, l, r) if op.node.is_comparison() => { 27,618 ( 0.00%) return is_infinite(cx, l).and(is_infinite(cx, r)).and(MaybeInfinite); 373,042 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/infinite_iter.rs:clippy_lints::infinite_iter::is_infinite (9,206x) . }, // TODO: ExprKind::Loop + Match . _ => (), . } . Finite . } 154,472 ( 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> { 2,422,280 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 10,866 ( 0.00%) if let Some(macro_call) = root_macro_call_first_node(cx, expr) 10,866 ( 0.00%) && is_format_macro(cx, macro_call.def_id) 462,036 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::is_format_macro (1,811x) 9,096 ( 0.00%) && let Some(format_args) = self.format_args.get(cx, expr, macro_call.expn) 7,753,292 ( 0.06%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:::get (1,137x) . { 7,400 ( 0.00%) let mut linter = FormatArgsExpr { . cx, . expr, . macro_call: ¯o_call, . format_args, 740 ( 0.00%) ignore_mixed: self.ignore_mixed, . msrv: &self.msrv, 740 ( 0.00%) ty_msrv_map: &self.ty_msrv_map, 740 ( 0.00%) has_derived_debug: &mut self.has_derived_debug, 740 ( 0.00%) has_pointer_format: &mut self.has_pointer_format, . }; . . linter.check_trailing_comma(); . linter.check_templates(); . 4,440 ( 0.00%) if self.msrv.meets(cx, msrvs::FORMAT_ARGS_CAPTURE) { 19,980 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (740x) . linter.check_uninlined_args(); . } . } 1,937,824 ( 0.02%) } . } . . 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 375 ---------------------------------------- . ty_msrv_map: &'a FxHashMap, Option>, . has_derived_debug: &'a mut FxHashMap, bool>, . has_pointer_format: &'a mut FxHashMap, bool>, . } . . impl<'tcx> FormatArgsExpr<'_, 'tcx> { . /// Check if there is a comma after the last format macro arg. . fn check_trailing_comma(&self) { 740 ( 0.00%) let span = self.macro_call.span; 5,180 ( 0.00%) if let Some(src) = span.get_text(self.cx) 740 ( 0.00%) && let Some(src) = src.strip_suffix([')', ']', '}']) 18,500 ( 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 (740x) . && let src = src.trim_end_matches(|c: char| c.is_whitespace() && c != '\n') . && let Some(src) = src.strip_suffix(',') . && let src = src.trim_end_matches(|c: char| c.is_whitespace() && c != '\n') 1 ( 0.00%) && !src.ends_with('\n') . { 12 ( 0.00%) span_lint_and_sugg( 1,466 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_sugg:: (1x) . self.cx, . UNNECESSARY_TRAILING_COMMA, . span.with_lo(span.lo() + BytePos::from_usize(src.len())) . .with_hi(span.hi() - BytePos(1)), . "unnecessary trailing comma", . "remove the trailing comma", . String::new(), . Applicability::MachineApplicable, . ); . } . } . . fn check_templates(&mut self) { 740 ( 0.00%) for piece in &self.format_args.template { 4,220 ( 0.00%) if let FormatArgsPiece::Placeholder(placeholder) = piece 1,010 ( 0.00%) && let Ok(index) = placeholder.argument.index 1,010 ( 0.00%) && let Some(arg) = self.format_args.arguments.all_args().get(index) 4,040 ( 0.00%) && let Some(arg_expr) = find_format_arg_expr(self.expr, arg) 1,572,651 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::find_format_arg_expr (1,010x) . { 1,010 ( 0.00%) self.check_unused_format_specifier(placeholder, arg_expr); 1,010 ( 0.00%) self.check_useless_format_width(placeholder); 4,040 ( 0.00%) self.check_useless_borrows_in_formatting(placeholder, arg_expr); 1,187,689 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/format_args.rs:::check_useless_borrows_in_formatting (1,010x) . . // Check width and precision arguments the same way as the value . for opt in [&placeholder.format_options.width, &placeholder.format_options.precision] { . if let Some(FormatCount::Argument(position)) = opt.as_ref() 7 ( 0.00%) && let Ok(pos_index) = position.index 7 ( 0.00%) && let Some(pos_arg) = self.format_args.arguments.all_args().get(pos_index) 28 ( 0.00%) && let Some(pos_arg_expr) = find_format_arg_expr(self.expr, pos_arg) 6,987 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::find_format_arg_expr (7x) . { 35 ( 0.00%) self.check_useless_borrows_in_formatting(placeholder, pos_arg_expr); 6,151 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/format_args.rs:::check_useless_borrows_in_formatting (7x) . } . } . 258 ( 0.00%) if placeholder.format_trait == Display 4,520 ( 0.00%) && placeholder.format_options == FormatOptions::default() 40,457 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/format.rs:::eq (904x) 897 ( 0.00%) && !self.is_aliased(index) . { 4,390 ( 0.00%) let name = self.cx.tcx.item_name(self.macro_call.def_id); 3,512 ( 0.00%) self.check_format_in_format_args(name, arg_expr); 1,756 ( 0.00%) self.check_to_string_in_format_args(name, arg_expr); . } . . if placeholder.format_trait == Debug { 415 ( 0.00%) let name = self.cx.tcx.item_name(self.macro_call.def_id); . self.check_unnecessary_debug_formatting(name, arg_expr); 249 ( 0.00%) if let Some(span) = placeholder.span 664 ( 0.00%) && self.has_pointer_debug(self.cx.typeck_results().expr_ty(arg_expr), 0) 1,676,033 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/format_args.rs:::has_pointer_debug (83x) 3,332 ( 0.00%) => ???:::expr_ty (83x) . { . span_lint(self.cx, POINTER_FORMAT, span, "pointer formatting detected"); . } . } . . if placeholder.format_trait == Pointer . && let Some(span) = placeholder.span . { . span_lint(self.cx, POINTER_FORMAT, span, "pointer formatting detected"); . } . } . } . } . 11,187 ( 0.00%) fn check_useless_borrows_in_formatting(&self, placeholder: &FormatPlaceholder, arg_expr: &Expr<'tcx>) { . // Updated while peeling: 1,017 ( 0.00%) let mut only_mutable = true; 1,017 ( 0.00%) let mut has_mutable = false; . 2,034 ( 0.00%) if !arg_expr.span.from_expansion() 2,034 ( 0.00%) && !is_from_proc_macro(self.cx, arg_expr) 6,326 ( 0.00%) && let Some(fmt_trait) = match placeholder.format_trait { . Display => self.cx.tcx.get_diagnostic_item(sym::Display), . Debug => self.cx.tcx.get_diagnostic_item(sym::Debug), . _ => None, . } 5,952 ( 0.00%) && let Some(sized_trait) = self.cx.tcx.lang_items().sized_trait() 39,680 ( 0.00%) => ???:::lang_items (992x) 9,920 ( 0.00%) && let peeled_expr = peel_hir_expr_while(arg_expr, |e| { 36,587 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::peel_hir_expr_while::<::check_useless_borrows_in_formatting::{closure#0}> (992x) . // Need to handle `&&&T` to `&T` when a single ref is still required 1,988 ( 0.00%) if let ExprKind::AddrOf(BorrowKind::Ref, m, e) = e.kind 3 ( 0.00%) && let ty = self.cx.typeck_results().expr_ty(e) 40 ( 0.00%) => ???:::expr_ty (1x) 9 ( 0.00%) && implements_trait(self.cx, ty, sized_trait, &[]) 3,747 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::implements_trait (1x) 9 ( 0.00%) && implements_trait(self.cx, ty, fmt_trait, &[]) 13,904 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::implements_trait (1x) . { 2 ( 0.00%) only_mutable = only_mutable && m == Mutability::Mut; 1 ( 0.00%) has_mutable = has_mutable || m == Mutability::Mut; . Some(e) . } else { . None . } . }) 992 ( 0.00%) && !std::ptr::eq(arg_expr, peeled_expr) 3 ( 0.00%) && let Some(peeled_snippet) = snippet_opt(self.cx, peeled_expr.span) . { 4 ( 0.00%) let name = self.cx.tcx.item_name(self.macro_call.def_id); 14 ( 0.00%) let message = if only_mutable { . "remove the redundant `&mut`" . } else if has_mutable { . "remove the redundant `&`/`&mut`" . } else { . "remove the redundant `&`" . }; 11 ( 0.00%) span_lint_and_sugg( 265,035 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_sugg:: (1x) . self.cx, . USELESS_BORROWS_IN_FORMATTING, . arg_expr.span, 3 ( 0.00%) format!("redundant reference in `{name}!` argument"), . message, 4 ( 0.00%) peeled_snippet, . Applicability::MachineApplicable, . ); . } 8,136 ( 0.00%) } . . fn check_unused_format_specifier(&self, placeholder: &FormatPlaceholder, arg: &Expr<'_>) { . let options = &placeholder.format_options; . 3,030 ( 0.00%) if let Some(placeholder_span) = placeholder.span 2,020 ( 0.00%) && *options != FormatOptions::default() 26 ( 0.00%) && let ty = self.cx.typeck_results().expr_ty(arg).peel_refs() 1,040 ( 0.00%) => ???:::expr_ty (26x) 2 ( 0.00%) && ty.is_lang_item(self.cx, LangItem::FormatArguments) . { . span_lint_and_then( . self.cx, . UNUSED_FORMAT_SPECS, . placeholder_span, . "format specifiers have no effect on `format_args!()`", . |diag| { . let mut suggest_format = |spec| { -- line 518 ---------------------------------------- -- line 549 ---------------------------------------- . }, . ); . } . } . . /// Lint when format width has no effect on the output because the format trait's . /// minimum output is larger (e.g. `{:#02X}` outputs "0x1" so width 2 has no effect). . fn check_useless_format_width(&self, placeholder: &FormatPlaceholder) { 5,119 ( 0.00%) let min_width = match placeholder.format_trait { . // 0x prefix, e.g. 0x1, 0o1, 0b1 59 ( 0.00%) LowerHex | UpperHex | Octal | Binary if placeholder.format_options.alternate => 4, . LowerExp | UpperExp | Pointer => 4, // e.g. 1e0 with exponent, 0x1 for pointer . _ => return, . }; 30 ( 0.00%) if let Some(FormatCount::Literal(width_value)) = placeholder.format_options.width . && width_value < min_width . && let Some(placeholder_span) = placeholder.span . { . span_lint_and_help( . self.cx, . UNUSED_FORMAT_SPECS, . placeholder_span, . "format width has no effect on the output for this format trait", . None, . format!("consider removing the width or increasing it to at least {min_width}"), . ); . } . } . . fn check_uninlined_args(&self) { 2,220 ( 0.00%) if self.format_args.span.from_expansion() { . return; . } 2,960 ( 0.00%) if self.macro_call.span.edition() < Edition2021 42,920 ( 0.00%) => ???:::edition (740x) . && (is_panic(self.cx, self.macro_call.def_id) || is_assert_macro(self.cx, self.macro_call.def_id)) . { . // panic!, assert!, and debug_assert! before 2021 edition considers a single string argument as . // non-format . return; . } . . let mut fixes = Vec::new(); . // If any of the arguments are referenced by an index number, . // and that argument is not a simple variable and cannot be inlined, . // we cannot remove any other arguments in the format string, . // because the index numbers might be wrong after inlining. . // Example of an un-inlinable format: print!("{}{1}", foo, 2) 8,140 ( 0.00%) for (pos, usage) in self.format_arg_positions() { 1,032 ( 0.00%) if !self.check_one_arg(pos, usage, &mut fixes) { . return; . } . } . 596 ( 0.00%) if fixes.is_empty() { . return; . } . . // multiline span display suggestion is sometimes broken: https://github.com/rust-lang/rust/pull/102729#discussion_r988704308 . // in those cases, make the code suggestion hidden . let multiline_fix = fixes . .iter() . .any(|(span, _)| self.cx.sess().source_map().is_multiline(*span)); -- line 610 ---------------------------------------- -- line 625 ---------------------------------------- . Applicability::MachineApplicable, . if multiline_fix { CompletelyHidden } else { ShowCode }, . ); . }, . ); . } . . fn check_one_arg(&self, pos: &FormatArgPosition, usage: FormatParamUsage, fixes: &mut Vec<(Span, String)>) -> bool { 930 ( 0.00%) let index = pos.index.unwrap(); 3,720 ( 0.00%) let arg = &self.format_args.arguments.all_args()[index]; . 1,860 ( 0.00%) if !matches!(arg.kind, FormatArgumentKind::Captured(_)) 592 ( 0.00%) && let rustc_ast::ExprKind::Path(None, path) = &arg.expr.kind 64 ( 0.00%) && let [segment] = path.segments.as_slice() 32 ( 0.00%) && segment.args.is_none() 128 ( 0.00%) && let Some(arg_span) = format_arg_removal_span(self.format_args, index) 4,952 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::format_arg_removal_span (32x) 96 ( 0.00%) && let Some(pos_span) = pos.span . { 64 ( 0.00%) let replacement = match usage { . FormatParamUsage::Argument => segment.ident.name.to_string(), . FormatParamUsage::Width => format!("{}$", segment.ident.name), . FormatParamUsage::Precision => format!(".{}$", segment.ident.name), . }; 192 ( 0.00%) fixes.push((pos_span, replacement)); 128 ( 0.00%) fixes.push((arg_span, String::new())); . true // successful inlining, continue checking . } else { . // Do not continue inlining (return false) in case . // * if we can't inline a numbered argument, e.g. `print!("{0} ...", foo.bar, ...)` . // * if allow_mixed_uninlined_format_args is false and this arg hasn't been inlined already . pos.kind != FormatArgPositionKind::Number 4,465 ( 0.00%) && (!self.ignore_mixed || matches!(arg.kind, FormatArgumentKind::Captured(_))) . } . } . . fn check_format_in_format_args(&self, name: Symbol, arg: &Expr<'_>) { . let expn_data = arg.span.ctxt().outer_expn_data(); 1,756 ( 0.00%) if expn_data.call_site.from_expansion() { . return; . } 3,512 ( 0.00%) let Some(mac_id) = expn_data.macro_def_id else { return }; 4,390 ( 0.00%) if !self.cx.tcx.is_diagnostic_item(sym::format_macro, mac_id) { 47,412 ( 0.00%) => ???:::is_diagnostic_item (878x) . return; . } . span_lint_and_then( . self.cx, . FORMAT_IN_FORMAT_ARGS, . self.macro_call.span, . format!("`format!` in `{name}!` args"), . |diag| { -- line 674 ---------------------------------------- -- line 677 ---------------------------------------- . )); . diag.help("or consider changing `format!` to `format_args!`"); . }, . ); . } . . fn check_to_string_in_format_args(&self, name: Symbol, value: &Expr<'_>) { . let cx = self.cx; 1,756 ( 0.00%) if !value.span.from_expansion() 112 ( 0.00%) && let ExprKind::MethodCall(_, receiver, [], to_string_span) = value.kind 70 ( 0.00%) && cx . .typeck_results() 105 ( 0.00%) .type_dependent_def_id(value.hir_id) 1,785 ( 0.00%) => ???:::type_dependent_def_id (35x) 35 ( 0.00%) .opt_parent(cx) . .is_diag_item(cx, sym::ToString) 9 ( 0.00%) && let receiver_ty = cx.typeck_results().expr_ty(receiver) 120 ( 0.00%) => ???:::expr_ty (3x) 15 ( 0.00%) && let Some(display_trait_id) = cx.tcx.get_diagnostic_item(sym::Display) 318 ( 0.00%) => ???:::get_diagnostic_item (3x) . && let (n_needed_derefs, target) = 10 ( 0.00%) count_needed_derefs(receiver_ty, cx.typeck_results().expr_adjustments(receiver).iter()) 129 ( 0.00%) => ???:::expr_adjustments (3x) 24 ( 0.00%) && implements_trait(cx, target, display_trait_id, &[]) 40,669 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::implements_trait (3x) 12 ( 0.00%) && let Some(sized_trait_id) = cx.tcx.lang_items().sized_trait() 120 ( 0.00%) => ???:::lang_items (3x) 36 ( 0.00%) && let Some(receiver_snippet) = receiver.span.source_callsite().get_text(cx) 1,509 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/source.rs:::get_text::<&rustc_lint::context::LateContext> (3x) 72 ( 0.00%) => ???:::source_callsite (3x) . { 24 ( 0.00%) let needs_ref = !implements_trait(cx, receiver_ty, sized_trait_id, &[]); 12,325 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::implements_trait (3x) 12 ( 0.00%) if n_needed_derefs == 0 && !needs_ref { 45 ( 0.00%) span_lint_and_sugg( 733,505 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_sugg:: (3x) . cx, . TO_STRING_IN_FORMAT_ARGS, 6 ( 0.00%) to_string_span.with_lo(receiver.span.source_callsite().hi()), 72 ( 0.00%) => ???:::source_callsite (3x) 12 ( 0.00%) format!("`to_string` applied to a type that implements `Display` in `{name}!` args"), . "remove this", . String::new(), . Applicability::MachineApplicable, . ); . } else { . span_lint_and_sugg( . cx, . TO_STRING_IN_FORMAT_ARGS, -- line 714 ---------------------------------------- -- line 722 ---------------------------------------- . ), . Applicability::MachineApplicable, . ); . } . } . } . . fn check_unnecessary_debug_formatting(&self, name: Symbol, value: &Expr<'tcx>) { 83 ( 0.00%) let cx = self.cx; 747 ( 0.00%) if !is_in_test(cx.tcx, value.hir_id) 410,241 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_in_test (83x) 166 ( 0.00%) && !value.span.from_expansion() 166 ( 0.00%) && !is_from_proc_macro(cx, value) 166 ( 0.00%) && let ty = cx.typeck_results().expr_ty(value) 3,332 ( 0.00%) => ???:::expr_ty (83x) . && self.can_display_format(ty) . { . // If the parent function is a method of `Debug`, we don't want to lint . // because it is likely that the user wants to use `Debug` formatting. . let parent_fn = cx.tcx.hir_get_parent_item(value.hir_id); . if let Some(trait_ref) = trait_ref_of_method(cx, parent_fn) . && let Some(trait_def_id) = trait_ref.trait_def_id() . && cx.tcx.is_diagnostic_item(sym::Debug, trait_def_id) -- line 742 ---------------------------------------- -- line 760 ---------------------------------------- . be removed", . ); . }, . ); . } . } . . fn format_arg_positions(&self) -> impl Iterator { 18,194 ( 0.00%) self.format_args.template.iter().flat_map(|piece| match piece { . FormatArgsPiece::Placeholder(placeholder) => { . let mut positions = ArrayVec::<_, 3>::new(); . . positions.push((&placeholder.argument, FormatParamUsage::Argument)); 20,626 ( 0.00%) if let Some(FormatCount::Argument(position)) = &placeholder.format_options.width { . positions.push((position, FormatParamUsage::Width)); . } 10,530 ( 0.00%) if let Some(FormatCount::Argument(position)) = &placeholder.format_options.precision { . positions.push((position, FormatParamUsage::Precision)); . } . 28,080 ( 0.00%) positions . }, . FormatArgsPiece::Literal(_) => ArrayVec::new(), . }) . } . . /// Returns true if the format argument at `index` is referred to by multiple format params . fn is_aliased(&self, index: usize) -> bool { . self.format_arg_positions() -- line 788 ---------------------------------------- -- line 789 ---------------------------------------- . .filter(|(position, _)| position.index == Ok(index)) . .at_most_one() . .is_err() . } . . fn can_display_format(&self, ty: Ty<'tcx>) -> bool { . let ty = ty.peel_refs(); . 83 ( 0.00%) if let Some(msrv) = self.ty_msrv_map.get(&ty) . && msrv.is_none_or(|msrv| self.msrv.meets(self.cx, msrv)) . { . return true; . } . . // Even if `ty` is not in `self.ty_msrv_map`, check whether `ty` implements `Deref` with . // a `Target` that is in `self.ty_msrv_map`. 332 ( 0.00%) if let Some(deref_trait_id) = self.cx.tcx.lang_items().deref_trait() 3,320 ( 0.00%) => ???:::lang_items (83x) 747 ( 0.00%) && implements_trait(self.cx, ty, deref_trait_id, &[]) 406,017 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::implements_trait (83x) 35 ( 0.00%) && let Some(target_ty) = self.cx.get_associated_type(ty, deref_trait_id, sym::Target) 99,030 ( 0.00%) => ???:::get_associated_type (5x) . && let Some(msrv) = self.ty_msrv_map.get(&target_ty) . && msrv.is_none_or(|msrv| self.msrv.meets(self.cx, msrv)) . { . return true; . } . . false . } . 3,250 ( 0.00%) fn has_pointer_debug(&mut self, ty: Ty<'tcx>, depth: usize) -> bool { 325 ( 0.00%) let cx = self.cx; 650 ( 0.00%) let tcx = cx.tcx; 650 ( 0.00%) if !tcx.recursion_limit().value_within_limit(depth) { 3,320 ( 0.00%) => ???:::recursion_limit (83x) . return false; . } 975 ( 0.00%) let depth = depth + 1; 975 ( 0.00%) let typing_env = cx.typing_env(); 2,490 ( 0.00%) => ???:::typing_env (83x) 325 ( 0.00%) let ty = tcx.normalize_erasing_regions(typing_env, Unnormalized::new_wip(ty)); 2,510 ( 0.00%) match ty.kind() { . ty::RawPtr(..) | ty::FnPtr(..) | ty::FnDef(..) => true, 204 ( 0.00%) ty::Ref(_, t, _) | ty::Slice(t) | ty::Array(t, _) => self.has_pointer_debug(*t, depth), 813,956 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/format_args.rs:::has_pointer_debug'2 (36x) . ty::Tuple(ts) => ts.iter().any(|t| self.has_pointer_debug(t, depth)), . ty::Adt(adt, args) => { 243 ( 0.00%) match self.has_pointer_format.entry(ty) { 149 ( 0.00%) Entry::Occupied(o) => return *o.get(), . Entry::Vacant(v) => v.insert(false), . }; 94 ( 0.00%) let derived_debug = if let Some(&known) = self.has_derived_debug.get(&ty) { . known . } else { 470 ( 0.00%) let Some(trait_id) = tcx.get_diagnostic_item(sym::Debug) else { 1,590 ( 0.00%) => ???:::get_diagnostic_item (15x) . return false; . }; 658 ( 0.00%) let (infcx, param_env) = tcx.infer_ctxt().build_with_typing_env(typing_env); 1,875 ( 0.00%) => ???:0x0000000000173dc0 (15x) 1,680 ( 0.00%) => ???:::build_with_typing_env (15x) 564 ( 0.00%) let trait_ref = TraitRef::new(tcx, trait_id, [GenericArg::from(ty)]); 1,755 ( 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/predicate.rs:>::new::<[rustc_middle::ty::Ty; 1]> (15x) 564 ( 0.00%) let obligation = Obligation { . cause: ObligationCause::dummy(), . param_env, . recursion_depth: 0, . predicate: trait_ref.upcast(tcx), . }; 188 ( 0.00%) let selection = SelectionContext::new(&infcx).select(&obligation); 244,548 ( 0.00%) => ???:::select (15x) 255 ( 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:: (15x) 752 ( 0.00%) let derived = if let Ok(Some(Selection::UserDefined(data))) = selection { 516 ( 0.00%) find_attr!(tcx, data.impl_def_id, AutomaticallyDerived) 10,419 ( 0.00%) => ???:>::get_attrs (15x) . } else { . false . }; 94 ( 0.00%) self.has_derived_debug.insert(ty, derived); . derived 470 ( 0.00%) }; 5,127 ( 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:: (15x) 188 ( 0.00%) let pointer_debug = derived_debug 120 ( 0.00%) && adt.all_fields().any(|f| { 2,292 ( 0.00%) self.has_pointer_debug(tcx.normalize_erasing_regions(typing_env, f.ty(tcx, args)), depth) 1,135,632 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/format_args.rs:::has_pointer_debug'2 (149x) 10,553 ( 0.00%) => ???:::ty (149x) . }); 94 ( 0.00%) self.has_pointer_format.insert(ty, pointer_debug); . pointer_debug 94 ( 0.00%) }, . _ => false, . } 2,600 ( 0.00%) } . } . . 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| { 372,815 ( 0.00%) => ???:::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>) . where . I: Iterator>, . { . let mut n_total = 0; . let mut n_needed = 0; . loop { 5 ( 0.00%) if let Some(Adjustment { . kind: Adjust::Deref(deref), . target, 10 ( 0.00%) }) = iter.next() . { . n_total += 1; 6 ( 0.00%) if let DerefAdjustKind::Overloaded(..) = deref { . n_needed = n_total; . } . ty = *target; . } else { . return (n_needed, ty); . } . } . } -- line 903 ---------------------------------------- 22,374 ( 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/result.rs -------------------------------------------------------------------------------- Ir -- line 587 ---------------------------------------- . /// let x: Result = Err("Some error message"); . /// assert_eq!(x.is_ok(), false); . /// ``` . #[must_use = "if you intended to assert that this is ok, consider `.unwrap()` instead"] . #[rustc_const_stable(feature = "const_result_basics", since = "1.48.0")] . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . pub const fn is_ok(&self) -> bool { 59 ( 0.00%) matches!(*self, Ok(_)) . } . . /// Returns `true` if the result is [`Ok`] and the value inside of it matches a predicate. . /// . /// # Examples . /// . /// ``` . /// let x: Result = Ok(2); -- line 603 ---------------------------------------- -- line 618 ---------------------------------------- . #[stable(feature = "is_some_and", since = "1.70.0")] . #[rustc_const_unstable(feature = "const_result_trait_fn", issue = "144211")] . pub const fn is_ok_and(self, f: F) -> bool . where . F: [const] FnOnce(T) -> bool + [const] Destruct, . T: [const] Destruct, . E: [const] Destruct, . { 7,674 ( 0.00%) match self { . Err(_) => false, . Ok(x) => f(x), . } . } . . /// Returns `true` if the result is [`Err`]. . /// . /// # Examples -- line 634 ---------------------------------------- -- line 706 ---------------------------------------- . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_result_trait_fn", issue = "144211")] . #[rustc_diagnostic_item = "result_ok_method"] . pub const fn ok(self) -> Option . where . T: [const] Destruct, . E: [const] Destruct, . { 42,219 ( 0.00%) match self { 41,325 ( 0.00%) Ok(x) => Some(x), . Err(_) => None, . } . } . . /// Converts from `Result` to [`Option`]. . /// . /// Converts `self` into an [`Option`], consuming `self`, . /// and discarding the success value, if any. -- line 723 ---------------------------------------- -- line 828 ---------------------------------------- . /// ``` . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_result_trait_fn", issue = "144211")] . pub const fn map(self, op: F) -> Result . where . F: [const] FnOnce(T) -> U + [const] Destruct, . { 2,386 ( 0.00%) match self { 1,251 ( 0.00%) Ok(t) => Ok(op(t)), . Err(e) => Err(e), . } . } . . /// Returns the provided default (if [`Err`]), or . /// applies a function to the contained value (if [`Ok`]). . /// . /// Arguments passed to `map_or` are eagerly evaluated; if you are passing -- line 845 ---------------------------------------- -- line 863 ---------------------------------------- . #[must_use = "if you don't need the returned value, use `if let` instead"] . pub const fn map_or(self, default: U, f: F) -> U . where . F: [const] FnOnce(T) -> U + [const] Destruct, . T: [const] Destruct, . E: [const] Destruct, . U: [const] Destruct, . { 34 ( 0.00%) match self { 30 ( 0.00%) Ok(t) => f(t), . Err(_) => default, . } . } . . /// Maps a `Result` to `U` by applying fallback function `default` to . /// a contained [`Err`] value, or function `f` to a contained [`Ok`] value. . /// . /// This function can be used to unpack a successful result -- line 880 ---------------------------------------- -- line 957 ---------------------------------------- . /// ``` . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_result_trait_fn", issue = "144211")] . pub const fn map_err(self, op: O) -> Result . where . O: [const] FnOnce(E) -> F + [const] Destruct, . { 120,810 ( 0.00%) match self { 116,320 ( 0.00%) Ok(t) => Ok(t), . Err(e) => Err(op(e)), . } . } . . /// Calls a function with a reference to the contained value if [`Ok`]. . /// . /// Returns the original result. . /// -- line 974 ---------------------------------------- -- line 1174 ---------------------------------------- . /// [`std::error`](../../std/error/index.html) module docs. . #[inline] . #[track_caller] . #[stable(feature = "result_expect", since = "1.4.0")] . pub fn expect(self, msg: &str) -> T . where . E: fmt::Debug, . { 31,136 ( 0.00%) match self { . Ok(t) => t, . Err(e) => unwrap_failed(msg, &e), . } . } . . /// Returns the contained [`Ok`] value, consuming the `self` value. . /// . /// Because this function may panic, its use is generally discouraged. -- line 1190 ---------------------------------------- -- line 1222 ---------------------------------------- . /// ``` . #[inline(always)] . #[track_caller] . #[stable(feature = "rust1", since = "1.0.0")] . pub fn unwrap(self) -> T . where . E: fmt::Debug, . { 5,426 ( 0.00%) match self { 154 ( 0.00%) Ok(t) => t, . Err(e) => unwrap_failed("called `Result::unwrap()` on an `Err` value", &e), . } . } . . /// Returns the contained [`Ok`] value or a default . /// . /// Consumes the `self` argument then, if [`Ok`], returns the contained . /// value, otherwise if [`Err`], returns the default value for that -- line 1239 ---------------------------------------- -- line 1586 ---------------------------------------- . #[inline] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_result_trait_fn", issue = "144211")] . pub const fn unwrap_or(self, default: T) -> T . where . T: [const] Destruct, . E: [const] Destruct, . { 894 ( 0.00%) match self { . Ok(t) => t, . Err(_) => default, . } . } . . /// Returns the contained [`Ok`] value or computes it from a closure. . /// . /// -- line 1602 ---------------------------------------- -- line 1612 ---------------------------------------- . #[track_caller] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_result_trait_fn", issue = "144211")] . pub const fn unwrap_or_else(self, op: F) -> T . where . F: [const] FnOnce(E) -> T + [const] Destruct, . { . match self { 217,067 ( 0.00%) Ok(t) => t, . Err(e) => op(e), . } . } . . /// Returns the contained [`Ok`] value, consuming the `self` value, . /// without checking that the value is not an [`Err`]. . /// . /// # Safety -- line 1628 ---------------------------------------- -- line 1643 ---------------------------------------- . /// unsafe { x.unwrap_unchecked() }; // Undefined behavior! . /// ``` . #[inline] . #[track_caller] . #[stable(feature = "option_result_unwrap_unchecked", since = "1.58.0")] . #[rustc_const_unstable(feature = "const_result_unwrap_unchecked", issue = "148714")] . pub const unsafe fn unwrap_unchecked(self) -> T { . match self { 4 ( 0.00%) Ok(t) => t, . Err(e) => { . // FIXME(const-hack): to avoid E: const Destruct bound . super::mem::forget(e); . // SAFETY: the safety contract must be upheld by the caller. . unsafe { hint::unreachable_unchecked() } . } . } . } -- line 1659 ---------------------------------------- -- line 1714 ---------------------------------------- . #[rustc_allow_const_fn_unstable(const_precise_live_drops)] . pub const fn copied(self) -> Result . where . T: Copy, . { . // FIXME(const-hack): this implementation, which sidesteps using `Result::map` since it's not const . // ready yet, should be reverted when possible to avoid code repetition . match self { 27,198 ( 0.00%) Ok(&v) => Ok(v), . Err(e) => Err(e), . } . } . . /// Maps a `Result<&T, E>` to a `Result` by cloning the contents of the . /// `Ok` part. . /// . /// # Examples -- line 1730 ---------------------------------------- -- line 2169 ---------------------------------------- . . #[inline] . fn from_output(output: Self::Output) -> Self { . Ok(output) . } . . #[inline] . fn branch(self) -> ControlFlow { 116,712 ( 0.00%) match self { 39,793 ( 0.00%) Ok(v) => ControlFlow::Continue(v), 14 ( 0.00%) Err(e) => ControlFlow::Break(Err(e)), . } . } . } . . #[unstable(feature = "try_trait_v2", issue = "84277", old_name = "try_trait")] . #[rustc_const_unstable(feature = "const_try", issue = "74935")] . const impl> ops::FromResidual> . for Result -- line 2187 ---------------------------------------- 211,453 ( 0.00%) -------------------------------------------------------------------------------- -- 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 { 2,180,052 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 485,518 ( 0.00%) if let ExprKind::Cast(cast_from_expr, cast_to_hir) = expr.kind { 1,593 ( 0.00%) if expr.span.in_external_macro(cx.sess().source_map()) { . return; . } 2,235 ( 0.00%) if is_hir_ty_cfg_dependant(cx, cast_to_hir) { 6,087 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_hir_ty_cfg_dependant (447x) . return; . } . let (cast_from, cast_to) = ( 2,235 ( 0.00%) cx.typeck_results().expr_ty(cast_from_expr), 17,916 ( 0.00%) => ???:::expr_ty (447x) 1,788 ( 0.00%) cx.typeck_results().expr_ty(expr), 17,944 ( 0.00%) => ???:::expr_ty (447x) . ); . 2,832 ( 0.00%) if !expr.span.from_expansion() && unnecessary_cast::check(cx, expr, cast_from_expr, cast_from, cast_to) { 397,303 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/unnecessary_cast.rs:clippy_lints::casts::unnecessary_cast::check (354x) . return; . } 2,682 ( 0.00%) char_lit_as_u8::check(cx, expr, cast_from_expr, cast_to); 5,811 ( 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 (447x) 3,129 ( 0.00%) cast_slice_from_raw_parts::check(cx, expr, cast_from_expr, cast_to, self.msrv); 8,062 ( 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 (447x) . cast_ptr_alignment::check(cx, expr, cast_from, cast_to); 3,129 ( 0.00%) ptr_cast_constness::check(cx, expr, cast_from_expr, cast_from, cast_to, self.msrv); 7,609 ( 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 (447x) 5,364 ( 0.00%) ptr_as_ptr::check(cx, expr, cast_from_expr, cast_from, cast_to_hir, cast_to, self.msrv); 17,711 ( 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 (447x) . as_ptr_cast_mut::check(cx, expr, cast_from_expr, cast_to); 3,576 ( 0.00%) confusing_method_to_numeric_cast::check(cx, expr, cast_from_expr, cast_from, cast_to); 11,622 ( 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 (447x) . zero_ptr::check(cx, expr, cast_from_expr, cast_to_hir, self.msrv); . 2,682 ( 0.00%) if self.msrv.meets(cx, msrvs::MANUAL_DANGLING_PTR) { 14,304 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (447x) 2,235 ( 0.00%) manual_dangling_ptr::check(cx, expr, cast_from_expr, cast_to_hir); 8,754 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/manual_dangling_ptr.rs:clippy_lints::casts::manual_dangling_ptr::check (447x) . } . . if cast_to.is_numeric() { 3,094 ( 0.00%) cast_possible_truncation::check(cx, expr, cast_from_expr, cast_from, cast_to, cast_to_hir.span); 590,273 ( 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 (442x) . if cast_from.is_numeric() { 3,368 ( 0.00%) cast_possible_wrap::check(cx, expr, cast_from_expr, cast_from, cast_to, self.msrv); 219,706 ( 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 (421x) 3,789 ( 0.00%) cast_precision_loss::check(cx, expr, cast_from, cast_to); 33,917 ( 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 (421x) . cast_sign_loss::check(cx, expr, cast_from_expr, cast_from, cast_to, self.msrv); 2,947 ( 0.00%) cast_abs_to_unsigned::check(cx, expr, cast_from_expr, cast_from, cast_to, self.msrv); 8,371 ( 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 (421x) 2,526 ( 0.00%) cast_nan_to_int::check(cx, expr, cast_from_expr, cast_from, cast_to); 8,420 ( 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 (421x) . } 4,420 ( 0.00%) cast_lossless::check(cx, expr, cast_from_expr, cast_from, cast_to, cast_to_hir, self.msrv); 540,412 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/cast_lossless.rs:clippy_lints::casts::cast_lossless::check (442x) . cast_enum_constructor::check(cx, expr, cast_from_expr, cast_from); 2,652 ( 0.00%) fn_to_numeric_cast_any::check(cx, expr, cast_from_expr, cast_from, cast_to); 8,840 ( 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 (442x) 2,652 ( 0.00%) fn_to_numeric_cast::check(cx, expr, cast_from_expr, cast_from, cast_to); 12,649 ( 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 (442x) 2,652 ( 0.00%) fn_to_numeric_cast_with_truncation::check(cx, expr, cast_from_expr, cast_from, cast_to); 12,906 ( 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 (442x) . } . . as_underscore::check(cx, expr, cast_to_hir); 1,788 ( 0.00%) as_pointer_underscore::check(cx, cast_to, cast_to_hir); 4,479 ( 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 (447x) . 3,129 ( 0.00%) let was_borrow_as_ptr_emitted = self.msrv.meets(cx, msrvs::BORROW_AS_PTR) 12,069 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (447x) 3,129 ( 0.00%) && borrow_as_ptr::check(cx, expr, cast_from_expr, cast_to_hir, self.msrv); 8,061 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/borrow_as_ptr.rs:clippy_lints::casts::borrow_as_ptr::check (447x) 4,023 ( 0.00%) if !was_borrow_as_ptr_emitted && self.msrv.meets(cx, msrvs::PTR_FROM_REF) { 12,069 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (447x) 1,341 ( 0.00%) ref_as_ptr::check(cx, expr, cast_from_expr, cast_to_hir); . } . } . 1,695,008 ( 0.01%) if self.msrv.meets(cx, msrvs::RAW_REF_OP) { 6,537,888 ( 0.05%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (242,144x) 726,432 ( 0.01%) borrow_as_ptr::check_implicit_cast(cx, expr); 5,337,212 ( 0.04%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/borrow_as_ptr.rs:clippy_lints::casts::borrow_as_ptr::check_implicit_cast (242,144x) . } 1,452,864 ( 0.01%) if self.msrv.meets(cx, msrvs::PTR_SLICE_RAW_PARTS) { 6,537,888 ( 0.05%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (242,144x) 726,432 ( 0.01%) cast_slice_from_raw_parts::check_implicit_cast(cx, expr); 7,339,103 ( 0.06%) => /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_implicit_cast (242,144x) . } 726,432 ( 0.01%) cast_ptr_alignment::check_cast_method(cx, expr); 3,199,879 ( 0.03%) => /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 (242,144x) 968,576 ( 0.01%) cast_slice_different_sizes::check(cx, expr, self.msrv); 44,430,445 ( 0.37%) => /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 (242,144x) 726,432 ( 0.01%) ptr_cast_constness::check_null_ptr_cast_method(cx, expr); 3,685,339 ( 0.03%) => /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 (242,144x) 1,937,824 ( 0.02%) } . . fn check_body(&mut self, cx: &LateContext<'tcx>, body: &rustc_hir::Body<'tcx>) { 18,612 ( 0.00%) needless_type_cast::check(cx, body); 13,771,327 ( 0.11%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/needless_type_cast.rs:clippy_lints::casts::needless_type_cast::check (6,204x) . } . } 5,422 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs -------------------------------------------------------------------------------- Ir -- line 47 ---------------------------------------- . cx.typeck_results . .filter(|results| results.hir_owner == hir_ty.hir_id.owner) . .and_then(|results| results.node_type_opt(hir_ty.hir_id)) . .unwrap_or_else(|| lower_ty(cx.tcx, hir_ty)) . } . . /// Checks if the given type implements copy. . pub fn is_copy<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool { 1,498 ( 0.00%) cx.type_is_copy_modulo_regions(ty) 144,855 ( 0.00%) => ???:::type_is_copy_modulo_regions (27x) . } . . /// This checks whether a given type is known to implement Debug. . pub fn has_debug_impl<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool { . cx.tcx . .get_diagnostic_item(sym::Debug) . .is_some_and(|debug| implements_trait(cx, ty, debug, &[])) . } -- line 63 ---------------------------------------- -- line 73 ---------------------------------------- . .all_fields() . .any(|f| !is_copy(cx, f.ty(cx.tcx, subs).skip_norm_wip())), . _ => true, . } . } . . /// Walks into `ty` and returns `true` if any inner type is an instance of the given adt . /// constructor. 1,806 ( 0.00%) pub fn contains_adt_constructor<'tcx>(ty: Ty<'tcx>, adt: AdtDef<'tcx>) -> bool { 602 ( 0.00%) ty.walk().any(|inner| match inner.kind() { 2,107 ( 0.00%) => ???:::walk (301x) . GenericArgKind::Type(inner_ty) => inner_ty.ty_adt_def() == Some(adt), . GenericArgKind::Lifetime(_) | GenericArgKind::Const(_) => false, . }) 1,204 ( 0.00%) } . . /// Walks into `ty` and returns `true` if any inner type is an instance of the given type, or adt . /// constructor of the same type. . /// . /// This method also recurses into opaque type predicates, so call it with `impl Trait` and `U` . /// will also return `true`. 30 ( 0.00%) pub fn contains_ty_adt_constructor_opaque<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>, needle: Ty<'tcx>) -> bool { 165 ( 0.00%) fn contains_ty_adt_constructor_opaque_inner<'tcx>( . cx: &LateContext<'tcx>, . ty: Ty<'tcx>, . needle: Ty<'tcx>, . seen: &mut FxHashSet, . ) -> bool { 15 ( 0.00%) ty.walk().any(|inner| match inner.kind() { 105 ( 0.00%) => ???:::walk (15x) . GenericArgKind::Type(inner_ty) => { 30 ( 0.00%) if inner_ty == needle { . return true; . } . 15 ( 0.00%) if inner_ty.ty_adt_def() == needle.ty_adt_def() { . return true; . } . . if let ty::Alias( . _, . AliasTy { . kind: ty::Opaque { def_id }, . .. -- line 114 ---------------------------------------- -- line 151 ---------------------------------------- . } . } . } . . false . }, . GenericArgKind::Lifetime(_) | GenericArgKind::Const(_) => false, . }) 135 ( 0.00%) } . . // A hash set to ensure that the same opaque type (`impl Trait` in RPIT or TAIT) is not . // visited twice. . let mut seen = FxHashSet::default(); 15 ( 0.00%) contains_ty_adt_constructor_opaque_inner(cx, ty, needle, &mut seen) 6,356 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::contains_ty_adt_constructor_opaque::contains_ty_adt_constructor_opaque_inner (15x) 45 ( 0.00%) } . . /// Resolves `::Item` for `T` . /// Do not invoke without first verifying that the type implements `Iterator` 135 ( 0.00%) pub fn get_iterator_item_ty<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option> { 27 ( 0.00%) cx.tcx 54 ( 0.00%) .get_diagnostic_item(sym::Iterator) 2,862 ( 0.00%) => ???:::get_diagnostic_item (27x) 216 ( 0.00%) .and_then(|iter_did| cx.get_associated_type(ty, iter_did, sym::Item)) 1,043,235 ( 0.01%) => ???:::get_associated_type (27x) . } . . /// Returns true if `ty` is a type on which calling `Clone` through a function instead of . /// as a method, such as `Arc::clone()` is considered idiomatic. . /// . /// Lints should avoid suggesting to replace instances of `ty::Clone()` by `.clone()` for objects . /// of those types. . pub fn should_call_clone_as_function(cx: &LateContext<'_>, ty: Ty<'_>) -> bool { . matches!( . ty.opt_diag_name(cx), . Some(sym::Arc | sym::ArcWeak | sym::Rc | sym::RcWeak) . ) . } . . /// If `ty` is known to have a `iter` or `iter_mut` method, returns a symbol representing the type. 20 ( 0.00%) pub fn has_iter_method(cx: &LateContext<'_>, probably_ref_ty: Ty<'_>) -> Option { . // FIXME: instead of this hard-coded list, we should check if `::iter` . // exists and has the desired signature. Unfortunately FnCtxt is not exported . // so we can't use its `lookup_method` method. . let into_iter_collections: &[Symbol] = &[ . sym::Vec, . sym::Option, . sym::Result, . sym::BTreeMap, -- line 196 ---------------------------------------- -- line 201 ---------------------------------------- . sym::HashSet, . sym::HashMap, . sym::PathBuf, . sym::Path, . sym::MpscReceiver, . sym::MpmcReceiver, . ]; . 8 ( 0.00%) let ty_to_check = match probably_ref_ty.kind() { . ty::Ref(_, ty_to_check, _) => *ty_to_check, . _ => probably_ref_ty, . }; . 20 ( 0.00%) let def_id = match ty_to_check.kind() { . ty::Array(..) => return Some(sym::array), . ty::Slice(..) => return Some(sym::slice), 2 ( 0.00%) ty::Adt(adt, _) => adt.did(), . _ => return None, . }; . . for &name in into_iter_collections { 105 ( 0.00%) if cx.tcx.is_diagnostic_item(name, def_id) { 859 ( 0.00%) => ???:::is_diagnostic_item (15x) . return Some(cx.tcx.item_name(def_id)); . } . } . None 28 ( 0.00%) } . . /// Checks whether a type implements a trait. . /// The function returns false in case the type contains an inference variable. . /// . /// See [Common tools for writing lints] for an example how to use this function and other options. . /// . /// [Common tools for writing lints]: https://github.com/rust-lang/rust-clippy/blob/master/book/src/development/common_tools_writing_lints.md#checking-if-a-type-implements-a-specific-trait 21,125 ( 0.00%) pub fn implements_trait<'tcx>( . cx: &LateContext<'tcx>, . ty: Ty<'tcx>, . trait_id: DefId, . args: &[GenericArg<'tcx>], . ) -> bool { . implements_trait_with_env_from_iter( 3,250 ( 0.00%) cx.tcx, 1,625 ( 0.00%) cx.typing_env(), 47,616 ( 0.00%) => ???:::typing_env (1,625x) . ty, . trait_id, . None, . args.iter().map(|&x| Some(x)), . ) 13,000 ( 0.00%) } . . /// Same as `implements_trait` but allows using a `ParamEnv` different from the lint context. . /// . /// The `callee_id` argument is used to determine whether this is a function call in a `const fn` . /// environment, used for checking const traits. 6,531 ( 0.00%) pub fn implements_trait_with_env<'tcx>( . tcx: TyCtxt<'tcx>, . typing_env: ty::TypingEnv<'tcx>, . ty: Ty<'tcx>, . trait_id: DefId, . callee_id: Option, . args: &[GenericArg<'tcx>], . ) -> bool { . implements_trait_with_env_from_iter(tcx, typing_env, ty, trait_id, callee_id, args.iter().map(|&x| Some(x))) 7,464 ( 0.00%) } . . /// Same as `implements_trait_from_env` but takes the arguments as an iterator. . pub fn implements_trait_with_env_from_iter<'tcx>( . tcx: TyCtxt<'tcx>, . typing_env: ty::TypingEnv<'tcx>, . ty: Ty<'tcx>, . trait_id: DefId, . callee_id: Option, . args: impl IntoIterator>>>, . ) -> bool { . // Clippy shouldn't have infer types 2,558 ( 0.00%) assert!(!ty.has_infer()); . . // If a `callee_id` is passed, then we assert that it is a body owner . // through calling `body_owner_kind`, which would panic if the callee . // does not have a body. 1,866 ( 0.00%) if let Some(callee_id) = callee_id { 2,610 ( 0.00%) let _ = tcx.hir_body_owner_kind(callee_id); 86,825 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_middle/src/hir/map.rs:::hir_body_owner_kind:: (870x) . } . . let ty = tcx.erase_and_anonymize_regions(ty); 2,558 ( 0.00%) if ty.has_escaping_bound_vars() { . return false; . } . 19,772 ( 0.00%) let (infcx, param_env) = tcx.infer_ctxt().build_with_typing_env(typing_env); 116,625 ( 0.00%) => ???:0x0000000000173dc0 (933x) 104,496 ( 0.00%) => ???:::build_with_typing_env (933x) . let args = args . .into_iter() . .map(|arg| arg.into().unwrap_or_else(|| infcx.next_ty_var(DUMMY_SP).into())) . .collect::>(); . . let trait_ref = TraitRef::new(tcx, trait_id, [GenericArg::from(ty)].into_iter().chain(args)); . . debug_assert_matches!( . tcx.def_kind(trait_id), . DefKind::Trait | DefKind::TraitAlias, . "`DefId` must belong to a trait or trait alias" . ); . #[cfg(debug_assertions)] . assert_generic_args_match(tcx, trait_id, trait_ref.args); . 22,089 ( 0.00%) let obligation = Obligation { . cause: ObligationCause::dummy(), . param_env, . recursion_depth: 0, . predicate: trait_ref.upcast(tcx), . }; . infcx 2,558 ( 0.00%) .evaluate_obligation(&obligation) 6,157,076 ( 0.05%) => ???:::evaluate_obligation (933x) . .is_ok_and(EvaluationResult::must_apply_modulo_regions) 2,558 ( 0.00%) } 233,250 ( 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:: (933x) . . /// Checks whether this type implements `Drop`. . pub fn has_drop<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool { . match ty.ty_adt_def() { 27 ( 0.00%) Some(def) => def.has_dtor(cx.tcx), 4,127 ( 0.00%) => ???:::has_dtor (9x) . None => false, . } . } . . /// Returns whether the `ty` has `#[must_use]` attribute, or acts like it does according to the . /// compiler determination. For example, if `ty` is a `Result`/`ControlFlow` whose `Err`/`Break` . /// payload is an uninhabited type, the `Ok`/`Continue` payload type will be used instead. . /// . /// The [`MustUsePath`] can be used to describe the type through [`describe_must_use_type`]. 1,926 ( 0.00%) pub fn opt_must_use_path<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option { . // `is_ty_must_use` requires an expression, whose `hir_id` will be used to determine whether . // certain types are visibly uninhabited from the module containing the expression. . // `cx.last_node_with_lint_attrs` is initialized to the crate/module `hir_id` when linting . // a new crate/module. If it is overriden, it is with an `hir_id` pertaining to the same . // create/module. We can use this in a dummy expression instead of asking all callers . // to provide a local `hir_id` which would not add more information. 3,852 ( 0.00%) let dummy_expr = Expr { 642 ( 0.00%) hir_id: cx.last_node_with_lint_attrs, . span: DUMMY_SP, . kind: ExprKind::Ret(None), . }; 1,926 ( 0.00%) match is_ty_must_use(cx, ty, &dummy_expr) { 2,981,693 ( 0.02%) => ???:rustc_lint::unused::must_use::is_ty_must_use (642x) 124 ( 0.00%) IsTyMustUse::Yes(path) => Some(path), 611 ( 0.00%) _ => None, . } 2,568 ( 0.00%) } . . /// Describe a [`MustUsePath`] returned by [`opt_must_use_path`]. . pub fn describe_must_use_type(cx: &LateContext<'_>, path: &MustUsePath) -> String { . describe_must_use_type_inner(cx, path, "", "", 1) . } . . // This is a rip-off from the compiler's `rustc_lint/src/unused/must_use.rs` . fn describe_must_use_type_inner( -- line 354 ---------------------------------------- -- line 432 ---------------------------------------- . } . . /// Returns `true` if the given type is a non aggregate primitive (a `bool` or `char`, any . /// integer or floating-point number type). . /// . /// For checking aggregation of primitive types (e.g. tuples and slices of primitive type) see . /// `is_recursively_primitive_type` . pub fn is_non_aggregate_primitive_type(ty: Ty<'_>) -> bool { 10 ( 0.00%) matches!(ty.kind(), ty::Bool | ty::Char | ty::Int(_) | ty::Uint(_) | ty::Float(_)) . } . . /// Returns `true` if the given type is a primitive (a `bool` or `char`, any integer or . /// floating-point number type, a `str`, or an array, slice, or tuple of those types). . pub fn is_recursively_primitive_type(ty: Ty<'_>) -> bool { . match *ty.kind() { . ty::Bool | ty::Char | ty::Int(_) | ty::Uint(_) | ty::Float(_) | ty::Str => true, . ty::Ref(_, inner, _) if inner.is_str() => true, -- line 448 ---------------------------------------- -- line 449 ---------------------------------------- . ty::Array(inner_type, _) | ty::Slice(inner_type) => is_recursively_primitive_type(inner_type), . ty::Tuple(inner_types) => inner_types.iter().all(is_recursively_primitive_type), . _ => false, . } . } . . /// Return `true` if the passed `typ` is `isize` or `usize`. . pub fn is_isize_or_usize(typ: Ty<'_>) -> bool { 3,244 ( 0.00%) matches!(typ.kind(), ty::Int(IntTy::Isize) | ty::Uint(UintTy::Usize)) . } . . /// Checks if the drop order for a type matters. . /// . /// Some std types implement drop solely to deallocate memory. For these types, and composites . /// containing them, changing the drop order won't result in any observable side effects. 862 ( 0.00%) pub fn needs_ordered_drop<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool { 13,350 ( 0.00%) fn needs_ordered_drop_inner<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>, seen: &mut FxHashSet>) -> bool { 2,670 ( 0.00%) if !seen.insert(ty) { . return false; . } 3,306 ( 0.00%) if !ty.has_significant_drop(cx.tcx, cx.typing_env()) { 12,930 ( 0.00%) => ???:::typing_env (431x) . false . } . // Check for std types which implement drop, but only for memory allocation. 23 ( 0.00%) else if ty.is_lang_item(cx, LangItem::OwnedBox) 112 ( 0.00%) || matches!( . ty.opt_diag_name(cx), . Some(sym::HashSet | sym::Rc | sym::Arc | sym::cstring_type | sym::RcWeak | sym::ArcWeak) . ) . { . // Check all of the generic arguments. . if let ty::Adt(_, subs) = ty.kind() { 9 ( 0.00%) subs.types().any(|ty| needs_ordered_drop_inner(cx, ty, seen)) 82,411 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::needs_ordered_drop::needs_ordered_drop_inner'2 (3x) . } else { . true . } 104 ( 0.00%) } else if !cx . .tcx 104 ( 0.00%) .lang_items() 1,680 ( 0.00%) => ???:::lang_items (42x) . .drop_trait() 364 ( 0.00%) .is_some_and(|id| implements_trait(cx, ty, id, &[])) 92,365 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::implements_trait (42x) . { . // This type doesn't implement drop, so no side effects here. . // Check if any component type has any. 278 ( 0.00%) match ty.kind() { 4 ( 0.00%) ty::Tuple(fields) => fields.iter().any(|ty| needs_ordered_drop_inner(cx, ty, seen)), 166,935 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::needs_ordered_drop::needs_ordered_drop_inner'2 (1x) . ty::Array(ty, _) => needs_ordered_drop_inner(cx, *ty, seen), 9 ( 0.00%) ty::Adt(adt, subs) => adt . .all_fields() 3,600 ( 0.00%) .map(|f| f.ty(cx.tcx, subs).skip_norm_wip()) 61,592 ( 0.00%) => ???:::ty (892x) 2,700 ( 0.00%) .any(|ty| needs_ordered_drop_inner(cx, ty, seen)), 764,606 ( 0.01%) => site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::needs_ordered_drop::needs_ordered_drop_inner'2 (892x) . _ => true, . } . } else { . true . } 10,680 ( 0.00%) } . 431 ( 0.00%) needs_ordered_drop_inner(cx, ty, &mut FxHashSet::default()) 9,966,379 ( 0.08%) => site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::needs_ordered_drop::needs_ordered_drop_inner (431x) 1,293 ( 0.00%) } . . /// Returns `true` if `ty` denotes an `unsafe fn`. . pub fn is_unsafe_fn<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool { . ty.is_fn() && ty.fn_sig(cx.tcx).safety().is_unsafe() . } . . /// Peels off all references on the type. Returns the underlying type, the number of references . /// removed, and, if there were any such references, whether the pointer is ultimately mutable or . /// not. 1,811 ( 0.00%) pub fn peel_and_count_ty_refs(mut ty: Ty<'_>) -> (Ty<'_>, usize, Option) { . let mut count = 0; . let mut mutbl = None; 5,792 ( 0.00%) while let ty::Ref(_, dest_ty, m) = ty.kind() { 1,085 ( 0.00%) ty = *dest_ty; 1,085 ( 0.00%) count += 1; . mutbl.replace(mutbl.map_or(*m, |mutbl: Mutability| mutbl.min(*m))); . } 5,433 ( 0.00%) (ty, count, mutbl) 1,811 ( 0.00%) } . . /// Peels off `n` references on the type. Returns the underlying type and, if any references . /// were removed, whether the pointer is ultimately mutable or not. . pub fn peel_n_ty_refs(mut ty: Ty<'_>, n: usize) -> (Ty<'_>, Option) { . let mut mutbl = None; . for _ in 0..n { . if let ty::Ref(_, dest_ty, m) = ty.kind() { . ty = *dest_ty; -- line 535 ---------------------------------------- -- line 547 ---------------------------------------- . /// For example, the function would return `true` for . /// - `u32` and `u32` . /// - `[u8; N]` and `[u8; M]`, if `N=M` . /// - `Option` and `Option`, if `same_type_modulo_regions(T, U)` holds . /// - `&'a str` and `&'b str` . /// . /// and `false` for: . /// - `Result` and `Result` 6,839 ( 0.00%) pub fn same_type_modulo_regions<'tcx>(a: Ty<'tcx>, b: Ty<'tcx>) -> bool { 7,932 ( 0.00%) match (a.kind(), b.kind()) { . (ty::Adt(did_a, args_a), ty::Adt(did_b, args_b)) => { 382 ( 0.00%) if did_a != did_b { . return false; . } . 59 ( 0.00%) iter::zip(*args_a, *args_b).all(|(arg_a, arg_b)| match (arg_a.kind(), arg_b.kind()) { . (GenericArgKind::Const(inner_a), GenericArgKind::Const(inner_b)) => inner_a == inner_b, . (GenericArgKind::Type(type_a), GenericArgKind::Type(type_b)) => { 21 ( 0.00%) same_type_modulo_regions(type_a, type_b) 197 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::same_type_modulo_regions'2 (7x) . }, . _ => true, . }) . }, 40 ( 0.00%) (ty::Ref(_, a, mut_a), ty::Ref(_, b, mut_b)) => mut_a == mut_b && same_type_modulo_regions(*a, *b), 7 ( 0.00%) (ty::Tuple(as_), ty::Tuple(bs)) => over(as_, bs, |a, b| same_type_modulo_regions(*a, *b)), 94 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::same_type_modulo_regions'2 (3x) . (ty::Array(a, na), ty::Array(b, nb)) => na == nb && same_type_modulo_regions(*a, *b), . _ => a == b, . } 5,862 ( 0.00%) } . . /// Checks if a given type looks safe to be uninitialized. . pub fn is_uninit_value_valid_for_ty<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool { . match cx.layout_of(ty) { . Ok(layout) => is_uninit_value_valid_for_layout(cx, layout), . // The type layout is either not concrete enough yet or too large, fall back to structural check instead . Err(LayoutError::TooGeneric(_) | LayoutError::SizeOverflow(_)) => is_uninit_value_valid_for_ty_fallback(cx, ty), . Err(_) => false, -- line 583 ---------------------------------------- -- line 713 ---------------------------------------- . Self::Closure(_, sig) => Some(sig.input(0).map_bound(|ty| ty.tuple_fields()[i])), . Self::Trait(inputs, _, _) => Some(inputs.map_bound(|ty| ty.tuple_fields()[i])), . } . } . . /// Gets the argument type at the given offset. For closures this will also get the type as . /// written. This will return `None` when the index is out of bounds only for variadic . /// functions, otherwise this will panic. 30,032 ( 0.00%) pub fn input_with_hir(self, i: usize) -> Option<(Option<&'tcx hir::Ty<'tcx>>, Binder<'tcx, Ty<'tcx>>)> { 18,642 ( 0.00%) match self { 7,364 ( 0.00%) Self::Sig(sig, _) => { 3,682 ( 0.00%) if sig.c_variadic() { . sig.inputs() . .map_bound(|inputs| inputs.get(i).copied()) . .transpose() . .map(|arg| (None, arg)) . } else { . Some((None, sig.input(i))) . } . }, 128 ( 0.00%) Self::Closure(decl, sig) => Some(( . decl.and_then(|decl| decl.inputs.get(i)), 320 ( 0.00%) sig.input(0).map_bound(|ty| ty.tuple_fields()[i]), 64 ( 0.00%) )), 64 ( 0.00%) Self::Trait(inputs, _, _) => Some((None, inputs.map_bound(|ty| ty.tuple_fields()[i]))), . } 30,032 ( 0.00%) } . . /// Gets the result type, if one could be found. Note that the result type of a trait may not be . /// specified. . pub fn output(self) -> Option>> { . match self { . Self::Sig(sig, _) | Self::Closure(_, sig) => Some(sig.output()), . Self::Trait(_, output, _) => output, . } . } . . pub fn predicates_id(&self) -> Option { 7,396 ( 0.00%) if let ExprFnSig::Sig(_, id) | ExprFnSig::Trait(_, _, id) = *self { . id . } else { . None . } . } . } . . /// If the expression is function like, get the signature for it. 30,032 ( 0.00%) pub fn expr_sig<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'_>) -> Option> { 42,107 ( 0.00%) if let Res::Def(DefKind::Fn | DefKind::Ctor(_, CtorKind::Fn) | DefKind::AssocFn, id) = expr.res(cx) { 25,760 ( 0.00%) Some(ExprFnSig::Sig( 3,680 ( 0.00%) cx.tcx.fn_sig(id).instantiate_identity().skip_norm_wip(), . Some(id), . )) . } else { 444 ( 0.00%) ty_sig(cx, cx.typeck_results().expr_ty_adjusted(expr).peel_refs()) 20,298 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::ty_sig (74x) 4,050 ( 0.00%) => ???:::expr_ty_adjusted (74x) . } 33,712 ( 0.00%) } . . /// If the type is function like, get the signature for it. 814 ( 0.00%) pub fn ty_sig<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option> { 296 ( 0.00%) if let Some(boxed_ty) = ty.boxed_ty() { 444 ( 0.00%) => ???:::boxed_ty (74x) . return ty_sig(cx, boxed_ty); . } 592 ( 0.00%) match *ty.kind() { 192 ( 0.00%) ty::Closure(id, subs) => { . let decl = id . .as_local() 384 ( 0.00%) .and_then(|id| cx.tcx.hir_fn_decl_by_hir_id(cx.tcx.local_def_id_to_hir_id(id))); 4,800 ( 0.00%) => ???:::hir_fn_decl_by_hir_id (64x) 384 ( 0.00%) Some(ExprFnSig::Closure(decl, subs.as_closure().sig())) 64 ( 0.00%) }, . ty::FnDef(id, subs) => Some(ExprFnSig::Sig( . cx.tcx . .fn_sig(id) . .instantiate(cx.tcx, subs.no_bound_vars().unwrap()) . .skip_norm_wip(), . Some(id), . )), . ty::Alias( -- line 790 ---------------------------------------- -- line 798 ---------------------------------------- . cx, . ty, . cx.tcx . .item_self_bounds(def_id) . .iter_instantiated(cx.tcx, args) . .map(Unnormalized::skip_norm_wip), . cx.tcx.opt_parent(def_id), . ), 18 ( 0.00%) ty::FnPtr(sig_tys, hdr) => Some(ExprFnSig::Sig(sig_tys.with(hdr), None)), . ty::Dynamic(bounds, _) => { . let lang_items = cx.tcx.lang_items(); . match bounds.principal() { . Some(bound) . if Some(bound.def_id()) == lang_items.fn_trait() . || Some(bound.def_id()) == lang_items.fn_once_trait() . || Some(bound.def_id()) == lang_items.fn_mut_trait() => . { -- line 814 ---------------------------------------- -- line 823 ---------------------------------------- . }, . ty::Alias(_, alias) if let Some(proj) = alias.try_to_projection() => match cx . .tcx . .try_normalize_erasing_regions(cx.typing_env(), Unnormalized::new_wip(ty)) . { . Ok(normalized_ty) if normalized_ty != ty => ty_sig(cx, normalized_ty), . _ => sig_for_projection(cx, proj).or_else(|| sig_from_bounds(cx, ty, cx.param_env.caller_bounds(), None)), . }, 24 ( 0.00%) ty::Param(_) => sig_from_bounds(cx, ty, cx.param_env.caller_bounds(), None), . _ => None, . } 674 ( 0.00%) } . 80 ( 0.00%) fn sig_from_bounds<'tcx>( . cx: &LateContext<'tcx>, . ty: Ty<'tcx>, . clauses: impl IntoIterator>, . predicates_id: Option, . ) -> Option> { . let mut inputs = None; . let mut output = None; 24 ( 0.00%) let lang_items = cx.tcx.lang_items(); 320 ( 0.00%) => ???:::lang_items (8x) . . for clause in clauses { 396 ( 0.00%) match clause.kind().skip_binder() { 1,064 ( 0.00%) => ???:::kind (76x) . ty::ClauseKind::Trait(p) . if (lang_items.fn_trait() == Some(p.def_id()) 2 ( 0.00%) || lang_items.fn_mut_trait() == Some(p.def_id()) 8 ( 0.00%) || lang_items.fn_once_trait() == Some(p.def_id())) 10 ( 0.00%) && p.self_ty() == ty => . { 30 ( 0.00%) let i = clause.kind().rebind(p.trait_ref.args.type_at(1)); 140 ( 0.00%) => ???:::kind (10x) . if inputs.is_some_and(|inputs| i != inputs) { . // Multiple different fn trait impls. Is this even allowed? . return None; . } . inputs = Some(i); . }, 80 ( 0.00%) ty::ClauseKind::Projection(p) . if Some(p.projection_term.expect_projection_def_id()) == lang_items.fn_once_output() . && p.projection_term.self_ty() == ty => . { 8 ( 0.00%) if output.is_some() { . // Multiple different fn trait impls. Is this even allowed? . return None; . } 48 ( 0.00%) output = Some(clause.kind().rebind(p.term.expect_type())); 112 ( 0.00%) => ???:::kind (8x) 40 ( 0.00%) => ???:::expect_type (8x) . }, . _ => (), . } . } . . inputs.map(|ty| ExprFnSig::Trait(ty, output, predicates_id)) 64 ( 0.00%) } . . fn sig_for_projection<'tcx>(cx: &LateContext<'tcx>, ty: ProjectionAliasTy<'tcx>) -> Option> { . let mut inputs = None; . let mut output = None; . let lang_items = cx.tcx.lang_items(); . . for (pred, _) in cx . .tcx -- line 884 ---------------------------------------- -- line 927 ---------------------------------------- . match self { . Self::Unsigned(x) => Self::Unsigned(x + u128::from(n)), . Self::Signed(x) => Self::Signed(x + i128::from(n)), . } . } . } . . /// Attempts to read the given constant as though it were an enum value. 648 ( 0.00%) pub fn read_explicit_enum_value(tcx: TyCtxt<'_>, id: DefId) -> Option { 324 ( 0.00%) if let Ok(ConstValue::Scalar(Scalar::Int(value))) = tcx.const_eval_poly(id) { 21,492 ( 0.00%) => ???:::const_eval_poly (54x) 204 ( 0.00%) match tcx.type_of(id).instantiate_identity().skip_norm_wip().kind() { 165 ( 0.00%) ty::Int(_) => Some(EnumValue::Signed(value.to_int(value.size()))), 147 ( 0.00%) ty::Uint(_) => Some(EnumValue::Unsigned(value.to_uint(value.size()))), . _ => None, . } . } else { . None . } 486 ( 0.00%) } . . /// Gets the value of the given variant. 24 ( 0.00%) pub fn get_discriminant_value(tcx: TyCtxt<'_>, adt: AdtDef<'_>, i: VariantIdx) -> EnumValue { . let variant = &adt.variant(i); 18 ( 0.00%) match variant.discr { 5 ( 0.00%) VariantDiscr::Explicit(id) => read_explicit_enum_value(tcx, id).unwrap(), 2,585 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::read_explicit_enum_value (5x) 4 ( 0.00%) VariantDiscr::Relative(x) => match adt.variant((i.as_usize() - x as usize).into()).discr { . VariantDiscr::Explicit(id) => read_explicit_enum_value(tcx, id).unwrap() + x, 4 ( 0.00%) VariantDiscr::Relative(_) => EnumValue::Unsigned(x.into()), . }, . } 30 ( 0.00%) } . . /// Check if the given type is either `core::ffi::c_void`, `std::os::raw::c_void`, or one of the . /// platform specific `libc::::c_void` types in libc. . pub fn is_c_void(cx: &LateContext<'_>, ty: Ty<'_>) -> bool { . if let ty::Adt(adt, _) = ty.kind() . && let &[krate, .., name] = &*cx.get_def_path(adt.did()) . && let sym::libc | sym::core | sym::std = krate . && name == sym::c_void -- line 965 ---------------------------------------- -- line 1004 ---------------------------------------- . pub size: u64, . . /// (ind, size) . pub fields_size: Vec<(usize, u64)>, . } . . impl AdtVariantInfo { . /// Returns ADT variants ordered by size 663 ( 0.00%) pub fn new<'tcx>(cx: &LateContext<'tcx>, adt: AdtDef<'tcx>, subst: GenericArgsRef<'tcx>) -> Vec { . let mut variants_size = adt . .variants() . .iter() . .enumerate() . .map(|(i, variant)| { . let mut fields_size = variant . .fields . .iter() . .enumerate() 7,189 ( 0.00%) .map(|(i, f)| (i, approx_ty_size(cx, f.ty(cx.tcx, subst).skip_norm_wip()))) 16,944,252 ( 0.14%) => site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::approx_ty_size (1,027x) 120,926 ( 0.00%) => ???:::ty (1,027x) . .collect::>(); . fields_size.sort_by_key(|(_, a_size)| *a_size); . . Self { . ind: i, . size: fields_size.iter().map(|(_, size)| size).sum(), 8,348 ( 0.00%) fields_size, . } . }) . .collect::>(); . variants_size.sort_by_key(|b| std::cmp::Reverse(b.size)); 884 ( 0.00%) variants_size 884 ( 0.00%) } . } . . /// Gets the struct or enum variant from the given `Res` 560 ( 0.00%) pub fn adt_and_variant_of_res<'tcx>(cx: &LateContext<'tcx>, res: Res) -> Option<(AdtDef<'tcx>, &'tcx VariantDef)> { 1,032 ( 0.00%) match res { 88 ( 0.00%) Res::Def(DefKind::Struct, id) => { 44 ( 0.00%) let adt = cx.tcx.adt_def(id); . Some((adt, adt.non_enum_variant())) . }, 72 ( 0.00%) Res::Def(DefKind::Variant, id) => { 108 ( 0.00%) let adt = cx.tcx.adt_def(cx.tcx.parent(id)); 144 ( 0.00%) Some((adt, adt.variant_with_id(id))) . }, . Res::Def(DefKind::Ctor(CtorOf::Struct, _), id) => { . let adt = cx.tcx.adt_def(cx.tcx.parent(id)); . Some((adt, adt.non_enum_variant())) . }, . Res::Def(DefKind::Ctor(CtorOf::Variant, _), id) => { . let var_id = cx.tcx.parent(id); . let adt = cx.tcx.adt_def(cx.tcx.parent(var_id)); -- line 1055 ---------------------------------------- -- line 1062 ---------------------------------------- . .instantiate_identity() . .skip_norm_wip() . .ty_adt_def() . .unwrap(); . Some((adt, adt.non_enum_variant())) . }, . _ => None, . } 720 ( 0.00%) } . . /// Comes up with an "at least" guesstimate for the type's size, not taking into . /// account the layout of type parameters. 12,408 ( 0.00%) pub fn approx_ty_size<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> u64 { . use rustc_middle::ty::layout::LayoutOf as _; 1,166 ( 0.00%) match (cx.layout_of(ty).map(|layout| layout.size.bytes()), ty.kind()) { 1,120 ( 0.00%) (Ok(size), _) => size, . (Err(_), ty::Tuple(list)) => list.iter().map(|t| approx_ty_size(cx, t)).sum(), . (Err(_), ty::Array(t, n)) => n.try_to_target_usize(cx.tcx).unwrap_or_default() * approx_ty_size(cx, *t), 10 ( 0.00%) (Err(_), ty::Adt(def, subst)) if def.is_struct() => def . .variants() . .iter() . .map(|v| { . v.fields . .iter() 84 ( 0.00%) .map(|field| approx_ty_size(cx, field.ty(cx.tcx, subst).skip_norm_wip())) 97,356 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::approx_ty_size'2 (9x) 7,089 ( 0.00%) => ???:::ty (9x) . .sum::() . }) . .sum(), 1 ( 0.00%) (Err(_), ty::Adt(def, subst)) if def.is_enum() => def . .variants() . .iter() . .map(|v| { . v.fields . .iter() 19 ( 0.00%) .map(|field| approx_ty_size(cx, field.ty(cx.tcx, subst).skip_norm_wip())) 2,145 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::approx_ty_size'2 (2x) 736 ( 0.00%) => ???:::ty (2x) . .sum::() . }) . .max() . .unwrap_or_default(), . (Err(_), ty::Adt(def, subst)) if def.is_union() => def . .variants() . .iter() . .map(|v| { -- line 1104 ---------------------------------------- -- line 1107 ---------------------------------------- . .map(|field| approx_ty_size(cx, field.ty(cx.tcx, subst).skip_norm_wip())) . .max() . .unwrap_or_default() . }) . .max() . .unwrap_or_default(), . (Err(_), _) => 0, . } 10,152 ( 0.00%) } . . #[cfg(debug_assertions)] . /// Asserts that the given arguments match the generic parameters of the given item. . fn assert_generic_args_match<'tcx>(tcx: TyCtxt<'tcx>, did: DefId, args: &[GenericArg<'tcx>]) { . use itertools::Itertools as _; . let g = tcx.generics_of(did); . let parent = g.parent.map(|did| tcx.generics_of(did)); . let count = g.parent_count + g.own_params.len(); -- line 1123 ---------------------------------------- -- line 1160 ---------------------------------------- . param.descr(), . params.clone().map(ty::GenericParamDefKind::descr).format(", "), . ); . } . } . . /// Returns whether `ty` is never-like; i.e., `!` (never) or an enum with zero variants. . pub fn is_never_like(ty: Ty<'_>) -> bool { 288 ( 0.00%) ty.is_never() || (ty.is_enum() && ty.ty_adt_def().is_some_and(|def| def.variants().is_empty())) . } . . /// Makes the projection type for the named associated type in the given impl or trait impl. . /// . /// This function is for associated types which are "known" to exist, and as such, will only return . /// `None` when debug assertions are disabled in order to prevent ICE's. With debug assertions . /// enabled this will check that the named associated type exists, the correct number of . /// arguments are given, and that the correct kinds of arguments are given (lifetime, . /// constant or type). This will not check if type normalization would succeed. . pub fn make_projection<'tcx>( . tcx: TyCtxt<'tcx>, . container_id: DefId, . assoc_ty: Symbol, . args: impl IntoIterator>>, . ) -> Option> { 5,642 ( 0.00%) fn helper<'tcx>( . tcx: TyCtxt<'tcx>, . container_id: DefId, . assoc_ty: Symbol, . args: GenericArgsRef<'tcx>, . ) -> Option> { 3,224 ( 0.00%) let Some(assoc_item) = tcx.associated_items(container_id).find_by_ident_and_kind( 154,383 ( 0.00%) => ???:::find_by_ident_and_kind (403x) . tcx, . Ident::with_dummy_span(assoc_ty), . AssocTag::Type, . container_id, . ) else { . debug_assert!(false, "type `{assoc_ty}` not found in `{container_id:?}`"); . return None; . }; . #[cfg(debug_assertions)] . assert_generic_args_match(tcx, assoc_item.def_id, args); . 2,418 ( 0.00%) let kind = if let DefKind::Impl { of_trait: false } = tcx.def_kind(tcx.parent(assoc_item.def_id)) { . ty::AliasTyKind::Inherent { . def_id: assoc_item.def_id, . } . } else { . ty::AliasTyKind::Projection { . def_id: assoc_item.def_id, . } . }; . 1,612 ( 0.00%) Some(AliasTy::new_from_args(tcx, kind, args)) 3,224 ( 0.00%) } 2,794 ( 0.00%) helper( 276,541 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::make_projection::helper (376x) . tcx, . container_id, . assoc_ty, . tcx.mk_args_from_iter(args.into_iter().map(Into::into)), . ) . } . . /// Normalizes the named associated type in the given impl or trait impl. . /// . /// This function is for associated types which are "known" to be valid with the given . /// arguments, and as such, will only return `None` when debug assertions are disabled in order . /// to prevent ICE's. With debug assertions enabled this will check that type normalization . /// succeeds as well as everything checked by `make_projection`. 132 ( 0.00%) pub fn make_normalized_projection<'tcx>( . tcx: TyCtxt<'tcx>, . typing_env: ty::TypingEnv<'tcx>, . container_id: DefId, . assoc_ty: Symbol, . args: impl IntoIterator>>, . ) -> Option> { 1,940 ( 0.00%) fn helper<'tcx>(tcx: TyCtxt<'tcx>, typing_env: ty::TypingEnv<'tcx>, ty: AliasTy<'tcx>) -> Option> { . #[cfg(debug_assertions)] . if let Some((i, arg)) = ty . .args . .iter() . .enumerate() . .find(|(_, arg)| arg.has_escaping_bound_vars()) . { . debug_assert!( . false, . "args contain late-bound region at index `{i}` which can't be normalized.\n\ . use `TyCtxt::instantiate_bound_regions_with_erased`\n\ . note: arg is `{arg:#?}`", . ); . return None; . } 776 ( 0.00%) match tcx.try_normalize_erasing_regions( . typing_env, . Unnormalized::new_wip(Ty::new_alias(tcx, ty::IsRigid::No, ty)), . ) { . Ok(ty) => Some(ty), . Err(e) => { . debug_assert!(false, "failed to normalize type `{ty}`: {e:#?}"); . None . }, . } 1,552 ( 0.00%) } 1,916 ( 0.00%) helper(tcx, typing_env, make_projection(tcx, container_id, assoc_ty, args)?) 2,477,140 ( 0.02%) => site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::make_normalized_projection::helper (376x) 472 ( 0.00%) } . . /// Helper to check if given type has inner mutability such as [`std::cell::Cell`] or . /// [`std::cell::RefCell`]. . #[derive(Default, Debug)] . pub struct InteriorMut<'tcx> { . ignored_def_ids: FxHashSet, . ignore_pointers: bool, . tys: FxHashMap, Option<&'tcx ty::List>>>, . } . . impl<'tcx> InteriorMut<'tcx> { 4 ( 0.00%) pub fn new(tcx: TyCtxt<'tcx>, ignore_interior_mutability: &[String]) -> Self { . let ignored_def_ids = ignore_interior_mutability . .iter() 8 ( 0.00%) .flat_map(|ignored_ty| lookup_path_str(tcx, PathNS::Type, ignored_ty)) 39,307 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/paths.rs:clippy_utils::paths::lookup_path_str (2x) . .collect(); . 5 ( 0.00%) Self { . ignored_def_ids, . ..Self::default() . } 4 ( 0.00%) } . 4 ( 0.00%) pub fn without_pointers(tcx: TyCtxt<'tcx>, ignore_interior_mutability: &[String]) -> Self { 7 ( 0.00%) Self { . ignore_pointers: true, . ..Self::new(tcx, ignore_interior_mutability) . } 4 ( 0.00%) } . . /// Check if given type has interior mutability such as [`std::cell::Cell`] or . /// [`std::cell::RefCell`] etc. and if it does, returns a chain of types that causes . /// this type to be interior mutable. False negatives may be expected for infinitely recursive . /// types, and `None` will be returned there. . pub fn interior_mut_ty_chain(&mut self, cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option<&'tcx ty::List>> { 60 ( 0.00%) self.interior_mut_ty_chain_inner(cx, ty, 0) 6,945 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:::interior_mut_ty_chain_inner (9x) . } . 528 ( 0.00%) fn interior_mut_ty_chain_inner( . &mut self, . cx: &LateContext<'tcx>, . ty: Ty<'tcx>, . depth: usize, . ) -> Option<&'tcx ty::List>> { 192 ( 0.00%) if !cx.tcx.recursion_limit().value_within_limit(depth) { 1,200 ( 0.00%) => ???:::recursion_limit (30x) . return None; . } . . match self.tys.entry(ty) { 27 ( 0.00%) Entry::Occupied(o) => return *o.get(), . // Temporarily insert a `None` to break cycles . Entry::Vacant(v) => v.insert(None), . }; 42 ( 0.00%) let depth = depth + 1; . 153 ( 0.00%) let chain = match *ty.kind() { . ty::RawPtr(inner_ty, _) if !self.ignore_pointers => self.interior_mut_ty_chain_inner(cx, inner_ty, depth), 1 ( 0.00%) ty::Ref(_, inner_ty, _) | ty::Slice(inner_ty) => self.interior_mut_ty_chain_inner(cx, inner_ty, depth), 2 ( 0.00%) ty::Array(inner_ty, size) if size.try_to_target_usize(cx.tcx) != Some(0) => { . self.interior_mut_ty_chain_inner(cx, inner_ty, depth) . }, 2 ( 0.00%) ty::Tuple(fields) => fields . .iter() 8 ( 0.00%) .find_map(|ty| self.interior_mut_ty_chain_inner(cx, ty, depth)), 194 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:::interior_mut_ty_chain_inner'2 (2x) 24 ( 0.00%) ty::Adt(def, _) if def.is_unsafe_cell() => Some(ty::List::empty()), 12 ( 0.00%) ty::Adt(def, args) => { 60 ( 0.00%) let is_std_collection = matches!( 12 ( 0.00%) cx.tcx.get_diagnostic_name(def.did()), 636 ( 0.00%) => ???:::get_diagnostic_name (12x) . Some( . sym::LinkedList . | sym::Vec . | sym::VecDeque . | sym::BTreeMap . | sym::BTreeSet . | sym::HashMap . | sym::HashSet . | sym::Arc . | sym::Rc . ) . ); . 12 ( 0.00%) if is_std_collection || def.is_box() { . // Include the types from std collections that are behind pointers internally . args.types() . .find_map(|ty| self.interior_mut_ty_chain_inner(cx, ty, depth)) 36 ( 0.00%) } else if self.ignored_def_ids.contains(&def.did()) || def.is_phantom_data() { . None . } else { . def.all_fields() 112 ( 0.00%) .find_map(|f| self.interior_mut_ty_chain_inner(cx, f.ty(cx.tcx, args).skip_norm_wip(), depth)) 2,991 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:::interior_mut_ty_chain_inner'2 (14x) 989 ( 0.00%) => ???:::ty (14x) . } . }, . ty::Alias( . _, . AliasTy { . kind: ty::Projection { .. }, . .. . }, . ) => match cx . .tcx . .try_normalize_erasing_regions(cx.typing_env(), Unnormalized::new_wip(ty)) . { . Ok(normalized_ty) if ty != normalized_ty => self.interior_mut_ty_chain_inner(cx, normalized_ty, depth), . _ => None, 14 ( 0.00%) }, . _ => None, . }; . . chain.map(|chain| { . let list = cx.tcx.mk_type_list_from_iter(chain.iter().chain([ty])); . self.tys.insert(ty, Some(list)); . list . }) 432 ( 0.00%) } . . /// Check if given type has interior mutability such as [`std::cell::Cell`] or . /// [`std::cell::RefCell`] etc. 9 ( 0.00%) pub fn is_interior_mut_ty(&mut self, cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool { . self.interior_mut_ty_chain(cx, ty).is_some() 18 ( 0.00%) } . } . . pub fn make_normalized_projection_with_regions<'tcx>( . tcx: TyCtxt<'tcx>, . typing_env: ty::TypingEnv<'tcx>, . container_id: DefId, . assoc_ty: Symbol, . args: impl IntoIterator>>, . ) -> Option> { 120 ( 0.00%) fn helper<'tcx>(tcx: TyCtxt<'tcx>, typing_env: ty::TypingEnv<'tcx>, ty: AliasTy<'tcx>) -> Option> { . #[cfg(debug_assertions)] . if let Some((i, arg)) = ty . .args . .iter() . .enumerate() . .find(|(_, arg)| arg.has_escaping_bound_vars()) . { . debug_assert!( -- line 1401 ---------------------------------------- -- line 1402 ---------------------------------------- . false, . "args contain late-bound region at index `{i}` which can't be normalized.\n\ . use `TyCtxt::instantiate_bound_regions_with_erased`\n\ . note: arg is `{arg:#?}`", . ); . return None; . } . let cause = ObligationCause::dummy(); 90 ( 0.00%) let (infcx, param_env) = tcx.infer_ctxt().build_with_typing_env(typing_env); 1,875 ( 0.00%) => ???:0x0000000000173dc0 (15x) 1,680 ( 0.00%) => ???:::build_with_typing_env (15x) 30 ( 0.00%) match infcx . .at(&cause, param_env) 30 ( 0.00%) .query_normalize(Ty::new_alias(tcx, ty::IsRigid::No, ty)) 218,833 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_trait_selection/src/traits/query/normalize.rs:::query_normalize:: (15x) . { 45 ( 0.00%) Ok(ty) => Some(ty.value), . Err(e) => { . debug_assert!(false, "failed to normalize type `{ty}`: {e:#?}"); . None . }, . } 120 ( 0.00%) } 3,750 ( 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:: (15x) 30 ( 0.00%) helper(tcx, typing_env, make_projection(tcx, container_id, assoc_ty, args)?) 229,172 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::make_normalized_projection_with_regions::helper (15x) . } . 90 ( 0.00%) pub fn normalize_with_regions<'tcx>(tcx: TyCtxt<'tcx>, typing_env: ty::TypingEnv<'tcx>, ty: Ty<'tcx>) -> Ty<'tcx> { . let cause = ObligationCause::dummy(); 90 ( 0.00%) let (infcx, param_env) = tcx.infer_ctxt().build_with_typing_env(typing_env); 1,803 ( 0.00%) => ???:0x0000000000173dc0 (15x) 1,680 ( 0.00%) => ???:::build_with_typing_env (15x) . infcx . .at(&cause, param_env) 30 ( 0.00%) .query_normalize(ty) 630 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_trait_selection/src/traits/query/normalize.rs:::query_normalize:: (15x) 15 ( 0.00%) .map_or(ty, |ty| ty.value) 105 ( 0.00%) } 3,750 ( 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:: (15x) . . /// Checks if the type is `core::mem::ManuallyDrop<_>` . pub fn is_manually_drop(ty: Ty<'_>) -> bool { . ty.ty_adt_def().is_some_and(AdtDef::is_manually_drop) . } . . /// Returns the deref chain of a type, starting with the type itself. . pub fn deref_chain<'cx, 'tcx>(cx: &'cx LateContext<'tcx>, ty: Ty<'tcx>) -> impl Iterator> + 'cx { . iter::successors(Some(ty), |&ty| { 4,340 ( 0.00%) if let Some(deref_did) = cx.tcx.lang_items().deref_trait() 43,400 ( 0.00%) => ???:::lang_items (1,085x) 11,935 ( 0.00%) && implements_trait(cx, ty, deref_did, &[]) 4,460,527 ( 0.04%) => site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::implements_trait (1,085x) . { 752 ( 0.00%) make_normalized_projection(cx.tcx, cx.typing_env(), deref_did, sym::Target, [ty]) 11,280 ( 0.00%) => ???:::typing_env (376x) . } else { . None . } . }) . } . . /// Checks if a Ty<'_> has some inherent method Symbol. . /// . /// This does not look for impls in the type's `Deref::Target` type. . /// If you need this, you should wrap this call in `clippy_utils::ty::deref_chain().any(...)`. 3,976 ( 0.00%) pub fn get_adt_inherent_method<'a>(cx: &'a LateContext<'_>, ty: Ty<'_>, method_name: Symbol) -> Option<&'a AssocItem> { . let ty_did = ty.ty_adt_def().map(AdtDef::did)?; 497 ( 0.00%) cx.tcx.inherent_impls(ty_did).iter().find_map(|&did| { . cx.tcx . .associated_items(did) 2,868 ( 0.00%) .filter_by_name_unhygienic(method_name) 77,025 ( 0.00%) => ???:::filter_by_name_unhygienic (956x) . .next() . .filter(|item| item.tag() == AssocTag::Fn) . }) 3,976 ( 0.00%) } . . /// Gets the type of a field by name. . pub fn get_field_by_name<'tcx>(tcx: TyCtxt<'tcx>, ty: Ty<'tcx>, name: Symbol) -> Option> { . match *ty.kind() { . ty::Adt(def, args) if def.is_union() || def.is_struct() => def . .non_enum_variant() . .fields . .iter() . .find(|f| f.name == name) . .map(|f| f.ty(tcx, args).skip_norm_wip()), . ty::Tuple(args) => name.as_str().parse::().ok().and_then(|i| args.get(i).copied()), . _ => None, . } . } . 11,447 ( 0.00%) pub fn get_field_def_id_by_name(ty: Ty<'_>, name: Symbol) -> Option { 22,894 ( 0.00%) let ty::Adt(adt_def, ..) = ty.kind() else { return None }; 5,149 ( 0.00%) adt_def . .all_fields() . .find_map(|field| if field.name == name { Some(field.did) } else { None }) 11,447 ( 0.00%) } . . /// Check if `ty` is an `Option` and return its argument type if it is. . pub fn option_arg_ty<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option> { 5,436 ( 0.00%) match *ty.kind() { . ty::Adt(adt, args) 5,364 ( 0.00%) if let [arg] = &**args 259 ( 0.00%) && let Some(arg) = arg.as_type() 585 ( 0.00%) && adt.is_diag_item(cx, sym::Option) => . { . Some(arg) . }, . _ => None, . } 2,718 ( 0.00%) } . . /// Check if `ty` is an `Option` or a `Result` and return its argument type (`T`) if it is. . pub fn option_or_result_arg_ty<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> Option> { . match ty.kind() { . ty::Adt(adt, args) if matches!(adt.opt_diag_name(cx), Some(sym::Option | sym::Result)) => Some(args.type_at(0)), . _ => None, . } . } . . /// Check if a Ty<'_> of `Iterator` contains any mutable access to non-owning types by checking if . /// it contains fields of mutable references or pointers, or references/pointers to non-`Freeze` . /// types, or `PhantomData` types containing any of the previous. This can be used to check whether . /// skipping iterating over an iterator will change its behavior. 75 ( 0.00%) pub fn has_non_owning_mutable_access<'tcx>(cx: &LateContext<'tcx>, iter_ty: Ty<'tcx>) -> bool { . fn normalize_ty<'tcx>(cx: &LateContext<'tcx>, ty: Unnormalized<'tcx, Ty<'tcx>>) -> Ty<'tcx> { . cx.tcx 2,205 ( 0.00%) .try_normalize_erasing_regions(cx.typing_env(), ty) 1,020 ( 0.00%) => ???:::typing_env (34x) . .unwrap_or(ty.skip_norm_wip()) . } . . /// Check if `ty` contains mutable references or equivalent, which includes: . /// - A mutable reference/pointer. . /// - A reference/pointer to a non-`Freeze` type. . /// - A `PhantomData` type containing any of the previous. 8,976 ( 0.00%) fn has_non_owning_mutable_access_inner<'tcx>( . cx: &LateContext<'tcx>, . phantoms: &mut FxHashSet>, . ty: Ty<'tcx>, . ) -> bool { 6,277 ( 0.00%) match ty.kind() { 1,066 ( 0.00%) ty::Adt(adt_def, args) if adt_def.is_phantom_data() => { 240 ( 0.00%) phantoms.insert(ty) 32 ( 0.00%) && args . .types() 96 ( 0.00%) .any(|arg_ty| has_non_owning_mutable_access_inner(cx, phantoms, arg_ty)) 32,923 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::has_non_owning_mutable_access::has_non_owning_mutable_access_inner'2 (32x) . }, . ty::Adt(adt_def, args) => adt_def.all_fields().any(|field| { 5,880 ( 0.00%) has_non_owning_mutable_access_inner(cx, phantoms, normalize_ty(cx, field.ty(cx.tcx, args))) 950,714 ( 0.01%) => site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::has_non_owning_mutable_access::has_non_owning_mutable_access_inner'2 (34x) 6,211 ( 0.00%) => ???:::ty (34x) . }), 2 ( 0.00%) ty::Array(elem_ty, _) | ty::Slice(elem_ty) => has_non_owning_mutable_access_inner(cx, phantoms, *elem_ty), . ty::RawPtr(pointee_ty, mutability) | ty::Ref(_, pointee_ty, mutability) => { 688 ( 0.00%) mutability.is_mut() || !pointee_ty.is_freeze(cx.tcx, cx.typing_env()) 282,542 ( 0.00%) => ???:::is_freeze (48x) 1,440 ( 0.00%) => ???:::typing_env (48x) . }, . ty::Closure(_, closure_args) => { 15 ( 0.00%) matches!(closure_args.types().next_back(), . Some(captures) if has_non_owning_mutable_access_inner(cx, phantoms, captures)) . }, 26 ( 0.00%) ty::Tuple(tuple_args) => tuple_args . .iter() 72 ( 0.00%) .any(|arg_ty| has_non_owning_mutable_access_inner(cx, phantoms, arg_ty)), 50,085 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::has_non_owning_mutable_access::has_non_owning_mutable_access_inner'2 (24x) . _ => false, . } 6,528 ( 0.00%) } . . let mut phantoms = FxHashSet::default(); 25 ( 0.00%) has_non_owning_mutable_access_inner(cx, &mut phantoms, iter_ty) 968,506 ( 0.01%) => site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::has_non_owning_mutable_access::has_non_owning_mutable_access_inner (25x) 75 ( 0.00%) } . . /// Check if `ty` is slice-like, i.e., `&[T]`, `[T; N]`, or `Vec`. . pub fn is_slice_like<'tcx>(cx: &LateContext<'tcx>, ty: Ty<'tcx>) -> bool { . ty.is_slice() || ty.is_array() || ty.is_diag_item(cx, sym::Vec) . } . . pub fn get_field_idx_by_name(ty: Ty<'_>, name: Symbol) -> Option { . match *ty.kind() { -- line 1565 ---------------------------------------- 98,311 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/operators/op_ref.rs -------------------------------------------------------------------------------- Ir -- line 7 ---------------------------------------- . use rustc_hir::def_id::DefId; . use rustc_hir::{BinOpKind, BorrowKind, Expr, ExprKind, GenericArg, ItemKind, QPath, TyKind}; . use rustc_lint::LateContext; . use rustc_middle::ty::{self, Ty}; . . use super::OP_REF; . . #[expect(clippy::too_many_lines)] 47,340 ( 0.00%) pub(crate) fn check<'tcx>( . cx: &LateContext<'tcx>, . e: &'tcx Expr<'_>, . op: BinOpKind, . left: &'tcx Expr<'_>, . right: &'tcx Expr<'_>, . ) { 19,725 ( 0.00%) let (trait_id, requires_ref) = match op { . BinOpKind::Add => (cx.tcx.lang_items().add_trait(), false), . BinOpKind::Sub => (cx.tcx.lang_items().sub_trait(), false), . BinOpKind::Mul => (cx.tcx.lang_items().mul_trait(), false), . BinOpKind::Div => (cx.tcx.lang_items().div_trait(), false), . BinOpKind::Rem => (cx.tcx.lang_items().rem_trait(), false), . // don't lint short circuiting ops . BinOpKind::And | BinOpKind::Or => return, . BinOpKind::BitXor => (cx.tcx.lang_items().bitxor_trait(), false), . BinOpKind::BitAnd => (cx.tcx.lang_items().bitand_trait(), false), . BinOpKind::BitOr => (cx.tcx.lang_items().bitor_trait(), false), . BinOpKind::Shl => (cx.tcx.lang_items().shl_trait(), false), . BinOpKind::Shr => (cx.tcx.lang_items().shr_trait(), false), 2,040 ( 0.00%) BinOpKind::Ne | BinOpKind::Eq => (cx.tcx.lang_items().eq_trait(), true), . BinOpKind::Lt | BinOpKind::Le | BinOpKind::Ge | BinOpKind::Gt => { . (cx.tcx.lang_items().partial_ord_trait(), true) . }, . }; 7,234 ( 0.00%) if let Some(trait_id) = trait_id { 37,573 ( 0.00%) match (&left.kind, &right.kind) { . // do not suggest to dereference literals . (&ExprKind::Lit(..), _) | (_, &ExprKind::Lit(..)) => {}, . // &foo == &bar . (&ExprKind::AddrOf(BorrowKind::Ref, _, l), &ExprKind::AddrOf(BorrowKind::Ref, _, r)) => { . let lty = cx.typeck_results().expr_ty(l); . let rty = cx.typeck_results().expr_ty(r); . let lcpy = is_copy(cx, lty); . let rcpy = is_copy(cx, rty); -- line 49 ---------------------------------------- -- line 138 ---------------------------------------- . Applicability::MachineApplicable, . ); . }, . ); . } . }, . // foo == &bar . (_, &ExprKind::AddrOf(BorrowKind::Ref, _, r)) => { 6 ( 0.00%) let rty = cx.typeck_results().expr_ty(r); 120 ( 0.00%) => ???:::expr_ty (3x) 30 ( 0.00%) if let Some((self_ty, other_ty)) = in_impl(cx, e, trait_id) { 1,521 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/operators/op_ref.rs:clippy_lints::operators::op_ref::in_impl (3x) . let lty = cx.typeck_results().expr_ty(left); . if (are_equal(cx, rty, self_ty) && are_equal(cx, lty, other_ty)) . || (are_equal(cx, rty, other_ty) && are_equal(cx, lty, self_ty)) . { . return; // Don't lint . } . } 9 ( 0.00%) let rcpy = is_copy(cx, rty); 606 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::is_copy (3x) 9 ( 0.00%) if (requires_ref || rcpy) 12 ( 0.00%) && implements_trait(cx, cx.typeck_results().expr_ty(left), trait_id, &[rty.into()]) 135,905 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::implements_trait (1x) 40 ( 0.00%) => ???:::expr_ty (1x) . { . span_lint_and_then(cx, OP_REF, e.span, "taken reference of right operand", |diag| { . let mut applicability = Applicability::MachineApplicable; . let (rsnip, _) = snippet_with_context(cx, r.span, e.span.ctxt(), "...", &mut applicability); . diag.span_suggestion( . right.span, . "use the right value directly", . rsnip, -- line 165 ---------------------------------------- -- line 166 ---------------------------------------- . Applicability::MachineApplicable, . ); . }); . } . }, . _ => {}, . } . } 31,560 ( 0.00%) } . 24 ( 0.00%) fn in_impl<'tcx>( . cx: &LateContext<'tcx>, . e: &'tcx Expr<'_>, . bin_op: DefId, . ) -> Option<(&'tcx rustc_hir::Ty<'tcx>, &'tcx rustc_hir::Ty<'tcx>)> { 9 ( 0.00%) if let Some(block) = get_enclosing_block(cx, e.hir_id) 1,156 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_enclosing_block (3x) 24 ( 0.00%) && let Some(impl_def_id) = cx.tcx.impl_of_assoc(block.hir_id.owner.to_def_id()) 287 ( 0.00%) => ???:::impl_of_assoc (3x) . && let item = cx.tcx.hir_expect_item(impl_def_id.expect_local()) . && let ItemKind::Impl(item) = &item.kind . && let Some(of_trait) = &item.of_trait . && let Some(seg) = of_trait.trait_ref.path.segments.last() . && let Res::Def(_, trait_id) = seg.res . && trait_id == bin_op . && let Some(generic_args) = seg.args . && let Some(GenericArg::Type(other_ty)) = generic_args.args.last() . { . // `_` is not permitted in impl headers . Some((item.self_ty, other_ty.as_unambig_ty())) . } else { . None . } 21 ( 0.00%) } . . fn are_equal(cx: &LateContext<'_>, middle_ty: Ty<'_>, hir_ty: &rustc_hir::Ty<'_>) -> bool { . if let ty::Adt(adt_def, _) = middle_ty.kind() . && let Some(local_did) = adt_def.did().as_local() . && let item = cx.tcx.hir_expect_item(local_did) . && let middle_ty_id = item.owner_id.to_def_id() . && let TyKind::Path(QPath::Resolved(_, path)) = hir_ty.kind . && let Res::Def(_, hir_ty_id) = path.res -- line 205 ---------------------------------------- 34,917 ( 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 { 59,770 ( 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 { 1,005,010 ( 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 { 11,719 ( 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)); 28,910 ( 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()?; 3,414 ( 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 { 569 ( 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 2455 ---------------------------------------- . buf.extend(iter); . buf . } . } . . #[cfg(not(no_global_oom_handling))] . #[stable(feature = "herd_cows", since = "1.19.0")] . impl<'a> FromIterator> for String { 9 ( 0.00%) fn from_iter>>(iter: I) -> String { . let mut iterator = iter.into_iter(); . . // Because we're iterating over CoWs, we can (potentially) avoid at least . // one allocation by getting the first item and appending to it all the . // subsequent items. 1 ( 0.00%) match iterator.next() { . None => String::new(), . Some(cow) => { . let mut buf = cow.into_owned(); . buf.extend(iterator); 4 ( 0.00%) buf . } . } 9 ( 0.00%) } . } . . #[cfg(not(no_global_oom_handling))] . #[unstable(feature = "ascii_char", issue = "110998")] . impl FromIterator for String { . fn from_iter>(iter: T) -> Self { . let buf = iter.into_iter().map(core::ascii::Char::to_u8).collect(); . // SAFETY: `buf` is guaranteed to be valid UTF-8 because the `core::ascii::Char` type -- line 2485 ---------------------------------------- -- 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); 10,368 ( 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] 2,680 ( 0.00%) fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 5,360 ( 0.00%) fmt::Display::fmt(&**self, f) 725,359 ( 0.01%) => ???:::fmt (2,680x) . } . } . . #[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); 228 ( 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 2923 ---------------------------------------- . /// if the `Display` implementation returns an error. . /// This indicates an incorrect `Display` implementation . /// since `fmt::Write for String` never returns an error itself. . #[cfg(not(no_global_oom_handling))] . #[stable(feature = "rust1", since = "1.0.0")] . impl ToString for T { . #[inline] . fn to_string(&self) -> String { 188 ( 0.00%) ::spec_to_string(self) 1,193 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/string.rs:::spec_to_string (5x) . } . } . . #[cfg(not(no_global_oom_handling))] . trait SpecToString { . fn spec_to_string(&self) -> String; . } . . #[cfg(not(no_global_oom_handling))] . impl SpecToString for T { . // A common guideline is to not inline generic functions. However, . // removing `#[inline]` from this method causes non-negligible regressions. . // See , the last attempt . // to try to remove it. . #[inline] 224 ( 0.00%) 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 45,420 ( 0.00%) fmt::Display::fmt(self, &mut formatter) 58,136 ( 0.00%) => ???:::fmt (279x) . .expect("a Display implementation returned an error unexpectedly"); 47,974 ( 0.00%) buf 168 ( 0.00%) } . } . . #[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 2963 ---------------------------------------- -- 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> { 13,138 ( 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] 113,491 ( 0.00%) fn write_str(&mut self, s: &str) -> fmt::Result { . self.push_str(s); . Ok(()) 113,491 ( 0.00%) } . . #[inline] . fn write_char(&mut self, c: char) -> fmt::Result { . self.push(c); . Ok(()) . } . } . -- line 3392 ---------------------------------------- 7,428 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/new_without_default.rs -------------------------------------------------------------------------------- Ir -- line 47 ---------------------------------------- . #[clippy::version = "pre 1.29.0"] . pub NEW_WITHOUT_DEFAULT, . style, . "`pub fn new() -> Self` method without `Default` implementation" . } . . impl_lint_pass!(NewWithoutDefault => [NEW_WITHOUT_DEFAULT]); . 1 ( 0.00%) #[derive(Clone, Default)] . pub struct NewWithoutDefault { . impling_types: Option, . } . . impl<'tcx> LateLintPass<'tcx> for NewWithoutDefault { . #[expect(clippy::too_many_lines)] 53,442 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>) { 16,224 ( 0.00%) let hir::ItemKind::Impl(hir::Impl { . of_trait: None, . generics, . self_ty: impl_self_ty, . .. . }) = item.kind . else { . return; . }; . 2,773 ( 0.00%) for assoc_item in cx . .tcx 526 ( 0.00%) .associated_items(item.owner_id.def_id) 526 ( 0.00%) .filter_by_name_unhygienic(sym::new) 18,036 ( 0.00%) => ???:::filter_by_name_unhygienic (263x) . { 332 ( 0.00%) if let AssocKind::Fn { has_self: false, .. } = assoc_item.kind 332 ( 0.00%) && let assoc_item_hir_id = cx.tcx.local_def_id_to_hir_id(assoc_item.def_id.expect_local()) 830 ( 0.00%) && let impl_item = cx.tcx.hir_node(assoc_item_hir_id).expect_impl_item() 5,377 ( 0.00%) => ???:::hir_node (83x) 415 ( 0.00%) => ???:::expect_impl_item (83x) 332 ( 0.00%) && !impl_item.span.in_external_macro(cx.sess().source_map()) 166 ( 0.00%) && let hir::ImplItemKind::Fn(ref sig, _) = impl_item.kind . && let id = impl_item.owner_id . // can't be implemented for unsafe new . && !sig.header.is_unsafe() . // shouldn't be implemented when it is hidden in docs 166 ( 0.00%) && !cx.tcx.is_doc_hidden(impl_item.owner_id.def_id) . // when the result of `new()` depends on a parameter we should not require . // an impl of `Default` 166 ( 0.00%) && impl_item.generics.params.is_empty() 144 ( 0.00%) && sig.decl.inputs.is_empty() 110 ( 0.00%) && cx.effective_visibilities.is_exported(impl_item.owner_id.def_id) 1,209 ( 0.00%) => ???:::is_exported (22x) 18 ( 0.00%) && let self_ty = cx.tcx.type_of(item.owner_id).instantiate_identity().skip_norm_wip() 72 ( 0.00%) && self_ty == return_ty(cx, impl_item.owner_id) 1,950 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::return_ty (18x) 72 ( 0.00%) && let Some(default_trait_id) = cx.tcx.get_diagnostic_item(sym::Default) 1,908 ( 0.00%) => ???:::get_diagnostic_item (18x) . { 18 ( 0.00%) if self.impling_types.is_none() { . let mut impls = HirIdSet::default(); 98 ( 0.00%) for &d in cx.tcx.local_trait_impls(default_trait_id) { . let ty = cx.tcx.type_of(d).instantiate_identity().skip_norm_wip(); . if let Some(ty_def) = ty.ty_adt_def() . && let Some(local_def_id) = ty_def.did().as_local() . { . impls.insert(cx.tcx.local_def_id_to_hir_id(local_def_id)); . } . } 19 ( 0.00%) self.impling_types = Some(impls); 10 ( 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) . } . . // Check if a Default implementation exists for the Self type, regardless of . // generics 2 ( 0.00%) if let Some(ref impling_types) = self.impling_types . && let self_def = cx.tcx.type_of(item.owner_id).instantiate_identity().skip_norm_wip() . && let Some(self_def) = self_def.ty_adt_def() . && let Some(self_local_did) = self_def.did().as_local() 36 ( 0.00%) && let self_id = cx.tcx.local_def_id_to_hir_id(self_local_did) 18 ( 0.00%) && impling_types.contains(&self_id) . { . return; . } . 13 ( 0.00%) let mut app = Applicability::MachineApplicable; . let attrs_sugg = { . let mut sugg = String::new(); 39 ( 0.00%) for attr in cx.tcx.hir_attrs(assoc_item_hir_id) { 820 ( 0.00%) => ???:::hir_attrs (13x) 60 ( 0.00%) let Attribute::Parsed(AttributeKind::CfgTrace(attrs)) = attr else { . // This might be some other attribute that the `impl Default` ought to inherit. . // But it could also be one of the many attributes that: . // - can't be put on an impl block -- like `#[inline]` . // - we can't even build a suggestion for, since `Attribute::span` may panic. . // . // Because of all that, remain on the safer side -- don't inherit this attr, and just . // reduce the applicability 20 ( 0.00%) app = Applicability::MaybeIncorrect; . continue; . }; . . for (_, attr_span) in attrs { . sugg.push_str(&snippet_with_applicability(cx.sess(), *attr_span, "_", &mut app)); . sugg.push('\n'); . } . } 65 ( 0.00%) sugg . }; 13 ( 0.00%) let generics_sugg = snippet_with_applicability(cx, generics.span, "", &mut app); 52 ( 0.00%) let where_clause_sugg = if generics.has_where_clause_predicates { . let where_clause_sugg = . snippet_with_applicability(cx, generics.where_clause_span, "", &mut app).to_string(); . let mut where_clause_sugg = reindent_multiline(&where_clause_sugg, true, Some(4)); . if impl_item.generics.has_where_clause_predicates { . if !where_clause_sugg.ends_with(',') { . where_clause_sugg.push(','); . } . -- line 154 ---------------------------------------- -- line 157 ---------------------------------------- . let ident = indent_of(cx, generics.where_clause_span).unwrap_or(0); . // Remove the leading `where ` keyword . let additional_where_preds = additional_where_preds.trim_start_matches("where").trim_start(); . where_clause_sugg.push('\n'); . where_clause_sugg.extend(std::iter::repeat_n(' ', ident)); . where_clause_sugg.push_str(additional_where_preds); . } . format!("\n{where_clause_sugg}\n") 39 ( 0.00%) } else if impl_item.generics.has_where_clause_predicates { . let where_clause_sugg = . snippet_with_applicability(cx, impl_item.generics.where_clause_span, "", &mut app); . let where_clause_sugg = reindent_multiline(&where_clause_sugg, true, Some(4)); . format!("\n{}\n", where_clause_sugg.trim_start()) . } else { . String::new() . }; . let self_ty_fmt = self_ty.to_string(); 13 ( 0.00%) let self_type_snip = snippet_with_applicability(cx, impl_self_ty.span, &self_ty_fmt, &mut app); . span_lint_hir_and_then( . cx, 39 ( 0.00%) NEW_WITHOUT_DEFAULT, . id.into(), 13 ( 0.00%) impl_item.span, 39 ( 0.00%) format!("you should consider adding a `Default` implementation for `{self_type_snip}`"), . |diag| { . diag.suggest_append_item( . cx, 13 ( 0.00%) item.span, . "try adding this", . &create_new_without_default_suggest_msg( . &attrs_sugg, . &self_type_snip, . &generics_sugg, . &where_clause_sugg, . ), 13 ( 0.00%) app, . ); . }, . ); . } . } 47,504 ( 0.00%) } . } . . fn create_new_without_default_suggest_msg( . attrs_sugg: &str, . self_type_snip: &str, . generics_sugg: &str, . where_clause_sugg: &str, . ) -> String { . #[rustfmt::skip] 156 ( 0.00%) format!( . "{attrs_sugg}impl{generics_sugg} Default for {self_type_snip}{where_clause_sugg} {{ . fn default() -> Self {{ . Self::new() . }} . }}") . } 6,785 ( 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/dep_graph/graph.rs -------------------------------------------------------------------------------- Ir -- line 60 ---------------------------------------- . . /// This field is used for assigning DepNodeIndices when running in . /// non-incremental mode. Even in non-incremental mode we make sure that . /// each task has a `DepNodeIndex` that uniquely identifies it. This unique . /// ID is used for self-profiling. . virtual_dep_node_index: Arc, . } . 323,031 ( 0.00%) rustc_index::newtype_index! { . pub struct DepNodeIndex {} . } . . // We store a large collection of these in `prev_index_to_index` during . // non-full incremental builds, and want to ensure that the element size . // doesn't inadvertently increase. . rustc_data_structures::static_assert_size!(Option, 4); . -- line 76 ---------------------------------------- -- line 500 ---------------------------------------- . hashing_timer.finish_with_query_invocation_id(dep_node_index.into()); . dep_node_index . } . } . . impl DepGraph { . #[inline] . pub fn read_index(&self, dep_node_index: DepNodeIndex) { 553,156 ( 0.00%) if let Some(ref data) = self.data { . read_deps(|task_deps| { 549,090 ( 0.00%) let mut task_deps = match task_deps { . TaskDepsRef::Allow(deps) => deps.lock(), . TaskDepsRef::EvalAlways => { . // We don't need to record dependencies of eval_always . // queries. They are re-evaluated unconditionally anyway. . return; . } . TaskDepsRef::Ignore => return, . TaskDepsRef::Forbid => { -- line 518 ---------------------------------------- 140,975 ( 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, . { 110,914 ( 0.00%) default fn from_iter(iterator: I) -> Self { 411,037 ( 0.00%) SpecFromIterNested::from_iter(iterator) 8,606,674 ( 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<(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 (334,416x) 99,865 ( 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 ---------------------------------------- 111 ( 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. 621,006 ( 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 { 581,725 ( 0.00%) Relaxed => intrinsics::atomic_load::(dst), 449,713 ( 0.00%) Acquire => intrinsics::atomic_load::(dst), 237,288 ( 0.00%) 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] . #[cfg(target_has_atomic)] -- line 4004 ---------------------------------------- -- 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), 4,528 ( 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 { 372,182 ( 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), 476,047 ( 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) => { 6,792 ( 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 ---------------------------------------- 5,434 ( 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/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. 192,502 ( 0.00%) if text.len() < 2 * USIZE_BYTES { . return memchr_naive(x, text); . } . 298,924 ( 0.00%) memchr_aligned(x, text) 892,095 ( 0.01%) => ???:core::slice::memchr::memchr_aligned (7,856x) . } . . #[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)`. 213,918 ( 0.00%) while i < text.len() { 175,563 ( 0.00%) if text[i] == x { . return Some(i); . } . 73,985 ( 0.00%) 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 ---------------------------------------- 80,673 ( 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 { 681,735 ( 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 { 139,848 ( 0.00%) self.provider.get_lint_level_spec(lint, self.sess) 2,595,141 ( 0.02%) => ???:::get_lint_level_spec (14,988x) . } . . /// 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,988 ( 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 ---------------------------------------- 37,954 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/matches/needless_match.rs -------------------------------------------------------------------------------- Ir -- line 9 ---------------------------------------- . }; . use rustc_errors::Applicability; . use rustc_hir::{ . Arm, BindingMode, ByRef, Expr, ExprKind, ItemKind, Node, Pat, PatExpr, PatExprKind, PatKind, Path, QPath, . }; . use rustc_lint::LateContext; . use rustc_span::{SyntaxContext, sym}; . 7,840 ( 0.00%) pub(crate) fn check_match(cx: &LateContext<'_>, ex: &Expr<'_>, arms: &[Arm<'_>], expr: &Expr<'_>) { 7,796 ( 0.00%) if arms.len() > 1 && expr_ty_matches_p_ty(cx, ex, expr) && check_all_arms(cx, expr.span.ctxt(), ex, arms) { 564,850 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/matches/needless_match.rs:clippy_lints::matches::needless_match::expr_ty_matches_p_ty (1,110x) . let mut applicability = Applicability::MachineApplicable; . span_lint_and_sugg( . cx, . NEEDLESS_MATCH, . expr.span, . "this match expression is unnecessary", . "replace it with", . snippet_with_applicability(cx, ex.span, "..", &mut applicability).to_string(), . applicability, . ); . } 8,960 ( 0.00%) } . . /// Check for nop `if let` expression that assembled as unnecessary match . /// . /// ```rust,ignore . /// if let Some(a) = option { . /// Some(a) . /// } else { . /// None -- line 38 ---------------------------------------- -- line 43 ---------------------------------------- . /// if let SomeEnum::A = some_enum { . /// SomeEnum::A . /// } else if let SomeEnum::B = some_enum { . /// SomeEnum::B . /// } else { . /// some_enum . /// } . /// ``` 19,820 ( 0.00%) pub(crate) fn check_if_let<'tcx>(cx: &LateContext<'tcx>, ex: &Expr<'_>, if_let: &higher::IfLet<'tcx>) { 9,910 ( 0.00%) if !is_else_clause(cx.tcx, ex) 346,948 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_else_clause (1,982x) 15,776 ( 0.00%) && expr_ty_matches_p_ty(cx, if_let.let_expr, ex) 5,122,806 ( 0.04%) => site/frontend/rust-clippy/clippy_lints/src/matches/needless_match.rs:clippy_lints::matches::needless_match::expr_ty_matches_p_ty (1,972x) 12 ( 0.00%) && check_if_let_inner(cx, ex.span.ctxt(), if_let) 124 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/matches/needless_match.rs:clippy_lints::matches::needless_match::check_if_let_inner (2x) . { . let mut applicability = Applicability::MachineApplicable; . span_lint_and_sugg( . cx, . NEEDLESS_MATCH, . ex.span, . "this if-let expression is unnecessary", . "replace it with", . snippet_with_applicability(cx, if_let.let_expr.span, "..", &mut applicability).to_string(), . applicability, . ); . } 15,856 ( 0.00%) } . . fn check_all_arms(cx: &LateContext<'_>, ctxt: SyntaxContext, match_expr: &Expr<'_>, arms: &[Arm<'_>]) -> bool { . for arm in arms { 6 ( 0.00%) let arm_expr = peel_blocks_with_stmt(arm.body); . 18 ( 0.00%) if let Some(guard_expr) = &arm.guard 6 ( 0.00%) && guard_expr.can_have_side_effects() 135 ( 0.00%) => ???:::can_have_side_effects (2x) . { . return false; . } . 12 ( 0.00%) if let PatKind::Wild = arm.pat.kind { . if !eq_expr_value(cx, ctxt, match_expr, arm_expr) { . return false; . } 8 ( 0.00%) } else if !pat_same_as_expr(arm.pat, arm_expr) { 161 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/matches/needless_match.rs:clippy_lints::matches::needless_match::pat_same_as_expr (4x) . return false; . } . } . . true . } . 14 ( 0.00%) fn check_if_let_inner(cx: &LateContext<'_>, ctxt: SyntaxContext, if_let: &higher::IfLet<'_>) -> bool { 6 ( 0.00%) if let Some(if_else) = if_let.if_else { 10 ( 0.00%) if !pat_same_as_expr(if_let.let_pat, peel_blocks_with_stmt(if_let.if_then)) { 36 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/matches/needless_match.rs:clippy_lints::matches::needless_match::pat_same_as_expr (2x) . return false; . } . . // Recursively check for each `else if let` phrase, . if let Some(ref nested_if_let) = higher::IfLet::hir(cx, if_else) . && SpanlessEq::new(cx).eq_expr(ctxt, nested_if_let.let_expr, if_let.let_expr) . { . return check_if_let_inner(cx, ctxt, nested_if_let); -- line 101 ---------------------------------------- -- line 110 ---------------------------------------- . if let_expr_ty.is_diag_item(cx, sym::Option) { . return is_none_expr(cx, else_expr) || eq_expr_value(cx, ctxt, if_let.let_expr, else_expr); . } . return eq_expr_value(cx, ctxt, if_let.let_expr, else_expr); . } . } . . false 16 ( 0.00%) } . . /// Manually check for coercion casting by checking if the type of the match operand or let expr . /// differs with the assigned local variable or the function return type. 199,152 ( 0.00%) fn expr_ty_matches_p_ty(cx: &LateContext<'_>, expr: &Expr<'_>, p_expr: &Expr<'_>) -> bool { 298,728 ( 0.00%) match cx.tcx.parent_hir_node(p_expr.hir_id) { 367,506 ( 0.00%) => ???:::parent_hir_node (3,082x) . // Compare match_expr ty with local in `let local = match match_expr {..}` 211 ( 0.00%) Node::LetStmt(local) => { . let results = cx.typeck_results(); 1,477 ( 0.00%) return same_type_modulo_regions(results.node_type(local.hir_id), results.expr_ty(expr)); 8,212 ( 0.00%) => ???:::node_type (200x) . }, . // compare match_expr ty with RetTy in `fn foo() -> RetTy` 53 ( 0.00%) Node::Item(item) => { 106 ( 0.00%) if let ItemKind::Fn { .. } = item.kind { . let output = cx . .tcx 106 ( 0.00%) .fn_sig(item.owner_id) . .instantiate_identity() . .skip_norm_wip() . .output() . .skip_binder(); . return same_type_modulo_regions(output, cx.typeck_results().expr_ty(expr)); . } . }, . // check the parent expr for this whole block `{ match match_expr {..} }` 12,851 ( 0.00%) Node::Block(block) => { 77,106 ( 0.00%) if let Some(block_parent_expr) = get_parent_expr_for_hir(cx, block.hir_id) { 297,577 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr_for_hir (2,271x) . return expr_ty_matches_p_ty(cx, expr, block_parent_expr); . } . }, . // recursively call on `if xxx {..}` etc. 8,961 ( 0.00%) Node::Expr(p_expr) => { . return expr_ty_matches_p_ty(cx, expr, p_expr); . }, . _ => {}, . } . false 174,258 ( 0.00%) } . 18 ( 0.00%) fn pat_same_as_expr(pat: &Pat<'_>, expr: &Expr<'_>) -> bool { 87 ( 0.00%) match (&pat.kind, &expr.kind) { . // Example: `Some(val) => Some(val)` . (PatKind::TupleStruct(QPath::Resolved(_, path), tuple_params, _), ExprKind::Call(call_expr, call_params)) => { . if let ExprKind::Path(QPath::Resolved(_, call_path)) = call_expr.kind { . return over(path.segments, call_path.segments, |pat_seg, call_seg| { . pat_seg.ident.name == call_seg.ident.name . }) && same_non_ref_symbols(tuple_params, call_params); . } . }, -- line 166 ---------------------------------------- -- line 180 ---------------------------------------- . // Example: `Custom::TypeA => Custom::TypeB`, or `None => None` . ( . PatKind::Expr(PatExpr { . kind: PatExprKind::Path(QPath::Resolved(_, p_path)), . .. . }), . ExprKind::Path(QPath::Resolved(_, e_path)), . ) => { 9 ( 0.00%) return over(p_path.segments, e_path.segments, |p_seg, e_seg| { . p_seg.ident.name == e_seg.ident.name . }); . }, . // Example: `5 => 5` . (PatKind::Expr(pat_expr_expr), ExprKind::Lit(expr_spanned)) => { . if let PatExprKind::Lit { . lit: pat_spanned, . negated: false, -- line 196 ---------------------------------------- -- line 198 ---------------------------------------- . { . return pat_spanned.node == expr_spanned.node; . } . }, . _ => {}, . } . . false 24 ( 0.00%) } . . fn same_non_ref_symbols(pats: &[Pat<'_>], exprs: &[Expr<'_>]) -> bool { . if pats.len() != exprs.len() { . return false; . } . . for i in 0..pats.len() { . if !pat_same_as_expr(&pats[i], &exprs[i]) { -- line 214 ---------------------------------------- 162,740 ( 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/generic_args.rs -------------------------------------------------------------------------------- Ir -- line 218 ---------------------------------------- . } . } . } . . impl<'tcx> GenericArg<'tcx> { . #[inline] . pub fn kind(self) -> GenericArgKind<'tcx> { . let ptr = 14,206 ( 0.00%) unsafe { self.ptr.map_addr(|addr| NonZero::new_unchecked(addr.get() & !TAG_MASK)) }; . // SAFETY: use of `Interned::new_unchecked` here is ok because these . // pointers were originally created from `Interned` types in `pack()`, . // and this is just going in the other direction. . unsafe { 30,470 ( 0.00%) match self.ptr.addr().get() & TAG_MASK { . REGION_TAG => GenericArgKind::Lifetime(ty::Region(Interned::new_unchecked( . ptr.cast::>().as_ref(), . ))), . TYPE_TAG => GenericArgKind::Type(Ty(Interned::new_unchecked( . ptr.cast::>>().as_ref(), . ))), . CONST_TAG => GenericArgKind::Const(ty::Const(Interned::new_unchecked( . ptr.cast::>>().as_ref(), -- line 239 ---------------------------------------- -- line 336 ---------------------------------------- . ) -> Result { . match self.kind() { . GenericArgKind::Lifetime(lt) => lt.try_fold_with(folder).map(Into::into), . GenericArgKind::Type(ty) => ty.try_fold_with(folder).map(Into::into), . GenericArgKind::Const(ct) => ct.try_fold_with(folder).map(Into::into), . } . } . 306 ( 0.00%) fn fold_with>>(self, folder: &mut F) -> Self { . match self.kind() { 2,548 ( 0.00%) GenericArgKind::Lifetime(lt) => lt.fold_with(folder).into(), 569 ( 0.00%) GenericArgKind::Type(ty) => ty.fold_with(folder).into(), . GenericArgKind::Const(ct) => ct.fold_with(folder).into(), . } 260 ( 0.00%) } . } . . impl<'tcx> TypeVisitable> for GenericArg<'tcx> { . fn visit_with>>(&self, visitor: &mut V) -> V::Result { 3,792 ( 0.00%) match self.kind() { . GenericArgKind::Lifetime(lt) => lt.visit_with(visitor), 158 ( 0.00%) GenericArgKind::Type(ty) => ty.visit_with(visitor), . GenericArgKind::Const(ct) => ct.visit_with(visitor), . } . } . } . . impl<'tcx, E: TyEncoder<'tcx>> Encodable for GenericArg<'tcx> { . fn encode(&self, e: &mut E) { . self.kind().encode(e) -- line 365 ---------------------------------------- -- line 419 ---------------------------------------- . /// compiler that encodes information like the inferred type; . /// see `ty::InlineConstArgs` struct for more comments. . pub fn as_inline_const(&'tcx self) -> InlineConstArgs<'tcx> { . InlineConstArgs { args: self } . } . . /// Creates a [`GenericArgs`] that maps each generic parameter to itself. . pub fn identity_for_item(tcx: TyCtxt<'tcx>, def_id: impl Into) -> GenericArgsRef<'tcx> { 56 ( 0.00%) Self::for_item(tcx, def_id.into(), |param, _| tcx.mk_param_from_def(param)) 3,912 ( 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/generic_args.rs:>::for_item::<>::identity_for_item::{closure#0}> (8x) . } . . /// Creates a [`GenericArgs`] for generic parameter definitions, . /// by calling closures to obtain each kind. . /// The closures get to observe the [`GenericArgs`] as they're . /// being built, which can be used to correctly . /// replace defaults of generic parameters. 96 ( 0.00%) pub fn for_item(tcx: TyCtxt<'tcx>, def_id: DefId, mut mk_kind: F) -> GenericArgsRef<'tcx> . where . F: FnMut(&ty::GenericParamDef, &[GenericArg<'tcx>]) -> GenericArg<'tcx>, . { . let defs = tcx.generics_of(def_id); . let count = defs.count(); . let mut args = SmallVec::with_capacity(count); 32 ( 0.00%) Self::fill_item(&mut args, tcx, defs, &mut mk_kind); 2,416 ( 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/generic_args.rs:>::fill_item::<>::identity_for_item::{closure#0}> (8x) 16 ( 0.00%) tcx.mk_args(&args) 672 ( 0.00%) => ???:::mk_args (8x) 56 ( 0.00%) } . . pub fn extend_to( . &self, . tcx: TyCtxt<'tcx>, . def_id: DefId, . mut mk_kind: F, . ) -> GenericArgsRef<'tcx> . where . F: FnMut(&ty::GenericParamDef, &[GenericArg<'tcx>]) -> GenericArg<'tcx>, . { . Self::for_item(tcx, def_id, |param, args| { . self.get(param.index as usize).cloned().unwrap_or_else(|| mk_kind(param, args)) . }) . } . 160 ( 0.00%) pub fn fill_item( . args: &mut SmallVec<[GenericArg<'tcx>; 8]>, . tcx: TyCtxt<'tcx>, . defs: &ty::Generics, . mk_kind: &mut F, . ) where . F: FnMut(&ty::GenericParamDef, &[GenericArg<'tcx>]) -> GenericArg<'tcx>, . { 72 ( 0.00%) if let Some(def_id) = defs.parent { . let parent_defs = tcx.generics_of(def_id); 40 ( 0.00%) Self::fill_item(args, tcx, parent_defs, mk_kind); 614 ( 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/generic_args.rs:>::fill_item::<>::identity_for_item::{closure#0}>'2 (8x) . } 16 ( 0.00%) Self::fill_single(args, defs, mk_kind) 128 ( 0.00%) } . . pub fn fill_single( . args: &mut SmallVec<[GenericArg<'tcx>; 8]>, . defs: &ty::Generics, . mk_kind: &mut F, . ) where . F: FnMut(&ty::GenericParamDef, &[GenericArg<'tcx>]) -> GenericArg<'tcx>, . { . args.reserve(defs.own_params.len()); . for param in &defs.own_params { . let kind = mk_kind(param, args); 32 ( 0.00%) assert_eq!(param.index as usize, args.len(), "{args:#?}, {defs:#?}"); . args.push(kind); . } . } . . // Extend an `original_args` list to the full number of args expected by `def_id`, . // filling in the missing parameters with error ty/ct or 'static regions. . pub fn extend_with_error( . tcx: TyCtxt<'tcx>, -- line 493 ---------------------------------------- -- line 524 ---------------------------------------- . self.iter().filter_map(|arg| match arg.kind() { . ty::GenericArgKind::Lifetime(_) => None, . generic => Some(generic), . }) . } . . #[inline] . #[track_caller] 24 ( 0.00%) pub fn type_at(&self, i: usize) -> Ty<'tcx> { 1,971 ( 0.00%) self[i].as_type().unwrap_or_else( . #[track_caller] . || bug!("expected type for param #{} in {:?}", i, self), . ) 16 ( 0.00%) } . . #[inline] . #[track_caller] . pub fn region_at(&self, i: usize) -> ty::Region<'tcx> { . self[i].as_region().unwrap_or_else( . #[track_caller] . || bug!("expected region for param #{} in {:?}", i, self), . ) -- line 545 ---------------------------------------- -- line 626 ---------------------------------------- . Ok(folder.cx().mk_args(&[param0, param1])) . } . } . 0 => Ok(self), . _ => ty::util::try_fold_list(self, folder, |tcx, v| tcx.mk_args(v)), . } . } . 27,620 ( 0.00%) fn fold_with>>(self, folder: &mut F) -> Self { . // See justification for this behavior in `try_fold_with`. 15,011 ( 0.00%) match self.len() { . 1 => { 2,981 ( 0.00%) let param0 = self[0].fold_with(folder); 36,001 ( 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/generic_args.rs:>::fold_with::> (68x) 22,580 ( 0.00%) if param0 == self[0] { self } else { folder.cx().mk_args(&[param0]) } . } . 2 => { 221 ( 0.00%) let param0 = self[0].fold_with(folder); 9,352 ( 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/generic_args.rs:>::fold_with::> (14x) 607 ( 0.00%) let param1 = self[1].fold_with(folder); 1,671 ( 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/generic_args.rs:>::fold_with::> (14x) 867 ( 0.00%) if param0 == self[0] && param1 == self[1] { . self . } else { 979 ( 0.00%) folder.cx().mk_args(&[param0, param1]) . } . } . 0 => self, 54 ( 0.00%) _ => ty::util::fold_list(self, folder, |tcx, v| tcx.mk_args(v)), 1,146 ( 0.00%) => ???:::mk_args (9x) . } 27,708 ( 0.00%) } . } . . impl<'tcx> TypeFoldable> for &'tcx ty::List> { . fn try_fold_with>>( . self, . folder: &mut F, . ) -> Result { . // This code is fairly hot, though not as hot as `GenericArgsRef`. -- line 661 ---------------------------------------- -- line 682 ---------------------------------------- . } else { . Ok(folder.cx().mk_type_list(&[param0, param1])) . } . } . _ => ty::util::try_fold_list(self, folder, |tcx, v| tcx.mk_type_list(v)), . } . } . 138,888 ( 0.00%) fn fold_with>>(self, folder: &mut F) -> Self { . // See comment justifying behavior in `try_fold_with`. 30,864 ( 0.00%) match self.len() { . 2 => { 3,782 ( 0.00%) let param0 = self[0].fold_with(folder); 11,346 ( 0.00%) let param1 = self[1].fold_with(folder); 11,370 ( 0.00%) if param0 == self[0] && param1 == self[1] { . self . } else { 26,474 ( 0.00%) folder.cx().mk_type_list(&[param0, param1]) 386,880 ( 0.00%) => ???:::mk_type_list (3,779x) . } . } 11,650 ( 0.00%) _ => ty::util::fold_list(self, folder, |tcx, v| tcx.mk_type_list(v)), 1,347,637 ( 0.01%) => ???:::mk_type_list (11,649x) . } 138,888 ( 0.00%) } . } . . impl<'tcx, T: TypeVisitable>> TypeVisitable> for &'tcx ty::List { . #[inline] . fn visit_with>>(&self, visitor: &mut V) -> V::Result { 31,729 ( 0.00%) walk_visitable_list!(visitor, self.iter()); . V::Result::output() . } . } . . /// Stores the user-given args to reach some fully qualified path . /// (e.g., `::Item` or `::Item`). . #[derive(Copy, Clone, Debug, PartialEq, Eq, Hash, TyEncodable, TyDecodable)] . #[derive(StableHash, TypeFoldable, TypeVisitable, Lift)] -- line 718 ---------------------------------------- 38,555 ( 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_type_ir/src/binder.rs -------------------------------------------------------------------------------- Ir -- line 18 ---------------------------------------- . use crate::{self as ty, DebruijnIndex, Interner, Region, UniverseIndex, Unnormalized}; . . /// `Binder` is a binder for higher-ranked lifetimes or types. It is part of the . /// compiler's representation for things like `for<'a> Fn(&'a isize)` . /// (which would be represented by the type `PolyTraitRef == Binder`). . /// . /// See . /// for more details. 63 ( 0.00%) #[derive_where(Clone, Copy, Hash, PartialEq, Debug; I: Interner, T)] . #[derive(GenericTypeVisitable, Lift_Generic)] . #[cfg_attr(feature = "nightly", derive(StableHash_NoContext))] . pub struct Binder { . value: T, . bound_vars: I::BoundVarKinds, . } . . impl Eq for Binder {} -- line 34 ---------------------------------------- -- line 37 ---------------------------------------- . where . T: TypeVisitable, . { . /// Wraps `value` in a binder, asserting that `value` does not . /// contain any bound vars that would be bound by the . /// binder. This is commonly used to 'inject' a value T into a . /// different binding level. . #[track_caller] 160 ( 0.00%) pub fn dummy(value: T) -> Binder { . assert!( 84 ( 0.00%) !value.has_escaping_bound_vars(), . "`{value:?}` has escaping bound vars, so it cannot be wrapped in a dummy binder." . ); . Binder { value, bound_vars: Default::default() } 320 ( 0.00%) } . . pub fn bind_with_vars(value: T, bound_vars: I::BoundVarKinds) -> Binder { . if cfg!(debug_assertions) { . let mut validator = ValidateBoundVars::new(bound_vars); . let _ = value.visit_with(&mut validator); . } 9,874 ( 0.00%) Binder { value, bound_vars } . } . } . . impl> TypeFoldable for Binder { . fn try_fold_with>(self, folder: &mut F) -> Result { . folder.try_fold_binder(self) . } . -- line 66 ---------------------------------------- -- line 79 ---------------------------------------- . fn try_super_fold_with>( . self, . folder: &mut F, . ) -> Result { . self.try_map_bound(|t| t.try_fold_with(folder)) . } . . fn super_fold_with>(self, folder: &mut F) -> Self { 306 ( 0.00%) self.map_bound(|t| t.fold_with(folder)) 3,245 ( 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/predicate.rs: as rustc_type_ir::fold::TypeFoldable>::fold_with::> (55x) . } . } . . impl> TypeSuperVisitable for Binder { . fn super_visit_with>(&self, visitor: &mut V) -> V::Result { . self.as_ref().skip_binder().visit_with(visitor) . } . } -- line 95 ---------------------------------------- -- line 104 ---------------------------------------- . /// . /// `skip_binder` is only valid when you are either extracting data that does not reference . /// any generic arguments, e.g. a `DefId`, or when you're making sure you only pass the . /// value to things which can handle escaping bound vars. . /// . /// See existing uses of `.skip_binder()` in `rustc_trait_selection::traits::select` . /// or `rustc_next_trait_solver` for examples. . pub fn skip_binder(self) -> T { 10,266 ( 0.00%) self.value . } . . pub fn bound_vars(&self) -> I::BoundVarKinds { . self.bound_vars . } . . pub fn as_ref(&self) -> Binder { . Binder { value: &self.value, bound_vars: self.bound_vars } -- line 120 ---------------------------------------- -- line 139 ---------------------------------------- . F: FnOnce(T) -> U, . { . let Binder { value, bound_vars } = self; . let value = f(value); . if cfg!(debug_assertions) { . let mut validator = ValidateBoundVars::new(bound_vars); . let _ = value.visit_with(&mut validator); . } 984 ( 0.00%) Binder { value, bound_vars } . } . . pub fn try_map_bound, E>(self, f: F) -> Result, E> . where . F: FnOnce(T) -> Result, . { . let Binder { value, bound_vars } = self; 31 ( 0.00%) let value = f(value)?; . if cfg!(debug_assertions) { . let mut validator = ValidateBoundVars::new(bound_vars); . let _ = value.visit_with(&mut validator); . } . Ok(Binder { value, bound_vars }) . } . . /// Wraps a `value` in a binder, using the same bound variables as the -- line 163 ---------------------------------------- -- line 168 ---------------------------------------- . /// This currently doesn't do anything different than `bind`, because we . /// don't actually track bound vars. However, semantically, it is different . /// because bound vars aren't allowed to change here, whereas they are . /// in `bind`. This may be (debug) asserted in the future. . pub fn rebind(&self, value: U) -> Binder . where . U: TypeVisitable, . { 4,047 ( 0.00%) Binder::bind_with_vars(value, self.bound_vars) . } . . /// Unwraps and returns the value within, but only if it contains . /// no bound vars at all. (In other words, if this binder -- . /// and indeed any enclosing binder -- doesn't bind anything at . /// all.) Otherwise, returns `None`. . /// . /// (One could imagine having a method that just unwraps a single . /// binder, but permits late-bound vars bound by enclosing . /// binders, but that would require adjusting the debruijn . /// indices, and given the shallow binding structure we often use, . /// would not be that useful.) 2 ( 0.00%) pub fn no_bound_vars(self) -> Option . where . T: TypeVisitable, . { . // `self.value` is equivalent to `self.skip_binder()` . if self.value.has_escaping_bound_vars() { None } else { Some(self.skip_binder()) } 6 ( 0.00%) } . } . . impl Binder> { . pub fn transpose(self) -> Option> { . let Binder { value, bound_vars } = self; . value.map(|value| Binder { value, bound_vars }) . } . } -- line 203 ---------------------------------------- -- line 327 ---------------------------------------- . /// For early binders, you should first call `instantiate` before using any visitors. . impl !TypeVisitable for ty::EarlyBinder {} . ); . . impl> EarlyBinder { . pub fn bind(cx: I, value: T) -> EarlyBinder { . // Instantiation will require normalization. . let value = ty::set_aliases_to_non_rigid(cx, value).skip_normalization(); 40 ( 0.00%) EarlyBinder { value, _tcx: PhantomData } . } . } . . impl> + Clone> EarlyBinder { . pub fn bind_iter(value: T) -> EarlyBinder { . #[cfg(debug_assertions)] . { . value.clone().into_iter().for_each(|v| assert!(!v.has_rigid_aliases())); -- line 343 ---------------------------------------- -- line 406 ---------------------------------------- . /// set up to handle these uninstantiated generic parameters. . /// . /// To skip the binder on `x: &EarlyBinder` to obtain `&T`, leverage . /// [`EarlyBinder::as_ref`](EarlyBinder::as_ref): `x.as_ref().skip_binder()`. . /// . /// See also [`Binder::skip_binder`](Binder::skip_binder), which is . /// the analogous operation on [`Binder`]. . pub fn skip_binder(self) -> T { 9,017 ( 0.00%) self.value . } . } . . impl EarlyBinder> { . pub fn def_id(&self) -> I::TraitId { . self.value.def_id . } . } -- line 422 ---------------------------------------- -- line 629 ---------------------------------------- . } . . fn size_hint(&self) -> (usize, Option) { . self.t.size_hint() . } . } . . impl> ty::EarlyBinder { 30 ( 0.00%) pub fn instantiate(self, cx: I, args: A) -> Unnormalized . where . A: SliceLike, . { . // Nothing to fold, so let's avoid visiting things and possibly re-hashing/equating . // them when interning. Perf testing found this to be a modest improvement. . // See: 85 ( 0.00%) if args.is_empty() { . assert!( 20 ( 0.00%) !self.value.has_param(), . "{:?} has parameters, but no args were provided in instantiate", . self.value, . ); . return Unnormalized::new(self.value); . } 321 ( 0.00%) let mut folder = ArgFolder { cx, args: args.as_slice(), binders_passed: 0 }; 171 ( 0.00%) Unnormalized::new(self.value.fold_with(&mut folder)) 117 ( 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/structural_impls.rs:>::fold_with::> (3x) 92 ( 0.00%) } . . /// Makes the identity replacement `T0 => T0, ..., TN => TN`. . /// Conceptually, this converts universally bound variables into placeholders . /// when inside of a given item. . /// . /// For example, consider `for fn foo(){ .. }`: . /// - Outside of `foo`, `T` is bound (represented by the presence of `EarlyBinder`). . /// - Inside of the body of `foo`, we treat `T` as a placeholder by calling -- line 662 ---------------------------------------- -- line 665 ---------------------------------------- . // FIXME(#155345): In case the bound value was already normalized, this . // is unnecessary. We may want to track explicitly whether `EarlyBinder` . // contains something that has been normalized already. . // Also do that for other types who have `instantiate_identity` method, . // e.g., `GenericClauses` and `ConstConditions`. . // . // This is annoying, as e.g. `type_of` for opaque types is normalized, . // while `type_of` for free type aliases is not. 1,048 ( 0.00%) Unnormalized::new(self.value) . } . . /// Returns the inner value, but only if it contains no bound vars. . pub fn no_bound_vars(self) -> Option { . if !self.value.has_param() { Some(self.value) } else { None } . } . } . -- line 681 ---------------------------------------- -- line 692 ---------------------------------------- . . impl<'a, I: Interner> TypeFolder for ArgFolder<'a, I> { . #[inline] . fn cx(&self) -> I { . self.cx . } . . fn fold_binder>(&mut self, t: ty::Binder) -> ty::Binder { 43 ( 0.00%) self.binders_passed += 1; . let t = t.super_fold_with(self); 43 ( 0.00%) self.binders_passed -= 1; . t . } . 126 ( 0.00%) fn fold_region(&mut self, r: Region) -> Region { . // Note: This routine only handles regions that are bound on . // type declarations and other outer declarations, not those . // bound in *fn types*. Region instantiation of the bound . // regions that appear in a function signature is done using . // the specialized routine `ty::replace_late_regions()`. 126 ( 0.00%) match r.kind() { . ty::ReEarlyParam(data) => { 30 ( 0.00%) let rk = self.args.get(data.index() as usize).map(|arg| arg.kind()); 36 ( 0.00%) => ???:::kind (6x) 12 ( 0.00%) match rk { 6 ( 0.00%) Some(ty::GenericArgKind::Lifetime(lt)) => self.shift_region_through_binders(lt), . Some(other) => self.region_param_expected(data, r, other), . None => self.region_param_out_of_range(data, r), . } . } . ty::ReBound(..) . | ty::ReLateParam(_) . | ty::ReStatic . | ty::RePlaceholder(_) . | ty::ReErased . | ty::ReError(_) => r, . ty::ReVar(_) => panic!("unexpected region: {r:?}"), . } 126 ( 0.00%) } . 375 ( 0.00%) fn fold_ty(&mut self, t: I::Ty) -> I::Ty { 136 ( 0.00%) if !t.has_param() { . return t; . } . 272 ( 0.00%) match t.kind() { . ty::Param(p) => self.ty_for_param(p, t), 348 ( 0.00%) _ => t.super_fold_with(self), 28,265 ( 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/structural_impls.rs:>::super_fold_with::> (58x) . } 525 ( 0.00%) } . . fn fold_const(&mut self, c: I::Const) -> I::Const { . if let ty::ConstKind::Param(p) = c.kind() { . self.const_for_param(p, c) . } else { . c.super_fold_with(self) . } . } -- line 748 ---------------------------------------- -- line 754 ---------------------------------------- . fn fold_clauses(&mut self, c: I::Clauses) -> I::Clauses { . if c.has_param() { c.super_fold_with(self) } else { c } . } . } . . impl<'a, I: Interner> ArgFolder<'a, I> { . fn ty_for_param(&self, p: I::ParamTy, source_ty: I::Ty) -> I::Ty { . // Look up the type in the args. It really should be in there. 312 ( 0.00%) let opt_ty = self.args.get(p.index() as usize).map(|arg| arg.kind()); 18 ( 0.00%) => ???:::kind (3x) 156 ( 0.00%) let ty = match opt_ty { . Some(ty::GenericArgKind::Type(ty)) => ty, . Some(kind) => self.type_param_expected(p, source_ty, kind), . None => self.type_param_out_of_range(p, source_ty), . }; . 78 ( 0.00%) self.shift_vars_through_binders(ty) . } . . #[cold] . #[inline(never)] . fn type_param_expected(&self, p: I::ParamTy, ty: I::Ty, kind: ty::GenericArgKind) -> ! { . panic!( . "expected type for `{:?}` ({:?}/{}) but found {:?} when instantiating, args={:?}", . p, -- line 777 ---------------------------------------- -- line 905 ---------------------------------------- . /// // DebruijnIndex of 1 | . /// // DebruijnIndex of 2 . /// ``` . /// As indicated in the diagram, here the same type `&'a i32` is instantiated once, but in the . /// first case we do not increase the De Bruijn index and in the second case we do. The reason . /// is that only in the second case have we passed through a fn binder. . #[instrument(level = "trace", skip(self), fields(binders_passed = self.binders_passed), ret)] . fn shift_vars_through_binders>(&self, val: T) -> T { 334 ( 0.00%) if self.binders_passed == 0 || !val.has_escaping_bound_vars() { . val . } else { . ty::shift_vars(self.cx, val, self.binders_passed) . } . } . . fn shift_region_through_binders(&self, region: Region) -> Region { 12 ( 0.00%) if self.binders_passed == 0 || !region.has_escaping_bound_vars() { . region . } else { . ty::shift_region(self.cx, region, self.binders_passed) . } . } . } . . /// Okay, we do something fun for `Bound` types/regions/consts: -- line 929 ---------------------------------------- -- line 976 ---------------------------------------- . if self.universe == ty::UniverseIndex::ROOT { . write!(f, "!{:?}", self.bound) . } else { . write!(f, "!{}_{:?}", self.universe.index(), self.bound) . } . } . } . 269,971 ( 0.00%) #[derive_where(Clone, Copy, PartialEq, Eq, Hash; I: Interner)] . #[derive(Lift_Generic, GenericTypeVisitable)] . #[cfg_attr( . feature = "nightly", . derive(Encodable_NoContext, Decodable_NoContext, StableHash_NoContext) . )] . pub enum BoundRegionKind { . /// An anonymous region parameter for a given fn (&T) . Anon, -- line 992 ---------------------------------------- -- line 1084 ---------------------------------------- . pub fn expect_const(self) { . match self { . BoundVariableKind::Const => (), . _ => panic!("expected a const, but found another kind"), . } . } . } . 7,251 ( 0.00%) #[derive_where(Clone, Copy, PartialEq, Eq, Hash; I: Interner)] . #[derive(GenericTypeVisitable, Lift_Generic)] . #[cfg_attr( . feature = "nightly", . derive(Encodable_NoContext, StableHash_NoContext, Decodable_NoContext) . )] . pub struct BoundRegion { . #[lift(identity)] . pub var: ty::BoundVar, -- line 1100 ---------------------------------------- 4,074 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/operators/manual_is_multiple_of.rs -------------------------------------------------------------------------------- Ir -- line 6 ---------------------------------------- . use rustc_ast::BinOpKind; . use rustc_errors::Applicability; . use rustc_hir::{Expr, ExprKind}; . use rustc_lint::LateContext; . use rustc_middle::ty::{self, Ty}; . . use super::MANUAL_IS_MULTIPLE_OF; . 47,352 ( 0.00%) pub(super) fn check<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'tcx>, . op: BinOpKind, . lhs: &'tcx Expr<'tcx>, . rhs: &'tcx Expr<'tcx>, . msrv: Msrv, . ) { 23,676 ( 0.00%) if msrv.meets(cx, msrvs::UNSIGNED_IS_MULTIPLE_OF) 106,542 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (3,946x) . && let Some(operand) = uint_compare_to_zero(cx, expr, op, lhs, rhs) . && let ExprKind::Binary(operand_op, operand_left, operand_right) = operand.kind . && operand_op.node == BinOpKind::Rem . && matches!( . cx.typeck_results().expr_ty_adjusted(operand_left).peel_refs().kind(), . ty::Uint(_) . ) . && matches!( -- line 30 ---------------------------------------- -- line 47 ---------------------------------------- . format!( . "{}{}.is_multiple_of({divisor})", . if op == BinOpKind::Eq { "" } else { "!" }, . Sugg::hir_with_context(cx, operand_left, expr.span.ctxt(), "_", &mut app).maybe_paren() . ), . app, . ); . } 31,568 ( 0.00%) } . . // If we have a `x == 0`, `x != 0` or `x > 0` (or the reverted ones), return the non-zero operand . fn uint_compare_to_zero<'tcx>( . cx: &LateContext<'tcx>, . e: &'tcx Expr<'tcx>, . op: BinOpKind, . lhs: &'tcx Expr<'tcx>, . rhs: &'tcx Expr<'tcx>, -- line 63 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 1,938,306 ( 0.02%) 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 { 22,049 ( 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, . { 122,746 ( 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()) . } . 18,905 ( 0.00%) if let Some(iter) = self.frontiter { . acc = fold(acc, iter); . } . 15 ( 0.00%) acc = self.iter.fold(acc, flatten(&mut fold)); . 47,226 ( 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`. . /// . /// Folds over the inner iterators, not over their elements. Is used by the `try_fold` and . /// `advance_by` methods. . #[inline] 1,008 ( 0.00%) fn iter_try_fold(&mut self, mut acc: Acc, mut fold: Fold) -> R . where . Fold: FnMut(Acc, &mut U) -> R, . R: Try, . { . #[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 { 9,033 ( 0.00%) move |acc, iter| fold(acc, frontiter.insert(iter.into_iter())) 3,305,739 ( 0.03%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/take_while.rs: 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} (5,823x) . } . 4,311 ( 0.00%) if let Some(iter) = &mut self.frontiter { . acc = fold(acc, iter)?; . } 732,446 ( 0.01%) self.frontiter = None; . 3,673 ( 0.00%) acc = self.iter.try_fold(acc, flatten(&mut self.frontiter, &mut fold))?; 248,307 ( 0.00%) self.frontiter = None; . 496,802 ( 0.00%) if let Some(iter) = &mut self.backiter { . acc = fold(acc, iter)?; . } 2,060 ( 0.00%) self.backiter = None; . . try { acc } 896 ( 0.00%) } . } . . impl FlattenCompat . where . I: DoubleEndedIterator>, . { . /// Folds the inner iterators into an accumulator by applying an operation, starting form the . /// back. -- line 448 ---------------------------------------- -- line 514 ---------------------------------------- . where . I: Iterator>, . U: Iterator, . { . type Item = U::Item; . . #[inline] . default fn next(&mut self) -> Option { 2,967 ( 0.00%) loop { . if let elt @ Some(_) = and_then_or_clear(&mut self.frontiter, Iterator::next) { . return elt; . } 14,988 ( 0.00%) match self.iter.next() { . None => return and_then_or_clear(&mut self.backiter, Iterator::next), 5,855 ( 0.00%) Some(inner) => self.frontiter = Some(inner.into_iter()), . } . } . } . . #[inline] . default fn size_hint(&self) -> (usize, Option) { . let (flo, fhi) = self.frontiter.as_ref().map_or((0, Some(0)), U::size_hint); . let (blo, bhi) = self.backiter.as_ref().map_or((0, Some(0)), U::size_hint); -- line 536 ---------------------------------------- -- line 541 ---------------------------------------- . . let lower = lower.saturating_mul(fixed_size).saturating_add(lo); . let upper = . try { fhi?.checked_add(bhi?)?.checked_add(fixed_size.checked_mul(upper?)?)? }; . . return (lower, upper); . } . 3 ( 0.00%) match (self.iter.size_hint(), fhi, bhi) { . ((0, Some(0)), Some(a), Some(b)) => (lo, a.checked_add(b)), . _ => (lo, None), . } . } . . #[inline] . default fn try_fold(&mut self, init: Acc, fold: Fold) -> R . where -- line 557 ---------------------------------------- -- line 558 ---------------------------------------- . Self: Sized, . Fold: FnMut(Acc, Self::Item) -> R, . R: Try, . { . #[inline] . fn flatten>( . mut fold: impl FnMut(Acc, U::Item) -> R, . ) -> impl FnMut(Acc, &mut U) -> R { 7,117 ( 0.00%) move |acc, iter| iter.try_fold(acc, &mut fold) . } . 172 ( 0.00%) self.iter_try_fold(init, flatten(fold)) 2,802,438 ( 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:, ::all_fields::{closure#0}>, core::slice::iter::Iter>>::iter_try_fold::<(), as core::iter::traits::iterator::Iterator>::try_fold::flatten, (), core::ops::control_flow::ControlFlow<()>, core::iter::adapters::map::map_try_fold<&rustc_middle::ty::FieldDef, rustc_type_ir::unnormalized::Unnormalized, (), core::ops::control_flow::ControlFlow<()>, clippy_lints::derive::derive_partial_eq_without_eq::check::{closure#0}, core::iter::traits::iterator::Iterator::all::check, clippy_lints::derive::derive_partial_eq_without_eq::check::{closure#1}>::{closure#0}>::{closure#0}>::{closure#0}, core::ops::control_flow::ControlFlow<()>> (40x) . } . . #[inline] . default fn fold(self, init: Acc, fold: Fold) -> Acc . where . Fold: FnMut(Acc, Self::Item) -> Acc, . { . #[inline] -- line 577 ---------------------------------------- -- line 602 ---------------------------------------- . } . } . . #[inline] . default fn count(self) -> usize { . #[inline] . #[rustc_inherit_overflow_checks] . fn count(acc: usize, iter: U) -> usize { 716 ( 0.00%) acc + iter.count() . } . 491 ( 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 { 23,145 ( 0.00%) while let Some(inner) = self.iter.next() { 2,944 ( 0.00%) if let item @ Some(_) = inner.into_iter().next() { . return item; . } . } . None . } . . #[inline] . fn size_hint(&self) -> (usize, Option) { -- line 864 ---------------------------------------- 663,787 ( 0.01%) -------------------------------------------------------------------------------- -- 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 { 2,180,052 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { . use self::Expression::{Bool, RetBool}; 484,456 ( 0.00%) if !e.span.from_expansion() . && let Some(higher::If { . cond, . then, . r#else: Some(else_expr), . }) = higher::If::hir(e) 706 ( 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); . }, . ); . }; 1,192 ( 0.00%) if let Some(a) = fetch_bool_block(then) 12,730 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_lints::needless_bool::fetch_bool_block (298x) 4 ( 0.00%) && let Some(b) = fetch_bool_block(else_expr) 45 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_lints::needless_bool::fetch_bool_block (1x) . { . match (a, b) { . (RetBool(true), RetBool(true)) | (Bool(true), Bool(true)) => { . span_lint( . cx, . NEEDLESS_BOOL, . e.span, . "this if-then-else expression will always return true", -- line 176 ---------------------------------------- -- 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), . _ => (), . } . } 1,492 ( 0.00%) if let Some((lhs_a, a)) = fetch_assign(then) 6,664 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_lints::needless_bool::fetch_assign (298x) 8 ( 0.00%) && let Some((lhs_b, b)) = fetch_assign(else_expr) 38 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_lints::needless_bool::fetch_assign (2x) . && 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:?};") . } else { -- line 203 ---------------------------------------- -- line 214 ---------------------------------------- . e.span, . "this if-then-else expression assigns a bool literal", . "you can reduce it to", . sugg, . applicability, . ); . } . } 1,937,824 ( 0.02%) } . 152,544 ( 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. 65,376 ( 0.00%) if let Some(tail) = block.expr 29,322 ( 0.00%) && !tail.span.from_expansion() 25,247 ( 0.00%) && let [.., last_stmt] = block.stmts 12,140 ( 0.00%) && let StmtKind::Semi(if_expr) | StmtKind::Expr(if_expr) = last_stmt.kind 2,720 ( 0.00%) && !if_expr.span.from_expansion() . && let Some(higher::If { . cond, . then, . r#else: None, . }) = higher::If::hir(if_expr) 484 ( 0.00%) && let ExprKind::Ret(Some(ret)) = peel_blocks_with_stmt(then).kind 1,882 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::peel_blocks_with_stmt (103x) 72 ( 0.00%) && let Some((then_func, then_val)) = fetch_bool_and_wrapper(ret) 493 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/needless_bool.rs:clippy_lints::needless_bool::fetch_bool_and_wrapper (24x) 12 ( 0.00%) && let Some((tail_func, tail_val)) = fetch_bool_and_wrapper(tail) 45 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/needless_bool.rs:clippy_lints::needless_bool::fetch_bool_and_wrapper (3x) . // `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); . if span_contains_comment(cx, span) { -- line 253 ---------------------------------------- -- line 274 ---------------------------------------- . NEEDLESS_BOOL, . span, . "this `if` guard returns a bool literal and is followed by another", . "you can reduce it to", . sugg, . applicability, . ); . } 174,336 ( 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); 6 ( 0.00%) if let Some(value) = fetch_bool_expr(expr) { . return Some((None, value)); . } 92 ( 0.00%) if let ExprKind::Call(func, [arg]) = expr.kind . && let Some(value) = fetch_bool_expr(arg) . { . return Some((Some(func), value)); . } . None 27 ( 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 { 903 ( 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)?)), . } 299 ( 0.00%) } . . fn fetch_bool_expr(expr: &Expr<'_>) -> Option { 6 ( 0.00%) if let ExprKind::Lit(lit_ptr) = peel_blocks(expr).kind 187 ( 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)> { 1,208 ( 0.00%) if let ExprKind::Assign(lhs, rhs, _) = peel_blocks_with_stmt(expr).kind { . fetch_bool_expr(rhs).map(|b| (lhs, b)) . } else { . None . } 300 ( 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 ---------------------------------------- 14,993 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/operators/manual_div_ceil.rs -------------------------------------------------------------------------------- Ir -- line 8 ---------------------------------------- . use rustc_errors::Applicability; . use rustc_hir::{Expr, ExprKind}; . use rustc_lint::LateContext; . use rustc_middle::ty::{self, Ty}; . use rustc_span::Spanned; . . use super::MANUAL_DIV_CEIL; . 53,888 ( 0.00%) pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>, op: BinOpKind, lhs: &Expr<'_>, rhs: &Expr<'_>, msrv: Msrv) { 6,736 ( 0.00%) let mut applicability = Applicability::MachineApplicable; . 6,736 ( 0.00%) if op == BinOpKind::Div 157 ( 0.00%) && check_int_ty_and_feature(cx, cx.typeck_results().expr_ty(lhs)) 1,252 ( 0.00%) => ???:::expr_ty (31x) 72 ( 0.00%) && check_int_ty_and_feature(cx, cx.typeck_results().expr_ty(rhs)) 960 ( 0.00%) => ???:::expr_ty (24x) 144 ( 0.00%) && msrv.meets(cx, msrvs::DIV_CEIL) 648 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (24x) . { 24 ( 0.00%) let ctxt = expr.span.ctxt(); 166 ( 0.00%) match lhs.kind { 15 ( 0.00%) ExprKind::Binary(inner_op, inner_lhs, inner_rhs) => { . // (x + (y - 1)) / y 10 ( 0.00%) if let ExprKind::Binary(sub_op, sub_lhs, sub_rhs) = inner_rhs.kind . && inner_op.node == BinOpKind::Add . && sub_op.node == BinOpKind::Sub . && check_literal(sub_rhs) . && eq_expr_value(cx, ctxt, sub_lhs, rhs) . { . build_suggestion(cx, expr, inner_lhs, rhs, &mut applicability); . return; . } . . // ((y - 1) + x) / y 10 ( 0.00%) if let ExprKind::Binary(sub_op, sub_lhs, sub_rhs) = inner_lhs.kind . && inner_op.node == BinOpKind::Add . && sub_op.node == BinOpKind::Sub . && check_literal(sub_rhs) . && eq_expr_value(cx, ctxt, sub_lhs, rhs) . { . build_suggestion(cx, expr, inner_rhs, rhs, &mut applicability); . return; . } -- line 47 ---------------------------------------- -- line 52 ---------------------------------------- . && add_op.node == BinOpKind::Add . && check_literal(inner_rhs) . && eq_expr_value(cx, ctxt, add_rhs, rhs) . { . build_suggestion(cx, expr, add_lhs, rhs, &mut applicability); . } . . // (x + (Y - 1)) / Y 28 ( 0.00%) if inner_op.node == BinOpKind::Add && differ_by_one(inner_rhs, rhs) { 50 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/operators/manual_div_ceil.rs:clippy_lints::operators::manual_div_ceil::differ_by_one (2x) 10 ( 0.00%) build_suggestion(cx, expr, inner_lhs, rhs, &mut applicability); 460,277 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/operators/manual_div_ceil.rs:clippy_lints::operators::manual_div_ceil::build_suggestion (2x) . } . . // ((Y - 1) + x) / Y 8 ( 0.00%) if inner_op.node == BinOpKind::Add && differ_by_one(inner_lhs, rhs) { 14 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/operators/manual_div_ceil.rs:clippy_lints::operators::manual_div_ceil::differ_by_one (2x) . build_suggestion(cx, expr, inner_rhs, rhs, &mut applicability); . } . . // (x - (-Y - 1)) / Y . if inner_op.node == BinOpKind::Sub 6 ( 0.00%) && let ExprKind::Unary(UnOp::Neg, abs_div_rhs) = rhs.kind . && differ_by_one(abs_div_rhs, inner_rhs) . { . build_suggestion(cx, expr, inner_lhs, rhs, &mut applicability); . } . }, 6 ( 0.00%) ExprKind::MethodCall(method, receiver, [next_multiple_of_arg], _) 2 ( 0.00%) if method.ident.name == sym::next_multiple_of . && check_int_ty(cx.typeck_results().expr_ty(receiver)) . && eq_expr_value(cx, ctxt, next_multiple_of_arg, rhs) => . { . // x.next_multiple_of(Y) / Y . build_suggestion(cx, expr, receiver, rhs, &mut applicability); . }, 6 ( 0.00%) ExprKind::Call(callee, [receiver, next_multiple_of_arg]) => { . // int_type::next_multiple_of(x, Y) / Y 2 ( 0.00%) if let Some(impl_ty_binder) = callee 4 ( 0.00%) .ty_rel_def_if_named(cx, sym::next_multiple_of) 6 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/res.rs:<&rustc_hir::hir::Expr as clippy_utils::res::MaybeQPath>::ty_rel_def_if_named:: (1x) 3 ( 0.00%) .assoc_fn_parent(cx) 10 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/res.rs: as clippy_utils::res::MaybeDef>::assoc_fn_parent:: (1x) 4 ( 0.00%) .opt_impl_ty(cx) 16 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/res.rs: as clippy_utils::res::MaybeDef>::opt_impl_ty:: (1x) . && check_int_ty(impl_ty_binder.skip_binder()) . && eq_expr_value(cx, ctxt, next_multiple_of_arg, rhs) . { . build_suggestion(cx, expr, receiver, rhs, &mut applicability); . } . }, . _ => (), . } . } 53,888 ( 0.00%) } . . /// Checks if two expressions represent non-zero integer literals such that `small_expr + 1 == . /// large_expr`. . fn differ_by_one(small_expr: &Expr<'_>, large_expr: &Expr<'_>) -> bool { 12 ( 0.00%) if let ExprKind::Lit(small) = small_expr.kind 4 ( 0.00%) && let ExprKind::Lit(large) = large_expr.kind 8 ( 0.00%) && let LitKind::Int(s, _) = small.node . && let LitKind::Int(l, _) = large.node . { . Some(l.get()) == s.get().checked_add(1) 4 ( 0.00%) } else if let ExprKind::Unary(UnOp::Neg, small_inner_expr) = small_expr.kind . && let ExprKind::Unary(UnOp::Neg, large_inner_expr) = large_expr.kind . { . differ_by_one(large_inner_expr, small_inner_expr) . } else { . false . } 4 ( 0.00%) } . . fn check_int_ty(expr_ty: Ty<'_>) -> bool { . matches!(expr_ty.peel_refs().kind(), ty::Int(_) | ty::Uint(_)) . } . . fn check_int_ty_and_feature(cx: &LateContext<'_>, expr_ty: Ty<'_>) -> bool { . match expr_ty.peel_refs().kind() { . ty::Uint(_) => true, 5 ( 0.00%) ty::Int(_) => cx.tcx.features().enabled(sym::int_roundings), 40 ( 0.00%) => ???:::features (1x) 4 ( 0.00%) => ???:::enabled (1x) . _ => false, . } . } . . fn check_literal(expr: &Expr<'_>) -> bool { . if let ExprKind::Lit(lit) = expr.kind . && let LitKind::Int(Pu128(1), _) = lit.node . { . return true; . } . false . } . 32 ( 0.00%) fn build_suggestion( . cx: &LateContext<'_>, . expr: &Expr<'_>, . lhs: &Expr<'_>, . rhs: &Expr<'_>, . applicability: &mut Applicability, . ) { . let ctxt = expr.span.ctxt(); 28 ( 0.00%) let dividend_sugg = Sugg::hir_with_context(cx, lhs, ctxt, "..", applicability).maybe_paren(); 1,755 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/sugg.rs:::hir_with_context (2x) 76 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/sugg.rs:::maybe_paren (2x) 8 ( 0.00%) let rhs_ty = cx.typeck_results().expr_ty(rhs); 80 ( 0.00%) => ???:::expr_ty (2x) 6 ( 0.00%) let type_suffix = if cx.typeck_results().expr_ty(lhs).is_numeric() 80 ( 0.00%) => ???:::expr_ty (2x) 6 ( 0.00%) && matches!( 4 ( 0.00%) lhs.kind, . ExprKind::Lit(Spanned { . node: LitKind::Int(_, LitIntType::Unsuffixed), . .. . }) | ExprKind::Unary( . UnOp::Neg, . Expr { . kind: ExprKind::Lit(Spanned { . node: LitKind::Int(_, LitIntType::Unsuffixed), -- line 161 ---------------------------------------- -- line 164 ---------------------------------------- . .. . } . ) . ) { . format!("_{rhs_ty}") . } else { . String::new() . }; 2 ( 0.00%) let dividend_sugg_str = dividend_sugg.into_string(); 68 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/sugg.rs:::into_string (2x) . // If `dividend_sugg` has enclosing paren like `(-2048)` and we need to add type suffix in the . // suggestion message, we want to make a suggestion string before `div_ceil` like . // `(-2048_{type_suffix})`. 8 ( 0.00%) let suggestion_before_div_ceil = if has_enclosing_paren(÷nd_sugg_str) { 26 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/convert/mod.rs:clippy_utils::sugg::has_enclosing_paren::<&alloc::string::String> (2x) . format!("{}{type_suffix})", ÷nd_sugg_str[..dividend_sugg_str.len() - 1]) . } else { 12 ( 0.00%) format!("{dividend_sugg_str}{type_suffix}") . }; . . // Dereference the RHS if it is a reference type 20 ( 0.00%) let divisor_snippet = match Sugg::hir_with_context(cx, rhs, ctxt, "_", applicability) { 1,761 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/sugg.rs:::hir_with_context (2x) 4 ( 0.00%) sugg if rhs_ty.is_ref() => sugg.deref(), 16 ( 0.00%) sugg => sugg, . }; . 28 ( 0.00%) span_lint_and_sugg( 452,980 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_sugg:: (2x) . cx, . MANUAL_DIV_CEIL, . expr.span, . "manually reimplementing `div_ceil`", . "consider using `.div_ceil()`", 14 ( 0.00%) format!("{suggestion_before_div_ceil}.div_ceil({divisor_snippet})"), . *applicability, . ); 18 ( 0.00%) } 126 ( 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) 155 ( 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/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. 819,177 ( 0.01%) unsafe { crate::intrinsics::copy_nonoverlapping(src, dst, count) } 279 ( 0.00%) => ???:0x0000000000173dc0 (21x) . } . . /// 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) . ); 68,250 ( 0.00%) crate::intrinsics::copy(src, dst, count) 65 ( 0.00%) => ???:0x0000000000173dc0 (5x) . } . } . . /// 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) . ); 40,413 ( 0.00%) crate::intrinsics::write_bytes(dst, val, count) 1,114 ( 0.00%) => ???:0x00000000001747c0 (94x) . } . } . . /// 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 71 ( 0.00%) unsafe { drop_glue(&mut *to_drop) } 266 ( 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"] 5,049,169 ( 0.04%) pub(crate) const unsafe fn drop_glue(_: &mut T) 104 ( 0.00%) => ???:::drop (26x) . 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]>) { 17,348 ( 0.00%) let a = *x; . let b = *y; 44,732 ( 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) . ); 344,725 ( 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) . ); 1,630,441 ( 0.01%) intrinsics::write_via_move(dst, src) 4,277 ( 0.00%) => ???:0x0000000000173dc0 (329x) . } . } . . /// 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 { 90,714 ( 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 { 103,685 ( 0.00%) (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 ---------------------------------------- 242,138 ( 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/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 { 3,642,817 ( 0.03%) 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. 1,377,256 ( 0.01%) 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`. 8,556 ( 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 465 ---------------------------------------- . #[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) -> *const T . where . T: Sized, . { . // SAFETY: the `arith_offset` intrinsic has no prerequisites to be called. 400 ( 0.00%) unsafe { intrinsics::arith_offset(self, count) } . } . . /// 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 481 ---------------------------------------- -- 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`. 53,913 ( 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`. 244,190 ( 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`. 661,653 ( 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 { 392,664 ( 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 ---------------------------------------- 212,845 ( 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 { 22,137 ( 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> { 1,438,506 ( 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])> { 10,988 ( 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])> { 9,017 ( 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> { 4,392,557 ( 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> { 44,820 ( 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]> { 395,353 ( 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]> { 2,252 ( 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) { 178 ( 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; 362 ( 0.00%) while i < n { 163 ( 0.00%) mem::swap(&mut a[i], &mut b[n - 1 - i]); 3 ( 0.00%) i += 1; . } . } . } . . /// Returns an iterator over the slice. . /// . /// The iterator yields all items from start to end. . /// -- line 1023 ---------------------------------------- -- line 1391 ---------------------------------------- . /// ``` . #[stable(feature = "slice_as_chunks", since = "1.88.0")] . #[rustc_const_stable(feature = "slice_as_chunks", since = "1.88.0")] . #[inline] . #[track_caller] . #[must_use] . pub const fn as_chunks<#[rustc_panics_when_zero] const N: usize>(&self) -> (&[[T; N]], &[T]) { . assert!(N != 0, "chunk size must be non-zero"); 76 ( 0.00%) let len_rounded_down = self.len() / N * N; . // SAFETY: The rounded-down value is always the same or smaller than the . // original length, and thus must be in-bounds of the slice. . let (multiple_of_n, remainder) = unsafe { self.split_at_unchecked(len_rounded_down) }; . // SAFETY: We already panicked for zero, and ensured by construction . // that the length of the subslice is a multiple of N. . let array_slice = unsafe { multiple_of_n.as_chunks_unchecked() }; . (array_slice, remainder) . } -- line 1407 ---------------------------------------- -- line 2054 ---------------------------------------- . . assert_unsafe_precondition!( . check_library_ub, . "slice::split_at_unchecked requires the index to be within the slice", . (mid: usize = mid, len: usize = len) => mid <= len, . ); . . // SAFETY: Caller has to check that `0 <= mid <= self.len()` 114 ( 0.00%) unsafe { (from_raw_parts(ptr, mid), from_raw_parts(ptr.add(mid), unchecked_sub(len, mid))) } . } . . /// Divides one mutable slice into two at an index, without doing bounds checking. . /// . /// The first will contain all indices from `[0, mid)` (excluding . /// the index `mid` itself) and the second will contain all . /// indices from `[mid, len)` (excluding the index `len` itself). . /// -- line 2070 ---------------------------------------- -- 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), 557 ( 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])> { 13,751 ( 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])> { 2,240 ( 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 2596 ---------------------------------------- . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[inline] . #[must_use] . pub fn contains(&self, x: &T) -> bool . where . T: PartialEq, . { 48 ( 0.00%) cmp::SliceContains::slice_contains(x, self) 904 ( 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:<&str as core::slice::cmp::SliceContains>::slice_contains (16x) . } . . /// Returns `true` if `needle` is a prefix of the slice or equal to the slice. . /// . /// # Examples . /// . /// ``` . /// let v = [10, 40, 30]; -- line 2612 ---------------------------------------- -- 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(); 751,925 ( 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()); 473,090 ( 0.00%) 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 ---------------------------------------- -- line 2981 ---------------------------------------- . #[rustc_const_unstable(feature = "const_binary_search", issue = "159532")] . #[stable(feature = "rust1", since = "1.0.0")] . #[inline] . pub const fn binary_search_by<'a, F>(&'a self, mut f: F) -> Result . where . F: [const] FnMut(&'a T) -> Ordering + [const] Destruct, . { . let mut size = self.len(); 2,120 ( 0.00%) if size == 0 { . return Err(0); . } . let mut base = 0usize; . . // This loop intentionally doesn't have an early exit if the comparison . // returns Equal. We want the number of loop iterations to depend *only* . // on the size of the input slice so that the CPU can reliably predict . // the loop count. 15,068 ( 0.00%) while size > 1 { 15,068 ( 0.00%) let half = size / 2; 7,534 ( 0.00%) let mid = base + half; . . // SAFETY: the call is made safe by the following invariants: . // - `mid >= 0`: by definition . // - `mid < size`: `mid = size / 2 + size / 4 + size / 8 ...` 7,534 ( 0.00%) let cmp = f(unsafe { self.get_unchecked(mid) }); . . // Binary search interacts poorly with branch prediction, so force . // the compiler to use conditional moves if supported by the target . // architecture. . base = hint::select_unpredictable(cmp == Greater, base, mid); . . // This is imprecise in the case where `size` is odd and the . // comparison returns Greater: the mid element still gets included . // by `size` even though it's known to be larger than the element . // being searched for. . // . // This is fine though: we gain more performance by keeping the . // loop iteration count invariant (and thus predictable) than we . // lose from considering one additional element. 7,534 ( 0.00%) size -= half; . } . . // SAFETY: base is always in [0, size) because base <= mid. 530 ( 0.00%) let cmp = f(unsafe { self.get_unchecked(base) }); . if cmp == Equal { . // SAFETY: same as the `get_unchecked` above. . unsafe { hint::assert_unchecked(base < self.len()) }; . Ok(base) . } else { 530 ( 0.00%) let result = base + (cmp == Less) as usize; . // SAFETY: same as the `get_unchecked` above. . // Note that this is `<=`, unlike the assume in the `Ok` path. . unsafe { hint::assert_unchecked(result <= self.len()) }; . Err(result) . } . } . . /// Binary searches this slice with a key extraction function. -- line 3038 ---------------------------------------- 232,077 ( 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 224 ---------------------------------------- . fn count(self) -> usize . where . Self: Sized + [const] Destruct, . Self::Item: [const] Destruct, . { . self.fold( . 0, . #[rustc_inherit_overflow_checks] 751 ( 0.00%) const |accum, _elem| accum + 1, . ) . } . . /// Consumes the iterator, returning the last element. . /// . /// This method will evaluate the iterator until it returns [`None`]. While . /// doing so, it keeps track of the current element. After [`None`] is . /// returned, `last()` will then return the last element it saw. -- line 240 ---------------------------------------- -- line 328 ---------------------------------------- . impl SpecAdvanceBy for I { . fn spec_advance_by(&mut self, n: usize) -> Result<(), NonZero> { . let Some(n) = NonZero::new(n) else { . return Ok(()); . }; . . let res = self.try_fold(n, |n, _| NonZero::new(n.get() - 1)); . 1 ( 0.00%) match res { . None => Ok(()), . Some(n) => Err(n), . } . } . } . . self.spec_advance_by(n) . } -- line 344 ---------------------------------------- -- line 381 ---------------------------------------- . /// ``` . /// 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 { 72 ( 0.00%) self.advance_by(n).ok()?; 2,536 ( 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:::advance_by (24x) 187 ( 0.00%) self.next() 155 ( 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 (1x) . } . . /// 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) . } . 43,483 ( 0.00%) self.fold((), call(f)); 179,784 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/char/mod.rs:::fold::<(), core::iter::traits::iterator::Iterator::for_each::call>::extend::{closure#0}>::{closure#0}> (4,994x) . } . . /// 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:?}"); . } . 14,928 ( 0.00%) FromIterator::from_iter(self) 235,544 ( 0.00%) => /rust/deps/indexmap-2.14.0/src/map.rs:, rustc_hash::FxBuildHasher> as core::iter::traits::collect::FromIterator<(rustc_span::def_id::LocalDefId, alloc::vec::Vec)>>::from_iter::, >::new::{closure#0}>> (3,830x) . } . . /// 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| { 1,739 ( 0.00%) let p = predicate(&**x); 876 ( 0.00%) *true_count += p as usize; . !p . } . } . . #[inline] . fn is_true(predicate: &mut impl FnMut(&T) -> bool) -> impl FnMut(&&mut T) -> bool + '_ { 1,605 ( 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); 625 ( 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")] 2,121,219 ( 0.02%) 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; 13,081,896 ( 0.11%) while let Some(x) = self.next() { 175,368 ( 0.00%) => ???:::next (2,236x) 1,239,896 ( 0.01%) accum = f(accum, x)?; 298 ( 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 core::iter::traits::iterator::Iterator::all::check<&(rustc_middle::ty::predicate::Clause, rustc_span::span_encoding::Span), clippy_utils::eager_or_lazy::fn_eagerness::{closure#2}>::{closure#0} as core::ops::function::FnMut<((), &(rustc_middle::ty::predicate::Clause, rustc_span::span_encoding::Span))>>::call_mut (2x) . } . try { accum } 1,429,598 ( 0.01%) } . . /// 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; 2,553,342 ( 0.02%) while let Some(x) = self.next() { 8,921 ( 0.00%) => /home/moon/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/percent-encoding-2.3.2/src/lib.rs:::next (132x) 1,064,394 ( 0.01%) accum = f(accum, x); . } 3,878,955 ( 0.03%) 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()?; 924 ( 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 2828 ---------------------------------------- . where . Self: Sized, . F: FnMut(Self::Item) -> bool, . { . #[inline] . fn check(mut f: impl FnMut(T) -> bool) -> impl FnMut((), T) -> ControlFlow<()> { . move |(), x| { . if f(x) { ControlFlow::Continue(()) } else { ControlFlow::Break(()) } 2 ( 0.00%) } . } 38 ( 0.00%) self.try_fold((), check(f)) == ControlFlow::Continue(()) 7,190 ( 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:, core::slice::iter::Iter> as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::all::check<(&rustc_hir::hir::PatField, &rustc_hir::hir::PatField), clippy_utils::hir_utils::over::eq_pat::{closure#0}>::{closure#0}>::{closure#0}, core::ops::control_flow::ControlFlow<()>> (20x) 6,233 ( 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:, core::slice::iter::Iter> as core::iter::traits::iterator::Iterator>::try_fold::<(), core::iter::traits::iterator::Iterator::all::check<(&rustc_hir::hir::Pat, &rustc_hir::hir::Pat), clippy_utils::hir_utils::over::eq_pat::{closure#3}>::{closure#0}>::{closure#0}, core::ops::control_flow::ControlFlow<()>> (12x) . } . . /// Tests if any element of the iterator matches a predicate. . /// . /// `any()` takes a closure that returns `true` or `false`. It applies . /// this closure to each element of the iterator, and if any of them return . /// `true`, then so does `any()`. If they all return `false`, it . /// returns `false`. -- line 2846 ---------------------------------------- -- 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| { 2,655 ( 0.00%) if predicate(&x) { ControlFlow::Break(x) } else { ControlFlow::Continue(()) } 159 ( 0.00%) } . } . . self.try_fold((), check(predicate)).break_value() . } . . /// Applies function to the elements of iterator and returns . /// the first non-none result. . /// -- line 2972 ---------------------------------------- -- 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 { 499,254 ( 0.00%) move |(), x| match f(x) { 759 ( 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::unit_types::let_unit_value::check::{closure#2}::{closure#0} as core::ops::function::FnMut<(clippy_lints::unit_types::let_unit_value::VariableUsage,)>>::call_mut (11x) 2,759 ( 0.00%) Some(x) => ControlFlow::Break(x), . None => ControlFlow::Continue(()), . } . } . 178,697 ( 0.00%) self.try_fold((), check(f)).break_value() 84,763 ( 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> (2,009x) . } . . /// 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] 4,704 ( 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); 5,880 ( 0.00%) unzipped 5,292 ( 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, . { 2,201 ( 0.00%) self.eq_by(other, |x, y| x == y) 57,613 ( 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:, ::block::{closure#0}>, ::block::{closure#1}> as core::iter::traits::iterator::Iterator>::eq_by::<[rustc_lexer::TokenKind; 1], , ::block::{closure#0}>, ::block::{closure#1}> as core::iter::traits::iterator::Iterator>::eq<[rustc_lexer::TokenKind; 1]>::{closure#0}> (75x) . } . . /// 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] 2,168 ( 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 . F: FnMut(X, Y) -> bool, . { . move |x, y| { . if eq(x, y) { ControlFlow::Continue(()) } else { ControlFlow::Break(()) } . } . } . 849 ( 0.00%) SpecIterEq::spec_iter_eq(self, other.into_iter(), compare(eq)) 2,304 ( 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,666 ( 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 ---------------------------------------- -- line 4160 ---------------------------------------- . #[inline] . fn spec_iter_eq(self, b: B, f: F) -> bool . where . F: FnMut(Self::Item, ::Item) -> ControlFlow<()>, . { . // we *can't* short-circuit if: . match (self.size_hint(), b.size_hint()) { . // ... both iterators have the same length 2,760 ( 0.00%) ((_, Some(a)), (_, Some(b))) if a == b => {} . // ... or both of them are longer than `usize::MAX` (i.e. have an unknown length). . ((_, None), (_, None)) => {} . // otherwise, we can ascertain that they are unequal without actually comparing items . _ => return false, . } . . iter_eq(self, b, f) . } -- line 4176 ---------------------------------------- -- line 4202 ---------------------------------------- . B: Iterator, . { . move |x| match b.next() { . None => ControlFlow::Break(ControlFlow::Continue(Ordering::Greater)), . Some(y) => f(x, y).map_break(ControlFlow::Break), . } . } . 150 ( 0.00%) match a.try_for_each(compare(&mut b, f)) { . ControlFlow::Continue(()) => ControlFlow::Continue(match b.next() { . None => Ordering::Equal, . Some(_) => Ordering::Less, . }), . ControlFlow::Break(x) => x, . } . } . -- line 4218 ---------------------------------------- -- line 4229 ---------------------------------------- . /// Implements `Iterator` for mutable references to iterators, such as those produced by [`Iterator::by_ref`]. . /// . /// This implementation passes all method calls on to the original iterator. . #[stable(feature = "rust1", since = "1.0.0")] . impl Iterator for &mut I { . type Item = I::Item; . #[inline] . fn next(&mut self) -> Option { 4,012 ( 0.00%) (**self).next() 10,371 ( 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 core::iter::traits::iterator::Iterator>::next (1,804x) 2,277 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:, core::slice::iter::Iter> as core::iter::traits::iterator::Iterator>::next (202x) . } . fn size_hint(&self) -> (usize, Option) { . (**self).size_hint() . } . fn advance_by(&mut self, n: usize) -> Result<(), NonZero> { . (**self).advance_by(n) . } . fn nth(&mut self, n: usize) -> Option { -- line 4245 ---------------------------------------- 6,598,005 ( 0.05%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/ifs/branches_sharing_code.rs -------------------------------------------------------------------------------- Ir -- line 15 ---------------------------------------- . }; . use rustc_lint::LateContext; . use rustc_span::hygiene::walk_chain; . use rustc_span::source_map::SourceMap; . use rustc_span::{Span, Symbol, SyntaxContext}; . . use super::BRANCHES_SHARING_CODE; . 3,465 ( 0.00%) pub(super) fn check<'tcx>( . cx: &LateContext<'tcx>, . conds: &[&'tcx Expr<'_>], . blocks: &[&'tcx Block<'_>], . expr: &'tcx Expr<'_>, . ) { . // We only lint ifs with multiple blocks 770 ( 0.00%) let &[first_block, ref blocks @ ..] = blocks else { . return; . }; 1,155 ( 0.00%) let &[.., last_block] = blocks else { . return; . }; . . let res = scan_block_for_eq(cx, conds, first_block, blocks); . let sm = cx.tcx.sess.source_map(); . let start_suggestion = res.start_span(first_block, sm).map(|span| { 2 ( 0.00%) let first_line_span = first_line_of_span(cx, expr.span); . let replace_span = first_line_span.with_hi(span.hi()); 6 ( 0.00%) let cond_span = first_line_span.until(first_block.span); 384 ( 0.00%) => ???:::until (2x) 8 ( 0.00%) let cond_snippet = reindent_multiline(&snippet(cx, cond_span, "_"), false, None); 6,570 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::reindent_multiline (2x) 4 ( 0.00%) let cond_indent = indent_of(cx, cond_span); 2,428 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::indent_of::<&rustc_lint::context::LateContext> (2x) 8 ( 0.00%) let moved_snippet = reindent_multiline(&snippet(cx, span, "_"), true, None); 6,000 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::reindent_multiline (2x) 8 ( 0.00%) let suggestion = moved_snippet + "\n" + &cond_snippet + "{"; 10 ( 0.00%) let suggestion = reindent_multiline(&suggestion, true, cond_indent); 12,406 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::reindent_multiline (2x) 10 ( 0.00%) (replace_span, suggestion) . }); 8 ( 0.00%) let end_suggestion = res.end_span(last_block, sm).map(|span| { 4 ( 0.00%) let moved_snipped = reindent_multiline(&snippet(cx, span, "_"), true, None); 2,754 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::reindent_multiline (1x) 6 ( 0.00%) let indent = indent_of(cx, expr.span.shrink_to_hi()); 1,227 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::indent_of::<&rustc_lint::context::LateContext> (1x) 1 ( 0.00%) let suggestion = "}\n".to_string() + &moved_snipped; 6 ( 0.00%) let suggestion = reindent_multiline(&suggestion, true, indent); 5,718 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::reindent_multiline (1x) . 5 ( 0.00%) let span = span.with_hi(last_block.span.hi()); . // Improve formatting if the inner block has indentation (i.e. normal Rust formatting) . let span = span 3 ( 0.00%) .map_range(cx, |_, src, range| { 502 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/source.rs:::map_range::<&rustc_lint::context::LateContext, clippy_lints::ifs::branches_sharing_code::check::{closure#1}::{closure#0}> (1x) 4 ( 0.00%) (range.start > 4 && src.get(range.start - 4..range.start)? == " ") . .then_some(range.start - 4..range.end) . }) 2 ( 0.00%) .map_or(span, |range| range.with_ctxt(span.ctxt())); 24 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/source.rs: as clippy_utils::source::IntoSpan>::with_ctxt (1x) 4 ( 0.00%) (span, suggestion.clone()) 68 ( 0.00%) => ???:::clone (1x) . }); . 1,546 ( 0.00%) let (span, msg, end_span) = match (&start_suggestion, &end_suggestion) { . (&Some((span, _)), &Some((end_span, _))) => ( . span, . "all if blocks contain the same code at both the start and the end", . Some(end_span), . ), . (&Some((span, _)), None) => (span, "all if blocks contain the same code at the start", None), . (None, &Some((span, _))) => (span, "all if blocks contain the same code at the end", None), . (None, None) => return, . }; 69 ( 0.00%) span_lint_and_then(cx, BRANCHES_SHARING_CODE, span, msg, |diag| { 4,571 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then:: (3x) . if let Some(span) = end_span { . diag.span_note(span, "this code is shared at the end"); . } . if let Some((span, sugg)) = start_suggestion { . diag.span_suggestion( . span, . "consider moving these statements before the if", . sugg, -- line 85 ---------------------------------------- -- line 96 ---------------------------------------- . if is_expr_parent_assignment(cx, expr) || !cx.typeck_results().expr_ty(expr).is_unit() { . diag.note("the end suggestion probably needs some adjustments to use the expression result correctly"); . } . } . if check_for_warn_of_moved_symbol(cx, &res.moved_locals, expr) { . diag.warn("some moved values might need to be renamed to avoid wrong references"); . } . }); 3,080 ( 0.00%) } . . /// Detects `match` expressions where every arm's body is a block ending in the same trailing . /// expression, so that expression can be hoisted out below the `match`. . /// . /// ```ignore . /// match mode { . /// Mode::A => { a(); Ok(()) } . /// Mode::B => { b(); Ok(()) } -- line 112 ---------------------------------------- -- line 115 ---------------------------------------- . /// can become . /// ```ignore . /// match mode { . /// Mode::A => a(), . /// Mode::B => b(), . /// } . /// Ok(()) . /// ``` 12,712 ( 0.00%) pub(super) fn check_match<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>, arms: &'tcx [Arm<'tcx>]) { 3,178 ( 0.00%) if arms.len() < 2 { . return; . } . . // We only move the shared expression after the `match`, so the `match` must be in tail position . // of its block. Cheapest, most selective check, so do it first. 6,316 ( 0.00%) if !is_expr_final_block_expr(cx.tcx, expr) { 201,131 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_expr_final_block_expr (1,579x) . return; . } . . // Each arm body must be a block with a trailing expression. . let mut blocks = Vec::with_capacity(arms.len()); . for arm in arms { 8,358 ( 0.00%) let ExprKind::Block(block, None) = arm.body.kind else { . return; . }; 3,744 ( 0.00%) let Some(tail) = block.expr else { . return; . }; 3,820 ( 0.00%) if block.span.from_expansion() || tail.span.from_expansion() { . return; . } . // Same drop-order concern for arm-locals dropped at the end of the arm. 936 ( 0.00%) let arm_local_needs_ordered_drop = block.stmts.iter().any(|stmt| { 3,258 ( 0.00%) matches!(stmt.kind, StmtKind::Let(l) if needs_ordered_drop(cx, cx.typeck_results().node_type(l.hir_id))) 1,563,831 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::needs_ordered_drop (380x) 15,580 ( 0.00%) => ???:::node_type (380x) . }); . if arm_local_needs_ordered_drop { . return; . } . blocks.push((block, tail)); . } . . // All tails must be equal. This also rules out tails referencing an arm-local: those have a . // distinct `HirId` per arm and so never compare equal. 29 ( 0.00%) let first = blocks[0].1; . let mut eq = SpanlessEq::new(cx); . if !blocks[1..] . .iter() 116 ( 0.00%) .all(|&(_, t)| eq.eq_expr(SyntaxContext::root(), first, t)) 35,475 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:::eq_expr (29x) . { . return; . } . . // Don't bother for a `()` tail: nothing worth moving. . if matches!(first.kind, ExprKind::Tup([])) { . return; . } -- line 170 ---------------------------------------- -- line 201 ---------------------------------------- . suggestions, . Applicability::Unspecified, . ); . diag.note( . "the suggestion may need adjustments to preserve drop order or to use the expression result correctly", . ); . }, . ); 14,079 ( 0.00%) } . . struct BlockEq { . /// The end of the range of equal stmts at the start. . start_end_eq: usize, . /// The start of the range of equal stmts at the end. . end_begin_eq: Option, . /// The name and id of every local which can be moved at the beginning and the end. . moved_locals: Vec<(HirId, Symbol)>, . } . . impl BlockEq { . fn start_span(&self, b: &Block<'_>, sm: &SourceMap) -> Option { 385 ( 0.00%) match &b.stmts[..self.start_end_eq] { 770 ( 0.00%) [first, .., last] => Some(sm.stmt_span(first.span, b.span).to(sm.stmt_span(last.span, b.span))), 397 ( 0.00%) [s] => Some(sm.stmt_span(s.span, b.span)), 38 ( 0.00%) => ???:::stmt_span (2x) . [] => None, . } . } . . fn end_span(&self, b: &Block<'_>, sm: &SourceMap) -> Option { 282 ( 0.00%) match (&b.stmts[b.stmts.len() - self.end_begin_eq?..], b.expr) { 141 ( 0.00%) ([first, .., last], None) => Some(sm.stmt_span(first.span, b.span).to(sm.stmt_span(last.span, b.span))), 94 ( 0.00%) ([first, ..], Some(last)) => Some(sm.stmt_span(first.span, b.span).to(sm.stmt_span(last.span, b.span))), 5 ( 0.00%) ([s], None) => Some(sm.stmt_span(s.span, b.span)), 19 ( 0.00%) => ???:::stmt_span (1x) . ([], Some(e)) => Some(walk_chain(e.span, b.span.ctxt())), . ([], None) => None, . } . } . } . . /// If the statement is a local, checks if the bound names match the expected list of names. . fn eq_binding_names(cx: &LateContext<'_>, s: &Stmt<'_>, names: &[(HirId, Symbol)]) -> bool { 82 ( 0.00%) match s.kind { 16 ( 0.00%) StmtKind::Let(l) => { 16 ( 0.00%) let mut i = 0usize; 16 ( 0.00%) let mut res = true; 112 ( 0.00%) l.pat.each_binding_or_first(&mut |_, _, _, name| { 64 ( 0.00%) if names.get(i).is_some_and(|&(_, n)| n == name.name) { 20 ( 0.00%) i += 1; . } else { 12 ( 0.00%) res = false; . } . }); . res && i == names.len() . }, . StmtKind::Item(item_id) . if let [(_, name)] = names . && let item = cx.tcx.hir_item(item_id) . && let ItemKind::Static(_, ident, ..) -- line 258 ---------------------------------------- -- line 266 ---------------------------------------- . }, . _ => false, . } . } . . /// Checks if the statement modifies or moves any of the given locals. . fn modifies_any_local<'tcx>(cx: &LateContext<'tcx>, s: &'tcx Stmt<'_>, locals: &HirIdSet) -> bool { . for_each_expr_without_closures(s, |e| { 275 ( 0.00%) if let Some(id) = e.res_local_id() 275 ( 0.00%) && locals.contains(&id) 388 ( 0.00%) && !capture_local_usage(cx, e).is_imm_ref() 10,687 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::capture_local_usage (5x) . { . ControlFlow::Break(()) . } else { . ControlFlow::Continue(()) . } . }) . .is_some() . } -- line 284 ---------------------------------------- -- line 288 ---------------------------------------- . fn eq_stmts( . cx: &LateContext<'_>, . stmt: &Stmt<'_>, . blocks: &[&Block<'_>], . get_stmt: impl for<'a> Fn(&'a Block<'a>) -> Option<&'a Stmt<'a>>, . eq: &mut HirEqInterExpr<'_, '_, '_>, . moved_bindings: &mut Vec<(HirId, Symbol)>, . ) -> bool { 42 ( 0.00%) (if let StmtKind::Let(l) = stmt.kind { . let old_count = moved_bindings.len(); 102 ( 0.00%) l.pat.each_binding_or_first(&mut |_, id, _, name| { . moved_bindings.push((id, name.name)); . }); . let new_bindings = &moved_bindings[old_count..]; . blocks . .iter() 45 ( 0.00%) .all(|b| get_stmt(b).is_some_and(|s| eq_binding_names(cx, s, new_bindings))) . } else { . true . }) && blocks.iter().all(|b| { 52 ( 0.00%) get_stmt(b).is_some_and(|s| { . eq.set_eval_ctxt(SyntaxContext::root()); 240 ( 0.00%) eq.eq_stmt(s, stmt) 94,462 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:::eq_stmt (48x) . }) . }) . } . . #[expect(clippy::too_many_lines)] . fn scan_block_for_eq<'tcx>( . cx: &LateContext<'tcx>, . conds: &[&'tcx Expr<'_>], . block: &'tcx Block<'_>, . blocks: &[&'tcx Block<'_>], . ) -> BlockEq { . let mut eq = SpanlessEq::new(cx); 770 ( 0.00%) let mut eq = eq.inter_expr(SyntaxContext::root()); 6,930 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:::inter_expr (385x) . let mut moved_locals = Vec::new(); . . let mut cond_locals = HirIdSet::default(); 436 ( 0.00%) for &cond in conds { . let _: Option = for_each_expr_without_closures(cond, |e| { . if let Some(id) = e.res_local_id() { . cond_locals.insert(id); . } . ControlFlow::Continue(()) . }); . } . . let mut local_needs_ordered_drop = false; 770 ( 0.00%) let start_end_eq = block . .stmts . .iter() . .enumerate() . .find(|&(i, stmt)| { 481 ( 0.00%) if let StmtKind::Let(l) = stmt.kind 287 ( 0.00%) && needs_ordered_drop(cx, cx.typeck_results().node_type(l.hir_id)) 8,335,437 ( 0.07%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/ty/mod.rs:clippy_utils::ty::needs_ordered_drop (41x) 1,681 ( 0.00%) => ???:::node_type (41x) . { . local_needs_ordered_drop = true; . return true; . } 210 ( 0.00%) modifies_any_local(cx, stmt, &cond_locals) . || !eq_stmts(cx, stmt, blocks, |b| b.stmts.get(i), &mut eq, &mut moved_locals) . }) . .map_or(block.stmts.len(), |(i, stmt)| { 2 ( 0.00%) adjust_by_closest_callsite(i, stmt, block.stmts[..i].iter().enumerate().rev()) . }); . 216 ( 0.00%) if local_needs_ordered_drop { . return BlockEq { . start_end_eq, . end_begin_eq: None, . moved_locals, . }; . } . . // Walk backwards through the final expression/statements so long as their hashes are equal. Note . // `SpanlessHash` treats all local references as equal allowing locals declared earlier in the block . // to match those in other blocks. e.g. If each block ends with the following the hash value will be . // the same even though each `x` binding will have a different `HirId`: . // let x = foo(); . // x + 50 1,588 ( 0.00%) let expr_hash_eq = if let Some(e) = block.expr { 327 ( 0.00%) let hash = hash_expr(cx, e); 1,223,354 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:clippy_utils::hir_utils::hash_expr (327x) 971 ( 0.00%) blocks.iter().all(|b| b.expr.is_some_and(|e| hash_expr(cx, e) == hash)) 646,568 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:clippy_utils::hir_utils::hash_expr (317x) . } else { . blocks.iter().all(|b| b.expr.is_none()) . }; . if !expr_hash_eq { . return BlockEq { . start_end_eq, . end_begin_eq: None, . moved_locals, . }; . } . let end_search_start = block.stmts[start_end_eq..] . .iter() . .rev() . .enumerate() . .find(|&(offset, stmt)| { 165 ( 0.00%) let hash = hash_stmt(cx, stmt); 166,922 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:clippy_utils::hir_utils::hash_stmt (55x) . blocks.iter().any(|b| { . b.stmts . // the bounds check will catch the underflow . .get(b.stmts.len().wrapping_sub(offset + 1)) 110 ( 0.00%) .is_none_or(|s| hash != hash_stmt(cx, s)) 233,899 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:clippy_utils::hir_utils::hash_stmt (55x) . }) . }) . .map_or(block.stmts.len() - start_end_eq, |(i, stmt)| { 51 ( 0.00%) adjust_by_closest_callsite(i, stmt, (0..i).rev().zip(block.stmts[(block.stmts.len() - i)..].iter())) . }); . . let moved_locals_at_start = moved_locals.len(); . let mut i = end_search_start; 14 ( 0.00%) let end_begin_eq = block.stmts[block.stmts.len() - end_search_start..] . .iter() . .zip(iter::repeat_with(move || { . let x = i; 4 ( 0.00%) i -= 1; . x . })) . .fold(end_search_start, |init, (stmt, offset)| { . if eq_stmts( . cx, . stmt, . blocks, 8 ( 0.00%) |b| b.stmts.get(b.stmts.len() - offset), . &mut eq, . &mut moved_locals, . ) { . init . } else { . // Clear out all locals seen at the end so far. None of them can be moved. 3 ( 0.00%) let stmts = &blocks[0].stmts; 18 ( 0.00%) for stmt in &stmts[stmts.len() - init..=stmts.len() - offset] { 15 ( 0.00%) match stmt.kind { . StmtKind::Let(l) => { . l.pat.each_binding_or_first(&mut |_, id, _, _| { . // FIXME(rust/#120456) - is `swap_remove` correct? . eq.locals.swap_remove(&id); . }); . }, . StmtKind::Item(item_id) => { . let item = cx.tcx.hir_item(item_id); -- line 430 ---------------------------------------- -- line 440 ---------------------------------------- . }, . _ => {}, . } . } . moved_locals.truncate(moved_locals_at_start); . offset - 1 . } . }); 64 ( 0.00%) if let Some(e) = block.expr { . for block in blocks { . eq.set_eval_ctxt(SyntaxContext::root()); 119 ( 0.00%) if block.expr.is_some_and(|expr| !eq.eq_expr(expr, e)) { 27,812 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/hir_utils.rs:::eq_expr (17x) . moved_locals.truncate(moved_locals_at_start); . return BlockEq { . start_end_eq, . end_begin_eq: None, . moved_locals, . }; . } . } . } . 141 ( 0.00%) BlockEq { . start_end_eq, . end_begin_eq: Some(end_begin_eq), 235 ( 0.00%) moved_locals, . } 817 ( 0.00%) } 6,341 ( 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:: (385x) . . /// Adjusts the index for which the statements begin to differ to the closest macro callsite. . /// This avoids giving suggestions that requires splitting a macro call in half, when only a . /// part of the macro expansion is equal. . /// . /// For example, for the following macro: . /// ```rust,ignore . /// macro_rules! foo { -- line 475 ---------------------------------------- -- line 496 ---------------------------------------- . stmt: &'tcx Stmt<'tcx>, . mut iter: impl Iterator)>, . ) -> usize { . let Some((_, first)) = iter.next() else { . return 0; . }; . . // If it is already at the boundary of a macro call, then just return. 12 ( 0.00%) if first.span.source_callsite() != stmt.span.source_callsite() { 96 ( 0.00%) => ???:::source_callsite (4x) . return i; . } . . iter.find(|(_, stmt)| stmt.span.source_callsite() != first.span.source_callsite()) . .map_or(0, |(i, _)| i + 1) . } . . fn check_for_warn_of_moved_symbol(cx: &LateContext<'_>, symbols: &[(HirId, Symbol)], if_expr: &Expr<'_>) -> bool { -- line 512 ---------------------------------------- 13,968 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/disallowed_types.rs -------------------------------------------------------------------------------- Ir -- line 61 ---------------------------------------- . . pub struct DisallowedTypes { . def_ids: DefIdMap<(&'static str, &'static DisallowedPath)>, . prim_tys: FxHashMap, . } . . impl DisallowedTypes { . pub fn new(tcx: TyCtxt<'_>, conf: &'static Conf) -> Self { 8 ( 0.00%) let (def_ids, prim_tys) = 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:: (1x) . tcx, . &conf.disallowed_types, . PathNS::Type, . def_kind_predicate, . "type", . true, . ); 8 ( 0.00%) Self { def_ids, prim_tys } . } . 233,395 ( 0.00%) fn check_res_emit(&self, cx: &LateContext<'_>, res: &Res, span: Span) { 224,765 ( 0.00%) let (path, disallowed_path) = match res { . Res::Def(_, did) if let Some(&x) = self.def_ids.get(did) => x, . Res::PrimTy(prim) if let Some(&x) = self.prim_tys.get(prim) => x, . _ => return, . }; . span_lint_and_then( . cx, . DISALLOWED_TYPES, . span, . format!("use of a disallowed type `{path}`"), . disallowed_path.diag_amendment(span), . ); 280,074 ( 0.00%) } . } . . pub fn def_kind_predicate(def_kind: DefKind) -> bool { . matches!( . def_kind, . DefKind::Struct . | DefKind::Union . | DefKind::Enum -- line 101 ---------------------------------------- -- line 103 ---------------------------------------- . | DefKind::TyAlias . | DefKind::ForeignTy . | DefKind::AssocTy . ) . } . . impl<'tcx> LateLintPass<'tcx> for DisallowedTypes { . fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'tcx>) { 15,332 ( 0.00%) if let ItemKind::Use(path, UseKind::Single(_)) = &item.kind 10,615 ( 0.00%) && let Some(res) = path.res.type_ns . { 5,168 ( 0.00%) self.check_res_emit(cx, &res, item.span); 23,256 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_types.rs:::check_res_emit (1,292x) . } . } . . fn check_ty(&mut self, cx: &LateContext<'tcx>, ty: &'tcx Ty<'tcx, AmbigArg>) { 148,689 ( 0.00%) if let TyKind::Path(path) = &ty.kind { 479,721 ( 0.00%) self.check_res_emit(cx, &cx.qpath_res(path, ty.hir_id), ty.span); 1,040,163 ( 0.01%) => ???:::qpath_res (43,611x) 762,458 ( 0.01%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_types.rs:::check_res_emit (43,611x) . } . } . . fn check_poly_trait_ref(&mut self, cx: &LateContext<'tcx>, poly: &'tcx PolyTraitRef<'tcx>) { 15,984 ( 0.00%) self.check_res_emit(cx, &poly.trait_ref.path.res, poly.trait_ref.path.span); 31,968 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_types.rs:::check_res_emit (1,776x) . } . } 1,292 ( 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; . 387,877 ( 0.00%) pub(super) fn check(cx: &EarlyContext<'_>, pat: &Pat) { 387,895 ( 0.00%) if let PatKind::Ident(ann, ident, Some(ref right)) = pat.kind 6 ( 0.00%) && let PatKind::Wild = right.kind . && !pat.span.in_external_macro(cx.sess().source_map()) . { . span_lint_and_sugg( . cx, . REDUNDANT_PATTERN, . pat.span, . format!( . "the `{} @ _` pattern can be written as just `{}`", . ident.name, ident.name, . ), . "try", . format!("{}{}", ann.prefix_str(), ident.name), . Applicability::MachineApplicable, . ); . } 443,288 ( 0.00%) } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/operators/needless_bitwise_bool.rs -------------------------------------------------------------------------------- Ir . use clippy_utils::diagnostics::span_lint_and_then; . use clippy_utils::source::snippet_with_context; . use rustc_errors::Applicability; . use rustc_hir::{BinOpKind, Expr, ExprKind}; . use rustc_lint::LateContext; . . use super::NEEDLESS_BITWISE_BOOL; . 39,460 ( 0.00%) pub(super) fn check(cx: &LateContext<'_>, e: &Expr<'_>, op: BinOpKind, lhs: &Expr<'_>, rhs: &Expr<'_>) { 19,415 ( 0.00%) let op_str = match op { . BinOpKind::BitAnd => "&&", . BinOpKind::BitOr => "||", . _ => return, . }; 205 ( 0.00%) if matches!( 410 ( 0.00%) rhs.kind, . ExprKind::Call(..) | ExprKind::MethodCall(..) | ExprKind::Binary(..) | ExprKind::Unary(..) 360 ( 0.00%) ) && cx.typeck_results().expr_ty(e).is_bool() 3,600 ( 0.00%) => ???:::expr_ty (90x) . && !rhs.can_have_side_effects() . { . span_lint_and_then( . cx, . NEEDLESS_BITWISE_BOOL, . e.span, . "use of bitwise operator instead of lazy operator between booleans", . |diag| { -- line 26 ---------------------------------------- -- line 28 ---------------------------------------- . let expr_span_ctxt = e.span.ctxt(); . let (lhs_snip, _) = snippet_with_context(cx, lhs.span, expr_span_ctxt, "..", &mut applicability); . let (rhs_snip, _) = snippet_with_context(cx, rhs.span, expr_span_ctxt, "..", &mut applicability); . . diag.span_suggestion(e.span, "try", format!("{lhs_snip} {op_str} {rhs_snip}"), applicability); . }, . ); . } 23,676 ( 0.00%) } 985 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/string_patterns.rs -------------------------------------------------------------------------------- Ir -- line 108 ---------------------------------------- . (sym::rmatch_indices, 0), . (sym::trim_start_matches, 0), . (sym::trim_end_matches, 0), . (sym::replace, 0), . (sym::replacen, 0), . ]; . . fn check_single_char_pattern_lint(cx: &LateContext<'_>, arg: &Expr<'_>) { 27 ( 0.00%) let mut applicability = Applicability::MachineApplicable; 63 ( 0.00%) if let Some(hint) = str_literal_to_char_literal(cx, arg, &mut applicability, true) { 1,533 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::str_literal_to_char_literal::<&rustc_lint::context::LateContext> (9x) 13 ( 0.00%) span_lint_and_sugg( 1,707 ( 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, . SINGLE_CHAR_PATTERN, 1 ( 0.00%) arg.span, . "single-character string constant used as pattern", . "consider using a `char`", . hint, . applicability, . ); . } . } . -- line 129 ---------------------------------------- -- line 134 ---------------------------------------- . { . Some(expr.span) . } else { . None . } . } . . fn check_manual_pattern_char_comparison(cx: &LateContext<'_>, method_arg: &Expr<'_>, msrv: Msrv) { 18 ( 0.00%) if let ExprKind::Closure(closure) = method_arg.kind . && let body = cx.tcx.hir_body(closure.body) . && let Some(PatKind::Binding(_, binding, ..)) = body.params.first().map(|p| p.pat.kind) . { . let mut set_char_spans: Vec = Vec::new(); . . // We want to retrieve all the comparisons done. . // They are ordered in a nested way and so we need to traverse the AST to collect them all. . if for_each_expr(cx.tcx, body.value, |sub_expr| -> ControlFlow<(), Descend> { -- line 150 ---------------------------------------- -- line 222 ---------------------------------------- . ); . } . }, . ); . } . } . . impl<'tcx> LateLintPass<'tcx> for StringPatterns { 1,453,368 ( 0.01%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 562,663 ( 0.00%) if !expr.span.from_expansion() 46,636 ( 0.00%) && let ExprKind::MethodCall(method, receiver, args, _) = expr.kind 11,659 ( 0.00%) && let method_name = method.ident.name 87 ( 0.00%) && let Some(&(_, pos)) = PATTERN_METHODS . .iter() . .find(|(array_method_name, _)| *array_method_name == method_name) . && let Some(arg) = args.get(pos) 162 ( 0.00%) && let ty::Ref(_, ty, _) = cx.typeck_results().expr_ty_adjusted(receiver).kind() 2,921 ( 0.00%) => ???:::expr_ty_adjusted (54x) 156 ( 0.00%) && ty.is_str() . { . check_single_char_pattern_lint(cx, arg); . 9 ( 0.00%) check_manual_pattern_char_comparison(cx, arg, self.msrv); . } 1,453,368 ( 0.01%) } . } 328,983 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/matches/match_wild_enum.rs -------------------------------------------------------------------------------- Ir -- line 7 ---------------------------------------- . use rustc_hir::{Arm, Expr, PatExpr, PatExprKind, PatKind, PathSegment, QPath, Ty, TyKind}; . use rustc_lint::LateContext; . use rustc_middle::ty::{self, VariantDef}; . use rustc_span::sym; . . use super::{MATCH_WILDCARD_FOR_SINGLE_VARIANTS, WILDCARD_ENUM_MATCH_ARM}; . . #[expect(clippy::too_many_lines)] 10,080 ( 0.00%) pub(crate) fn check(cx: &LateContext<'_>, ex: &Expr<'_>, arms: &[Arm<'_>]) { 2,240 ( 0.00%) let ty = cx.typeck_results().expr_ty(ex).peel_refs(); 44,824 ( 0.00%) => ???:::expr_ty (1,120x) . let adt_def = match ty.kind() { . ty::Adt(adt_def, _) 5,232 ( 0.00%) if adt_def.is_enum() && !matches!(ty.opt_diag_name(cx), Some(sym::Option | sym::Result)) => . { . adt_def . }, . _ => return, . }; . . // First pass - check for violation, but don't do much book-keeping because this is hopefully . // the uncommon case, and the book-keeping is slightly expensive. . let mut wildcard_span = None; 769 ( 0.00%) let mut wildcard_ident = None; . let mut has_non_wild = false; . for arm in arms { 48,826 ( 0.00%) match peel_hir_pat_refs(arm.pat).0.kind { 25,350 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::peel_hir_pat_refs (4,138x) 842 ( 0.00%) PatKind::Wild if arm.guard.is_none() => wildcard_span = Some(arm.pat.span), 24 ( 0.00%) PatKind::Binding(_, _, ident, None) => { . wildcard_span = Some(arm.pat.span); . wildcard_ident = Some(ident); 6 ( 0.00%) }, . _ => has_non_wild = true, . } . } 2,307 ( 0.00%) let wildcard_span = match wildcard_span { 425 ( 0.00%) Some(x) if has_non_wild => x, . _ => return, . }; . . // Accumulate the variants which should be put in place of the wildcard because they're not . // already covered. 425 ( 0.00%) let is_external = adt_def.did().as_local().is_none(); 1,015 ( 0.00%) let has_external_hidden = is_external && adt_def.variants().iter().any(|x| is_hidden(cx, x)); 93,656 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/matches/match_wild_enum.rs:clippy_lints::matches::match_wild_enum::is_hidden (160x) 5 ( 0.00%) let mut missing_variants: Vec<_> = adt_def . .variants() . .iter() 62,116 ( 0.00%) .filter(|x| !(is_external && is_hidden(cx, x))) 20,653 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/matches/match_wild_enum.rs:clippy_lints::matches::match_wild_enum::is_hidden (160x) . .collect(); . 1,275 ( 0.00%) let mut path_prefix = CommonPrefixSearcher::None; . for arm in arms { . // Guards mean that this case probably isn't exhaustively covered. Technically . // this is incorrect, as we should really check whether each variant is exhaustively . // covered by the set of guards that cover it, but that's really hard to do. 34,459 ( 0.00%) recurse_or_patterns(arm.pat, |pat| { 27,637 ( 0.00%) let path = match &peel_hir_pat_refs(pat).0.kind { 15,615 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::peel_hir_pat_refs (2,232x) . PatKind::Expr(PatExpr { . hir_id, 1,317 ( 0.00%) kind: PatExprKind::Path(path), . .. . }) => { . // FIXME(clippy): don't you want to use the hir id of the peeled pat? 19,755 ( 0.00%) let id = match cx.qpath_res(path, *hir_id) { 34,801 ( 0.00%) => ???:::qpath_res (1,317x) . Res::Def(DefKind::Const { .. } | DefKind::ConstParam | DefKind::AnonConst, _) => return, 2,634 ( 0.00%) Res::Def(_, id) => id, . _ => return, . }; 4,363 ( 0.00%) if arm.guard.is_none() { 3,948 ( 0.00%) missing_variants.retain(|e| e.ctor_def_id() != Some(id)); 1,632,860 ( 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:>::retain:: (1,316x) . } . path . }, 31 ( 0.00%) PatKind::TupleStruct(path, patterns, ..) => { 279 ( 0.00%) if let Some(id) = cx.qpath_res(path, pat.hir_id).opt_def_id() 823 ( 0.00%) => ???:::qpath_res (31x) 62 ( 0.00%) && arm.guard.is_none() 141 ( 0.00%) && patterns.iter().all(|p| !is_refutable(cx, p)) 1,116 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_refutable (38x) . { 78 ( 0.00%) missing_variants.retain(|e| e.ctor_def_id() != Some(id)); 2,433 ( 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:>::retain:: (26x) . } . path . }, . PatKind::Struct(path, patterns, ..) => { 3,646 ( 0.00%) if let Some(id) = cx.qpath_res(path, pat.hir_id).opt_def_id() 12,290 ( 0.00%) => ???:::qpath_res (457x) 894 ( 0.00%) && arm.guard.is_none() 2,007 ( 0.00%) && patterns.iter().all(|p| !is_refutable(cx, p.pat)) 25,371 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_refutable (788x) . { 1,239 ( 0.00%) missing_variants.retain(|e| e.def_id != id); 69,344 ( 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:>::retain:: (413x) . } . path . }, . _ => return, . }; 4,205 ( 0.00%) match path { 6,744 ( 0.00%) QPath::Resolved(_, path) => path_prefix.with_path(path.segments), . QPath::TypeRelative( . Ty { . kind: TyKind::Path(QPath::Resolved(_, path)), . .. . }, . _, 476 ( 0.00%) ) => path_prefix.with_prefix(path.segments), . QPath::TypeRelative(..) => (), . } 17,856 ( 0.00%) }); . } . 2,375 ( 0.00%) let format_suggestion = |variant: &VariantDef| { 350 ( 0.00%) format!( . "{}{}{}{}", 75 ( 0.00%) wildcard_ident.map_or(String::new(), |ident| { . ident . .span . .get_text(cx) . .map_or_else(|| format!("{} @ ", ident.name), |s| format!("{s} @ ")) . }), 125 ( 0.00%) if let CommonPrefixSearcher::Path(path_prefix) = path_prefix { . let mut s = String::new(); . for seg in path_prefix { 133 ( 0.00%) s.push_str(seg.ident.as_str()); 864 ( 0.00%) => ???:::as_str (27x) . s.push_str("::"); . } 150 ( 0.00%) s . } else { . let mut s = cx.tcx.def_path_str(adt_def.did()); . s.push_str("::"); . s . }, . variant.name, 24 ( 0.00%) match variant.ctor_kind() { 3 ( 0.00%) Some(CtorKind::Fn) if variant.fields.len() == 1 => "(_)", . Some(CtorKind::Fn) => "(..)", . Some(CtorKind::Const) => "", . None => " { .. }", . } . ) 200 ( 0.00%) }; . . match missing_variants.as_slice() { 1,632 ( 0.00%) [] => (), 532 ( 0.00%) [x] if !adt_def.is_variant_list_non_exhaustive() && !has_external_hidden => span_lint_and_sugg( 43,099 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_sugg:: (25x) . cx, . MATCH_WILDCARD_FOR_SINGLE_VARIANTS, . wildcard_span, . "wildcard matches only a single variant and will also match any future added variants", . "try", 75 ( 0.00%) format_suggestion(x), 42,153 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/matches/match_wild_enum.rs:clippy_lints::matches::match_wild_enum::check::{closure#3} (25x) . Applicability::MaybeIncorrect, . ), . variants => { 3,293 ( 0.00%) let (message, add_wildcard) = if adt_def.is_variant_list_non_exhaustive() || has_external_hidden { . ( . "wildcard matches known variants and will also match future added variants", . true, . ) . } else { . ("wildcard match will also match any future added variants", false) . }; . 5,490 ( 0.00%) span_lint_and_then(cx, WILDCARD_ENUM_MATCH_ARM, wildcard_span, message, |diag| { 616,516 ( 0.01%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/diagnostics.rs:clippy_utils::diagnostics::span_lint_and_then:: (366x) . let mut suggestions: Vec<_> = variants.iter().copied().map(format_suggestion).collect(); . if add_wildcard { . suggestions.push("_".into()); . } . diag.span_suggestion( . wildcard_span, . "try", . suggestions.join(" | "), . Applicability::MaybeIncorrect, . ); . }); . }, . } 8,960 ( 0.00%) } . . enum CommonPrefixSearcher<'a> { . None, . Path(&'a [PathSegment<'a>]), . Mixed, . } . impl<'a> CommonPrefixSearcher<'a> { . fn with_path(&mut self, path: &'a [PathSegment<'a>]) { 5,058 ( 0.00%) if let [path @ .., _] = path { . self.with_prefix(path); . } . } . . fn with_prefix(&mut self, path: &'a [PathSegment<'a>]) { 8,231 ( 0.00%) match self { 1,672 ( 0.00%) Self::None => *self = Self::Path(path), . Self::Path(self_path) 1,289 ( 0.00%) if path . .iter() . .map(|p| p.ident.name) 6,536 ( 0.00%) .eq(self_path.iter().map(|p| p.ident.name)) => {}, . Self::Path(_) => *self = Self::Mixed, . Self::Mixed => (), . } . } . } . 2,560 ( 0.00%) fn is_hidden(cx: &LateContext<'_>, variant_def: &VariantDef) -> bool { . cx.tcx.is_doc_hidden(variant_def.def_id) 1,920 ( 0.00%) } 11,404 ( 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 87 ---------------------------------------- . use rustc_data_structures::unord::UnordMap; . use rustc_hashes::{Hash64, Hash128}; . use sha1::Sha1; . use sha2::Sha256; . . #[cfg(test)] . mod tests; . 17 ( 0.00%) #[derive(Clone, Encodable, Decodable, Debug, Copy, PartialEq, Hash, StableHash)] . pub struct Spanned { . pub node: T, . pub span: Span, . } . . pub fn respan(sp: Span, t: T) -> Spanned { . Spanned { node: t, span: sp } . } -- line 103 ---------------------------------------- -- line 177 ---------------------------------------- . } . } . . #[inline] . pub fn with_session_globals(f: F) -> R . where . F: FnOnce(&SessionGlobals) -> R, . { 5,866,053 ( 0.05%) SESSION_GLOBALS.with(f) 92 ( 0.00%) => /rust/deps/scoped-tls-1.0.1/src/lib.rs:>::with::::data::{closure#0}>::{closure#0}, rustc_span::SpanData> (2x) . } . . /// 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)) . } . 207 ( 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> { 104 ( 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 { 103 ( 0.00%) if self.was_not_remapped() { 206 ( 0.00%) Some(self.maybe_remapped.name) . } else if let Some(local) = self.local { . Some(local.name) . } else { . None . } 412 ( 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 698 ---------------------------------------- . . impl SpanData { . #[inline] . pub fn span(&self) -> Span { . Span::new(self.lo, self.hi, self.ctxt, self.parent) . } . #[inline] . pub fn with_lo(&self, lo: BytePos) -> Span { 3,957 ( 0.00%) Span::new(lo, self.hi, self.ctxt, self.parent) 36 ( 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 (1x) . } . #[inline] . pub fn with_hi(&self, hi: BytePos) -> Span { 52,587 ( 0.00%) Span::new(self.lo, hi, self.ctxt, self.parent) 72 ( 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 (2x) . } . /// Avoid if possible, `Span::map_ctxt` should be preferred. . #[inline] . fn with_ctxt(&self, ctxt: SyntaxContext) -> Span { 72 ( 0.00%) Span::new(self.lo, self.hi, ctxt, self.parent) . } . /// Avoid if possible, `Span::with_parent` should be preferred. . #[inline] . fn with_parent(&self, parent: Option) -> Span { 22,464 ( 0.00%) Span::new(self.lo, self.hi, self.ctxt, parent) . } . /// Returns `true` if this is a dummy span with any hygienic context. . #[inline] . pub fn is_dummy(self) -> bool { . self.lo.0 == 0 && self.hi.0 == 0 . } . /// Returns `true` if `self` fully encloses `other`. . pub fn contains(self, other: Self) -> bool { -- line 728 ---------------------------------------- -- line 745 ---------------------------------------- . fn cmp(&self, rhs: &Self) -> Ordering { . Ord::cmp(&self.data(), &rhs.data()) . } . } . . impl Span { . #[inline] . pub fn lo(self) -> BytePos { 36,349 ( 0.00%) self.data().lo 3,450 ( 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 (75x) . } . #[inline] . pub fn with_lo(self, lo: BytePos) -> Span { 429 ( 0.00%) self.data().with_lo(lo) 46 ( 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 (1x) . } . #[inline] . pub fn hi(self) -> BytePos { 45,823 ( 0.00%) self.data().hi 2,760 ( 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 (60x) . } . #[inline] . pub fn with_hi(self, hi: BytePos) -> Span { 2,784 ( 0.00%) self.data().with_hi(hi) 49,183 ( 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 (1,063x) . } . #[inline] . pub fn with_ctxt(self, ctxt: SyntaxContext) -> Span { 84 ( 0.00%) self.map_ctxt(|_| ctxt) . } . . #[inline] . pub fn is_visible(self, sm: &SourceMap) -> bool { . !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] 10,056 ( 0.00%) pub fn in_external_macro(self, sm: &SourceMap) -> bool { 1,879,544 ( 0.02%) self.ctxt().in_external_macro(sm) 11,365 ( 0.00%) => ???:::in_external_macro (109x) . } . . /// 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 809 ---------------------------------------- . #[inline] . pub fn with_root_ctxt(lo: BytePos, hi: BytePos) -> Span { . Span::new(lo, hi, SyntaxContext::root(), None) . } . . /// Returns a new span representing an empty span at the beginning of this span. . #[inline] . pub fn shrink_to_lo(self) -> Span { 67 ( 0.00%) let span = self.data_untracked(); 30 ( 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_untracked (2x) 34 ( 0.00%) span.with_hi(span.lo) . } . /// Returns a new span representing an empty span at the end of this span. . #[inline] . pub fn shrink_to_hi(self) -> Span { 418 ( 0.00%) let span = self.data_untracked(); 3,562 ( 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_untracked (209x) 209 ( 0.00%) span.with_lo(span.hi) . } . . #[inline] . /// Returns `true` if `hi == lo`. . pub fn is_empty(self) -> bool { . let span = self.data_untracked(); . span.hi == span.lo . } -- line 832 ---------------------------------------- -- line 1693 ---------------------------------------- . /// No attempt has been made to load the external source. . AbsentOk, . /// A failed attempt has been made to load the external source. . AbsentErr, . } . . impl ExternalSource { . pub fn get_source(&self) -> Option<&str> { 386 ( 0.00%) match self { . ExternalSource::Foreign { kind: ExternalSourceKind::Present(src), .. } => Some(src), . _ => None, . } . } . } . . #[derive(Debug)] . pub struct OffsetOverflowError; -- line 1709 ---------------------------------------- -- line 2364 ---------------------------------------- . } . . pub fn count_lines(&self) -> usize { . self.lines().len() . } . . #[inline] . pub fn absolute_position(&self, pos: RelativeBytePos) -> BytePos { 50 ( 0.00%) BytePos::from_u32(pos.to_u32() + self.start_pos.to_u32()) . } . . #[inline] . pub fn relative_position(&self, pos: BytePos) -> RelativeBytePos { 16,590 ( 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 2639 ---------------------------------------- . ( . $( . $(#[$attr:meta])* . $vis:vis struct $ident:ident($inner_vis:vis $inner_ty:ty); . )* . ) => { . $( . $(#[$attr])* 35 ( 0.00%) $vis struct $ident($inner_vis $inner_ty); . . impl Pos for $ident { . #[inline(always)] . fn from_usize(n: usize) -> $ident { . $ident(n as $inner_ty) . } . . #[inline(always)] . fn to_usize(&self) -> usize { 50,702 ( 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 { 50 ( 0.00%) self.0 as u32 . } . } . . impl Add for $ident { . type Output = $ident; . . #[inline(always)] . fn add(self, rhs: $ident) -> $ident { 58 ( 0.00%) $ident(self.0 + rhs.0) . } . } . . impl Sub for $ident { . type Output = $ident; . . #[inline(always)] . fn sub(self, rhs: $ident) -> $ident { 22,000 ( 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. 37,652 ( 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. . /// . /// Because of multibyte UTF-8 characters, a byte offset . /// is not equivalent to a character offset. The [`SourceMap`] will convert [`BytePos`] . /// values to `CharPos` values as necessary. 13 ( 0.00%) #[derive(Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug)] . pub struct CharPos(pub usize); . } . . impl Encodable for BytePos { . fn encode(&self, s: &mut S) { . s.emit_u32(self.0); . } . } -- line 2716 ---------------------------------------- 1,003,082 ( 0.01%) -------------------------------------------------------------------------------- The following files chosen for auto-annotation could not be found: -------------------------------------------------------------------------------- /rust/deps/hashbrown-0.17.0/src/control/bitmask.rs /rust/deps/hashbrown-0.17.0/src/control/tag.rs /rust/deps/hashbrown-0.17.0/src/raw.rs /rust/deps/hashbrown-0.17.0/src/table.rs /rust/deps/hashbrown-0.17.1/src/control/bitmask.rs /rust/deps/hashbrown-0.17.1/src/control/tag.rs /rust/deps/hashbrown-0.17.1/src/map.rs /rust/deps/hashbrown-0.17.1/src/raw.rs /rust/deps/indexmap-2.14.0/src/inner.rs /rust/deps/indexmap-2.14.0/src/inner/entry.rs /rust/deps/indexmap-2.14.0/src/map.rs /rust/deps/indexmap-2.14.0/src/map/entry.rs /rust/deps/pulldown-cmark-0.11.3/src/parse.rs /rust/deps/rustc-hash-2.1.1/src/lib.rs /rust/deps/scoped-tls-1.0.1/src/lib.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/emap.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/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/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/ehooks.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 -------------------------------------------------------------------------------- 1,874,741,842 (15.57%) events annotated