-------------------------------------------------------------------------------- I1 cache: 65536 B, 64 B, 4-way associative D1 cache: 32768 B, 64 B, 8-way associative LL cache: 67108864 B, 64 B, 64-way associative Command: /usr/home/liquid/.rustup/toolchains/w-profiling/bin/rustc --crate-name unicode_categories src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts,future-incompat --crate-type lib --emit=dep-info,metadata -C embed-bitcode=no -C debuginfo=2 -C metadata=6dc85741e867f671 -C extra-filename=-6dc85741e867f671 --out-dir /usr/home/liquid/tmp/.tmpKz1Lgq/target/debug/deps -L dependency=/usr/home/liquid/tmp/.tmpKz1Lgq/target/debug/deps -Adeprecated -Aunknown-lints -Zincremental-verify-ich Data file: results/cgout-w-profiling-unicode_categories-0.1.1-Check-Full Events recorded: Ir Events shown: Ir Event sort order: Ir Thresholds: 0.1 Include dirs: User annotated: Auto-annotation: on -------------------------------------------------------------------------------- Ir -------------------------------------------------------------------------------- 877,880,986 (100.0%) PROGRAM TOTALS -------------------------------------------------------------------------------- Ir file:function -------------------------------------------------------------------------------- 17,775,143 ( 2.02%) ./malloc/malloc.c:_int_malloc 11,650,130 ( 1.33%) ./malloc/malloc.c:_int_free 10,305,124 ( 1.17%) ./elf/dl-lookup.c:_dl_lookup_symbol_x 9,619,672 ( 1.10%) ./string/../sysdeps/x86_64/multiarch/memmove-vec-unaligned-erms.S:__memcpy_avx_unaligned_erms 8,557,450 ( 0.97%) ./malloc/malloc.c:malloc 7,984,608 ( 0.91%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_lexer/src/unescape.rs:rustc_lexer::unescape::scan_escape 7,107,505 ( 0.81%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_parse/src/lexer/mod.rs:::next_token 5,760,593 ( 0.66%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:>>::from_key_hashed_nocheck:: 5,743,976 ( 0.65%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_const_eval/src/interpret/operand.rs:>::try_read_immediate 5,421,486 ( 0.62%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:>>::insert 5,344,677 ( 0.61%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:::intern 4,835,679 ( 0.55%) ./elf/dl-lookup.c:do_lookup_x 4,603,016 ( 0.52%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:>>::get:: 4,397,199 ( 0.50%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_parse/src/lexer/tokentrees.rs:::parse_token_tree 4,279,101 ( 0.49%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_lexer/src/lib.rs:::advance_token 4,260,693 ( 0.49%) ./malloc/malloc.c:malloc_consolidate 4,244,633 ( 0.48%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:>::insert::>::{closure#0}> 4,237,390 ( 0.48%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_span/src/caching_source_map_view.rs:::span_data_to_lines_and_cols 4,141,271 ( 0.47%) ./elf/../sysdeps/x86_64/dl-machine.h:_dl_relocate_object 4,057,780 ( 0.46%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:>::reserve_rehash::>::{closure#0}> 3,832,927 ( 0.44%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/num/uint_macros.rs:::short_write_process_buffer:: 3,633,413 ( 0.41%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_parse/src/parser/mod.rs:::check 3,352,480 ( 0.38%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/hir/map/mod.rs:::attrs 3,318,208 ( 0.38%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_span/src/lib.rs:>::hash_stable 3,256,560 ( 0.37%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_parse/src/parser/mod.rs:::bump 3,213,385 ( 0.37%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-hash-1.1.0/src/lib.rs:<&str as core::hash::Hash>::hash:: 3,197,341 ( 0.36%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_mir_build/src/thir/cx/expr.rs:::mirror_expr_inner 3,127,705 ( 0.36%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/middle/region.rs:::temporary_scope 3,095,266 ( 0.35%) ./malloc/malloc.c:free 3,046,752 ( 0.35%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/mir/interpret/allocation.rs:::read_scalar:: 2,979,318 ( 0.34%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_const_eval/src/transform/check_consts/qualifs.rs:rustc_const_eval::transform::check_consts::qualifs::in_operand::::qualif_local::{closure#0}> 2,970,001 ( 0.34%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_parse/src/parser/mod.rs:::next 2,955,460 ( 0.34%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:::node_type_opt 2,793,830 ( 0.32%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_serialize/src/opaque.rs:>::decode 2,781,856 ( 0.32%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/rustc-hash-1.1.0/src/lib.rs:::write 2,774,663 ( 0.32%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_ast/src/token.rs:::clone 2,662,278 ( 0.30%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/ty/context.rs:::maybe_lint_level_root_bounded 2,573,768 ( 0.29%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/mir/mod.rs:::check_static_ptr 2,571,156 ( 0.29%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_data_structures/src/sip128.rs:::short_write_process_buffer:: 2,527,986 ( 0.29%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_parse/src/parser/expr.rs:::parse_assoc_expr_with 2,517,994 ( 0.29%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_const_eval/src/interpret/memory.rs:>::get_global_alloc 2,490,713 ( 0.28%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:>>::insert 2,475,668 ( 0.28%) /usr/home/liquid/rust/worktree-benchmarking/library/alloc/src/vec/mod.rs:>::decode 2,458,232 ( 0.28%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_const_eval/src/interpret/validity.rs:>::try_visit_primitive 2,396,014 ( 0.27%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_mir_build/src/thir/cx/expr.rs:::make_mirror_unadjusted 2,378,681 ( 0.27%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_mir_build/src/build/expr/as_operand.rs:::as_operand 2,350,365 ( 0.27%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_ast/src/tokenstream.rs:::next_with_spacing 2,344,560 ( 0.27%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/mir/interpret/allocation.rs:::get_bytes_internal:: 2,338,528 ( 0.27%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_typeck/src/check/regionck.rs:::visit_expr 2,328,030 ( 0.27%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_span/src/lib.rs:>::decode 2,303,822 ( 0.26%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_data_structures/src/sip128.rs:>::hash_stable 2,296,875 ( 0.26%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/md-5-0.9.1/src/utils.rs:md5::utils::compress 2,283,646 ( 0.26%) ./malloc/malloc.c:unlink_chunk.constprop.0 2,278,302 ( 0.26%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_const_eval/src/interpret/validity.rs:>::aggregate_field_path_elem 2,258,335 ( 0.26%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/hir/map/mod.rs:::find_parent_node 2,239,852 ( 0.26%) ./string/../sysdeps/x86_64/multiarch/memcmp-avx2-movbe.S:__memcmp_avx2_movbe 2,230,827 ( 0.25%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_lint/src/levels.rs:::push 2,225,204 ( 0.25%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_const_eval/src/interpret/memory.rs:>::get 2,220,112 ( 0.25%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_query_system/src/query/plumbing.rs:rustc_query_system::query::plumbing::get_query:: 2,219,884 ( 0.25%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_const_eval/src/interpret/operand.rs:>::read_scalar 2,189,143 ( 0.25%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_parse/src/lexer/tokentrees.rs:::push 2,139,033 ( 0.24%) ./elf/do-rel.h:_dl_relocate_object 2,138,942 ( 0.24%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_typeck/src/check/writeback.rs:::visit_node_id 2,123,836 ( 0.24%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/middle/region.rs:>>::get:: 2,122,232 ( 0.24%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/map.rs:>>::from_key_hashed_nocheck:: 2,049,390 ( 0.23%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/mir/interpret/allocation.rs:::get_relocations:: 2,034,490 ( 0.23%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/ops/bit.rs:::hash:: 2,009,000 ( 0.23%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/num/uint_macros.rs:md5::utils::compress 1,999,753 ( 0.23%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_parse/src/parser/expr.rs:::collect_tokens_for_expr::<::parse_dot_or_call_expr::{closure#0}>::{closure#0} 1,999,656 ( 0.23%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:>::reserve_rehash::>::{closure#0}> 1,989,554 ( 0.23%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/str/validations.rs:::single_quoted_string 1,978,621 ( 0.23%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_typeck/src/check/expr.rs:::check_expr_with_expectation_and_args 1,962,575 ( 0.22%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_const_eval/src/interpret/place.rs:>::try_read_immediate 1,961,332 ( 0.22%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/../../stdarch/crates/core_arch/src/x86/sse2.rs:>>::insert 1,953,742 ( 0.22%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/../../stdarch/crates/core_arch/src/x86/sse2.rs:::intern 1,929,922 ( 0.22%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_target/src/abi/mod.rs:::read_scalar:: 1,929,502 ( 0.22%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_const_eval/src/interpret/operand.rs:>::const_val_to_op 1,927,794 ( 0.22%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/mir/interpret/value.rs:::to_u32 1,901,833 ( 0.22%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_const_eval/src/interpret/operand.rs:>::eval_operand 1,885,770 ( 0.21%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/cell.rs:::attrs 1,855,473 ( 0.21%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_borrowck/src/type_check/mod.rs:::visit_constant 1,842,127 ( 0.21%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/ty/util.rs:::is_trivially_unpin 1,827,830 ( 0.21%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_ast/src/token.rs:::eq 1,811,144 ( 0.21%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:)>>::remove_entry::>::{closure#0}> 1,794,917 ( 0.20%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:, rustc_query_system::dep_graph::graph::DepNodeIndex))>>::reserve_rehash::, rustc_query_system::dep_graph::graph::DepNodeIndex), core::hash::BuildHasherDefault>::{closure#0}> 1,754,220 ( 0.20%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/ty/util.rs:::is_freeze 1,752,624 ( 0.20%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_typeck/src/check/coercion.rs:>::coerce 1,711,289 ( 0.19%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_passes/src/region.rs:::visit_expr 1,671,825 ( 0.19%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/ty/flags.rs:::add_const 1,656,027 ( 0.19%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_typeck/src/mem_categorization.rs:::cat_expr_unadjusted 1,653,407 ( 0.19%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/mir/interpret/value.rs:::hash:: 1,638,918 ( 0.19%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/ptr/mod.rs:>::truncate 1,635,732 ( 0.19%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_const_eval/src/interpret/place.rs:>::place_field 1,622,903 ( 0.18%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:, ())>>::reserve_rehash::, rustc_middle::ty::context::Interned, (), core::hash::BuildHasherDefault>::{closure#0}> 1,612,291 ( 0.18%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_const_eval/src/interpret/place.rs:>::force_allocation_maybe_sized 1,594,826 ( 0.18%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_hir/src/intravisit.rs:rustc_hir::intravisit::walk_expr:: 1,587,539 ( 0.18%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/intrinsics.rs:::intern 1,581,822 ( 0.18%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_const_eval/src/interpret/place.rs:>::copy_op_no_validate 1,577,286 ( 0.18%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/mir/interpret/pointer.rs:<&mut >::mplace_array_fields::{closure#0} as core::ops::function::FnOnce<(u64,)>>::call_once 1,555,511 ( 0.18%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/bitmask.rs:::intern 1,550,701 ( 0.18%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/bitmask.rs:>>::insert 1,538,969 ( 0.18%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_privacy/src/lib.rs:::check_expr_pat_type 1,538,167 ( 0.18%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_lexer/src/lib.rs:::single_quoted_string 1,525,316 ( 0.17%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_expand/src/expand.rs:::filter_map_expr 1,523,012 ( 0.17%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/result.rs:>::try_read_immediate 1,522,367 ( 0.17%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_ast/src/token.rs:::ident 1,517,467 ( 0.17%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/../../stdarch/crates/core_arch/src/x86/sse2.rs:>>::from_key_hashed_nocheck:: 1,510,450 ( 0.17%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_trait_selection/src/traits/query/type_op/mod.rs:> as rustc_trait_selection::traits::query::type_op::TypeOp>::fully_perform 1,507,225 ( 0.17%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_parse/src/parser/mod.rs:::bump_with 1,505,072 ( 0.17%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/slice/iter/macros.rs:::next 1,492,907 ( 0.17%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_const_eval/src/interpret/place.rs:>::write_immediate_to_mplace_no_validate 1,486,580 ( 0.17%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:, (core::result::Result, rustc_middle::ty::layout::LayoutError>, rustc_query_system::dep_graph::graph::DepNodeIndex), core::hash::BuildHasherDefault>>::from_key_hashed_nocheck::> 1,470,999 ( 0.17%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/intrinsics.rs:>>::insert 1,459,872 ( 0.17%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:)>>::remove_entry::>::{closure#0}> 1,456,572 ( 0.17%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_metadata/src/rmeta/encoder.rs:>::encode 1,444,079 ( 0.16%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_lint/src/early.rs: as rustc_ast::visit::Visitor>::visit_expr 1,434,084 ( 0.16%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_passes/src/check_attr.rs:::check_attributes 1,418,436 ( 0.16%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/ty/context.rs:::node_type 1,414,656 ( 0.16%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_lint/src/early.rs: as rustc_ast::visit::Visitor>::visit_expr 1,406,107 ( 0.16%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_mir_build/src/build/scope.rs:::as_operand 1,404,720 ( 0.16%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/rustc_entry.rs:, rustc_middle::mir::interpret::allocation::Allocation), core::hash::BuildHasherDefault>>::rustc_entry 1,402,032 ( 0.16%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_const_eval/src/interpret/validity.rs:>::read_scalar 1,374,584 ( 0.16%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:, rustc_query_system::dep_graph::graph::DepNodeIndex))>>::insert::, rustc_query_system::dep_graph::graph::DepNodeIndex), core::hash::BuildHasherDefault>::{closure#0}> 1,374,425 ( 0.16%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:>::insert::>::{closure#0}> 1,362,217 ( 0.16%) ???:SetImpliedBits(llvm::FeatureBitset&, llvm::FeatureBitset const&, llvm::ArrayRef) 1,359,642 ( 0.15%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:>::insert::>::{closure#0}> 1,354,882 ( 0.15%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_parse/src/parser/expr.rs:::parse_dot_or_call_expr_with_ 1,348,752 ( 0.15%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/mir/interpret/allocation.rs:::find_bit 1,347,814 ( 0.15%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_mir_build/src/build/expr/as_constant.rs:::as_constant 1,347,557 ( 0.15%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:, ())>>::insert_entry::, rustc_middle::ty::context::Interned, (), core::hash::BuildHasherDefault>::{closure#0}> 1,346,246 ( 0.15%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_const_eval/src/interpret/visitor.rs: as rustc_const_eval::interpret::visitor::ValueVisitor>::walk_value 1,343,614 ( 0.15%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_const_eval/src/interpret/validity.rs: as rustc_const_eval::interpret::visitor::ValueVisitor>::visit_value 1,343,614 ( 0.15%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/option.rs: as rustc_const_eval::interpret::visitor::ValueVisitor>::walk_value 1,343,126 ( 0.15%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_ast/src/token.rs:::clone 1,336,839 ( 0.15%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:::push 1,316,039 ( 0.15%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_ast/src/util/literal.rs:::from_lit_token 1,298,327 ( 0.15%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/str/mod.rs:::next_token 1,292,011 ( 0.15%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_span/src/lib.rs:::next_token 1,278,875 ( 0.15%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/slice/iter/macros.rs:::single_quoted_string 1,270,731 ( 0.14%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_typeck/src/check/writeback.rs:::visit_expr 1,264,068 ( 0.14%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_parse/src/parser/expr.rs:::parse_prefix_expr 1,257,438 ( 0.14%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_parse/src/parser/expr.rs:::parse_opt_lit 1,240,681 ( 0.14%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_resolve/src/late.rs:::resolve_expr 1,239,126 ( 0.14%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:::get_global_alloc 1,238,888 ( 0.14%) /usr/home/liquid/rust/worktree-benchmarking/library/std/src/collections/hash/map.rs:>>::get:: 1,237,451 ( 0.14%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_typeck/src/check/expr.rs:::check_expr_kind 1,233,456 ( 0.14%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_ast/src/ptr.rs:>::map::<::parse_dot_or_call_expr_with::{closure#0}::{closure#0}> 1,233,425 ( 0.14%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_lint/src/late.rs:rustc_hir::intravisit::walk_expr::> 1,230,754 ( 0.14%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_data_structures/src/sorted_map.rs:>::range_slice_indices::> 1,229,634 ( 0.14%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/slice/index.rs:::get_relocations:: 1,229,130 ( 0.14%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_const_eval/src/interpret/memory.rs:>::get_mut 1,227,240 ( 0.14%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_parse/src/parser/expr.rs:::parse_lit_expr 1,220,712 ( 0.14%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_ast/src/ast.rs:::hash:: 1,212,792 ( 0.14%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/bitmask.rs:>>::from_key_hashed_nocheck:: 1,205,206 ( 0.14%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/ty/walk.rs:::next 1,205,018 ( 0.14%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_span/src/span_encoding.rs:::to 1,204,906 ( 0.14%) /usr/home/liquid/rust/worktree-benchmarking/library/alloc/src/vec/mod.rs:::check 1,198,600 ( 0.14%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_span/src/hygiene.rs:>::hash_stable 1,181,253 ( 0.13%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_ast_lowering/src/expr.rs:rustc_data_structures::stack::ensure_sufficient_stack::::lower_expr_mut::{closure#0}> 1,162,044 ( 0.13%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/slice/iter/macros.rs:rustc_ast::util::unicode::contains_text_flow_control_chars 1,154,612 ( 0.13%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_index/src/vec.rs:::mirror_expr_inner 1,153,161 ( 0.13%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_lint/src/builtin.rs:::check_heap_type 1,147,492 ( 0.13%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_lint/src/types.rs:::check_expr 1,144,104 ( 0.13%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_borrowck/src/type_check/canonical.rs:::fully_perform_op::<&rustc_middle::ty::TyS, rustc_middle::ty::ParamEnvAnd>> 1,139,151 ( 0.13%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_const_eval/src/interpret/place.rs:<&mut >::mplace_array_fields::{closure#0} as core::ops::function::FnOnce<(u64,)>>::call_once 1,132,948 ( 0.13%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/map.rs:>>::insert 1,128,804 ( 0.13%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/str/validations.rs:::next 1,122,578 ( 0.13%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_lint/src/types.rs:::inherent_atomic_method_call 1,113,134 ( 0.13%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/mir/interpret/allocation.rs:::get_bytes_mut:: 1,112,070 ( 0.13%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:, rustc_middle::mir::interpret::allocation::Allocation), core::hash::BuildHasherDefault>>::rustc_entry 1,109,942 ( 0.13%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/mir/interpret/value.rs:::to_char 1,089,501 ( 0.12%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_parse/src/parser/mod.rs:::expect 1,085,656 ( 0.12%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/map.rs:>>::insert 1,084,009 ( 0.12%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/mir/interpret/allocation.rs:::write_scalar:: 1,080,844 ( 0.12%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_mir_build/src/thir/constant.rs:rustc_mir_build::thir::constant::lit_to_const 1,071,721 ( 0.12%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/slice/iter/macros.rs:, >::decode::{closure#0}>, ::imported_source_files::{closure#3}::{closure#0}> as core::iter::traits::iterator::Iterator>::fold::<(), core::iter::traits::iterator::Iterator::for_each::call as alloc::vec::spec_extend::SpecExtend, >::decode::{closure#0}>, ::imported_source_files::{closure#3}::{closure#0}>>>::spec_extend::{closure#0}>::{closure#0}> 1,071,416 ( 0.12%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_parse/src/parser/attr.rs:::parse_outer_attributes 1,067,761 ( 0.12%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/slice/iter/macros.rs:::new_imported_source_file 1,064,836 ( 0.12%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_span/src/lib.rs:::new_imported_source_file 1,064,173 ( 0.12%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/stacker-0.1.14/src/lib.rs:stacker::remaining_stack 1,063,801 ( 0.12%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_privacy/src/lib.rs:::visit_expr 1,062,576 ( 0.12%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs:::warn_if_unreachable 1,062,388 ( 0.12%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/bitmask.rs:>>::get:: 1,052,532 ( 0.12%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_const_eval/src/interpret/operand.rs:>::const_to_op 1,050,584 ( 0.12%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/option.rs:::attrs 1,046,157 ( 0.12%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/map.rs:, rustc_query_system::dep_graph::graph::DepNodeIndex), core::hash::BuildHasherDefault>>::insert 1,034,285 ( 0.12%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_lint/src/types.rs:::check_expr 1,033,725 ( 0.12%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_lint/src/passes.rs:::check_expr 1,026,440 ( 0.12%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/mir/mod.rs:::ty 1,021,335 ( 0.12%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_typeck/src/check/coercion.rs:::try_find_coercion_lub:: 1,011,140 ( 0.12%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_mir_build/src/build/scope.rs:::pop_scope 1,003,534 ( 0.11%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:>::reserve_rehash::>::{closure#0}> 996,228 ( 0.11%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:>::reserve_rehash::>::{closure#0}> 995,486 ( 0.11%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_const_eval/src/interpret/memory.rs:>::try_read_immediate 995,018 ( 0.11%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_lexer/src/lib.rs:::lifetime_or_char 994,262 ( 0.11%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_lexer/src/unescape.rs:rustc_lexer::unescape::unescape_literal::<::validate_literal_escape::{closure#0}> 994,142 ( 0.11%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/ty/structural_impls.rs:<&rustc_middle::ty::consts::Const as rustc_middle::ty::fold::TypeFoldable>::super_fold_with:: 993,204 ( 0.11%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_parse/src/parser/mod.rs:::parse_array_or_repeat_expr 993,106 ( 0.11%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/iter/adapters/enumerate.rs: as rustc_const_eval::interpret::visitor::ValueVisitor>::walk_value 988,462 ( 0.11%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:::opt_local_def_id 982,384 ( 0.11%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_borrowck/src/type_check/mod.rs:::check_rvalue 969,983 ( 0.11%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/ty/structural_impls.rs:<&rustc_middle::ty::consts::Const as rustc_middle::ty::fold::TypeFoldable>::super_fold_with:: 966,254 ( 0.11%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/str/traits.rs:::next_token 964,624 ( 0.11%) /usr/home/liquid/rust/worktree-benchmarking/library/alloc/src/vec/mod.rs:>::truncate 954,305 ( 0.11%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/slice/iter/macros.rs:::advance_token 945,366 ( 0.11%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/ptr/mod.rs:core::ptr::drop_in_place:: 943,642 ( 0.11%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_parse/src/parser/mod.rs:::expect_one_of 943,264 ( 0.11%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_typeck/src/check/dropck.rs:rustc_typeck::check::dropck::check_drop_obligations 943,110 ( 0.11%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_typeck/src/check/fn_ctxt/_impl.rs:::resolve_vars_with_obligations 939,000 ( 0.11%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_const_eval/src/interpret/place.rs:>::write_immediate_no_validate 936,816 ( 0.11%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_passes/src/region.rs:rustc_passes::region::resolve_local::record_rvalue_scope_if_borrow_expr 935,595 ( 0.11%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_lexer/src/unescape.rs:rustc_lexer::unescape::unescape_char_or_byte 927,069 ( 0.11%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_span/src/lib.rs:::to 923,118 ( 0.11%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_span/src/span_encoding.rs:>::hash_stable 922,827 ( 0.11%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_privacy/src/lib.rs: as rustc_middle::ty::fold::TypeVisitor>::visit_ty 922,560 ( 0.11%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/map.rs:>>::insert 920,438 ( 0.10%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_data_structures/src/sip128.rs:::hash_hir_expr 918,285 ( 0.10%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_passes/src/region.rs:::enter_node_scope_with_dtor 914,636 ( 0.10%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_passes/src/liveness.rs:::propagate_through_expr 913,997 ( 0.10%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/num/uint_macros.rs:::short_write_process_buffer:: 912,436 ( 0.10%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_ast/src/token.rs:::eq 912,420 ( 0.10%) /usr/home/liquid/rust/worktree-benchmarking/library/alloc/src/vec/into_iter.rs: as core::ops::drop::Drop>::drop 908,083 ( 0.10%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_const_eval/src/interpret/memory.rs:>::write_scalar 900,515 ( 0.10%) /usr/home/liquid/rust/worktree-benchmarking/library/std/src/sys/unix/alloc.rs:__rdl_alloc 890,118 ( 0.10%) /usr/home/liquid/rust/worktree-benchmarking/library/core/src/slice/mod.rs:::attrs 888,695 ( 0.10%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_middle/src/ty/codec.rs:rustc_middle::ty::codec::encode_with_shorthand::::type_shorthands> 884,970 ( 0.10%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_resolve/src/def_collector.rs:::visit_expr 884,920 ( 0.10%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/map.rs:>>::get:: 881,881 ( 0.10%) /usr/home/liquid/.cargo/registry/src/github.com-1ecc6299db9ec823/hashbrown-0.12.0/src/raw/mod.rs:::expr_adjustments 880,889 ( 0.10%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_serialize/src/leb128.rs:>::encode 878,370 ( 0.10%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_const_eval/src/interpret/memory.rs:>::get_raw 878,370 ( 0.10%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_target/src/abi/mod.rs:>::get 878,163 ( 0.10%) /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_serialize/src/leb128.rs:>::encode -------------------------------------------------------------------------------- -- Auto-annotated source: /usr/home/liquid/rust/worktree-benchmarking/compiler/rustc_resolve/src/late.rs -------------------------------------------------------------------------------- Ir -- line 141 ---------------------------------------- . /// parameters. . ConstParamTyRibKind, . } . . impl RibKind<'_> { . /// Whether this rib kind contains generic parameters, as opposed to local . /// variables. . crate fn contains_params(&self) -> bool { 13,882 ( 0.00%) match self { . NormalRibKind . | ClosureOrAsyncRibKind . | FnItemRibKind . | ConstantItemRibKind(..) . | ModuleRibKind(_) . | MacroDefinition(_) . | ConstParamTyRibKind => false, . AssocItemRibKind | ItemRibKind(_) | ForwardGenericParamBanRibKind => true, -- line 157 ---------------------------------------- -- line 174 ---------------------------------------- . #[derive(Debug)] . crate struct Rib<'a, R = Res> { . pub bindings: IdentMap, . pub kind: RibKind<'a>, . } . . impl<'a, R> Rib<'a, R> { . fn new(kind: RibKind<'a>) -> Rib<'a, R> { 511 ( 0.00%) Rib { bindings: Default::default(), kind } . } . } . . #[derive(Copy, Clone, PartialEq, Eq, Debug)] . crate enum AliasPossibility { . No, . Maybe, . } -- line 190 ---------------------------------------- -- line 212 ---------------------------------------- . match self { . PathSource::Type | PathSource::Trait(_) | PathSource::Struct => TypeNS, . PathSource::Expr(..) | PathSource::Pat | PathSource::TupleStruct(..) => ValueNS, . PathSource::TraitItem(ns) => ns, . } . } . . fn defer_to_typeck(self) -> bool { 642 ( 0.00%) match self { . PathSource::Type . | PathSource::Expr(..) . | PathSource::Pat . | PathSource::Struct . | PathSource::TupleStruct(..) => true, . PathSource::Trait(_) | PathSource::TraitItem(..) => false, . } . } -- line 228 ---------------------------------------- -- line 268 ---------------------------------------- . } . } . . fn is_call(self) -> bool { . matches!(self, PathSource::Expr(Some(&Expr { kind: ExprKind::Call(..), .. }))) . } . . crate fn is_expected(self, res: Res) -> bool { 2,026 ( 0.00%) match self { 1,322 ( 0.00%) PathSource::Type => matches!( 378 ( 0.00%) res, . Res::Def( . DefKind::Struct . | DefKind::Union . | DefKind::Enum . | DefKind::Trait . | DefKind::TraitAlias . | DefKind::TyAlias . | DefKind::AssocTy . | DefKind::TyParam . | DefKind::OpaqueTy . | DefKind::ForeignTy, . _, . ) | Res::PrimTy(..) . | Res::SelfTy(..) . ), 3 ( 0.00%) PathSource::Trait(AliasPossibility::No) => matches!(res, Res::Def(DefKind::Trait, _)), . PathSource::Trait(AliasPossibility::Maybe) => { 14 ( 0.00%) matches!(res, Res::Def(DefKind::Trait | DefKind::TraitAlias, _)) . } 519 ( 0.00%) PathSource::Expr(..) => matches!( 285 ( 0.00%) res, . Res::Def( . DefKind::Ctor(_, CtorKind::Const | CtorKind::Fn) . | DefKind::Const . | DefKind::Static . | DefKind::Fn . | DefKind::AssocFn . | DefKind::AssocConst . | DefKind::ConstParam, -- line 307 ---------------------------------------- -- line 329 ---------------------------------------- . ) | Res::SelfTy(..) . ), . PathSource::TraitItem(ns) => match res { . Res::Def(DefKind::AssocConst | DefKind::AssocFn, _) if ns == ValueNS => true, . Res::Def(DefKind::AssocTy, _) if ns == TypeNS => true, . _ => false, . }, . } 404 ( 0.00%) } . . fn error_code(self, has_unexpected_resolution: bool) -> DiagnosticId { . use rustc_errors::error_code; . match (self, has_unexpected_resolution) { . (PathSource::Trait(_), true) => error_code!(E0404), . (PathSource::Trait(_), false) => error_code!(E0405), . (PathSource::Type, true) => error_code!(E0573), . (PathSource::Type, false) => error_code!(E0412), -- line 345 ---------------------------------------- -- line 350 ---------------------------------------- . (PathSource::Pat | PathSource::TupleStruct(..), true) => error_code!(E0532), . (PathSource::Pat | PathSource::TupleStruct(..), false) => error_code!(E0531), . (PathSource::TraitItem(..), true) => error_code!(E0575), . (PathSource::TraitItem(..), false) => error_code!(E0576), . } . } . } . 2 ( 0.00%) #[derive(Default)] . struct DiagnosticMetadata<'ast> { . /// The current trait's associated items' ident, used for diagnostic suggestions. . current_trait_assoc_items: Option<&'ast [P]>, . . /// The current self type if inside an impl (used for better errors). . current_self_type: Option, . . /// The current self item if inside an ADT (used for better errors). -- line 366 ---------------------------------------- -- line 434 ---------------------------------------- . fn visit_attribute(&mut self, _: &'ast Attribute) { . // We do not want to resolve expressions that appear in attributes, . // as they do not correspond to actual code. . } . fn visit_item(&mut self, item: &'ast Item) { . let prev = replace(&mut self.diagnostic_metadata.current_item, Some(item)); . // Always report errors in items we just entered. . let old_ignore = replace(&mut self.in_func_body, false); 68 ( 0.00%) self.resolve_item(item); 34 ( 0.00%) self.in_func_body = old_ignore; 34 ( 0.00%) self.diagnostic_metadata.current_item = prev; . } 91 ( 0.00%) fn visit_arm(&mut self, arm: &'ast Arm) { . self.resolve_arm(arm); 78 ( 0.00%) } 324 ( 0.00%) fn visit_block(&mut self, block: &'ast Block) { . self.resolve_block(block); 288 ( 0.00%) } . fn visit_anon_const(&mut self, constant: &'ast AnonConst) { . // We deal with repeat expressions explicitly in `resolve_expr`. . self.resolve_anon_const(constant, IsRepeatExpr::No); . } . fn visit_expr(&mut self, expr: &'ast Expr) { 88,077 ( 0.01%) self.resolve_expr(expr, None); . } . fn visit_local(&mut self, local: &'ast Local) { . let local_spans = match local.pat.kind { . // We check for this to avoid tuple struct fields. . PatKind::Wild => None, . _ => Some(( . local.pat.span, . local.ty.as_ref().map(|ty| ty.span), . local.kind.init().map(|init| init.span), . )), . }; . let original = replace(&mut self.diagnostic_metadata.current_let_binding, local_spans); . self.resolve_local(local); . self.diagnostic_metadata.current_let_binding = original; . } 1,728 ( 0.00%) fn visit_ty(&mut self, ty: &'ast Ty) { 432 ( 0.00%) let prev = self.diagnostic_metadata.current_trait_object; 1,132 ( 0.00%) match ty.kind { 190 ( 0.00%) TyKind::Path(ref qself, ref path) => { 570 ( 0.00%) self.smart_resolve_path(ty.id, qself.as_ref(), path, PathSource::Type); . } . TyKind::ImplicitSelf => { . let self_ty = Ident::with_dummy_span(kw::SelfUpper); . let res = self 63 ( 0.00%) .resolve_ident_in_lexical_scope(self_ty, TypeNS, Some(ty.id), ty.span) 378 ( 0.00%) .map_or(Res::Err, |d| d.res()); 693 ( 0.00%) self.r.record_partial_res(ty.id, PartialRes::new(res)); . } . TyKind::TraitObject(ref bounds, ..) => { . self.diagnostic_metadata.current_trait_object = Some(&bounds[..]); . } . _ => (), . } 648 ( 0.00%) visit::walk_ty(self, ty); 432 ( 0.00%) self.diagnostic_metadata.current_trait_object = prev; 1,512 ( 0.00%) } . fn visit_poly_trait_ref(&mut self, tref: &'ast PolyTraitRef, m: &'ast TraitBoundModifier) { 6 ( 0.00%) self.smart_resolve_path( 2 ( 0.00%) tref.trait_ref.ref_id, . None, 2 ( 0.00%) &tref.trait_ref.path, 4 ( 0.00%) PathSource::Trait(AliasPossibility::Maybe), . ); . visit::walk_poly_trait_ref(self, tref, m); . } . fn visit_foreign_item(&mut self, foreign_item: &'ast ForeignItem) { . match foreign_item.kind { . ForeignItemKind::Fn(box Fn { ref generics, .. }) . | ForeignItemKind::TyAlias(box TyAlias { ref generics, .. }) => { . self.with_generic_param_rib(generics, ItemRibKind(HasGenericParams::Yes), |this| { -- line 507 ---------------------------------------- -- line 513 ---------------------------------------- . visit::walk_foreign_item(this, foreign_item); . }); . } . ForeignItemKind::MacCall(..) => { . visit::walk_foreign_item(self, foreign_item); . } . } . } 576 ( 0.00%) fn visit_fn(&mut self, fn_kind: FnKind<'ast>, sp: Span, _: NodeId) { 1,040 ( 0.00%) let rib_kind = match fn_kind { . // Bail if the function is foreign, and thus cannot validly have . // a body, or if there's no body for some other reason. . FnKind::Fn(FnCtxt::Foreign, _, sig, ..) | FnKind::Fn(_, _, sig, .., None) => { . // We don't need to deal with patterns in parameters, because . // they are not possible for foreign or bodiless functions. . self.visit_fn_header(&sig.header); . visit::walk_fn_decl(self, &sig.decl); . return; . } . FnKind::Fn(FnCtxt::Free, ..) => FnItemRibKind, . FnKind::Fn(FnCtxt::Assoc(_), ..) => NormalRibKind, . FnKind::Closure(..) => ClosureOrAsyncRibKind, . }; 252 ( 0.00%) let previous_value = self.diagnostic_metadata.current_function; 72 ( 0.00%) if matches!(fn_kind, FnKind::Fn(..)) { 252 ( 0.00%) self.diagnostic_metadata.current_function = Some((fn_kind, sp)); . } . debug!("(resolving function) entering function"); 108 ( 0.00%) let declaration = fn_kind.decl(); . . // Create a value rib for the function. . self.with_rib(ValueNS, rib_kind, |this| { . // Create a label rib for the function. . this.with_label_rib(rib_kind, |this| { . // Add each argument to the rib. 72 ( 0.00%) this.resolve_params(&declaration.inputs); . . visit::walk_fn_ret_ty(this, &declaration.output); . . // Ignore errors in function bodies if this is rustdoc . // Be sure not to set this until the function signature has been resolved. . let previous_state = replace(&mut this.in_func_body, true); . // Resolve the function body, potentially inside the body of an async closure 72 ( 0.00%) match fn_kind { 180 ( 0.00%) FnKind::Fn(.., body) => walk_list!(this, visit_block, body), . FnKind::Closure(_, body) => this.visit_expr(body), . }; . . debug!("(resolving function) leaving function"); 36 ( 0.00%) this.in_func_body = previous_state; . }) . }); 216 ( 0.00%) self.diagnostic_metadata.current_function = previous_value; 288 ( 0.00%) } . 528 ( 0.00%) fn visit_generics(&mut self, generics: &'ast Generics) { . // For type parameter defaults, we have to ban access . // to following type parameters, as the InternalSubsts can only . // provide previous type parameters as they're built. We . // put all the parameters on the ban list and then remove . // them one by one as they are processed and become available. . let mut forward_ty_ban_rib = Rib::new(ForwardGenericParamBanRibKind); . let mut forward_const_ban_rib = Rib::new(ForwardGenericParamBanRibKind); . for param in generics.params.iter() { -- line 576 ---------------------------------------- -- line 593 ---------------------------------------- . // another type parameter. For ADTs, we consider it . // well-defined only after all of the ADT type parameters have . // been provided. Therefore, we do not allow use of `Self` . // anywhere in ADT type parameter defaults. . // . // (We however cannot ban `Self` for defaults on *all* generic . // lists; e.g. trait generics can usefully refer to `Self`, . // such as in the case of `trait Add`.) 66 ( 0.00%) if self.diagnostic_metadata.current_self_item.is_some() { . // (`Some` if + only if we are in ADT's generics.) . forward_ty_ban_rib.bindings.insert(Ident::with_dummy_span(kw::SelfUpper), Res::Err); . } . . for param in &generics.params { . match param.kind { . GenericParamKind::Lifetime => self.visit_generic_param(param), . GenericParamKind::Type { ref default } => { -- line 609 ---------------------------------------- -- line 645 ---------------------------------------- . .bindings . .remove(&Ident::with_dummy_span(param.ident.name)); . } . } . } . for p in &generics.where_clause.predicates { . self.visit_where_predicate(p); . } 528 ( 0.00%) } . . fn visit_generic_arg(&mut self, arg: &'ast GenericArg) { . debug!("visit_generic_arg({:?})", arg); . let prev = replace(&mut self.diagnostic_metadata.currently_processing_generics, true); . match arg { . GenericArg::Type(ref ty) => { . // We parse const arguments as path types as we cannot distinguish them during . // parsing. We try to resolve that ambiguity by attempting resolution the type -- line 661 ---------------------------------------- -- line 715 ---------------------------------------- . let previous_value = . replace(&mut self.diagnostic_metadata.current_where_predicate, Some(p)); . visit::walk_where_predicate(self, p); . self.diagnostic_metadata.current_where_predicate = previous_value; . } . } . . impl<'a: 'ast, 'b, 'ast> LateResolutionVisitor<'a, 'b, 'ast> { 9 ( 0.00%) fn new(resolver: &'b mut Resolver<'a>) -> LateResolutionVisitor<'a, 'b, 'ast> { . // During late resolution we only track the module component of the parent scope, . // although it may be useful to track other components as well for diagnostics. 1 ( 0.00%) let graph_root = resolver.graph_root; . let parent_scope = ParentScope::module(graph_root, resolver); . let start_rib_kind = ModuleRibKind(graph_root); 30 ( 0.00%) LateResolutionVisitor { . r: resolver, . parent_scope, . ribs: PerNS { 2 ( 0.00%) value_ns: vec![Rib::new(start_rib_kind)], 2 ( 0.00%) type_ns: vec![Rib::new(start_rib_kind)], 2 ( 0.00%) macro_ns: vec![Rib::new(start_rib_kind)], . }, . label_ribs: Vec::new(), . current_trait_ref: None, . diagnostic_metadata: DiagnosticMetadata::default(), . // errors at module scope should always be reported . in_func_body: false, . } 9 ( 0.00%) } . . fn resolve_ident_in_lexical_scope( . &mut self, . ident: Ident, . ns: Namespace, . record_used_id: Option, . path_span: Span, . ) -> Option> { 1,063 ( 0.00%) self.r.resolve_ident_in_lexical_scope( . ident, . ns, 100 ( 0.00%) &self.parent_scope, . record_used_id, . path_span, . &self.ribs[ns], . ) . } . . fn resolve_path( . &mut self, . path: &[Segment], . opt_ns: Option, // `None` indicates a module path in import . record_used: bool, . path_span: Span, . crate_lint: CrateLint, . ) -> PathResult<'a> { 3,686 ( 0.00%) self.r.resolve_path_with_ribs( . path, . opt_ns, 1 ( 0.00%) &self.parent_scope, . record_used, . path_span, . crate_lint, 1 ( 0.00%) Some(&self.ribs), . ) . } . . // AST resolution . // . // We maintain a list of value ribs and type ribs. . // . // Simultaneously, we keep track of the current position in the module -- line 785 ---------------------------------------- -- line 798 ---------------------------------------- . . /// Do some `work` within a new innermost rib of the given `kind` in the given namespace (`ns`). . fn with_rib( . &mut self, . ns: Namespace, . kind: RibKind<'a>, . work: impl FnOnce(&mut Self) -> T, . ) -> T { 292 ( 0.00%) self.ribs[ns].push(Rib::new(kind)); . let ret = work(self); . self.ribs[ns].pop(); . ret . } . . fn with_scope(&mut self, id: NodeId, f: impl FnOnce(&mut Self) -> T) -> T { 8 ( 0.00%) if let Some(module) = self.r.get_module(self.r.local_def_id(id).to_def_id()) { . // Move down in the graph. . let orig_module = replace(&mut self.parent_scope.module, module); . self.with_rib(ValueNS, ModuleRibKind(module), |this| { . this.with_rib(TypeNS, ModuleRibKind(module), |this| { . let ret = f(this); 1 ( 0.00%) this.parent_scope.module = orig_module; . ret . }) . }) . } else { . f(self) . } . } . -- line 827 ---------------------------------------- -- line 908 ---------------------------------------- . let item_def_id = this.r.local_def_id(item.id).to_def_id(); . this.with_self_rib(Res::SelfTy(None, Some((item_def_id, false))), |this| { . visit::walk_item(this, item); . }); . }); . }); . } . 9 ( 0.00%) fn future_proof_import(&mut self, use_tree: &UseTree) { . let segments = &use_tree.prefix.segments; 1 ( 0.00%) if !segments.is_empty() { 2 ( 0.00%) let ident = segments[0].ident; 10 ( 0.00%) if ident.is_path_segment_keyword() || ident.span.rust_2015() { . return; . } . . let nss = match use_tree.kind { . UseTreeKind::Simple(..) if segments.len() == 1 => &[TypeNS, ValueNS][..], . _ => &[TypeNS], . }; . let report_error = |this: &Self, ns| { -- line 928 ---------------------------------------- -- line 952 ---------------------------------------- . None => {} . } . } . } else if let UseTreeKind::Nested(use_trees) = &use_tree.kind { . for (use_tree, _) in use_trees { . self.future_proof_import(use_tree); . } . } 8 ( 0.00%) } . 272 ( 0.00%) fn resolve_item(&mut self, item: &'ast Item) { . let name = item.ident.name; . debug!("(resolving item) resolving {} ({:?})", name, item.kind); . 204 ( 0.00%) match item.kind { . ItemKind::TyAlias(box TyAlias { ref generics, .. }) . | ItemKind::Fn(box Fn { ref generics, .. }) => { 4 ( 0.00%) self.compute_num_lifetime_params(item.id, generics); . self.with_generic_param_rib(generics, ItemRibKind(HasGenericParams::Yes), |this| { 3 ( 0.00%) visit::walk_item(this, item) . }); . } . . ItemKind::Enum(_, ref generics) . | ItemKind::Struct(_, ref generics) . | ItemKind::Union(_, ref generics) => { . self.compute_num_lifetime_params(item.id, generics); . self.resolve_adt(item, generics); . } . . ItemKind::Impl(box Impl { 1 ( 0.00%) ref generics, . ref of_trait, . ref self_ty, . items: ref impl_items, . .. . }) => { 4 ( 0.00%) self.compute_num_lifetime_params(item.id, generics); 1 ( 0.00%) self.resolve_implementation(generics, of_trait, &self_ty, item.id, impl_items); . } . 1 ( 0.00%) ItemKind::Trait(box Trait { ref generics, ref bounds, ref items, .. }) => { 4 ( 0.00%) self.compute_num_lifetime_params(item.id, generics); . // Create a new rib for the trait-wide type parameters. . self.with_generic_param_rib(generics, ItemRibKind(HasGenericParams::Yes), |this| { 2 ( 0.00%) let local_def_id = this.r.local_def_id(item.id).to_def_id(); . this.with_self_rib(Res::SelfTy(Some(local_def_id), None), |this| { 2 ( 0.00%) this.visit_generics(generics); . walk_list!(this, visit_param_bound, bounds); . 315 ( 0.00%) let walk_assoc_item = |this: &mut Self, generics, item| { . this.with_generic_param_rib(generics, AssocItemRibKind, |this| { 140 ( 0.00%) visit::walk_assoc_item(this, item, AssocCtxt::Trait) . }); 280 ( 0.00%) }; . . this.with_trait_items(items, |this| { . for item in items { 144 ( 0.00%) match &item.kind { . AssocItemKind::Const(_, ty, default) => { . this.visit_ty(ty); . // Only impose the restrictions of `ConstRibKind` for an . // actual constant expression in a provided default. . if let Some(expr) = default { . // We allow arbitrary const expressions inside of associated consts, . // even if they are potentially not const evaluatable. . // -- line 1018 ---------------------------------------- -- line 1021 ---------------------------------------- . this.with_constant_rib( . IsRepeatExpr::No, . true, . None, . |this| this.visit_expr(expr), . ); . } . } 70 ( 0.00%) AssocItemKind::Fn(box Fn { generics, .. }) => { 105 ( 0.00%) walk_assoc_item(this, generics, item); . } . AssocItemKind::TyAlias(box TyAlias { generics, .. }) => { . walk_assoc_item(this, generics, item); . } . AssocItemKind::MacCall(_) => { . panic!("unexpanded macro in resolve!") . } . }; -- line 1038 ---------------------------------------- -- line 1050 ---------------------------------------- . this.with_self_rib(Res::SelfTy(Some(local_def_id), None), |this| { . this.visit_generics(generics); . walk_list!(this, visit_param_bound, bounds); . }); . }); . } . . ItemKind::Mod(..) | ItemKind::ForeignMod(_) => { 1 ( 0.00%) self.with_scope(item.id, |this| { 3 ( 0.00%) visit::walk_item(this, item); . }); . } . 84 ( 0.00%) ItemKind::Static(ref ty, _, ref expr) | ItemKind::Const(_, ref ty, ref expr) => { . self.with_item_rib(HasGenericParams::No, |this| { 28 ( 0.00%) this.visit_ty(ty); 56 ( 0.00%) if let Some(expr) = expr { 112 ( 0.00%) let constant_item_kind = match item.kind { . ItemKind::Const(..) => ConstantItemKind::Const, . ItemKind::Static(..) => ConstantItemKind::Static, . _ => unreachable!(), . }; . // We already forbid generic params because of the above item rib, . // so it doesn't matter whether this is a trivial constant. . this.with_constant_rib( . IsRepeatExpr::No, . true, 140 ( 0.00%) Some((item.ident, constant_item_kind)), . |this| this.visit_expr(expr), . ); . } . }); . } . 1 ( 0.00%) ItemKind::Use(ref use_tree) => { 9 ( 0.00%) self.future_proof_import(use_tree); . } . . ItemKind::ExternCrate(..) | ItemKind::MacroDef(..) => { . // do nothing, these are just around to be encoded . } . . ItemKind::GlobalAsm(_) => { . visit::walk_item(self, item); . } . . ItemKind::MacCall(_) => panic!("unexpanded macro in resolve!"), . } 264 ( 0.00%) } . . fn with_generic_param_rib<'c, F>(&'c mut self, generics: &'c Generics, kind: RibKind<'a>, f: F) . where . F: FnOnce(&mut Self), . { . debug!("with_generic_param_rib"); 66 ( 0.00%) let mut function_type_rib = Rib::new(kind); . let mut function_value_rib = Rib::new(kind); . let mut seen_bindings = FxHashMap::default(); . . // We also can't shadow bindings from the parent item . if let AssocItemRibKind = kind { 35 ( 0.00%) let mut add_bindings_for_ns = |ns| { . let parent_rib = self.ribs[ns] . .iter() 245 ( 0.00%) .rfind(|r| matches!(r.kind, ItemRibKind(_))) . .expect("associated item outside of an item"); . seen_bindings . .extend(parent_rib.bindings.iter().map(|(ident, _)| (*ident, ident.span))); . }; . add_bindings_for_ns(ValueNS); . add_bindings_for_ns(TypeNS); . } . -- line 1122 ---------------------------------------- -- line 1145 ---------------------------------------- . GenericParamKind::Const { .. } => (&mut function_value_rib, DefKind::ConstParam), . _ => unreachable!(), . }; . let res = Res::Def(def_kind, self.r.local_def_id(param.id).to_def_id()); . self.r.record_partial_res(param.id, PartialRes::new(res)); . rib.bindings.insert(ident, res); . } . 618 ( 0.00%) self.ribs[ValueNS].push(function_value_rib); 528 ( 0.00%) self.ribs[TypeNS].push(function_type_rib); . . f(self); . . self.ribs[TypeNS].pop(); . self.ribs[ValueNS].pop(); . } . . fn with_label_rib(&mut self, kind: RibKind<'a>, f: impl FnOnce(&mut Self)) { 120 ( 0.00%) self.label_ribs.push(Rib::new(kind)); . f(self); . self.label_ribs.pop(); . } . . fn with_item_rib(&mut self, has_generic_params: HasGenericParams, f: impl FnOnce(&mut Self)) { . let kind = ItemRibKind(has_generic_params); . self.with_rib(ValueNS, kind, |this| this.with_rib(TypeNS, kind, f)) . } -- line 1171 ---------------------------------------- -- line 1195 ---------------------------------------- . }, . ) . }); . } . . fn with_current_self_type(&mut self, self_type: &Ty, f: impl FnOnce(&mut Self) -> T) -> T { . // Handle nested impls (inside fn bodies) . let previous_value = 1 ( 0.00%) replace(&mut self.diagnostic_metadata.current_self_type, Some(self_type.clone())); . let result = f(self); 27 ( 0.00%) self.diagnostic_metadata.current_self_type = previous_value; . result . } . . fn with_current_self_item(&mut self, self_item: &Item, f: impl FnOnce(&mut Self) -> T) -> T { . let previous_value = . replace(&mut self.diagnostic_metadata.current_self_item, Some(self_item.id)); . let result = f(self); . self.diagnostic_metadata.current_self_item = previous_value; -- line 1213 ---------------------------------------- -- line 1218 ---------------------------------------- . fn with_trait_items( . &mut self, . trait_items: &'ast [P], . f: impl FnOnce(&mut Self) -> T, . ) -> T { . let trait_assoc_items = . replace(&mut self.diagnostic_metadata.current_trait_assoc_items, Some(&trait_items)); . let result = f(self); 3 ( 0.00%) self.diagnostic_metadata.current_trait_assoc_items = trait_assoc_items; . result . } . . /// This is called to resolve a trait reference from an `impl` (i.e., `impl Trait for Foo`). 9 ( 0.00%) fn with_optional_trait_ref( . &mut self, . opt_trait_ref: Option<&TraitRef>, . f: impl FnOnce(&mut Self, Option) -> T, . ) -> T { 1 ( 0.00%) let mut new_val = None; . let mut new_id = None; 2 ( 0.00%) if let Some(trait_ref) = opt_trait_ref { . let path: Vec<_> = Segment::from_path(&trait_ref.path); 15 ( 0.00%) let res = self.smart_resolve_path_fragment( 1 ( 0.00%) trait_ref.ref_id, . None, . &path, 1 ( 0.00%) trait_ref.path.span, 1 ( 0.00%) PathSource::Trait(AliasPossibility::No), . CrateLint::SimplePath(trait_ref.ref_id), . ); . let res = res.base_res(); 1 ( 0.00%) if res != Res::Err { 13 ( 0.00%) if let PathResult::Module(ModuleOrUniformRoot::Module(module)) = self.resolve_path( . &path, . Some(TypeNS), . true, . trait_ref.path.span, 1 ( 0.00%) CrateLint::SimplePath(trait_ref.ref_id), . ) { . new_id = Some(res.def_id()); 10 ( 0.00%) new_val = Some((module, trait_ref.clone())); . } . } . } . let original_trait_ref = replace(&mut self.current_trait_ref, new_val); 7 ( 0.00%) let result = f(self, new_id); 18 ( 0.00%) self.current_trait_ref = original_trait_ref; . result 8 ( 0.00%) } . . fn with_self_rib_ns(&mut self, ns: Namespace, self_res: Res, f: impl FnOnce(&mut Self)) { . let mut self_type_rib = Rib::new(NormalRibKind); . . // Plain insert (no renaming, since types are not currently hygienic) . self_type_rib.bindings.insert(Ident::with_dummy_span(kw::SelfUpper), self_res); 33 ( 0.00%) self.ribs[ns].push(self_type_rib); . f(self); . self.ribs[ns].pop(); . } . . fn with_self_rib(&mut self, self_res: Res, f: impl FnOnce(&mut Self)) { . self.with_self_rib_ns(TypeNS, self_res, f) . } . -- line 1281 ---------------------------------------- -- line 1288 ---------------------------------------- . impl_items: &'ast [P], . ) { . debug!("resolve_implementation"); . // If applicable, create a rib for the type parameters. . self.with_generic_param_rib(generics, ItemRibKind(HasGenericParams::Yes), |this| { . // Dummy self type for better errors if `Self` is used in the trait path. . this.with_self_rib(Res::SelfTy(None, None), |this| { . // Resolve the trait reference, if necessary. 10 ( 0.00%) this.with_optional_trait_ref(opt_trait_reference.as_ref(), |this, trait_id| { 2 ( 0.00%) let item_def_id = this.r.local_def_id(item_id); . . // Register the trait definitions from here. 2 ( 0.00%) if let Some(trait_id) = trait_id { 4 ( 0.00%) this.r.trait_impls.entry(trait_id).or_default().push(item_def_id); . } . . let item_def_id = item_def_id.to_def_id(); 1 ( 0.00%) this.with_self_rib(Res::SelfTy(trait_id, Some((item_def_id, false))), |this| { 1 ( 0.00%) if let Some(trait_ref) = opt_trait_reference.as_ref() { . // Resolve type arguments in the trait path. . visit::walk_trait_ref(this, trait_ref); . } . // Resolve the self type. 3 ( 0.00%) this.visit_ty(self_type); . // Resolve the generic parameters. 1 ( 0.00%) this.visit_generics(generics); . // Resolve the items within the impl. . this.with_current_self_type(self_type, |this| { . this.with_self_rib_ns(ValueNS, Res::SelfCtor(item_def_id), |this| { . debug!("resolve_implementation with_self_rib_ns(ValueNS, ...)"); 1 ( 0.00%) for item in impl_items { . use crate::ResolutionError::*; 168 ( 0.00%) match &item.kind { . AssocItemKind::Const(_default, _ty, _expr) => { . debug!("resolve_implementation AssocItemKind::Const"); . // If this is a trait impl, ensure the const . // exists in trait . this.check_trait_item( . item.id, . item.ident, . &item.kind, -- line 1328 ---------------------------------------- -- line 1344 ---------------------------------------- . visit::walk_assoc_item( . this, . item, . AssocCtxt::Impl, . ) . }, . ); . } 28 ( 0.00%) AssocItemKind::Fn(box Fn { generics, .. }) => { . debug!("resolve_implementation AssocItemKind::Fn"); . // We also need a new scope for the impl item type parameters. . this.with_generic_param_rib( . generics, . AssocItemRibKind, . |this| { . // If this is a trait impl, ensure the method . // exists in trait . this.check_trait_item( 28 ( 0.00%) item.id, 56 ( 0.00%) item.ident, . &item.kind, . ValueNS, 84 ( 0.00%) item.span, . |i, s, c| MethodNotMemberOfTrait(i, s, c), . ); . 56 ( 0.00%) visit::walk_assoc_item( . this, . item, . AssocCtxt::Impl, . ) . }, . ); . } . AssocItemKind::TyAlias(box TyAlias { -- line 1378 ---------------------------------------- -- line 1423 ---------------------------------------- . kind: &AssocItemKind, . ns: Namespace, . span: Span, . err: F, . ) where . F: FnOnce(Ident, &str, Option) -> ResolutionError<'_>, . { . // If there is a TraitRef in scope for an impl, then the method must be in the trait. 56 ( 0.00%) let Some((module, _)) = &self.current_trait_ref else { return; }; 168 ( 0.00%) ident.span.normalize_to_macros_2_0_and_adjust(module.expansion); 140 ( 0.00%) let key = self.r.new_key(ident, ns); 280 ( 0.00%) let mut binding = self.r.resolution(module, key).try_borrow().ok().and_then(|r| r.binding); . debug!(?binding); 28 ( 0.00%) if binding.is_none() { . // We could not find the trait item in the correct namespace. . // Check the other namespace to report an error. . let ns = match ns { . ValueNS => TypeNS, . TypeNS => ValueNS, . _ => ns, . }; . let key = self.r.new_key(ident, ns); -- line 1444 ---------------------------------------- -- line 1449 ---------------------------------------- . // We could not find the method: report an error. . let candidate = self.find_similarly_named_assoc_item(ident.name, kind); . let path = &self.current_trait_ref.as_ref().unwrap().1.path; . self.report_error(span, err(ident, &path_names_to_string(path), candidate)); . return; . }; . . let res = binding.res(); 56 ( 0.00%) let Res::Def(def_kind, _) = res else { bug!() }; 196 ( 0.00%) match (def_kind, kind) { . (DefKind::AssocTy, AssocItemKind::TyAlias(..)) . | (DefKind::AssocFn, AssocItemKind::Fn(..)) . | (DefKind::AssocConst, AssocItemKind::Const(..)) => { 392 ( 0.00%) self.r.record_partial_res(id, PartialRes::new(res)); . return; . } . _ => {} . } . . // The method kind does not correspond to what appeared in the trait, report. . let path = &self.current_trait_ref.as_ref().unwrap().1.path; . let (code, kind) = match kind { -- line 1470 ---------------------------------------- -- line 1480 ---------------------------------------- . kind, . code, . trait_path: path_names_to_string(path), . trait_item_span: binding.span, . }, . ); . } . 324 ( 0.00%) fn resolve_params(&mut self, params: &'ast [Param]) { 180 ( 0.00%) let mut bindings = smallvec![(PatBoundCtx::Product, Default::default())]; 216 ( 0.00%) for Param { pat, ty, .. } in params { . self.resolve_pattern(pat, PatternSource::FnParam, &mut bindings); 148 ( 0.00%) self.visit_ty(ty); . debug!("(resolving function / closure) recorded parameter"); . } 288 ( 0.00%) } . . fn resolve_local(&mut self, local: &'ast Local) { . debug!("resolving local ({:?})", local); . // Resolve the type. . walk_list!(self, visit_ty, &local.ty); . . // Resolve the initializer. . if let Some((init, els)) = local.kind.init_else_opt() { -- line 1503 ---------------------------------------- -- line 1615 ---------------------------------------- . } . . // 5) Finally bubble up all the binding maps. . maps . } . . /// Check the consistency of the outermost or-patterns. . fn check_consistent_bindings_top(&mut self, pat: &'ast Pat) { 350 ( 0.00%) pat.walk(&mut |pat| match pat.kind { . PatKind::Or(ref ps) => { . self.check_consistent_bindings(ps); . false . } . _ => true, . }) . } . . fn resolve_arm(&mut self, arm: &'ast Arm) { . self.with_rib(ValueNS, NormalRibKind, |this| { . this.resolve_pattern_top(&arm.pat, PatternSource::Match); 13 ( 0.00%) walk_list!(this, visit_expr, &arm.guard); . this.visit_expr(&arm.body); . }); . } . . /// Arising from `source`, resolve a top level pattern. . fn resolve_pattern_top(&mut self, pat: &'ast Pat, pat_src: PatternSource) { 52 ( 0.00%) let mut bindings = smallvec![(PatBoundCtx::Product, Default::default())]; . self.resolve_pattern(pat, pat_src, &mut bindings); . } . . fn resolve_pattern( . &mut self, . pat: &'ast Pat, . pat_src: PatternSource, . bindings: &mut SmallVec<[(PatBoundCtx, FxHashSet); 1]>, . ) { . // We walk the pattern before declaring the pattern's inner bindings, . // so that we avoid resolving a literal expression to a binding defined . // by the pattern. 150 ( 0.00%) visit::walk_pat(self, pat); . self.resolve_pattern_inner(pat, pat_src, bindings); . // This has to happen *after* we determine which pat_idents are variants: . self.check_consistent_bindings_top(pat); . } . . /// Resolve bindings in a pattern. This is a helper to `resolve_pattern`. . /// . /// ### `bindings` -- line 1663 ---------------------------------------- -- line 1679 ---------------------------------------- . /// See the implementation and `fresh_binding` for more details. . fn resolve_pattern_inner( . &mut self, . pat: &Pat, . pat_src: PatternSource, . bindings: &mut SmallVec<[(PatBoundCtx, FxHashSet); 1]>, . ) { . // Visit all direct subpatterns of this pattern. 400 ( 0.00%) pat.walk(&mut |pat| { . debug!("resolve_pattern pat={:?} node={:?}", pat, pat.kind); 237 ( 0.00%) match pat.kind { 148 ( 0.00%) PatKind::Ident(bmode, ident, ref sub) => { . // First try to resolve the identifier as some existing entity, . // then fall back to a fresh binding. . let has_sub = sub.is_some(); 407 ( 0.00%) let res = self . .try_resolve_as_non_binding(pat_src, pat, bmode, ident, has_sub) 407 ( 0.00%) .unwrap_or_else(|| self.fresh_binding(ident, pat.id, pat_src, bindings)); 259 ( 0.00%) self.r.record_partial_res(pat.id, PartialRes::new(res)); 111 ( 0.00%) self.r.record_pat_span(pat.id, pat.span); . } . PatKind::TupleStruct(ref qself, ref path, ref sub_patterns) => { . self.smart_resolve_path( . pat.id, . qself.as_ref(), . path, . PathSource::TupleStruct( . pat.span, -- line 1706 ---------------------------------------- -- line 1740 ---------------------------------------- . return false; . } . _ => {} . } . true . }); . } . 444 ( 0.00%) fn fresh_binding( . &mut self, . ident: Ident, . pat_id: NodeId, . pat_src: PatternSource, . bindings: &mut SmallVec<[(PatBoundCtx, FxHashSet); 1]>, . ) -> Res { . // Add the binding to the local ribs, if it doesn't already exist in the bindings map. . // (We must not add it if it's in the bindings map because that breaks the assumptions . // later passes make about or-patterns.) 185 ( 0.00%) let ident = ident.normalize_to_macro_rules(); . . let mut bound_iter = bindings.iter().filter(|(_, set)| set.contains(&ident)); . // Already bound in a product pattern? e.g. `(a, a)` which is not allowed. . let already_bound_and = bound_iter.clone().any(|(ctx, _)| *ctx == PatBoundCtx::Product); . // Already bound in an or-pattern? e.g. `V1(a) | V2(a)`. . // This is *required* for consistency which is checked later. . let already_bound_or = bound_iter.any(|(ctx, _)| *ctx == PatBoundCtx::Or); . 37 ( 0.00%) if already_bound_and { . // Overlap in a product pattern somewhere; report an error. . use ResolutionError::*; . let error = match pat_src { . // `fn f(a: u8, a: u8)`: . PatternSource::FnParam => IdentifierBoundMoreThanOnceInParameterList, . // `Variant(a, a)`: . _ => IdentifierBoundMoreThanOnceInSamePattern, . }; . self.report_error(ident.span, error(ident.name)); . } . . // Record as bound if it's valid: . let ident_valid = ident.name != kw::Empty; 37 ( 0.00%) if ident_valid { 74 ( 0.00%) bindings.last_mut().unwrap().1.insert(ident); . } . 37 ( 0.00%) if already_bound_or { . // `Variant1(a) | Variant2(a)`, ok . // Reuse definition from the first `a`. . self.innermost_rib_bindings(ValueNS)[&ident] . } else { . let res = Res::Local(pat_id); . if ident_valid { . // A completely fresh binding add to the set if it's valid. 74 ( 0.00%) self.innermost_rib_bindings(ValueNS).insert(ident, res); . } 296 ( 0.00%) res . } 333 ( 0.00%) } . . fn innermost_rib_bindings(&mut self, ns: Namespace) -> &mut IdentMap { . &mut self.ribs[ns].last_mut().unwrap().bindings . } . 481 ( 0.00%) fn try_resolve_as_non_binding( . &mut self, . pat_src: PatternSource, . pat: &Pat, . bm: BindingMode, . ident: Ident, . has_sub: bool, . ) -> Option { . // An immutable (no `mut`) by-value (no `ref`) binding pattern without . // a sub pattern (no `@ $pat`) is syntactically ambiguous as it could . // also be interpreted as a path to e.g. a constant, variant, etc. 74 ( 0.00%) let is_syntactic_ambiguity = !has_sub && bm == BindingMode::ByValue(Mutability::Not); . . let ls_binding = self.resolve_ident_in_lexical_scope(ident, ValueNS, None, pat.span)?; . let (res, binding) = match ls_binding { . LexicalScopeBinding::Item(binding) . if is_syntactic_ambiguity && binding.is_ambiguity() => . { . // For ambiguous bindings we don't know all their definitions and cannot check . // whether they can be shadowed by fresh bindings or not, so force an error. -- line 1822 ---------------------------------------- -- line 1882 ---------------------------------------- . None . } . _ => span_bug!( . ident.span, . "unexpected resolution for an identifier in pattern: {:?}", . res, . ), . } 333 ( 0.00%) } . . // High-level and context dependent path resolution routine. . // Resolves the path and records the resolution into definition map. . // If resolution fails tries several techniques to find likely . // resolution candidates, suggest imports or other help, and report . // errors in user friendly way. 2,568 ( 0.00%) fn smart_resolve_path( . &mut self, . id: NodeId, . qself: Option<&QSelf>, . path: &Path, . source: PathSource<'ast>, . ) { 3,210 ( 0.00%) self.smart_resolve_path_fragment( . id, . qself, . &Segment::from_path(path), 214 ( 0.00%) path.span, 856 ( 0.00%) source, . CrateLint::SimplePath(id), . ); . } . 3,010 ( 0.00%) fn smart_resolve_path_fragment( . &mut self, . id: NodeId, . qself: Option<&QSelf>, . path: &[Segment], . span: Span, . source: PathSource<'ast>, . crate_lint: CrateLint, . ) -> PartialRes { . tracing::debug!( . "smart_resolve_path_fragment(id={:?}, qself={:?}, path={:?})", . id, . qself, . path . ); 1,720 ( 0.00%) let ns = source.namespace(); . 1,290 ( 0.00%) let report_errors = |this: &mut Self, res: Option| { . if this.should_report_errs() { . let (err, candidates) = this.smart_resolve_report_errors(path, span, source, res); . . let def_id = this.parent_scope.module.nearest_parent_mod(); . let instead = res.is_some(); . let suggestion = . if res.is_none() { this.report_missing_type_error(path) } else { None }; . // get_from_node_id -- line 1939 ---------------------------------------- -- line 2014 ---------------------------------------- . err.cancel(); . } . . // We don't return `Some(parent_err)` here, because the error will . // be already printed as part of the `use` injections . None . }; . 4,730 ( 0.00%) let partial_res = match self.resolve_qpath_anywhere( . id, . qself, . path, . ns, . span, . source.defer_to_typeck(), . crate_lint, . ) { 1,290 ( 0.00%) Ok(Some(partial_res)) if partial_res.unresolved_segments() == 0 => { 1,505 ( 0.00%) if source.is_expected(partial_res.base_res()) || partial_res.base_res() == Res::Err . { 1,290 ( 0.00%) partial_res . } else { . report_errors(self, Some(partial_res.base_res())) . } . } . . Ok(Some(partial_res)) if source.defer_to_typeck() => { . // Not fully resolved associated item `T::A::B` or `::A::B` . // or `::A::B`. If `B` should be resolved in value namespace then -- line 2042 ---------------------------------------- -- line 2073 ---------------------------------------- . } . . PartialRes::new(Res::Err) . } . . _ => report_errors(self, None), . }; . 430 ( 0.00%) if !matches!(source, PathSource::TraitItem(..)) { . // Avoid recording definition of `A::B` in `::B::C`. 860 ( 0.00%) self.r.record_partial_res(id, partial_res); . } . . partial_res 1,720 ( 0.00%) } . . fn self_type_is_available(&mut self, span: Span) -> bool { . let binding = self.resolve_ident_in_lexical_scope( . Ident::with_dummy_span(kw::SelfUpper), . TypeNS, . None, . span, . ); -- line 2095 ---------------------------------------- -- line 2113 ---------------------------------------- . . #[inline] . /// If we're actually rustdoc then avoid giving a name resolution error for `cfg()` items. . fn should_report_errs(&self) -> bool { . !(self.r.session.opts.actually_rustdoc && self.in_func_body) . } . . // Resolve in alternative namespaces if resolution in the primary namespace fails. 2,795 ( 0.00%) fn resolve_qpath_anywhere( . &mut self, . id: NodeId, . qself: Option<&QSelf>, . path: &[Segment], . primary_ns: Namespace, . span: Span, . defer_to_typeck: bool, . crate_lint: CrateLint, . ) -> Result, Spanned>> { . let mut fin_res = None; . 1,505 ( 0.00%) for (i, &ns) in [primary_ns, TypeNS, ValueNS].iter().enumerate() { 430 ( 0.00%) if i == 0 || ns != primary_ns { 860 ( 0.00%) match self.resolve_qpath(id, qself, path, ns, span, crate_lint)? { . Some(partial_res) 1,290 ( 0.00%) if partial_res.unresolved_segments() == 0 || defer_to_typeck => . { 2,580 ( 0.00%) return Ok(Some(partial_res)); . } . partial_res => { . if fin_res.is_none() { . fin_res = partial_res; . } . } . } . } -- line 2147 ---------------------------------------- -- line 2155 ---------------------------------------- . if let Ok((_, res)) = . self.r.resolve_macro_path(&path, None, &self.parent_scope, false, false) . { . return Ok(Some(PartialRes::new(res))); . } . } . . Ok(fin_res) 1,720 ( 0.00%) } . . /// Handles paths that may refer to associated items. . fn resolve_qpath( . &mut self, . id: NodeId, . qself: Option<&QSelf>, . path: &[Segment], . ns: Namespace, -- line 2171 ---------------------------------------- -- line 2172 ---------------------------------------- . span: Span, . crate_lint: CrateLint, . ) -> Result, Spanned>> { . debug!( . "resolve_qpath(id={:?}, qself={:?}, path={:?}, ns={:?}, span={:?})", . id, qself, path, ns, span, . ); . 215 ( 0.00%) if let Some(qself) = qself { . if qself.position == 0 { . // This is a case like `::B`, where there is no . // trait to resolve. In that case, we leave the `B` . // segment to be resolved by type-check. . return Ok(Some(PartialRes::with_unresolved_segments( . Res::Def(DefKind::Mod, DefId::local(CRATE_DEF_INDEX)), . path.len(), . ))); -- line 2188 ---------------------------------------- -- line 2216 ---------------------------------------- . // have to be resolved by type-check, since that requires doing . // trait resolution. . return Ok(Some(PartialRes::with_unresolved_segments( . partial_res.base_res(), . partial_res.unresolved_segments() + path.len() - qself.position - 1, . ))); . } . 1,296 ( 0.00%) let result = match self.resolve_path(&path, Some(ns), true, span, crate_lint) { 2,756 ( 0.00%) PathResult::NonModule(path_res) => path_res, 12 ( 0.00%) PathResult::Module(ModuleOrUniformRoot::Module(module)) if !module.is_normal() => { . PartialRes::new(module.res().unwrap()) . } . // In `a(::assoc_item)*` `a` cannot be a module. If `a` does resolve to a module we . // don't report an error right away, but try to fallback to a primitive type. . // So, we are still able to successfully resolve something like . // . // use std::u8; // bring module u8 in scope . // fn f() -> u8 { // OK, resolves to primitive u8, not to std::u8 -- line 2234 ---------------------------------------- -- line 2248 ---------------------------------------- . PathResult::Module(ModuleOrUniformRoot::Module(module)) => { . PartialRes::new(module.res().unwrap()) . } . PathResult::Failed { is_error_from_last_segment: false, span, label, suggestion } => { . return Err(respan(span, ResolutionError::FailedToResolve { label, suggestion })); . } . PathResult::Module(..) | PathResult::Failed { .. } => return Ok(None), . PathResult::Indeterminate => bug!("indeterminate path result in resolve_qpath"), 1,075 ( 0.00%) }; . 355 ( 0.00%) if path.len() > 1 . && result.base_res() != Res::Err 28 ( 0.00%) && path[0].ident.name != kw::PathRoot . && path[0].ident.name != kw::DollarCrate . { . let unqualified_result = { 140 ( 0.00%) match self.resolve_path( 140 ( 0.00%) &[*path.last().unwrap()], . Some(ns), . false, . span, . CrateLint::No, . ) { . PathResult::NonModule(path_res) => path_res.base_res(), . PathResult::Module(ModuleOrUniformRoot::Module(module)) => { . module.res().unwrap() . } 112 ( 0.00%) _ => return Ok(Some(result)), . } . }; . if result.base_res() == unqualified_result { . let lint = lint::builtin::UNUSED_QUALIFICATIONS; . self.r.lint_buffer.buffer_lint(lint, id, span, "unnecessary qualification") . } . } . 748 ( 0.00%) Ok(Some(result)) . } . . fn with_resolved_label(&mut self, label: Option