-------------------------------------------------------------------------------- Profile data file 'results/clgout-nightly-2026-08-14-coercions-Clippy-IncrUnchanged-Threads1' (creator: callgrind-3.25.1) -------------------------------------------------------------------------------- I1 cache: D1 cache: LL cache: Timerange: Basic block 0 - 230021747 Trigger: Program termination Profiled target: /home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver --crate-name issue_32278_big_array_of_strings --edition=2015 src/main.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type bin --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 --check-cfg cfg(docsrs,test) --check-cfg cfg(feature, values()) -C metadata=d0f908dc104c39f1 -C extra-filename=-42faf777678209db --out-dir /tmp/.tmpeUtPjf/target/debug/deps -L dependency=/tmp/.tmpeUtPjf/target/debug/deps -C incremental=/tmp/.tmpeUtPjf/incremental-state -Wclippy::all -Zthreads=1 -Adeprecated -Aunknown-lints -Zincremental-verify-ich (PID 676154, part 1) Events recorded: Ir Events shown: Ir Event sort order: Ir Thresholds: 99 Include dirs: User annotated: Auto-annotation: on -------------------------------------------------------------------------------- Ir -------------------------------------------------------------------------------- 1,239,685,265 (100.0%) PROGRAM TOTALS -------------------------------------------------------------------------------- Ir file:function -------------------------------------------------------------------------------- 74,970,881 ( 6.05%) ???:::advance_token [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 56,624,832 ( 4.57%) site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 51,976,929 ( 4.19%) ???:::next_token_from_cursor [???] 35,785,214 ( 2.89%) ???:>::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] 26,820,320 ( 2.16%) ???:::unescape_1 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 26,428,474 ( 2.13%) ???:::stable_hash::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 24,358,371 ( 1.96%) ???:::stable_hash::::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 21,300,031 ( 1.72%) ???:::span_to_snippet [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 21,234,886 ( 1.71%) ???:::parent_hir_node [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 19,445,798 ( 1.57%) ???:md5::compress::soft::compress [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 19,267,290 ( 1.55%) ???: as rustc_ast::visit::Visitor>::visit_expr'2 [???] 17,628,915 ( 1.42%) ???:::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] 16,960,294 ( 1.37%) ???:::encode_span [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 16,505,186 ( 1.33%) ???:::from_token_lit [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 15,735,043 ( 1.27%) ???:::lower_expr_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 15,638,889 ( 1.26%) ???:::decode_span [???] 15,349,642 ( 1.24%) ???:::short_write_process_buffer::<8> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 14,345,966 ( 1.16%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 14,022,524 ( 1.13%) ???:::decode_alloc_id [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 12,388,679 ( 1.00%) ???:)>>::call_once [???] 12,058,992 ( 0.97%) 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] 11,404,211 ( 0.92%) ???:>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 11,183,364 ( 0.90%) ???:::encode_alloc_id [???] 10,551,933 ( 0.85%) ???:::in_external_macro [???] 10,486,607 ( 0.85%) ???:>::push [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 10,310,315 ( 0.83%) 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] 9,175,595 ( 0.74%) ???:::parse_expr_array_or_repeat [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 9,175,320 ( 0.74%) ???:::next [???] 8,783,029 ( 0.71%) ???:rustc_middle::ty::codec::encode_with_shorthand::::type_shorthands> [???] 8,263,354 ( 0.67%) ???: 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] 7,865,600 ( 0.63%) ???:::hir_attrs [???] 7,524,092 ( 0.61%) ???:::intern_str [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 7,340,891 ( 0.59%) ???:>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 7,185,981 ( 0.58%) /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 7,011,081 ( 0.57%) ???:>::decode'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,751,270 ( 0.54%) ???:::lex_token_trees'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,708,997 ( 0.54%) ???:0x0000000000173dc0 [/usr/lib/libc.so.6] 6,291,646 ( 0.51%) ???:::desugaring_kind [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,226,478 ( 0.50%) ???:>::encode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 6,097,491 ( 0.49%) ???:::to [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,535,946 ( 0.45%) ???:::short_write_process_buffer::<1> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,504,940 ( 0.44%) ???: as rustc_hir::intravisit::Visitor>::visit_expr::{closure#0}::{closure#0}'2 [???] 5,324,169 ( 0.43%) ???:::slice_write_process_buffer [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 5,243,008 ( 0.42%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:clippy_utils::macros::first_node_in_macro:: 5,242,800 ( 0.42%) ???: as rustc_hir::intravisit::Visitor>::visit_expr'2 [???] 5,046,349 ( 0.41%) 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] 4,799,446 ( 0.39%) include/jemalloc/internal/rtree.h:free 4,784,197 ( 0.39%) ???:::check_expr [???] 4,588,535 ( 0.37%) ???: as rustc_ast::visit::Visitor>::visit_id [???] 4,444,215 ( 0.36%) ???:>::call_once'2 [???] 4,217,764 ( 0.34%) ???:::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,195,506 ( 0.34%) ???: 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] 4,194,240 ( 0.34%) ???:>>::walk_ref'2 [???] 4,128,705 ( 0.33%) ???:::parse_expr_assoc_with'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,064,100 ( 0.33%) ???:::hir_node [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 4,063,730 ( 0.33%) 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] 3,783,472 ( 0.31%) ???:::short_write_process_buffer::<4> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,727,376 ( 0.30%) ???:rustc_query_impl::plumbing::encode_query_values_inner::>, core::result::Result>::{closure#0}'2 [???] 3,698,859 ( 0.30%) ???:>::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,539,192 ( 0.29%) ???:stacker::remaining_stack [???] 3,441,488 ( 0.28%) ???:0x000000000000fb40 [/usr/lib/ld-linux-x86-64.so.2] 3,342,438 ( 0.27%) 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,325,625 ( 0.27%) ???:::mk_const_alloc [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,276,750 ( 0.26%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,253,843 ( 0.26%) ???:::serialize::{closure#0}'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,211,215 ( 0.26%) ???:::filter_map_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 3,145,824 ( 0.25%) 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] 3,014,748 ( 0.24%) 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] 2,965,759 ( 0.24%) ???:)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,935,822 ( 0.24%) include/jemalloc/internal/rtree.h:tcache_bin_flush_small 2,933,269 ( 0.24%) ???:rustc_query_impl::plumbing::encode_query_values_inner::, rustc_middle::dep_graph::graph::DepNodeIndex>, &rustc_middle::ty::typeck_results::TypeckResults>::{closure#0} [???] 2,884,222 ( 0.23%) ???:core::ptr::drop_glue::> [???] 2,822,351 ( 0.23%) src/arena.c:malloc_default 2,817,862 ( 0.23%) include/jemalloc/internal/jemalloc_internal_inlines_c.h:malloc [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,811,589 ( 0.23%) /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 2,752,932 ( 0.22%) ???:rustc_interface::callbacks::track_span_parent [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,752,596 ( 0.22%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,687,383 ( 0.22%) ???:::expect_hir_owner_nodes [???] 2,687,046 ( 0.22%) site/frontend/rust-clippy/clippy_lints/src/casts/cast_slice_different_sizes.rs:clippy_lints::casts::cast_slice_different_sizes::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,622,020 ( 0.21%) ???:::take [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,452,300 ( 0.20%) /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] 2,424,897 ( 0.20%) site/frontend/rust-clippy/clippy_lints/src/unit_types/unit_arg.rs:clippy_lints::unit_types::unit_arg::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,424,869 ( 0.20%) site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,395,935 ( 0.19%) ???: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,359,730 ( 0.19%) ???:::hir_attrs'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,359,368 ( 0.19%) ???:::next'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,359,260 ( 0.19%) ???:::resolve_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,293,915 ( 0.19%) ???:::lower_expr_mut::{closure#0}'2 [???] 2,293,840 ( 0.19%) site/frontend/rust-clippy/clippy_lints/src/byte_char_slices.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,198,230 ( 0.18%) ???:0x0000000000173660 [/usr/lib/libc.so.6] 2,194,596 ( 0.18%) ???:rustc_span::normalize_src [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,162,754 ( 0.17%) site/frontend/rust-clippy/clippy_lints/src/loops/mod.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,162,655 ( 0.17%) ???:::parse_expr_prefix'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,162,655 ( 0.17%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,097,212 ( 0.17%) site/frontend/rust-clippy/clippy_lints/src/operators/mod.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 2,097,152 ( 0.17%) ???:>::walk_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,097,120 ( 0.17%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,072,495 ( 0.17%) ???:core::slice::memchr::memchr_aligned [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 2,031,678 ( 0.16%) 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] 1,966,140 ( 0.16%) ???:::range_span [???] 1,966,140 ( 0.16%) 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] 1,966,135 ( 0.16%) 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] 1,966,050 ( 0.16%) 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] 1,952,331 ( 0.16%) include/jemalloc/internal/cache_bin.h:malloc 1,914,523 ( 0.15%) ???:::hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,900,602 ( 0.15%) site/frontend/rust-clippy/clippy_lints/src/strings.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,900,566 ( 0.15%) site/frontend/rust-clippy/clippy_lints/src/raw_strings.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,881,488 ( 0.15%) ???:::get_str [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,835,450 ( 0.15%) ???:rustc_span::hygiene::decode_syntax_context::::decode_syntax_context::{closure#0}> [???] 1,835,064 ( 0.15%) site/frontend/rust-clippy/clippy_lints/src/repeat_vec_with_capacity.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,769,526 ( 0.14%) site/frontend/rust-clippy/clippy_lints/src/manual_option_as_slice.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,769,493 ( 0.14%) site/frontend/rust-clippy/clippy_lints/src/formatting.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,703,988 ( 0.14%) site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,703,988 ( 0.14%) site/frontend/rust-clippy/clippy_lints/src/ranges.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,703,988 ( 0.14%) site/frontend/rust-clippy/clippy_lints/src/regex.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,703,910 ( 0.14%) ???:>::walk_mut'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,690,576 ( 0.14%) ???:0x000000000000ba80 [/usr/lib/ld-linux-x86-64.so.2] 1,684,713 ( 0.14%) include/jemalloc/internal/cache_bin.h:free 1,654,642 ( 0.13%) ???:rustc_middle::dep_graph::read_deps::<::read_index::{closure#0}>::{closure#0} [???] 1,638,575 ( 0.13%) site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs:::check_attributes [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,638,450 ( 0.13%) site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,638,450 ( 0.13%) site/frontend/rust-clippy/clippy_lints/src/redundant_slicing.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,638,450 ( 0.13%) site/frontend/rust-clippy/clippy_lints/src/useless_conversion.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,638,375 ( 0.13%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,638,375 ( 0.13%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,638,375 ( 0.13%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,638,375 ( 0.13%) ???:>::walk_ref'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,623,100 ( 0.13%) /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 1,572,912 ( 0.13%) site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs:::check_expr_post [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,572,912 ( 0.13%) site/frontend/rust-clippy/clippy_lints/src/format.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,572,912 ( 0.13%) site/frontend/rust-clippy/clippy_lints/src/if_let_mutex.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,572,912 ( 0.13%) site/frontend/rust-clippy/clippy_lints/src/ifs/mod.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,572,912 ( 0.13%) site/frontend/rust-clippy/clippy_lints/src/incompatible_msrv.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,572,912 ( 0.13%) site/frontend/rust-clippy/clippy_lints/src/legacy_numeric_constants.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,572,888 ( 0.13%) site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::if_statement_binops [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,572,840 ( 0.13%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_expr::>'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,507,466 ( 0.12%) site/frontend/rust-clippy/clippy_lints/src/attrs/mod.rs:::check_attributes [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,507,391 ( 0.12%) 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] 1,507,374 ( 0.12%) /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 1,507,374 ( 0.12%) site/frontend/rust-clippy/clippy_lints/src/bit_width.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,507,374 ( 0.12%) site/frontend/rust-clippy/clippy_lints/src/needless_nonzero_get.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,507,341 ( 0.12%) site/frontend/rust-clippy/clippy_lints/src/unicode.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,507,305 ( 0.12%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_expr::'2 [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,507,305 ( 0.12%) ???:>::walk_mut'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,441,946 ( 0.12%) ???:rustc_resolve::rustdoc::unindent_doc_fragments [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,441,847 ( 0.12%) site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,441,836 ( 0.12%) site/frontend/rust-clippy/clippy_lints/src/len_zero.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,441,836 ( 0.12%) site/frontend/rust-clippy/clippy_lints/src/manual_is_ascii_check.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,441,836 ( 0.12%) site/frontend/rust-clippy/clippy_lints/src/manual_main_separator_str.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,441,836 ( 0.12%) site/frontend/rust-clippy/clippy_lints/src/match_result_ok.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,441,836 ( 0.12%) site/frontend/rust-clippy/clippy_lints/src/redundant_closure_call.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,441,836 ( 0.12%) site/frontend/rust-clippy/clippy_lints/src/unnecessary_mut_passed.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,441,836 ( 0.12%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::fn_def_id_with_node_args [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,441,814 ( 0.12%) site/frontend/rust-clippy/clippy_lints/src/double_parens.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,441,814 ( 0.12%) site/frontend/rust-clippy/clippy_lints/src/precedence.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,441,814 ( 0.12%) site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::append_opt_vecs:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,441,770 ( 0.12%) ???:::visit_expr'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,409,250 ( 0.11%) include/jemalloc/internal/sz.h:malloc 1,376,353 ( 0.11%) 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] 1,376,299 ( 0.11%) site/frontend/rust-clippy/clippy_lints/src/bool_comparison.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,376,298 ( 0.11%) site/frontend/rust-clippy/clippy_lints/src/operators/eq_op.rs:clippy_lints::operators::eq_op::check_assert [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,376,298 ( 0.11%) site/frontend/rust-clippy/clippy_lints/src/partialeq_to_none.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,376,298 ( 0.11%) site/frontend/rust-clippy/clippy_lints/src/unit_types/unit_cmp.rs:clippy_lints::unit_types::unit_cmp::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,376,298 ( 0.11%) site/frontend/rust-clippy/clippy_lints/src/useless_vec.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,376,298 ( 0.11%) site/frontend/rust-clippy/clippy_lints/src/utils/author.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,376,298 ( 0.11%) site/frontend/rust-clippy/clippy_lints/src/utils/dump_hir.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,376,295 ( 0.11%) site/frontend/rust-clippy/clippy_lints/src/manual_clamp.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,376,235 ( 0.11%) ???:rustc_hir::intravisit::walk_expr::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,317,811 ( 0.11%) /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 1,310,840 ( 0.11%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:::check_attributes 1,310,761 ( 0.11%) site/frontend/rust-clippy/clippy_lints/src/nonnull_unchecked_on_box_ptr.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,310,761 ( 0.11%) site/frontend/rust-clippy/clippy_lints/src/strlen_on_c_strings.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,310,760 ( 0.11%) site/frontend/rust-clippy/clippy_lints/src/minmax.rs:clippy_lints::minmax::min_max [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,310,754 ( 0.11%) site/frontend/rust-clippy/clippy_lints/src/float_literal.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,252,946 ( 0.10%) ???:pthread_mutex_unlock [/usr/lib/libc.so.6] 1,245,298 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/combined_early_pass.rs:::check_attributes [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,245,298 ( 0.10%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:::check_attributes_post 1,245,256 ( 0.10%) ???:rustc_hir::intravisit::walk_expr:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,245,224 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/single_range_in_vec_init.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,245,223 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/unnecessary_map_on_constructor.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,245,223 ( 0.10%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::root_macro_call [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,245,222 ( 0.10%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:clippy_utils::macros::root_macro_call 1,245,222 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/casts/cast_slice_different_sizes.rs:clippy_lints::casts::cast_slice_different_sizes::expr_cast_chain_tys [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,245,222 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/default.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,245,222 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/disallowed_fields.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,245,222 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/needless_bool.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,245,222 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/zombie_processes.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,245,222 ( 0.10%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::in_automatically_derived [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,245,165 ( 0.10%) ???:core::ptr::drop_glue::'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,236,127 ( 0.10%) include/jemalloc/internal/emap.h:tcache_bin_flush_small 1,219,355 ( 0.10%) ???:>::reserve_rehash::<>>::insert_unique::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,179,774 ( 0.10%) site/frontend/rust-clippy/clippy_utils/src/attrs.rs:clippy_utils::attrs::parse_attrs::<::pop_attrs::{closure#0}, rustc_hir::hir::Attribute> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,179,774 ( 0.10%) site/frontend/rust-clippy/clippy_utils/src/attrs.rs:clippy_utils::attrs::parse_attrs::<::push_attrs::{closure#0}, rustc_hir::hir::Attribute> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,179,684 ( 0.10%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/map.rs:, clippy_utils::macros::first_node_macro_backtrace::{closure#0}> as core::iter::traits::iterator::Iterator>::try_fold::<(), >::iter_try_fold::flatten, clippy_utils::macros::macro_backtrace::{closure#0}>, clippy_utils::macros::first_node_macro_backtrace::{closure#0}::{closure#0}>, (), core::ops::control_flow::ControlFlow, as core::iter::traits::iterator::Iterator>::try_fold::flatten, clippy_utils::macros::macro_backtrace::{closure#0}>, clippy_utils::macros::first_node_macro_backtrace::{closure#0}::{closure#0}>, (), core::ops::control_flow::ControlFlow, core::iter::traits::iterator::Iterator::find::check::{closure#0}>::{closure#0}>::{closure#0}, core::ops::control_flow::ControlFlow> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,179,684 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/assertions_on_constants.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,179,684 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/await_holding_invalid.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,179,684 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/block_scrutinee.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,179,684 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/blocks_in_conditions.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,179,684 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/entry.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,179,684 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/format_args.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,179,684 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/format_impl.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,179,684 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/implicit_saturating_sub.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,179,684 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/infinite_iter.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,179,684 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/manual_abs_diff.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,179,684 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/manual_ignore_case_cmp.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,179,684 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/manual_pop_if.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,179,684 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/manual_take.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,179,684 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/needless_borrows_for_generic_args.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,179,684 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/reserve_after_initialization.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,179,684 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/swap_ptr_to_ref.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,179,684 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/write/mod.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,179,684 ( 0.10%) site/frontend/rust-clippy/clippy_lints/src/zero_repeat_side_effects.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,179,684 ( 0.10%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::matching_root_macro_call [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,179,653 ( 0.10%) /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,133,454 ( 0.09%) ???:>::reserve_rehash::::{closure#0}> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 1,114,418 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,240 ( 0.09%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:::check_attributes 1,114,231 ( 0.09%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/spec_from_iter_nested.rs: as alloc::vec::spec_from_iter_nested::SpecFromIterNested<(rustc_span::span_encoding::Span, alloc::string::String), core::iter::adapters::filter_map::FilterMap, clippy_lints::doc::suspicious_doc_comments::collect_doc_replacements::{closure#0}>>>::from_iter [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,231 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/doc/suspicious_doc_comments.rs:clippy_lints::doc::suspicious_doc_comments::check [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,170 ( 0.09%) 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] 1,114,147 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/useless_concat.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/arc_with_non_send_sync.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/async_yields_async.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/bool_assert_comparison.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/box_default.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) 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] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/cloned_ref_to_slice_refs.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/collapsible_if.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/default_constructed_unit_structs.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/default_instead_of_iter_empty.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/drop_forget_ref.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/explicit_write.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/from_raw_with_void_ptr.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/from_str_radix_10.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/implicit_saturating_add.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/indexing_slicing.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/manual_bits.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/manual_checked_ops.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/manual_float_methods.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/manual_rem_euclid.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/manual_rotate.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/manual_slice_size_calculation.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/mem_replace.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/minmax.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/neg_cmp_op_on_partial_ord.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/non_copy_const.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/operators/float_cmp.rs:clippy_lints::operators::float_cmp::check_assert [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/panicking_overflow_checks.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/rc_clone_in_vec_init.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/replace_box.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/size_of_in_element_count.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/strings.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/to_digit_is_some.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/transmute/mod.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/unit_return_expecting_ord.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,146 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/unnecessary_owned_empty_strings.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,129 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/unused_rounding.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,114,129 ( 0.09%) site/frontend/rust-clippy/clippy_lints/src/utils/format_args_collector.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,093,858 ( 0.09%) include/jemalloc/internal/edata.h:tcache_bin_flush_small 1,087,789 ( 0.09%) ???:0x000000000000aec0 [/usr/lib/ld-linux-x86-64.so.2] 1,086,384 ( 0.09%) ???:pthread_mutex_trylock [/usr/lib/libc.so.6] 1,048,677 ( 0.08%) site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:clippy_utils::msrvs::check_attrs:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,048,609 ( 0.08%) site/frontend/rust-clippy/clippy_lints/src/reference.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,048,609 ( 0.08%) site/frontend/rust-clippy/clippy_lints/src/string_patterns.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,048,608 ( 0.08%) ???:::node [???] 1,048,608 ( 0.08%) site/frontend/rust-clippy/clippy_lints/src/init_numbered_fields.rs:::check_expr [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 1,048,608 ( 0.08%) 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] 983,130 ( 0.08%) 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] 983,098 ( 0.08%) ???:::visit_expr::{closure#0} [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 983,089 ( 0.08%) ???:>::walk_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 983,084 ( 0.08%) ???:>::walk_mut [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 983,070 ( 0.08%) 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] 983,070 ( 0.08%) 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] 983,070 ( 0.08%) 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] 983,070 ( 0.08%) 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] 983,070 ( 0.08%) 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] 983,070 ( 0.08%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 983,070 ( 0.08%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 983,063 ( 0.08%) /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 983,055 ( 0.08%) 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] 983,025 ( 0.08%) ???:::filter_map_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 917,532 ( 0.07%) ???:rustc_hir::hir::is_range_literal [???] 917,532 ( 0.07%) 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] 917,527 ( 0.07%) ???:thin_vec::drop_non_singleton::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 911,535 ( 0.07%) /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 906,186 ( 0.07%) ???:>>::insert_unique [???] 864,550 ( 0.07%) ???:core::str::converts::from_utf8 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 852,046 ( 0.07%) 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] 851,995 ( 0.07%) 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] 851,994 ( 0.07%) 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] 851,994 ( 0.07%) 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] 851,994 ( 0.07%) 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] 851,994 ( 0.07%) 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] 850,540 ( 0.07%) ???:0x00000000001747c0 [/usr/lib/libc.so.6] 822,321 ( 0.07%) include/jemalloc/internal/thread_event.h:malloc 786,907 ( 0.06%) include/jemalloc/internal/arena_inlines_b.h:tcache_bin_flush_small 786,680 ( 0.06%) ???:>>::drop_slow'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 786,562 ( 0.06%) ???:>>::walk_ref [???] 786,534 ( 0.06%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 786,516 ( 0.06%) ???:rustc_resolve::rustdoc::span_of_fragments [???] 786,456 ( 0.06%) 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] 786,439 ( 0.06%) /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] 785,233 ( 0.06%) include/jemalloc/internal/bit_util.h:malloc_default 765,565 ( 0.06%) include/jemalloc/internal/cache_bin.h:malloc_default 736,976 ( 0.06%) ???:::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 721,073 ( 0.06%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 720,995 ( 0.06%) ???:::expect_hir_owner_nodes'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 720,918 ( 0.06%) /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 720,918 ( 0.06%) 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] 720,918 ( 0.06%) 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] 720,916 ( 0.06%) /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 667,245 ( 0.05%) ???:dladdr [/usr/lib/libc.so.6] 657,437 ( 0.05%) ???:, ())>>::reserve_rehash::, (), rustc_middle::mir::interpret::allocation::Allocation>::{closure#1}> [???] 656,160 ( 0.05%) ???:rust_psm_stack_pointer [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 655,430 ( 0.05%) /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 655,380 ( 0.05%) 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] 655,380 ( 0.05%) 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] 655,366 ( 0.05%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 642,353 ( 0.05%) ???:::make_owner_info [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 618,040 ( 0.05%) /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_expr 605,300 ( 0.05%) include/jemalloc/internal/bitmap.h:tcache_bin_flush_small 589,891 ( 0.05%) /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 589,890 ( 0.05%) /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 589,887 ( 0.05%) 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] 589,842 ( 0.05%) 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] 589,837 ( 0.05%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr_post 589,833 ( 0.05%) 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] 589,827 ( 0.05%) /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}> 589,824 ( 0.05%) /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}> 564,220 ( 0.05%) include/jemalloc/internal/sz.h:free 558,725 ( 0.05%) include/jemalloc/internal/arena_inlines_b.h:malloc_default 547,174 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/ascii.rs:::check_expr 525,044 ( 0.04%) ???:::stable_hash:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 524,304 ( 0.04%) /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 524,304 ( 0.04%) site/frontend/rust-clippy/clippy_utils/src/res.rs:::check_expr 524,300 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 524,300 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 524,300 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 524,300 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 524,300 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 524,300 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 524,300 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 524,300 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 524,300 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 524,300 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 524,300 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 524,300 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 524,300 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 524,300 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 524,300 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 524,300 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:clippy_lints::unit_types::unit_arg::check 524,300 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:clippy_lints::unit_types::unit_cmp::check 524,296 ( 0.04%) site/frontend/rust-clippy/clippy_lints/src/unnested_or_patterns.rs:::check_expr 524,292 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 524,280 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:clippy_utils::macros::span_is_local 524,280 ( 0.04%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::span_is_local [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 504,545 ( 0.04%) /rustc/84b36a78a28a63f134171c670be1932ffa2485f8/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/build/tikv-jemalloc-sys/80122c672fbe49ef/out/build/src/tcache.c:tcache_bin_flush_stashed [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 499,255 ( 0.04%) ???:::new [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 458,820 ( 0.04%) ???:::resolve_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 458,766 ( 0.04%) site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check_expr 458,766 ( 0.04%) site/frontend/rust-clippy/clippy_lints/src/regex.rs:::check_expr_post 458,766 ( 0.04%) 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] 458,763 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 458,763 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 458,762 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 458,745 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::visit_expr'2 458,745 ( 0.04%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 453,975 ( 0.04%) include/jemalloc/internal/div.h:tcache_bin_flush_small 444,435 ( 0.04%) /rustc/84b36a78a28a63f134171c670be1932ffa2485f8/obj/build/x86_64-unknown-linux-gnu/stage2-rustc/x86_64-unknown-linux-gnu/release/build/tikv-jemalloc-sys/80122c672fbe49ef/out/build/src/jemalloc.c:malloc_default [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 440,639 ( 0.04%) ???: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] 430,016 ( 0.03%) include/jemalloc/internal/ph.h:pa_alloc 416,633 ( 0.03%) include/jemalloc/internal/tcache_inlines.h:malloc_default 415,475 ( 0.03%) include/jemalloc/internal/rtree.h:pa_alloc 409,043 ( 0.03%) ???:, ())>>::reserve_rehash::, (), rustc_middle::mir::interpret::allocation::Allocation>::{closure#1}>'2 [???] 394,186 ( 0.03%) ???:std::exception::~exception() [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 393,504 ( 0.03%) /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] 393,410 ( 0.03%) ???: as rustc_hir::intravisit::Visitor>::visit_expr::{closure#0}::{closure#0} [???] 393,330 ( 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:::check_attributes 393,330 ( 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:::check_attributes_post 393,284 ( 0.03%) ???:::visit_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 393,284 ( 0.03%) ???:::visit_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 393,283 ( 0.03%) ???:::visit_expr [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 393,270 ( 0.03%) site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::check_attributes 393,270 ( 0.03%) site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::check_attributes_post 393,267 ( 0.03%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 393,267 ( 0.03%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 393,267 ( 0.03%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 393,267 ( 0.03%) ???:>::walk_ref [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 393,260 ( 0.03%) /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] 393,260 ( 0.03%) /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] 393,258 ( 0.03%) /rust/deps/thin-vec-0.2.19/src/lib.rs:::check_attributes 393,228 ( 0.03%) /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 393,228 ( 0.03%) site/frontend/rust-clippy/clippy_lints/src/unit_types/mod.rs:::check_expr 393,228 ( 0.03%) 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] 393,227 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 393,227 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 393,226 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 393,210 ( 0.03%) site/frontend/rust-clippy/clippy_lints/src/casts/needless_type_cast.rs:rustc_hir::intravisit::walk_expr::> 369,771 ( 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:::check_expr 366,649 ( 0.03%) ???:0x0000000000029600 [/usr/lib/ld-linux-x86-64.so.2] 354,105 ( 0.03%) include/jemalloc/internal/edata.h:pa_alloc 343,818 ( 0.03%) ???:::fill_well_known'2 [???] 327,752 ( 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::> [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 327,715 ( 0.03%) site/frontend/rust-clippy/clippy_utils/src/attrs.rs:::check_attributes 327,710 ( 0.03%) 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] 327,693 ( 0.03%) /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 327,693 ( 0.03%) /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 327,690 ( 0.03%) /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 327,690 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:::check_expr 327,690 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:::check_expr 327,690 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:::check_expr 327,690 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:::check_expr 327,690 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:::check_expr 327,690 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:::check_expr 327,690 ( 0.03%) /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 327,690 ( 0.03%) site/frontend/rust-clippy/clippy_lints/src/functions/mod.rs:::check_expr 327,690 ( 0.03%) 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] 327,690 ( 0.03%) site/frontend/rust-clippy/clippy_lints/src/needless_parens_on_range_literals.rs:::check_expr 327,690 ( 0.03%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 327,690 ( 0.03%) 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] 327,689 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 327,689 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 327,689 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 327,689 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 327,689 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 327,689 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 327,689 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:::check_expr 327,689 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:clippy_lints::casts::borrow_as_ptr::check_implicit_cast 327,689 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/span_encoding.rs:clippy_utils::macros::root_macro_call 327,685 ( 0.03%) ???:::check_expr_post [???] 327,680 ( 0.03%) 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] 327,675 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:::check_expr 327,675 ( 0.03%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs:::check_expr 327,675 ( 0.03%) site/frontend/rust-clippy/clippy_utils/src/visitors.rs:rustc_hir::intravisit::walk_expr::> 316,750 ( 0.03%) include/jemalloc/internal/sz.h:pa_alloc 302,650 ( 0.02%) include/jemalloc/internal/util.h:tcache_bin_flush_small 295,081 ( 0.02%) ???:rustc_query_impl::plumbing::encode_query_values_inner::>, core::result::Result>::{closure#0} [???] 282,580 ( 0.02%) src/eset.c:pa_alloc 282,334 ( 0.02%) include/jemalloc/internal/tsd_tls.h:free [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 282,333 ( 0.02%) include/jemalloc/internal/atomic.h:free 273,990 ( 0.02%) ???:::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] 264,966 ( 0.02%) include/jemalloc/internal/ph.h:tcache_bin_flush_small 262,485 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:::trim_matches::<::is_whitespace> 262,181 ( 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 262,176 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_attributes 262,172 ( 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: 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 262,172 ( 0.02%) site/frontend/rust-clippy/clippy_utils/src/attrs.rs:::check_attributes_post 262,168 ( 0.02%) /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 262,168 ( 0.02%) site/frontend/rust-clippy/clippy_lints/src/attrs/mod.rs:::check_attributes_post 262,164 ( 0.02%) /rust/deps/smallvec-1.15.1/src/lib.rs:::meets [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 262,154 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::meets 262,154 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/sync/atomic.rs:::meets 262,152 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::hir 262,152 ( 0.02%) /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 262,152 ( 0.02%) site/frontend/rust-clippy/clippy_lints/src/eta_reduction.rs:::check_expr 262,152 ( 0.02%) site/frontend/rust-clippy/clippy_lints/src/suspicious_trait_impl.rs:::check_expr 262,152 ( 0.02%) site/frontend/rust-clippy/clippy_lints/src/vec_init_then_push.rs:::check_expr 262,140 ( 0.02%) /rust/deps/scoped-tls-1.0.1/src/lib.rs:::check_expr 262,140 ( 0.02%) site/frontend/rust-clippy/clippy_utils/src/source.rs:::check_expr 258,621 ( 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/jemalloc.c:malloc 257,171 ( 0.02%) ???:::new [???] 253,601 ( 0.02%) src/base.c:pa_alloc 242,798 ( 0.02%) ???:>::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] 241,031 ( 0.02%) ???:>::insert [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 239,817 ( 0.02%) include/jemalloc/internal/rtree.h:ecache_evict 235,622 ( 0.02%) ???:__cxa_finalize [/usr/lib/libc.so.6] 217,740 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_expr 216,299 ( 0.02%) include/jemalloc/internal/sz.h:malloc_default 215,938 ( 0.02%) ???:core::ptr::drop_glue::> [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 214,283 ( 0.02%) ???:::register_lints [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 212,769 ( 0.02%) ???:::stable_hash_span [???] 211,649 ( 0.02%) ???:::decode_span [???] 210,771 ( 0.02%) include/jemalloc/internal/jemalloc_internal_inlines_b.h:malloc_default 209,097 ( 0.02%) ???: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] 196,823 ( 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:::trim_matches::<::is_whitespace> 196,725 ( 0.02%) ???:>>,)>>::call_once [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 196,678 ( 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:: [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 196,631 ( 0.02%) /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 196,629 ( 0.02%) /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 196,629 ( 0.02%) /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 196,629 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/string.rs:::check_attributes 196,629 ( 0.02%) /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 196,629 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/str/mod.rs:::check_attributes 196,620 ( 0.02%) 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] 196,620 ( 0.02%) 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] 196,614 ( 0.02%) /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 196,614 ( 0.02%) /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> 196,614 ( 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:, 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> 196,614 ( 0.02%) /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 196,614 ( 0.02%) /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 196,614 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::check_expr 196,614 ( 0.02%) /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 196,614 ( 0.02%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:::check_expr 196,614 ( 0.02%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:::check_expr 196,614 ( 0.02%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:::check_expr 196,614 ( 0.02%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:::check_expr 196,614 ( 0.02%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:::check_expr 196,614 ( 0.02%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:::check_expr 196,611 ( 0.02%) 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] 196,611 ( 0.02%) 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] 196,611 ( 0.02%) 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] 196,608 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:::eq 196,608 ( 0.02%) site/frontend/rust-clippy/clippy_lints/src/approx_const.rs:::check_lit [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 196,608 ( 0.02%) site/frontend/rust-clippy/clippy_utils/src/lib.rs:::with_source_text::::{closure#0}> 196,605 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/string.rs:::check_expr 196,605 ( 0.02%) /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_expr 196,605 ( 0.02%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/thread/local.rs:::check_expr 191,942 ( 0.02%) ???:0x000000000000ad20 [/usr/lib/ld-linux-x86-64.so.2] 187,733 ( 0.02%) include/jemalloc/internal/atomic.h:tcache_bin_flush_small 185,885 ( 0.01%) include/jemalloc/internal/cache_bin.h:tcache_bin_flush_stashed 175,359 ( 0.01%) include/jemalloc/internal/edata.h:ecache_evict 175,304 ( 0.01%) include/jemalloc/internal/mutex.h:malloc_default 170,609 ( 0.01%) include/jemalloc/internal/edata.h:malloc_default 167,659 ( 0.01%) include/jemalloc/internal/fb.h:pa_alloc 165,617 ( 0.01%) include/jemalloc/internal/thread_event.h:malloc_default 162,380 ( 0.01%) include/jemalloc/internal/ticker.h:malloc_default 153,664 ( 0.01%) include/jemalloc/internal/ph.h:ecache_evict 152,482 ( 0.01%) ???:::lint_level_spec_at_node [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 152,107 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/mod.rs:::check_expr 151,731 ( 0.01%) include/jemalloc/internal/ph.h:eset_remove 151,194 ( 0.01%) src/extent.c:pa_alloc 149,775 ( 0.01%) ???:::stable_hash:: [???] 145,188 ( 0.01%) ???:::hash_one::<&std::path::PathBuf> [???] 141,712 ( 0.01%) ???:::finish128_inner [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 132,408 ( 0.01%) ???:>::decode [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 131,086 ( 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 131,086 ( 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 131,084 ( 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 131,082 ( 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 131,082 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets 131,080 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint/src/passes.rs:::check_attributes [/home/moon/git/rustc-perf/site/frontend/rust-clippy/target/clippy-build/clippy-driver] 131,076 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/token.rs:::check_expr 131,076 ( 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 131,076 ( 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 131,076 ( 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 131,076 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/hygiene.rs:::check_expr 131,076 ( 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 131,076 ( 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 131,076 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/fuse.rs:clippy_lints::operators::float_cmp::check_assert 131,076 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/traits/iterator.rs:clippy_lints::operators::float_cmp::check_assert 131,076 ( 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 131,076 ( 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 131,076 ( 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 131,076 ( 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 131,076 ( 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 131,076 ( 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 131,076 ( 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 131,076 ( 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 131,076 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/option.rs:clippy_utils::fn_def_id 131,076 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/iter/macros.rs:clippy_utils::in_automatically_derived 131,076 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/mod.rs:::check_expr_post 131,076 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/mod.rs:::check_expr 131,076 ( 0.01%) /rust/deps/hashbrown-0.17.1/src/raw.rs:::check_expr 131,076 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/manual_non_exhaustive.rs:::check_expr 131,076 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/needless_question_mark.rs:::check_expr 131,076 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/pointers_in_nomem_asm_block.rs:::check_expr 131,076 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/question_mark.rs:::check_expr_post 131,076 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/slow_vector_initialization.rs:::check_expr 131,076 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/temporary_assignment.rs:::check_expr 131,076 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/useless_conversion.rs:::check_expr_post 131,076 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 131,076 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 131,076 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 131,076 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 131,076 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 131,076 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 131,076 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:::check_expr 131,076 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/higher.rs:clippy_lints::loops::while_let_on_iterator::check 131,076 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_lints::operators::eq_op::check_assert 131,076 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_lints::operators::float_cmp::check_assert 131,076 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/res.rs:::check_expr 131,076 ( 0.01%) site/frontend/rust-clippy/clippy_utils/src/res.rs:::check_expr 131,075 ( 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 131,075 ( 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 131,074 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/asm_syntax.rs:::check_expr 131,074 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/else_if_without_else.rs:::check_expr 131,074 ( 0.01%) site/frontend/rust-clippy/clippy_lints/src/option_env_unwrap.rs:::check_expr 131,071 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:rustc_hir::intravisit::walk_expr:: 131,070 ( 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:::check_expr 131,070 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/alloc.rs:::check_expr 131,070 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/borrow.rs:::check_expr 131,070 ( 0.01%) /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:::check_expr 131,070 ( 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 131,070 ( 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 131,044 ( 0.01%) /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 125,474 ( 0.01%) ???:__cxa_atexit [/usr/lib/libc.so.6] 125,135 ( 0.01%) src/tcache.c:malloc_default 117,742 ( 0.01%) ???: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] 116,244 ( 0.01%) ???:::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] 113,004 ( 0.01%) ???:::try_mark_previous_green'2 [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 105,321 ( 0.01%) ???: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] 101,735 ( 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] 99,230 ( 0.01%) ???:0x0000000000067b30 [/usr/lib/libc.so.6] 97,474 ( 0.01%) ???:0x0000000000040520 [/usr/lib/libc.so.6] 96,652 ( 0.01%) ???:::insert [???] 94,670 ( 0.01%) include/jemalloc/internal/edata.h:eset_remove 93,890 ( 0.01%) include/jemalloc/internal/tsd.h:malloc_default 92,506 ( 0.01%) ???:rustc_metadata::rmeta::decoder::cstore_impl::provide_extern::diagnostic_items [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 92,276 ( 0.01%) ???:core::ptr::drop_glue:: [/home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/librustc_driver-173404cd07acc0f2.so] 87,166 ( 0.01%) include/jemalloc/internal/cache_bin.h:tcache_bin_flush_small -------------------------------------------------------------------------------- -- 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 { 262,152 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &'_ Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::Call(path, [arg]) = expr.kind . && 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", . ); . } 327,690 ( 0.03%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/mod.rs -------------------------------------------------------------------------------- Ir -- line 621 ---------------------------------------- . /// assert!(ascii.is_ascii()); . /// assert!(!non_ascii.is_ascii()); . /// ``` . #[must_use] . #[stable(feature = "ascii_methods_on_intrinsics", since = "1.23.0")] . #[rustc_const_stable(feature = "const_u8_is_ascii", since = "1.43.0")] . #[inline] . pub const fn is_ascii(&self) -> bool { 152,107 ( 0.01%) *self <= 127 . } . . /// If the value of this byte is within the ASCII range, returns it as an . /// [ASCII character](ascii::Char). Otherwise, returns `None`. . #[must_use] . #[unstable(feature = "ascii_char", issue = "110998")] . #[inline] . pub const fn as_ascii(&self) -> Option { -- line 637 ---------------------------------------- -- line 1218 ---------------------------------------- . #[inline] . pub fn escape_ascii(self) -> ascii::EscapeDefault { . ascii::escape_default(self) . } . . #[inline] . pub(crate) const fn is_utf8_char_boundary(self) -> bool { . // This is bit magic equivalent to: b < 128 || b >= 192 81 ( 0.00%) (self as i8) >= -0x40 . } . } . . impl u16 { . uint_impl! { . Self = u16, . ActualT = u16, . SignedT = i16, -- line 1234 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 524,304 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 131,076 ( 0.01%) if !expr.span.from_expansion() . && let Some(if_expr) = If::hir(expr) . && let Some(r#else) = if_expr.r#else . && let ExprKind::Binary(op, rhs, lhs) = if_expr.cond.kind . && let (BinOpKind::Gt | BinOpKind::Ge, mut a, mut b) | (BinOpKind::Lt | BinOpKind::Le, mut b, mut a) = . (op.node, rhs, lhs) . && let Some((ty, b_n_refs)) = self.are_ty_eligible(cx, a, b) . && is_sub_expr(cx, if_expr.then, a, b, ty) . && is_sub_expr(cx, r#else, b, a, ty) -- line 66 ---------------------------------------- -- 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); . }, . ); . } 524,304 ( 0.04%) } . } . . 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)> { . let is_int = |ty: Ty<'_>| matches!(ty.kind(), ty::Uint(_) | ty::Int(_)) && self.msrv.meets(cx, msrvs::ABS_DIFF); . let is_duration = -- line 102 ---------------------------------------- -------------------------------------------------------------------------------- -- 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, . ) { 2 ( 0.00%) if let FnRetTy::Return(hir_ty) = decl.output . && is_unit_ty(hir_ty) . && !hir_ty.span.from_expansion() . && get_def(span) == get_def(hir_ty.span) . { . // The explicit `-> ()` in the closure signature might be necessary for multiple reasons: . // - Implicit types in closure signatures are forbidden when `for<...>` is present . // - If the closure body ends with a function call, and that function's return type is generic, the . // `-> ()` could be required for it to be inferred -- line 62 ---------------------------------------- -- line 75 ---------------------------------------- . && let Some(expr) = block.expr . && is_never_expr(cx, expr).is_some() . { . return; . } . . lint_unneeded_unit_return(cx, hir_ty.span, span); . } 1 ( 0.00%) } . . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 327,690 ( 0.03%) if let ExprKind::Ret(Some(expr)) | ExprKind::Break(_, Some(expr)) = expr.kind . && is_unit_expr(expr) . && !expr.span.from_expansion() . { . span_lint_and_sugg( . cx, . UNUSED_UNIT, . expr.span, . "unneeded `()`", . "remove the `()`", . String::new(), . Applicability::MachineApplicable, . ); . } 65,538 ( 0.01%) } . . fn check_poly_trait_ref(&mut self, cx: &LateContext<'tcx>, poly: &'tcx PolyTraitRef<'tcx>) { . if let [segment] = &poly.trait_ref.path.segments . && matches!(segment.ident.name, sym::Fn | sym::FnMut | sym::FnOnce) . && let Some(args) = segment.args . && args.parenthesized == GenericArgsParentheses::ParenSugar . && let [constraint] = &args.constraints . && constraint.ident.name == sym::Output -- line 108 ---------------------------------------- -- line 115 ---------------------------------------- . lint_unneeded_unit_return(cx, hir_ty.span, poly.span); . } . } . } . . 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. 4 ( 0.00%) fn check_block(&mut self, cx: &EarlyContext<'_>, block: &Block) { . if let Some(stmt) = block.stmts.last() . && let StmtKind::Expr(expr) = &stmt.kind . && let rustc_ast::ExprKind::Tup(inner) = &expr.kind . && inner.is_empty() . && let ctxt = block.span.ctxt() . && stmt.span.ctxt() == ctxt . && expr.span.ctxt() == ctxt . && expr.attrs.is_empty() -- line 131 ---------------------------------------- -- line 136 ---------------------------------------- . UNUSED_UNIT, . sp, . "unneeded unit expression", . "remove the final `()`", . String::new(), . Applicability::MachineApplicable, . ); . } 5 ( 0.00%) } . } . . fn is_unit_ty(ty: &Ty<'_>) -> bool { . matches!(ty.kind, TyKind::Tup([])) . } . . // get the def site . #[must_use] -- line 152 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 65,552 ( 0.01%) 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. 22 ( 0.00%) if index == 0 { . return true; . } . 69 ( 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 -- line 391 ---------------------------------------- -- 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()] 30 ( 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)), 18 ( 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 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> { 14 ( 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>, . { 10 ( 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 1978 ---------------------------------------- . /// 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] . pub fn split_once(&self, delimiter: P) -> Option<(&'_ str, &'_ str)> { 99 ( 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. . unsafe { Some((self.get_unchecked(..start), self.get_unchecked(end..))) } . } . . /// Splits the string on the last occurrence of the specified delimiter and . /// returns prefix before delimiter and suffix after delimiter. . /// . /// # Examples -- line 1994 ---------------------------------------- -- 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 { 131,169 ( 0.01%) self.trim_matches(char::is_whitespace) 1,048,688 ( 0.08%) => /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> (65,543x) . } . . /// 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 { 2 ( 0.00%) self.trim_start_matches(char::is_whitespace) 58 ( 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> (2x) . } . . /// Returns a string slice with trailing whitespace removed. . /// . /// 'Whitespace' is defined according to the terms of the Unicode Derived . /// Core Property `White_Space`, which includes newlines. . /// . /// # Text directionality -- line 2234 ---------------------------------------- -- line 2369 ---------------------------------------- . /// A more complex pattern, using a closure: . /// . /// ``` . /// assert_eq!("1foo1barXX".trim_matches(|c| c == '1' || c == 'X'), "foo1bar"); . /// ``` . #[must_use = "this returns the trimmed string as a new slice, \ . without modifying the original"] . #[stable(feature = "rust1", since = "1.0.0")] 196,752 ( 0.02%) 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) } 196,752 ( 0.02%) } . . /// 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")] 4 ( 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()) } 2 ( 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 ---------------------------------------- 105 ( 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 { 589,842 ( 0.05%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::Binary(ref op, l, r) = expr.kind . && matches!( . op.node, . BinOpKind::And | BinOpKind::BitAnd | BinOpKind::Or | BinOpKind::BitOr . ) . && self.msrv.meets(cx, msrvs::RANGE_CONTAINS) . && !is_in_const_context(cx) . { . check_possible_range_contains(cx, op.node, l, r, expr, expr.span); . } . 393,228 ( 0.03%) if let Some(range) = higher::Range::hir(cx, expr) { 2,949,210 ( 0.24%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (65,538x) . check_exclusive_range_plus_one(cx, expr, &range); . check_inclusive_range_minus_one(cx, expr, &range); . check_reversed_empty_range(cx, expr, &range); . } 524,304 ( 0.04%) } . } . . fn check_possible_range_contains( . cx: &LateContext<'_>, . op: BinOpKind, . left: &Expr<'_>, . right: &Expr<'_>, . expr: &Expr<'_>, -- line 217 ---------------------------------------- 65,538 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/const_ptr.rs -------------------------------------------------------------------------------- Ir -- line 30 ---------------------------------------- . match (ptr).guaranteed_eq(null_mut()) { . Some(res) => res, . // To remain maximally conservative, we stop execution when we don't . // know whether the pointer is null or not. . // We can *not* return `false` here, that would be unsound in `NonNull::new`! . None => panic!("null-ness of this pointer cannot be determined in const context"), . } . } else { 131,243 ( 0.01%) 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. 65,569 ( 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 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`. 48 ( 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`. 85 ( 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`. 65,660 ( 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 { 65,544 ( 0.01%) *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 ---------------------------------------- 23 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/unnested_or_patterns.rs -------------------------------------------------------------------------------- Ir -- line 63 ---------------------------------------- . impl EarlyLintPass for UnnestedOrPatterns { . fn check_arm(&mut self, cx: &EarlyContext<'_>, a: &ast::Arm) { . if self.msrv.meets(msrvs::OR_PATTERNS) { . lint_unnested_or_patterns(cx, &a.pat); . } . } . . fn check_expr(&mut self, cx: &EarlyContext<'_>, e: &ast::Expr) { 327,685 ( 0.03%) if self.msrv.meets(msrvs::OR_PATTERNS) 524,296 ( 0.04%) => /rust/deps/smallvec-1.15.1/src/lib.rs:::meets (65,537x) . && let ast::ExprKind::Let(pat, _, _, _) = &e.kind . { . lint_unnested_or_patterns(cx, pat); . } . } . . fn check_param(&mut self, cx: &EarlyContext<'_>, p: &ast::Param) { . if self.msrv.meets(msrvs::OR_PATTERNS) { -- line 79 ---------------------------------------- 196,611 ( 0.02%) -------------------------------------------------------------------------------- -- 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 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>> { 2 ( 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 1490 ---------------------------------------- . matches!(n.args, AttrArgs::Empty) . } . _ => false, . } . } . . #[inline] . fn symbol_path(&self) -> Option> { 11 ( 0.00%) match &self { . 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), -- line 1506 ---------------------------------------- -- line 1517 ---------------------------------------- . } . . fn is_automatically_derived_attr(&self) -> bool { . matches!(self, Attribute::Parsed(AttributeKind::AutomaticallyDerived)) . } . . #[inline] . fn doc_str_and_fragment_kind(&self) -> Option<(Symbol, DocFragmentKind)> { 2 ( 0.00%) match &self { . Attribute::Parsed(AttributeKind::DocComment { kind, comment, .. }) => { . Some((*comment, *kind)) . } . _ => None, . } . } . . fn doc_resolution_scope(&self) -> Option { -- line 1533 ---------------------------------------- -- line 1547 ---------------------------------------- . AttributeKind::ProcMacro . | AttributeKind::ProcMacroAttribute . | AttributeKind::ProcMacroDerive { .. } . ) . ) . } . . fn is_doc_hidden(&self) -> bool { 2 ( 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 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 { 33 ( 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 2727 ---------------------------------------- . while let ExprKind::DropTemps(inner) = &expr.kind { . expr = inner; . } . expr . } . . pub fn peel_blocks(&self) -> &Self { . let mut expr = self; 655,398 ( 0.05%) while let ExprKind::Block(Block { expr: Some(inner), .. }, _) = &expr.kind { . expr = inner; . } . expr . } . . pub fn peel_borrows(&self) -> &Self { . let mut expr = self; 196,614 ( 0.02%) while let ExprKind::AddrOf(.., inner) = &expr.kind { . 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(..) => { -- line 2751 ---------------------------------------- -- 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>> { 6 ( 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 }) -- line 3575 ---------------------------------------- -- line 4313 ---------------------------------------- . #[derive(Copy, Clone, PartialEq, Eq, Encodable, Decodable, Debug, StableHash)] . pub enum IsAsync { . Async(Span), . NotAsync, . } . . impl IsAsync { . pub fn is_async(self) -> bool { 2 ( 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 { 8 ( 0.00%) match *self { 1 ( 0.00%) Self::DefaultReturn(span) => span, . 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() . { -- line 4376 ---------------------------------------- -- 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. 24 ( 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 4789 ---------------------------------------- . pub safety: HeaderSafety, . pub constness: Constness, . pub asyncness: IsAsync, . pub abi: ExternAbi, . } . . impl FnHeader { . pub fn is_async(&self) -> bool { 2 ( 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 { 4 ( 0.00%) match self.safety { . HeaderSafety::SafeTargetFeatures => Safety::Unsafe, . HeaderSafety::Normal(safety) => safety, . } . } . } . . #[derive(Debug, Clone, Copy, StableHash)] . pub enum ItemKind<'hir> { -- line 4817 ---------------------------------------- 196,646 ( 0.02%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/vec_init_then_push.rs -------------------------------------------------------------------------------- Ir -- line 147 ---------------------------------------- . s, . Applicability::HasPlaceholders, . ); . } . } . . impl<'tcx> LateLintPass<'tcx> for VecInitThenPush { . fn check_block(&mut self, _: &LateContext<'tcx>, _: &'tcx Block<'tcx>) { 1 ( 0.00%) self.searcher = None; . } . . fn check_local(&mut self, cx: &LateContext<'tcx>, local: &'tcx LetStmt<'tcx>) { . if let Some(init_expr) = local.init . && let PatKind::Binding(BindingMode::MUT, id, name, None) = local.pat.kind . && !local.span.in_external_macro(cx.sess().source_map()) . && let Some(init) = get_vec_init_kind(cx, init_expr) . && !matches!(init, VecInitKind::WithExprCapacity(_)) -- line 163 ---------------------------------------- -- line 171 ---------------------------------------- . err_span: local.span, . found: 0, . last_push_expr: init_expr.hir_id, . }); . } . } . . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 196,614 ( 0.02%) if self.searcher.is_none() . && let ExprKind::Assign(left, right, _) = expr.kind . && let ExprKind::Path(QPath::Resolved(None, path)) = left.kind . && let [name] = &path.segments . && let Res::Local(id) = path.res . && !expr.span.in_external_macro(cx.sess().source_map()) . && let Some(init) = get_vec_init_kind(cx, right) . && !matches!(init, VecInitKind::WithExprCapacity(_)) . { -- line 187 ---------------------------------------- -- line 191 ---------------------------------------- . lhs_is_let: false, . let_ty_span: None, . name: name.ident.name, . err_span: expr.span, . found: 0, . last_push_expr: expr.hir_id, . }); . } 65,538 ( 0.01%) } . . fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx Stmt<'_>) { . if let Some(searcher) = self.searcher.take() { . if let StmtKind::Expr(expr) | StmtKind::Semi(expr) = stmt.kind . && !stmt.span.from_expansion() . && let ExprKind::MethodCall(name, self_arg, [_], _) = expr.kind . && self_arg.res_local_id() == Some(searcher.local_id) . && name.ident.name == sym::push -- line 207 ---------------------------------------- -- line 214 ---------------------------------------- . }); . } else { . searcher.display_err(cx); . } . } . } . . fn check_block_post(&mut self, cx: &LateContext<'tcx>, _: &'tcx Block<'tcx>) { 2 ( 0.00%) if let Some(searcher) = self.searcher.take() { . searcher.display_err(cx); . } . } . } -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs -------------------------------------------------------------------------------- Ir -- line 2128 ---------------------------------------- . // `ArcInner` structure itself is `Sync` because the inner data is . // `Sync` as well, so we're ok loaning out an immutable pointer to these . // contents. . unsafe { self.ptr.as_ref() } . } . . // Non-inlined part of `drop`. . #[inline(never)] 2 ( 0.00%) unsafe fn drop_slow(&mut self) { . // Drop the weak ref collectively held by all strong references when this . // variable goes out of scope. This ensures that the memory is deallocated . // even if the destructor of `T` panics. . // Take a reference to `self.alloc` instead of cloning because 1. it'll last long . // enough, and 2. you should be able to drop `Arc`s with unclonable allocators 2 ( 0.00%) let _weak = Weak { ptr: self.ptr, alloc: &self.alloc }; . . // Destroy the data at this time, even though we must not free the box . // allocation itself (there might still be weak pointers lying around). . // We cannot use `get_mut_unchecked` here, because `self.alloc` is borrowed. . unsafe { ptr::drop_in_place(&mut (*self.ptr.as_ptr()).data) }; . } . . /// Returns `true` if the two `Arc`s point to the same allocation in a vein similar to -- line 2150 ---------------------------------------- -- line 2424 ---------------------------------------- . // the worst already happened and we actually do overflow the `usize` counter. However, that . // requires the counter to grow from `isize::MAX` to `usize::MAX` between the increment . // above and the `abort` below, which seems exceedingly unlikely. . // . // This is a global invariant, and also applies when using a compare-exchange loop to increment . // counters in other methods. . // Otherwise, the counter could be brought to an almost-overflow using a compare-exchange loop, . // and then overflow using a few `fetch_add`s. 20 ( 0.00%) if old_size > MAX_REFCOUNT { . abort(); . } . 18 ( 0.00%) unsafe { Self::from_inner_in(self.ptr, self.alloc.clone()) } . } . } . . #[unstable(feature = "ergonomic_clones", issue = "132290")] . impl UseCloned for Arc {} . . #[unstable(feature = "share_trait", issue = "156756")] . impl Share for Arc {} . . #[stable(feature = "rust1", since = "1.0.0")] . impl Deref for Arc { . type Target = T; . . #[inline] . fn deref(&self) -> &T { 589,910 ( 0.05%) &self.inner().data . } . } . . #[unstable(feature = "pin_coerce_unsized_trait", issue = "150112")] . unsafe impl PinCoerceUnsized for Arc {} . . #[unstable(feature = "deref_pure_trait", issue = "87121")] . unsafe impl DerefPure for Arc {} -- line 2460 ---------------------------------------- -- line 2850 ---------------------------------------- . /// drop(foo); // Doesn't print anything . /// drop(foo2); // Prints "dropped!" . /// ``` . #[inline] . fn drop(&mut self) { . // Because `fetch_sub` is already atomic, we do not need to synchronize . // with other threads unless we are going to delete the object. This . // same logic applies to the below `fetch_sub` to the `weak` count. 40 ( 0.00%) if self.inner().strong.fetch_sub(1, Release) != 1 { . return; . } . . // This fence is needed to prevent reordering of use of the data and . // deletion of the data. Because it is marked `Release`, the decreasing . // of the reference count synchronizes with this `Acquire` fence. This . // means that use of the data happens before decreasing the reference . // count, which happens before this fence, which happens before the -- line 2866 ---------------------------------------- -- line 2893 ---------------------------------------- . // used by Default::default. . debug_assert!( . !ptr::addr_eq(self.ptr.as_ptr(), &STATIC_INNER_SLICE.inner), . "Arcs backed by a static should never reach a strong count of 0. \ . Likely decrement_strong_count or from_raw were called too many times.", . ); . . unsafe { 6 ( 0.00%) self.drop_slow(); 100 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:>>>::drop_slow (1x) 75 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/sync.rs:>>>::drop_slow (1x) . } . } . } . . impl Arc { . /// Attempts to downcast the `Arc` to a concrete type. . /// . /// # Examples -- line 2909 ---------------------------------------- -- line 3372 ---------------------------------------- . } . } . . /// Returns `None` when the pointer is dangling and there is no allocated `ArcInner`, . /// (i.e., when this `Weak` was created by `Weak::new`). . #[inline] . fn inner(&self) -> Option> { . let ptr = self.ptr.as_ptr(); 2 ( 0.00%) if is_dangling(ptr) { . None . } else { . // We are careful to *not* create a reference covering the "data" field, as . // the field may be mutated concurrently (for example, if the last `Arc` . // is dropped, the data field will be dropped in-place). . Some(unsafe { WeakInner { strong: &(*ptr).strong, weak: &(*ptr).weak } }) . } . } -- line 3388 ---------------------------------------- -- line 3524 ---------------------------------------- . // the memory orderings . // . // It's not necessary to check for the locked state here, because the . // weak count can only be locked if there was precisely one weak ref, . // meaning that drop could only subsequently run ON that remaining weak . // ref, which can only happen after the lock is released. . let inner = if let Some(inner) = self.inner() { inner } else { return }; . 2 ( 0.00%) if inner.weak.fetch_sub(1, Release) == 1 { . acquire!(inner.weak); . . // Make sure we aren't trying to "deallocate" the shared static for empty slices . // used by Default::default. . debug_assert!( . !ptr::addr_eq(self.ptr.as_ptr(), &STATIC_INNER_SLICE.inner), . "Arc/Weaks backed by a static should never be deallocated. \ . Likely decrement_strong_count or from_raw were called too many times.", -- line 3540 ---------------------------------------- 1,835,114 ( 0.15%) -------------------------------------------------------------------------------- -- 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::Index(array, index, _) = &expr.kind . && (!self.suppress_restriction_lint_in_const || !cx.tcx.hir_is_inside_const_context(expr.hir_id)) . && let expr_ty = cx.typeck_results().expr_ty(array) . && 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) . }) -- line 121 ---------------------------------------- -- line 223 ---------------------------------------- . 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); . } . }); . } . } 524,304 ( 0.04%) } . } . . /// Returns a tuple of options with the start and end (exclusive) values of . /// the range. If the start or end is not constant, None is returned. . fn to_const_range(cx: &LateContext<'_>, range: higher::Range<'_>, array_size: u128) -> (Option, Option) { . let ecx = ConstEvalCtxt::new(cx); . let s = range.start.map(|expr| ecx.eval(expr)); . let start = match s { -- line 239 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/int_plus_one.rs -------------------------------------------------------------------------------- Ir -- 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 { 393,222 ( 0.03%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 131,074 ( 0.01%) if let ExprKind::Binary(binop, lhs, rhs) = &expr.kind . && let Ok(le_or_ge) = LeOrGe::try_from(binop.node) . && 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); . } 458,759 ( 0.04%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/mem/mod.rs -------------------------------------------------------------------------------- Ir -- line 460 ---------------------------------------- . /// assert_eq!(13, unsafe { mem::size_of_val_raw(y) }); . /// ``` . #[inline] . #[must_use] . #[stable(feature = "layout_for_ptr", since = "CURRENT_RUSTC_VERSION")] . #[rustc_const_stable(feature = "layout_for_ptr", since = "CURRENT_RUSTC_VERSION")] . pub const unsafe fn size_of_val_raw(val: *const T) -> usize { . // SAFETY: the caller must provide a valid raw pointer 1 ( 0.00%) unsafe { intrinsics::size_of_val(val) } . } . . /// Returns the [ABI]-required minimum alignment of a type in bytes. . /// . /// Every reference to a value of the type `T` must be a multiple of this number. . /// . /// This is the alignment used for struct fields. It may be smaller than the preferred alignment. . /// -- line 476 ---------------------------------------- -- line 634 ---------------------------------------- . /// . /// [type-layout]: ../../reference/type-layout.html#r-layout.primitive . #[inline] . #[must_use] . #[stable(feature = "layout_for_ptr", since = "CURRENT_RUSTC_VERSION")] . #[rustc_const_stable(feature = "layout_for_ptr", since = "CURRENT_RUSTC_VERSION")] . pub const unsafe fn align_of_val_raw(val: *const T) -> usize { . // SAFETY: the caller must provide a valid raw pointer 1 ( 0.00%) unsafe { intrinsics::align_of_val(val) } . } . . /// Returns `true` if dropping values of type `T` matters. . /// . /// This is purely an optimization hint, and may be implemented conservatively: . /// it may return `true` for types that don't actually need to be dropped. . /// As such always returning `true` would be a valid implementation of . /// this function. However if this function actually returns `false`, then you -- line 650 ---------------------------------------- -- line 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). . 393,433 ( 0.03%) let result = crate::intrinsics::read_via_copy(dest); 262,341 ( 0.02%) 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 ---------------------------------------- 65,540 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/temporary_assignment.rs -------------------------------------------------------------------------------- Ir -- line 26 ---------------------------------------- . declare_lint_pass!(TemporaryAssignment => [TEMPORARY_ASSIGNMENT]); . . fn is_temporary(expr: &Expr<'_>) -> bool { . matches!(&expr.kind, ExprKind::Struct(..) | ExprKind::Tup(..)) . } . . impl<'tcx> LateLintPass<'tcx> for TemporaryAssignment { . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::Assign(target, ..) = &expr.kind { . let mut base = target; . 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 42 ---------------------------------------- -------------------------------------------------------------------------------- -- 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; _]); 38 ( 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) { 142 ( 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. . 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)) { . return *availability; . } -- line 136 ---------------------------------------- -- line 214 ---------------------------------------- . } . }, . ); . } . } . } . . impl<'tcx> LateLintPass<'tcx> for IncompatibleMsrv { 589,842 ( 0.05%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 458,766 ( 0.04%) match expr.kind { . ExprKind::MethodCall(_, _, _, span) => { . if let Some(method_did) = cx.typeck_results().type_dependent_def_id(expr.hir_id) { . self.emit_lint_if_under_msrv(cx, is_in_const_context(cx), method_did, expr.hir_id, span); . } . }, . ExprKind::Call(callee, _) if let ExprKind::Path(qpath) = callee.kind => { . self.called_path = Some(callee.hir_id); . let needs_const = is_in_const_context(cx); -- line 231 ---------------------------------------- -- line 248 ---------------------------------------- . ExprKind::Path(qpath) . if let Some(path_def_id) = cx.qpath_res(&qpath, expr.hir_id).opt_def_id() . && self.called_path != Some(expr.hir_id) => . { . self.emit_lint_if_under_msrv(cx, false, path_def_id, expr.hir_id, expr.span); . }, . _ => {}, . } 524,304 ( 0.04%) } . . fn check_ty(&mut self, cx: &LateContext<'tcx>, hir_ty: &'tcx hir::Ty<'tcx, AmbigArg>) { 10 ( 0.00%) if let hir::TyKind::Path(qpath) = hir_ty.kind 8 ( 0.00%) && let Some(ty_def_id) = cx.qpath_res(&qpath, hir_ty.hir_id).opt_def_id() 23 ( 0.00%) => ???:::qpath_res (1x) . // `CStr` and `CString` have been moved around but have been available since Rust 1.0.0 . && !matches!(cx.tcx.get_diagnostic_name(ty_def_id), Some(sym::cstr_type | sym::cstring_type)) . { . self.emit_lint_if_under_msrv(cx, false, ty_def_id, hir_ty.hir_id, hir_ty.span); . } . } . } . -- line 268 ---------------------------------------- 3 ( 0.00%) -------------------------------------------------------------------------------- -- 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; . 458,766 ( 0.04%) pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . if let Some(higher::WhileLet { if_then, let_pat, let_expr, label, .. }) = higher::WhileLet::hir(expr) . // check for `Some(..)` pattern . && let Some(some_pat) = as_some_pattern(cx, let_pat) . // check for call to `Iterator::next` . && let ExprKind::MethodCall(method_name, iter_expr, [], _) = let_expr.kind . && method_name.ident.name == sym::next . && cx.ty_based_def(let_expr).opt_parent(cx).is_diag_item(cx, sym::Iterator) . && let Some(iter_expr_struct) = try_parse_iter_expr(cx, iter_expr) -- line 27 ---------------------------------------- -- line 61 ---------------------------------------- . WHILE_LET_ON_ITERATOR, . expr.span.with_hi(let_expr.span.hi()), . "this loop could be written as a `for` loop", . "try", . format!("{loop_label}for {loop_var} in {iterator_by_ref}"), . applicability, . ); . } 524,304 ( 0.04%) } . . #[derive(Debug)] . struct IterExpr { . /// The fields used, in order of child to parent. . fields: Vec, . /// The path being used. . path: Res, . /// Whether or not the iterator can be moved. -- line 77 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/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 { 7 ( 0.00%) fn check_generics(&mut self, cx: &EarlyContext<'_>, generics: &Generics) { . for param in &generics.params { . builtin_type_shadow::check(cx, param); . } 8 ( 0.00%) } . . fn check_pat(&mut self, cx: &EarlyContext<'_>, pat: &Pat) { . unneeded_field_pattern::check(cx, pat); . redundant_pattern::check(cx, pat); . redundant_at_rest_pattern::check(cx, pat); . unneeded_wildcard_pattern::check(cx, pat); . } . 458,759 ( 0.04%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { . // `check_lit` only lints integer literals and suffixed float literals. 262,146 ( 0.02%) if let ExprKind::Lit(lit) = expr.kind 196,606 ( 0.02%) && match lit.kind { . token::LitKind::Integer => true, . token::LitKind::Float => lit.suffix.is_some(), . _ => false, . } 3 ( 0.00%) && !expr.span.in_external_macro(cx.sess().source_map()) . { . MiscEarlyLints::check_lit(cx, lit, expr.span); . } 524,296 ( 0.04%) } . } . . 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. 2 ( 0.00%) let lit_snip = match snippet_opt(cx, span) { 1 ( 0.00%) Some(snip) if snip.starts_with(|c: char| c.is_ascii_digit()) => snip, . _ => return, . }; . 1 ( 0.00%) let lit_kind = LitKind::from_token_lit(lit); 234 ( 0.00%) => ???:::from_token_lit (1x) 6 ( 0.00%) if let Ok(LitKind::Int(value, lit_int_type)) = lit_kind { 4 ( 0.00%) let suffix = match lit_int_type { . LitIntType::Signed(ty) => ty.name_str(), . LitIntType::Unsigned(ty) => ty.name_str(), . LitIntType::Unsuffixed => "", . }; 10 ( 0.00%) literal_suffix::check(cx, span, &lit_snip, suffix, "integer"); 27 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/misc_early/literal_suffix.rs:clippy_lints::misc_early::literal_suffix::check (1x) 1 ( 0.00%) if lit_snip.starts_with("0x") { 8 ( 0.00%) mixed_case_hex_literals::check(cx, span, suffix, &lit_snip); 104 ( 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 (1x) . } else if lit_snip.starts_with("0b") || lit_snip.starts_with("0o") { . // nothing to do . } 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 375 ---------------------------------------- 65,548 ( 0.01%) -------------------------------------------------------------------------------- -- 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { . // If the expression is a call (`Box::new(...)`) 131,076 ( 0.01%) if let ExprKind::Call(box_new, [arg]) = expr.kind . // And call is of the form `::something` . // Here, it would be `::new` . && let ExprKind::Path(QPath::TypeRelative(ty, seg)) = box_new.kind . // And that method is `new` . && seg.ident.name == sym::new . // And the call is that of a `Box` method . && ty.basic_res().is_lang_item(cx, LangItem::OwnedBox) . // And the single argument to the call is another function call -- line 49 ---------------------------------------- -- line 62 ---------------------------------------- . BOX_DEFAULT, . expr.span, . "`Box::new(_)` of default value", . "try", . "Box::default()".into(), . Applicability::MachineApplicable, . ); . } 524,304 ( 0.04%) } . } . . fn is_plain_default(cx: &LateContext<'_>, arg_path: &Expr<'_>) -> bool { . // we need to match the actual path so we don't match e.g. "u8::default" . if let ExprKind::Path(QPath::Resolved(None, path)) = &arg_path.kind . && let Res::Def(_, def_id) = path.res . { . // avoid generic parameters -- line 78 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 293 ---------------------------------------- . } . } . eval_stack.pop(); . false . } . } . } . 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 { 24 ( 0.00%) fn check_body(&mut self, cx: &LateContext<'tcx>, body: &Body<'tcx>) { 9 ( 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. 34 ( 0.00%) let (fn_id, fn_kind, skip_params) = match cx.tcx.parent_hir_node(body.value.hir_id) { 324 ( 0.00%) => ???:::parent_hir_node (3x) 4 ( 0.00%) Node::Item(i) => (i.owner_id.to_def_id(), FnKind::Fn, 0), . Node::TraitItem(&TraitItem { . kind: TraitItemKind::Fn(ref sig, _), . owner_id, . .. . }) => ( . owner_id.to_def_id(), . FnKind::TraitFn, . usize::from(sig.decl.implicit_self().has_implicit_self()), -- line 324 ---------------------------------------- -- line 342 ---------------------------------------- . usize::from(sig.decl.implicit_self().has_implicit_self()), . ) . } else { . (owner_id.to_def_id(), FnKind::Fn, 0) . } . }, . _ => return, . }; 4 ( 0.00%) body.params . .iter() . .enumerate() . .skip(skip_params) . .filter_map(|(idx, p)| match p.pat.kind { . PatKind::Binding(_, id, ident, None) if !ident.as_str().starts_with('_') => { . Some((id, Param::new(fn_id, fn_kind, idx, ident))) . }, . _ => None, . }) . .for_each(|(id, param)| self.params.insert(param, id)); 2 ( 0.00%) if self.entered_body.is_none() { 4 ( 0.00%) self.entered_body = Some(body.value.hir_id); . } 24 ( 0.00%) } . 458,766 ( 0.04%) 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(); . let span = e.span; . let mut e = e; . loop { . match get_expr_use_or_unification_node(cx.tcx, e) { -- line 374 ---------------------------------------- -- line 428 ---------------------------------------- . _ => (), . }, . _ => (), . } . self.params.remove_by_id(id); . return; . } . } 524,304 ( 0.04%) } . 21 ( 0.00%) fn check_body_post(&mut self, cx: &LateContext<'tcx>, body: &Body<'tcx>) { 2 ( 0.00%) if self.entered_body == Some(body.value.hir_id) { 2 ( 0.00%) self.entered_body = None; . self.params.flag_for_linting(); . for param in &self.params.params { . if param.apply_lint.get() { . if param.ident.name == kw::SelfLower { . span_lint_and_then( . cx, . SELF_ONLY_USED_IN_RECURSION, . param.ident.span, -- line 448 ---------------------------------------- -- line 473 ---------------------------------------- . ); . }, . ); . } . } . } . self.params.clear(); . } 24 ( 0.00%) } . } . . fn has_matching_args(kind: FnKind, args: GenericArgsRef<'_>) -> bool { . match kind { . FnKind::Fn => true, . FnKind::TraitFn => args.iter().enumerate().all(|(idx, subst)| match subst.kind() { . GenericArgKind::Lifetime(_) => true, . GenericArgKind::Type(ty) => matches!(*ty.kind(), ty::Param(ty) if ty.index as usize == idx), -- line 489 ---------------------------------------- 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_lint/src/context.rs -------------------------------------------------------------------------------- Ir -- line 523 ---------------------------------------- . lint: &'static Lint, . span: Option, . decorate: impl for<'a> Diagnostic<'a, ()>, . ); . . /// Emit a lint at `span` from a lint struct (some type that implements `Diagnostic`, . /// typically generated by `#[derive(Diagnostic)]`). . #[track_caller] 10 ( 0.00%) fn emit_span_lint>( . &self, . lint: &'static Lint, . span: S, . decorator: impl for<'a> Diagnostic<'a, ()>, . ) { . self.opt_span_lint(lint, Some(span), decorator); 7 ( 0.00%) } . . /// This returns the lint level spec for the given lint at the current location. . fn get_lint_level_spec(&self, lint: &'static Lint) -> LevelSpec; . . /// This function can be used to manually fulfill an expectation. This can . /// be used for lints which contain several spans, and should be suppressed, . /// if either location was marked with an expectation. . /// -- line 546 ---------------------------------------- -- line 584 ---------------------------------------- . } . } . . impl<'tcx> LintContext for LateContext<'tcx> { . type LintExpectationId = StableLintExpectationId; . . /// Gets the overall compiler `Session` object. . fn sess(&self) -> &Session { 852,037 ( 0.07%) self.tcx.sess . } . . fn opt_span_lint>( . &self, . lint: &'static Lint, . span: Option, . decorate: impl for<'a> Diagnostic<'a, ()>, . ) { -- line 600 ---------------------------------------- -- line 660 ---------------------------------------- . } . . /// Gets the type-checking results for the current body. . /// As this will ICE if called outside bodies, only call when working with . /// `Expr` or `Pat` nodes (they are guaranteed to be found only in bodies). . #[inline] . #[track_caller] . pub fn typeck_results(&self) -> &'tcx ty::TypeckResults<'tcx> { 196,615 ( 0.02%) self.typeck_results.expect("`LateContext::typeck_results` called outside of body") . } . . /// Returns the final resolution of a `QPath`, or `Res::Err` if unavailable. . /// Unlike `.typeck_results().qpath_res(qpath, id)`, this can be used even outside . /// bodies (e.g. for paths in `hir::Ty`), without any risk of ICE-ing. . pub fn qpath_res(&self, qpath: &hir::QPath<'_>, id: hir::HirId) -> Res { . match *qpath { . hir::QPath::Resolved(_, path) => path.res, -- line 676 ---------------------------------------- 65,543 ( 0.01%) -------------------------------------------------------------------------------- -- 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) { 131,074 ( 0.01%) if let ExprKind::MethodCall(MethodCall { seg, receiver, .. }) = &expr.kind . && matches!(seg.ident.name, sym::expect | sym::unwrap) . && is_direct_expn_of(receiver.span, sym::option_env).is_some() . { . span_lint_and_help( . cx, . OPTION_ENV_UNWRAP, . expr.span, . "this will panic at run-time if the environment variable doesn't exist at compile-time", -- line 46 ---------------------------------------- -------------------------------------------------------------------------------- -- 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. 131,077 ( 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 3986 ---------------------------------------- . . #[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 { 131,077 ( 0.01%) Relaxed => intrinsics::atomic_load::(dst), 149 ( 0.00%) Acquire => intrinsics::atomic_load::(dst), 18 ( 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 4021 ---------------------------------------- . #[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 { 20 ( 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), 46 ( 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 ---------------------------------------- 1 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/utils/format_args_collector.rs -------------------------------------------------------------------------------- Ir -- line 13 ---------------------------------------- . pub struct FormatArgsCollector { . format_args: FxHashMap, . parent_spans: Vec, . storage: FormatArgsStorage, . } . . impl FormatArgsCollector { . pub fn new(storage: FormatArgsStorage) -> Self { 8 ( 0.00%) Self { . format_args: FxHashMap::default(), . parent_spans: Vec::new(), . storage, . } . } . } . . impl_lint_pass!(FormatArgsCollector => []); . . impl EarlyLintPass for FormatArgsCollector { 458,759 ( 0.04%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 131,074 ( 0.01%) if let ExprKind::FormatArgs(args) = &expr.kind { . if self.has_span_from_external_macro(cx.sess().source_map(), expr.span, args) { . return; . } . . self.format_args.insert(expr.span.with_parent(None), (**args).clone()); . } 524,296 ( 0.04%) } . . fn check_crate_post(&mut self, _: &EarlyContext<'_>, _: &Crate) { 2 ( 0.00%) self.storage.set(mem::take(&mut self.format_args)); 110 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:::set (1x) . } . } . . impl FormatArgsCollector { . /// Detects if the format string or an argument has its span set by a proc macro to something . /// inside a macro callsite, e.g. . /// . /// ```ignore -- line 51 ---------------------------------------- -------------------------------------------------------------------------------- -- 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. . pub fn method_call<'tcx>(recv: &'tcx Expr<'tcx>) -> Option<(Symbol, &'tcx Expr<'tcx>, &'tcx [Expr<'tcx>], Span, Span)> { . if let ExprKind::MethodCall(path, receiver, args, call_span) = recv.kind . && !args.iter().any(|e| e.range_span().unwrap_or(e.span).from_expansion()) -- line 5127 ---------------------------------------- -- line 5129 ---------------------------------------- . { . Some((path.ident.name, receiver, args, path.ident.span, call_span)) . } else { . None . } . } . . 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%) } . 524,304 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 131,076 ( 0.01%) if expr.span.from_expansion() { . return; . } . 458,766 ( 0.04%) match expr.kind { . ExprKind::Call(func, args) => { . unnecessary_fallible_conversions::check_function(cx, expr, func); . manual_c_str_literals::check(cx, expr, func, args, self.msrv); . useless_nonzero_new_unchecked::check(cx, expr, func, args, self.msrv); . io_other_error::check(cx, expr, func, args, self.msrv); . swap_with_temporary::check(cx, expr, func, args); . ip_constant::check(cx, expr, func, args); . clone_on_copy::check_function(cx, expr); -- line 5163 ---------------------------------------- -- line 5186 ---------------------------------------- . }; . lint_binary_expr_with_method_call(cx, &mut info); . }, . ExprKind::Binary(op, lhs, rhs) if op.node == hir::BinOpKind::Or => { . manual_is_variant_and::check_or(cx, expr, lhs, rhs, self.msrv); . }, . _ => (), . } 524,304 ( 0.04%) } . . fn check_impl_item(&mut self, cx: &LateContext<'tcx>, impl_item: &'tcx hir::ImplItem<'_>) { . if impl_item.span.in_external_macro(cx.sess().source_map()) { . return; . } . . if let hir::ImplItemKind::Fn(ref sig, id) = impl_item.kind { . let parent = cx.tcx.hir_get_parent_item(impl_item.hir_id()).def_id; -- line 5202 ---------------------------------------- 2 ( 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { . // Check that the expression is generated by a macro. 131,077 ( 0.01%) if expr.span.from_expansion() . // Check that it's a string literal. . && let ExprKind::Lit(lit) = expr.kind . && let LitKind::Str(lit_s, _) = lit.node . // Get the direct parent of the expression. . && let Some(macro_call) = macro_backtrace(expr.span).next() . // Check if the `concat` macro from the `core` library. . && cx.tcx.is_diagnostic_item(sym::macro_concat, macro_call.def_id) . // We get the original code to parse it. -- line 46 ---------------------------------------- -- line 94 ---------------------------------------- . macro_call.span, . "unneeded use of `concat!` macro", . "replace with", . format!("{lit_s:?}"), . Applicability::MachineApplicable, . ); . } . } 524,304 ( 0.04%) } . } -------------------------------------------------------------------------------- -- 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<'_>) { 262,152 ( 0.02%) match expr.kind { . hir::ExprKind::Binary(op, _, _) => { . check_expr_inner(cx, expr, op.node, op.span); . }, . hir::ExprKind::AssignOp(op, _, _) => { . check_expr_inner(cx, expr, op.node.into(), op.span); . }, . _ => {}, . } -- line 71 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/multi_assignments.rs -------------------------------------------------------------------------------- Ir -- line 47 ---------------------------------------- . expr . } . }, . _ => expr, . } . } . . impl EarlyLintPass for MultiAssignments { 196,611 ( 0.02%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 131,074 ( 0.01%) if let ExprKind::Assign(target, source, _) = &expr.kind { . if let ExprKind::Assign(_target, _source, _) = &strip_paren_blocks(target).kind { . span_lint(cx, MULTI_ASSIGNMENTS, expr.span, "assignments don't nest intuitively"); . } . if let ExprKind::Assign(_target, _source, _) = &strip_paren_blocks(source).kind { . span_lint(cx, MULTI_ASSIGNMENTS, expr.span, "assignments don't nest intuitively"); . } . } 262,148 ( 0.02%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/block_scrutinee.rs -------------------------------------------------------------------------------- Ir -- line 27 ---------------------------------------- . pub BLOCK_SCRUTINEE, . suspicious, . "warns when the scrutinee is wrapped in a block in older editions" . } . . declare_lint_pass!(BlockScrutinee => [BLOCK_SCRUTINEE]); . . impl<'tcx> LateLintPass<'tcx> for BlockScrutinee { 327,690 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 196,614 ( 0.02%) if cx.tcx.sess.edition() >= Edition::Edition2024 { . return; . } . 327,690 ( 0.03%) let (scrutinee, keyword_fallback) = match expr.kind { . ExprKind::Match(scrutinee, _, _) => (scrutinee, "`match`"), . ExprKind::Let(let_expr) => (let_expr.init, "`if let` / `while let`"), . _ => return, . }; . . if scrutinee.span.from_expansion() || expr.span.from_expansion() { . return; . } -- line 48 ---------------------------------------- -- line 102 ---------------------------------------- . vec![ . (outer_span.shrink_to_lo(), format!("let res = {inner_snippet};\n{pad}")), . (scrutinee.span, "res".to_string()), . ], . Applicability::MaybeIncorrect, . ); . }); . } 327,690 ( 0.03%) } . } -------------------------------------------------------------------------------- -- 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 { 393,228 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'tcx>) { 131,076 ( 0.01%) if let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, addrof_target) = e.kind . && let ExprKind::Unary(UnOp::Deref, deref_target) = addrof_target.kind . && !matches!(deref_target.kind, ExprKind::Unary(UnOp::Deref, ..)) . && !e.span.from_expansion() . && !deref_target.span.from_expansion() . && !addrof_target.span.from_expansion() . && let ref_ty = cx.typeck_results().expr_ty(deref_target) . && let ty::Ref(_, inner_ty, Mutability::Not) = ref_ty.kind() . && get_parent_expr(cx, e).is_none_or(|parent| { -- line 63 ---------------------------------------- -- line 119 ---------------------------------------- . e.span, . "if you would like to deref, try using `&**`", . format!("&**{deref_text}"), . Applicability::MaybeIncorrect, . ); . }, . ); . } 458,766 ( 0.04%) } . } . . /// 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)) . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_is_ascii_check.rs -------------------------------------------------------------------------------- Ir -- line 85 ---------------------------------------- . /// 'A..=F' . UpperHexLetter, . /// '0..=9' | 'a..=f' | 'A..=F' . HexDigit, . Otherwise, . } . . impl<'tcx> LateLintPass<'tcx> for ManualIsAsciiCheck { 589,842 ( 0.05%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 196,614 ( 0.02%) if !matches!( 131,076 ( 0.01%) expr.kind, . ExprKind::Match(_, [_, ..], _) | ExprKind::MethodCall(_, _, [_], _) . ) { . return; . } . . if !self.msrv.meets(cx, msrvs::IS_ASCII_DIGIT) { . return; . } -- line 103 ---------------------------------------- -- line 127 ---------------------------------------- . let range = check_expr_range(start, end); . (arg, expr.span, range) . } else { . return; . }; . . let ty_sugg = get_ty_sugg(cx, arg); . check_is_ascii(cx, span, arg, &range, ty_sugg); 524,304 ( 0.04%) } . } . . fn get_ty_sugg<'tcx>(cx: &LateContext<'tcx>, arg: &Expr<'_>) -> Option<(Span, Ty<'tcx>)> { . let local_hid = arg.res_local_id()?; . if let Node::Param(Param { ty_span, span, .. }) = cx.tcx.parent_hir_node(local_hid) . // `ty_span` and `span` are the same for inferred type, thus a type suggestion must be given . && ty_span == span . { -- line 143 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_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> { 655,380 ( 0.05%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { . if let Some(macro_call) = root_macro_call_first_node(cx, expr) . && is_format_macro(cx, macro_call.def_id) . && let Some(format_args) = self.format_args.get(cx, expr, macro_call.expn) . { . let mut linter = FormatArgsExpr { . cx, . expr, . macro_call: ¯o_call, -- line 349 ---------------------------------------- -- line 357 ---------------------------------------- . . linter.check_trailing_comma(); . linter.check_templates(); . . if self.msrv.meets(cx, msrvs::FORMAT_ARGS_CAPTURE) { . linter.check_uninlined_args(); . } . } 524,304 ( 0.04%) } . } . . struct FormatArgsExpr<'a, 'tcx> { . cx: &'a LateContext<'tcx>, . expr: &'tcx Expr<'tcx>, . macro_call: &'a MacroCall, . format_args: &'a rustc_ast::FormatArgs, . ignore_mixed: bool, -- line 373 ---------------------------------------- -- line 866 ---------------------------------------- . } . } . } . . fn make_ty_msrv_map(tcx: TyCtxt<'_>) -> FxHashMap, Option> { . [(sym::OsStr, Some(msrvs::OS_STR_DISPLAY)), (sym::Path, None)] . .into_iter() . .filter_map(|(name, feature)| { 6 ( 0.00%) tcx.get_diagnostic_item(name).map(|def_id| { 641,748 ( 0.05%) => ???:::get_diagnostic_item (2x) . let ty = Ty::new_adt(tcx, tcx.adt_def(def_id), List::empty()); . (ty, feature) . }) . }) . .collect() . } . . fn count_needed_derefs<'tcx, I>(mut ty: Ty<'tcx>, mut iter: I) -> (usize, Ty<'tcx>) -- line 882 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . // (x % c + c) % c 131,076 ( 0.01%) if let ExprKind::Binary(rem_op, rem_lhs, rem_rhs) = expr.kind . && rem_op.node == BinOpKind::Rem . && 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 -- line 61 ---------------------------------------- -- line 93 ---------------------------------------- . MANUAL_REM_EUCLID, . expr.span, . "manual `rem_euclid` implementation", . "consider using", . format!("{rem_of}.rem_euclid({const1})"), . app, . ); . } 524,304 ( 0.04%) } . } . . // 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 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 589,842 ( 0.05%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { . use self::Expression::{Bool, RetBool}; 131,076 ( 0.01%) if !e.span.from_expansion() . && let Some(higher::If { . cond, . then, . r#else: Some(else_expr), . }) = higher::If::hir(e) . && !span_contains_comment(cx, e.span) . { . let reduce = |ret, not| { -- line 136 ---------------------------------------- -- line 214 ---------------------------------------- . e.span, . "this if-then-else expression assigns a bool literal", . "you can reduce it to", . sugg, . applicability, . ); . } . } 524,304 ( 0.04%) } . 7 ( 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. 3 ( 0.00%) if let Some(tail) = block.expr . && !tail.span.from_expansion() . && let [.., last_stmt] = block.stmts . && let StmtKind::Semi(if_expr) | StmtKind::Expr(if_expr) = last_stmt.kind . && !if_expr.span.from_expansion() . && let Some(higher::If { . cond, . then, . r#else: None, -- line 241 ---------------------------------------- -- line 274 ---------------------------------------- . NEEDLESS_BOOL, . span, . "this `if` guard returns a bool literal and is followed by another", . "you can reduce it to", . sugg, . applicability, . ); . } 8 ( 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)> { -- line 290 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/unit_types/mod.rs -------------------------------------------------------------------------------- Ir -- line 110 ---------------------------------------- . } . . impl<'tcx> LateLintPass<'tcx> for UnitTypes { . fn check_local(&mut self, cx: &LateContext<'tcx>, local: &'tcx LetStmt<'tcx>) { . let_unit_value::check(cx, &self.format_args, local); . } . . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 196,614 ( 0.02%) unit_cmp::check(cx, expr); 1,900,598 ( 0.15%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/unit_types/unit_cmp.rs:clippy_lints::unit_types::unit_cmp::check (65,538x) 196,614 ( 0.02%) unit_arg::check(cx, expr); 10,027,301 ( 0.81%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/unit_types/unit_arg.rs:clippy_lints::unit_types::unit_arg::check (65,538x) . } . } -------------------------------------------------------------------------------- -- 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. 16 ( 0.00%) if let ItemKind::Use(path, kind @ (UseKind::Single(_) | UseKind::Glob)) = item.kind 4 ( 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 . && let Some(res) = path.res.present_items().next() . && let Some(def_id) = res.opt_def_id() . && self.msrv.meets(cx, msrvs::NUMERIC_ASSOCIATED_CONSTANTS) . { . let module = if is_integer_module(cx, def_id) { . true . } else if is_numeric_const(cx, def_id) { -- line 63 ---------------------------------------- -- line 96 ---------------------------------------- . } else if let [.., module_name, name] = &*def_path { . diag.help( . format!("remove this import and use the associated constant `{module_name}::{name}` from the primitive type instead") . ); . } . }, . ); . } 4 ( 0.00%) } . 655,380 ( 0.05%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx rustc_hir::Expr<'tcx>) { . // `std::::` check 196,614 ( 0.02%) let (sugg, msg) = if let ExprKind::Path(qpath) = &expr.kind . && let QPath::Resolved(None, path) = qpath . && let Some(def_id) = path.res.opt_def_id() . && is_numeric_const(cx, def_id) . && let [.., mod_name, name] = &*cx.get_def_path(def_id) . // Skip linting if this usage looks identical to the associated constant, . // since this would only require removing a `use` import (which is already linted). . && !is_numeric_const_path_canonical(path, [*mod_name, *name]) . { . (format!("{mod_name}::{name}"), "usage of a legacy numeric constant") . // `::xxx_value` check 131,076 ( 0.01%) } else if let ExprKind::Call(func, []) = &expr.kind . && let ExprKind::Path(qpath) = &func.kind . && let QPath::TypeRelative(ty, last_segment) = qpath . && let Some(def_id) = cx.qpath_res(qpath, func.hir_id).opt_def_id() . && is_integer_method(cx, def_id) . && let Some(mod_name) = ty.span.get_text(cx) . && ty.span.eq_ctxt(last_segment.ident.span) . { . let name = last_segment.ident.name.as_str()[..=2].to_ascii_uppercase(); -- line 127 ---------------------------------------- -- line 138 ---------------------------------------- . diag.span_suggestion_verbose( . expr.span, . "use the associated constant instead", . sugg, . Applicability::MaybeIncorrect, . ); . }); . } 524,304 ( 0.04%) } . } . . fn is_integer_module(cx: &LateContext<'_>, did: DefId) -> bool { . matches!( . cx.tcx.get_diagnostic_name(did), . Some( . sym::isize_legacy_mod . | sym::i128_legacy_mod -- line 154 ---------------------------------------- 65,552 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_main_separator_str.rs -------------------------------------------------------------------------------- Ir -- line 41 ---------------------------------------- . . impl ManualMainSeparatorStr { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl LateLintPass<'_> for ManualMainSeparatorStr { 655,380 ( 0.05%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 131,076 ( 0.01%) let (target, _) = peel_hir_expr_refs(expr); 327,690 ( 0.03%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::peel_hir_expr_refs (65,538x) 131,076 ( 0.01%) if let ExprKind::MethodCall(path, receiver, &[], _) = target.kind . && path.ident.name == sym::to_string . && let ExprKind::Path(QPath::Resolved(None, path)) = receiver.kind . && let Res::Def(DefKind::Const { .. }, receiver_def_id) = path.res . && cx.ty_based_def(target).opt_parent(cx).is_diag_item(cx, sym::ToString) . && cx.tcx.is_diagnostic_item(sym::path_main_separator, receiver_def_id) . && let ty::Ref(_, ty, Mutability::Not) = cx.typeck_results().expr_ty_adjusted(expr).kind() . && ty.is_str() . && self.msrv.meets(cx, msrvs::PATH_MAIN_SEPARATOR_STR) -- line 59 ---------------------------------------- -- line 63 ---------------------------------------- . MANUAL_MAIN_SEPARATOR_STR, . expr.span, . "taking a reference on `std::path::MAIN_SEPARATOR` conversion to `String`", . "replace with", . "std::path::MAIN_SEPARATOR_STR".to_owned(), . Applicability::MachineApplicable, . ); . } 524,304 ( 0.04%) } . } -------------------------------------------------------------------------------- -- 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 { 262,152 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &'_ Expr<'_>) { 196,611 ( 0.02%) if let ExprKind::Lit(lit) = expr.kind 196,608 ( 0.02%) && let LitKind::Str(_, _) | LitKind::Char(_) = lit.node . { 131,070 ( 0.01%) check_str(cx, lit.span, expr.hir_id); . } 327,690 ( 0.03%) } . } . . 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) { 262,140 ( 0.02%) if !span_is_local(span) { 1,048,560 ( 0.08%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::span_is_local (65,535x) . 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 ---------------------------------------- 131,070 ( 0.01%) -------------------------------------------------------------------------------- -- 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 { 524,304 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 131,077 ( 0.01%) if !expr.span.from_expansion() . && let ExprKind::Call(func, [recv]) = expr.kind . && let ExprKind::Path(path) = &func.kind . && let Some(did) = cx.qpath_res(path, func.hir_id).opt_def_id() . && match_libc_symbol(cx, did, sym::strlen) . && let ExprKind::MethodCall(path, self_arg, [], _) = recv.kind . && !recv.span.from_expansion() . && path.ident.name == sym::as_ptr . && let typeck = cx.typeck_results() -- line 62 ---------------------------------------- -- line 100 ---------------------------------------- . } else { . format!("{val_name}.to_bytes().len()") . }; . . diag.span_suggestion(span, "use", suggestion, app); . }, . ); . } 524,304 ( 0.04%) } . } 131,076 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_rotate.rs -------------------------------------------------------------------------------- Ir -- line 64 ---------------------------------------- . _ => return None, . }; . return Some((dir, l, r)); . } . None . } . . impl LateLintPass<'_> for ManualRotate { 458,766 ( 0.04%) fn check_expr<'tcx>(&mut self, cx: &LateContext<'tcx>, expr: &Expr<'tcx>) { 131,076 ( 0.01%) if let ExprKind::Binary(op, l, r) = expr.kind . && let BinOpKind::Add | BinOpKind::BitOr = op.node . && let Some((l_shift_dir, l_expr, l_amount)) = parse_shift(l) . && let Some((r_shift_dir, r_expr, r_amount)) = parse_shift(r) . && l_shift_dir != r_shift_dir . && let ctxt = expr.span.ctxt() . && clippy_utils::eq_expr_value(cx, ctxt, l_expr, r_expr) . && let Some(bit_width) = match cx.typeck_results().expr_ty(expr).kind() { . ty::Int(itype) => itype.bit_width(), -- line 81 ---------------------------------------- -- line 130 ---------------------------------------- . expr.span, . "this expression can be rewritten as", . format!("{expr_sugg}.{shift_function}({amount})"), . applicability, . ); . }, . ); . } 524,304 ( 0.04%) } . } -------------------------------------------------------------------------------- -- 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 { 524,304 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 131,076 ( 0.01%) if expr.span.from_expansion() { . return; . } . 65,538 ( 0.01%) let ctxt = expr.span.ctxt(); 131,076 ( 0.01%) if let ExprKind::AddrOf(BorrowKind::Ref, mutability, addressee) = expr.kind . && addressee.span.ctxt() == ctxt . && let ExprKind::Index(indexed, range, _) = addressee.kind . && cx . .typeck_results() . .expr_ty_adjusted(range) . .is_lang_item(cx, LangItem::RangeFull) . { . let (expr_ty, expr_ref_count, _) = peel_and_count_ty_refs(cx.typeck_results().expr_ty(expr)); -- line 89 ---------------------------------------- -- line 159 ---------------------------------------- . format!("(&{}{}*{snip})", mutability.prefix_str(), "*".repeat(indexed_ref_count)) . } else { . format!("&{}{}*{snip}", mutability.prefix_str(), "*".repeat(indexed_ref_count)) . }; . diag.span_suggestion(expr.span, "dereference the original value instead", sugg, app); . }); . } . } 524,304 ( 0.04%) } . } 262,152 ( 0.02%) -------------------------------------------------------------------------------- -- 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 { 32 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>) { 5 ( 0.00%) if has_attr(cx, item.hir_id()) { . println!("{item:#?}"); . } 32 ( 0.00%) } . 524,304 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) { 196,614 ( 0.02%) if has_attr(cx, expr.hir_id) { . println!("{expr:#?}"); . } 524,304 ( 0.04%) } . . fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx hir::Stmt<'_>) { . match stmt.kind { . hir::StmtKind::Expr(e) | hir::StmtKind::Semi(e) if has_attr(cx, e.hir_id) => return, . _ => {}, . } . if has_attr(cx, stmt.hir_id) { . println!("{stmt:#?}"); -- line 44 ---------------------------------------- -- line 54 ---------------------------------------- . fn check_impl_item(&mut self, cx: &LateContext<'_>, item: &hir::ImplItem<'_>) { . if has_attr(cx, item.hir_id()) { . println!("{item:#?}"); . } . } . } . . fn has_attr(cx: &LateContext<'_>, hir_id: hir::HirId) -> bool { 131,088 ( 0.01%) let attrs = cx.tcx.hir_attrs(hir_id); 218 ( 0.00%) => ???:::hir_attrs (4x) 1 ( 0.00%) get_builtin_attr(attrs, sym::dump).count() > 0 . } 2 ( 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::Call(iter_expr, []) = &expr.kind . && let ExprKind::Path(QPath::TypeRelative(ty, _)) = &iter_expr.kind . && let TyKind::Path(ty_path) = &ty.kind . && let QPath::Resolved(None, path) = ty_path . && let def::Res::Def(_, def_id) = &path.res . && cx.tcx.is_diagnostic_item(sym::IterEmpty, *def_id) . && let ctxt = expr.span.ctxt() . && ty.span.ctxt() == ctxt . { -- line 44 ---------------------------------------- -- line 51 ---------------------------------------- . DEFAULT_INSTEAD_OF_ITER_EMPTY, . expr.span, . format!("`{path}()` is the more idiomatic way"), . "try", . sugg, . applicability, . ); . } 524,304 ( 0.04%) } . } . . fn make_sugg( . cx: &LateContext<'_>, . ty_path: &QPath<'_>, . ctxt: SyntaxContext, . applicability: &mut Applicability, . path: &str, -- line 67 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/casts/borrow_as_ptr.rs -------------------------------------------------------------------------------- Ir -- line 54 ---------------------------------------- . . span_lint_and_sugg(cx, BORROW_AS_PTR, span, "borrow as raw pointer", "try", suggestion, app); . return true; . } . false . } . . /// Check for an implicit cast from reference to raw pointer outside an explicit `as`. 262,152 ( 0.02%) pub(super) fn check_implicit_cast<'cx>(cx: &LateContext<'cx>, expr: &Expr<'cx>) { 131,077 ( 0.01%) if !expr.span.from_expansion() . && let ExprKind::AddrOf(BorrowKind::Ref, _, pointee) = expr.kind . && !matches!(get_parent_expr(cx, expr).map(|e| e.kind), Some(ExprKind::Cast(..))) . && let [deref, borrow] = cx.typeck_results().expr_adjustments(expr) . && matches!(deref.kind, Adjust::Deref(..)) . && 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) -- line 71 ---------------------------------------- -- line 74 ---------------------------------------- . diag.span_suggestion_verbose( . expr.span.until(pointee.span), . "use a raw pointer instead", . format!("&raw {} ", mutability.ptr_str()), . Applicability::MachineApplicable, . ); . }); . } 327,690 ( 0.03%) } 131,076 ( 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/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. 5 ( 0.00%) #[derive(Clone, Copy, Eq, PartialEq, Hash)] . #[rustc_pass_by_value] . pub struct Span { . lo_or_index: u32, . len_with_tag_or_marker: u16, . ctxt_or_parent_or_marker: u16, . } . . // Convenience structures for all span formats. -- line 88 ---------------------------------------- -- line 109 ---------------------------------------- . #[derive(Clone, Copy)] . struct Interned { . index: u32, . } . . impl InlineCtxt { . #[inline] . fn data(self) -> SpanData { 5 ( 0.00%) let len = self.len as u32; . debug_assert!(len <= MAX_LEN); 5 ( 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 { 9 ( 0.00%) let len = (self.len_with_tag & !PARENT_TAG) as u32; . debug_assert!(len <= MAX_LEN); 28 ( 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) = 1 ( 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 { 26 ( 0.00%) SpanData { . ctxt: SyntaxContext::from_u16(self.ctxt), 14 ( 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, . ) => { 6,685,033 ( 0.54%) if $span.len_with_tag_or_marker != BASE_LEN_INTERNED_MARKER { 12,779,893 ( 1.03%) 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 . } 524,439 ( 0.04%) } 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 246 ---------------------------------------- . impl Span { . #[inline] . pub fn new( . mut lo: BytePos, . mut hi: BytePos, . ctxt: SyntaxContext, . parent: Option, . ) -> Self { 5 ( 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). . let (len, ctxt32) = (hi.0 - lo.0, ctxt.as_u32()); 18 ( 0.00%) if len <= MAX_LEN && ctxt32 <= MAX_CTXT { 13 ( 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(); 16 ( 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| { -- line 273 ---------------------------------------- -- line 274 ---------------------------------------- . with_span_interner(|interner| interner.intern(&SpanData { lo, hi, ctxt, parent })) . }; . if ctxt32 <= MAX_CTXT { . // Interned ctxt should never be read, so it can use any value. . PartiallyInterned::span(index(SyntaxContext::from_u32(u32::MAX)), ctxt32 as u16) . } else { . Interned::span(index(ctxt)) . } 32 ( 0.00%) } . . #[inline] . pub fn data(self) -> SpanData { . let data = self.data_untracked(); 19 ( 0.00%) if let Some(parent) = data.parent { 12 ( 0.00%) (*SPAN_TRACK)(parent); 63 ( 0.00%) => ???:rustc_interface::callbacks::track_span_parent (3x) . } . data . } . . /// Internal function to translate between an encoded span and the expanded representation. . /// This function must not be used outside the incremental engine. . #[inline] . pub fn data_untracked(self) -> SpanData { . match_span_kind! { . self, . InlineCtxt(span) => span.data(), . InlineParent(span) => span.data(), 14 ( 0.00%) PartiallyInterned(span) => span.data(), . Interned(span) => span.data(), . } . } . . /// Returns `true` if this span comes from any kind of macro, desugaring or inlining. . #[inline] . pub fn from_expansion(self) -> bool { . let ctxt = match_span_kind! { -- line 309 ---------------------------------------- 4,653,245 ( 0.38%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/needless_parens_on_range_literals.rs -------------------------------------------------------------------------------- Ir -- line 71 ---------------------------------------- . diag.span_suggestion(e.span, "try", suggestion, applicability); . }, . ); . } . } . . impl<'tcx> LateLintPass<'tcx> for NeedlessParensOnRangeLiterals { . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 327,690 ( 0.03%) if let Some(higher::Range { start, end, .. }) = higher::Range::hir(cx, expr) { 2,949,210 ( 0.24%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (65,538x) . if let Some(start) = start { . check_for_parens(cx, start, true); . } . if let Some(end) = end { . check_for_parens(cx, end, false); . } . } . } -- line 87 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::Call(box_from_raw, [arg]) = expr.kind . && let ExprKind::Path(QPath::TypeRelative(ty, seg)) = box_from_raw.kind . && seg.ident.name == sym::from_raw . && let Some(type_str) = ty.basic_res().opt_def_id().and_then(|id| def_id_matches_type(cx, id)) . && let arg_kind = cx.typeck_results().expr_ty(arg).kind() . && let ty::RawPtr(ty, _) = arg_kind . && is_c_void(cx, *ty) . { . let msg = format!("creating a `{type_str}` from a void raw pointer"); -- line 51 ---------------------------------------- -- line 53 ---------------------------------------- . cx, . FROM_RAW_WITH_VOID_PTR, . expr.span, . msg, . Some(arg.span), . "cast this to a pointer of the appropriate type", . ); . } 524,304 ( 0.04%) } . } . . /// Checks whether a `DefId` matches `Box`, `Rc`, `Arc`, or one of the `Weak` types. . /// Returns a static string slice with the name of the type, if one was found. . fn def_id_matches_type(cx: &LateContext<'_>, def_id: DefId) -> Option<&'static str> { . // Box . if Some(def_id) == cx.tcx.lang_items().owned_box() { . return Some("Box"); -- line 69 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/hygiene.rs -------------------------------------------------------------------------------- Ir -- line 45 ---------------------------------------- . use crate::edition::Edition; . use crate::source_map::SourceMap; . use crate::symbol::{Symbol, kw, sym}; . use crate::{DUMMY_SP, Span, SpanDecoder, SpanEncoder, with_session_globals}; . . /// A `SyntaxContext` represents a chain of pairs `(ExpnId, Transparency)` named "marks". . /// . /// See for more explanation. 1 ( 0.00%) #[derive(Clone, Copy, PartialEq, Eq, Hash)] . pub struct SyntaxContext(u32); . . // To ensure correctness of incremental compilation, . // `SyntaxContext` must not implement `Ord` or `PartialOrd`. . // See https://github.com/rust-lang/rust/issues/90317. . impl !Ord for SyntaxContext {} . impl !PartialOrd for SyntaxContext {} . -- line 61 ---------------------------------------- -- line 98 ---------------------------------------- . . rustc_index::newtype_index! { . /// A unique ID associated with a macro invocation and expansion. . #[orderable] . pub struct ExpnIndex {} . } . . /// A unique ID associated with a macro invocation and expansion. 4 ( 0.00%) #[derive(Clone, Copy, PartialEq, Eq, Hash)] . pub struct ExpnId { . pub krate: CrateNum, . pub local_id: ExpnIndex, . } . . impl fmt::Debug for ExpnId { . fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { . // Generate crate_::{{expn_}}. -- line 114 ---------------------------------------- -- line 385 ---------------------------------------- . syntax_context_data: vec![root_ctxt_data], . syntax_context_map: iter::once((root_ctxt_data.key(), SyntaxContext(0))).collect(), . expn_data_disambiguators: UnhashMap::default(), . } . } . . #[inline] . fn with(f: impl FnOnce(&mut HygieneData) -> R) -> R { 4 ( 0.00%) with_session_globals(|session_globals| f(&mut session_globals.hygiene_data.borrow_mut())) . } . . #[inline] . fn expn_hash(&self, expn_id: ExpnId) -> ExpnHash { . match expn_id.as_local() { . Some(expn_id) => self.local_expn_hashes[expn_id], . None => self.foreign_expn_hashes[&expn_id], . } -- line 401 ---------------------------------------- -- line 441 ---------------------------------------- . #[inline] . fn normalize_to_macro_rules(&self, ctxt: SyntaxContext) -> SyntaxContext { . self.syntax_context_data[ctxt.0 as usize].opaque_and_semiopaque . } . . /// See [`SyntaxContextData::outer_expn`] . #[inline] . fn outer_expn(&self, ctxt: SyntaxContext) -> ExpnId { 8 ( 0.00%) self.syntax_context_data[ctxt.0 as usize].outer_expn . } . . /// The last macro expansion and its Transparency . #[inline] . fn outer_mark(&self, ctxt: SyntaxContext) -> (ExpnId, Transparency) { . let data = &self.syntax_context_data[ctxt.0 as usize]; . (data.outer_expn, data.outer_transparency) . } -- line 457 ---------------------------------------- -- line 698 ---------------------------------------- . impl SyntaxContext { . #[inline] . pub const fn root() -> Self { . SyntaxContext(0) . } . . #[inline] . pub const fn is_root(self) -> bool { 131,085 ( 0.01%) self.0 == SyntaxContext::root().as_u32() . } . . #[inline] . pub(crate) const fn as_u32(self) -> u32 { . self.0 . } . . #[inline] -- line 714 ---------------------------------------- -- line 904 ---------------------------------------- . pub fn outer_expn(self) -> ExpnId { . HygieneData::with(|data| data.outer_expn(self)) . } . . /// `ctxt.outer_expn_data()` is equivalent to but faster than . /// `ctxt.outer_expn().expn_data()`. . #[inline] . pub fn outer_expn_data(self) -> ExpnData { 4 ( 0.00%) HygieneData::with(|data| data.expn_data(data.outer_expn(self)).clone()) 60 ( 0.00%) => ???:::expn_data (4x) . } . . /// See [`HygieneData::outer_mark`] . #[inline] . fn outer_mark(self) -> (ExpnId, Transparency) { . HygieneData::with(|data| data.outer_mark(self)) . } . -- line 920 ---------------------------------------- -- line 975 ---------------------------------------- . }; . let expn_id = LocalExpnId::fresh(expn_data, hcx); . self.apply_mark(expn_id.to_expn_id(), Transparency::Transparent) . } . } . . /// A subset of properties from both macro definition and macro call available through global data. . /// Avoid using this if you have access to the original definition or call structures. 48 ( 0.00%) #[derive(Clone, Debug, Encodable, Decodable, StableHash)] . pub struct ExpnData { . // --- The part unique to each expansion. . pub kind: ExpnKind, . /// The expansion that contains the definition of the macro for this expansion. . pub parent: ExpnId, . /// The span of the macro call which produced this expansion. . /// . /// This span will typically have a different `ExpnData` and `call_site`. -- line 991 ---------------------------------------- -- line 1003 ---------------------------------------- . /// that have identical `ExpnData`s. This violates the contract of `StableHash` . /// - the two `ExpnId`s are not equal, but their `Fingerprint`s are equal . /// (since the numerical `ExpnId` value is not considered by the `StableHash` . /// implementation). . /// . /// The `disambiguator` field is set by `update_disambiguator` when two distinct . /// `ExpnId`s would end up with the same `Fingerprint`. Since `ExpnData` includes . /// a `krate` field, this value only needs to be unique within a single crate. 4 ( 0.00%) disambiguator: u32, . . // --- The part specific to the macro/desugaring definition. . // --- It may be reasonable to share this part between expansions with the same definition, . // --- but such sharing is known to bring some minor inconveniences without also bringing . // --- noticeable perf improvements (PR #62898). . /// The span of the macro definition (possibly dummy). . /// This span serves only informational purpose and is not used for resolution. . pub def_site: Span, -- line 1019 ---------------------------------------- -- line 1024 ---------------------------------------- . /// Edition of the crate in which the macro is defined. . pub edition: Edition, . /// The `DefId` of the macro being invoked, . /// if this `ExpnData` corresponds to a macro invocation . pub macro_def_id: Option, . /// The normal module (`mod`) in which the expanded macro was defined. . pub parent_module: Option, . /// Suppresses the `unsafe_code` lint for code produced by this macro. 4 ( 0.00%) pub(crate) allow_internal_unsafe: bool, . /// Enables the macro helper hack (`ident!(...)` -> `$crate::ident!(...)`) for this macro. . pub local_inner_macros: bool, . /// Should debuginfo for the macro be collapsed to the outermost expansion site (in other . /// words, was the macro definition annotated with `#[collapse_debuginfo]`)? . pub(crate) collapse_debuginfo: bool, . /// When true, we prevent diagnostics pointing into this macro, if it is one, and we do not . /// display the note telling people to use the `-Zmacro-backtrace` flag. . pub diagnostic_opaque: bool, -- line 1040 ---------------------------------------- -- line 1123 ---------------------------------------- . fn hash_expn(&self, hcx: &mut impl StableHashCtxt) -> Hash64 { . let mut hasher = StableHasher::new(); . self.stable_hash(hcx, &mut hasher); . hasher.finish() . } . } . . /// Expansion kind. 4 ( 0.00%) #[derive(Clone, Debug, PartialEq, Encodable, Decodable, StableHash)] . pub enum ExpnKind { . /// No expansion, aka root expansion. Only `ExpnId::root()` has this kind. . Root, . /// Expansion produced by a macro. . Macro(MacroKind, Symbol), . /// Transform done by the compiler on the AST. . AstPass(AstPass), . /// Desugaring done by the compiler during AST lowering. -- line 1139 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 262,152 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::MethodCall(name, recv, [_], _) = expr.kind . && name.ident.name == sym::open . && !expr.span.from_expansion() . && cx . .typeck_results() . .expr_ty(recv) . .peel_refs() . .is_diag_item(cx, sym::FsOpenOptions) . { -- line 55 ---------------------------------------- -- line 94 ---------------------------------------- . write_span, . "unnecessary use of `.write(true)` because there is `.append(true)`", . "remove `.write(true)`", . String::new(), . Applicability::MachineApplicable, . ); . } . } 262,152 ( 0.02%) } . } -------------------------------------------------------------------------------- -- 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . // match call to unwrap 131,076 ( 0.01%) if let ExprKind::MethodCall(unwrap_fun, write_call, [], _) = expr.kind . && unwrap_fun.ident.name == sym::unwrap . // match call to write_fmt . && let ExprKind::MethodCall(write_fun, write_recv, [write_arg], _) = *look_in_block(cx, &write_call.kind) . && let ExprKind::Call(write_recv_path, []) = write_recv.kind . && write_fun.ident.name == sym::write_fmt . && let Some(def_id) = write_recv_path.basic_res().opt_def_id() . { . // match calls to std::io::stdout() / std::io::stderr () -- line 65 ---------------------------------------- -- line 105 ---------------------------------------- . EXPLICIT_WRITE, . expr.span, . format!("use of `{used}.unwrap()`"), . "try", . format!("{prefix}{sugg_mac}!({inputs_snippet})"), . applicability, . ); . } 524,304 ( 0.04%) } . } . . /// If `kind` is a block that looks like `{ let result = $expr; result }` then . /// returns $expr. Otherwise returns `kind`. . fn look_in_block<'tcx, 'hir>(cx: &LateContext<'tcx>, kind: &'tcx ExprKind<'hir>) -> &'tcx ExprKind<'hir> { . if let ExprKind::Block(block, _label @ None) = kind . && let Block { . stmts: [Stmt { kind: StmtKind::Let(local), .. }], -- line 121 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/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. 2,167 ( 0.00%) unsafe { crate::intrinsics::copy_nonoverlapping(src, dst, count) } 372 ( 0.00%) => ???:0x0000000000173dc0 (26x) . } . . /// 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 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) . ); 48 ( 0.00%) crate::intrinsics::write_bytes(dst, val, count) 22 ( 0.00%) => ???:0x00000000001747c0 (2x) . } . } . . /// 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 7 ( 0.00%) unsafe { drop_glue(&mut *to_drop) } . } . . /// Helper function for `drop_in_place`. The compiler replaces this by the actual drop glue. . #[lang = "drop_glue"] 197,680 ( 0.02%) pub(crate) const unsafe fn drop_glue(_: &mut T) 18 ( 0.00%) => /rust/deps/hashbrown-0.17.1/src/raw.rs: as core::ops::drop::Drop>::drop (1x) . 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]>) { 16 ( 0.00%) let a = *x; . let b = *y; 48 ( 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) . ); 121 ( 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) . ); 3,814 ( 0.00%) intrinsics::write_via_move(dst, src) 150 ( 0.00%) => ???:0x0000000000173dc0 (5x) . } . } . . /// 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 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 { 20 ( 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 ---------------------------------------- 65,987 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/mod.rs -------------------------------------------------------------------------------- Ir -- line 129 ---------------------------------------- . /// assert!(b.is_empty()); . /// ``` . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_stable(feature = "const_slice_is_empty", since = "1.39.0")] . #[rustc_no_implicit_autorefs] . #[inline] . #[must_use] . pub const fn is_empty(&self) -> bool { 1 ( 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> { 262,286 ( 0.02%) 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])> { 192 ( 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 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> { 786,517 ( 0.06%) 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> { 2 ( 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]> { 4 ( 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 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"); 26 ( 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()` 39 ( 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 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])> { 726,148 ( 0.06%) 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 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(); 239 ( 0.00%) 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()); 13 ( 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 ---------------------------------------- 185,545 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs -------------------------------------------------------------------------------- Ir -- line 446 ---------------------------------------- . #[stable(feature = "nonnull", since = "1.25.0")] . #[rustc_const_stable(feature = "const_nonnull_as_ref", since = "1.73.0")] . #[must_use] . #[inline(always)] . pub const unsafe fn as_ref<'a>(&self) -> &'a T { . // SAFETY: the caller must guarantee that `self` meets all the . // requirements for a reference. . // `cast_const` avoids a mutable raw pointer deref. 524,444 ( 0.04%) unsafe { &*self.as_ptr().cast_const() } . } . . /// Returns a unique reference to the value. If the value may be uninitialized, [`as_uninit_mut`] . /// must be used instead. . /// . /// For the shared counterpart see [`as_ref`]. . /// . /// [`as_uninit_mut`]: NonNull::as_uninit_mut -- line 462 ---------------------------------------- -- line 619 ---------------------------------------- . pub const unsafe fn add(self, count: usize) -> Self . where . T: Sized, . { . // SAFETY: the caller must uphold the safety contract for `offset`. . // Additionally safety contract of `offset` guarantees that the resulting pointer is . // pointing to an allocation, there can't be an allocation at null, thus it's safe to . // construct `NonNull`. 65,721 ( 0.01%) unsafe { transmute(intrinsics::offset(self.as_ptr(), count)) } . } . . /// Calculates the offset from a pointer in bytes (convenience for `.byte_offset(count as isize)`). . /// . /// `count` is in units of bytes. . /// . /// This is purely a convenience for casting to a `u8` pointer and . /// using [`add`][NonNull::add] on it. See that method for documentation -- line 635 ---------------------------------------- -- line 1655 ---------------------------------------- . #[stable(feature = "nonnull", since = "1.25.0")] . impl Eq for NonNull {} . . #[stable(feature = "nonnull", since = "1.25.0")] . impl PartialEq for NonNull { . #[inline] . #[allow(ambiguous_wide_pointer_comparisons)] . fn eq(&self, other: &Self) -> bool { 3,308,303 ( 0.27%) self.as_ptr() == other.as_ptr() . } . } . . #[stable(feature = "nonnull", since = "1.25.0")] . impl Ord for NonNull { . #[inline] . #[allow(ambiguous_wide_pointer_comparisons)] . fn cmp(&self, other: &Self) -> Ordering { -- line 1671 ---------------------------------------- 178 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/question_mark.rs -------------------------------------------------------------------------------- Ir -- 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 { 4 ( 0.00%) if let Some(expr) = bl.expr . && let ExprKind::Call(callee, [_]) = expr.kind . && let ExprKind::Path(qpath) = callee.kind . && cx.tcx.qpath_is_lang_item(qpath, LangItem::TryTraitFromOutput) . { . true . } else { . false . } . } . . fn is_inferred_ret_closure(expr: &Expr<'_>) -> bool { 458,766 ( 0.04%) let ExprKind::Closure(closure) = expr.kind else { . return false; . }; . . match closure.fn_decl.output { . FnRetTy::Return(ret_ty) => ret_ty.is_suggestable_infer_ty(), . FnRetTy::DefaultReturn(_) => true, . } . } -- line 630 ---------------------------------------- -- line 642 ---------------------------------------- . } . . if !self.inside_try_block() && !is_in_const_context(cx) { . check_let_some_else_return_none(cx, stmt); . } . self.check_manual_let_else(cx, stmt); . } . 655,380 ( 0.05%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 196,614 ( 0.02%) if is_inferred_ret_closure(expr) { . 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(..)) . && !self.inside_try_block() . && !is_in_const_context(cx) -- line 659 ---------------------------------------- -- line 662 ---------------------------------------- . { . check_is_none_or_err_and_early_return(cx, expr); . check_if_let_some_or_err_and_early_return(cx, expr); . . if self.inferred_ret_closure_stack == 0 { . check_if_try_match(cx, expr); . } . } 524,304 ( 0.04%) } . . fn check_expr_post(&mut self, _: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { . if is_inferred_ret_closure(expr) { . self.inferred_ret_closure_stack -= 1; . } . } . . fn check_block(&mut self, cx: &LateContext<'tcx>, block: &'tcx Block<'tcx>) { 1 ( 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>) { 1 ( 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; . } . } . } -------------------------------------------------------------------------------- -- 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)] 524,304 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 131,076 ( 0.01%) if expr.span.from_expansion() { . return; . } . . let Some(higher::If { . cond: cond_expr, . then: then_expr, . r#else: else_expr, . }) = higher::If::hir(expr) -- line 75 ---------------------------------------- -- line 205 ---------------------------------------- . lint_msg, . None, . format!( . "consider using the `Entry` API: https://doc.rust-lang.org/std/collections/struct.{}.html#entry-api", . map_ty.name() . ), . ); . } 524,304 ( 0.04%) } . } . . #[derive(Clone, Copy)] . enum MapType { . Hash, . BTree, . } . impl MapType { -- line 221 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 879 ---------------------------------------- . Self: Sized, . F: FnMut(Self::Item), . { . #[inline] . fn call(mut f: impl FnMut(T)) -> impl FnMut((), T) { . move |(), item| f(item) . } . 73 ( 0.00%) self.fold((), call(f)); 46 ( 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}> (1x) . } . . /// 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:?}"); . } . 4 ( 0.00%) FromIterator::from_iter(self) 753,753 ( 0.06%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/collections/hash/map.rs:, rustc_hash::FxBuildHasher> as core::iter::traits::collect::FromIterator<(rustc_middle::ty::Ty, core::option::Option)>>::from_iter::), 2>, clippy_lints::format_args::make_ty_msrv_map::{closure#0}>> (1x) . } . . /// Fallibly transforms an iterator into a collection, short circuiting if . /// a failure is encountered. . /// . /// `try_collect()` is a variation of [`collect()`][`collect`] that allows fallible . /// conversions during collection. Its main use case is simplifying conversions from . /// iterators yielding [`Option`][`Option`] into `Option>`, or similarly for other [`Try`] -- line 2094 ---------------------------------------- -- line 2481 ---------------------------------------- . #[stable(feature = "iterator_try_fold", since = "1.27.0")] . 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; 1,769,518 ( 0.14%) while let Some(x) = self.next() { 7 ( 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: as core::iter::traits::iterator::Iterator>::next (1x) 196,850 ( 0.02%) accum = f(accum, x)?; . } . try { accum } . } . . /// 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()`] -- line 2498 ---------------------------------------- -- 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; 6 ( 0.00%) while let Some(x) = self.next() { . accum = f(accum, x); . } 983,070 ( 0.08%) 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 ---------------------------------------- 721,036 ( 0.06%) -------------------------------------------------------------------------------- -- 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. 262,152 ( 0.02%) let var = if let ExprKind::Assign(lhs, ..) | ExprKind::AssignOp(_, lhs, _) = expr.kind . && let Some(var) = lhs.res_local_id() . && expr.span.desugaring_kind().is_none() . { . var . } else { . return; . }; . let mut visitor = ReadVisitor { . cx, . var, . write_expr: expr, . last_expr: expr, . }; . check_for_unsequenced_reads(&mut visitor); 65,538 ( 0.01%) } . fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx Stmt<'_>) { . match stmt.kind { . StmtKind::Let(local) => { . if let LetStmt { init: Some(e), .. } = local { . DivergenceVisitor { cx }.visit_expr(e); . } . }, . StmtKind::Expr(e) | StmtKind::Semi(e) => DivergenceVisitor { cx }.maybe_walk_expr(e), -- line 113 ---------------------------------------- -------------------------------------------------------------------------------- -- 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%) } . 524,304 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 524,304 ( 0.04%) if let ExprKind::Call(fun, [arg]) = expr.kind . && 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( -- line 149 ---------------------------------------- -- 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), . } 131,076 ( 0.01%) } else if let ExprKind::Loop(block, _, _, span) = expr.kind { . self.loop_stack.push((block.hir_id.owner, span)); . } 524,304 ( 0.04%) } . . fn check_expr_post(&mut self, _: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 458,766 ( 0.04%) 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 ---------------------------------------- 1 ( 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 { 524,304 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 327,690 ( 0.03%) 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::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. . if let Some(parent_ty) = cx.typeck_results().expr_ty_adjusted_opt(e) . && let Some(field_def_id) = get_field_def_id_by_name(parent_ty, ident.name) . { -- line 89 ---------------------------------------- -- line 98 ---------------------------------------- . span_lint_and_then( . cx, . DISALLOWED_FIELDS, . span, . format!("use of a disallowed field `{path}`"), . disallowed_path.diag_amendment(span), . ); . } 393,228 ( 0.03%) } . . fn check_pat(&mut self, cx: &LateContext<'tcx>, pat: &'tcx Pat<'_>) { . let PatKind::Struct(struct_path, pat_fields, _) = pat.kind else { . return; . }; . match cx.typeck_results().qpath_res(&struct_path, pat.hir_id) { . Res::Def(DefKind::Struct, struct_def_id) => { . let adt_def = cx.tcx.adt_def(struct_def_id); -- line 114 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/octal_escapes.rs -------------------------------------------------------------------------------- Ir -- line 45 ---------------------------------------- . pub OCTAL_ESCAPES, . suspicious, . "string escape sequences looking like octal characters" . } . . declare_lint_pass!(OctalEscapes => [OCTAL_ESCAPES]); . . impl EarlyLintPass for OctalEscapes { 458,759 ( 0.04%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 131,074 ( 0.01%) if let ExprKind::Lit(lit) = &expr.kind . // The number of bytes from the start of the token to the start of literal's text. 196,612 ( 0.02%) && let start_offset = BytePos::from_u32(match lit.kind { . LitKind::Str => 1, . LitKind::ByteStr | LitKind::CStr => 2, . _ => return, . }) 196,605 ( 0.02%) && !expr.span.in_external_macro(cx.sess().source_map()) . { . let s = lit.symbol.as_str(); . let mut iter = s.as_bytes().iter(); 2,373,482 ( 0.19%) while let Some(&c) = iter.next() { 5,221,668 ( 0.42%) if c == b'\\' . // Always move the iterator to read the escape char. 949,408 ( 0.08%) && let Some(b'0') = iter.next() . { . // C-style octal escapes read from one to three characters. . // The first character (`0`) has already been read. . let (tail, len, c_hi, c_lo) = match *iter.as_slice() { . [c_hi @ b'0'..=b'7', c_lo @ b'0'..=b'7', ref tail @ ..] => (tail, 4, c_hi, c_lo), . [c_lo @ b'0'..=b'7', ref tail @ ..] => (tail, 3, b'0', c_lo), . _ => continue, . }; -- line 76 ---------------------------------------- -- line 107 ---------------------------------------- . ); . }); . } else { . break; . } . } . } . } 524,296 ( 0.04%) } . } 258,411 ( 0.02%) -------------------------------------------------------------------------------- -- 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 { 589,842 ( 0.05%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { . use rustc_ast::LitKind; . 524,304 ( 0.04%) if let ExprKind::Call(fun, [bytes_arg]) = e.kind . // Find `std::str::converts::from_utf8` or `std::primitive::str::from_utf8` . && let Some(sym::str_from_utf8 | sym::str_inherent_from_utf8) = . fun.res(cx).opt_diag_name(cx) . . // Find string::as_bytes . && let ExprKind::AddrOf(BorrowKind::Ref, _, args) = bytes_arg.kind . && let ExprKind::Index(left, right, _) = args.kind . && let (method_names, expressions, _) = method_calls(left, 1) -- line 297 ---------------------------------------- -- 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, . ); . } . 131,076 ( 0.01%) if !e.span.in_external_macro(cx.sess().source_map()) . && let ExprKind::MethodCall(path, receiver, ..) = &e.kind . && path.ident.name == sym::as_bytes . && let ExprKind::Lit(lit) = &receiver.kind . && let LitKind::Str(lit_content, _) = &lit.node . { . let callsite = snippet(cx, receiver.span.source_callsite(), r#""foo""#); . let mut applicability = Applicability::MachineApplicable; . if callsite.starts_with("include_str!") { -- line 331 ---------------------------------------- -- line 362 ---------------------------------------- . snippet_with_applicability(cx, receiver.span, r#""foo""#, &mut applicability) . ), . applicability, . ); . } . } . } . 65,538 ( 0.01%) if let ExprKind::MethodCall(path, recv, [], _) = &e.kind . && path.ident.name == sym::into_bytes . && let ExprKind::MethodCall(path, recv, [], _) = &recv.kind . && matches!(path.ident.name, sym::to_owned | sym::to_string) . && let ExprKind::Lit(lit) = &recv.kind . && let LitKind::Str(lit_content, _) = &lit.node . && lit_content.as_str().is_ascii() . && lit_content.as_str().len() <= MAX_LENGTH_BYTE_STRING_LIT . && !recv.span.from_expansion() -- line 378 ---------------------------------------- -- line 387 ---------------------------------------- . "consider using a byte string literal instead", . format!( . "b{}.to_vec()", . snippet_with_applicability(cx, recv.span, r#""..""#, &mut applicability) . ), . applicability, . ); . } 524,304 ( 0.04%) } . } . . 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &Expr<'_>) { . let tyckres = cx.typeck_results(); 131,076 ( 0.01%) if let ExprKind::MethodCall(path, split_recv, [], split_ws_span) = expr.kind . && 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) . { -- line 456 ---------------------------------------- -- 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, . ); . } 524,304 ( 0.04%) } . } . . 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 ---------------------------------------- 65,538 ( 0.01%) -------------------------------------------------------------------------------- -- 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 { 589,833 ( 0.05%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 196,613 ( 0.02%) if let ExprKind::FormatArgs(format_args) = &expr.kind . && !format_args.span.in_external_macro(cx.sess().source_map()) . && format_args.span.check_text(cx, |src| src.starts_with('r')) . && let Some(str) = snippet_opt(cx.sess(), format_args.span) . && let count_hash = str.bytes().skip(1).take_while(|b| *b == b'#').count() . && let Some(str) = str.get(count_hash + 2..str.len() - count_hash - 1) . { . self.check_raw_string( . cx, -- line 83 ---------------------------------------- -- line 84 ---------------------------------------- . str, . format_args.span, . "r", . u8::try_from(count_hash).unwrap(), . "string", . ); . } . 262,144 ( 0.02%) if let ExprKind::Lit(lit) = expr.kind 327,680 ( 0.03%) && 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()); . } 524,296 ( 0.04%) } . } . . 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: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/symbol.rs -------------------------------------------------------------------------------- Ir -- line 2670 ---------------------------------------- . pub const fn new(n: u32) -> Self { . Symbol(SymbolIndex::from_u32(n)) . } . . /// Maps a string to its interned representation. . #[rustc_diagnostic_item = "SymbolIntern"] . #[inline] . pub fn intern(str: &str) -> Self { 181 ( 0.00%) with_session_globals(|session_globals| session_globals.symbol_interner.intern_str(str)) 110 ( 0.00%) => ???:::intern_str (1x) . } . . /// Access the underlying string. This is a slowish operation because it . /// requires locking the symbol interner. . /// . /// Note that the lifetime of the return value is a lie. It's not the same . /// as `&self`, but actually tied to the lifetime of the underlying . /// interner. Interners are long-lived, and there are very few of them, and . /// this function is typically used for short-lived things, so in practice . /// it works out ok. . #[inline] . pub fn as_str(&self) -> &str { . with_session_globals(|session_globals| unsafe { 131,076 ( 0.01%) std::mem::transmute::<&str, &str>(session_globals.symbol_interner.get_str(*self)) 84 ( 0.00%) => ???:::get_str (3x) . }) . } . . pub fn as_u32(self) -> u32 { . self.0.as_u32() . } . . pub fn is_empty(self) -> bool { -- line 2700 ---------------------------------------- 5 ( 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 196,614 ( 0.02%) if !expr.span.from_expansion() . // Avoid cases already linted by `field_reassign_with_default` 65,538 ( 0.01%) && !self.reassigned_linted.contains(&expr.span) . && let ExprKind::Call(path, []) = expr.kind . && !in_automatically_derived(cx.tcx, expr.hir_id) . && let ExprKind::Path(ref qpath) = path.kind . && let Some(def_id) = cx.qpath_res(qpath, path.hir_id).opt_def_id() . && cx.tcx.is_diagnostic_item(sym::default_fn, def_id) . && !is_update_syntax_base(cx, expr) . // Detect and ignore ::default() because these calls do explicitly name the type. . && let QPath::Resolved(None, _path) = qpath -- line 92 ---------------------------------------- -- line 100 ---------------------------------------- . DEFAULT_TRAIT_ACCESS, . expr.span, . format!("calling `{replacement}` is more clear than this expression"), . "try", . replacement, . Applicability::Unspecified, // First resolve the TODO above . ); . } 524,304 ( 0.04%) } . . #[expect(clippy::too_many_lines)] 9 ( 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 { 4 ( 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 . let (local, variant, binding_name, binding_type, span) = if let StmtKind::Let(local) = stmt.kind -- line 123 ---------------------------------------- -- line 242 ---------------------------------------- . first_assign.unwrap().span, . "field assignment outside of initializer for an instance created with Default::default()", . Some(local.span), . format!("consider initializing the variable with `{sugg}` and removing relevant reassignments"), . ); . self.reassigned_linted.insert(span); . } . } 8 ( 0.00%) } . } . . /// Returns the reassigned field and the assigning expression (right-hand side of assign). . fn field_reassigned_by_stmt<'tcx>(this: &Stmt<'tcx>, binding_name: Symbol) -> Option<(Ident, &'tcx Expr<'tcx>)> { . if let StmtKind::Semi(later_expr) = this.kind . // only take assignments . && let ExprKind::Assign(assign_lhs, assign_rhs, _) = later_expr.kind . // only take assignments to fields where the left-hand side field is a field of -- line 258 ---------------------------------------- -------------------------------------------------------------------------------- -- 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, . } . 24 ( 0.00%) pub(super) fn check<'a>(cx: &LateContext<'a>, body: &Body<'a>) { . let mut bindings: FxHashMap> = FxHashMap::default(); . 3 ( 0.00%) for_each_expr_without_closures(body.value, |expr| { 327,688 ( 0.03%) match expr.kind { 1 ( 0.00%) ExprKind::Block(block, _) => { 1 ( 0.00%) for stmt in block.stmts { . if let StmtKind::Let(let_stmt) = stmt.kind { . collect_binding_from_local(cx, let_stmt, &mut bindings); . } . } . }, . ExprKind::Let(let_expr) => { . collect_binding_from_let(cx, let_expr, &mut bindings); . }, . _ => {}, . } . ControlFlow::<()>::Continue(()) . }); . . #[allow(rustc::potential_query_instability)] 9 ( 0.00%) let mut binding_vec: Vec<_> = bindings.into_iter().collect(); . binding_vec.sort_by_key(|(_, info)| info.ty_span.lo()); . 3 ( 0.00%) for (hir_id, binding_info) in binding_vec { . check_binding_usages(cx, body, hir_id, &binding_info); . } 24 ( 0.00%) } . . fn collect_binding_from_let<'a>( . cx: &LateContext<'a>, . let_expr: &rustc_hir::LetExpr<'a>, . bindings: &mut FxHashMap>, . ) { . if let_expr.ty.is_none() . || let_expr.span.from_expansion() -- line 62 ---------------------------------------- 65,538 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_non_exhaustive.rs -------------------------------------------------------------------------------- Ir -- line 66 ---------------------------------------- . pub struct ManualNonExhaustive { . msrv: Msrv, . constructed_enum_variants: FxHashSet, . potential_enums: Vec<(LocalDefId, LocalDefId, Span, Span)>, . } . . impl ManualNonExhaustive { . pub fn new(conf: &'static Conf) -> Self { 8 ( 0.00%) Self { . msrv: conf.msrv.into(), . constructed_enum_variants: FxHashSet::default(), . potential_enums: Vec::new(), . } . } . } . . impl<'tcx> LateLintPass<'tcx> for ManualNonExhaustive { 44 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) { 34 ( 0.00%) if !cx.effective_visibilities.is_exported(item.owner_id.def_id) || !self.msrv.meets(cx, msrvs::NON_EXHAUSTIVE) { 183 ( 0.00%) => ???:::is_exported (4x) 15 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (1x) . return; . } . 5 ( 0.00%) match item.kind { . ItemKind::Enum(_, _, def) if def.variants.len() > 1 => { . let iter = def.variants.iter().filter_map(|v| { . (matches!(v.data, VariantData::Unit(_, _)) && is_doc_hidden(cx.tcx.hir_attrs(v.hir_id))) . .then_some((v.def_id, v.span)) . }); . if let Ok((id, span)) = iter.exactly_one() . && !find_attr!(cx.tcx, item.hir_id(), NonExhaustive(..)) . { -- line 96 ---------------------------------------- -- line 142 ---------------------------------------- . // ``` . diag.span_help(field.span, "remove this field"); . }, . ); . } . }, . _ => {}, . } 32 ( 0.00%) } . . fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::Path(QPath::Resolved(None, p)) = &e.kind . && let Res::Def(DefKind::Ctor(CtorOf::Variant, CtorKind::Const), ctor_id) = p.res . && let Some(local_ctor) = ctor_id.as_local() . { . let variant_id = cx.tcx.local_parent(local_ctor); . self.constructed_enum_variants.insert(variant_id); . } . } . 8 ( 0.00%) fn check_crate_post(&mut self, cx: &LateContext<'tcx>) { . for (enum_id, _, enum_span, variant_span) in std::mem::take(&mut self.potential_enums) . .into_iter() . .filter(|(_, variant_id, _, _)| !self.constructed_enum_variants.contains(variant_id)) . { . let hir_id = cx.tcx.local_def_id_to_hir_id(enum_id); . span_lint_hir_and_then( . cx, . MANUAL_NON_EXHAUSTIVE, -- line 170 ---------------------------------------- -- line 180 ---------------------------------------- . Applicability::MaybeIncorrect, . ); . // FIXME: Ideally this would be a suggestion, but the span for that is annoying to get. . // See the comment above for examples. . diag.span_help(variant_span, "remove this variant"); . }, . ); . } 8 ( 0.00%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/literal_representation.rs -------------------------------------------------------------------------------- Ir -- line 201 ---------------------------------------- . } . } . . pub struct LiteralDigitGrouping { . lint_fraction_readability: bool, . } . . impl EarlyLintPass for LiteralDigitGrouping { 458,759 ( 0.04%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { . // `NumericLiteral::from_lit_kind` only accepts integer and float literals. 196,610 ( 0.02%) if let ExprKind::Lit(lit) = expr.kind 196,608 ( 0.02%) && matches!(lit.kind, token::LitKind::Integer | token::LitKind::Float) 4 ( 0.00%) && !expr.span.in_external_macro(cx.sess().source_map()) . { . self.check_lit(cx, lit, expr.span); . } 524,296 ( 0.04%) } . } . . // 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) { 7 ( 0.00%) if let Some(src) = span.get_text(cx) 8 ( 0.00%) && let Ok(lit_kind) = LitKind::from_token_lit(lit) 234 ( 0.00%) => ???:::from_token_lit (1x) 21 ( 0.00%) && let Some(mut num_lit) = NumericLiteral::from_lit_kind(&src, &lit_kind) 155 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/numeric_literal.rs:::from_lit_kind (1x) 25 ( 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 (1x) . { . if !Self::check_for_mistyped_suffix(cx, span, &mut num_lit) { . return; . } . . if Self::is_literal_uuid_formatted(&num_lit) { . return; . } . 3 ( 0.00%) let result = (|| { 1 ( 0.00%) let integral_group_size = Self::get_group_size(num_lit.integer.split('_'), num_lit.radix, true)?; 3 ( 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 { 1 ( 0.00%) if num_lit.suffix.is_some() { . return true; . } . 3 ( 0.00%) let (part, mistyped_suffixes, is_float) = if let Some((_, exponent)) = &mut num_lit.exponent { . (exponent, &["32", "64"][..], true) 1 ( 0.00%) } else if num_lit.fraction.is_some() { . return true; . } else { . (&mut num_lit.integer, &["8", "16", "32", "64"][..], false) . }; . 2 ( 0.00%) let mut split = part.rsplit('_'); 2 ( 0.00%) let last_group = split.next().expect("At least one group"); 1 ( 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 { 2 ( 0.00%) if num_lit.radix != Radix::Hexadecimal { . return false; . } . . // UUIDs should not have a fraction . if num_lit.fraction.is_some() { . return false; . } . 2 ( 0.00%) let group_sizes: Vec = num_lit.integer.split('_').map(str::len).collect(); 2 ( 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"); . 2 ( 0.00%) if (radix == Radix::Binary || radix == Radix::Octal || radix == Radix::Hexadecimal) . && let Some(second_size) = groups.next() . && (!groups.all(|i| i == second_size) || first > second_size) . { . return Err(WarningType::UnusualByteGroupings); . } . . if let Some(second) = groups.next() { . if !groups.all(|x| x == second) || first > second { . Err(WarningType::InconsistentDigitGrouping) . } else if second > 4 { . Err(WarningType::LargeDigitGroups) . } else { . Ok(Some(second)) . } 2 ( 0.00%) } else if first > 5 && lint_unreadable { . Err(WarningType::UnreadableLiteral) . } else { . Ok(None) . } . } . } . . pub struct DecimalLiteralRepresentation { . threshold: u64, . } . . impl EarlyLintPass for DecimalLiteralRepresentation { 458,759 ( 0.04%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { . // Only integer tokens can produce `LitKind::Int`. 131,074 ( 0.01%) if let ExprKind::Lit(lit) = expr.kind . && lit.kind == token::LitKind::Integer 3 ( 0.00%) && !expr.span.in_external_macro(cx.sess().source_map()) . { 5 ( 0.00%) self.check_lit(cx, lit, expr.span); . } 524,296 ( 0.04%) } . } . . 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. 7 ( 0.00%) if let Ok(lit_kind) = LitKind::from_token_lit(lit) 234 ( 0.00%) => ???:::from_token_lit (1x) 4 ( 0.00%) && let LitKind::Int(val, _) = lit_kind 1 ( 0.00%) && val >= u128::from(self.threshold) 10 ( 0.00%) && let Some(src) = span.get_text(cx) 357 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/source.rs:::get_text::<&rustc_lint::context::EarlyContext> (1x) 6 ( 0.00%) && let Some(num_lit) = NumericLiteral::from_lit_kind(&src, &lit_kind) 155 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/numeric_literal.rs:::from_lit_kind (1x) 25 ( 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 (1x) . && num_lit.radix == Radix::Decimal . { . let hex = format!("{val:#X}"); . let num_lit = NumericLiteral::new(&hex, num_lit.suffix, false); . let _: Result<(), ()> = Self::do_lint(num_lit.integer).map_err(|warning_type| { . warning_type.display(&num_lit, cx, span); . }); . } -- line 453 ---------------------------------------- 18 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/write/mod.rs -------------------------------------------------------------------------------- Ir -- line 251 ---------------------------------------- . format_args: FormatArgsStorage, . // The outermost `impl Debug` we're currently in. While we're in one, `USE_DEBUG` is deactivated . outermost_debug_impl: Option, . allow_print_in_tests: bool, . } . . impl Write { . pub fn new(conf: &'static Conf, format_args: FormatArgsStorage) -> Self { 3 ( 0.00%) Self { . format_args, . outermost_debug_impl: None, . allow_print_in_tests: conf.allow_print_in_tests, . } . } . . fn in_debug_impl(&self) -> bool { . self.outermost_debug_impl.is_some() . } . } . . impl<'tcx> LateLintPass<'tcx> for Write { . fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) { . // Only check for `impl Debug`s if we're not already in one 8 ( 0.00%) if self.outermost_debug_impl.is_none() && is_debug_impl(cx, item) { . self.outermost_debug_impl = Some(item.owner_id); . } . } . . fn check_item_post(&mut self, _cx: &LateContext<'_>, item: &Item<'_>) { . // Only clear `self.outermost_debug_impl` if we're escaping the _outermost_ debug impl . if self.outermost_debug_impl == Some(item.owner_id) { . self.outermost_debug_impl = None; . } . } . 655,380 ( 0.05%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . let Some(macro_call) = root_macro_call_first_node(cx, expr) else { . return; . }; . let Some(diag_name) = cx.tcx.get_diagnostic_name(macro_call.def_id) else { . return; . }; . let Some(name) = diag_name.as_str().strip_suffix("_macro") else { . return; -- line 294 ---------------------------------------- -- line 332 ---------------------------------------- . } . . literal::check(cx, format_args, name); . . if !self.in_debug_impl() { . use_debug::check(cx, format_args); . } . } 524,304 ( 0.04%) } . } . . fn is_debug_impl(cx: &LateContext<'_>, item: &Item<'_>) -> bool { 24 ( 0.00%) if let ItemKind::Impl(Impl { . of_trait: Some(of_trait), . .. . }) = &item.kind . && let Some(trait_id) = of_trait.trait_ref.trait_def_id() . { . cx.tcx.is_diagnostic_item(sym::Debug, trait_id) . } else { . false -- line 352 ---------------------------------------- -------------------------------------------------------------------------------- -- 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}; . 589,842 ( 0.05%) 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)) . && let Some((lhs, rhs, _)) = find_assert_eq_args(cx, e, macro_call.expn) . && is_float(cx, lhs) . { . let ecx = ConstEvalCtxt::new(cx); . let ctxt = macro_call.span.ctxt(); . -- line 23 ---------------------------------------- -- 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); . } 524,304 ( 0.04%) } . . 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, . } . } . -- line 46 ---------------------------------------- -------------------------------------------------------------------------------- -- 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/fuse.rs -------------------------------------------------------------------------------- Ir -- line 94 ---------------------------------------- . FuseImpl::try_fold(self, acc, fold) . } . . #[inline] . fn fold(self, mut acc: Acc, fold: Fold) -> Acc . where . Fold: FnMut(Acc, Self::Item) -> Acc, . { 21 ( 0.00%) if let Some(iter) = self.iter { 1 ( 0.00%) acc = iter.fold(acc, fold); 19 ( 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:, ::new::{closure#0}>, ::new::{closure#1}> as core::iter::traits::iterator::Iterator>::fold::<(), >::iter_fold::flatten, ::new::{closure#1}::{closure#0}>, (), as core::iter::traits::iterator::Iterator>::fold::flatten, ::new::{closure#1}::{closure#0}>, (), core::iter::traits::iterator::Iterator::for_each::call<(rustc_span::def_id::DefId, rustc_span::symbol::Symbol), as core::iter::traits::collect::Extend<(rustc_span::def_id::DefId, rustc_span::symbol::Symbol)>>::extend, ::new::{closure#0}>, core::iter::adapters::map::Map, ::new::{closure#1}::{closure#0}>, ::new::{closure#1}>>::{closure#0}>::{closure#0}>::{closure#0}>::{closure#0}> (1x) . } . acc . } . . #[inline] . fn find

(&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> { 5 ( 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, . { 131,076 ( 0.01%) if let Some(ref mut iter) = self.iter { 65,538 ( 0.01%) acc = iter.try_fold(acc, fold)?; 1,572,912 ( 0.13%) => /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> (65,538x) . } . try { acc } . } . . #[inline] . fn find

(&mut self, predicate: P) -> Option . where . P: FnMut(&Self::Item) -> bool, -- line 438 ---------------------------------------- 5 ( 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) { 131,074 ( 0.01%) if let ExprKind::If(_, _, Some(ref els)) = item.kind . && let ExprKind::If(_, _, None) = els.kind . && !item.span.in_external_macro(cx.sess().source_map()) . { . #[expect(clippy::collapsible_span_lint_calls, reason = "rust-clippy#7797")] . span_lint_and_then( . cx, . ELSE_IF_WITHOUT_ELSE, . els.span, -- line 58 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 393,228 ( 0.03%) pub fn hir(expr: &Expr<'tcx>) -> Option { 131,076 ( 0.01%) if let ExprKind::DropTemps(e) = expr.kind . && let ExprKind::Match(iterexpr, [arm], MatchSource::ForLoopDesugar) = e.kind . && let ExprKind::Call(_, [arg]) = iterexpr.kind . && let ExprKind::Loop(block, label, ..) = arm.body.kind . && let [stmt] = block.stmts . && let hir::StmtKind::Expr(e) = stmt.kind . && let ExprKind::Match(_, [_, some_arm], _) = e.kind . && let hir::PatKind::Struct(_, [field], _) = some_arm.pat.kind . { -- line 46 ---------------------------------------- -- line 48 ---------------------------------------- . pat: field.pat, . arg, . body: some_arm.body, . loop_id: arm.body.hir_id, . span: expr.span.ctxt().outer_expn_data().call_site, . label, . }); . } 65,538 ( 0.01%) None 393,228 ( 0.03%) } . } . . /// 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 { 983,070 ( 0.08%) if let ExprKind::If(cond, then, r#else) = expr.kind . && !has_let_expr(cond) . { . Some(Self { cond, then, r#else }) . } else { . None . } . } . } -- line 82 ---------------------------------------- -- 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 196,614 ( 0.02%) pub fn hir(cx: &LateContext<'_>, expr: &Expr<'hir>) -> Option { 393,228 ( 0.03%) if let ExprKind::If( . &Expr { . kind: . ExprKind::Let(&hir::LetExpr { . pat: let_pat, . init: let_expr, . span: let_span, . .. . }), -- line 110 ---------------------------------------- -- line 130 ---------------------------------------- . return Some(Self { . let_pat, . let_expr, . if_then, . if_else, . let_span, . }); . } 196,614 ( 0.02%) None 196,614 ( 0.02%) } . } . . /// 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 211 ---------------------------------------- . pub start: Option<&'a Expr<'a>>, . /// The upper bound of the range, or `None` for ranges such as `X..`. . pub end: Option<&'a Expr<'a>>, . pub span: Span, . } . . impl<'a> Range<'a> { . /// Higher a `hir` range to something similar to `ast::ExprKind::Range`. 1,310,760 ( 0.11%) pub fn hir(cx: &LateContext<'_>, expr: &'a Expr<'_>) -> Option> { 262,152 ( 0.02%) let span = expr.range_span()?; 2,883,672 ( 0.23%) => ???:::range_span (131,076x) . let (ty, start, end) = match expr.kind { . ExprKind::Call(path, [arg1, arg2]) . if let ExprKind::Path(qpath) = path.kind . && cx.tcx.qpath_is_lang_item(qpath, hir::LangItem::RangeInclusiveNew) => . { . (RangeTy::OpsInclusive, Some(arg1), Some(arg2)) . }, . ExprKind::Struct(&qpath, fields, StructTailExpr::None) => match (cx.tcx.qpath_lang_item(qpath)?, fields) { -- line 228 ---------------------------------------- -- line 256 ---------------------------------------- . }, . (hir::LangItem::RangeTo, [end]) if end.ident.name == sym::end => (RangeTy::OpsTo, None, Some(end.expr)), . _ => return None, . }, . _ => return None, . }; . . Some(Range { ty, start, end, span }) 1,048,608 ( 0.08%) } . } . . /// A type that can appear as the type of a range expression. . /// . /// This is a component of [`Range`]. . #[derive(Debug, Copy, Clone, Eq, PartialEq)] . pub enum RangeTy { . /// [`core::ops::RangeFrom`] -- line 272 ---------------------------------------- -- line 361 ---------------------------------------- . Repeat(&'a Expr<'a>, &'a Expr<'a>), . /// `vec![a, b, c]` . Vec(&'a [Expr<'a>]), . } . . impl<'a> VecArgs<'a> { . /// Returns the arguments of the `vec!` macro if this expression was expanded . /// from `vec!`. 1,376,298 ( 0.11%) pub fn hir(cx: &LateContext<'_>, expr: &'a Expr<'_>) -> Option> { 393,228 ( 0.03%) if let ExprKind::Call(fun, args) = expr.kind . && let ExprKind::Path(ref qpath) = fun.kind . && is_expn_of(fun.span, sym::vec).is_some() . && let Some(fun_def_id) = cx.qpath_res(qpath, fun.hir_id).opt_def_id() . && let Some(name) = cx.tcx.get_diagnostic_name(fun_def_id) . { . return match (name, args) { . (sym::vec_from_elem, [elem, size]) => { . // `vec![elem; size]` case -- line 378 ---------------------------------------- -- line 386 ---------------------------------------- . Some(VecArgs::Vec(elems)) . }, . (sym::vec_new, []) => Some(VecArgs::Vec(&[])), . _ => None, . }; . } . . None 1,376,298 ( 0.11%) } . } . . /// 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 448 ---------------------------------------- . /// ^^^^^^^^^^^^^^ . pub let_span: Span, . } . . impl<'hir> WhileLet<'hir> { . #[inline] . /// Parses a desugared `while let` loop . pub const fn hir(expr: &Expr<'hir>) -> Option { 393,228 ( 0.03%) if let ExprKind::Loop( . &Block { . expr: . Some(&Expr { . kind: . ExprKind::If( . &Expr { . kind: . ExprKind::Let(&hir::LetExpr { -- line 464 ---------------------------------------- 393,228 ( 0.03%) -------------------------------------------------------------------------------- -- 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx rustc_hir::Expr<'tcx>) { 131,077 ( 0.01%) if !expr.span.from_expansion() . && let hir::ExprKind::MethodCall(path, recv, [map_arg], ..) = expr.kind . && !map_arg.span.from_expansion() . && let hir::ExprKind::Path(fun) = map_arg.kind . && let Some(sym::Option | sym::Result) = cx.typeck_results().expr_ty(recv).opt_diag_name(cx) . { . let (constructor_path, constructor_item) = if let hir::ExprKind::Call(constructor, [arg, ..]) = recv.kind . && let hir::ExprKind::Path(constructor_path) = constructor.kind . && !constructor.span.from_expansion() -- line 49 ---------------------------------------- -- line 81 ---------------------------------------- . "unnecessary `{}` on constructor `{constructor_snippet}(_)`", . path.ident.name . ), . "try", . format!("{constructor_snippet}({fun_snippet}({constructor_arg_snippet}))"), . app, . ); . } 524,304 ( 0.04%) } . } 131,076 ( 0.01%) -------------------------------------------------------------------------------- -- 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) { 131,074 ( 0.01%) if let ExprKind::InlineAsm(inline_asm) = &expr.kind { . check_asm_syntax(INLINE_ASM_X86_ATT_SYNTAX, cx, inline_asm, expr.span, AsmStyle::Att); . } . } . . fn check_item(&mut self, cx: &EarlyContext<'_>, item: &Item) { 9 ( 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_utils/src/msrvs.rs -------------------------------------------------------------------------------- Ir -- line 111 ---------------------------------------- . } . . 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 . pub fn current(self, cx: &LateContext<'_>) -> Option { 131,077 ( 0.01%) if SEEN_MSRV_ATTR.load(Ordering::Relaxed) { . self.for_attrs(cx.tcx, cx.last_node_with_lint_attrs) . } else { . self.0 . } . } . . /// Returns the MSRV at the specified node . /// -- line 127 ---------------------------------------- -- 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 655,385 ( 0.05%) pub fn meets(self, cx: &LateContext<'_>, required: RustcVersion) -> bool { . self.current(cx).is_none_or(|msrv| msrv >= required) 524,308 ( 0.04%) } . /// Checks if a required version from [this module](self) is met at the specified node . /// . /// If the crate being linted uses an `#[clippy::msrv]` attribute this will search the parent . /// nodes for that attribute, prefer to run this check after cheaper pattern matching operations . pub fn meets_at(self, tcx: TyCtxt<'_>, node: HirId, required: RustcVersion) -> bool { . self.at(tcx, node).is_none_or(|msrv| msrv >= required) . } . -- line 159 ---------------------------------------- -- line 233 ---------------------------------------- . . impl MsrvStack { . pub fn current(&self) -> Option { . self.stack.last().copied() . } . . pub fn meets(&self, required: RustcVersion) -> bool { . self.current().is_none_or(|msrv| msrv >= required) 65,541 ( 0.01%) } . . 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); . } 393,250 ( 0.03%) } . . pub fn check_attributes_post(&mut self, attrs: &[Attribute]) { . if parse_attrs(attrs).is_some() { . self.stack.pop(); . } 393,250 ( 0.03%) } . } . . fn parse_attrs(attrs: &[impl AttributeExt]) -> Option { 40 ( 0.00%) let msrv_attr = attrs.iter().find(|attr| attr.path_matches(&[sym::clippy, sym::msrv]))?; 40 ( 0.00%) => ???:::path_matches (5x) . . let msrv = msrv_attr.value_str()?; . . parse_version(msrv) . } . 524,336 ( 0.04%) pub fn check_attrs(sess: &Session, attrs: &[impl AttributeExt]) { 4 ( 0.00%) let mut msrv_attrs = attrs.iter().filter(|attr| attr.path_matches(&[sym::clippy, sym::msrv])); 8 ( 0.00%) => ???:::path_matches (1x) . . 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")); . } 524,336 ( 0.04%) } 196,619 ( 0.02%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/await_holding_invalid.rs -------------------------------------------------------------------------------- Ir -- line 178 ---------------------------------------- . AWAIT_HOLDING_REFCELL_REF, . ]); . . pub struct AwaitHolding { . def_ids: DefIdMap<(&'static str, &'static DisallowedPathWithoutReplacement)>, . } . . impl AwaitHolding { 8 ( 0.00%) pub(crate) fn new(tcx: TyCtxt<'_>, conf: &'static Conf) -> Self { . let (def_ids, _) = create_disallowed_map( . tcx, . &conf.await_holding_invalid_types, . PathNS::Type, . crate::disallowed_types::def_kind_predicate, . "type", . false, . ); . Self { def_ids } 8 ( 0.00%) } . } . . impl<'tcx> LateLintPass<'tcx> for AwaitHolding { 524,304 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>) { 131,076 ( 0.01%) if let hir::ExprKind::Closure(hir::Closure { . kind: hir::ClosureKind::Coroutine(hir::CoroutineKind::Desugared(hir::CoroutineDesugaring::Async, _)), . def_id, . .. . }) = expr.kind . && let Some(coroutine_layout) = cx.tcx.mir_coroutine_witnesses(*def_id) . { . self.check_interior_types(cx, coroutine_layout); . } 524,304 ( 0.04%) } . } . . impl AwaitHolding { . fn check_interior_types(&self, cx: &LateContext<'_>, coroutine: &CoroutineLayout<'_>) { . for (ty_index, ty_cause) in coroutine.field_tys.iter_enumerated() { . if let rustc_middle::ty::Adt(adt, _) = ty_cause.ty.kind() { . let await_points = || { . coroutine -- line 218 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 131,076 ( 0.01%) if e.span.from_expansion() { . // Issue #11268 . return; . } . 327,690 ( 0.03%) match e.kind { . ExprKind::Call(fn_expr, arguments) => { . if let ExprKind::Path(ref path) = fn_expr.kind . && arguments.iter().any(is_mut_ref_arg) . { . check_arguments( . cx, . &mut arguments.iter(), . cx.typeck_results().expr_ty(fn_expr), -- line 56 ---------------------------------------- -- line 76 ---------------------------------------- . &mut iter::once(receiver).chain(arguments.iter()), . method_type, . &|| path.ident.as_str().to_owned(), . "method", . ); . }, . _ => (), . } 524,304 ( 0.04%) } . } . . /// 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 { . matches!(argument.kind, ExprKind::AddrOf(BorrowKind::Ref, Mutability::Mut, _)) . } . . fn check_arguments<'tcx>( -- line 92 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { . 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), -- line 79 ---------------------------------------- -- line 455 ---------------------------------------- . ControlFlow::Break((collection_expr, span, false)) . } else { . ControlFlow::Continue(()) . } . }) . } . . impl<'tcx> LateLintPass<'tcx> for ManualPopIf { 524,304 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 131,076 ( 0.01%) let ExprKind::If(cond, then_block, None) = expr.kind else { . return; . }; . . let in_else_clause = is_else_clause(cx.tcx, expr); . . for kind in [ . ManualPopIfKind::Vec, . ManualPopIfKind::VecDequeBack, -- line 472 ---------------------------------------- -- line 482 ---------------------------------------- . if in_else_clause { . pattern.suggestable = false; . } . . pattern.emit_lint(cx); . return; . } . } 524,304 ( 0.04%) } . } -------------------------------------------------------------------------------- -- 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 { 327,690 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 65,538 ( 0.01%) 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), . ); . } 393,228 ( 0.03%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_utils/src/res.rs -------------------------------------------------------------------------------- Ir -- line 422 ---------------------------------------- . 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> { 786,456 ( 0.06%) match &self.kind { . ExprKind::Path(qpath) => qpath.opt_res_path(), . _ => (None, None), . } . } . . #[inline] . fn opt_ty_rel_path(self) -> OptTyRelPath<'a> { . match &self.kind { -- line 438 ---------------------------------------- -------------------------------------------------------------------------------- -- 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; . 458,801 ( 0.04%) pub fn check(cx: &LateContext<'_>, attrs: &[Attribute]) -> bool { . let replacements: Vec<_> = collect_doc_replacements(attrs); . 131,086 ( 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 . } 524,344 ( 0.04%) } . . fn collect_doc_replacements(attrs: &[Attribute]) -> Vec<(Span, String)> { . attrs . .iter() . .filter_map(|attr| { 2 ( 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 { 1 ( 0.00%) None . } . }) . .collect() . } -------------------------------------------------------------------------------- -- 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 131,076 ( 0.01%) if let ExprKind::Binary(ref op, left, right) = expr.kind . && BinOpKind::Mul == op.node . && !expr.span.from_expansion() . && 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 { -- line 64 ---------------------------------------- -- line 74 ---------------------------------------- . MANUAL_SLICE_SIZE_CALCULATION, . expr.span, . "manual slice size calculation", . "try", . format!("{sugg}::mem::size_of_val({deref}{val_name})"), . app, . ); . } 524,304 ( 0.04%) } . } . . fn simplify<'tcx>( . cx: &LateContext<'tcx>, . expr1: &'tcx Expr<'tcx>, . expr2: &'tcx Expr<'tcx>, . ) -> Option<(&'tcx Expr<'tcx>, usize)> { . let expr1 = expr_or_init(cx, expr1); -- line 90 ---------------------------------------- -------------------------------------------------------------------------------- -- 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. 4 ( 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`. 451,593 ( 0.04%) 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. 1,220 ( 0.00%) unsafe { intrinsics::offset(self, intrinsics::unchecked_sub(0, count as isize)) } . } . } . . /// Subtracts an unsigned offset in bytes from a pointer. . /// . /// `count` is in units of bytes. . /// . /// This is purely a convenience for casting to a `u8` pointer and -- line 1063 ---------------------------------------- 560,274 ( 0.05%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_ast/src/token.rs -------------------------------------------------------------------------------- Ir -- line 180 ---------------------------------------- . } . } . } . . // Note that the suffix is *not* considered when deciding the `LitKind` in this . // type. This means that float literals like `1f32` are classified by this type . // as `Int`. Only upon conversion to `ast::LitKind` will such a literal be . // given the `Float` kind. 131,072 ( 0.01%) #[derive(Clone, Copy, PartialEq, Eq, Hash, Encodable, Decodable, Debug, StableHash)] . pub enum LitKind { . Bool, // AST only, must never appear in a `Token` . Byte, . Char, . Integer, // e.g. `1`, `1u8`, `1f32` . Float, // e.g. `1.`, `1.0`, `1e3f32` . Str, . StrRaw(u8), // raw string delimited by `n` hash symbols -- line 196 ---------------------------------------- 4 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/iter/adapters/flatten.rs -------------------------------------------------------------------------------- Ir -- line 15 ---------------------------------------- . #[must_use = "iterators are lazy and do nothing unless consumed"] . #[stable(feature = "rust1", since = "1.0.0")] . pub struct FlatMap { . inner: FlattenCompat, ::IntoIter>, . } . . impl U> FlatMap { . pub(in crate::iter) fn new(iter: I, f: F) -> FlatMap { 524,312 ( 0.04%) 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 242 ---------------------------------------- . self.inner.try_fold(init, fold) . } . . #[inline] . fn fold(self, init: Acc, fold: Fold) -> Acc . where . Fold: FnMut(Acc, Self::Item) -> Acc, . { 13 ( 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()) . } . 23 ( 0.00%) if let Some(iter) = self.frontiter { . acc = fold(acc, iter); . } . 15 ( 0.00%) acc = self.iter.fold(acc, flatten(&mut fold)); . 21 ( 0.00%) if let Some(iter) = self.backiter { . acc = fold(acc, iter); . } . . acc . } . . /// Folds over the inner iterators as long as the given function returns successfully, . /// always storing the most recent inner iterator in `self.frontiter`. -- line 408 ---------------------------------------- -- line 421 ---------------------------------------- . fold: &'a mut impl FnMut(Acc, &mut T::IntoIter) -> R, . ) -> impl FnMut(Acc, T) -> R + 'a { . move |acc, iter| fold(acc, frontiter.insert(iter.into_iter())) . } . . if let Some(iter) = &mut self.frontiter { . acc = fold(acc, iter)?; . } 196,614 ( 0.02%) self.frontiter = None; . . acc = self.iter.try_fold(acc, flatten(&mut self.frontiter, &mut fold))?; 65,538 ( 0.01%) self.frontiter = None; . 131,076 ( 0.01%) if let Some(iter) = &mut self.backiter { . acc = fold(acc, iter)?; . } . self.backiter = None; . . try { acc } . } . } . -- line 442 ---------------------------------------- -- line 518 ---------------------------------------- . type Item = U::Item; . . #[inline] . default fn next(&mut self) -> Option { . loop { . if let elt @ Some(_) = and_then_or_clear(&mut self.frontiter, Iterator::next) { . return elt; . } 12 ( 0.00%) match self.iter.next() { . None => return and_then_or_clear(&mut self.backiter, Iterator::next), . Some(inner) => self.frontiter = Some(inner.into_iter()), . } . } . } . . #[inline] . default fn size_hint(&self) -> (usize, Option) { -- line 534 ---------------------------------------- 131,085 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/casts/ptr_cast_constness.rs -------------------------------------------------------------------------------- Ir -- line 71 ---------------------------------------- . format!("try `pointer::cast_{constness}`, a safer alternative"), . format!("{}.cast_{constness}()", sugg.maybe_paren()), . app, . ); . } . } . } . 393,228 ( 0.03%) pub(super) fn check_null_ptr_cast_method(cx: &LateContext<'_>, expr: &Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::MethodCall(method, cast_from_expr, [], _) = expr.kind . && let ExprKind::Call(func, []) = cast_from_expr.kind . && let ExprKind::Path(QPath::Resolved(None, path)) = func.kind . && let Some(defid) = path.res.opt_def_id() . && let method = match (cx.tcx.get_diagnostic_name(defid), method.ident.name) { . (Some(sym::ptr_null), sym::cast_mut) => "null_mut", . (Some(sym::ptr_null_mut), sym::cast_const) => "null", . _ => return, . } -- line 88 ---------------------------------------- -- 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, . ); . } 458,766 ( 0.04%) } -------------------------------------------------------------------------------- -- 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 { 589,842 ( 0.05%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 131,076 ( 0.01%) if !expr.span.from_expansion() . && let Some((has_ref, slice)) = is_byte_char_slices(cx, expr) . { . span_lint_and_then( . cx, . BYTE_CHAR_SLICES, . expr.span, . "can be more succinctly written as a byte str", . |diag| { -- line 49 ---------------------------------------- -- line 64 ---------------------------------------- . if !has_ref && !cx.typeck_results().expr_ty_adjusted(expr).is_array_slice() { . sugg = sugg.deref(); . } . . diag.span_suggestion(expr.span, "try", sugg, app); . }, . ); . } 524,304 ( 0.04%) } . } . . /// 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)> { 196,614 ( 0.02%) let (has_ref, expr) = if let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner) = expr.kind { . (true, inner) 327,690 ( 0.03%) } else if let Some(parent) = get_parent_expr(cx, expr) // Already checked by the parent expr. 7,799,022 ( 0.63%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::get_parent_expr (65,538x) 131,070 ( 0.01%) && let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, _) = parent.kind . { . return None; . } else { . (false, expr) . }; . 131,077 ( 0.01%) if let ExprKind::Array(members) = expr.kind 2 ( 0.00%) && !members.is_empty() 1 ( 0.00%) && !span_contains_comment(cx, expr.span) 5 ( 0.00%) && !span_contains_cfg(cx, expr.span) 2,070,680 ( 0.17%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/attrs.rs:clippy_utils::attrs::span_contains_cfg (1x) . { . return members . .iter() . .try_fold(Vec::new(), |mut acc, member| { 2 ( 0.00%) if let ExprKind::Lit(lit) = member.kind 2 ( 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 ---------------------------------------- 262,155 ( 0.02%) -------------------------------------------------------------------------------- -- 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 262,152 ( 0.02%) if let ExprKind::Call(..) | ExprKind::MethodCall(..) = expr.kind . && let child_ty = cx.typeck_results().expr_ty(expr) . && 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) => . { -- line 70 ---------------------------------------- -- line 110 ---------------------------------------- . .. . }) => { . // Immediately dropped. E.g. `std::process::Command::new("echo").spawn().unwrap();` . check(cx, expr, Cause::NeverWait, true); . }, . _ => {}, . } . } 524,304 ( 0.04%) } . } . . 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 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 524,304 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 131,076 ( 0.01%) if expr.span.from_expansion() { . return; . } . if let Some(higher::If { cond, then, r#else: None }) = higher::If::hir(expr) . . // Check if the conditional expression is a binary operation . && let ExprKind::Binary(ref cond_op, cond_left, cond_right) = cond.kind . { . check_with_condition(cx, expr, cond_op.node, cond_left, cond_right, then, self.msrv); -- line 107 ---------------------------------------- -- line 111 ---------------------------------------- . r#else: Some(else_block), . }) = higher::If::hir(expr) . && let ExprKind::Binary(ref cond_op, cond_left, cond_right) = cond.kind . { . check_manual_check( . cx, expr, cond_op, cond_left, cond_right, if_block, else_block, self.msrv, . ); . } 524,304 ( 0.04%) } . } . . #[expect(clippy::too_many_arguments)] . fn check_manual_check<'tcx>( . cx: &LateContext<'tcx>, . expr: &Expr<'tcx>, . condition: &BinOp, . left_hand: &Expr<'tcx>, -- line 127 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::Call(path, [arg]) = expr.kind . && let ExprKind::Path(ref qpath) = path.kind . && let Some(def_id) = cx.qpath_res(qpath, path.hir_id).opt_def_id() . && let Some(fn_name) = cx.tcx.get_diagnostic_name(def_id) . { . let arg_ty = cx.typeck_results().expr_ty(arg); . let is_copy = is_copy(cx, arg_ty); . let drop_is_single_call_in_arm = is_single_call_in_arm(cx, arg, expr); . let (lint, msg, note_span) = match fn_name { -- line 90 ---------------------------------------- -- 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); . } . }); . } 524,304 ( 0.04%) } . } . . // 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 { -- line 143 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) { 131,076 ( 0.01%) if let hir::ExprKind::MethodCall(is_some_path, to_digit_expr, [], _) = &expr.kind . && is_some_path.ident.name == sym::is_some . { . let match_result = match to_digit_expr.kind { . hir::ExprKind::MethodCall(to_digits_path, char_arg, [radix_arg], _) => { . if to_digits_path.ident.name == sym::to_digit . && cx.typeck_results().expr_ty_adjusted(char_arg).is_char() . { . Some((true, char_arg, radix_arg)) -- line 60 ---------------------------------------- -- line 89 ---------------------------------------- . format!("{char_arg_snip}.is_digit({radix_snip})") . } else { . format!("char::is_digit({char_arg_snip}, {radix_snip})") . }, . applicability, . ); . } . } 524,304 ( 0.04%) } . } -------------------------------------------------------------------------------- -- 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &Expr<'tcx>) { . // `&[foo.clone()]` expressions 131,076 ( 0.01%) if let ExprKind::AddrOf(_, mutability, arr) = &expr.kind . // mutable references would have a different meaning . && mutability.is_not() . . // check for single item arrays . && let ExprKind::Array([item]) = &arr.kind . . // check for clones . && let ExprKind::MethodCall(path, recv, _, _) = item.kind -- line 76 ---------------------------------------- -- 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, . ); . } 524,304 ( 0.04%) } . } . . /// 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/misc.rs -------------------------------------------------------------------------------- Ir -- line 119 ---------------------------------------- . 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); . }, . ); . } . } . 589,842 ( 0.05%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 196,614 ( 0.02%) if expr.span.in_external_macro(cx.sess().source_map()) 196,614 ( 0.02%) || expr.span.desugaring_kind().is_some() 6,291,646 ( 0.51%) => ???:::desugaring_kind (65,538x) 524,304 ( 0.04%) || in_automatically_derived(cx.tcx, expr.hir_id) 20,906,622 ( 1.69%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::in_automatically_derived (65,538x) . { . return; . } . . used_underscore_binding(cx, expr); . used_underscore_items(cx, expr); 524,304 ( 0.04%) } . } . . fn used_underscore_items<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 458,766 ( 0.04%) let (def_id, ident) = match expr.kind { . ExprKind::Call(func, ..) => { . 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; -- line 149 ---------------------------------------- -- 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<'_>) { 393,228 ( 0.03%) let (definition_hir_id, ident) = match expr.kind { . ExprKind::Path(ref qpath) => { . if let QPath::Resolved(None, path) = qpath . && let Res::Local(id) = path.res . && is_used(cx, expr) . { . (id, last_path_segment(qpath).ident) . } else { . return; -- line 200 ---------------------------------------- 131,076 ( 0.01%) -------------------------------------------------------------------------------- -- 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; . 720,918 ( 0.06%) 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 262,149 ( 0.02%) if is_child_of_cast(cx, expr) { . return; . } . 65,538 ( 0.01%) if let Some(CastChainInfo { . left_cast, . start_ty, . end_ty, 327,690 ( 0.03%) }) = expr_cast_chain_tys(cx, expr) 1,572,915 ( 0.13%) => site/frontend/rust-clippy/clippy_lints/src/casts/cast_slice_different_sizes.rs:clippy_lints::casts::cast_slice_different_sizes::expr_cast_chain_tys (65,538x) . && 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, . ); . }, . ); . } . } 524,304 ( 0.04%) } . . fn is_child_of_cast(cx: &LateContext<'_>, expr: &Expr<'_>) -> bool { 131,076 ( 0.01%) let parent = cx.tcx.parent_hir_node(expr.hir_id); 7,078,104 ( 0.57%) => ???:::parent_hir_node (65,538x) 327,690 ( 0.03%) let expr = match parent { . Node::Block(block) => { . if let Some(parent_expr) = block.expr { . parent_expr . } else { . return false; . } . }, 131,070 ( 0.01%) Node::Expr(expr) => expr, . _ => return false, . }; . 65,535 ( 0.01%) 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> { . match ty.kind() { . ty::RawPtr(slice_ty, mutbl) => match slice_ty.kind() { . ty::Slice(ty) => Some(TypeAndMut { ty: *ty, mutbl: *mutbl }), -- line 90 ---------------------------------------- -- 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 524,304 ( 0.04%) fn expr_cast_chain_tys<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'tcx>) -> Option> { 65,538 ( 0.01%) if let ExprKind::Cast(cast_expr, _cast_to_hir_ty) = expr.peel_blocks().kind { . let cast_to = cx.typeck_results().expr_ty(expr); . let to_slice_ty = get_raw_slice_ty_mut(cast_to)?; . . // If the expression that makes up the source of this cast is itself a cast, recursively . // call `expr_cast_chain_tys` and update the end type with the final target type. . // Otherwise, this cast is not immediately nested, just construct the info for this cast . if let Some(prev_info) = expr_cast_chain_tys(cx, cast_expr) { . Some(CastChainInfo { -- line 119 ---------------------------------------- -- line 125 ---------------------------------------- . let from_slice_ty = get_raw_slice_ty_mut(cast_from)?; . Some(CastChainInfo { . left_cast: cast_expr, . start_ty: from_slice_ty, . end_ty: to_slice_ty, . }) . } . } else { 65,538 ( 0.01%) None . } 524,304 ( 0.04%) } 196,614 ( 0.02%) -------------------------------------------------------------------------------- -- 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) { 131,074 ( 0.01%) if let ExprKind::Struct(ref se) = expr.kind . && self.msrv.meets(msrvs::FIELD_INIT_SHORTHAND) . { . for field in &se.fields { . if !field.is_shorthand . && let ExprKind::Path(None, path) = &field.expr.kind . && let [segment] = path.segments.as_slice() . && segment.args.is_none() . && segment.ident == field.ident -- line 60 ---------------------------------------- -- line 68 ---------------------------------------- . "redundant field names in struct initialization", . "replace it with", . field.ident.to_string(), . Applicability::MachineApplicable, . ); . } . } . } 65,537 ( 0.01%) } . . extract_msrv_attr!(); . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/bit_width.rs -------------------------------------------------------------------------------- Ir -- line 93 ---------------------------------------- . . impl ManualBitWidth { . pub fn new(conf: &Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl LateLintPass<'_> for ManualBitWidth { 655,380 ( 0.05%) fn check_expr<'tcx>(&mut self, cx: &LateContext<'tcx>, expr: &Expr<'tcx>) { 196,614 ( 0.02%) if expr.span.in_external_macro(cx.sess().source_map()) { . return; . } . 131,076 ( 0.01%) match expr.kind { . // `T::BITS - n.leading_zeros()` . ExprKind::Binary(op, left, right) . if op.node == BinOpKind::Sub . && let ExprKind::MethodCall(leading_zeros, recv, [], _) = right.kind . && leading_zeros.ident.name == sym::leading_zeros . && let ExprKind::Path(QPath::TypeRelative(hir_ty, segment)) = left.kind . && segment.ident.name == sym::BITS . && let right_ty = cx.typeck_results().expr_ty(recv) -- line 114 ---------------------------------------- -- line 124 ---------------------------------------- . emit_manual_bit_width(cx, recv, expr, right_int_kind); . } else { . // mismatched calling types . emit_type_mismatch(cx, recv, expr, right_int_kind); . } . }, . _ => {}, . } 524,304 ( 0.04%) } . } . . fn get_int_kind<'a>(cx: &LateContext<'a>, ty: Ty<'a>) -> Option> { . match ty.kind() { . // int::BITS or uint::BITS . ty::Int(int_ty) => Some(IntKind::Int(*int_ty)), . ty::Uint(uint_ty) => Some(IntKind::Uint(*uint_ty)), . // NonZero::::BITS -- line 140 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: 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>) { 196,614 ( 0.02%) if cx.tcx.sess.edition() >= Edition2024 { . return; . } . 65,538 ( 0.01%) if let Some(higher::IfLet { . let_expr, . if_then, . if_else: Some(if_else), . .. 131,076 ( 0.01%) }) = higher::IfLet::hir(cx, expr) 327,690 ( 0.03%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (65,538x) . && let ctxt = expr.span.ctxt() . && let Some(op_mutex) = for_each_expr_without_closures(let_expr, |e| mutex_lock_call(cx, ctxt, e, None)) . && let Some(arm_mutex) = . for_each_expr_without_closures((if_then, if_else), |e| mutex_lock_call(cx, ctxt, e, Some(op_mutex))) . { . let diag = |diag: &mut Diag<'_, ()>| { . diag.span_label( . op_mutex.span, -- line 72 ---------------------------------------- -- line 81 ---------------------------------------- . span_lint_and_then( . cx, . IF_LET_MUTEX, . expr.span, . "calling `Mutex::lock` inside the scope of another `Mutex::lock` causes a deadlock", . diag, . ); . } 65,538 ( 0.01%) } . } . . fn mutex_lock_call<'tcx>( . cx: &LateContext<'tcx>, . ctxt: SyntaxContext, . expr: &'tcx Expr<'_>, . op_mutex: Option<&'tcx Expr<'_>>, . ) -> ControlFlow<&'tcx Expr<'tcx>> { -- line 97 ---------------------------------------- 1,114,146 ( 0.09%) -------------------------------------------------------------------------------- -- 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%) } . 524,432 ( 0.04%) fn check(&mut self, cx: &LateContext<'_>, span: Span, derive_src: Option) { 65,554 ( 0.01%) 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); . } . } . } 524,432 ( 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 { 5 ( 0.00%) self.check(cx, *span, None); 18 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (1x) . } . } 7 ( 0.00%) } . . fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 327,690 ( 0.03%) self.check(cx, expr.span, None); 1,179,684 ( 0.10%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (65,538x) . // `$t + $t` can have the context of $t, check also the span of the binary operator 131,076 ( 0.01%) if let ExprKind::Binary(op, ..) = expr.kind { . self.check(cx, op.span, None); . } . } . . fn check_stmt(&mut self, cx: &LateContext<'_>, stmt: &Stmt<'_>) { . self.check(cx, stmt.span, None); . } . . fn check_ty(&mut self, cx: &LateContext<'_>, ty: &Ty<'_, AmbigArg>) { 12 ( 0.00%) self.check(cx, ty.span, None); 54 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (3x) . } . . fn check_pat(&mut self, cx: &LateContext<'_>, pat: &Pat<'_>) { . self.check(cx, pat.span, None); . } . 40 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'_>, item: &Item<'_>) { 16 ( 0.00%) self.check(cx, item.span, self.derive_src); 72 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (4x) 20 ( 0.00%) self.check(cx, item.vis_span, None); 72 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (4x) . 12 ( 0.00%) if matches!( 4 ( 0.00%) item.kind, . ItemKind::Struct(..) | ItemKind::Enum(..) | ItemKind::Union(..) . ) && macro_backtrace(item.span).all(|m| !matches!(m.kind, MacroKind::Derive)) . { . self.derive_src = Some(item.owner_id); . } 32 ( 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<'_>) { . self.check(cx, item.span, None); -- line 179 ---------------------------------------- -- line 182 ---------------------------------------- . } . } . . fn check_trait_item(&mut self, cx: &LateContext<'_>, item: &TraitItem<'_>) { . self.check(cx, item.span, None); . } . . fn check_path(&mut self, cx: &LateContext<'_>, path: &Path<'_>, _: HirId) { 16 ( 0.00%) self.check(cx, path.span, None); 72 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check (4x) . } . } -------------------------------------------------------------------------------- -- 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::Call(path_expr, [arg]) = e.kind . && let ExprKind::Path(QPath::Resolved(None, path)) = path_expr.kind . && let Some(def_id) = path.res.opt_def_id() . && cx.tcx.is_diagnostic_item(sym::transmute, def_id) . { . // 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) -- line 535 ---------------------------------------- -- 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); . } . } 524,304 ( 0.04%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_hir/src/intravisit.rs -------------------------------------------------------------------------------- Ir -- line 81 ---------------------------------------- . Method(Ident, &'a FnSig<'a>), . . /// `|x, y| {}` . Closure, . } . . impl<'a> FnKind<'a> { . pub fn header(&self) -> Option<&FnHeader> { 6 ( 0.00%) match *self { 3 ( 0.00%) FnKind::ItemFn(_, _, ref header) => Some(header), . FnKind::Method(_, ref sig) => Some(&sig.header), . FnKind::Closure => None, . } . } . . pub fn constness(self) -> Constness { . self.header().map_or(Constness::NotConst, |header| header.constness) . } -- line 98 ---------------------------------------- -- line 274 ---------------------------------------- . Self::Result::output() . } . . /// Invoked to visit the body of a function, method or closure. Like . /// `visit_nested_item`, does nothing by default unless you override . /// `Self::NestedFilter`. . fn visit_nested_body(&mut self, id: BodyId) -> Self::Result { . if Self::NestedFilter::INTRA { 7 ( 0.00%) let body = self.maybe_tcx().hir_body(id); 62 ( 0.00%) => ???:::hir_body (1x) . try_visit!(self.visit_body(body)); . } . Self::Result::output() . } . . fn visit_param(&mut self, param: &'v Param<'v>) -> Self::Result { . walk_param(self, param) . } -- line 290 ---------------------------------------- -- line 315 ---------------------------------------- . } . fn visit_foreign_item(&mut self, i: &'v ForeignItem<'v>) -> Self::Result { . walk_foreign_item(self, i) . } . fn visit_local(&mut self, l: &'v LetStmt<'v>) -> Self::Result { . walk_local(self, l) . } . fn visit_block(&mut self, b: &'v Block<'v>) -> Self::Result { 30 ( 0.00%) walk_block(self, b) 24 ( 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:: (1x) . } . fn visit_stmt(&mut self, s: &'v Stmt<'v>) -> Self::Result { . walk_stmt(self, s) . } . fn visit_arm(&mut self, a: &'v Arm<'v>) -> Self::Result { . walk_arm(self, a) . } . fn visit_pat(&mut self, p: &'v Pat<'v>) -> Self::Result { -- line 331 ---------------------------------------- -- line 363 ---------------------------------------- . walk_const_item_rhs(self, c) . } . . /// All consts are treated as ambiguous consts for the purposes of hir visiting in . /// order to ensure that visitors can handle infer vars without it being too error-prone. . /// . /// The [`Visitor::visit_infer`] method should be overridden in order to handle infer vars. . fn visit_const_arg(&mut self, c: &'v ConstArg<'v, AmbigArg>) -> Self::Result { 1 ( 0.00%) walk_const_arg(self, c) . } . . #[allow(unused_variables)] . fn visit_infer(&mut self, inf_id: HirId, inf_span: Span, kind: InferKind<'v>) -> Self::Result { . self.visit_id(inf_id) . } . . fn visit_lifetime(&mut self, lifetime: &'v Lifetime) -> Self::Result { . walk_lifetime(self, lifetime) . } . . fn visit_expr(&mut self, ex: &'v Expr<'v>) -> Self::Result { 1 ( 0.00%) walk_expr(self, ex) 34 ( 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) . } . fn visit_expr_field(&mut self, field: &'v ExprField<'v>) -> Self::Result { . walk_expr_field(self, field) . } . fn visit_const_arg_expr_field(&mut self, field: &'v ConstArgExprField<'v>) -> Self::Result { . walk_const_arg_expr_field(self, field) . } . fn visit_pattern_type_pattern(&mut self, p: &'v TyPat<'v>) -> Self::Result { -- line 392 ---------------------------------------- -- line 394 ---------------------------------------- . } . fn visit_generic_param(&mut self, p: &'v GenericParam<'v>) -> Self::Result { . walk_generic_param(self, p) . } . fn visit_const_param_default(&mut self, _param: HirId, ct: &'v ConstArg<'v>) -> Self::Result { . walk_const_param_default(self, ct) . } . fn visit_generics(&mut self, g: &'v Generics<'v>) -> Self::Result { 2 ( 0.00%) walk_generics(self, g) 24 ( 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:: (1x) . } . fn visit_where_predicate(&mut self, predicate: &'v WherePredicate<'v>) -> Self::Result { . walk_where_predicate(self, predicate) . } . fn visit_fn_ret_ty(&mut self, ret_ty: &'v FnRetTy<'v>) -> Self::Result { . walk_fn_ret_ty(self, ret_ty) . } . fn visit_fn_decl(&mut self, fd: &'v FnDecl<'v>) -> Self::Result { -- line 410 ---------------------------------------- -- line 465 ---------------------------------------- . fn visit_variant(&mut self, v: &'v Variant<'v>) -> Self::Result { . walk_variant(self, v) . } . fn visit_label(&mut self, label: &'v Label) -> Self::Result { . walk_label(self, label) . } . // The span is that of the surrounding type/pattern/expr/whatever. . fn visit_qpath(&mut self, qpath: &'v QPath<'v>, id: HirId, _span: Span) -> Self::Result { 9 ( 0.00%) walk_qpath(self, qpath, id) 41 ( 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:: (1x) . } . fn visit_path(&mut self, path: &Path<'v>, _id: HirId) -> Self::Result { . walk_path(self, path) . } . fn visit_path_segment(&mut self, path_segment: &'v PathSegment<'v>) -> Self::Result { . walk_path_segment(self, path_segment) . } . fn visit_generic_args(&mut self, generic_args: &'v GenericArgs<'v>) -> Self::Result { -- line 481 ---------------------------------------- -- line 632 ---------------------------------------- . walk_list!(visitor, visit_param_bound, bounds); . } . } . V::Result::output() . } . . pub fn walk_body<'v, V: Visitor<'v>>(visitor: &mut V, body: &Body<'v>) -> V::Result { . let Body { params, value } = body; 4 ( 0.00%) walk_list!(visitor, visit_param, *params); 9 ( 0.00%) visitor.visit_expr(*value) 58 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/unwrap.rs:::visit_expr (1x) . } . . pub fn walk_ident<'v, V: Visitor<'v>>(visitor: &mut V, ident: Ident) -> V::Result { . visitor.visit_name(ident.name) . } . . pub fn walk_mod<'v, V: Visitor<'v>>(visitor: &mut V, module: &'v Mod<'v>) -> V::Result { . let Mod { spans: _, item_ids } = module; -- line 649 ---------------------------------------- -- line 682 ---------------------------------------- . visit_opt!(visitor, visit_expr, *init); . try_visit!(visitor.visit_id(*hir_id)); . try_visit!(visitor.visit_pat(*pat)); . visit_opt!(visitor, visit_block, *els); . visit_opt!(visitor, visit_ty_unambig, *ty); . V::Result::output() . } . 25 ( 0.00%) pub fn walk_block<'v, V: Visitor<'v>>(visitor: &mut V, block: &'v Block<'v>) -> V::Result { . let Block { stmts, expr, hir_id, rules: _, span: _, targeted_by_break: _ } = block; . try_visit!(visitor.visit_id(*hir_id)); 5 ( 0.00%) walk_list!(visitor, visit_stmt, *stmts); 14 ( 0.00%) visit_opt!(visitor, visit_expr, *expr); . V::Result::output() 22 ( 0.00%) } . . pub fn walk_stmt<'v, V: Visitor<'v>>(visitor: &mut V, statement: &'v Stmt<'v>) -> V::Result { . let Stmt { kind, hir_id, span: _ } = statement; . try_visit!(visitor.visit_id(*hir_id)); . match *kind { . StmtKind::Let(ref local) => visitor.visit_local(local), . StmtKind::Item(item) => visitor.visit_nested_item(item), . StmtKind::Expr(ref expression) | StmtKind::Semi(ref expression) => { -- line 704 ---------------------------------------- -- line 799 ---------------------------------------- . visitor: &mut V, . constant: &'v ConstBlock, . ) -> V::Result { . let ConstBlock { hir_id, def_id: _, body } = constant; . try_visit!(visitor.visit_id(*hir_id)); . visitor.visit_nested_body(*body) . } . 1,310,788 ( 0.11%) pub fn walk_expr<'v, V: Visitor<'v>>(visitor: &mut V, expression: &'v Expr<'v>) -> V::Result { . let Expr { hir_id, kind, span } = expression; 131,078 ( 0.01%) try_visit!(visitor.visit_id(*hir_id)); 589,858 ( 0.05%) match *kind { 2 ( 0.00%) ExprKind::Array(subexpressions) => { 393,211 ( 0.03%) walk_list!(visitor, visit_expr, subexpressions); 3,932,100 ( 0.32%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/macro_metavars_in_unsafe.rs:::visit_expr'2 (65,535x) . } . ExprKind::ConstBlock(ref const_block) => { . try_visit!(visitor.visit_inline_const(const_block)) . } . ExprKind::Repeat(ref element, ref count) => { . try_visit!(visitor.visit_expr(element)); . try_visit!(visitor.visit_const_arg_unambig(count)); . } -- line 820 ---------------------------------------- -- line 889 ---------------------------------------- . constness: _, . explicit_captures: _, . }) => { . walk_list!(visitor, visit_generic_param, bound_generic_params); . try_visit!(visitor.visit_fn(FnKind::Closure, fn_decl, body, *span, def_id)); . } . ExprKind::Block(ref block, ref opt_label) => { . visit_opt!(visitor, visit_label, opt_label); 5 ( 0.00%) try_visit!(visitor.visit_block(block)); . } . ExprKind::Assign(ref lhs, ref rhs, _) => { . try_visit!(visitor.visit_expr(rhs)); . try_visit!(visitor.visit_expr(lhs)); . } . ExprKind::AssignOp(_, ref left_expression, ref right_expression) => { . try_visit!(visitor.visit_expr(right_expression)); . try_visit!(visitor.visit_expr(left_expression)); -- line 905 ---------------------------------------- -- line 939 ---------------------------------------- . ExprKind::UnsafeBinderCast(_kind, expr, ty) => { . try_visit!(visitor.visit_expr(expr)); . visit_opt!(visitor, visit_ty_unambig, ty); . } . ExprKind::Lit(lit) => try_visit!(visitor.visit_lit(*hir_id, lit, false)), . ExprKind::Err(_) => {} . } . V::Result::output() 1,048,609 ( 0.08%) } . . pub fn walk_expr_field<'v, V: Visitor<'v>>(visitor: &mut V, field: &'v ExprField<'v>) -> V::Result { . let ExprField { hir_id, ident, expr, span: _, is_shorthand: _ } = field; . try_visit!(visitor.visit_id(*hir_id)); . try_visit!(visitor.visit_ident(*ident)); . visitor.visit_expr(*expr) . } . -- line 955 ---------------------------------------- -- line 983 ---------------------------------------- . let InferArg { hir_id, span } = inf; . visitor.visit_infer(*hir_id, *span, InferKind::Ambig(inf)) . } . } . } . . pub fn walk_unambig_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty<'v>) -> V::Result { . match typ.try_as_ambig_ty() { 6 ( 0.00%) Some(ambig_ty) => visitor.visit_ty(ambig_ty), 142 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/types/type_complexity.rs:::visit_ty'2 (1x) . None => { . let Ty { hir_id, span, kind: _ } = typ; . visitor.visit_infer(*hir_id, *span, InferKind::Ty(typ)) . } . } . } . 24 ( 0.00%) pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty<'v, AmbigArg>) -> V::Result { . let Ty { hir_id, span: _, kind } = typ; . try_visit!(visitor.visit_id(*hir_id)); . 15 ( 0.00%) match *kind { . TyKind::Slice(ref ty) => try_visit!(visitor.visit_ty_unambig(ty)), . TyKind::Ptr(ref mutable_type) => try_visit!(visitor.visit_ty_unambig(mutable_type.ty)), . TyKind::Ref(ref lifetime, ref mutable_type) => { . try_visit!(visitor.visit_lifetime(lifetime)); 1 ( 0.00%) try_visit!(visitor.visit_ty_unambig(mutable_type.ty)); . } . TyKind::Never => {} . TyKind::Tup(tuple_element_types) => { . walk_list!(visitor, visit_ty_unambig, tuple_element_types); . } . TyKind::FnPtr(ref function_declaration) => { . walk_list!(visitor, visit_generic_param, function_declaration.generic_params); . try_visit!(visitor.visit_fn_decl(function_declaration.decl)); . } . TyKind::UnsafeBinder(ref unsafe_binder) => { . walk_list!(visitor, visit_generic_param, unsafe_binder.generic_params); . try_visit!(visitor.visit_ty_unambig(unsafe_binder.inner_ty)); . } 1 ( 0.00%) TyKind::Path(ref qpath) => { . try_visit!(visitor.visit_qpath(qpath, typ.hir_id, typ.span)); . } . TyKind::OpaqueDef(opaque) => { . try_visit!(visitor.visit_opaque_ty(opaque)); . } . TyKind::TraitAscription(bounds) => { . walk_list!(visitor, visit_param_bound, bounds); . } . TyKind::Array(ref ty, ref length) => { 1 ( 0.00%) try_visit!(visitor.visit_ty_unambig(ty)); 1 ( 0.00%) try_visit!(visitor.visit_const_arg_unambig(length)); . } . TyKind::TraitObject(bounds, ref lifetime) => { . for bound in bounds { . try_visit!(visitor.visit_poly_trait_ref(bound)); . } . try_visit!(visitor.visit_lifetime(lifetime)); . } . TyKind::InferDelegation(..) | TyKind::Err(_) => {} -- line 1041 ---------------------------------------- -- line 1076 ---------------------------------------- . Some(ambig_ct) => visitor.visit_const_arg(ambig_ct), . None => { . let ConstArg { hir_id, kind: _, span } = const_arg; . visitor.visit_infer(*hir_id, *span, InferKind::Const(const_arg)) . } . } . } . 6 ( 0.00%) pub fn walk_const_arg<'v, V: Visitor<'v>>( . visitor: &mut V, . const_arg: &'v ConstArg<'v, AmbigArg>, . ) -> V::Result { . let ConstArg { hir_id, kind, span: _ } = const_arg; . try_visit!(visitor.visit_id(*hir_id)); 5 ( 0.00%) match kind { . ConstArgKind::Tup(exprs) => { . walk_list!(visitor, visit_const_arg_unambig, *exprs); . V::Result::output() . } . ConstArgKind::Struct(qpath, field_exprs) => { . try_visit!(visitor.visit_qpath(qpath, *hir_id, qpath.span())); . . for field_expr in *field_exprs { -- line 1098 ---------------------------------------- -- line 1114 ---------------------------------------- . } . V::Result::output() . } . ConstArgKind::Path(qpath) => visitor.visit_qpath(qpath, *hir_id, qpath.span()), . ConstArgKind::Anon(anon) => visitor.visit_anon_const(*anon), . ConstArgKind::Error(_) => V::Result::output(), // errors and spans are not important . ConstArgKind::Literal { .. } => V::Result::output(), // FIXME(mcga) . } 6 ( 0.00%) } . . pub fn walk_generic_param<'v, V: Visitor<'v>>( . visitor: &mut V, . param: &'v GenericParam<'v>, . ) -> V::Result { . let GenericParam { . hir_id, . def_id: _, -- line 1130 ---------------------------------------- -- line 1157 ---------------------------------------- . . pub fn walk_const_param_default<'v, V: Visitor<'v>>( . visitor: &mut V, . ct: &'v ConstArg<'v>, . ) -> V::Result { . visitor.visit_const_arg_unambig(ct) . } . 18 ( 0.00%) pub fn walk_generics<'v, V: Visitor<'v>>(visitor: &mut V, generics: &'v Generics<'v>) -> V::Result { . let &Generics { 2 ( 0.00%) params, 4 ( 0.00%) predicates, . has_where_clause_predicates: _, . where_clause_span: _, . span: _, . } = generics; . walk_list!(visitor, visit_generic_param, params); . walk_list!(visitor, visit_where_predicate, predicates); . V::Result::output() 16 ( 0.00%) } . . pub fn walk_where_predicate<'v, V: Visitor<'v>>( . visitor: &mut V, . predicate: &'v WherePredicate<'v>, . ) -> V::Result { . let &WherePredicate { hir_id, kind, span: _ } = predicate; . try_visit!(visitor.visit_id(hir_id)); . match *kind { -- line 1184 ---------------------------------------- -- line 1204 ---------------------------------------- . V::Result::output() . } . . pub fn walk_fn_decl<'v, V: Visitor<'v>>( . visitor: &mut V, . function_declaration: &'v FnDecl<'v>, . ) -> V::Result { . let FnDecl { inputs, output, fn_decl_kind: _ } = function_declaration; 2 ( 0.00%) walk_list!(visitor, visit_ty_unambig, *inputs); . visitor.visit_fn_ret_ty(output) . } . . pub fn walk_fn_ret_ty<'v, V: Visitor<'v>>(visitor: &mut V, ret_ty: &'v FnRetTy<'v>) -> V::Result { 4 ( 0.00%) if let FnRetTy::Return(output_ty) = *ret_ty { . try_visit!(visitor.visit_ty_unambig(output_ty)); . } . V::Result::output() . } . 12 ( 0.00%) pub fn walk_fn<'v, V: Visitor<'v>>( . visitor: &mut V, . function_kind: FnKind<'v>, . function_declaration: &'v FnDecl<'v>, . body_id: BodyId, . _: LocalDefId, . ) -> V::Result { . try_visit!(visitor.visit_fn_decl(function_declaration)); 1 ( 0.00%) try_visit!(walk_fn_kind(visitor, function_kind)); . visitor.visit_nested_body(body_id) 8 ( 0.00%) } . . pub fn walk_fn_kind<'v, V: Visitor<'v>>(visitor: &mut V, function_kind: FnKind<'v>) -> V::Result { 2 ( 0.00%) match function_kind { . FnKind::ItemFn(_, generics, ..) => { . try_visit!(visitor.visit_generics(generics)); . } . FnKind::Closure | FnKind::Method(..) => {} . } . V::Result::output() . } . -- line 1244 ---------------------------------------- -- line 1450 ---------------------------------------- . } . . pub fn walk_lifetime<'v, V: Visitor<'v>>(visitor: &mut V, lifetime: &'v Lifetime) -> V::Result { . let Lifetime { hir_id, ident, kind: _, source: _, syntax: _ } = lifetime; . try_visit!(visitor.visit_id(*hir_id)); . visitor.visit_ident(*ident) . } . 9 ( 0.00%) pub fn walk_qpath<'v, V: Visitor<'v>>( . visitor: &mut V, . qpath: &'v QPath<'v>, . id: HirId, . ) -> V::Result { 2 ( 0.00%) match *qpath { . QPath::Resolved(ref maybe_qself, ref path) => { 2 ( 0.00%) visit_opt!(visitor, visit_ty_unambig, maybe_qself); 1 ( 0.00%) visitor.visit_path(path, id) . } . QPath::TypeRelative(ref qself, ref segment) => { . try_visit!(visitor.visit_ty_unambig(qself)); . visitor.visit_path_segment(segment) . } . } 8 ( 0.00%) } . . pub fn walk_path<'v, V: Visitor<'v>>(visitor: &mut V, path: &Path<'v>) -> V::Result { . let Path { segments, span: _, res: _ } = path; 1 ( 0.00%) walk_list!(visitor, visit_path_segment, *segments); . V::Result::output() . } . . pub fn walk_path_segment<'v, V: Visitor<'v>>( . visitor: &mut V, . segment: &'v PathSegment<'v>, . ) -> V::Result { . let PathSegment { ident, hir_id, res: _, args, infer_args: _, delegation_child_segment: _ } = . segment; . try_visit!(visitor.visit_ident(*ident)); . try_visit!(visitor.visit_id(*hir_id)); 3 ( 0.00%) visit_opt!(visitor, visit_generic_args, *args); . V::Result::output() . } . . pub fn walk_generic_args<'v, V: Visitor<'v>>( . visitor: &mut V, . generic_args: &'v GenericArgs<'v>, . ) -> V::Result { . let GenericArgs { args, constraints, parenthesized: _, span_ext: _ } = generic_args; -- line 1497 ---------------------------------------- 131,098 ( 0.01%) -------------------------------------------------------------------------------- -- 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::Struct(path, fields @ [field, ..], StructTailExpr::None) = e.kind . // If the first character of any field is a digit it has to be a tuple. . && field.ident.as_str().as_bytes().first().is_some_and(u8::is_ascii_digit) . // Type aliases can't be used as functions. . && !matches!( . cx.qpath_res(path, e.hir_id), . Res::Def(DefKind::TyAlias | DefKind::AssocTy, _) . ) . // This is the only syntax macros can use that works for all struct types. -- line 54 ---------------------------------------- -- line 89 ---------------------------------------- . .intersperse(Cow::Borrowed(", ")) . .collect::() . ), . app, . ); . }, . ); . } 458,766 ( 0.04%) } . } -------------------------------------------------------------------------------- -- 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); 54 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_no_std_crate (1x) . } . 262,152 ( 0.02%) fn check_expr_post(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 262,152 ( 0.02%) 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", . ); . } 327,690 ( 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_lint/src/levels.rs -------------------------------------------------------------------------------- Ir -- line 482 ---------------------------------------- . } . } . . impl<'s, P: LintLevelsProvider> LintLevelsBuilder<'s, P> . where . LevelSpec: Into, . { . pub(crate) fn sess(&self) -> &Session { 196,633 ( 0.02%) 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 { 105 ( 0.00%) self.provider.get_lint_level_spec(lint, self.sess) 202 ( 0.00%) => ???:::get_lint_level_spec (1x) . } . . /// Used to emit a lint-related diagnostic based on the current state of . /// this lint context. . #[track_caller] . pub(crate) fn opt_span_lint( . &self, . lint: &'static Lint, . span: Option, . decorator: impl for<'a> Diagnostic<'a, ()>, . ) { . let level_spec = self.lint_level_spec(lint); 1 ( 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 ---------------------------------------- 28 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/unit_return_expecting_ord.rs -------------------------------------------------------------------------------- Ir -- line 153 ---------------------------------------- . Some((fn_decl_span, None)) . } . } else { . None . } . } . . impl<'tcx> LateLintPass<'tcx> for UnitReturnExpectingOrd { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 131,076 ( 0.01%) if let ExprKind::MethodCall(_, receiver, args, _) = expr.kind . && args.iter().any(|arg| { . matches!( . arg.peel_blocks().peel_borrows().peel_drop_temps().kind, . ExprKind::Path(_) | ExprKind::Closure(_) . ) . }) . && let Some(fn_mut_trait) = cx.tcx.lang_items().fn_mut_trait() . { -- line 170 ---------------------------------------- -- line 190 ---------------------------------------- . if let Some(last_semi) = last_semi { . diag.span_help(last_semi, "probably caused by this trailing semicolon"); . } . }, . ); . } . } . } 524,304 ( 0.04%) } . } -------------------------------------------------------------------------------- -- 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 { 524,304 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { . // Skip expanded code, as we have no control over it anyway... 131,076 ( 0.01%) if e.span.from_expansion() { . return; . } . . // If the expression is of type `Option` . let is_ty_option = |expr: &Expr<'_>| { . cx.typeck_results() . .expr_ty(expr) . .peel_refs() . .is_diag_item(cx, sym::Option) . }; . . // If the expression is a literal `Option::None` . let is_none_ctor = . |expr: &Expr<'_>| !expr.span.from_expansion() && is_none_expr(cx, peel_hir_expr_refs(expr).0); . 65,538 ( 0.01%) let mut applicability = Applicability::MachineApplicable; . 131,076 ( 0.01%) if let ExprKind::Binary(op, left_side, right_side) = e.kind { . // All other comparisons (e.g. `>= None`) have special meaning wrt T . 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` -- line 72 ---------------------------------------- -- line 97 ---------------------------------------- . "use `Option::is_none()` instead" . } else { . "use `Option::is_some()` instead" . }, . sugg, . applicability, . ); . } 524,304 ( 0.04%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/reserve_after_initialization.rs -------------------------------------------------------------------------------- Ir -- line 29 ---------------------------------------- . #[clippy::version = "1.74.0"] . pub RESERVE_AFTER_INITIALIZATION, . complexity, . "`reserve` called immediately after `Vec` creation" . } . . impl_lint_pass!(ReserveAfterInitialization => [RESERVE_AFTER_INITIALIZATION]); . 1 ( 0.00%) #[derive(Default)] . pub struct ReserveAfterInitialization { . searcher: Option, . } . . struct VecReserveSearcher { . local_id: HirId, . err_span: Span, . init_part: String, -- line 45 ---------------------------------------- -- line 62 ---------------------------------------- . s, . Applicability::HasPlaceholders, . ); . } . } . . impl<'tcx> LateLintPass<'tcx> for ReserveAfterInitialization { . fn check_block(&mut self, _: &LateContext<'tcx>, _: &'tcx Block<'tcx>) { 1 ( 0.00%) self.searcher = None; . } . . fn check_local(&mut self, cx: &LateContext<'tcx>, local: &'tcx LetStmt<'tcx>) { . if let Some(init_expr) = local.init . && let PatKind::Binding(BindingMode::MUT, id, _, None) = local.pat.kind . && !local.span.in_external_macro(cx.sess().source_map()) . && let Some(init) = get_vec_init_kind(cx, init_expr) . && !matches!( -- line 78 ---------------------------------------- -- line 92 ---------------------------------------- . "..", . ) . .into_owned(), . space_hint: String::new(), . }); . } . } . 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 196,614 ( 0.02%) if self.searcher.is_none() . && let ExprKind::Assign(left, right, _) = expr.kind . && let ExprKind::Path(QPath::Resolved(None, path)) = left.kind . && let Res::Local(id) = path.res . && !expr.span.in_external_macro(cx.sess().source_map()) . && let Some(init) = get_vec_init_kind(cx, right) . && !matches!( . init, . VecInitKind::WithExprCapacity(_) | VecInitKind::WithConstCapacity(_) -- line 109 ---------------------------------------- -- line 116 ---------------------------------------- . cx, . left.span.shrink_to_lo().to(right.span.source_callsite().shrink_to_lo()), . "..", . ) . .into_owned(), // see `assign_expression` test . space_hint: String::new(), . }); . } 524,304 ( 0.04%) } . . fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx Stmt<'_>) { . if let Some(searcher) = self.searcher.take() { . if let StmtKind::Expr(expr) | StmtKind::Semi(expr) = stmt.kind . && let ExprKind::MethodCall(name, self_arg, [space_hint], _) = expr.kind . && self_arg.res_local_id() == Some(searcher.local_id) . && name.ident.name == sym::reserve . && !is_from_proc_macro(cx, expr) -- line 132 ---------------------------------------- -- line 137 ---------------------------------------- . ..searcher . }); . } else { . searcher.display_err(cx); . } . } . } . 4 ( 0.00%) fn check_block_post(&mut self, cx: &LateContext<'tcx>, _: &'tcx Block<'tcx>) { 2 ( 0.00%) if let Some(searcher) = self.searcher.take() { . searcher.display_err(cx); . } 4 ( 0.00%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/async_yields_async.rs -------------------------------------------------------------------------------- Ir -- line 43 ---------------------------------------- . pub ASYNC_YIELDS_ASYNC, . correctness, . "async blocks that return a type that can be awaited" . } . . declare_lint_pass!(AsyncYieldsAsync => [ASYNC_YIELDS_ASYNC]); . . impl<'tcx> LateLintPass<'tcx> for AsyncYieldsAsync { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 131,076 ( 0.01%) let ExprKind::Closure(Closure { . kind: ClosureKind::Coroutine(CoroutineKind::Desugared(CoroutineDesugaring::Async, kind)), . body: body_id, . .. . }) = expr.kind . else { . return; . }; . -- line 60 ---------------------------------------- -- line 118 ---------------------------------------- . return_expr_span, . "consider awaiting this value", . format!("{return_expr_snip}.await"), . applicability, . ); . }, . ); . } 524,304 ( 0.04%) } . } -------------------------------------------------------------------------------- -- 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` 11 ( 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>)> { 4 ( 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 . .instantiate_bound_regions_with_erased(cx.tcx.fn_sig(id).instantiate_identity().skip_norm_wip().output()); . . // for async functions, peel through `impl Future` to get `T` . if cx.tcx.ty_is_opaque_future(ty) -- line 32 ---------------------------------------- -- line 38 ---------------------------------------- . if let ty::Adt(adt_def, args) = ty.kind() . && cx.tcx.is_diagnostic_item(sym::Result, adt_def.did()) . { . let err_ty = args.type_at(1); . return Some((hir_ty, err_ty)); . } . } . None 9 ( 0.00%) } . 36 ( 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, . ) { 8 ( 0.00%) if let hir::ItemKind::Fn { ref sig, .. } = item.kind 12 ( 0.00%) && let Some((hir_ty, err_ty)) = result_err_ty(cx, sig.decl, item.owner_id.def_id, item.span) 141 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::result_err_ty (1x) . { . if cx.effective_visibilities.is_exported(item.owner_id.def_id) { . let fn_header_span = item.span.with_hi(sig.decl.output.span().hi()); . check_result_unit_err(cx, err_ty, fn_header_span, msrv); . } . check_result_large_err(cx, err_ty, hir_ty.span, large_err_threshold, large_err_ignored, false); . } 32 ( 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, . ) { -- line 72 ---------------------------------------- -- line 178 ---------------------------------------- . diag.span_label(hir_ty_span, format!("the `Err`-variant is at least {ty_size} bytes")); . diag.help(format!("try reducing the size of `{err_ty}`, for example by boxing large elements or replacing it with `Box<{err_ty}>`")); . }, . ); . } . } . } . 458,766 ( 0.04%) pub(super) fn check_expr<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx hir::Expr<'tcx>, . large_err_threshold: u64, . large_err_ignored: &DefIdSet, . ) { 131,076 ( 0.01%) if let hir::ExprKind::Closure(closure) = expr.kind . && let ty::Closure(_, args) = cx.typeck_results().expr_ty(expr).kind() . && let closure_sig = args.as_closure().sig() . && let Ok(err_binder) = closure_sig.output().try_map_bound(|output_ty| { . if let ty::Adt(adt, args) = output_ty.kind() . && let [_, err_arg] = args.as_slice() . && let Some(err_ty) = err_arg.as_type() . && adt.is_diag_item(cx, sym::Result) . { -- line 200 ---------------------------------------- -- line 206 ---------------------------------------- . { . let err_ty = cx.tcx.instantiate_bound_regions_with_erased(err_binder); . let hir_ty_span = match closure.fn_decl.output { . hir::FnRetTy::Return(hir_ty) => hir_ty.span, . hir::FnRetTy::DefaultReturn(_) => expr.span, . }; . check_result_large_err(cx, err_ty, hir_ty_span, large_err_threshold, large_err_ignored, true); . } 524,304 ( 0.04%) } 2 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_option_as_slice.rs -------------------------------------------------------------------------------- Ir -- line 48 ---------------------------------------- . . impl ManualOptionAsSlice { . pub fn new(conf: &Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl LateLintPass<'_> for ManualOptionAsSlice { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 327,690 ( 0.03%) let span = expr.span; . if span.from_expansion() { . return; . } 458,766 ( 0.04%) match expr.kind { . ExprKind::Match(scrutinee, [arm1, arm2], _) . if is_none_pattern(cx, arm2.pat) && check_arms(cx, arm2, arm1) . || is_none_pattern(cx, arm1.pat) && check_arms(cx, arm1, arm2) => . { . check_as_ref(cx, scrutinee, span, self.msrv); . }, . ExprKind::If(cond, then, Some(other)) => { . if let ExprKind::Let(let_expr) = cond.kind -- line 69 ---------------------------------------- -- line 92 ---------------------------------------- . }, . sym::map_or_else if returns_empty_slice(cx, or_else) && is_slice_from_ref(cx, map) => { . check_as_ref(cx, callee, span, self.msrv); . }, . _ => {}, . }, . _ => {}, . } 524,304 ( 0.04%) } . } . . fn check_map(cx: &LateContext<'_>, map: &Expr<'_>, span: Span, msrv: Msrv) { . if let ExprKind::MethodCall(seg, callee, [mapping], _) = map.kind . && seg.ident.name == sym::map . && is_slice_from_ref(cx, mapping) . { . check_as_ref(cx, callee, span, msrv); -- line 108 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/needless_update.rs -------------------------------------------------------------------------------- Ir -- line 44 ---------------------------------------- . pub NEEDLESS_UPDATE, . complexity, . "using `Foo { ..base }` when there are no missing fields" . } . . declare_lint_pass!(NeedlessUpdate => [NEEDLESS_UPDATE]); . . impl<'tcx> LateLintPass<'tcx> for NeedlessUpdate { 327,690 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::Struct(_, fields, StructTailExpr::Base(base)) = expr.kind { . let ty = cx.typeck_results().expr_ty(expr); . if let ty::Adt(def, _) = ty.kind() . && fields.len() == def.non_enum_variant().fields.len() . && !def.variant(0_usize.into()).is_field_list_non_exhaustive() . { . span_lint( . cx, . NEEDLESS_UPDATE, . base.span, . "struct update has no effect, all the fields in the struct have already been specified", . ); . } . } 393,228 ( 0.03%) } . } -------------------------------------------------------------------------------- -- 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 { 524,304 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 196,614 ( 0.02%) if let Some((outer_max, outer_c, oe)) = min_max(cx, expr) 1,376,298 ( 0.11%) => site/frontend/rust-clippy/clippy_lints/src/minmax.rs:clippy_lints::minmax::min_max (65,538x) . && let Some((inner_max, inner_c, ie)) = min_max(cx, oe) . && outer_max != inner_max . && let Some(ord) = Constant::partial_cmp(cx.tcx, cx.typeck_results().expr_ty(ie), &outer_c, &inner_c) . && matches!( . (outer_max, ord), . (MinMax::Max, Equal | Greater) | (MinMax::Min, Equal | Less) . ) . { . span_lint( . cx, . MIN_MAX, . expr.span, . "this `min`/`max` combination leads to constant result", . ); . } 393,228 ( 0.03%) } . } . . #[derive(PartialEq, Eq, Debug, Clone, Copy)] . enum MinMax { . Min, . Max, . } . 458,766 ( 0.04%) fn min_max<'a>(cx: &LateContext<'_>, expr: &'a Expr<'a>) -> Option<(MinMax, Constant, &'a Expr<'a>)> { 327,690 ( 0.03%) match expr.kind { . ExprKind::Call(path, args) => { . if let ExprKind::Path(ref qpath) = path.kind { . cx.typeck_results() . .qpath_res(qpath, path.hir_id) . .opt_def_id() . .and_then(|def_id| match cx.tcx.get_diagnostic_name(def_id) { . Some(sym::cmp_min) => fetch_const(cx, expr.span.ctxt(), None, args, MinMax::Min), . Some(sym::cmp_max) => fetch_const(cx, expr.span.ctxt(), None, args, MinMax::Max), -- line 74 ---------------------------------------- -- line 89 ---------------------------------------- . { . fetch_const(cx, expr.span.ctxt(), Some(receiver), args, m) . } else { . None . } . }, . _ => None, . } 524,304 ( 0.04%) } . . fn fetch_const<'a>( . cx: &LateContext<'_>, . ctxt: SyntaxContext, . receiver: Option<&'a Expr<'a>>, . args: &'a [Expr<'a>], . m: MinMax, . ) -> Option<(MinMax, Constant, &'a Expr<'a>)> { -- line 105 ---------------------------------------- -------------------------------------------------------------------------------- -- 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); 131,088 ( 0.01%) let mut other_attrs = ThinVec::::with_capacity(if doc_only { 0 } else { size_hint }); . for (attr, item_id) in attrs { . if let Some((doc_str, fragment_kind)) = attr.doc_str_and_fragment_kind() { . let doc = beautify_doc_string(doc_str, fragment_kind.comment_kind()); . let attr_span = attr.span(); . 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()) -- line 215 ---------------------------------------- -- line 221 ---------------------------------------- . } else if !doc_only { . other_attrs.push(attr.clone()); . } . } . . doc_fragments.shrink_to_fit(); . other_attrs.shrink_to_fit(); . 65,543 ( 0.01%) unindent_doc_fragments(&mut doc_fragments); 1,441,946 ( 0.12%) => ???:rustc_resolve::rustdoc::unindent_doc_fragments (65,543x) . 393,258 ( 0.03%) (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 ---------------------------------------- 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_lexer/src/lib.rs -------------------------------------------------------------------------------- Ir -- line 63 ---------------------------------------- . . impl Token { . fn new(kind: TokenKind, len: u32) -> Token { . Token { kind, len } . } . } . . /// Enum representing common lexeme types. 786,438 ( 0.06%) #[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 || { 589,827 ( 0.05%) let token = cursor.advance_token(); 37,479,607 ( 3.02%) => ???:::advance_token (196,609x) 589,826 ( 0.05%) 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. -- line 342 ---------------------------------------- 1 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/pointers_in_nomem_asm_block.rs -------------------------------------------------------------------------------- Ir -- line 30 ---------------------------------------- . suspicious, . "pointers in nomem asm block" . } . . declare_lint_pass!(PointersInNomemAsmBlock => [POINTERS_IN_NOMEM_ASM_BLOCK]); . . impl<'tcx> LateLintPass<'tcx> for PointersInNomemAsmBlock { . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &Expr<'tcx>) { 131,076 ( 0.01%) if let ExprKind::InlineAsm(asm) = &expr.kind { . check_asm(cx, asm); . } . } . } . . fn check_asm(cx: &LateContext<'_>, asm: &InlineAsm<'_>) { . if !asm.options.contains(InlineAsmOptions::NOMEM) { . return; -- line 46 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: /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 { 48 ( 0.00%) 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 { 18 ( 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 { . move |acc, elt| g(acc, f(elt)) . } -- line 96 ---------------------------------------- -- line 98 ---------------------------------------- . #[stable(feature = "rust1", since = "1.0.0")] . impl Iterator for Map . where . F: FnMut(I::Item) -> B, . { . type Item = B; . . #[inline] 147 ( 0.00%) fn next(&mut self) -> Option { 21 ( 0.00%) self.iter.next().map(&mut self.f) 222 ( 0.00%) => ???:::next (3x) 54 ( 0.00%) } . . #[inline] . fn size_hint(&self) -> (usize, Option) { . self.iter.size_hint() . } . 655,380 ( 0.05%) fn try_fold(&mut self, init: Acc, g: G) -> R . where . Self: Sized, . G: FnMut(Acc, Self::Item) -> R, . R: Try, . { . self.iter.try_fold(init, map_try_fold(&mut self.f, g)) 524,304 ( 0.04%) } . 69 ( 0.00%) fn fold(self, init: Acc, g: G) -> Acc . where . G: FnMut(Acc, Self::Item) -> Acc, . { 2 ( 0.00%) self.iter.fold(init, map_fold(self.f, g)) 64 ( 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 ---------------------------------------- 3 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/useless_conversion.rs -------------------------------------------------------------------------------- Ir -- line 150 ---------------------------------------- . expr = recv; . depth += 1; . } . (expr, depth) . } . . #[expect(clippy::too_many_lines)] . impl<'tcx> LateLintPass<'tcx> for UselessConversion { 524,304 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 131,076 ( 0.01%) if e.span.from_expansion() { . if e.span.desugaring_kind().is_none() { . self.expn_depth += 1; . } . return; . } . . if Some(&e.hir_id) == self.try_desugar_arm.last() { . return; . } . 458,766 ( 0.04%) match e.kind { . ExprKind::Match(_, arms, MatchSource::TryDesugar(_)) => { . let (ExprKind::Ret(Some(e)) | ExprKind::Break(_, Some(e))) = arms[0].body.kind else { . return; . }; . if let ExprKind::Call(_, [arg, ..]) = e.kind { . self.try_desugar_arm.push(arg.hir_id); . } . }, -- line 178 ---------------------------------------- -- line 450 ---------------------------------------- . app, . ); . } . } . }, . . _ => {}, . } 524,304 ( 0.04%) } . . fn check_expr_post(&mut self, _: &LateContext<'tcx>, e: &'tcx Expr<'_>) { . if Some(&e.hir_id) == self.try_desugar_arm.last() { . self.try_desugar_arm.pop(); . } 131,076 ( 0.01%) if e.span.from_expansion() && e.span.desugaring_kind().is_none() { . self.expn_depth -= 1; . } . } . } . . fn has_eligible_receiver(cx: &LateContext<'_>, recv: &Expr<'_>, expr: &Expr<'_>) -> bool { . if cx.ty_based_def(expr).opt_parent(cx).is_impl(cx) { . matches!( -- line 472 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 8 ( 0.00%) fn check_block(&mut self, cx: &EarlyContext<'_>, block: &Block) { . for w in block.stmts.windows(2) { . if let (StmtKind::Expr(first), StmtKind::Expr(second) | StmtKind::Semi(second)) = (&w[0].kind, &w[1].kind) { . check_missing_else(cx, first, second); . } . } 8 ( 0.00%) } . 458,759 ( 0.04%) 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); 524,296 ( 0.04%) } . } . . /// Implementation of the `SUSPICIOUS_ASSIGNMENT_FORMATTING` lint. . fn check_assign(cx: &EarlyContext<'_>, expr: &Expr) { 196,611 ( 0.02%) if let ExprKind::Assign(ref lhs, ref rhs, _) = expr.kind . && !lhs.span.from_expansion() . && !rhs.span.from_expansion() . { . let eq_span = lhs.span.between(rhs.span); . if let ExprKind::Unary(op, ref sub_rhs) = rhs.kind . && let Some(eq_snippet) = snippet_opt(cx, eq_span) . { . let op = op.as_str(); -- line 175 ---------------------------------------- -- line 188 ---------------------------------------- . ); . } . } . } . } . . /// Implementation of the `SUSPICIOUS_UNARY_OP_FORMATTING` lint. . fn check_unop(cx: &EarlyContext<'_>, expr: &Expr) { 131,074 ( 0.01%) if let ExprKind::Binary(ref binop, ref lhs, ref rhs) = expr.kind . && !lhs.span.from_expansion() && !rhs.span.from_expansion() . // span between BinOp LHS and RHS . && let binop_span = lhs.span.between(rhs.span) . // if RHS is an UnOp . && let ExprKind::Unary(op, ref un_rhs) = rhs.kind . // from UnOp operator to UnOp operand . && let unop_operand_span = rhs.span.until(un_rhs.span) . && let Some(binop_snippet) = snippet_opt(cx, binop_span) -- line 204 ---------------------------------------- -- 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) { 131,074 ( 0.01%) if let ExprKind::If(_, then, Some(else_)) = &expr.kind . && (is_block(else_) || is_if(else_)) . && !then.span.from_expansion() && !else_.span.from_expansion() . && !expr.span.in_external_macro(cx.sess().source_map()) . . // workaround for rust-lang/rust#43081 . && expr.span.lo().0 != 0 && expr.span.hi().0 != 0 . . // this will be a span from the closing ‘}’ of the “then” block (excluding) to -- line 236 ---------------------------------------- -- line 282 ---------------------------------------- . } . . fn indentation(cx: &EarlyContext<'_>, span: Span) -> usize { . cx.sess().source_map().lookup_char_pos(span.lo()).col.0 . } . . /// Implementation of the `POSSIBLE_MISSING_COMMA` lint for array . fn check_array(cx: &EarlyContext<'_>, expr: &Expr) { 131,074 ( 0.01%) if let ExprKind::Array(ref array) = expr.kind { . for element in array { 196,605 ( 0.02%) if let ExprKind::Binary(ref op, ref lhs, _) = element.kind . && has_unary_equivalent(op.node) . && lhs.span.eq_ctxt(op.span) . && let space_span = lhs.span.between(op.span) . && let Some(space_snippet) = snippet_opt(cx, space_span) . && let lint_span = lhs.span.with_lo(lhs.span.hi()) . && space_snippet.contains('\n') . && indentation(cx, op.span) <= indentation(cx, lhs.span) . { -- line 300 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_utils/src/macros.rs -------------------------------------------------------------------------------- Ir -- line 77 ---------------------------------------- . span_is_local(self.span) . } . } . . /// Returns an iterator of expansions that created the given span . pub fn expn_backtrace(mut span: Span) -> impl Iterator { . std::iter::from_fn(move || { . let ctxt = span.ctxt(); 1 ( 0.00%) if ctxt == SyntaxContext::root() { . return None; . } . let expn = ctxt.outer_expn(); . let data = expn.expn_data(); . span = data.call_site; . Some((expn, data)) . }) . } . . /// Checks whether the span is from the root expansion or a locally defined macro 327,675 ( 0.03%) pub fn span_is_local(span: Span) -> bool { . !span.from_expansion() || expn_is_local(span.ctxt().outer_expn()) 196,605 ( 0.02%) } . . /// Checks whether the expansion is the root expansion or a locally defined macro . pub fn expn_is_local(expn: ExpnId) -> bool { . if expn == ExpnId::root() { . return true; . } . let data = expn.expn_data(); . let backtrace = expn_backtrace(data.call_site); -- line 106 ---------------------------------------- -- 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. 720,918 ( 0.06%) pub fn root_macro_call(span: Span) -> Option { . macro_backtrace(span).last() 524,304 ( 0.04%) } . . /// 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. 589,842 ( 0.05%) pub fn matching_root_macro_call(cx: &LateContext<'_>, span: Span, name: Symbol) -> Option { 131,076 ( 0.01%) root_macro_call(span).filter(|mc| cx.tcx.is_diagnostic_item(name, mc.def_id)) 2,883,673 ( 0.23%) => site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::root_macro_call (65,538x) 458,766 ( 0.04%) } . . /// Like [`root_macro_call`], but only returns `Some` if `node` is the "first node" . /// produced by the macro call, as in [`first_node_in_macro`]. . pub fn root_macro_call_first_node(cx: &LateContext<'_>, node: &impl HirNode) -> Option { 1,179,684 ( 0.10%) if first_node_in_macro(cx, node) != Some(ExpnId::root()) { 2,162,750 ( 0.17%) => site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::first_node_in_macro:: (65,538x) . return None; . } . root_macro_call(node.span()) . } . . /// Like [`macro_backtrace`], but only returns macro calls where `node` is the "first node" of the . /// macro call, as in [`first_node_in_macro`]. . pub fn first_node_macro_backtrace(cx: &LateContext<'_>, node: &impl HirNode) -> impl Iterator { 131,076 ( 0.01%) let span = node.span(); 131,076 ( 0.01%) first_node_in_macro(cx, node) 2,162,750 ( 0.17%) => site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::first_node_in_macro:: (65,538x) . .into_iter() . .flat_map(move |expn| macro_backtrace(span).take_while(move |macro_call| macro_call.expn != expn)) . } . . /// If `node` is the "first node" in a macro expansion, returns `Some` with the `ExpnId` of the . /// macro call site (i.e. the parent of the macro expansion). . /// . /// This generally means that `node` is the outermost node of an entire macro expansion, but there -- line 169 ---------------------------------------- -- line 174 ---------------------------------------- . /// just check the context of that span directly (e.g. `parent.span.from_expansion()`). . /// . /// If a macro call is in statement position, it expands to one or more statements. . /// In that case, each statement *and* their immediate descendants will all yield `Some` . /// with the `ExpnId` of the containing block. . /// . /// A node may be the "first node" of multiple macro calls in a macro backtrace. . /// The expansion of the outermost macro call site is returned in such cases. 4,718,736 ( 0.38%) pub fn first_node_in_macro(cx: &LateContext<'_>, node: &impl HirNode) -> Option { . // A node that is not from an expansion can never be the first node in a macro. This is the . // common case, so return before touching the cache. 2,621,520 ( 0.21%) 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. -- line 193 ---------------------------------------- -- line 195 ---------------------------------------- . if let Some((cached_id, cached)) = LAST_FIRST_NODE_IN_MACRO.get() . && cached_id == hir_id . { . return cached; . } . let result = first_node_in_macro_uncached(cx, node); . LAST_FIRST_NODE_IN_MACRO.set(Some((hir_id, result))); . result 4,718,736 ( 0.38%) } . . 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 -- line 211 ---------------------------------------- -- line 426 ---------------------------------------- . match result { . ControlFlow::Break(is_assert_arg) => is_assert_arg, . ControlFlow::Continue(()) => true, . } . } . . /// Stores AST [`FormatArgs`] nodes for use in late lint passes, as they are in a desugared form in . /// the HIR 1 ( 0.00%) #[derive(Default, Clone)] . pub struct FormatArgsStorage(Arc>>); . . impl FormatArgsStorage { . /// Returns an AST [`FormatArgs`] node if a `format_args` expansion is found as a descendant of . /// `expn_id` . /// . /// See also [`find_format_arg_expr`] . pub fn get(&self, cx: &LateContext<'_>, start: &Expr<'_>, expn_id: ExpnId) -> Option<&FormatArgs> { -- line 442 ---------------------------------------- -- line 457 ---------------------------------------- . })?; . . debug_assert!(self.0.get().is_some(), "`FormatArgsStorage` not yet populated"); . . self.0.get()?.get(&format_args_expr.span.with_parent(None)) . } . . /// Should only be called by `FormatArgsCollector` 2 ( 0.00%) pub fn set(&self, format_args: FxHashMap) { . self.0 . .set(format_args) . .expect("`FormatArgsStorage::set` should only be called once"); 3 ( 0.00%) } . } . . /// Attempt to find the [`rustc_hir::Expr`] that corresponds to the [`FormatArgument`]'s value . pub fn find_format_arg_expr<'hir>(start: &'hir Expr<'hir>, target: &FormatArgument) -> Option<&'hir Expr<'hir>> { . let SpanData { . lo, . hi, . ctxt, -- line 477 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/needless_else.rs -------------------------------------------------------------------------------- Ir -- line 32 ---------------------------------------- . style, . "empty else branch" . } . . declare_lint_pass!(NeedlessElse => [NEEDLESS_ELSE]); . . impl EarlyLintPass for NeedlessElse { . fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 131,074 ( 0.01%) if let ExprKind::If(_, then_block, Some(else_clause)) = &expr.kind . && let ExprKind::Block(block, _) = &else_clause.kind . && !expr.span.from_expansion() . && !else_clause.span.from_expansion() . && block.stmts.is_empty() . && let range = (then_block.span.hi()..expr.span.hi()).trim_start(cx) . && range.clone().check_text(cx, |src| { . // Ignore else blocks that contain comments or #[cfg]s . !src.contains(['/', '#']) -- line 48 ---------------------------------------- -- line 53 ---------------------------------------- . NEEDLESS_ELSE, . range.with_ctxt(expr.span.ctxt()), . "this `else` branch is empty", . "you can remove it", . String::new(), . Applicability::MachineApplicable, . ); . } 65,537 ( 0.01%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/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 { 262,340 ( 0.02%) 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 { 196,675 ( 0.02%) Vec { buf: RawVec::with_capacity_in(capacity, alloc), len: 0 } . } . . /// Appends an element to the back of a collection. . /// . /// # Panics . /// . /// Panics if the new capacity exceeds `isize::MAX` _bytes_. . /// -- line 977 ---------------------------------------- -- line 1021 ---------------------------------------- . /// capacity after the push, *O*(*capacity*) time is taken to copy the . /// vector's elements to a larger allocation. This expensive operation is . /// offset by the *capacity* *O*(1) insertions it allows. . #[inline] . #[stable(feature = "push_mut", since = "1.95.0")] . #[must_use = "if you don't need a reference to the value, use `Vec::push` instead"] . pub fn push_mut(&mut self, value: T) -> &mut T { . // Inform codegen that the length does not change across grow_one(). 1,381 ( 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. 3,093 ( 0.00%) if len == self.buf.capacity() { 258 ( 0.00%) self.buf.grow_one(); 103 ( 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 (1x) . } . unsafe { . let end = self.as_mut_ptr().add(len); . ptr::write(end, value); 3,275 ( 0.00%) self.len = len + 1; . // SAFETY: We just wrote a value to the pointer that will live the lifetime of the reference. . &mut *end . } . } . } . . impl Vec { . /// Constructs a new, empty `Vec`. -- line 1046 ---------------------------------------- -- line 1188 ---------------------------------------- . capacity: usize, . alloc: A, . ) -> Self { . ub_checks::assert_unsafe_precondition!( . check_library_ub, . "Vec::from_raw_parts_in requires that length <= capacity", . (length: usize = length, capacity: usize = capacity) => length <= capacity . ); 960 ( 0.00%) unsafe { Vec { buf: RawVec::from_raw_parts_in(ptr, capacity, alloc), len: length } } . } . . #[doc(alias = "from_non_null_parts_in")] . /// Creates a `Vec` directly from a `NonNull` pointer, a length, a capacity, . /// and an allocator. . /// . /// # Safety . /// -- line 1204 ---------------------------------------- -- line 1453 ---------------------------------------- . /// let mut vec = vec![1]; . /// vec.reserve(10); . /// assert!(vec.capacity() >= 11); . /// ``` . #[cfg(not(no_global_oom_handling))] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_diagnostic_item = "vec_reserve"] . pub fn reserve(&mut self, additional: usize) { 16 ( 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. 3 ( 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 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 458,991 ( 0.04%) &*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 65,549 ( 0.01%) &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 . ); . 76 ( 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 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 { 24 ( 0.00%) if self.len == 0 { . None . } else { . unsafe { 16 ( 0.00%) self.len -= 1; . core::hint::assert_unchecked(self.len < self.capacity()); . 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 -- line 2885 ---------------------------------------- -- 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(); 3 ( 0.00%) if count > 0 { . unsafe { . ptr::copy_nonoverlapping(other as *const T, self.as_mut_ptr().add(len), count) . }; . } 569 ( 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 { 4 ( 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 { 83 ( 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 { 19 ( 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. 28 ( 0.00%) fn clone(&self) -> Self { . let alloc = self.allocator().clone(); 2 ( 0.00%) <[T]>::to_vec_in(&**self, alloc) 34 ( 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 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 { 4 ( 0.00%) >::from_iter(iter.into_iter()) 205 ( 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 (4x) . } . } . . #[stable(feature = "rust1", since = "1.0.0")] . impl IntoIterator for Vec { . type Item = T; . type IntoIter = IntoIter; . -- line 4004 ---------------------------------------- -- line 4026 ---------------------------------------- . let buf = me.buf.non_null(); . let begin = buf.as_ptr(); . let end = if T::IS_ZST { . begin.wrapping_byte_add(me.len()) . } else { . begin.add(me.len()) as *const T . }; . let cap = me.buf.capacity(); 7 ( 0.00%) IntoIter { buf, phantom: PhantomData, cap, alloc, ptr: buf, end } . } . } . } . . #[stable(feature = "rust1", since = "1.0.0")] . impl<'a, T, A: Allocator> IntoIterator for &'a Vec { . type Item = &'a T; . type IntoIter = slice::Iter<'a, T>; -- line 4042 ---------------------------------------- -- line 4056 ---------------------------------------- . } . } . . #[cfg(not(no_global_oom_handling))] . #[stable(feature = "rust1", since = "1.0.0")] . impl Extend for Vec { . #[inline] . fn extend>(&mut self, iter: I) { 1 ( 0.00%) >::spec_extend(self, iter.into_iter()) 519 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/vec/spec_extend.rs: as alloc::vec::spec_extend::SpecExtend>>::spec_extend (1x) . } . . #[inline] . fn extend_one(&mut self, item: T) { . self.push(item); . } . . #[inline] -- line 4072 ---------------------------------------- -- line 4092 ---------------------------------------- . 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); . // } 258 ( 0.00%) while let Some(element) = iterator.next() { 54 ( 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_driver::main::{closure#1}::{closure#4}>, alloc::vec::into_iter::IntoIter> as core::iter::traits::iterator::Iterator>::next (2x) . let len = self.len(); 72 ( 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 36 ( 0.00%) self.set_len(len + 1); . } . } . } . . // 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) { -- line 4119 ---------------------------------------- -- 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 . { 27 ( 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 34 ( 0.00%) self.as_mut_ptr().cast_slice(self.len).drop_in_place() . } . // RawVec handles deallocation 32 ( 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 ---------------------------------------- 66,811 ( 0.01%) -------------------------------------------------------------------------------- -- 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}; . 589,842 ( 0.05%) pub(super) fn check<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 131,076 ( 0.01%) if expr.span.from_expansion() { . return; . } . . // apparently stuff in the desugaring of `?` can trigger this . // so check for that here . // only the calls to `Try::from_error` is marked as desugared, . // so we need to check both the current Expr and its parent. 131,076 ( 0.01%) if is_questionmark_desugar_marked_call(expr) { . return; . } 589,839 ( 0.05%) if let Node::Expr(parent_expr) = cx.tcx.parent_hir_node(expr.hir_id) 7,078,104 ( 0.57%) => ???:::parent_hir_node (65,538x) . && is_questionmark_desugar_marked_call(parent_expr) . { . return; . } . 262,152 ( 0.02%) let (receiver, args) = match expr.kind { . ExprKind::Call(_, args) => (None, args), . ExprKind::MethodCall(_, receiver, args, _) => (Some(receiver), args), . _ => return, . }; . . let args_to_recover = receiver . .into_iter() . .chain(args) -- line 41 ---------------------------------------- -- line 48 ---------------------------------------- . } else { . false . } . }) . .collect::>(); . if !args_to_recover.is_empty() && !is_from_proc_macro(cx, expr) { . lint_unit_args(cx, expr, args_to_recover.as_slice()); . } 524,304 ( 0.04%) } . . fn is_questionmark_desugar_marked_call(expr: &Expr<'_>) -> bool { . use rustc_span::hygiene::DesugaringKind; 196,608 ( 0.02%) if let ExprKind::Call(callee, _) = expr.kind { . callee.span.is_desugaring(DesugaringKind::QuestionMark) . } 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; -- line 68 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::If(cond, then, r#else) = expr.kind . && !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 -- line 58 ---------------------------------------- -- line 118 ---------------------------------------- . 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`"); . }); . } 524,304 ( 0.04%) } . } . . #[derive(Copy, Clone, Eq, PartialEq)] . enum UseKind { . Division, . Other, . } . -- line 134 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/combined_early_pass.rs -------------------------------------------------------------------------------- Ir -- line 19 ---------------------------------------- . /// Run one field's `check_*`. . /// . /// Fully qualified through [`rustc_lint::EarlyLintPass`] since some passes impl . /// both `EarlyLintPass` and `LateLintPass` with like-named methods, which would . /// be ambiguous on the concrete field type. . #[macro_export] . macro_rules! run_combined_early_lint_pass_field { . ($self:ident, $field:ident, $name:ident, ($($arg:expr),* $(,)?)) => { 5,374,364 ( 0.43%) rustc_lint::EarlyLintPass::$name(&mut $self.$field, $($arg),*); 1,776 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/module_style.rs:::check_item_post (4x) . }; . } . . /// 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),*);)*]) => ( 1,769,689 ( 0.14%) $(#[inline(always)] fn $name(&mut self, cx: &rustc_lint::EarlyContext<'_>, $($param: $arg),*) { . $crate::expand_combined_early_lint_pass_method!($fields, self, $name, (cx, $($param),*)); 327,761 ( 0.03%) })* . ) . } . . /// 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 ( 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)] 589,842 ( 0.05%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . let from_expansion = expr.span.from_expansion(); . 196,614 ( 0.02%) if let ExprKind::Match(ex, arms, source) = expr.kind { . if is_direct_expn_of(expr.span, sym::matches).is_some() . && let [arm, _] = arms . { . redundant_pattern_match::check_match(cx, expr, ex, arms); . redundant_pattern_match::check_matches_true(cx, expr, arm, ex); . } . if expr.span.in_external_macro(cx.tcx.sess.source_map()) { . return; -- line 1067 ---------------------------------------- -- line 1141 ---------------------------------------- . if self.infallible_destructuring_match_linted { . self.infallible_destructuring_match_linted = false; . } else { . match_single_binding::check(cx, ex, arms, expr); . } . } . match_ref_pats::check(cx, ex, arms.iter().map(|el| el.pat), expr); . } 393,228 ( 0.03%) } else if let Some(if_let) = higher::IfLet::hir(cx, expr) { 327,690 ( 0.03%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (65,538x) . if expr.span.in_external_macro(cx.tcx.sess.source_map()) { . return; . } . collapsible_match::check_if_let( . cx, . if_let.let_span.ctxt(), . if_let.let_pat, . if_let.if_then, -- line 1157 ---------------------------------------- -- line 1206 ---------------------------------------- . if_let.let_pat, . if_let.let_expr, . if_let.if_else.is_some(), . if_let.let_span, . ); . needless_match::check_if_let(cx, expr, &if_let); . } . } else { 327,690 ( 0.03%) if expr.span.in_external_macro(cx.tcx.sess.source_map()) { . return; . } . if let Some(while_let) = higher::WhileLet::hir(expr) { . significant_drop_in_scrutinee::check_while_let(cx, expr, while_let.let_expr, while_let.if_then); . } . if !from_expansion { . redundant_pattern_match::check(cx, expr); . } . } 524,304 ( 0.04%) } . . fn check_local(&mut self, cx: &LateContext<'tcx>, local: &'tcx LetStmt<'_>) { . self.infallible_destructuring_match_linted |= . local.els.is_none() && infallible_destructuring_match::check(cx, local); . } . . fn check_pat(&mut self, cx: &LateContext<'tcx>, pat: &'tcx Pat<'_>) { . rest_pat_in_fully_bound_struct::check(cx, pat); -- line 1232 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_ignore_case_cmp.rs -------------------------------------------------------------------------------- Ir -- line 72 ---------------------------------------- . 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 { 524,304 ( 0.04%) 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 131,076 ( 0.01%) if let Binary(op, left, right) = &expr.kind . && (op.node == BinOpKind::Eq || op.node == BinOpKind::Ne) . && let Some((left_span, left_val)) = get_ascii_type(cx, left.kind) . && let Some((right_span, right_val)) = get_ascii_type(cx, right.kind) . && match (&left_val, &right_val) { . (ToAscii(l_lower, ..), ToAscii(r_lower, ..)) if l_lower == r_lower => true, . (ToAscii(..), Literal(..)) | (Literal(..), ToAscii(..)) => true, . _ => false, . } -- line 93 ---------------------------------------- -- line 117 ---------------------------------------- . expr.span, . "consider using `.eq_ignore_ascii_case()` instead", . format!("{neg}{left_snip}.eq_ignore_ascii_case({deref}{right_snip})"), . app, . ); . }, . ); . } 524,304 ( 0.04%) } . } -------------------------------------------------------------------------------- -- 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<'_>) { 131,076 ( 0.01%) if let ExprKind::Ret(Some(e)) = expr.kind { . check(cx, e); . } . } . . fn check_body(&mut self, cx: &LateContext<'_>, body: &'_ Body<'_>) { 7 ( 0.00%) if let ExprKind::Block( . Block { . expr: . Some(Expr { . kind: ExprKind::DropTemps(async_body), . .. . }), . .. . }, . _, 6 ( 0.00%) ) = body.value.kind . { . if let ExprKind::Block(Block { expr: Some(expr), .. }, ..) = async_body.kind { . check(cx, expr.peel_blocks()); . } . } else { . check(cx, body.value.peel_blocks()); . } . } . } . . fn check(cx: &LateContext<'_>, expr: &Expr<'_>) { 6 ( 0.00%) if let ExprKind::Call(path, [arg]) = expr.kind . && let Res::Def(DefKind::Ctor(..), ctor_id) = path.res(cx) . && let Some(variant_id) = cx.tcx.opt_parent(ctor_id) . && let variant = if cx.tcx.lang_items().option_some_variant() == Some(variant_id) { . "Some" . } else if cx.tcx.lang_items().result_ok_variant() == Some(variant_id) { . "Ok" . } else { . return; -- line 104 ---------------------------------------- -- line 128 ---------------------------------------- . String::new(), . ), . ], . Applicability::MachineApplicable, . ); . }, . ); . } 3 ( 0.00%) } -------------------------------------------------------------------------------- -- 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)` 131,076 ( 0.01%) if let ExprKind::Assign(left, right, _) = expr.kind . && let Some(local_id) = left.res_local_id() . && let Some(size_expr) = Self::as_vec_initializer(cx, right) . { . let vi = VecAllocation { . local_id, . allocation_expr: right, . size_expr, . }; -- line 111 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 655,380 ( 0.05%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . let (let_pat, let_expr, ifwhile) = 262,152 ( 0.02%) if let Some(higher::IfLet { let_pat, let_expr, .. }) = higher::IfLet::hir(cx, expr) { 327,690 ( 0.03%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (65,538x) . (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; . }; . . if let ExprKind::MethodCall(ok_path, recv, [], ..) = let_expr.kind //check is expr.ok() has type Result.ok(, _) -- line 57 ---------------------------------------- -- 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, . ); . } 524,304 ( 0.04%) } . } -------------------------------------------------------------------------------- -- 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 { 784 ( 0.00%) if b { . true . } else { . cold_path(); . false . } . } . . /// Hints to the compiler that branch condition is likely to be false. -- line 463 ---------------------------------------- -- line 470 ---------------------------------------- . /// Therefore, implementations must not require the user to uphold . /// any safety invariants. . /// . /// This intrinsic does not have a stable counterpart. . #[unstable(feature = "core_intrinsics", issue = "none")] . #[rustc_nounwind] . #[inline(always)] . pub const fn unlikely(b: bool) -> bool { 888 ( 0.00%) if b { . cold_path(); . true . } else { . false . } . } . . /// Returns either `true_val` or `false_val` depending on condition `b` with a -- line 486 ---------------------------------------- -- line 2207 ---------------------------------------- . #[rustc_nounwind] . #[rustc_intrinsic] . #[rustc_allow_const_fn_unstable(const_trait_impl, funnel_shifts)] . #[miri::intrinsic_fallback_is_spec] . pub const fn rotate_left(x: T, shift: u32) -> T { . // Make sure to call the intrinsic for `funnel_shl`, not the fallback impl. . // SAFETY: we modulo `shift` so that the result is definitely less than the size of . // `T` in bits. 1,331 ( 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])* 131,044 ( 0.01%) 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 ---------------------------------------- 1,056 ( 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)] 589,842 ( 0.05%) 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`" 131,078 ( 0.01%) let (inner_expr, span, suggested_type) = if let ExprKind::Array([inner_expr]) = expr.kind . && !expr.span.from_expansion() . { . (inner_expr, expr.span, SuggestedType::Array) . } else if let Some(macro_call) = root_macro_call_first_node(cx, expr) . && let Some(VecArgs::Vec([expr])) = VecArgs::hir(cx, expr) . { . (expr, macro_call.span, SuggestedType::Vec) . } else { -- line 87 ---------------------------------------- -- line 188 ---------------------------------------- . format!("if you wanted {suggested_type} of len {end_snippet}, try"), . format!("{start_snippet}; {end_snippet}"), . applicability, . ); . } . } . }, . ); 524,304 ( 0.04%) } . } -------------------------------------------------------------------------------- -- 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 . } . }}; 262,196 ( 0.02%) ($this:ident, $len:ident => $zst_body:expr, $end:ident => $other_body:expr,) => {{ . #![allow(unused_unsafe)] // we're sometimes used within an unsafe block . 2 ( 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 . let $end = unsafe { mem::transmute::<*const T, NonNull>($this.end_or_len) }; . $other_body . } . }}; -- line 36 ---------------------------------------- -- 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.) 8,912,914 ( 0.72%) 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. 2 ( 0.00%) self.ptr = ptr.add(1); . } . // SAFETY: Now that we know it wasn't empty and we've moved past . // the first one (to avoid giving a duplicate `&mut` next time), . // we can give out a reference to it. . Some({ptr}.$into_ref()) . } . } . -- line 193 ---------------------------------------- -- line 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 970 ( 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) }; 819 ( 0.00%) if i == len { . break; . } . } . acc . } . . // We override the default implementation, which uses `try_fold`, . // because this simple implementation generates less LLVM IR and is -- line 287 ---------------------------------------- -- line 302 ---------------------------------------- . // faster to compile. . #[inline] . fn all(&mut self, mut f: F) -> bool . where . Self: Sized, . F: FnMut(Self::Item) -> bool, . { . while let Some(x) = self.next() { 152,117 ( 0.01%) if !f(x) { . return false; . } . } . true . } . . // We override the default implementation, which uses `try_fold`, . // because this simple implementation generates less LLVM IR and is -- line 318 ---------------------------------------- -- line 319 ---------------------------------------- . // faster to compile. . #[inline] . fn any(&mut self, mut f: F) -> bool . where . Self: Sized, . F: FnMut(Self::Item) -> bool, . { . while let Some(x) = self.next() { 478 ( 0.00%) if f(x) { . return true; . } . } . false . } . . // We override the default implementation, which uses `try_fold`, . // because this simple implementation generates less LLVM IR and is -- line 335 ---------------------------------------- -- line 336 ---------------------------------------- . // faster to compile. . #[inline] . fn find

(&mut self, mut predicate: P) -> Option . where . Self: Sized, . P: FnMut(&Self::Item) -> bool, . { . while let Some(x) = self.next() { 30 ( 0.00%) if predicate(&x) { . return Some(x); . } . } . None . } . . // We override the default implementation, which uses `try_fold`, . // because this simple implementation generates less LLVM IR and is -- line 352 ---------------------------------------- -- line 353 ---------------------------------------- . // faster to compile. . #[inline] . fn find_map(&mut self, mut f: F) -> Option . where . Self: Sized, . F: FnMut(Self::Item) -> Option, . { . while let Some(x) = self.next() { 7 ( 0.00%) if let Some(y) = f(x) { 12 ( 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 (1x) . return Some(y); . } . } . None 3 ( 0.00%) } . . // We override the default implementation, which uses `try_fold`, . // because this simple implementation generates less LLVM IR and is . // faster to compile. Also, the `assume` avoids a bounds check. . #[inline] . fn position

(&mut self, mut predicate: P) -> Option where . Self: Sized, . P: FnMut(Self::Item) -> bool, . { . let n = len!(self); . let mut i = 0; . while let Some(x) = self.next() { 232 ( 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); . } 150 ( 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 ---------------------------------------- 328,903 ( 0.03%) -------------------------------------------------------------------------------- -- 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 { 458,759 ( 0.04%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 458,759 ( 0.04%) match &expr.kind { . // ((..)) . // ^^^^^^ expr . // ^^^^ inner . ExprKind::Paren(inner) . 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) => -- line 53 ---------------------------------------- -- line 92 ---------------------------------------- . "unnecessary parentheses", . "remove them", . sugg.to_string(), . applicability, . ); . }, . _ => {}, . } 524,296 ( 0.04%) } . } . . /// 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 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 131,076 ( 0.01%) if let ExprKind::AddrOf(BorrowKind::Ref, Mutability::Not, inner_expr) = expr.kind . && let ExprKind::Call(fun, args) = inner_expr.kind . && let ExprKind::Path(ref qpath) = fun.kind . && let Some(fun_def_id) = cx.qpath_res(qpath, fun.hir_id).opt_def_id() . && let ty::Ref(_, inner_str, _) = cx.typeck_results().expr_ty_adjusted(expr).kind() . && inner_str.is_str() . { . let fun_name = cx.tcx.get_diagnostic_name(fun_def_id); . if fun_name == Some(sym::string_new) { -- line 48 ---------------------------------------- -- line 69 ---------------------------------------- . expr.span, . "usage of `&String::from(\"\")` for a function expecting a `&str` argument", . "try", . "\"\"".to_owned(), . Applicability::MachineApplicable, . ); . } . } 524,304 ( 0.04%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/approx_const.rs -------------------------------------------------------------------------------- Ir -- line 74 ---------------------------------------- . impl ApproxConstant { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl LateLintPass<'_> for ApproxConstant { . fn check_lit(&mut self, cx: &LateContext<'_>, _hir_id: HirId, lit: Lit, _is_negated_pat: bool) { 131,072 ( 0.01%) match lit.node { . LitKind::Float(s, LitFloatType::Suffixed(fty)) => match fty { . FloatTy::F16 => self.check_known_consts(cx, lit.span, s, "f16"), . FloatTy::F32 => self.check_known_consts(cx, lit.span, s, "f32"), . FloatTy::F64 => self.check_known_consts(cx, lit.span, s, "f64"), . FloatTy::F128 => self.check_known_consts(cx, lit.span, s, "f128"), . }, . // FIXME(f16_f128): add `f16` and `f128` when these types become stable. . LitKind::Float(s, LitFloatType::Unsuffixed) => self.check_known_consts(cx, lit.span, s, "f{32, 64}"), . _ => (), . } 65,536 ( 0.01%) } . } . . impl ApproxConstant { . fn check_known_consts(&self, cx: &LateContext<'_>, span: Span, s: symbol::Symbol, module: &str) { . let s = s.as_str(); . if let Ok(maybe_constant) = s.parse::() { . for &(constant, name, min_digits, msrv) in &KNOWN_CONSTS { . if is_approx_const(constant, s, maybe_constant, min_digits) -- line 101 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: /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 108 ---------------------------------------- . . #[inline] . fn from_output(output: Self::Output) -> Self { . ControlFlow::Continue(output) . } . . #[inline] . fn branch(self) -> ControlFlow { 196,614 ( 0.02%) match self { . ControlFlow::Continue(c) => ControlFlow::Continue(c), . 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")] -- line 124 ---------------------------------------- -- line 188 ---------------------------------------- . #[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, . { . match self { 4 ( 0.00%) ControlFlow::Continue(..) => None, . 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 204 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 27 ( 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 { 196,629 ( 0.02%) 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 { 264 ( 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)); 33 ( 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 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); 20 ( 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 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> { 196,608 ( 0.02%) 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 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 524,304 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'_>, e: &Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::Call(fn_expr, [arg1, arg2]) = e.kind . && 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, -- line 52 ---------------------------------------- -- line 63 ---------------------------------------- . "use ptr::swap", . format!("core::ptr::swap({snip1}, {snip2})"), . app, . ); . } . }, . ); . } 524,304 ( 0.04%) } . } . . /// 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/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 { 589,842 ( 0.05%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { . let Some(macro_call) = root_macro_call_first_node(cx, expr) else { . return; . }; . let Some(VecArgs::Repeat(elem, len)) = VecArgs::hir(cx, expr) else { . return; . }; . let Some((symbol, func_span)) = ref_init(cx, elem) else { . return; . }; . . emit_lint(cx, symbol, macro_call.span, elem, len, func_span); 524,304 ( 0.04%) } . } . . fn loop_init_suggestion(elem: &str, len: &str, indent: &str) -> String { . format!( . r"{{ . {indent} let mut v = Vec::with_capacity({len}); . {indent} (0..{len}).for_each(|_| v.push({elem})); . {indent} v -- line 72 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) { 131,076 ( 0.01%) if let hir::ExprKind::Lit(lit) = expr.kind 131,072 ( 0.01%) && 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, . ); . }, . ); . } . } 524,304 ( 0.04%) } . } . . #[must_use] . fn max_digits(fty: FloatTy) -> u32 { . match fty { . FloatTy::F16 => f16::DIGITS, . FloatTy::F32 => f32::DIGITS, . FloatTy::F64 => f64::DIGITS, -- line 184 ---------------------------------------- 65,536 ( 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), 31,485 ( 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> { 589,842 ( 0.05%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 131,076 ( 0.01%) if expr.span.from_expansion() { . return; . } 327,690 ( 0.03%) if matches!(expr.kind, ExprKind::If(..)) && !is_else_clause(cx.tcx, expr) { . let (conds, blocks) = if_sequence(expr); . ifs_same_cond::check(cx, &conds, &mut self.interior_mut); . same_functions_in_if_cond::check(cx, &conds); . let all_same = . !is_lint_allowed(cx, IF_SAME_THEN_ELSE, expr.hir_id) && if_same_then_else::check(cx, &conds, &blocks); . if !all_same && conds.len() != blocks.len() { . branches_sharing_code::check(cx, &conds, &blocks, expr); . } . } else if let ExprKind::Match(_, arms, _) = expr.kind { . branches_sharing_code::check_match(cx, expr, arms); . } 524,304 ( 0.04%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_bits.rs -------------------------------------------------------------------------------- Ir -- line 42 ---------------------------------------- . . impl ManualBits { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl<'tcx> LateLintPass<'tcx> for ManualBits { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::Binary(bin_op, left_expr, right_expr) = expr.kind . && let BinOpKind::Mul = &bin_op.node . && !expr.span.from_expansion() . && let ctxt = expr.span.ctxt() . && left_expr.span.ctxt() == ctxt . && right_expr.span.ctxt() == ctxt . && let Some((real_ty_span, resolved_ty, other_expr)) = get_one_size_of_ty(cx, left_expr, right_expr) . && matches!(resolved_ty.kind(), ty::Int(_) | ty::Uint(_)) . && let ExprKind::Lit(lit) = &other_expr.kind -- line 59 ---------------------------------------- -- line 69 ---------------------------------------- . MANUAL_BITS, . expr.span, . "usage of `size_of::()` to obtain the size of `T` in bits", . "consider using", . sugg, . app, . ); . } 524,304 ( 0.04%) } . } . . fn get_one_size_of_ty<'tcx>( . cx: &LateContext<'tcx>, . expr1: &'tcx Expr<'_>, . expr2: &'tcx Expr<'_>, . ) -> Option<(Span, Ty<'tcx>, &'tcx Expr<'tcx>)> { . match (get_size_of_ty(cx, expr1), get_size_of_ty(cx, expr2)) { -- line 85 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 524,304 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . if let Some(higher::If { cond, then, .. }) = higher::If::hir(expr) . && let ExprKind::MethodCall(_, target_arg, [pattern], _) = cond.kind . && let ExprKind::Path(target_path) = &target_arg.kind . && let Some(method_def_id) = cx.typeck_results().type_dependent_def_id(cond.hir_id) . { . let strip_kind = match cx.tcx.get_diagnostic_name(method_def_id) { . Some(sym::str_starts_with) => StripKind::Prefix, . Some(sym::str_ends_with) => StripKind::Suffix, -- line 79 ---------------------------------------- -- line 144 ---------------------------------------- . ) . .collect(), . app, . ); . }, . ); . } . } 524,304 ( 0.04%) } . } . . // Returns `Some(arg)` if `expr` matches `arg.len()` and `None` otherwise. . fn len_arg<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) -> Option<&'tcx Expr<'tcx>> { . if let ExprKind::MethodCall(_, arg, [], _) = expr.kind . && let Some(method_def_id) = cx.typeck_results().type_dependent_def_id(expr.hir_id) . && cx.tcx.is_diagnostic_item(sym::str_len, method_def_id) . { -- line 160 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/result.rs -------------------------------------------------------------------------------- Ir -- 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, . { 131,082 ( 0.01%) match self { 196,609 ( 0.02%) 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 ( 0.00%) match self { . 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`]). . /// -- line 844 ---------------------------------------- -- 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, . { 42 ( 0.00%) match self { 42 ( 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 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 { 65,542 ( 0.01%) 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 { 128 ( 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 { 42 ( 0.00%) match self { 19 ( 0.00%) Ok(v) => ControlFlow::Continue(v), . 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> -- line 2186 ---------------------------------------- 65,606 ( 0.01%) -------------------------------------------------------------------------------- -- 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 { 393,228 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'_>, e: &Expr<'_>) { 131,077 ( 0.01%) if !e.span.from_expansion() . && let ExprKind::Unary(UnOp::Deref, deref_target) = e.kind . && !deref_target.span.from_expansion() . && let ExprKind::AddrOf(_, _, addrof_target) = deref_target.kind . // NOTE(tesuji): `*&` forces rustc to const-promote the array to `.rodata` section. . // See #12854 for details. . && !matches!(addrof_target.kind, ExprKind::Array(_)) . && deref_target.span.eq_ctxt(e.span) . && !addrof_target.span.from_expansion() -- line 51 ---------------------------------------- -- line 73 ---------------------------------------- . DEREF_ADDROF, . e.span, . "immediately dereferencing a reference", . "try", . sugg.to_string(), . applicability, . ); . } 393,228 ( 0.03%) } . } . . /// 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 ---------------------------------------- 131,076 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/zero_div_zero.rs -------------------------------------------------------------------------------- Ir -- line 24 ---------------------------------------- . pub ZERO_DIVIDED_BY_ZERO, . complexity, . "usage of `0.0 / 0.0` to obtain NaN instead of `f32::NAN` or `f64::NAN`" . } . . declare_lint_pass!(ZeroDiv => [ZERO_DIVIDED_BY_ZERO]); . . impl<'tcx> LateLintPass<'tcx> for ZeroDiv { 393,228 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . // check for instances of 0.0/0.0 131,076 ( 0.01%) if let ExprKind::Binary(ref op, left, right) = expr.kind . && op.node == BinOpKind::Div . // TODO - constant_simple does not fold many operations involving floats. . // That's probably fine for this lint - it's pretty unlikely that someone would . // do something like 0.0/(2.0 - 2.0), but it would be nice to warn on that case too. . && let ecx = ConstEvalCtxt::new(cx) . && let ctxt = expr.span.ctxt() . && let Some(lhs_value) = ecx.eval_local(left, ctxt) . && let Some(rhs_value) = ecx.eval_local(right, ctxt) -- line 42 ---------------------------------------- -- line 54 ---------------------------------------- . cx, . ZERO_DIVIDED_BY_ZERO, . expr.span, . "constant division of `0.0` with `0.0` will always result in NaN", . None, . format!("consider using `{float_type}::NAN` if you would like a constant representing NaN"), . ); . } 458,766 ( 0.04%) } . } -------------------------------------------------------------------------------- -- 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 131,076 ( 0.01%) if let ExprKind::If(cond, then, None) = expr.kind . && let Some((c, op_node, l)) = get_const(cx, cond) . && let BinOpKind::Ne | BinOpKind::Lt = op_node . && let ExprKind::Block(block, None) = then.kind . && let Block { . stmts: . [ . Stmt { . kind: StmtKind::Expr(ex) | StmtKind::Semi(ex), -- line 52 ---------------------------------------- -- line 88 ---------------------------------------- . IMPLICIT_SATURATING_ADD, . expr.span, . "manual saturating add detected", . "use instead", . sugg, . app, . ); . } 524,304 ( 0.04%) } . } . . 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 ---------------------------------------- -------------------------------------------------------------------------------- -- 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<'_>) { 8 ( 0.00%) check_item(cx, item.hir_id()); 784 ( 0.00%) => site/frontend/rust-clippy/clippy_lints/src/utils/author.rs:clippy_lints::utils::author::check_item (4x) . } . . fn check_impl_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::ImplItem<'_>) { . check_item(cx, item.hir_id()); . } . . fn check_trait_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::TraitItem<'_>) { . check_item(cx, item.hir_id()); -- line 112 ---------------------------------------- -- line 113 ---------------------------------------- . } . . fn check_arm(&mut self, cx: &LateContext<'tcx>, arm: &'tcx hir::Arm<'_>) { . check_node(cx, arm.hir_id, |v| { . v.arm(&v.bind("arm", arm)); . }); . } . 589,842 ( 0.05%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) { 131,076 ( 0.01%) check_node(cx, expr.hir_id, |v| { . v.expr(&v.bind("expr", expr)); . }); 524,304 ( 0.04%) } . . fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx hir::Stmt<'_>) { . match stmt.kind { . StmtKind::Expr(e) | StmtKind::Semi(e) if has_attr(cx, e.hir_id) => return, . _ => {}, . } . check_node(cx, stmt.hir_id, |v| { . v.stmt(&v.bind("stmt", stmt)); . }); . } . } . 36 ( 0.00%) fn check_item(cx: &LateContext<'_>, hir_id: HirId) { 20 ( 0.00%) if let Some(body) = cx.tcx.hir_maybe_body_owned_by(hir_id.expect_owner().def_id) { 578 ( 0.00%) => ???:::hir_maybe_body_owned_by (4x) . check_node_with_body( . cx, . hir_id, 2 ( 0.00%) |v| { . v.expr(&v.bind("expr", body.value)); . }, . Some(body), . ); . } 32 ( 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<'_>>, . ) { 65,538 ( 0.01%) 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 { 65,546 ( 0.01%) let attrs = cx.tcx.hir_attrs(hir_id); 3,407,976 ( 0.27%) => ???:::hir_attrs (65,538x) . get_builtin_attr(attrs, sym::author).count() > 0 . } -------------------------------------------------------------------------------- -- 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 { 589,842 ( 0.05%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::Cast(cast_from_expr, cast_to_hir) = expr.kind { . if expr.span.in_external_macro(cx.sess().source_map()) { . return; . } . if is_hir_ty_cfg_dependant(cx, cast_to_hir) { . return; . } . let (cast_from, cast_to) = ( . cx.typeck_results().expr_ty(cast_from_expr), -- line 900 ---------------------------------------- -- line 938 ---------------------------------------- . . let was_borrow_as_ptr_emitted = self.msrv.meets(cx, msrvs::BORROW_AS_PTR) . && borrow_as_ptr::check(cx, expr, cast_from_expr, cast_to_hir, self.msrv); . if !was_borrow_as_ptr_emitted && self.msrv.meets(cx, msrvs::PTR_FROM_REF) { . ref_as_ptr::check(cx, expr, cast_from_expr, cast_to_hir); . } . } . 458,766 ( 0.04%) if self.msrv.meets(cx, msrvs::RAW_REF_OP) { 983,070 ( 0.08%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (65,538x) 196,614 ( 0.02%) borrow_as_ptr::check_implicit_cast(cx, expr); 1,179,685 ( 0.10%) => /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 (65,538x) . } 393,228 ( 0.03%) if self.msrv.meets(cx, msrvs::PTR_SLICE_RAW_PARTS) { 983,070 ( 0.08%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:::meets (65,538x) 196,614 ( 0.02%) cast_slice_from_raw_parts::check_implicit_cast(cx, expr); 1,441,839 ( 0.12%) => /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 (65,538x) . } 196,614 ( 0.02%) cast_ptr_alignment::check_cast_method(cx, expr); 851,994 ( 0.07%) => /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 (65,538x) 262,152 ( 0.02%) cast_slice_different_sizes::check(cx, expr, self.msrv); 11,338,065 ( 0.91%) => /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 (65,538x) 196,614 ( 0.02%) ptr_cast_constness::check_null_ptr_cast_method(cx, expr); 983,070 ( 0.08%) => /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 (65,538x) 524,304 ( 0.04%) } . . fn check_body(&mut self, cx: &LateContext<'tcx>, body: &rustc_hir::Body<'tcx>) { 9 ( 0.00%) needless_type_cast::check(cx, body); 2,687,322 ( 0.22%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/casts/needless_type_cast.rs:clippy_lints::casts::needless_type_cast::check (3x) . } . } -------------------------------------------------------------------------------- -- 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 { 589,842 ( 0.05%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 131,077 ( 0.01%) if e.span.from_expansion() { . return; . } . . if let ExprKind::Binary(Spanned { node, .. }, left_side, right_side) = e.kind . && is_expn_of(left_side.span, sym::cfg).is_none() . && is_expn_of(right_side.span, sym::cfg).is_none() . && cx.typeck_results().expr_ty(left_side).is_bool() . && cx.typeck_results().expr_ty(right_side).is_bool() -- line 48 ---------------------------------------- -- line 94 ---------------------------------------- . Some(( . |l: Sugg<'tcx>, r: Sugg<'tcx>| l.bit_and(&(!r)), . "order comparisons between booleans can be simplified", . )), . ), . _ => (), . } . } 524,304 ( 0.04%) } . } . . fn check_comparison<'a, 'tcx>( . cx: &LateContext<'tcx>, . e: &'tcx Expr<'_>, . left_true: Option<(impl FnOnce(Sugg<'a>) -> Sugg<'a>, &'static str)>, . left_false: Option<(impl FnOnce(Sugg<'a>) -> Sugg<'a>, &'static str)>, . right_true: Option<(impl FnOnce(Sugg<'a>) -> Sugg<'a>, &'static str)>, -- line 110 ---------------------------------------- 131,076 ( 0.01%) -------------------------------------------------------------------------------- -- 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)] 524,304 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . // Skip path expressions from deref calls. e.g. `Deref::deref(e)` 131,076 ( 0.01%) if Some(expr.hir_id) == self.skip_expr.take() { . return; . } . . if let Some(local) = expr.res_local_id() { . self.check_local_usage(cx, expr, local); . } . . // Stop processing sub expressions when a macro call is seen 131,076 ( 0.01%) if expr.span.from_expansion() { . 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 131,076 ( 0.01%) if let Some((state, data)) = self.state.take() { . self.report(cx, expr, state, data, typeck); . } . return; . }; . self.skip_expr = skip_expr; . . if is_from_proc_macro(cx, expr) { . if let Some((state, data)) = self.state.take() { -- line 272 ---------------------------------------- -- 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), . } 524,304 ( 0.04%) } . . fn check_pat(&mut self, cx: &LateContext<'tcx>, pat: &'tcx Pat<'_>) { . if let PatKind::Binding(BindingMode::REF, id, name, _) = pat.kind { . if let Some(opt_prev_pat) = self.ref_locals.get_mut(&id) { . // This binding id has been seen before. Add this pattern to the list of changes. . if let Some(prev_pat) = opt_prev_pat { . if pat.span.from_expansion() { . // Doesn't match the context of the previous pattern. Can't lint here. -- line 658 ---------------------------------------- -- line 687 ---------------------------------------- . replacements: vec![(pat.span, snip.into())], . hir_id: pat.hir_id, . }), . ); . } . } . } . 21 ( 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; . } 24 ( 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 8 ( 0.00%) if !self.in_deref_impl() && is_deref_or_derefmut_impl(cx, item) { . self.outermost_deref_impl = Some(item.owner_id); . } . } . . fn check_item_post(&mut self, _cx: &LateContext<'_>, item: &Item<'_>) { . // Only clear `self.outermost_deref_impl` if we're escaping the _outermost_ `impl Deref(Mut)` . if self.outermost_deref_impl == Some(item.owner_id) { . self.outermost_deref_impl = None; . } . } . } . . fn is_deref_or_derefmut_impl(cx: &LateContext<'_>, item: &Item<'_>) -> bool { 16 ( 0.00%) if let hir::ItemKind::Impl(impl_) = item.kind . && let Some(of_trait) = impl_.of_trait . && let Some(trait_id) = of_trait.trait_ref.trait_def_id() . { . cx.tcx.lang_items().deref_trait() == Some(trait_id) || cx.tcx.lang_items().deref_mut_trait() == Some(trait_id) . } else { . false . } . } . . fn try_parse_ref_op<'tcx>( . tcx: TyCtxt<'tcx>, . typeck: &'tcx TypeckResults<'_>, . expr: &'tcx Expr<'_>, . ) -> Option<(RefOp, &'tcx Expr<'tcx>, Option)> { 393,225 ( 0.03%) let (call_path_id, def_id, arg) = match expr.kind { . ExprKind::MethodCall(_, arg, [], _) => (None, typeck.type_dependent_def_id(expr.hir_id)?, arg), . ExprKind::Call( . &Expr { . kind: ExprKind::Path(QPath::Resolved(None, path)), . hir_id, . .. . }, . [arg], -- line 759 ---------------------------------------- 131,082 ( 0.01%) -------------------------------------------------------------------------------- -- 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; . 589,842 ( 0.05%) pub(super) fn check(cx: &LateContext<'_>, expr: &Expr<'_>) { 131,076 ( 0.01%) if expr.span.from_expansion() { . if let Some(macro_call) = root_macro_call_first_node(cx, expr) . && let Some(diag_name) = cx.tcx.get_diagnostic_name(macro_call.def_id) . { . let result = match diag_name { . sym::assert_eq_macro | sym::debug_assert_eq_macro => "succeed", . sym::assert_ne_macro | sym::debug_assert_ne_macro => "fail", . _ => return, . }; -- line 18 ---------------------------------------- -- line 33 ---------------------------------------- . "`{}` of unit values detected. This will always {result}", . cx.tcx.item_name(macro_call.def_id) . ), . ); . } . return; . } . 131,076 ( 0.01%) if let ExprKind::Binary(ref cmp, left, _) = expr.kind { . let op = cmp.node; . if op.is_comparison() && cx.typeck_results().expr_ty(left).is_unit() { . let result = match op { . BinOpKind::Eq | BinOpKind::Le | BinOpKind::Ge => "true", . _ => "false", . }; . span_lint( . cx, -- line 49 ---------------------------------------- -- line 51 ---------------------------------------- . expr.span, . format!( . "{}-comparison of unit values detected. This will always be {result}", . op.as_str() . ), . ); . } . } 524,304 ( 0.04%) } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/doc/mod.rs -------------------------------------------------------------------------------- Ir -- line 731 ---------------------------------------- . valid_idents: &'static FxHashSet, . check_private_items: bool, . } . . impl Documentation { . pub fn new(conf: &'static Conf) -> Self { . Self { . valid_idents: &conf.doc_valid_idents, 3 ( 0.00%) check_private_items: conf.check_private_items, . } . } . } . . impl EarlyLintPass for Documentation { 458,794 ( 0.04%) fn check_attributes(&mut self, cx: &EarlyContext<'_>, attrs: &[rustc_ast::Attribute]) { . include_in_doc_without_cfg::check(cx, attrs); 524,336 ( 0.04%) } . } . . impl<'tcx> LateLintPass<'tcx> for Documentation { 655,430 ( 0.05%) fn check_attributes(&mut self, cx: &LateContext<'tcx>, attrs: &'tcx [Attribute]) { 655,430 ( 0.05%) let Some(headers) = check_attrs(cx, self.valid_idents, attrs) else { . return; . }; . 1,048,700 ( 0.08%) match cx.tcx.hir_node(cx.last_node_with_lint_attrs) { 4,063,666 ( 0.33%) => ???:::hir_node (65,543x) . Node::Field(FieldDef { span, safety, .. }) => match (headers.safety, safety) { . (false, Safety::Unsafe) => span_lint( . cx, . MISSING_SAFETY_DOC, . *span, . "docs for unsafe field missing `# Safety` section", . ), . (true, Safety::Safe) if cx.tcx.features().unsafe_fields() => span_lint_and_help( -- line 764 ---------------------------------------- -- line 766 ---------------------------------------- . UNNECESSARY_SAFETY_DOC, . *span, . "field with `# Safety` documentation is not marked unsafe", . None, . "if the field has safety invariants, mark it `unsafe`", . ), . _ => (), . }, 4 ( 0.00%) Node::Item(item) => { . too_long_first_doc_paragraph::check( . cx, . item, . attrs, 8 ( 0.00%) headers.first_paragraph_text_len, 4 ( 0.00%) headers.first_paragraph_md_len, 4 ( 0.00%) self.check_private_items, . ); 18 ( 0.00%) match item.kind { . ItemKind::Fn { sig, body, .. } 6 ( 0.00%) if !(is_entrypoint_fn(cx, item.owner_id.to_def_id()) 1,843 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_entrypoint_fn (1x) . || item.span.in_external_macro(cx.tcx.sess.source_map())) => . { . missing_headers::check(cx, item.owner_id, sig, headers, Some(body), self.check_private_items); . }, . ItemKind::Trait { safety, .. } => match (headers.safety, safety) { . (false, Safety::Unsafe) => span_lint( . cx, . MISSING_SAFETY_DOC, -- line 793 ---------------------------------------- -- line 824 ---------------------------------------- . headers, . Some(body_id), . self.check_private_items, . ); . } . }, . _ => {}, . } 524,344 ( 0.04%) } . } . . #[derive(Copy, Clone)] . struct Fragments<'a> { . doc: &'a str, . fragments: &'a [DocFragment], . } . -- line 840 ---------------------------------------- -- line 867 ---------------------------------------- . // We don't want the parser to choke on intra doc links. Since we don't . // actually care about rendering them, just pretend that all broken links . // point to a fake address. . #[expect(clippy::unnecessary_wraps)] // we're following a type signature . fn fake_broken_link_callback<'a>(_: BrokenLink<'_>) -> Option<(CowStr<'a>, CowStr<'a>)> { . Some(("fake".into(), "fake".into())) . } . 393,258 ( 0.03%) if suspicious_doc_comments::check(cx, attrs) || is_doc_hidden(attrs) { 3,867,064 ( 0.31%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/doc/suspicious_doc_comments.rs:clippy_lints::doc::suspicious_doc_comments::check (65,543x) . return None; . } . 131,086 ( 0.01%) let (fragments, _) = attrs_to_doc_fragments( . attrs.iter().filter_map(|attr| { . if attr.doc_str_and_fragment_kind().is_none() || attr.span().in_external_macro(cx.sess().source_map()) { . None . } else { . Some((attr, None)) . } . }), . true, -- line 887 ---------------------------------------- -- line 889 ---------------------------------------- . . let mut doc = String::with_capacity(fragments.iter().map(|frag| frag.doc.as_str().len() + 1).sum()); . . for fragment in &fragments { . add_doc_fragment(&mut doc, fragment); . } . doc.pop(); . 65,543 ( 0.01%) if doc.trim().is_empty() { 196,629 ( 0.02%) if let Some(span) = span_of_fragments(&fragments) { 786,516 ( 0.06%) => ???:rustc_resolve::rustdoc::span_of_fragments (65,543x) . span_lint_and_help( . cx, . EMPTY_DOCS, . span, . "empty doc comment", . None, . "consider removing or filling it", . ); . } 196,629 ( 0.02%) return Some(DocHeaders::default()); . } . . // Only emits the allow-by-default `DOC_LINK_CODE`; skip its extra markdown reparse when it's off. . if !clippy_utils::is_lint_allowed(cx, DOC_LINK_CODE, cx.last_node_with_lint_attrs) { . check_for_code_clusters( . cx, . pulldown_cmark::Parser::new_with_broken_link_callback( . &doc, -- line 916 ---------------------------------------- 196,637 ( 0.02%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/collapsible_if.rs -------------------------------------------------------------------------------- Ir -- line 256 ---------------------------------------- . . // There are other attributes, which are significant tokens -- check failed . _ => false, . } . } . } . . impl LateLintPass<'_> for CollapsibleIf { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::If(cond, then, else_) = &expr.kind . && !expr.span.from_expansion() . { . if let Some(else_) = else_ . // Short circuit if both `if` branches contain only a single `if {..} else {}`, as . // collapsing such blocks can lead to less readable code (#4971) . && !(single_inner_if_else(then) && single_inner_if_else(else_)) . && let ExprKind::Block(else_, None) = else_.kind . { -- line 273 ---------------------------------------- -- line 274 ---------------------------------------- . self.check_collapsible_else_if(cx, then.span, else_); . } else if else_.is_none() . && self.eligible_condition(cx, cond) . && let ExprKind::Block(then, None) = then.kind . { . self.check_collapsible_if_if(cx, expr, cond, then); . } . } 524,304 ( 0.04%) } . } . . /// Returns true if `expr` is a block that contains only one `if {..} else {}` statement . fn single_inner_if_else(expr: &Expr<'_>) -> bool { . if let ExprKind::Block(block, None) = expr.kind . && let Some(inner_expr) = expr_block(block) . && let ExprKind::If(_, _, else_) = inner_expr.kind . && else_.is_some() -- line 290 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/string_patterns.rs -------------------------------------------------------------------------------- Ir -- line 222 ---------------------------------------- . ); . } . }, . ); . } . } . . impl<'tcx> LateLintPass<'tcx> for StringPatterns { 393,228 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 131,077 ( 0.01%) if !expr.span.from_expansion() . && let ExprKind::MethodCall(method, receiver, args, _) = expr.kind . && let method_name = method.ident.name . && let Some(&(_, pos)) = PATTERN_METHODS . .iter() . .find(|(array_method_name, _)| *array_method_name == method_name) . && let Some(arg) = args.get(pos) . && let ty::Ref(_, ty, _) = cx.typeck_results().expr_ty_adjusted(receiver).kind() . && ty.is_str() . { . check_single_char_pattern_lint(cx, arg); . . check_manual_pattern_char_comparison(cx, arg, self.msrv); . } 393,228 ( 0.03%) } . } 131,076 ( 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/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)] 16 ( 0.00%) #[derive(Copy, Debug, Hash)] . #[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 { 196,640 ( 0.02%) matches!(*self, Some(_)) . } . . /// Returns `true` if the option is a [`Some`] and the value inside of it matches a predicate. . /// . /// # Examples . /// . /// ``` . /// let x: Option = Some(2); -- line 642 ---------------------------------------- -- line 652 ---------------------------------------- . /// assert_eq!(x.as_ref().is_some_and(|x| x.len() > 1), true); . /// println!("still alive {:?}", x); . /// ``` . #[must_use] . #[inline] . #[stable(feature = "is_some_and", since = "1.70.0")] . #[rustc_const_unstable(feature = "const_option_ops", issue = "143956")] . pub const fn is_some_and(self, f: impl [const] FnOnce(T) -> bool + [const] Destruct) -> bool { 131,080 ( 0.01%) match self { . None => false, 14 ( 0.00%) Some(x) => f(x), . } . } . . /// Returns `true` if the option is a [`None`] value. . /// . /// # Examples . /// . /// ``` -- line 670 ---------------------------------------- -- line 701 ---------------------------------------- . /// assert_eq!(x.as_ref().is_none_or(|x| x.len() > 1), true); . /// println!("still alive {:?}", x); . /// ``` . #[must_use] . #[inline] . #[stable(feature = "is_none_or", since = "1.82.0")] . #[rustc_const_unstable(feature = "const_option_ops", issue = "143956")] . pub const fn is_none_or(self, f: impl [const] FnOnce(T) -> bool + [const] Destruct) -> bool { 262,154 ( 0.02%) match self { . None => true, . Some(x) => f(x), . } . } . . ///////////////////////////////////////////////////////////////////////// . // Adapter for working with references . ///////////////////////////////////////////////////////////////////////// -- line 717 ---------------------------------------- -- line 735 ---------------------------------------- . /// // then consume *that* with `map`, leaving `text` on the stack. . /// let text_length: Option = text.as_ref().map(|s| s.len()); . /// println!("still can print text: {text:?}"); . /// ``` . #[inline] . #[rustc_const_stable(feature = "const_option_basics", since = "1.48.0")] . #[stable(feature = "rust1", since = "1.0.0")] . pub const fn as_ref(&self) -> Option<&T> { 62 ( 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> { 185 ( 0.00%) match *self { . Some(ref mut x) => Some(x), . None => None, . } . } . . /// Converts from [Pin]<[&]Option\> to Option<[Pin]<[&]T>>. . /// . /// [&]: reference "shared reference" -- line 773 ---------------------------------------- -- line 802 ---------------------------------------- . None => None, . } . } . } . . #[inline] . const fn len(&self) -> usize { . // Using the intrinsic avoids emitting a branch to get the 0 or 1. 15 ( 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 { 393,232 ( 0.03%) match self { 2 ( 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 { 98 ( 0.00%) match self { 68 ( 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, . { 4 ( 0.00%) match self { 2 ( 0.00%) Some(x) => x, . None => default, . } . } . . /// Returns the contained [`Some`] value or computes it from a closure. . /// . /// # Examples . /// -- line 1049 ---------------------------------------- -- line 1055 ---------------------------------------- . #[inline] . #[track_caller] . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_option_ops", issue = "143956")] . pub const fn unwrap_or_else(self, f: F) -> T . where . F: [const] FnOnce() -> T + [const] Destruct, . { 3 ( 0.00%) match self { . Some(x) => x, . None => f(), . } . } . . /// Returns the contained [`Some`] value or a default. . /// . /// Consumes the `self` argument then, if [`Some`], returns the contained -- line 1071 ---------------------------------------- -- 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, . { 29 ( 0.00%) match self { 12 ( 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, . { 131,233 ( 0.01%) match self { 118 ( 0.00%) Some(x) => Some(f(x)), . None => None, . } . } . . /// Calls a function with a reference to the contained value if [`Some`]. . /// . /// Returns the original option. . /// -- line 1171 ---------------------------------------- -- line 1219 ---------------------------------------- . #[stable(feature = "rust1", since = "1.0.0")] . #[must_use = "if you don't need the returned value, use `if let` instead"] . #[rustc_const_unstable(feature = "const_option_ops", issue = "143956")] . pub const fn map_or(self, default: U, f: F) -> U . where . F: [const] FnOnce(T) -> U + [const] Destruct, . U: [const] Destruct, . { 58 ( 0.00%) match self { . Some(t) => f(t), . None => default, . } 8 ( 0.00%) } . . /// 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, . { 131,073 ( 0.01%) match self { . Some(t) => f(t), . None => default(), . } . } . . /// 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`. -- line 1282 ---------------------------------------- -- 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, . { 6 ( 0.00%) match self { 26 ( 0.00%) Some(x) => f(x), . 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 -- line 1550 ---------------------------------------- -- 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, . { 196,614 ( 0.02%) if let Some(x) = self { . if predicate(&x) { . return Some(x); . } . } 65,538 ( 0.01%) None . } . . /// 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. . /// -- line 1592 ---------------------------------------- -- 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, . { 3 ( 0.00%) match self { . x @ Some(_) => x, . None => f(), . } . } . . /// Returns [`Some`] if exactly one of `self`, `optb` is [`Some`], otherwise returns [`None`]. . /// . /// # Examples -- line 1658 ---------------------------------------- -- line 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 { 69 ( 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 { 28 ( 0.00%) match self { . Some(x) => Some(x.clone()), . None => None, . } . } . . #[inline] . fn clone_from(&mut self, source: &Self) { . match (self, source) { -- line 2282 ---------------------------------------- -- line 2431 ---------------------------------------- . impl crate::marker::StructuralPartialEq for Option {} . #[stable(feature = "rust1", since = "1.0.0")] . #[rustc_const_unstable(feature = "const_cmp", issue = "143800")] . const impl PartialEq for Option { . #[inline] . fn eq(&self, other: &Self) -> bool { . // Spelling out the cases explicitly optimizes better than . // `_ => false` 1,048,734 ( 0.08%) match (self, other) { . (Some(l), Some(r)) => *l == *r, . (Some(_), None) => false, . (None, Some(_)) => false, . (None, None) => true, . } . } . } . -- line 2447 ---------------------------------------- -- line 2861 ---------------------------------------- . . #[inline] . fn from_output(output: Self::Output) -> Self { . Some(output) . } . . #[inline] . fn branch(self) -> ControlFlow { 262,230 ( 0.02%) match self { . 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 { 8 ( 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 ---------------------------------------- 328,079 ( 0.03%) -------------------------------------------------------------------------------- -- 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 { 524,304 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 131,077 ( 0.01%) if !expr.span.from_expansion() . && let ExprKind::Call(nonnull_new_unchecked, [arg]) = expr.kind . && let ExprKind::Call(box_into_raw, [arg]) = arg.kind . && nonnull_new_unchecked . .ty_rel_def_if_named(cx, sym::new_unchecked) . .opt_parent(cx) . .opt_impl_ty(cx) . .is_diag_item(cx, sym::NonNull) . && box_into_raw -- line 60 ---------------------------------------- -- line 89 ---------------------------------------- . } else { . format!("NonNull::from(Box::leak({arg_name}))") . }; . . diag.span_suggestion(span, "try", sugg, app); . }, . ); . } 524,304 ( 0.04%) } . } 131,076 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/size_of_in_element_count.rs -------------------------------------------------------------------------------- Ir -- line 71 ---------------------------------------- . sym::add, . sym::wrapping_add, . sym::sub, . sym::wrapping_sub, . sym::offset, . sym::wrapping_offset, . ]; . 327,690 ( 0.03%) if let ExprKind::Call(func, [.., count]) = expr.kind . // Find calls to ptr::{copy, copy_nonoverlapping} . // and ptr::swap_nonoverlapping, . && let ExprKind::Path(ref func_qpath) = func.kind . && let Some(def_id) = cx.qpath_res(func_qpath, func.hir_id).opt_def_id() . && matches!(cx.tcx.get_diagnostic_name(def_id), Some( . sym::ptr_copy . | sym::ptr_copy_nonoverlapping . | sym::ptr_slice_from_raw_parts -- line 87 ---------------------------------------- -- line 106 ---------------------------------------- . cx.typeck_results().expr_ty(ptr_self).kind() . { . return Some((*pointee_ty, count)); . } . None . } . . impl<'tcx> LateLintPass<'tcx> for SizeOfInElementCount { 393,228 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . const HELP_MSG: &str = "use a count of elements instead of a count of bytes\ . , it already gets multiplied by the size of the type"; . . const LINT_MSG: &str = "found a count of bytes \ . instead of a count of elements of `T`"; . . if let Some((pointee_ty, count_expr)) = get_pointee_ty_and_count_expr(cx, expr) . // Using a number of bytes for a byte type isn't suspicious -- line 122 ---------------------------------------- -- line 126 ---------------------------------------- . . // Find a size_of call in the count parameter expression and . // check that it's the same type . && let Some(ty_used_for_size_of) = get_size_of_ty(cx, count_expr, false) . && pointee_ty == ty_used_for_size_of . { . span_lint_and_help(cx, SIZE_OF_IN_ELEMENT_COUNT, count_expr.span, LINT_MSG, None, HELP_MSG); . } 393,228 ( 0.03%) } . } -------------------------------------------------------------------------------- -- 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>) { 262,152 ( 0.02%) if let ExprKind::MethodCall(_method, receiver, args, _) = expr.kind { . for arg in args { . check_closure(cx, Some(receiver), arg); . } . } . if let ExprKind::Call(func, args) = expr.kind { . check_closure(cx, None, func); . for arg in args { . check_closure(cx, None, arg); -- line 83 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 524,304 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::If(cond, then, Some(otherwise)) = expr.kind . && let ExprKind::Path(_) = cond.kind . && let ExprKind::Block( . Block { . stmts: [stmt], . expr: Some(then_expr), . .. . }, . .., -- line 65 ---------------------------------------- -- line 98 ---------------------------------------- . expr.span, . "use", . format!("{negate}{std_or_core}::mem::take(&mut {taken})"), . app, . ); . }, . ); . } 524,304 ( 0.04%) } . } . . 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/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 { 196,614 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 131,076 ( 0.01%) if let ExprKind::MethodCall(path, receiver, [arg], _) = &expr.kind . && let ExprKind::Lit(lit) = &arg.kind . && LitKind::Bool(false) == lit.node . && path.ident.name == sym::set_readonly . && cx . .typeck_results() . .expr_ty(receiver) . .is_diag_item(cx, sym::FsPermissions) . { -- line 44 ---------------------------------------- -- 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", . ); . }, . ); . } 262,152 ( 0.02%) } . } -------------------------------------------------------------------------------- -- 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 { 65,538 ( 0.01%) 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 { 25 ( 0.00%) fn into_range(self) -> Range { . let data = self.data(); 10 ( 0.00%) data.lo..data.hi 10 ( 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 104 ---------------------------------------- . fn with_ctxt(self, ctxt: SyntaxContext) -> Span { . Span::new(self.start, self.end, ctxt, None) . } . } . . 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. 4 ( 0.00%) fn get_text<'sm>(self, sm: impl HasSourceMap<'sm>) -> Option { 14 ( 0.00%) get_source_range(sm.source_map(), self.into_range()).and_then(SourceText::new) 283 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::get_source_range (1x) 17 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:::into_range (1x) 5 ( 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 { . get_source_range(sm.source_map(), self.into_range()) . } . . /// Calls the given function with the source text referenced and returns the value. Returns . /// `None` if the source text cannot be retrieved. 5 ( 0.00%) fn with_source_text<'sm, T>(self, sm: impl HasSourceMap<'sm>, f: impl for<'a> FnOnce(&'a str) -> T) -> Option { 11 ( 0.00%) with_source_text(sm.source_map(), self.into_range(), f) 94 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:::into_range (1x) 6 ( 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 { 1 ( 0.00%) self.with_source_text(sm, pred).unwrap_or(false) 41,019,037 ( 3.31%) => 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 177 ---------------------------------------- . } . } . 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. 2 ( 0.00%) pub fn new(text: SourceFileRange) -> Option { . if text.as_str().is_some() { 8 ( 0.00%) Some(Self(text)) . } else { . None . } 2 ( 0.00%) } . . /// Gets the source text. . pub fn as_str(&self) -> &str { . self.0.as_str().unwrap() . } . . /// Converts this into an owned string. . pub fn to_owned(&self) -> String { . self.as_str().to_owned() . } . } . impl Deref for SourceText { . type Target = str; . fn deref(&self) -> &Self::Target { . self.as_str() 2 ( 0.00%) } . } . impl AsRef for SourceText { . fn as_ref(&self) -> &str { . self.as_str() . } . } . impl Index for SourceText . where -- line 215 ---------------------------------------- -- line 226 ---------------------------------------- . } . } . impl fmt::Debug for SourceText { . fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { . self.as_str().fmt(f) . } . } . 50 ( 0.00%) fn get_source_range(sm: &SourceMap, sp: Range) -> Option { 40 ( 0.00%) let start = sm.lookup_byte_offset(sp.start); 550 ( 0.00%) => ???:::lookup_byte_offset (5x) 25 ( 0.00%) let end = sm.lookup_byte_offset(sp.end); 550 ( 0.00%) => ???:::lookup_byte_offset (5x) 15 ( 0.00%) if !Arc::ptr_eq(&start.sf, &end.sf) || start.pos > end.pos { . return None; . } 15 ( 0.00%) sm.ensure_source_file_source_present(&start.sf); 115 ( 0.00%) => ???:::ensure_source_file_source_present (5x) . let range = start.pos.to_usize()..end.pos.to_usize(); 20 ( 0.00%) Some(SourceFileRange { sf: start.sf, range }) 45 ( 0.00%) } . 11 ( 0.00%) fn with_source_text(sm: &SourceMap, sp: Range, f: impl for<'a> FnOnce(&'a str) -> T) -> Option { 27 ( 0.00%) if let Some(src) = get_source_range(sm, sp) 303 ( 0.00%) => site/frontend/rust-clippy/clippy_utils/src/source.rs:clippy_utils::source::get_source_range (1x) 7 ( 0.00%) && let Some(src) = src.as_str() 28 ( 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 (1x) . { . Some(f(src)) . } else { . None . } 8 ( 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 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())) 2 ( 0.00%) } . } . . /// Like [`snippet_block`], but add braces if the expr is not an `ExprKind::Block` with no label. . pub fn expr_block<'sm>( . sm: impl HasSourceMap<'sm>, . expr: &Expr<'_>, . outer: SyntaxContext, . default: &str, -- line 371 ---------------------------------------- -- line 583 ---------------------------------------- . *applicability = Applicability::HasPlaceholders; . } . Cow::Borrowed(default) . } . } . . /// Converts a span to a code snippet. Returns `None` if not available. . pub fn snippet_opt<'sm>(sm: impl HasSourceMap<'sm>, span: Span) -> Option { 196,609 ( 0.02%) sm.source_map().span_to_snippet(span).ok() 330 ( 0.00%) => ???:::span_to_snippet (1x) . } . . /// 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 -- line 599 ---------------------------------------- 18 ( 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { 262,152 ( 0.02%) if let Some(args) = VecArgs::hir(cx, expr) 1,114,146 ( 0.09%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (65,538x) . && let VecArgs::Repeat(inner_expr, len) = args . && let ExprKind::Lit(l) = len.kind . && let LitKind::Int(Pu128(0), _) = l.node . { . inner_check(cx, expr, inner_expr, true); . } . // Lint only if the length is a literal zero, and not a path to any constants. . // NOTE(@y21): When reading `[f(); LEN]`, I intuitively expect that the function is called and it . // doesn't seem as confusing as `[f(); 0]`. It would also have false positives when eg. . // the const item depends on `#[cfg]s` and has different values in different compilation . // sessions). 131,076 ( 0.01%) else if let ExprKind::Repeat(inner_expr, const_arg) = expr.kind . && let ConstArgKind::Anon(anon_const) = const_arg.kind . && let length_expr = cx.tcx.hir_body(anon_const.body).value . && !length_expr.span.from_expansion() . && let ExprKind::Lit(literal) = length_expr.kind . && let LitKind::Int(Pu128(0), _) = literal.node . { . inner_check(cx, expr, inner_expr, false); . } 327,690 ( 0.03%) } . } . . fn inner_check(cx: &LateContext<'_>, expr: &'_ Expr<'_>, inner_expr: &'_ Expr<'_>, is_vec: bool) { . // check if expr is a call or has a call inside it . if inner_expr.can_have_side_effects() { . let parent_hir_node = cx.tcx.parent_hir_node(expr.hir_id); . let inner_expr_ty = cx.typeck_results().expr_ty(inner_expr); . let return_type = cx.typeck_results().expr_ty(expr); -- line 78 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/bool_assert_comparison.rs -------------------------------------------------------------------------------- Ir -- line 68 ---------------------------------------- . .tcx . .normalize_erasing_regions(cx.typing_env(), Unnormalized::new_wip(proj)); . . nty.is_bool() . }) . } . . impl<'tcx> LateLintPass<'tcx> for BoolAssertComparison { 589,842 ( 0.05%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . let Some(macro_call) = root_macro_call_first_node(cx, expr) else { . return; . }; . let eq_macro = match cx.tcx.get_diagnostic_name(macro_call.def_id) { . Some(sym::assert_eq_macro | sym::debug_assert_eq_macro) => true, . Some(sym::assert_ne_macro | sym::debug_assert_ne_macro) => false, . _ => return, . }; -- line 84 ---------------------------------------- -- line 148 ---------------------------------------- . . diag.multipart_suggestion( . format!("replace it with `{non_eq_mac}!(..)`"), . suggestions, . applicability, . ); . }, . ); 524,304 ( 0.04%) } . } -------------------------------------------------------------------------------- -- 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::Unary(UnOp::Not, inner) = expr.kind . && let ExprKind::Binary(ref op, left, _) = inner.kind . && let BinOpKind::Le | BinOpKind::Ge | BinOpKind::Lt | BinOpKind::Gt = op.node . && !expr.span.in_external_macro(cx.sess().source_map()) . { . let ty = cx.typeck_results().expr_ty(left); . . let implements_ord = { . if let Some(id) = cx.tcx.get_diagnostic_item(sym::Ord) { -- line 55 ---------------------------------------- -- line 74 ---------------------------------------- . expr.span, . "the use of negated comparison operators on partially ordered \ . types produces code that is hard to read and refactor, please \ . consider using the `partial_cmp` method instead, to make it \ . clear that the two values could be incomparable", . ); . } . } 524,304 ( 0.04%) } . } -------------------------------------------------------------------------------- -- 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 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, . { 131,136 ( 0.01%) let thread_local = unsafe { (self.inner)(None).as_ref().ok_or(AccessError)? }; 3 ( 0.00%) => ???:>>,)>>::call_once (1x) 65,613 ( 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 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 458,759 ( 0.04%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 131,074 ( 0.01%) if expr.span.from_expansion() { . return; . } . 327,685 ( 0.03%) if let ExprKind::Binary(Spanned { node: op, .. }, ref left, ref right) = expr.kind { . let span_sugg = |lint: &'static Lint, expr: &Expr, sugg, appl| { . span_lint_and_sugg( . cx, . lint, . expr.span, . "operator precedence might not be obvious", . "consider parenthesizing your expression", . sugg, -- line 63 ---------------------------------------- -- line 119 ---------------------------------------- . vec![ . (closure.fn_decl_span.shrink_to_lo(), String::from("(")), . (closure.body.span.shrink_to_hi(), String::from(")")), . ], . Applicability::MachineApplicable, . ); . }); . } 524,296 ( 0.04%) } . } . . fn get_bin_opt(expr: &Expr) -> Option { . match expr.kind { . ExprKind::Binary(Spanned { node: op, .. }, _, _) => Some(op), . _ => None, . } . } -- line 135 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 196,614 ( 0.02%) if let ExprKind::Let(lt) = expr.kind . && match lt.pat.kind { . PatKind::Slice([], None, []) => true, . PatKind::Expr(lit) . if let PatExprKind::Lit { lit, .. } = lit.kind . && let LitKind::Str(lit, _) = lit.node => . { . lit.as_str().is_empty() . }, -- line 113 ---------------------------------------- -- 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, . ); . } . 131,076 ( 0.01%) if let ExprKind::MethodCall(method, lhs_expr, [rhs_expr], _) = expr.kind . && cx.ty_based_def(expr).opt_parent(cx).is_diag_item(cx, sym::PartialEq) . && !expr.span.from_expansion() . { . self.check_empty_expr( . cx, . expr.span, . lhs_expr, . peel_ref_operators(cx, rhs_expr), -- line 143 ---------------------------------------- -- line 144 ---------------------------------------- . if method.ident.name == sym::ne { . "!" . } else { . Default::default() . }, . ); . } . 131,076 ( 0.01%) if let ExprKind::Binary(Spanned { node: cmp, .. }, left, right) = expr.kind . && !expr.span.from_expansion() . { . // expr.span might contains parenthesis, see issue #10529 . let actual_span = span_without_enclosing_paren(cx, expr.span); . match cmp { . BinOpKind::Eq => { . self.check_cmp(cx, actual_span, left, right, "", 0); // len == 0 . self.check_cmp(cx, actual_span, right, left, "", 0); // 0 == len -- line 160 ---------------------------------------- -- line 171 ---------------------------------------- . self.check_cmp(cx, actual_span, left, right, "", 1); // len < 1 . self.check_cmp(cx, actual_span, right, left, "!", 0); // 0 < len . }, . BinOpKind::Ge => self.check_cmp(cx, actual_span, left, right, "!", 1), // len >= 1 . BinOpKind::Le => self.check_cmp(cx, actual_span, right, left, "!", 1), // 1 <= len . _ => (), . } . } 524,304 ( 0.04%) } . } . . impl LenZero { . fn check_cmp( . &self, . cx: &LateContext<'_>, . span: Span, . method: &Expr<'_>, -- line 187 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { . // Cheap kind check before the costlier const context query. 65,538 ( 0.01%) if matches!( 131,076 ( 0.01%) expr.kind, . ExprKind::If(..) | ExprKind::Match(..) | ExprKind::MethodCall(..) | ExprKind::Call(..) . ) && !expr.span.from_expansion() . && !is_in_const_context(cx) . { . let suggestion = is_if_elseif_else_pattern(cx, expr) . .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); . } . } 524,304 ( 0.04%) } . 7 ( 0.00%) fn check_block(&mut self, cx: &LateContext<'tcx>, block: &'tcx Block<'tcx>) { . // Cheap `if`-statement check before the costlier const context query. 1 ( 0.00%) if !block . .stmts . .iter() . .any(|stmt| matches!(stmt.kind, StmtKind::Expr(e) if matches!(e.kind, ExprKind::If(..)))) . { . return; . } . . if is_in_const_context(cx) || !self.msrv.meets(cx, msrvs::CLAMP) { . return; . } . for suggestion in is_two_if_pattern(cx, block) { . maybe_emit_suggestion(cx, &suggestion); . } 8 ( 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 ---------------------------------------- 196,611 ( 0.02%) -------------------------------------------------------------------------------- -- 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. 779 ( 0.00%) __rust_no_alloc_shim_is_unstable_v2(); 2 ( 0.00%) => ???:std::exception::~exception() (2x) . 2,034 ( 0.00%) __rust_alloc(layout.size(), layout.alignment()) 76 ( 0.00%) => ???:__rustc::__rust_alloc (2x) . } . } . . /// Deallocates memory with the global allocator. . /// . /// This function forwards calls to the [`GlobalAlloc::dealloc`] method . /// of the allocator registered with the `#[global_allocator]` attribute . /// if there is one, or the `std` crate’s default. -- line 132 ---------------------------------------- -- line 161 ---------------------------------------- . pub unsafe fn dealloc(ptr: *mut u8, layout: Layout) { . unsafe { dealloc_nonnull(NonNull::new_unchecked(ptr), layout) } . } . . /// Same as [`dealloc`] but when you already have a non-null pointer . #[inline] . #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces . unsafe fn dealloc_nonnull(ptr: NonNull, layout: Layout) { 133,234 ( 0.01%) unsafe { __rust_dealloc(ptr, layout.size(), layout.alignment()) } 38 ( 0.00%) => ???:__rustc::__rdl_dealloc (1x) . } . . /// 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 { 15 ( 0.00%) unsafe { __rust_realloc(ptr, layout.size(), layout.alignment(), new_size) } 1,683 ( 0.00%) => ???:__rustc::__rust_realloc (3x) . } . . /// Allocates zero-initialized memory with the global allocator. . /// . /// This function forwards calls to the [`GlobalAlloc::alloc_zeroed`] method . /// of the allocator registered with the `#[global_allocator]` attribute . /// if there is one, or the `std` crate’s default. . /// -- line 230 ---------------------------------------- -- line 284 ---------------------------------------- . __rust_alloc_zeroed(layout.size(), layout.alignment()) . } . } . . impl Global { . #[inline] . #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces . fn alloc_impl_runtime(layout: Layout, zeroed: bool) -> Result, AllocError> { 38 ( 0.00%) match layout.size() { . 0 => Ok(layout.dangling_ptr().cast_slice(0)), . // SAFETY: `layout` is non-zero in size, . size => unsafe { 26 ( 0.00%) let raw_ptr = if zeroed { alloc_zeroed(layout) } else { alloc(layout) }; 4 ( 0.00%) => ???:std::exception::~exception() (4x) . let ptr = NonNull::new(raw_ptr).ok_or(AllocError)?; . Ok(ptr.cast_slice(size)) . }, . } . } . . #[inline] . #[cfg_attr(miri, track_caller)] // even without panics, this helps for Miri backtraces . fn deallocate_impl_runtime(ptr: NonNull, layout: Layout) { 40 ( 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 ---------------------------------------- 193 ( 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, . { 524,468 ( 0.04%) default fn from_iter(mut iterator: I) -> Self { . // Unroll the first iteration, as the vector is going to be . // expanded on this iteration in every case when the iterable is not . // empty, but the loop in extend_desugared() is not going to see the . // vector being full in the few subsequent loop iterations. . // So we get better branch prediction. 46 ( 0.00%) let mut vector = match iterator.next() { 101 ( 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 (4x) . None => return Vec::new(), 1 ( 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); . } 25 ( 0.00%) vector . } . }; . // must delegate to spec_extend() since extend() itself delegates . // to spec_from for empty Vecs 117 ( 0.00%) as SpecExtend>::spec_extend(&mut vector, iterator); 30 ( 0.00%) => ???:0x0000000000173dc0 (1x) 35 ( 0.00%) vector 590,024 ( 0.05%) } . } . . impl SpecFromIterNested for Vec . where . I: TrustedLen, . { 35 ( 0.00%) fn from_iter(iterator: I) -> Self { . 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 . vector.spec_extend(iterator); 18 ( 0.00%) vector 40 ( 0.00%) } . } 42 ( 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 { 524,304 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 131,076 ( 0.01%) if expr.span.from_expansion() { . return; . } . . let Some((cond, keyword, desc)) = higher::If::hir(expr) . .map(|hif| (hif.cond, "if", "an `if` condition")) . .or(if let ExprKind::Match(match_ex, _, MatchSource::Normal) = expr.kind { . Some((match_ex, "match", "a `match` scrutinee")) . } else { -- line 64 ---------------------------------------- -- line 129 ---------------------------------------- . "let res = {}; {keyword} res", . snippet_block_with_applicability(cx, block.span, "..", Some(expr.span), &mut applicability), . ), . applicability, . ); . } . } . } 524,304 ( 0.04%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/slice/ascii.rs -------------------------------------------------------------------------------- Ir -- line 577 ---------------------------------------- . let b1 = _mm_loadu_si128(ptr.add(32) as *const __m128i); . let b2 = _mm_loadu_si128(ptr.add(48) as *const __m128i); . // OR all chunks - if any byte has high bit set, combined will too. . let combined = _mm_or_si128(_mm_or_si128(a1, a2), _mm_or_si128(b1, b2)); . // Create a mask from the MSBs of each byte. . // If any byte is >= 128, its MSB is 1, so the mask will be non-zero. . _mm_movemask_epi8(combined) . }; 26 ( 0.00%) if mask != 0 { . return false; . } . } . . // Handle remaining bytes . rest.iter().all(|b| b.is_ascii()) . } . -- line 593 ---------------------------------------- -- line 660 ---------------------------------------- . const SIMD_MIN_LEN: usize = NEON_CHUNK_SIZE; . . const_eval_select!( . @capture { bytes: &[u8] } -> bool: . if const { . is_ascii_simple(bytes) . } else { . // For small inputs, use usize-at-a-time processing to avoid SSE2 call overhead. 131,070 ( 0.01%) if bytes.len() < SIMD_MIN_LEN { . let chunks = bytes.chunks_exact(USIZE_SIZE); . let remainder = chunks.remainder(); . for chunk in chunks { . let word = usize::from_ne_bytes(chunk.try_into().unwrap()); 350,556 ( 0.03%) if (word & NONASCII_MASK) != 0 { . return false; . } . } . return remainder.iter().all(|b| b.is_ascii()); . } . . #[cfg(all(target_arch = "x86_64", target_feature = "sse2"))] . { is_ascii_sse2(bytes) } -- line 681 ---------------------------------------- 65,522 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/redundant_closure_call.rs -------------------------------------------------------------------------------- Ir -- line 158 ---------------------------------------- . { . expr = parent; . depth += 1; . } . (expr, depth) . } . . impl<'tcx> LateLintPass<'tcx> for RedundantClosureCall { 524,304 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>) { 393,228 ( 0.03%) if expr.span.in_external_macro(cx.sess().source_map()) { . return; . } . . 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). -- line 175 ---------------------------------------- -- line 229 ---------------------------------------- . .maybe_paren(); . } . . diag.span_suggestion(full_expr.span, "try doing something like", hint, applicability); . } . }, . ); . } 524,304 ( 0.04%) } . 7 ( 0.00%) fn check_block(&mut self, cx: &LateContext<'tcx>, block: &'tcx hir::Block<'_>) { . fn count_closure_usage<'tcx>( . cx: &LateContext<'tcx>, . block: &'tcx hir::Block<'_>, . path: &'tcx hir::Path<'tcx>, . ) -> usize { . struct ClosureUsageCount<'a, 'tcx> { . cx: &'a LateContext<'tcx>, . path: &'tcx hir::Path<'tcx>, -- line 247 ---------------------------------------- -- line 265 ---------------------------------------- . self.cx.tcx . } . } . let mut closure_usage_count = ClosureUsageCount { cx, path, count: 0 }; . closure_usage_count.visit_block(block); . closure_usage_count.count . } . 1 ( 0.00%) for w in block.stmts.windows(2) { . if let hir::StmtKind::Let(local) = w[0].kind . && let Some(t) = local.init . && let ExprKind::Closure { .. } = t.kind . && let hir::PatKind::Binding(_, _, ident, _) = local.pat.kind . && let hir::StmtKind::Semi(second) = w[1].kind . && let ExprKind::Assign(_, call, _) = second.kind . && let ExprKind::Call(closure, _) = call.kind . && let ExprKind::Path(hir::QPath::Resolved(_, path)) = closure.kind -- line 281 ---------------------------------------- -- line 286 ---------------------------------------- . cx, . REDUNDANT_CLOSURE_CALL, . second.hir_id, . second.span, . "closure called just once immediately after it was declared", . ); . } . } 8 ( 0.00%) } . } -------------------------------------------------------------------------------- -- 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 { 655,380 ( 0.05%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { . if let Some(macro_call) = root_macro_call_first_node(cx, e) . && let is_debug = match cx.tcx.get_diagnostic_name(macro_call.def_id) { . Some(sym::debug_assert_macro) => true, . Some(sym::assert_macro) => false, . _ => return, . } . && let Some((condition, _)) = find_assert_args(cx, e, macro_call.expn) . // Check if the whole expression can be moved into a const context. -- line 55 ---------------------------------------- -- line 76 ---------------------------------------- . ( . "this assertion is always `false`", . "replace this with `panic!()` or `unreachable!()`", . ) . }; . . span_lint_and_help(cx, ASSERTIONS_ON_CONSTANTS, macro_call.span, msg, None, help); . } 524,304 ( 0.04%) } . } . . fn as_bool_lit(e: &Expr<'_>) -> Option { . if let ExprKind::Lit(l) = e.kind . && let LitKind::Bool(b) = l.node . { . Some(b) . } else { -- line 92 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/borrow.rs -------------------------------------------------------------------------------- Ir -- line 190 ---------------------------------------- . fn borrow(&self) -> &B { . &**self . } . } . . #[stable(feature = "rust1", since = "1.0.0")] . impl Clone for Cow<'_, B> { . fn clone(&self) -> Self { 9 ( 0.00%) match *self { . Borrowed(b) => Borrowed(b), . Owned(ref o) => { . let b: &B = o.borrow(); . Owned(b.to_owned()) . } . } . } . -- line 206 ---------------------------------------- -- line 342 ---------------------------------------- . #[stable(feature = "rust1", since = "1.0.0")] . impl Deref for Cow<'_, B> . // where . // B::Owned: [const] Borrow, . { . type Target = B; . . fn deref(&self) -> &B { 131,070 ( 0.01%) match *self { . Borrowed(borrowed) => borrowed, . Owned(ref owned) => owned.borrow(), . } . } . } . . // `Cow<'_, T>` can only implement `DerefPure` if `>` (and `BorrowMut`) is trusted. . // For now, we restrict `DerefPure for Cow` to `T: Sized` (`T as Borrow` is trusted), -- line 358 ---------------------------------------- -- line 417 ---------------------------------------- . } . } . . #[stable(feature = "rust1", since = "1.0.0")] . impl fmt::Display for Cow<'_, B> . where . B: fmt::Display + ToOwned, . { 2 ( 0.00%) fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { 291 ( 0.00%) => ???:::fmt (1x) . match *self { . Borrowed(ref b) => fmt::Display::fmt(b, f), . Owned(ref o) => fmt::Display::fmt(o, f), . } . } . } . . #[stable(feature = "default", since = "1.11.0")] -- line 433 ---------------------------------------- 16 ( 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 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::Binary(op, lhs, rhs) = expr.kind . && let (lt, gt) = match op.node { . BinOpKind::Lt => (lhs, rhs), . BinOpKind::Gt => (rhs, lhs), . _ => return, . } . && let ctxt = expr.span.ctxt() . && let (op_lhs, op_rhs, other, commutative) = match (<.kind, >.kind) { . (&ExprKind::Binary(op, lhs, rhs), _) if op.node == BinOpKind::Add && ctxt == lt.span.ctxt() => { -- line 61 ---------------------------------------- -- line 76 ---------------------------------------- . { . span_lint( . cx, . PANICKING_OVERFLOW_CHECKS, . expr.span, . "you are trying to use classic C overflow conditions that will fail in Rust", . ); . } 524,304 ( 0.04%) } . } -------------------------------------------------------------------------------- -- 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 { 327,690 ( 0.03%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'_>) { 131,076 ( 0.01%) if let Assign(left_expr, collect_expr, _) = &expr.kind . && let hir::ExprKind::MethodCall(seg, target_expr, [], _) = &collect_expr.kind . && seg.args.is_none() . && let Some(collect_def_id) = cx.typeck_results().type_dependent_def_id(collect_expr.hir_id) . && cx.tcx.is_diagnostic_item(sym::iterator_collect_fn, collect_def_id) . { . 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); . } 393,228 ( 0.03%) } . } . . fn check_into_iter( . cx: &LateContext<'_>, . left_expr: &hir::Expr<'_>, . target_expr: &hir::Expr<'_>, . parent_expr_span: Span, . msrv: Msrv, -- line 79 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 157 ---------------------------------------- . self.expn_depth += 1; . } . walk_stmt(self, s); . if from_expn { . self.expn_depth -= 1; . } . } . 524,304 ( 0.04%) fn visit_expr(&mut self, e: &'tcx Expr<'tcx>) { 65,538 ( 0.01%) let ctxt = e.span.ctxt(); . 131,076 ( 0.01%) if let ExprKind::Block(block, _) = e.kind 1 ( 0.00%) && let BlockCheckMode::UnsafeBlock(UnsafeSource::UserProvided) = block.rules . && !ctxt.is_root() . && let Some(macro_def_id) = ctxt.outer_expn_data().macro_def_id . && let Some(macro_def_id) = macro_def_id.as_local() . && (self.lint.warn_unsafe_macro_metavars_in_private_macros || is_public_macro(self.cx, macro_def_id)) . { . self.macro_unsafe_blocks.push(block.hir_id); . self.expn_depth += 1; . walk_block(self, block); . self.expn_depth -= 1; . self.macro_unsafe_blocks.pop(); 262,152 ( 0.02%) } else if ctxt.is_root() && self.expn_depth > 0 { . let unsafe_block = self.macro_unsafe_blocks.last().copied(); . . match (self.lint.metavar_expns.entry(e.span), unsafe_block) { . (Entry::Vacant(e), None) => { . e.insert(MetavarState::ReferencedInSafe); . }, . (Entry::Vacant(e), Some(unsafe_block)) => { . e.insert(MetavarState::ReferencedInUnsafe { -- line 188 ---------------------------------------- -- line 201 ---------------------------------------- . unsafe_blocks.push(unsafe_block); . } . }, . } . . // NB: No need to visit descendant nodes. They're guaranteed to represent the same . // metavariable . } else { 196,614 ( 0.02%) walk_expr(self, e); 4,325,413 ( 0.35%) => /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) . } 524,304 ( 0.04%) } . } . . impl<'tcx> LateLintPass<'tcx> for ExprMetavarsInUnsafe { 27 ( 0.00%) fn check_body(&mut self, cx: &LateContext<'tcx>, body: &rustc_hir::Body<'tcx>) { 24 ( 0.00%) if is_lint_allowed(cx, MACRO_METAVARS_IN_UNSAFE, body.value.hir_id) { 6,500 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::is_lint_allowed (3x) . 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 . 18 ( 0.00%) let mut vis = BodyVisitor { . macro_unsafe_blocks: Vec::new(), . #[expect(clippy::bool_to_int_with_if)] // obfuscates the meaning 6 ( 0.00%) expn_depth: if body.value.span.from_expansion() { 1 } else { 0 }, . cx, . lint: self . }; . vis.visit_body(body); 21 ( 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) -- line 239 ---------------------------------------- -- 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 { 49 ( 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%) } . } 262,155 ( 0.02%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/combined_late_pass.rs -------------------------------------------------------------------------------- Ir -- line 16 ---------------------------------------- . pub struct Gated

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

{ . #[inline] . pub fn new bool>(is_active: &F, pass: P) -> Self { 70 ( 0.00%) let active = is_active(&pass.get_lints()); 368 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint_defs/src/lib.rs:::get_lints (1x) 361 ( 0.00%) Gated { active, pass } 90 ( 0.00%) => ???:0x0000000000173dc0 (3x) . } . } . . /// Run one field's `check_*`, if that field is active. . /// . /// Fully qualified through [`rustc_lint::LateLintPass`] since some passes impl . /// both `EarlyLintPass` and `LateLintPass` with like-named methods, which would . /// be ambiguous on the concrete field type. The args arrive as one `tt` and are . /// re-parsed here so the per-field and per-argument repetitions never share a . /// nesting level. . #[macro_export] . macro_rules! run_combined_late_lint_pass_field { . ($self:ident, $field:ident, $name:ident, ($($arg:expr),* $(,)?)) => { 30,541,928 ( 2.46%) if $self.$field.active { 27,329,998 ( 2.20%) rustc_lint::LateLintPass::$name(&mut $self.$field.pass, $($arg),*); 43,471 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/cargo/mod.rs:::check_crate (1x) 1,274 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/regex.rs:::check_crate (1x) 58 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/disallowed_macros.rs:::check_crate (1x) 19 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/methods/mod.rs:::check_crate (1x) . } . }; . } . . /// Forward one `check_*` method to every field of the combined pass. . #[macro_export] . macro_rules! expand_combined_late_lint_pass_method { . ([$($field:ident),*], $self:ident, $name:ident, $args:tt) => ({ -- line 48 ---------------------------------------- -- line 50 ---------------------------------------- . }) . } . . /// Generate the combined `LateLintPass` impl's `check_*` methods, one per method . /// in rustc's late-pass method list. . #[macro_export] . macro_rules! expand_combined_late_lint_pass_methods { . ($fields:tt, [$($(#[$attr:meta])* fn $name:ident($($param:ident: $arg:ty),*);)*]) => ( 1,638,732 ( 0.13%) $(#[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),*)); 786,622 ( 0.06%) })* . ) . } . . /// 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); . } . }; . } 458,984 ( 0.04%) -------------------------------------------------------------------------------- -- 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; . 589,842 ( 0.05%) pub(crate) fn check_assert<'tcx>(cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 65,538 ( 0.01%) if let Some(macro_call) = first_node_macro_backtrace(cx, e).find(|macro_call| { . matches!( . cx.tcx.get_diagnostic_name(macro_call.def_id), . Some(sym::assert_eq_macro | sym::assert_ne_macro | sym::debug_assert_eq_macro | sym::debug_assert_ne_macro) . ) . }) && let Some((lhs, rhs, _)) = find_assert_eq_args(cx, e, macro_call.expn) . && eq_expr_value(cx, macro_call.span.ctxt(), lhs, rhs) . && macro_call.is_local() . && !is_in_test_function(cx.tcx, e.hir_id) -- line 19 ---------------------------------------- -- line 23 ---------------------------------------- . EQ_OP, . lhs.span.to(rhs.span), . format!( . "identical args used in this `{}!` macro call", . cx.tcx.item_name(macro_call.def_id) . ), . ); . } 524,304 ( 0.04%) } . . pub(crate) fn check<'tcx>( . cx: &LateContext<'tcx>, . e: &'tcx Expr<'_>, . op: BinOpKind, . left: &'tcx Expr<'_>, . right: &'tcx Expr<'_>, . ) { -- line 39 ---------------------------------------- 196,614 ( 0.02%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/casts/cast_ptr_alignment.rs -------------------------------------------------------------------------------- Ir -- line 7 ---------------------------------------- . 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>) { . lint_cast_ptr_alignment(cx, expr, cast_from, cast_to); . } . 327,690 ( 0.03%) pub(super) fn check_cast_method(cx: &LateContext<'_>, expr: &Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::MethodCall(method_path, self_arg, [], _) = &expr.kind . && 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); . } 393,228 ( 0.03%) } . . fn lint_cast_ptr_alignment<'tcx>(cx: &LateContext<'tcx>, expr: &Expr<'_>, cast_from: Ty<'tcx>, cast_to: Ty<'tcx>) { . if let ty::RawPtr(from_ptr_ty, _) = *cast_from.kind() . && let ty::RawPtr(to_ptr_ty, _) = *cast_to.kind() . && let Ok(from_layout) = cx.layout_of(from_ptr_ty) . && let Ok(to_layout) = cx.layout_of(to_ptr_ty) . && from_layout.align.abi < to_layout.align.abi . // with c_void, we inherently need to trust the user -- line 34 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 36 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) { 20 ( 0.00%) let attrs = cx.tcx.hir_attrs(item.hir_id()); 218 ( 0.00%) => ???:::hir_attrs (4x) 11 ( 0.00%) if let ItemKind::Fn { ident, body, .. } = item.kind { 7 ( 0.00%) inline_always::check(cx, item.span, ident.name, attrs, Some(body)); 23 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/attrs/inline_always.rs:clippy_lints::attrs::inline_always::check (1x) . } 3 ( 0.00%) repr_attributes::check(cx, item.span, attrs, self.msrv); 28 ( 0.00%) } . . fn check_impl_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx ImplItem<'_>) { . if let ImplItemKind::Fn(_, body) = item.kind { . inline_always::check( . cx, . item.span, . item.ident.name, . cx.tcx.hir_attrs(item.hir_id()), -- line 528 ---------------------------------------- -- line 543 ---------------------------------------- . } . . pub struct EarlyAttributes { . msrv: MsrvStack, . } . . impl EarlyAttributes { . pub fn new(conf: &'static Conf) -> Self { 1 ( 0.00%) Self { msrv: conf.msrv.into() } . } . } . . impl EarlyLintPass for EarlyAttributes { . fn check_attribute(&mut self, cx: &EarlyContext<'_>, attr: &Attribute) { . deprecated_cfg_attr::check(cx, attr, &self.msrv); . deprecated_cfg_attr::check_clippy(cx, attr); . non_minimal_cfg::check(cx, attr); -- line 559 ---------------------------------------- -- line 563 ---------------------------------------- . } . . 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); . } . 10 ( 0.00%) fn check_attribute(&mut self, cx: &EarlyContext<'_>, attr: &Attribute) { 3 ( 0.00%) check_clippy_attr(cx.sess(), attr); 89 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/attrs.rs:clippy_utils::attrs::check_clippy_attr:: (1x) 5 ( 0.00%) if let Some(items) = &attr.meta_item_list() 7 ( 0.00%) => ???:::meta_item_list (1x) . && let Some(name) = attr.name() . { . if matches!(name, sym::allow) && self.msrv.meets(msrvs::LINT_REASONS_STABILIZATION) { . allow_attributes::check(cx, attr); . } . if matches!(name, sym::allow | sym::expect) && self.msrv.meets(msrvs::LINT_REASONS_STABILIZATION) { . allow_attributes_without_reason::check(cx, name, items, attr); . } -- line 590 ---------------------------------------- -- line 603 ---------------------------------------- . } . } . } . . if attr.has_name(sym::should_panic) { . should_panic_without_expect::check(cx, attr); . } . 1 ( 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 `= \"..\"`", . ); . } 8 ( 0.00%) } . . fn check_item(&mut self, cx: &EarlyContext<'_>, item: &'_ ast::Item) { 12 ( 0.00%) match item.kind { 6 ( 0.00%) ast::ItemKind::ExternCrate(..) | ast::ItemKind::Use(..) => useless_attribute::check(cx, item, &item.attrs), 103 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/attrs/useless_attribute.rs:clippy_lints::attrs::useless_attribute::check (2x) . _ => {}, . } . 20 ( 0.00%) mixed_attributes_style::check(cx, item.span, &item.attrs); 676 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/attrs/mixed_attributes_style.rs:clippy_lints::attrs::mixed_attributes_style::check (4x) . } . 655,420 ( 0.05%) fn check_attributes(&mut self, cx: &EarlyContext<'_>, attrs: &[Attribute]) { 196,626 ( 0.02%) self.msrv.check_attributes(attrs); 196,661 ( 0.02%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_attributes (65,542x) . duplicated_attributes::check(cx, attrs); 131,084 ( 0.01%) msrvs::check_attrs(cx.sess(), attrs); 1,179,784 ( 0.10%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/msrvs.rs:clippy_utils::msrvs::check_attrs:: (65,542x) 524,336 ( 0.04%) } . . fn check_attributes_post(&mut self, _cx: &EarlyContext<'_>, attrs: &[Attribute]) { 262,168 ( 0.02%) self.msrv.check_attributes_post(attrs); 196,661 ( 0.02%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_attributes_post (65,542x) . } . } -------------------------------------------------------------------------------- -- 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 { 524,304 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &Expr<'tcx>) { 458,766 ( 0.04%) match expr.kind { . // `.get().()` . ExprKind::MethodCall(method, get_call, [], _) . if let Some((recv, nz_ty, nonzero_did, get_span)) = nonzero_get(cx, get_call) . // 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 -- line 76 ---------------------------------------- -- line 100 ---------------------------------------- . && 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()); . }, . . _ => {}, . } 524,304 ( 0.04%) } . } . . /// Returns the receiver, its `NonZero` type and definition, and the `get` identifier span when . /// `expr` is an inherent `NonZero::get()` call. . fn nonzero_get<'tcx>( . cx: &LateContext<'tcx>, . expr: &'tcx Expr<'tcx>, . ) -> Option<(&'tcx Expr<'tcx>, Ty<'tcx>, DefId, Span)> { -- line 116 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_lint/src/passes.rs -------------------------------------------------------------------------------- Ir -- line 169 ---------------------------------------- . fn check_where_predicate_post(a: &rustc_ast::WherePredicate); . ]); . ) . } . . macro_rules! declare_early_lint_pass { . ([], [$(fn $name:ident($($param:ident: $arg:ty),*);)*]) => ( . pub trait EarlyLintPass: LintPass { 131,082 ( 0.01%) $(#[inline(always)] fn $name(&mut self, _: &EarlyContext<'_>, $(_: $arg),*) {})* . } . ) . } . . // Declare the `EarlyLintPass` trait, which contains empty default definitions . // for all the `check_*` methods. . early_lint_methods!(declare_early_lint_pass, []); . -- line 185 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/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 { 589,842 ( 0.05%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 65,538 ( 0.01%) let span = expr.span; 262,152 ( 0.02%) if !span.in_external_macro(cx.tcx.sess.source_map()) && 524,304 ( 0.04%) let Some(body_expr) = desugar_async_block(cx, expr) && 655,380 ( 0.05%) => site/frontend/rust-clippy/clippy_lints/src/redundant_async_block.rs:clippy_lints::redundant_async_block::desugar_async_block (65,538x) . 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, . ); . } 524,304 ( 0.04%) } . } . . /// If `expr` is a desugared `async` block, return the original expression if it does not capture . /// any variable by ref. 196,614 ( 0.02%) fn desugar_async_block<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) -> Option<&'tcx Expr<'tcx>> { 131,076 ( 0.01%) if let ExprKind::Closure(Closure { body, def_id, kind, .. }) = expr.kind . && let body = cx.tcx.hir_body(*body) . && matches!( . kind, . ClosureKind::Coroutine(CoroutineKind::Desugared( . CoroutineDesugaring::Async, . CoroutineSource::Block . )) . ) -- line 81 ---------------------------------------- -- line 89 ---------------------------------------- . .iter() . .all(|place| matches!(place.info.capture_kind, UpvarCapture::ByValue)) . }) . }) . .then_some(body.value) . } else { . None . } 262,152 ( 0.02%) } 65,538 ( 0.01%) -------------------------------------------------------------------------------- -- 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) { 131,074 ( 0.01%) if let ExprKind::Range(Some(start), Some(end), RangeLimits::HalfOpen) = &e.kind . && is_incomplete_range(start, end) . && !e.span.in_external_macro(cx.sess().source_map()) . { . span_lint_and_then( . cx, . ALMOST_COMPLETE_RANGE, . e.span, . "almost complete ascii range", -- line 52 ---------------------------------------- -- line 61 ---------------------------------------- . "use an inclusive range", . "..=".to_owned(), . Applicability::MaybeIncorrect, . ); . } . }, . ); . } 65,537 ( 0.01%) } . . fn check_pat(&mut self, cx: &EarlyContext<'_>, p: &Pat) { . if let PatKind::Range(Some(start), Some(end), kind) = &p.kind . && matches!(kind.node, RangeEnd::Excluded) . && is_incomplete_range(start, end) . && !p.span.in_external_macro(cx.sess().source_map()) . { . span_lint_and_then( -- line 77 ---------------------------------------- -------------------------------------------------------------------------------- -- 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<'_>) { 196,614 ( 0.02%) if let Some(VecArgs::Repeat(repeat_expr, len_expr)) = VecArgs::hir(cx, expr) 1,114,146 ( 0.09%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (65,538x) . && matching_root_macro_call(cx, expr.span, sym::vec_macro).is_some() . && fn_def_id(cx, repeat_expr).is_some_and(|did| cx.tcx.is_diagnostic_item(sym::vec_with_capacity, did)) . && !len_expr.span.from_expansion() . && let Some(Constant::Int(2..)) = ConstEvalCtxt::new(cx).eval(expr_or_init(cx, len_expr)) . { . emit_lint( . cx, . expr.span.source_callsite(), -- line 88 ---------------------------------------- -- line 95 ---------------------------------------- . snippet(cx, repeat_expr.span, "..") . ), . ); . } . } . . /// Checks `iter::repeat(Vec::with_capacity(x))` . fn check_repeat_fn(cx: &LateContext<'_>, expr: &Expr<'_>, msrv: Msrv) { 131,076 ( 0.01%) if !expr.span.from_expansion() 196,614 ( 0.02%) && fn_def_id(cx, expr).is_some_and(|did| cx.tcx.is_diagnostic_item(sym::iter_repeat, did)) 2,293,830 ( 0.19%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::fn_def_id (65,538x) . && 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 { 720,918 ( 0.06%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) { . check_vec_macro(cx, expr); 65,538 ( 0.01%) check_repeat_fn(cx, expr, self.msrv); 524,304 ( 0.04%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/useless_vec.rs -------------------------------------------------------------------------------- Ir -- line 43 ---------------------------------------- . /// work, we get a false positive warning on the `$v.push(3)` which really requires `$v` to . /// be a vector. . span_to_state: BTreeMap, . allow_in_test: bool, . } . . impl UselessVec { . pub fn new(conf: &'static Conf) -> Self { 5 ( 0.00%) Self { . too_large_for_stack: conf.too_large_for_stack, . msrv: conf.msrv.into(), . span_to_state: BTreeMap::new(), 2 ( 0.00%) allow_in_test: conf.allow_useless_vec_in_tests, . } . } . } . . declare_clippy_lint! { . /// ### What it does . /// Checks for usage of `vec![..]` when using `[..]` would . /// be possible. -- line 63 ---------------------------------------- -- line 166 ---------------------------------------- . VecToArray::Impossible . } . }, . } . } . } . . impl<'tcx> LateLintPass<'tcx> for UselessVec { 589,842 ( 0.05%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 262,152 ( 0.02%) if let Some(vec_args) = higher::VecArgs::hir(cx, expr.peel_borrows()) 1,114,146 ( 0.09%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (65,538x) . // The `vec![]` or `&vec![]` invocation span. . && let vec_span = expr.span.parent_callsite().unwrap_or(expr.span) . && !vec_span.from_expansion() . { . if self.allow_in_test && is_in_test(cx.tcx, expr.hir_id) { . return; . } . -- line 183 ---------------------------------------- -- line 232 ---------------------------------------- . }); . } . }, . VecToArray::Impossible => { . self.span_to_state.insert(vec_span, VecState::NoChange); . }, . } . } 524,304 ( 0.04%) } . 8 ( 0.00%) fn check_crate_post(&mut self, cx: &LateContext<'tcx>) { 10 ( 0.00%) for (span, state) in mem::take(&mut self.span_to_state) { . if let VecState::Change { . suggest_ty, . vec_snippet, . expr_hir_id, . } = state . { . span_lint_hir_and_then(cx, USELESS_VEC, expr_hir_id, span, "useless use of `vec!`", |diag| { . let help_msg = format!("you can use {} directly", suggest_ty.desc()); -- line 251 ---------------------------------------- -- line 255 ---------------------------------------- . Applicability::Unspecified . } else { . Applicability::MachineApplicable . }; . diag.span_suggestion(span, help_msg, vec_snippet, applicability); . }); . } . } 8 ( 0.00%) } . } . . #[derive(Copy, Clone)] . pub(crate) enum SuggestedType { . /// Suggest using a slice `&[..]` / `&mut [..]` . SliceRef(Mutability), . /// Suggest using an array: `[..]` . Array, -- line 271 ---------------------------------------- 1 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/needless_borrows_for_generic_args.rs -------------------------------------------------------------------------------- Ir -- line 67 ---------------------------------------- . /// be moved. . possible_borrowers: Vec<(LocalDefId, PossibleBorrowerMap<'tcx, 'tcx>)>, . . // `IntoIterator` for arrays requires Rust 1.53. . msrv: Msrv, . } . impl NeedlessBorrowsForGenericArgs<'_> { . pub fn new(conf: &'static Conf) -> Self { 4 ( 0.00%) Self { . possible_borrowers: Vec::new(), . msrv: conf.msrv.into(), . } . } . } . . impl<'tcx> LateLintPass<'tcx> for NeedlessBorrowsForGenericArgs<'tcx> { 524,304 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 131,076 ( 0.01%) if matches!(expr.kind, ExprKind::AddrOf(..)) . && !expr.span.from_expansion() . && let use_site = get_expr_use_site(cx.tcx, cx.typeck_results(), SyntaxContext::root(), expr) . && use_site.same_ctxt . && !use_site.is_ty_unified . && let use_node = use_site.use_node(cx) . && let Some(DefinedTy::Mir { def_site_def_id: _, ty }) = use_node.defined_ty(cx) . && let ty::Param(param_ty) = *ty.skip_binder().kind() . && let Some((hir_id, fn_id, i)) = match use_node { -- line 92 ---------------------------------------- -- line 128 ---------------------------------------- . |diag| { . let mut app = Applicability::MachineApplicable; . let snip_span = peel_n_hir_expr_refs(expr, count).0.span; . let snip = snippet_with_context(cx, snip_span, expr.span.ctxt(), "..", &mut app).0; . diag.span_suggestion(expr.span, "change this to", snip.into_owned(), app); . }, . ); . } 524,304 ( 0.04%) } . 21 ( 0.00%) fn check_body_post(&mut self, cx: &LateContext<'tcx>, body: &Body<'_>) { . if self . .possible_borrowers . .last() . .is_some_and(|&(local_def_id, _)| local_def_id == cx.tcx.hir_body_owner_def_id(body.id())) . { . self.possible_borrowers.pop(); . } 24 ( 0.00%) } . } . . fn path_has_args(p: &QPath<'_>) -> bool { . match *p { . QPath::Resolved(_, Path { segments: [.., s], .. }) | QPath::TypeRelative(_, s) => s.args.is_some(), . QPath::Resolved(..) => false, . } . } -- line 154 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 589,834 ( 0.05%) !self.eq(other) 983,047 ( 0.08%) => /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 (196,609x) . } . } . . /// 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 486 ---------------------------------------- . /// assert_eq!(Ordering::Equal.is_lt(), false); . /// assert_eq!(Ordering::Greater.is_lt(), false); . /// ``` . #[inline] . #[must_use] . #[rustc_const_stable(feature = "ordering_helpers", since = "1.53.0")] . #[stable(feature = "ordering_helpers", since = "1.53.0")] . pub const fn is_lt(self) -> bool { 1 ( 0.00%) self.as_raw() < 0 . } . . /// Returns `true` if the ordering is the `Greater` variant. . /// . /// # Examples . /// . /// ``` . /// use std::cmp::Ordering; -- line 502 ---------------------------------------- -- line 505 ---------------------------------------- . /// assert_eq!(Ordering::Equal.is_gt(), false); . /// assert_eq!(Ordering::Greater.is_gt(), true); . /// ``` . #[inline] . #[must_use] . #[rustc_const_stable(feature = "ordering_helpers", since = "1.53.0")] . #[stable(feature = "ordering_helpers", since = "1.53.0")] . pub const fn is_gt(self) -> bool { 6 ( 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 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 { 131,078 ( 0.01%) 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 } 169 ( 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 } 47 ( 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 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 } 48 ( 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] 243 ( 0.00%) fn eq(&self, other: &Self) -> bool { *self == *other } . // Override the default to use the primitive implementation for `!=`. . #[inline] . fn ne(&self, other: &Self) -> bool { *self != *other } . } . )*) . } . . impl_partial_eq_for_primitive! { -- line 1905 ---------------------------------------- -- line 1928 ---------------------------------------- . } . . eq_impl! { () bool char usize u8 u16 u32 u64 u128 isize i8 i16 i32 i64 i128 } . . #[rustfmt::skip] . macro_rules! partial_ord_methods_primitive_impl { . () => { . #[inline(always)] 124 ( 0.00%) fn lt(&self, other: &Self) -> bool { *self < *other } . #[inline(always)] . 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 -- line 1944 ---------------------------------------- -- 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 { 1 ( 0.00%) PartialEq::eq(*self, *other) . } . #[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 ---------------------------------------- 69 ( 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/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 { 262,232 ( 0.02%) 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 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 { 2 ( 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 1431 ---------------------------------------- . where . K: Clone, . V: Clone, . S: Clone, . A: Allocator + Clone, . { . #[inline] . fn clone(&self) -> Self { 14 ( 0.00%) Self { base: self.base.clone() } . } . . #[inline] . fn clone_from(&mut self, source: &Self) { . self.base.clone_from(&source.base); . } . } . -- line 1447 ---------------------------------------- -- line 3006 ---------------------------------------- . where . K: Eq + Hash, . S: BuildHasher + Default, . { . /// Constructs a `HashMap` from an iterator of key-value pairs. . /// . /// If the iterator produces any pairs with equal keys, . /// all but one of the corresponding values will be dropped. 33 ( 0.00%) fn from_iter>(iter: T) -> HashMap { . let mut map = HashMap::with_hasher(Default::default()); 51 ( 0.00%) map.extend(iter); 77 ( 0.00%) => ???:0x0000000000173dc0 (1x) 38 ( 0.00%) map 34 ( 0.00%) } . } . . /// Inserts all new key-values from the iterator and replaces values with existing . /// keys with new values returned from the iterator. . #[stable(feature = "rust1", since = "1.0.0")] . impl Extend<(K, V)> for HashMap . where . K: Eq + Hash, . S: BuildHasher, . A: Allocator, . { . #[inline] . fn extend>(&mut self, iter: T) { 4 ( 0.00%) self.base.extend(iter) 4,294 ( 0.00%) => /rust/deps/hashbrown-0.17.1/src/map.rs: as core::iter::traits::collect::Extend<(clippy_config::types::SourceItemOrderingModuleItemKind, alloc::string::String)>>::extend::<[(clippy_config::types::SourceItemOrderingModuleItemKind, alloc::string::String); 16]> (1x) 3,718 ( 0.00%) => /rust/deps/hashbrown-0.17.1/src/map.rs: as core::iter::traits::collect::Extend<(clippy_config::types::SourceItemOrderingModuleItemKind, usize)>>::extend::<[(clippy_config::types::SourceItemOrderingModuleItemKind, usize); 16]> (1x) . } . . #[inline] . fn extend_one(&mut self, (k, v): (K, V)) { . self.base.insert(k, v); . } . . #[inline] -- line 3040 ---------------------------------------- -- line 3066 ---------------------------------------- . Extend::<(K, V)>::extend_reserve(self, additional) . } . } . . #[inline] . fn map_entry<'a, K: 'a, V: 'a, A: Allocator>( . raw: base::RustcEntry<'a, K, V, A>, . ) -> Entry<'a, K, V, A> { 38 ( 0.00%) match raw { . base::RustcEntry::Occupied(base) => Entry::Occupied(OccupiedEntry { base }), . base::RustcEntry::Vacant(base) => Entry::Vacant(VacantEntry { base }), . } . } . . #[inline] . pub(super) fn map_try_reserve_error(err: hashbrown::TryReserveError) -> TryReserveError { . match err { -- line 3082 ---------------------------------------- 28 ( 0.00%) -------------------------------------------------------------------------------- -- 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) { 3 ( 0.00%) duplicate_underscore_argument::check(cx, fn_kind); 26 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/duplicate_underscore_argument.rs:clippy_lints::functions::duplicate_underscore_argument::check (1x) . } . } . . 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 { 12 ( 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, . ) { 1 ( 0.00%) let hir_id = cx.tcx.local_def_id_to_hir_id(def_id); 10 ( 0.00%) too_many_arguments::check_fn(cx, kind, decl, hir_id, def_id, self.too_many_arguments_threshold); 4 ( 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); 13 ( 0.00%) misnamed_getters::check_fn(cx, kind, decl, body, span); 17 ( 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 (1x) 1 ( 0.00%) impl_trait_in_params::check_fn(cx, &kind, body, hir_id); 13 ( 0.00%) ref_option::check_fn( 1,070 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/ref_option.rs:clippy_lints::functions::ref_option::check_fn (1x) . cx, . kind, . decl, . span, . hir_id, . def_id, . body, 2 ( 0.00%) self.avoid_breaking_exported_api, . ); 7 ( 0.00%) } . . fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::Item<'_>) { 12 ( 0.00%) must_use::check_item(cx, item); 763 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/must_use.rs:clippy_lints::functions::must_use::check_item (4x) 12 ( 0.00%) result::check_item( 231 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::check_item (4x) . cx, . item, 4 ( 0.00%) self.large_error_threshold, 4 ( 0.00%) &self.large_error_ignored, 4 ( 0.00%) self.msrv, . ); . } . . fn check_impl_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx hir::ImplItem<'_>) { . must_use::check_impl_item(cx, item); . result::check_impl_item( . cx, . item, -- line 582 ---------------------------------------- -- line 599 ---------------------------------------- . &self.large_error_ignored, . self.msrv, . ); . impl_trait_in_params::check_trait_item(cx, item, self.avoid_breaking_exported_api); . ref_option::check_trait_item(cx, item, self.avoid_breaking_exported_api); . } . . fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>) { 327,690 ( 0.03%) result::check_expr(cx, expr, self.large_error_threshold, &self.large_error_ignored); 1,114,146 ( 0.09%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/functions/result.rs:clippy_lints::functions::result::check_expr (65,538x) . } . } 16 ( 0.00%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/casts/cast_slice_from_raw_parts.rs -------------------------------------------------------------------------------- Ir -- line 54 ---------------------------------------- . "replace with", . format!("{krate}::ptr::slice_{func}({ptr}, {len})"), . applicability, . ); . } . } . . /// Checks for implicit cast from slice reference to raw slice pointer. 524,304 ( 0.04%) pub(super) fn check_implicit_cast(cx: &LateContext<'_>, expr: &Expr<'_>) { . if let ExprKind::Call(fun, [ptr_arg, len_arg]) = 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) . && !matches!(get_parent_expr(cx, expr).map(|e| e.kind), Some(ExprKind::Cast(..))) . && let [deref, borrow] = cx.typeck_results().expr_adjustments(expr) . && matches!(deref.kind, Adjust::Deref(..)) . && let Adjustment { -- line 70 ---------------------------------------- -- 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, . ); . } 524,304 ( 0.04%) } 65,538 ( 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 { 589,833 ( 0.05%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { 131,074 ( 0.01%) if expr.span.from_expansion() { . return; . } . 196,611 ( 0.02%) if let Some(binops) = extract_related_binops(&expr.kind) { . check_binops(cx, &binops.iter().collect::>(), &mut self.linted_spans); . . 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| { -- line 88 ---------------------------------------- -- line 92 ---------------------------------------- . }); . . for op_type in op_types { . let ops: Vec<_> = binops.iter().filter(|b| b.op == op_type).collect(); . . check_binops(cx, &ops, &mut self.linted_spans); . } . } 524,296 ( 0.04%) } . } . . fn check_binops(cx: &EarlyContext<'_>, binops: &[&BinaryOp<'_>], linted_spans: &mut FxHashSet) { . let binop_count = binops.len(); . if binop_count < 2 { . // Single binary operation expressions would likely be false . // positives. . return; -- line 108 ---------------------------------------- -- line 356 ---------------------------------------- . _ => { . return output; . }, . }; . } . } . . fn extract_related_binops(kind: &ExprKind) -> Option>> { 196,611 ( 0.02%) append_opt_vecs(chained_binops(kind), if_statement_binops(kind)) 1,572,888 ( 0.13%) => site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::if_statement_binops (65,537x) 1,441,814 ( 0.12%) => site/frontend/rust-clippy/clippy_lints/src/suspicious_operation_groupings.rs:clippy_lints::suspicious_operation_groupings::append_opt_vecs:: (65,537x) . } . 458,759 ( 0.04%) fn if_statement_binops(kind: &ExprKind) -> Option>> { 458,759 ( 0.04%) match kind { . ExprKind::If(condition, _, _) => chained_binops(&condition.kind), . ExprKind::Paren(e) => if_statement_binops(&e.kind), . ExprKind::Block(block, _) => { . let mut output = None; . for stmt in &block.stmts { . match &stmt.kind { . StmtKind::Expr(e) | StmtKind::Semi(e) => { . output = append_opt_vecs(output, if_statement_binops(&e.kind)); -- line 376 ---------------------------------------- -- line 377 ---------------------------------------- . }, . _ => {}, . } . } . output . }, . _ => None, . } 524,296 ( 0.04%) } . 458,759 ( 0.04%) fn append_opt_vecs(target_opt: Option>, source_opt: Option>) -> Option> { 327,685 ( 0.03%) match (target_opt, source_opt) { . (Some(mut target), Some(source)) => { . target.reserve(source.len()); . for op in source { . target.push(op); . } . Some(target) . }, . (Some(v), None) | (None, Some(v)) => Some(v), 131,074 ( 0.01%) (None, None) => None, . } 524,296 ( 0.04%) } . . fn chained_binops(kind: &ExprKind) -> Option>> { 458,759 ( 0.04%) match kind { . ExprKind::Binary(_, left_outer, right_outer) => chained_binops_helper(left_outer, right_outer), . ExprKind::Paren(e) | ExprKind::Unary(_, e) => chained_binops(&e.kind), 65,537 ( 0.01%) _ => None, . } . } . . fn chained_binops_helper<'expr>(left_outer: &'expr Expr, right_outer: &'expr Expr) -> Option>> { . match (&left_outer.kind, &right_outer.kind) { . ( . ExprKind::Paren(left_e) | ExprKind::Unary(_, left_e), . ExprKind::Paren(right_e) | ExprKind::Unary(_, right_e), -- line 413 ---------------------------------------- 393,222 ( 0.03%) -------------------------------------------------------------------------------- -- 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 { 655,380 ( 0.05%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 196,614 ( 0.02%) eq_op::check_assert(cx, e); 6,226,106 ( 0.50%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/eq_op.rs:clippy_lints::operators::eq_op::check_assert (65,538x) 196,614 ( 0.02%) float_cmp::check_assert(cx, e); 3,997,814 ( 0.32%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/operators/float_cmp.rs:clippy_lints::operators::float_cmp::check_assert (65,538x) 458,763 ( 0.04%) match e.kind { . ExprKind::Binary(op, lhs, rhs) => { . if !e.span.from_expansion() { . absurd_extreme_comparisons::check(cx, e, op.node, lhs, rhs); . if !(macro_with_not_op(lhs) || macro_with_not_op(rhs)) { . eq_op::check(cx, e, op.node, lhs, rhs); . op_ref::check(cx, e, op.node, lhs, rhs); . } . erasing_op::check(cx, e, op.node, lhs, rhs); -- line 1060 ---------------------------------------- -- line 1105 ---------------------------------------- . { . #[expect(clippy::collapsible_match)] . if op == UnOp::Neg { . self.arithmetic_context.check_negate(cx, e, arg); . } . }, . _ => (), . } 524,304 ( 0.04%) } . . 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); . } -- line 1121 ---------------------------------------- 65,538 ( 0.01%) -------------------------------------------------------------------------------- -- 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 { 655,380 ( 0.05%) 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. 327,690 ( 0.03%) if let Some(macro_call) = matching_root_macro_call(cx, expr.span, sym::format_macro) 4,325,509 ( 0.35%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/macros.rs:clippy_utils::macros::matching_root_macro_call (65,538x) . && first_node_in_macro(cx, expr).is_some_and(|p_expn| p_expn != macro_call.expn) . && let Some(format_args) = self.format_args.get(cx, expr, macro_call.expn) . { . let mut applicability = Applicability::MachineApplicable; . let call_site = macro_call.span; . . match (format_args.arguments.all_args(), &format_args.template[..]) { . ([], []) => span_useless_format_empty(cx, call_site, "String::new()".to_owned(), applicability), -- line 69 ---------------------------------------- -- line 101 ---------------------------------------- . format!("{}.to_string()", sugg.maybe_paren()) . }; . span_useless_format(cx, call_site, sugg, applicability); . } . }, . _ => {}, . } . } 524,304 ( 0.04%) } . } . . fn span_useless_format_empty(cx: &LateContext<'_>, span: Span, sugg: String, applicability: Applicability) { . span_lint_and_sugg( . cx, . USELESS_FORMAT, . span, . "useless use of `format!`", -- line 117 ---------------------------------------- 65,538 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/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 { 98 ( 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)] 8 ( 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) } 8 ( 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 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. 262,545 ( 0.02%) unsafe { self.inner.deallocate(T::LAYOUT) } . } . } . . #[rustc_const_unstable(feature = "const_heap", issue = "79597")] . #[rustfmt::skip] // FIXME(fee1-dead): temporary measure before rustfmt is bumped . const impl RawVecInner { . #[cfg(not(no_global_oom_handling))] . #[inline] -- line 433 ---------------------------------------- -- line 453 ---------------------------------------- . // We avoid `unwrap_or_else` here because it bloats the amount of . // LLVM IR generated. . let layout = match layout_array(capacity, elem_layout) { . Ok(layout) => layout, . Err(_) => return Err(CapacityOverflow.into()), . }; . . // Don't allocate here because `Drop` will not deallocate when `capacity` is 0. 289 ( 0.00%) if layout.size() == 0 { . return Ok(Self::new_in(alloc, elem_layout.alignment())); . } . . let result = match init { . AllocInit::Uninitialized => alloc.allocate(layout), . #[cfg(not(no_global_oom_handling))] . AllocInit::Zeroed => alloc.allocate_zeroed(layout), . }; 453 ( 0.00%) let ptr = match result { . Ok(ptr) => ptr, . Err(_) => return Err(AllocError { layout, non_exhaustive: () }.into()), . }; . . // Allocators currently return a `NonNull<[u8]>` whose length . // matches the size requested. If that ever changes, the capacity . // here should change to `ptr.len() / size_of::()`. . Ok(Self { -- line 478 ---------------------------------------- -- line 485 ---------------------------------------- . /// # Safety . /// - `elem_layout` must be valid for `self`, i.e. it must be the same `elem_layout` used to . /// initially construct `self` . /// - `elem_layout`'s size must be a multiple of its alignment . #[cfg(not(no_global_oom_handling))] . #[inline] . unsafe fn grow_one(&mut self, elem_layout: Layout) { . // SAFETY: Precondition passed to caller 2 ( 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); . 28 ( 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`. 32 ( 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 58 ( 0.00%) let ptr = unsafe { self.finish_grow(cap, elem_layout)? }; 76 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:::finish_grow (1x) . . // SAFETY: `finish_grow` would have failed if `cap > isize::MAX` . unsafe { self.set_ptr_and_cap(ptr, cap) }; . Ok(()) . } . . /// # Safety . /// - `elem_layout` must be valid for `self`, i.e. it must be the same `elem_layout` used to . /// initially construct `self` . /// - `elem_layout`'s size must be a multiple of its alignment . /// - `cap` must be greater than the current capacity . // not marked inline(never) since we want optimizers to be able to observe the specifics of this . // function, see tests/codegen-llvm/vec-reserve-extend.rs. . #[cold] 164 ( 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()) 124 ( 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 { 132,890 ( 0.01%) self.ptr.cast().as_non_null_ptr() . } . . #[inline] . const fn capacity(&self, elem_size: usize) -> usize { 75 ( 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)> { 262,570 ( 0.02%) 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] 59 ( 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); . } 60 ( 0.00%) } . 54 ( 0.00%) if self.needs_to_grow(len, additional, elem_layout) { . unsafe { 71 ( 0.00%) do_reserve_and_handle(self, len, additional, elem_layout); 911 ( 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:: (8x) . } . } . } . . /// # 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 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 { 592 ( 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::()`. 19 ( 0.00%) self.ptr = Unique::from(ptr.cast()); 17 ( 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( -- line 782 ---------------------------------------- -- line 789 ---------------------------------------- . // 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 28 ( 0.00%) let ptr = unsafe { self.finish_grow(cap, elem_layout)? }; 76 ( 0.00%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/alloc/src/raw_vec/mod.rs:::finish_grow (1x) . . // SAFETY: `finish_grow` would have failed if `cap > isize::MAX` . unsafe { self.set_ptr_and_cap(ptr, cap) }; . Ok(()) . } . . /// # Safety . /// - `elem_layout` must be valid for `self`, i.e. it must be the same `elem_layout` used to -- 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 1 ( 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. 2 ( 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 ---------------------------------------- 787,568 ( 0.06%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/mem_replace.rs -------------------------------------------------------------------------------- Ir -- line 292 ---------------------------------------- . . impl MemReplace { . pub fn new(conf: &'static Conf) -> Self { . Self { msrv: conf.msrv.into() } . } . } . . impl<'tcx> LateLintPass<'tcx> for MemReplace { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::Call(func, [dest, src]) = expr.kind . // Check that `expr` is a call to `mem::replace()` . && 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_replace, def_id) . // Check that second argument is `Option::None` . && !check_replace_option_with_none(cx, src, dest, expr.span) . && !check_replace_option_with_some(cx, src, dest, expr.span, self.msrv) . && !check_replace_with_default(cx, src, dest, expr, self.msrv) . { . check_replace_with_uninit(cx, src, dest, expr.span); . } 524,304 ( 0.04%) } . } -------------------------------------------------------------------------------- -- 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { . let (lint, msg) = match complete_infinite_iter(cx, expr) { . Infinite => (INFINITE_ITER, "infinite iteration detected"), . MaybeInfinite => (MAYBE_INFINITE_ITER, "possible infinite iteration detected"), . Finite => { . return; . }, . }; . span_lint(cx, lint, expr.span, msg); 393,228 ( 0.03%) } . } . . #[derive(Copy, Clone, Debug, PartialEq, Eq)] . enum Finiteness { . Infinite, . MaybeInfinite, . Finite, . } -- line 73 ---------------------------------------- -- 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 { 327,690 ( 0.03%) match expr.kind { . ExprKind::MethodCall(method, receiver, args, _) => { . let method_str = method.ident.name; . for &(name, len) in &COMPLETING_METHODS { . if method_str == name && args.len() == len { . return is_infinite(cx, receiver); . } . } . for &(name, len) in &POSSIBLY_COMPLETING_METHODS { -- line 223 ---------------------------------------- -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_utils/src/visitors.rs -------------------------------------------------------------------------------- Ir -- line 87 ---------------------------------------- . } . V::Result::output() . } . } . macro_rules! visitable_ref { . ($t:ident, $f:ident) => { . impl<'tcx> Visitable<'tcx> for &'tcx $t<'tcx> { . fn visit>(self, visitor: &mut V) -> V::Result { 3 ( 0.00%) visitor.$f(self) 59 ( 0.00%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_lints/src/cognitive_complexity.rs:::check::{closure#0}> 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); -- line 103 ---------------------------------------- -- line 111 ---------------------------------------- . ) -> Option { . struct V { . f: F, . } . impl<'tcx, B, C: Continue, F: FnMut(&'tcx Expr<'tcx>) -> ControlFlow> Visitor<'tcx> for V { . type Result = ControlFlow; . . fn visit_expr(&mut self, e: &'tcx Expr<'tcx>) -> Self::Result { 131,070 ( 0.01%) match (self.f)(e) { 196,612 ( 0.02%) ControlFlow::Continue(c) if c.descend() => walk_expr(self, e), 1,638,375 ( 0.13%) => /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 (65,535x) . ControlFlow::Break(b) => ControlFlow::Break(b), . ControlFlow::Continue(_) => ControlFlow::Continue(()), . } . } . . // Avoid unnecessary `walk_*` calls. . fn visit_ty(&mut self, _: &'tcx hir::Ty<'tcx, AmbigArg>) -> Self::Result { . ControlFlow::Continue(()) -- line 128 ---------------------------------------- -- 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(()) . } . } 14 ( 0.00%) let mut v = V { f }; . node.visit(&mut v).break_value() . } . . /// Calls the given function once for each expression contained. This will enter bodies, but not . /// nested items. . pub fn for_each_expr<'tcx, B, C: Continue>( . tcx: TyCtxt<'tcx>, . node: impl Visitable<'tcx>, -- line 149 ---------------------------------------- 1 ( 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)> { 131,074 ( 0.01%) if let ExprKind::MethodCall(MethodCall { . seg: name_ident, . receiver, . .. . }) = &expr.kind . && let method_name = name_ident.ident.name . && matches!(method_name, sym::ceil | sym::floor | sym::round) . && let ExprKind::Lit(token_lit) = &receiver.kind . && token_lit.is_semantic_float() -- line 45 ---------------------------------------- -- line 48 ---------------------------------------- . { . Some((method_name, snippet(cx, receiver.span, "..").into())) . } else { . None . } . } . . impl EarlyLintPass for UnusedRounding { 458,759 ( 0.04%) fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) { . 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, . ); . } 524,296 ( 0.04%) } . } -------------------------------------------------------------------------------- -- 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. 9 ( 0.00%) pub fn check_clippy_attr(sess: &Session, attr: &A) { 1 ( 0.00%) if let [clippy, segment2] = &*attr.path() . && *clippy == sym::clippy . { . let path_span = attr . .path_span() . .expect("Clippy attributes are unparsed and have a span"); . . match *segment2 { . sym::cyclomatic_complexity => { -- line 25 ---------------------------------------- -- line 40 ---------------------------------------- . | sym::msrv . | sym::has_significant_drop . | sym::format_args => {}, . _ => { . sess.dcx().span_err(path_span, "usage of unknown attribute"); . }, . } . } 7 ( 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| { . if let [clippy, segment2] = &*attr.path() . && *clippy == sym::clippy . { . if *segment2 == sym::cyclomatic_complexity { -- line 56 ---------------------------------------- -- line 99 ---------------------------------------- . variant_def.is_field_list_non_exhaustive() || find_attr!(tcx, variant_def.def_id, NonExhaustive(..)) . }) . || adt . .all_fields() . .any(|field_def| find_attr!(tcx, field_def.did, NonExhaustive(..))) . } . . /// Checks whether the given span contains a `#[cfg(..)]` attribute 1 ( 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. 1 ( 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 . }) 3 ( 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 { 1 ( 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; 262,172 ( 0.02%) parse_attrs(sess, attrs, name, |val| stack.push(val)); 1,310,874 ( 0.11%) => site/frontend/rust-clippy/clippy_utils/src/attrs.rs:clippy_utils::attrs::parse_attrs::<::push_attrs::{closure#0}, rustc_hir::hir::Attribute> (65,543x) . } . pub fn pop_attrs(&mut self, sess: &Session, attrs: &[impl AttributeExt], name: Symbol) { . let stack = &mut self.stack; 262,172 ( 0.02%) parse_attrs(sess, attrs, name, |val| { 1,310,876 ( 0.11%) => site/frontend/rust-clippy/clippy_utils/src/attrs.rs:clippy_utils::attrs::parse_attrs::<::pop_attrs::{closure#0}, rustc_hir::hir::Attribute> (65,543x) . let popped = stack.pop(); . debug_assert_eq!(popped, Some(val)); . }); . } . } . 1,310,860 ( 0.11%) fn parse_attrs(sess: &Session, attrs: &[impl AttributeExt], name: Symbol, mut f: F) { . for attr in get_builtin_attr(attrs, name) { . let Some(value) = attr.value_str() else { . sess.dcx().span_err(attr.span(), "bad clippy attribute"); . continue; . }; . let Ok(value) = u64::from_str(value.as_str()) else { . sess.dcx().span_err(attr.span(), "not a number"); . continue; . }; . f(value); . } 1,048,688 ( 0.08%) } 65,544 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_utils/src/lib.rs -------------------------------------------------------------------------------- Ir -- line 128 ---------------------------------------- . /// Methods on `Vec` that also exists on slices. . pub const VEC_METHODS_SHADOWING_SLICE_METHODS: [Symbol; 3] = [sym::as_ptr, sym::is_empty, sym::len]; . . #[macro_export] . macro_rules! extract_msrv_attr { . () => { . fn check_attributes(&mut self, cx: &rustc_lint::EarlyContext<'_>, attrs: &[rustc_ast::ast::Attribute]) { . let sess = rustc_lint::LintContext::sess(cx); 1,507,460 ( 0.12%) self.msrv.check_attributes(attrs); 196,620 ( 0.02%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_attributes (65,540x) . } . . fn check_attributes_post(&mut self, cx: &rustc_lint::EarlyContext<'_>, attrs: &[rustc_ast::ast::Attribute]) { . let sess = rustc_lint::LintContext::sess(cx); 1,441,918 ( 0.12%) self.msrv.check_attributes_post(attrs); 196,620 ( 0.02%) => /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/ptr/non_null.rs:::check_attributes_post (65,540x) . } . }; . } . . /// 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 216 ---------------------------------------- . /// `tcx.hir_is_inside_const_context(_)`. . /// . /// Do not call this unless the `LateContext` has an enclosing body. For release build this case . /// will safely return `false`, but debug builds will ICE. Note that `check_expr`, `check_block`, . /// `check_pat` and a few other entry points will always have an enclosing body. Some entry points . /// like `check_path` or `check_ty` may or may not have one. . pub fn is_in_const_context(cx: &LateContext<'_>) -> bool { . debug_assert!(cx.enclosing_body.is_some(), "`LateContext` has no enclosing body"); 2 ( 0.00%) cx.enclosing_body.is_some_and(|id| { 1 ( 0.00%) cx.tcx 5 ( 0.00%) .hir_body_const_context(cx.tcx.hir_body_owner_def_id(id)) 192 ( 0.00%) => ???:::hir_body_const_context (1x) 124 ( 0.00%) => ???:::hir_body_owner_def_id (1x) . .is_some() . }) 1 ( 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 . pub fn is_inside_always_const_context(tcx: TyCtxt<'_>, hir_id: HirId) -> bool { -- line 237 ---------------------------------------- -- line 1055 ---------------------------------------- . } . } . // Reverse `matched` so that it is in the same order as `methods`. . matched.reverse(); . Some(matched) . } . . /// Returns `true` if the provided `def_id` is an entrypoint to a program. 9 ( 0.00%) pub fn is_entrypoint_fn(cx: &LateContext<'_>, def_id: DefId) -> bool { 1 ( 0.00%) cx.tcx . .entry_fn(()) . .is_some_and(|(entry_fn_def_id, _)| def_id == entry_fn_def_id) 8 ( 0.00%) } . . /// Returns `true` if the expression is in the program's `#[panic_handler]`. . pub fn is_in_panic_handler(cx: &LateContext<'_>, e: &Expr<'_>) -> bool { . let parent = cx.tcx.hir_get_parent_item(e.hir_id); . Some(parent.to_def_id()) == cx.tcx.lang_items().panic_impl() . } . . /// Gets the name of the item the expression is in, if available. -- line 1075 ---------------------------------------- -- line 1118 ---------------------------------------- . } else { . ControlFlow::Continue(()) . } . }) . .is_some() . } . . /// Gets the parent expression, if any –- this is useful to constrain a lint. 65,538 ( 0.01%) pub fn get_parent_expr<'tcx>(cx: &LateContext<'tcx>, e: &Expr<'_>) -> Option<&'tcx Expr<'tcx>> { 131,076 ( 0.01%) get_parent_expr_for_hir(cx, e.hir_id) 131,076 ( 0.01%) } . . /// This retrieves the parent for the given `HirId` if it's an expression. This is useful for . /// constraint lints . pub fn get_parent_expr_for_hir<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId) -> Option<&'tcx Expr<'tcx>> { 262,152 ( 0.02%) match cx.tcx.parent_hir_node(hir_id) { 7,078,104 ( 0.57%) => ???:::parent_hir_node (65,538x) . Node::Expr(parent) => Some(parent), . _ => None, . } . } . . /// Gets the enclosing block, if any. . pub fn get_enclosing_block<'tcx>(cx: &LateContext<'tcx>, hir_id: HirId) -> Option<&'tcx Block<'tcx>> { . let enclosing_node = cx -- line 1141 ---------------------------------------- -- 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> { 1 ( 0.00%) (0..decl.inputs.len()).map(move |i| &body.params[i]) . } . . /// Checks if a given expression is a match expression expanded from the `?` . /// operator or the `try` macro. . pub fn is_try<'tcx>(cx: &LateContext<'_>, expr: &'tcx Expr<'tcx>) -> Option<&'tcx Expr<'tcx>> { . fn is_ok(cx: &LateContext<'_>, arm: &Arm<'_>) -> bool { . if let PatKind::TupleStruct(ref path, pat, ddpos) = arm.pat.kind . && ddpos.as_opt_usize().is_none() -- line 1561 ---------------------------------------- -- line 1628 ---------------------------------------- . . /// Returns `true` if the lint is allowed in the current context. This is useful for . /// skipping long running code when it's unnecessary . /// . /// This function should check the lint level for the same node, that the lint will . /// be emitted at. If the information is buffered to be emitted at a later point, please . /// make sure to use `span_lint_hir` functions to emit the lint. This ensures that . /// expectations at the checked nodes will be fulfilled. 32 ( 0.00%) pub fn is_lint_allowed(cx: &LateContext<'_>, lint: &'static Lint, id: HirId) -> bool { 16 ( 0.00%) cx.tcx.lint_level_spec_at_node(lint, id).is_allow() 7,197 ( 0.00%) => ???:::lint_level_spec_at_node (8x) 16 ( 0.00%) } . . pub fn strip_pat_refs<'hir>(mut pat: &'hir Pat<'hir>) -> &'hir Pat<'hir> { . while let PatKind::Ref(subpat, _, _) = pat.kind { . pat = subpat; . } . pat . } . -- line 1646 ---------------------------------------- -- line 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. 458,766 ( 0.04%) pub fn in_automatically_derived(tcx: TyCtxt<'_>, id: HirId) -> bool { . tcx.hir_parent_owner_iter(id) 327,690 ( 0.03%) .filter(|(_, node)| matches!(node, OwnerNode::Item(item) if matches!(item.kind, ItemKind::Impl(_)))) . .any(|(id, _)| find_attr!(tcx, id.def_id, AutomaticallyDerived)) 458,766 ( 0.04%) } . . /// Checks if the given `DefId` matches the `libc` item. . 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. . cx.tcx.crate_name(did.krate) == sym::libc && cx.tcx.def_path_str(did).ends_with(name.as_str()) . } . -- line 1708 ---------------------------------------- -- line 2052 ---------------------------------------- . None . } else if is_no_std_crate(cx) { . Some("core") . } else { . Some("std") . } . } . 1 ( 0.00%) pub fn is_no_std_crate(cx: &LateContext<'_>) -> bool { 2 ( 0.00%) find_attr!(cx.tcx, crate, NoStd) 45 ( 0.00%) => ???:::hir_krate_attrs (1x) 3 ( 0.00%) } . . pub fn is_no_core_crate(cx: &LateContext<'_>) -> bool { . find_attr!(cx.tcx, crate, NoCore) . } . . /// Check if parent of a hir node is a trait implementation block. . /// For example, `f` in . /// ```no_run . /// # struct S; . /// # trait Trait { fn f(); } . /// impl Trait for S { . /// fn f() {} . /// } . /// ``` 6 ( 0.00%) pub fn is_trait_impl_item(cx: &LateContext<'_>, hir_id: HirId) -> bool { 8 ( 0.00%) if let Node::Item(item) = cx.tcx.parent_hir_node(hir_id) { 1,084 ( 0.00%) => ???:::parent_hir_node (2x) . matches!(item.kind, ItemKind::Impl(Impl { of_trait: Some(_), .. })) . } else { . false . } 4 ( 0.00%) } . . /// Check if it's even possible to satisfy the `where` clause for the item. . /// . /// `trivial_bounds` feature allows functions with unsatisfiable bounds, for example: . /// . /// ```ignore . /// fn foo() where i32: Iterator { . /// for _ in 2i32 {} -- line 2091 ---------------------------------------- -- line 2098 ---------------------------------------- . .clauses_of(did) . .clauses . .iter() . .filter_map(|(p, _)| if p.is_global() { Some(*p) } else { None }); . traits::impossible_clauses(cx.tcx, traits::elaborate(cx.tcx, clauses).collect::>()) . } . . /// Returns the `DefId` of the callee if the given expression is a function or method call. 262,152 ( 0.02%) pub fn fn_def_id(cx: &LateContext<'_>, expr: &Expr<'_>) -> Option { 65,538 ( 0.01%) fn_def_id_with_node_args(cx, expr).map(|(did, _)| did) 1,703,988 ( 0.14%) => site/frontend/rust-clippy/clippy_utils/src/lib.rs:clippy_utils::fn_def_id_with_node_args (65,538x) 131,076 ( 0.01%) } . . /// Returns the `DefId` of the callee if the given expression is a function or method call, . /// as well as its node args. 458,766 ( 0.04%) pub fn fn_def_id_with_node_args<'tcx>( . cx: &LateContext<'tcx>, . expr: &Expr<'_>, . ) -> Option<(DefId, GenericArgsRef<'tcx>)> { . let typeck = cx.typeck_results(); 327,690 ( 0.03%) match &expr.kind { . ExprKind::MethodCall(..) => Some(( . typeck.type_dependent_def_id(expr.hir_id)?, . typeck.node_args(expr.hir_id), . )), . ExprKind::Call( . Expr { . kind: ExprKind::Path(qpath), . hir_id: path_hir_id, -- line 2125 ---------------------------------------- -- line 2134 ---------------------------------------- . { . Some((id, typeck.node_args(*path_hir_id))) . } else { . None . } . }, . _ => None, . } 589,842 ( 0.05%) } . . /// 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 2267 ---------------------------------------- . count = count.wrapping_add(1); . curr_expr = local_expr; . } . (curr_expr, count) . } . . /// Peels off all references on the expression. Returns the underlying expression and the number of . /// references removed. 131,076 ( 0.01%) pub fn peel_hir_expr_refs<'a>(expr: &'a Expr<'a>) -> (&'a Expr<'a>, usize) { . let mut count = 0; 131,076 ( 0.01%) let e = peel_hir_expr_while(expr, |e| match e.kind { . ExprKind::AddrOf(ast::BorrowKind::Ref, _, e) => { . count += 1; . Some(e) . }, . _ => None, . }); . (e, count) 65,538 ( 0.01%) } . . /// 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 2841 ---------------------------------------- . }) . } . . /// 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| { 196,608 ( 0.02%) 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 ---------------------------------------- 196,660 ( 0.02%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/non_copy_const.rs -------------------------------------------------------------------------------- Ir -- 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)) 680,477 ( 0.05%) => /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. . 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 -- line 279 ---------------------------------------- -- line 709 ---------------------------------------- . _ => return None, . }; . src_expr = use_expr; . } . } . } . . impl<'tcx> LateLintPass<'tcx> for NonCopyConst<'tcx> { 28 ( 0.00%) fn check_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx Item<'_>) { 8 ( 0.00%) if let ItemKind::Const(ident, .., ct_rhs) = item.kind . && !ident.is_special() . && let ty = cx.tcx.type_of(item.owner_id).instantiate_identity().skip_norm_wip() . && match self.is_ty_freeze(cx.tcx, cx.typing_env(), ty) { . IsFreeze::No => true, . IsFreeze::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 -- line 726 ---------------------------------------- -- 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"); . } . }, . ); . } 32 ( 0.00%) } . . fn check_trait_item(&mut self, cx: &LateContext<'tcx>, item: &'tcx TraitItem<'_>) { . if let TraitItemKind::Const(_, ct_rhs_opt) = item.kind . && let ty = cx.tcx.type_of(item.owner_id).instantiate_identity().skip_norm_wip() . && match self.is_ty_freeze(cx.tcx, cx.typing_env(), ty) { . IsFreeze::No => true, . IsFreeze::Maybe if let Some(ct_rhs) = ct_rhs_opt => { . match cx.tcx.const_eval_poly(item.owner_id.to_def_id()) { -- line 765 ---------------------------------------- -- line 845 ---------------------------------------- . cx, . DECLARE_INTERIOR_MUTABLE_CONST, . item.ident.span, . "named constant with interior mutability", . ); . } . } . 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, e: &'tcx Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::Path(qpath) = &e.kind . && let typeck = cx.typeck_results() . && let Res::Def(DefKind::Const { .. } | DefKind::AssocConst { .. }, did) = typeck.qpath_res(qpath, e.hir_id) . // As of `1.80` constant contexts can't borrow any type with interior mutability . && !is_in_const_context(cx) . && !self.is_ty_freeze(cx.tcx, cx.typing_env(), typeck.expr_ty(e)).is_freeze() . && let Some(borrow_src) = { . // The extra block helps formatting a lot. . if let Ok(val) = cx.tcx.const_eval_resolve( -- line 862 ---------------------------------------- -- 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"); . }, . ); . } 524,304 ( 0.04%) } . } . . struct ReplaceAssocFolder<'tcx> { . tcx: TyCtxt<'tcx>, . trait_id: DefId, . self_ty: Ty<'tcx>, . } . impl<'tcx> TypeFolder> for ReplaceAssocFolder<'tcx> { -- line 900 ---------------------------------------- -------------------------------------------------------------------------------- -- 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<'_>) { -- line 119 ---------------------------------------- -- line 122 ---------------------------------------- . . fn check_impl_item_post(&mut self, cx: &LateContext<'_>, impl_item: &ImplItem<'_>) { . // Assume no nested Impl of Debug and Display within each other . if is_format_trait_impl(cx, impl_item).is_some() { . self.format_trait_impl = None; . } . } . 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 196,614 ( 0.02%) if let Some(format_trait_impl) = self.format_trait_impl { . let linter = FormatImplExpr { . cx, . 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(); . } 524,304 ( 0.04%) } . } . . struct FormatImplExpr<'a, 'tcx> { . cx: &'a LateContext<'tcx>, . format_args: &'a FormatArgsStorage, . expr: &'tcx Expr<'tcx>, . format_trait_impl: FormatTraitNames, . } -- line 150 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 131,076 ( 0.01%) if let ExprKind::Call(func, [arg]) = expr.kind . && let ExprKind::Path(QPath::TypeRelative(func_ty, func_name)) = func.kind . && func_name.ident.name == sym::new . && !expr.span.from_expansion() . && cx.typeck_results().node_type(func_ty.hir_id).is_diag_item(cx, sym::Arc) . && let arg_ty = cx.typeck_results().expr_ty(arg) . // make sure that the type is not and does not contain any type parameters . && arg_ty.walk().all(|arg| { . !matches!(arg.kind(), GenericArgKind::Type(ty) if matches!(ty.kind(), ty::Param(_))) -- line 55 ---------------------------------------- -- 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`" . )); . }); . }, . ); . } 524,304 ( 0.04%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/manual_float_methods.rs -------------------------------------------------------------------------------- Ir -- 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 131,076 ( 0.01%) if let ExprKind::Binary(kind, lhs, rhs) = expr.kind . && let ExprKind::Binary(lhs_kind, lhs_lhs, lhs_rhs) = lhs.kind . && 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`. . && let mut exprs = [lhs_lhs, lhs_rhs, rhs_lhs, rhs_rhs] . && exprs.iter_mut().partition_in_place(|i| i.res_local_id().is_some()) == 2 . && !expr.span.in_external_macro(cx.sess().source_map()) . && ( -- line 145 ---------------------------------------- -- line 197 ---------------------------------------- . "or, for conciseness", . format!("!{local_snippet}.is_infinite()"), . Applicability::MaybeIncorrect, . ); . }, . } . }); . } 524,304 ( 0.04%) } . } -------------------------------------------------------------------------------- -- 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 { 196,634 ( 0.02%) Filter { iter, predicate } . } . } . . impl Filter . where . I: Iterator, . P: FnMut(&I::Item) -> bool, . { -- line 36 ---------------------------------------- -- line 78 ---------------------------------------- . ) -> impl FnMut(Acc, T) -> Acc { . 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 { 65,541 ( 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] 8 ( 0.00%) fn next(&mut self) -> Option { . self.iter.find(&mut self.predicate) 8 ( 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 157 ---------------------------------------- . self.iter.try_fold(init, filter_try_fold(&mut self.predicate, fold)) . } . . #[inline] . fn fold(self, init: Acc, fold: Fold) -> Acc . where . Fold: FnMut(Acc, Self::Item) -> Acc, . { 5 ( 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 ---------------------------------------- 131,077 ( 0.01%) -------------------------------------------------------------------------------- -- Auto-annotated source: site/frontend/rust-clippy/clippy_lints/src/default_constructed_unit_structs.rs -------------------------------------------------------------------------------- Ir -- line 54 ---------------------------------------- . if let hir::TyKind::Path(ref qpath) = ty.kind { . is_ty_alias(qpath) . } else { . false . } . } . . impl LateLintPass<'_> for DefaultConstructedUnitStructs { 458,766 ( 0.04%) fn check_expr<'tcx>(&mut self, cx: &LateContext<'tcx>, expr: &'tcx hir::Expr<'tcx>) { 131,076 ( 0.01%) if let ExprKind::Call(fn_expr, &[]) = expr.kind . // make sure we have a call to `Default::default` . && 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 . && !is_alias(*base) . && let Res::Def(_, def_id) = cx.qpath_res(qpath, fn_expr.hir_id) . && cx.tcx.is_diagnostic_item(sym::default_fn, def_id) . // make sure we have a struct with no fields (unit struct) -- line 71 ---------------------------------------- -- line 91 ---------------------------------------- . diag.multipart_suggestion( . "remove this call to `default`", . removals, . Applicability::MachineApplicable, . ); . }, . ); . } 524,304 ( 0.04%) } . } -------------------------------------------------------------------------------- -- Auto-annotated source: /home/moon/.rustup/toolchains/nightly-2026-08-07-x86_64-unknown-linux-gnu/lib/rustlib/rustc-src/rust/compiler/rustc_span/src/lib.rs -------------------------------------------------------------------------------- Ir -- line 177 ---------------------------------------- . } . } . . #[inline] . pub fn with_session_globals(f: F) -> R . where . F: FnOnce(&SessionGlobals) -> R, . { 38 ( 0.00%) 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)) . } . 1 ( 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> { 1 ( 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 702 ---------------------------------------- . Span::new(self.lo, self.hi, self.ctxt, self.parent) . } . #[inline] . pub fn with_lo(&self, lo: BytePos) -> Span { . Span::new(lo, self.hi, self.ctxt, self.parent) . } . #[inline] . pub fn with_hi(&self, hi: BytePos) -> Span { 11 ( 0.00%) Span::new(self.lo, hi, self.ctxt, self.parent) . } . /// Avoid if possible, `Span::map_ctxt` should be preferred. . #[inline] . fn with_ctxt(&self, ctxt: SyntaxContext) -> Span { . Span::new(self.lo, self.hi, ctxt, self.parent) . } . /// Avoid if possible, `Span::with_parent` should be preferred. . #[inline] -- line 718 ---------------------------------------- -- line 745 ---------------------------------------- . fn cmp(&self, rhs: &Self) -> Ordering { . Ord::cmp(&self.data(), &rhs.data()) . } . } . . impl Span { . #[inline] . pub fn lo(self) -> BytePos { 7 ( 0.00%) self.data().lo . } . #[inline] . pub fn with_lo(self, lo: BytePos) -> Span { . self.data().with_lo(lo) . } . #[inline] . pub fn hi(self) -> BytePos { 6 ( 0.00%) self.data().hi . } . #[inline] . pub fn with_hi(self, hi: BytePos) -> Span { . self.data().with_hi(hi) . } . #[inline] . pub fn with_ctxt(self, ctxt: SyntaxContext) -> Span { . self.map_ctxt(|_| ctxt) -- line 769 ---------------------------------------- -- line 775 ---------------------------------------- . } . . /// 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] . pub fn in_external_macro(self, sm: &SourceMap) -> bool { 524,332 ( 0.04%) self.ctxt().in_external_macro(sm) 101 ( 0.00%) => ???:::in_external_macro (1x) . } . . /// 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 2649 ---------------------------------------- . impl Pos for $ident { . #[inline(always)] . fn from_usize(n: usize) -> $ident { . $ident(n as $inner_ty) . } . . #[inline(always)] . fn to_usize(&self) -> usize { 10 ( 0.00%) self.0 as usize . } . . #[inline(always)] . fn from_u32(n: u32) -> $ident { . $ident(n as $inner_ty) . } . . #[inline(always)] -- line 2665 ---------------------------------------- -- line 2677 ---------------------------------------- . } . } . . impl Sub for $ident { . type Output = $ident; . . #[inline(always)] . fn sub(self, rhs: $ident) -> $ident { 61,806 ( 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. 2 ( 0.00%) #[derive(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Debug)] . pub struct BytePos(pub u32); . . /// A byte offset relative to file beginning. . #[derive(Clone, Copy, PartialEq, Eq, Hash, PartialOrd, Ord, Debug, StableHash)] . pub struct RelativeBytePos(pub u32); . . /// A character offset. . /// -- line 2704 ---------------------------------------- 1,692,418 ( 0.14%) -------------------------------------------------------------------------------- -- 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 { 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'tcx>, exp: &Expr<'tcx>) { 131,076 ( 0.01%) if let ExprKind::Call(maybe_path, [src, radix]) = &exp.kind . && let ExprKind::Path(QPath::TypeRelative(ty, pathseg)) = &maybe_path.kind . . // check if the second argument is a primitive `10` . && is_integer_literal(radix, 10) . . // check if the second part of the path indeed calls the associated . // function `from_str_radix` . && pathseg.ident.name == sym::from_str_radix -- line 55 ---------------------------------------- -- 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, . ); . } 524,304 ( 0.04%) } . } . . /// 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() . } -------------------------------------------------------------------------------- -- 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 { 720,918 ( 0.06%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) { 131,076 ( 0.01%) let for_loop = higher::ForLoop::hir(expr); 983,070 ( 0.08%) => /home/moon/git/rustc-perf/site/frontend/rust-clippy/clippy_utils/src/higher.rs:::hir (65,538x) 65,538 ( 0.01%) if let Some(higher::ForLoop { . pat, . arg, . body, . loop_id, . span, . label, 131,076 ( 0.01%) }) = for_loop . { . // we don't want to check expanded macros . // this check is not at the top of the function . // since higher::for_loop expressions are marked as expansions . if body.span.from_expansion() { . return; . } . self.check_for_loop(cx, pat, arg, body, expr, span, label); . if let ExprKind::Block(block, _) = body.kind { . never_loop::check(cx, block, loop_id, span, for_loop.as_ref()); . } . } . . // we don't want to check expanded macros 131,076 ( 0.01%) if expr.span.from_expansion() { . return; . } . . // check for never_loop 196,614 ( 0.02%) if let ExprKind::Loop(block, ..) = expr.kind { . never_loop::check(cx, block, expr.hir_id, expr.span, None); . } . . // 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`) . if let ExprKind::Loop(block, label, LoopSource::Loop, _) = expr.kind { . // also check for empty `loop {}` statements, skipping those in #[panic_handler] . empty_loop::check(cx, expr, block); . while_let_loop::check(cx, expr, block); . infinite_loop::check(cx, expr, block, label); . } . 131,076 ( 0.01%) while_let_on_iterator::check(cx, expr); 1,114,146 ( 0.09%) => /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 (65,538x) . . if let Some(higher::While { . condition, body, span, .. . }) = higher::While::hir(expr) . { . while_immutable_condition::check(cx, condition, body); . while_float::check(cx, condition); . missing_spin_loop::check(cx, condition, body); . manual_while_let_some::check(cx, condition, body, span); . } . 131,076 ( 0.01%) if let ExprKind::MethodCall(path, recv, args, _) = expr.kind { . let name = path.ident.name; . . let is_iterator_method = || { . cx.ty_based_def(expr) . .assoc_fn_parent(cx) . .is_diag_item(cx, sym::Iterator) . }; . -- line 924 ---------------------------------------- -- line 947 ---------------------------------------- . { . never_loop::check_iterator_reduction(cx, expr, recv, closure); . } . }, . . _ => {}, . } . } 524,304 ( 0.04%) } . } . . impl Loops { . #[expect(clippy::too_many_arguments)] . fn check_for_loop<'tcx>( . &self, . cx: &LateContext<'tcx>, . pat: &'tcx Pat<'_>, -- line 963 ---------------------------------------- -------------------------------------------------------------------------------- -- 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<'_>) { 6 ( 0.00%) if self.loaded_bodies.first().is_some_and(|&x| x == body.id()) { . self.consumed_locals.clear(); . self.loaded_bodies.clear(); . } . } . 458,766 ( 0.04%) fn check_expr(&mut self, cx: &LateContext<'_>, expr: &'_ Expr<'_>) { 131,076 ( 0.01%) if let ExprKind::Assign(lhs, rhs, _) = &expr.kind . && !lhs.span.from_expansion() . && !rhs.span.from_expansion() . && let lhs_ty = cx.typeck_results().expr_ty(lhs) . && let Some(inner_ty) = lhs_ty.boxed_ty() . // 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 -- line 89 ---------------------------------------- -- line 132 ---------------------------------------- . expr.span, . "replace existing content with inner value instead", . suggestion, . app, . ); . }); . } . } 524,304 ( 0.04%) } . } . . 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 ---------------------------------------- -------------------------------------------------------------------------------- -- 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 { 262,152 ( 0.02%) fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) { 327,690 ( 0.03%) match &expr.kind { . ExprKind::MethodCall(path, func, [param], _) => { . if let Some(adt) = cx.typeck_results().expr_ty(func).peel_refs().ty_adt_def() . && matches!( . (cx.tcx.get_diagnostic_name(adt.did()), path.ident.name), . (Some(sym::FsOpenOptions | sym::DirBuilder), sym::mode) . | (Some(sym::FsPermissions), sym::set_mode) . ) . && let ExprKind::Lit(_) = param.kind -- line 51 ---------------------------------------- -- line 67 ---------------------------------------- . .span . .check_text(cx, |src| !matches!(src.as_bytes(), [b'0', b'o' | b'b', ..])) . { . show_error(cx, param); . } . }, . _ => {}, . } 327,690 ( 0.03%) } . } . . 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 ---------------------------------------- -------------------------------------------------------------------------------- The following files chosen for auto-annotation could not be found: -------------------------------------------------------------------------------- /rust/deps/hashbrown-0.17.1/src/raw.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/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/emap.h include/jemalloc/internal/fb.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/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/eset.c src/extent.c src/tcache.c -------------------------------------------------------------------------------- Ir -------------------------------------------------------------------------------- 377,140,972 (30.42%) events annotated