/rust/registry/src/index.crates.io-1949cf8c6b5b557f/cranelift-entity-0.128.3/src/primary.rs
Line | Count | Source |
1 | | //! Densely numbered entity references as mapping keys. |
2 | | use crate::EntityRef; |
3 | | use crate::boxed_slice::BoxedSlice; |
4 | | use crate::iter::{IntoIter, Iter, IterMut}; |
5 | | use crate::keys::Keys; |
6 | | use alloc::boxed::Box; |
7 | | use alloc::vec::Vec; |
8 | | use core::fmt; |
9 | | use core::marker::PhantomData; |
10 | | use core::ops::{Index, IndexMut}; |
11 | | use core::slice; |
12 | | #[cfg(feature = "enable-serde")] |
13 | | use serde_derive::{Deserialize, Serialize}; |
14 | | |
15 | | /// A primary mapping `K -> V` allocating dense entity references. |
16 | | /// |
17 | | /// The `PrimaryMap` data structure uses the dense index space to implement a map with a vector. |
18 | | /// |
19 | | /// A primary map contains the main definition of an entity, and it can be used to allocate new |
20 | | /// entity references with the `push` method. |
21 | | /// |
22 | | /// There should only be a single `PrimaryMap` instance for a given `EntityRef` type, otherwise |
23 | | /// conflicting references will be created. Using unknown keys for indexing will cause a panic. |
24 | | /// |
25 | | /// Note that `PrimaryMap` doesn't implement `Deref` or `DerefMut`, which would allow |
26 | | /// `&PrimaryMap<K, V>` to convert to `&[V]`. One of the main advantages of `PrimaryMap` is |
27 | | /// that it only allows indexing with the distinct `EntityRef` key type, so converting to a |
28 | | /// plain slice would make it easier to use incorrectly. To make a slice of a `PrimaryMap`, use |
29 | | /// `into_boxed_slice`. |
30 | | #[derive(Clone, Hash, PartialEq, Eq)] |
31 | | #[cfg_attr(feature = "enable-serde", derive(Serialize, Deserialize))] |
32 | | pub struct PrimaryMap<K, V> |
33 | | where |
34 | | K: EntityRef, |
35 | | { |
36 | | elems: Vec<V>, |
37 | | unused: PhantomData<K>, |
38 | | } |
39 | | |
40 | | impl<K, V> PrimaryMap<K, V> |
41 | | where |
42 | | K: EntityRef, |
43 | | { |
44 | | /// Create a new empty map. |
45 | 17.4M | pub fn new() -> Self { |
46 | 17.4M | Self { |
47 | 17.4M | elems: Vec::new(), |
48 | 17.4M | unused: PhantomData, |
49 | 17.4M | } |
50 | 17.4M | } <cranelift_entity::primary::PrimaryMap<cranelift_frontend::variable::Variable, cranelift_codegen::ir::types::Type>>::new Line | Count | Source | 45 | 352k | pub fn new() -> Self { | 46 | 352k | Self { | 47 | 352k | elems: Vec::new(), | 48 | 352k | unused: PhantomData, | 49 | 352k | } | 50 | 352k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_bforest::Node, cranelift_bforest::node::NodeData<cranelift_bforest::map::MapTypes<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::entities::Block>>>>::new Line | Count | Source | 45 | 676k | pub fn new() -> Self { | 46 | 676k | Self { | 47 | 676k | elems: Vec::new(), | 48 | 676k | unused: PhantomData, | 49 | 676k | } | 50 | 676k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_bforest::Node, cranelift_bforest::node::NodeData<cranelift_bforest::set::SetTypes<cranelift_codegen::ir::entities::Block>>>>::new Line | Count | Source | 45 | 676k | pub fn new() -> Self { | 46 | 676k | Self { | 47 | 676k | elems: Vec::new(), | 48 | 676k | unused: PhantomData, | 49 | 676k | } | 50 | 676k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::loop_analysis::Loop, cranelift_codegen::loop_analysis::LoopData>>::new Line | Count | Source | 45 | 96.6k | pub fn new() -> Self { | 46 | 96.6k | Self { | 47 | 96.6k | elems: Vec::new(), | 48 | 96.6k | unused: PhantomData, | 49 | 96.6k | } | 50 | 96.6k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::MemoryType, cranelift_codegen::ir::memtype::MemoryTypeData>>::new Line | Count | Source | 45 | 157k | pub fn new() -> Self { | 46 | 157k | Self { | 47 | 157k | elems: Vec::new(), | 48 | 157k | unused: PhantomData, | 49 | 157k | } | 50 | 157k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicType, cranelift_codegen::ir::dynamic_type::DynamicTypeData>>::new Line | Count | Source | 45 | 157k | pub fn new() -> Self { | 46 | 157k | Self { | 47 | 157k | elems: Vec::new(), | 48 | 157k | unused: PhantomData, | 49 | 157k | } | 50 | 157k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::GlobalValue, cranelift_codegen::ir::globalvalue::GlobalValueData>>::new Line | Count | Source | 45 | 157k | pub fn new() -> Self { | 46 | 157k | Self { | 47 | 157k | elems: Vec::new(), | 48 | 157k | unused: PhantomData, | 49 | 157k | } | 50 | 157k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData>>::new Line | Count | Source | 45 | 157k | pub fn new() -> Self { | 46 | 157k | Self { | 47 | 157k | elems: Vec::new(), | 48 | 157k | unused: PhantomData, | 49 | 157k | } | 50 | 157k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, cranelift_codegen::ir::stackslot::DynamicStackSlotData>>::new Line | Count | Source | 45 | 157k | pub fn new() -> Self { | 46 | 157k | Self { | 47 | 157k | elems: Vec::new(), | 48 | 157k | unused: PhantomData, | 49 | 157k | } | 50 | 157k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, u32>>::new Line | Count | Source | 45 | 96.6k | pub fn new() -> Self { | 46 | 96.6k | Self { | 47 | 96.6k | elems: Vec::new(), | 48 | 96.6k | unused: PhantomData, | 49 | 96.6k | } | 50 | 96.6k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::UserExternalNameRef, cranelift_codegen::ir::extname::UserExternalName>>::new Line | Count | Source | 45 | 157k | pub fn new() -> Self { | 46 | 157k | Self { | 47 | 157k | elems: Vec::new(), | 48 | 157k | unused: PhantomData, | 49 | 157k | } | 50 | 157k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::instructions::InstructionData>>::new Line | Count | Source | 45 | 157k | pub fn new() -> Self { | 46 | 157k | Self { | 47 | 157k | elems: Vec::new(), | 48 | 157k | unused: PhantomData, | 49 | 157k | } | 50 | 157k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Block, cranelift_codegen::ir::dfg::BlockData>>::new Line | Count | Source | 45 | 157k | pub fn new() -> Self { | 46 | 157k | Self { | 47 | 157k | elems: Vec::new(), | 48 | 157k | unused: PhantomData, | 49 | 157k | } | 50 | 157k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Value, cranelift_codegen::ir::dfg::ValueDataPacked>>::new Line | Count | Source | 45 | 157k | pub fn new() -> Self { | 46 | 157k | Self { | 47 | 157k | elems: Vec::new(), | 48 | 157k | unused: PhantomData, | 49 | 157k | } | 50 | 157k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::SigRef, cranelift_codegen::ir::extfunc::Signature>>::new Line | Count | Source | 45 | 157k | pub fn new() -> Self { | 46 | 157k | Self { | 47 | 157k | elems: Vec::new(), | 48 | 157k | unused: PhantomData, | 49 | 157k | } | 50 | 157k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::FuncRef, cranelift_codegen::ir::extfunc::ExtFuncData>>::new Line | Count | Source | 45 | 157k | pub fn new() -> Self { | 46 | 157k | Self { | 47 | 157k | elems: Vec::new(), | 48 | 157k | unused: PhantomData, | 49 | 157k | } | 50 | 157k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Immediate, cranelift_codegen::ir::constant::ConstantData>>::new Line | Count | Source | 45 | 157k | pub fn new() -> Self { | 46 | 157k | Self { | 47 | 157k | elems: Vec::new(), | 48 | 157k | unused: PhantomData, | 49 | 157k | } | 50 | 157k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::JumpTable, cranelift_codegen::ir::jumptable::JumpTableData>>::new Line | Count | Source | 45 | 157k | pub fn new() -> Self { | 46 | 157k | Self { | 47 | 157k | elems: Vec::new(), | 48 | 157k | unused: PhantomData, | 49 | 157k | } | 50 | 157k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, cranelift_codegen::ir::stackslot::StackSlotData>>::new Line | Count | Source | 45 | 157k | pub fn new() -> Self { | 46 | 157k | Self { | 47 | 157k | elems: Vec::new(), | 48 | 157k | unused: PhantomData, | 49 | 157k | } | 50 | 157k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, u32>>::new Line | Count | Source | 45 | 96.6k | pub fn new() -> Self { | 46 | 96.6k | Self { | 47 | 96.6k | elems: Vec::new(), | 48 | 96.6k | unused: PhantomData, | 49 | 96.6k | } | 50 | 96.6k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::vcode::VCodeConstantData>>::new <cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::buffer::MachBufferConstant>>::new Line | Count | Source | 45 | 96.6k | pub fn new() -> Self { | 46 | 96.6k | Self { | 47 | 96.6k | elems: Vec::new(), | 48 | 96.6k | unused: PhantomData, | 49 | 96.6k | } | 50 | 96.6k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_frontend::variable::Variable, cranelift_codegen::ir::types::Type>>::new Line | Count | Source | 45 | 554k | pub fn new() -> Self { | 46 | 554k | Self { | 47 | 554k | elems: Vec::new(), | 48 | 554k | unused: PhantomData, | 49 | 554k | } | 50 | 554k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_bforest::Node, cranelift_bforest::node::NodeData<cranelift_bforest::map::MapTypes<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::entities::Block>>>>::new Line | Count | Source | 45 | 2.33M | pub fn new() -> Self { | 46 | 2.33M | Self { | 47 | 2.33M | elems: Vec::new(), | 48 | 2.33M | unused: PhantomData, | 49 | 2.33M | } | 50 | 2.33M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_bforest::Node, cranelift_bforest::node::NodeData<cranelift_bforest::set::SetTypes<cranelift_codegen::ir::entities::Block>>>>::new Line | Count | Source | 45 | 2.33M | pub fn new() -> Self { | 46 | 2.33M | Self { | 47 | 2.33M | elems: Vec::new(), | 48 | 2.33M | unused: PhantomData, | 49 | 2.33M | } | 50 | 2.33M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::loop_analysis::Loop, cranelift_codegen::loop_analysis::LoopData>>::new Line | Count | Source | 45 | 333k | pub fn new() -> Self { | 46 | 333k | Self { | 47 | 333k | elems: Vec::new(), | 48 | 333k | unused: PhantomData, | 49 | 333k | } | 50 | 333k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::MemoryType, cranelift_codegen::ir::memtype::MemoryTypeData>>::new Line | Count | Source | 45 | 472k | pub fn new() -> Self { | 46 | 472k | Self { | 47 | 472k | elems: Vec::new(), | 48 | 472k | unused: PhantomData, | 49 | 472k | } | 50 | 472k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicType, cranelift_codegen::ir::dynamic_type::DynamicTypeData>>::new Line | Count | Source | 45 | 472k | pub fn new() -> Self { | 46 | 472k | Self { | 47 | 472k | elems: Vec::new(), | 48 | 472k | unused: PhantomData, | 49 | 472k | } | 50 | 472k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::GlobalValue, cranelift_codegen::ir::globalvalue::GlobalValueData>>::new Line | Count | Source | 45 | 472k | pub fn new() -> Self { | 46 | 472k | Self { | 47 | 472k | elems: Vec::new(), | 48 | 472k | unused: PhantomData, | 49 | 472k | } | 50 | 472k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData>>::new Line | Count | Source | 45 | 472k | pub fn new() -> Self { | 46 | 472k | Self { | 47 | 472k | elems: Vec::new(), | 48 | 472k | unused: PhantomData, | 49 | 472k | } | 50 | 472k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, cranelift_codegen::ir::stackslot::DynamicStackSlotData>>::new Line | Count | Source | 45 | 472k | pub fn new() -> Self { | 46 | 472k | Self { | 47 | 472k | elems: Vec::new(), | 48 | 472k | unused: PhantomData, | 49 | 472k | } | 50 | 472k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, u32>>::new Line | Count | Source | 45 | 333k | pub fn new() -> Self { | 46 | 333k | Self { | 47 | 333k | elems: Vec::new(), | 48 | 333k | unused: PhantomData, | 49 | 333k | } | 50 | 333k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::UserExternalNameRef, cranelift_codegen::ir::extname::UserExternalName>>::new Line | Count | Source | 45 | 472k | pub fn new() -> Self { | 46 | 472k | Self { | 47 | 472k | elems: Vec::new(), | 48 | 472k | unused: PhantomData, | 49 | 472k | } | 50 | 472k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::instructions::InstructionData>>::new Line | Count | Source | 45 | 472k | pub fn new() -> Self { | 46 | 472k | Self { | 47 | 472k | elems: Vec::new(), | 48 | 472k | unused: PhantomData, | 49 | 472k | } | 50 | 472k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Block, cranelift_codegen::ir::dfg::BlockData>>::new Line | Count | Source | 45 | 472k | pub fn new() -> Self { | 46 | 472k | Self { | 47 | 472k | elems: Vec::new(), | 48 | 472k | unused: PhantomData, | 49 | 472k | } | 50 | 472k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Value, cranelift_codegen::ir::dfg::ValueDataPacked>>::new Line | Count | Source | 45 | 472k | pub fn new() -> Self { | 46 | 472k | Self { | 47 | 472k | elems: Vec::new(), | 48 | 472k | unused: PhantomData, | 49 | 472k | } | 50 | 472k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::SigRef, cranelift_codegen::ir::extfunc::Signature>>::new Line | Count | Source | 45 | 472k | pub fn new() -> Self { | 46 | 472k | Self { | 47 | 472k | elems: Vec::new(), | 48 | 472k | unused: PhantomData, | 49 | 472k | } | 50 | 472k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::FuncRef, cranelift_codegen::ir::extfunc::ExtFuncData>>::new Line | Count | Source | 45 | 472k | pub fn new() -> Self { | 46 | 472k | Self { | 47 | 472k | elems: Vec::new(), | 48 | 472k | unused: PhantomData, | 49 | 472k | } | 50 | 472k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Immediate, cranelift_codegen::ir::constant::ConstantData>>::new Line | Count | Source | 45 | 472k | pub fn new() -> Self { | 46 | 472k | Self { | 47 | 472k | elems: Vec::new(), | 48 | 472k | unused: PhantomData, | 49 | 472k | } | 50 | 472k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::JumpTable, cranelift_codegen::ir::jumptable::JumpTableData>>::new Line | Count | Source | 45 | 472k | pub fn new() -> Self { | 46 | 472k | Self { | 47 | 472k | elems: Vec::new(), | 48 | 472k | unused: PhantomData, | 49 | 472k | } | 50 | 472k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, cranelift_codegen::ir::stackslot::StackSlotData>>::new Line | Count | Source | 45 | 472k | pub fn new() -> Self { | 46 | 472k | Self { | 47 | 472k | elems: Vec::new(), | 48 | 472k | unused: PhantomData, | 49 | 472k | } | 50 | 472k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, u32>>::new Line | Count | Source | 45 | 333k | pub fn new() -> Self { | 46 | 333k | Self { | 47 | 333k | elems: Vec::new(), | 48 | 333k | unused: PhantomData, | 49 | 333k | } | 50 | 333k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::vcode::VCodeConstantData>>::new <cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::buffer::MachBufferConstant>>::new Line | Count | Source | 45 | 333k | pub fn new() -> Self { | 46 | 333k | Self { | 47 | 333k | elems: Vec::new(), | 48 | 333k | unused: PhantomData, | 49 | 333k | } | 50 | 333k | } |
|
51 | | |
52 | | /// Create a new empty map with the given capacity. |
53 | 860k | pub fn with_capacity(capacity: usize) -> Self { |
54 | 860k | Self { |
55 | 860k | elems: Vec::with_capacity(capacity), |
56 | 860k | unused: PhantomData, |
57 | 860k | } |
58 | 860k | } <cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::abi::Sig, cranelift_codegen::machinst::abi::SigData>>::with_capacity Line | Count | Source | 53 | 96.6k | pub fn with_capacity(capacity: usize) -> Self { | 54 | 96.6k | Self { | 55 | 96.6k | elems: Vec::with_capacity(capacity), | 56 | 96.6k | unused: PhantomData, | 57 | 96.6k | } | 58 | 96.6k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::vcode::VCodeConstantData>>::with_capacity Line | Count | Source | 53 | 96.6k | pub fn with_capacity(capacity: usize) -> Self { | 54 | 96.6k | Self { | 55 | 96.6k | elems: Vec::with_capacity(capacity), | 56 | 96.6k | unused: PhantomData, | 57 | 96.6k | } | 58 | 96.6k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::abi::Sig, cranelift_codegen::machinst::abi::SigData>>::with_capacity Line | Count | Source | 53 | 333k | pub fn with_capacity(capacity: usize) -> Self { | 54 | 333k | Self { | 55 | 333k | elems: Vec::with_capacity(capacity), | 56 | 333k | unused: PhantomData, | 57 | 333k | } | 58 | 333k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::vcode::VCodeConstantData>>::with_capacity Line | Count | Source | 53 | 333k | pub fn with_capacity(capacity: usize) -> Self { | 54 | 333k | Self { | 55 | 333k | elems: Vec::with_capacity(capacity), | 56 | 333k | unused: PhantomData, | 57 | 333k | } | 58 | 333k | } |
|
59 | | |
60 | | /// Check if `k` is a valid key in the map. |
61 | 391M | pub fn is_valid(&self, k: K) -> bool { |
62 | 391M | k.index() < self.elems.len() |
63 | 391M | } <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::UserExternalNameRef, cranelift_codegen::ir::extname::UserExternalName>>::is_valid Line | Count | Source | 61 | 35.6k | pub fn is_valid(&self, k: K) -> bool { | 62 | 35.6k | k.index() < self.elems.len() | 63 | 35.6k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::GlobalValue, cranelift_codegen::ir::globalvalue::GlobalValueData>>::is_valid Line | Count | Source | 61 | 283k | pub fn is_valid(&self, k: K) -> bool { | 62 | 283k | k.index() < self.elems.len() | 63 | 283k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData>>::is_valid Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, cranelift_codegen::ir::stackslot::DynamicStackSlotData>>::is_valid Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, u32>>::is_valid <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::instructions::InstructionData>>::is_valid Line | Count | Source | 61 | 13.9M | pub fn is_valid(&self, k: K) -> bool { | 62 | 13.9M | k.index() < self.elems.len() | 63 | 13.9M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Block, cranelift_codegen::ir::dfg::BlockData>>::is_valid Line | Count | Source | 61 | 8.05M | pub fn is_valid(&self, k: K) -> bool { | 62 | 8.05M | k.index() < self.elems.len() | 63 | 8.05M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Value, cranelift_codegen::ir::dfg::ValueDataPacked>>::is_valid Line | Count | Source | 61 | 34.6M | pub fn is_valid(&self, k: K) -> bool { | 62 | 34.6M | k.index() < self.elems.len() | 63 | 34.6M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::SigRef, cranelift_codegen::ir::extfunc::Signature>>::is_valid Line | Count | Source | 61 | 699k | pub fn is_valid(&self, k: K) -> bool { | 62 | 699k | k.index() < self.elems.len() | 63 | 699k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::FuncRef, cranelift_codegen::ir::extfunc::ExtFuncData>>::is_valid Line | Count | Source | 61 | 44.6k | pub fn is_valid(&self, k: K) -> bool { | 62 | 44.6k | k.index() < self.elems.len() | 63 | 44.6k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::JumpTable, cranelift_codegen::ir::jumptable::JumpTableData>>::is_valid Line | Count | Source | 61 | 636 | pub fn is_valid(&self, k: K) -> bool { | 62 | 636 | k.index() < self.elems.len() | 63 | 636 | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, cranelift_codegen::ir::stackslot::StackSlotData>>::is_valid <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::UserExternalNameRef, cranelift_codegen::ir::extname::UserExternalName>>::is_valid Line | Count | Source | 61 | 195k | pub fn is_valid(&self, k: K) -> bool { | 62 | 195k | k.index() < self.elems.len() | 63 | 195k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::GlobalValue, cranelift_codegen::ir::globalvalue::GlobalValueData>>::is_valid Line | Count | Source | 61 | 3.68M | pub fn is_valid(&self, k: K) -> bool { | 62 | 3.68M | k.index() < self.elems.len() | 63 | 3.68M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData>>::is_valid Line | Count | Source | 61 | 20.5k | pub fn is_valid(&self, k: K) -> bool { | 62 | 20.5k | k.index() < self.elems.len() | 63 | 20.5k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, cranelift_codegen::ir::stackslot::DynamicStackSlotData>>::is_valid Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, u32>>::is_valid <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::instructions::InstructionData>>::is_valid Line | Count | Source | 61 | 84.3M | pub fn is_valid(&self, k: K) -> bool { | 62 | 84.3M | k.index() < self.elems.len() | 63 | 84.3M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Block, cranelift_codegen::ir::dfg::BlockData>>::is_valid Line | Count | Source | 61 | 42.6M | pub fn is_valid(&self, k: K) -> bool { | 62 | 42.6M | k.index() < self.elems.len() | 63 | 42.6M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Value, cranelift_codegen::ir::dfg::ValueDataPacked>>::is_valid Line | Count | Source | 61 | 199M | pub fn is_valid(&self, k: K) -> bool { | 62 | 199M | k.index() < self.elems.len() | 63 | 199M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::SigRef, cranelift_codegen::ir::extfunc::Signature>>::is_valid Line | Count | Source | 61 | 3.63M | pub fn is_valid(&self, k: K) -> bool { | 62 | 3.63M | k.index() < self.elems.len() | 63 | 3.63M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::FuncRef, cranelift_codegen::ir::extfunc::ExtFuncData>>::is_valid Line | Count | Source | 61 | 252k | pub fn is_valid(&self, k: K) -> bool { | 62 | 252k | k.index() < self.elems.len() | 63 | 252k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::JumpTable, cranelift_codegen::ir::jumptable::JumpTableData>>::is_valid Line | Count | Source | 61 | 6.73k | pub fn is_valid(&self, k: K) -> bool { | 62 | 6.73k | k.index() < self.elems.len() | 63 | 6.73k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, cranelift_codegen::ir::stackslot::StackSlotData>>::is_valid |
64 | | |
65 | | /// Get the element at `k` if it exists. |
66 | 4.48M | pub fn get(&self, k: K) -> Option<&V> { |
67 | 4.48M | self.elems.get(k.index()) |
68 | 4.48M | } <cranelift_entity::primary::PrimaryMap<cranelift_frontend::variable::Variable, cranelift_codegen::ir::types::Type>>::get Line | Count | Source | 66 | 514k | pub fn get(&self, k: K) -> Option<&V> { | 67 | 514k | self.elems.get(k.index()) | 68 | 514k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData>>::get <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::JumpTable, cranelift_codegen::ir::jumptable::JumpTableData>>::get Line | Count | Source | 66 | 106 | pub fn get(&self, k: K) -> Option<&V> { | 67 | 106 | self.elems.get(k.index()) | 68 | 106 | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicType, cranelift_codegen::ir::dynamic_type::DynamicTypeData>>::get Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData>>::get Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, cranelift_codegen::ir::stackslot::DynamicStackSlotData>>::get Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Immediate, cranelift_codegen::ir::constant::ConstantData>>::get <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::JumpTable, cranelift_codegen::ir::jumptable::JumpTableData>>::get Line | Count | Source | 66 | 2.30k | pub fn get(&self, k: K) -> Option<&V> { | 67 | 2.30k | self.elems.get(k.index()) | 68 | 2.30k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_frontend::variable::Variable, cranelift_codegen::ir::types::Type>>::get Line | Count | Source | 66 | 3.86M | pub fn get(&self, k: K) -> Option<&V> { | 67 | 3.86M | self.elems.get(k.index()) | 68 | 3.86M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData>>::get Line | Count | Source | 66 | 3.42k | pub fn get(&self, k: K) -> Option<&V> { | 67 | 3.42k | self.elems.get(k.index()) | 68 | 3.42k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::JumpTable, cranelift_codegen::ir::jumptable::JumpTableData>>::get Line | Count | Source | 66 | 1.12k | pub fn get(&self, k: K) -> Option<&V> { | 67 | 1.12k | self.elems.get(k.index()) | 68 | 1.12k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicType, cranelift_codegen::ir::dynamic_type::DynamicTypeData>>::get <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData>>::get Line | Count | Source | 66 | 68.8k | pub fn get(&self, k: K) -> Option<&V> { | 67 | 68.8k | self.elems.get(k.index()) | 68 | 68.8k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, cranelift_codegen::ir::stackslot::DynamicStackSlotData>>::get Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Immediate, cranelift_codegen::ir::constant::ConstantData>>::get <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::JumpTable, cranelift_codegen::ir::jumptable::JumpTableData>>::get Line | Count | Source | 66 | 28.3k | pub fn get(&self, k: K) -> Option<&V> { | 67 | 28.3k | self.elems.get(k.index()) | 68 | 28.3k | } |
|
69 | | |
70 | | /// Get the slice of values associated with the given range of keys, if any. |
71 | | pub fn get_range(&self, range: core::ops::Range<K>) -> Option<&[V]> { |
72 | | self.elems.get(range.start.index()..range.end.index()) |
73 | | } |
74 | | |
75 | | /// Get the element at `k` if it exists, mutable version. |
76 | 16.6k | pub fn get_mut(&mut self, k: K) -> Option<&mut V> { |
77 | 16.6k | self.elems.get_mut(k.index()) |
78 | 16.6k | } Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData>>::get_mut Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::UserExternalNameRef, cranelift_codegen::ir::extname::UserExternalName>>::get_mut <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::JumpTable, cranelift_codegen::ir::jumptable::JumpTableData>>::get_mut Line | Count | Source | 76 | 416 | pub fn get_mut(&mut self, k: K) -> Option<&mut V> { | 77 | 416 | self.elems.get_mut(k.index()) | 78 | 416 | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData>>::get_mut Line | Count | Source | 76 | 10.2k | pub fn get_mut(&mut self, k: K) -> Option<&mut V> { | 77 | 10.2k | self.elems.get_mut(k.index()) | 78 | 10.2k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::UserExternalNameRef, cranelift_codegen::ir::extname::UserExternalName>>::get_mut <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::JumpTable, cranelift_codegen::ir::jumptable::JumpTableData>>::get_mut Line | Count | Source | 76 | 5.98k | pub fn get_mut(&mut self, k: K) -> Option<&mut V> { | 77 | 5.98k | self.elems.get_mut(k.index()) | 78 | 5.98k | } |
|
79 | | |
80 | | /// Is this map completely empty? |
81 | 0 | pub fn is_empty(&self) -> bool { |
82 | 0 | self.elems.is_empty() |
83 | 0 | } Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_frontend::variable::Variable, cranelift_codegen::ir::types::Type>>::is_empty Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_frontend::variable::Variable, cranelift_codegen::ir::types::Type>>::is_empty |
84 | | |
85 | | /// Get the total number of entity references created. |
86 | 223M | pub fn len(&self) -> usize { |
87 | 223M | self.elems.len() |
88 | 223M | } Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Block, cranelift_codegen::ir::dfg::BlockData>>::len <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicType, cranelift_codegen::ir::dynamic_type::DynamicTypeData>>::len Line | Count | Source | 86 | 96.6k | pub fn len(&self) -> usize { | 87 | 96.6k | self.elems.len() | 88 | 96.6k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::GlobalValue, cranelift_codegen::ir::globalvalue::GlobalValueData>>::len <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData>>::len Line | Count | Source | 86 | 96.6k | pub fn len(&self) -> usize { | 87 | 96.6k | self.elems.len() | 88 | 96.6k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, cranelift_codegen::ir::stackslot::DynamicStackSlotData>>::len Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::UserExternalNameRef, cranelift_codegen::ir::extname::UserExternalName>>::len <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::instructions::InstructionData>>::len Line | Count | Source | 86 | 3.38M | pub fn len(&self) -> usize { | 87 | 3.38M | self.elems.len() | 88 | 3.38M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Block, cranelift_codegen::ir::dfg::BlockData>>::len Line | Count | Source | 86 | 2.12M | pub fn len(&self) -> usize { | 87 | 2.12M | self.elems.len() | 88 | 2.12M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Value, cranelift_codegen::ir::dfg::ValueDataPacked>>::len Line | Count | Source | 86 | 26.0M | pub fn len(&self) -> usize { | 87 | 26.0M | self.elems.len() | 88 | 26.0M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::SigRef, cranelift_codegen::ir::extfunc::Signature>>::len Line | Count | Source | 86 | 289k | pub fn len(&self) -> usize { | 87 | 289k | self.elems.len() | 88 | 289k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::FuncRef, cranelift_codegen::ir::extfunc::ExtFuncData>>::len Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Immediate, cranelift_codegen::ir::constant::ConstantData>>::len <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::JumpTable, cranelift_codegen::ir::jumptable::JumpTableData>>::len Line | Count | Source | 86 | 96.6k | pub fn len(&self) -> usize { | 87 | 96.6k | self.elems.len() | 88 | 96.6k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, cranelift_codegen::ir::stackslot::StackSlotData>>::len <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, u32>>::len Line | Count | Source | 86 | 96.6k | pub fn len(&self) -> usize { | 87 | 96.6k | self.elems.len() | 88 | 96.6k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Block, cranelift_codegen::ir::dfg::BlockData>>::len <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicType, cranelift_codegen::ir::dynamic_type::DynamicTypeData>>::len Line | Count | Source | 86 | 333k | pub fn len(&self) -> usize { | 87 | 333k | self.elems.len() | 88 | 333k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::GlobalValue, cranelift_codegen::ir::globalvalue::GlobalValueData>>::len <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData>>::len Line | Count | Source | 86 | 333k | pub fn len(&self) -> usize { | 87 | 333k | self.elems.len() | 88 | 333k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, cranelift_codegen::ir::stackslot::DynamicStackSlotData>>::len Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::UserExternalNameRef, cranelift_codegen::ir::extname::UserExternalName>>::len <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::instructions::InstructionData>>::len Line | Count | Source | 86 | 23.7M | pub fn len(&self) -> usize { | 87 | 23.7M | self.elems.len() | 88 | 23.7M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Block, cranelift_codegen::ir::dfg::BlockData>>::len Line | Count | Source | 86 | 7.34M | pub fn len(&self) -> usize { | 87 | 7.34M | self.elems.len() | 88 | 7.34M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Value, cranelift_codegen::ir::dfg::ValueDataPacked>>::len Line | Count | Source | 86 | 157M | pub fn len(&self) -> usize { | 87 | 157M | self.elems.len() | 88 | 157M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::SigRef, cranelift_codegen::ir::extfunc::Signature>>::len Line | Count | Source | 86 | 1.00M | pub fn len(&self) -> usize { | 87 | 1.00M | self.elems.len() | 88 | 1.00M | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::FuncRef, cranelift_codegen::ir::extfunc::ExtFuncData>>::len Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Immediate, cranelift_codegen::ir::constant::ConstantData>>::len <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::JumpTable, cranelift_codegen::ir::jumptable::JumpTableData>>::len Line | Count | Source | 86 | 333k | pub fn len(&self) -> usize { | 87 | 333k | self.elems.len() | 88 | 333k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, cranelift_codegen::ir::stackslot::StackSlotData>>::len <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, u32>>::len Line | Count | Source | 86 | 333k | pub fn len(&self) -> usize { | 87 | 333k | self.elems.len() | 88 | 333k | } |
|
89 | | |
90 | | /// Iterate over all the keys in this map. |
91 | 4.30M | pub fn keys(&self) -> Keys<K> { |
92 | 4.30M | Keys::with_len(self.elems.len()) |
93 | 4.30M | } <cranelift_entity::primary::PrimaryMap<cranelift_codegen::loop_analysis::Loop, cranelift_codegen::loop_analysis::LoopData>>::keys Line | Count | Source | 91 | 193k | pub fn keys(&self) -> Keys<K> { | 92 | 193k | Keys::with_len(self.elems.len()) | 93 | 193k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::GlobalValue, cranelift_codegen::ir::globalvalue::GlobalValueData>>::keys Line | Count | Source | 91 | 579k | pub fn keys(&self) -> Keys<K> { | 92 | 579k | Keys::with_len(self.elems.len()) | 93 | 579k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Block, cranelift_codegen::ir::dfg::BlockData>>::keys <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Value, cranelift_codegen::ir::dfg::ValueDataPacked>>::keys Line | Count | Source | 91 | 96.6k | pub fn keys(&self) -> Keys<K> { | 92 | 96.6k | Keys::with_len(self.elems.len()) | 93 | 96.6k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::SigRef, cranelift_codegen::ir::extfunc::Signature>>::keys Line | Count | Source | 91 | 96.6k | pub fn keys(&self) -> Keys<K> { | 92 | 96.6k | Keys::with_len(self.elems.len()) | 93 | 96.6k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::loop_analysis::Loop, cranelift_codegen::loop_analysis::LoopData>>::keys Line | Count | Source | 91 | 667k | pub fn keys(&self) -> Keys<K> { | 92 | 667k | Keys::with_len(self.elems.len()) | 93 | 667k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::GlobalValue, cranelift_codegen::ir::globalvalue::GlobalValueData>>::keys Line | Count | Source | 91 | 2.00M | pub fn keys(&self) -> Keys<K> { | 92 | 2.00M | Keys::with_len(self.elems.len()) | 93 | 2.00M | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Block, cranelift_codegen::ir::dfg::BlockData>>::keys <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Value, cranelift_codegen::ir::dfg::ValueDataPacked>>::keys Line | Count | Source | 91 | 333k | pub fn keys(&self) -> Keys<K> { | 92 | 333k | Keys::with_len(self.elems.len()) | 93 | 333k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::SigRef, cranelift_codegen::ir::extfunc::Signature>>::keys Line | Count | Source | 91 | 333k | pub fn keys(&self) -> Keys<K> { | 92 | 333k | Keys::with_len(self.elems.len()) | 93 | 333k | } |
|
94 | | |
95 | | /// Iterate over all the values in this map. |
96 | 0 | pub fn values(&self) -> slice::Iter<'_, V> { |
97 | 0 | self.elems.iter() |
98 | 0 | } Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicType, cranelift_codegen::ir::dynamic_type::DynamicTypeData>>::values Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::GlobalValue, cranelift_codegen::ir::globalvalue::GlobalValueData>>::values Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, cranelift_codegen::ir::stackslot::DynamicStackSlotData>>::values Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::SigRef, cranelift_codegen::ir::extfunc::Signature>>::values Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::FuncRef, cranelift_codegen::ir::extfunc::ExtFuncData>>::values Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Immediate, cranelift_codegen::ir::constant::ConstantData>>::values Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, cranelift_codegen::ir::stackslot::StackSlotData>>::values Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicType, cranelift_codegen::ir::dynamic_type::DynamicTypeData>>::values Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::GlobalValue, cranelift_codegen::ir::globalvalue::GlobalValueData>>::values Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, cranelift_codegen::ir::stackslot::DynamicStackSlotData>>::values Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::SigRef, cranelift_codegen::ir::extfunc::Signature>>::values Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::FuncRef, cranelift_codegen::ir::extfunc::ExtFuncData>>::values Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Immediate, cranelift_codegen::ir::constant::ConstantData>>::values Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, cranelift_codegen::ir::stackslot::StackSlotData>>::values |
99 | | |
100 | | /// Iterate over all the values in this map, mutable edition. |
101 | 860k | pub fn values_mut(&mut self) -> slice::IterMut<'_, V> { |
102 | 860k | self.elems.iter_mut() |
103 | 860k | } <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::instructions::InstructionData>>::values_mut Line | Count | Source | 101 | 96.6k | pub fn values_mut(&mut self) -> slice::IterMut<'_, V> { | 102 | 96.6k | self.elems.iter_mut() | 103 | 96.6k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Value, cranelift_codegen::ir::dfg::ValueDataPacked>>::values_mut Line | Count | Source | 101 | 96.6k | pub fn values_mut(&mut self) -> slice::IterMut<'_, V> { | 102 | 96.6k | self.elems.iter_mut() | 103 | 96.6k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::instructions::InstructionData>>::values_mut Line | Count | Source | 101 | 333k | pub fn values_mut(&mut self) -> slice::IterMut<'_, V> { | 102 | 333k | self.elems.iter_mut() | 103 | 333k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Value, cranelift_codegen::ir::dfg::ValueDataPacked>>::values_mut Line | Count | Source | 101 | 333k | pub fn values_mut(&mut self) -> slice::IterMut<'_, V> { | 102 | 333k | self.elems.iter_mut() | 103 | 333k | } |
|
104 | | |
105 | | /// Get this map's underlying values as a slice. |
106 | | pub fn as_values_slice(&self) -> &[V] { |
107 | | &self.elems |
108 | | } |
109 | | |
110 | | /// Iterate over all the keys and values in this map. |
111 | 2.58M | pub fn iter(&self) -> Iter<'_, K, V> { |
112 | 2.58M | Iter::new(self.elems.iter()) |
113 | 2.58M | } <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicType, cranelift_codegen::ir::dynamic_type::DynamicTypeData>>::iter Line | Count | Source | 111 | 96.6k | pub fn iter(&self) -> Iter<'_, K, V> { | 112 | 96.6k | Iter::new(self.elems.iter()) | 113 | 96.6k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, cranelift_codegen::ir::stackslot::DynamicStackSlotData>>::iter Line | Count | Source | 111 | 96.6k | pub fn iter(&self) -> Iter<'_, K, V> { | 112 | 96.6k | Iter::new(self.elems.iter()) | 113 | 96.6k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::UserExternalNameRef, cranelift_codegen::ir::extname::UserExternalName>>::iter <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Value, cranelift_codegen::ir::dfg::ValueDataPacked>>::iter Line | Count | Source | 111 | 193k | pub fn iter(&self) -> Iter<'_, K, V> { | 112 | 193k | Iter::new(self.elems.iter()) | 113 | 193k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::FuncRef, cranelift_codegen::ir::extfunc::ExtFuncData>>::iter <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, cranelift_codegen::ir::stackslot::StackSlotData>>::iter Line | Count | Source | 111 | 96.6k | pub fn iter(&self) -> Iter<'_, K, V> { | 112 | 96.6k | Iter::new(self.elems.iter()) | 113 | 96.6k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::vcode::VCodeConstantData>>::iter Line | Count | Source | 111 | 96.6k | pub fn iter(&self) -> Iter<'_, K, V> { | 112 | 96.6k | Iter::new(self.elems.iter()) | 113 | 96.6k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicType, cranelift_codegen::ir::dynamic_type::DynamicTypeData>>::iter Line | Count | Source | 111 | 333k | pub fn iter(&self) -> Iter<'_, K, V> { | 112 | 333k | Iter::new(self.elems.iter()) | 113 | 333k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, cranelift_codegen::ir::stackslot::DynamicStackSlotData>>::iter Line | Count | Source | 111 | 333k | pub fn iter(&self) -> Iter<'_, K, V> { | 112 | 333k | Iter::new(self.elems.iter()) | 113 | 333k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::UserExternalNameRef, cranelift_codegen::ir::extname::UserExternalName>>::iter <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Value, cranelift_codegen::ir::dfg::ValueDataPacked>>::iter Line | Count | Source | 111 | 667k | pub fn iter(&self) -> Iter<'_, K, V> { | 112 | 667k | Iter::new(self.elems.iter()) | 113 | 667k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::FuncRef, cranelift_codegen::ir::extfunc::ExtFuncData>>::iter <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, cranelift_codegen::ir::stackslot::StackSlotData>>::iter Line | Count | Source | 111 | 333k | pub fn iter(&self) -> Iter<'_, K, V> { | 112 | 333k | Iter::new(self.elems.iter()) | 113 | 333k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::vcode::VCodeConstantData>>::iter Line | Count | Source | 111 | 333k | pub fn iter(&self) -> Iter<'_, K, V> { | 112 | 333k | Iter::new(self.elems.iter()) | 113 | 333k | } |
|
114 | | |
115 | | /// Iterate over all the keys and values in this map, mutable edition. |
116 | 860k | pub fn iter_mut(&mut self) -> IterMut<'_, K, V> { |
117 | 860k | IterMut::new(self.elems.iter_mut()) |
118 | 860k | } <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData>>::iter_mut Line | Count | Source | 116 | 96.6k | pub fn iter_mut(&mut self) -> IterMut<'_, K, V> { | 117 | 96.6k | IterMut::new(self.elems.iter_mut()) | 118 | 96.6k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::JumpTable, cranelift_codegen::ir::jumptable::JumpTableData>>::iter_mut Line | Count | Source | 116 | 96.6k | pub fn iter_mut(&mut self) -> IterMut<'_, K, V> { | 117 | 96.6k | IterMut::new(self.elems.iter_mut()) | 118 | 96.6k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData>>::iter_mut Line | Count | Source | 116 | 333k | pub fn iter_mut(&mut self) -> IterMut<'_, K, V> { | 117 | 333k | IterMut::new(self.elems.iter_mut()) | 118 | 333k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::JumpTable, cranelift_codegen::ir::jumptable::JumpTableData>>::iter_mut Line | Count | Source | 116 | 333k | pub fn iter_mut(&mut self) -> IterMut<'_, K, V> { | 117 | 333k | IterMut::new(self.elems.iter_mut()) | 118 | 333k | } |
|
119 | | |
120 | | /// Remove all entries from this map. |
121 | 8.17M | pub fn clear(&mut self) { |
122 | 8.17M | self.elems.clear() |
123 | 8.17M | } <cranelift_entity::primary::PrimaryMap<cranelift_frontend::variable::Variable, cranelift_codegen::ir::types::Type>>::clear Line | Count | Source | 121 | 96.6k | pub fn clear(&mut self) { | 122 | 96.6k | self.elems.clear() | 123 | 96.6k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_bforest::Node, cranelift_bforest::node::NodeData<cranelift_bforest::map::MapTypes<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::entities::Block>>>>::clear Line | Count | Source | 121 | 773k | pub fn clear(&mut self) { | 122 | 773k | self.elems.clear() | 123 | 773k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_bforest::Node, cranelift_bforest::node::NodeData<cranelift_bforest::set::SetTypes<cranelift_codegen::ir::entities::Block>>>>::clear Line | Count | Source | 121 | 773k | pub fn clear(&mut self) { | 122 | 773k | self.elems.clear() | 123 | 773k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::loop_analysis::Loop, cranelift_codegen::loop_analysis::LoopData>>::clear Line | Count | Source | 121 | 193k | pub fn clear(&mut self) { | 122 | 193k | self.elems.clear() | 123 | 193k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::MemoryType, cranelift_codegen::ir::memtype::MemoryTypeData>>::clear Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicType, cranelift_codegen::ir::dynamic_type::DynamicTypeData>>::clear Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::GlobalValue, cranelift_codegen::ir::globalvalue::GlobalValueData>>::clear Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, cranelift_codegen::ir::stackslot::DynamicStackSlotData>>::clear Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::UserExternalNameRef, cranelift_codegen::ir::extname::UserExternalName>>::clear Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::instructions::InstructionData>>::clear Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Block, cranelift_codegen::ir::dfg::BlockData>>::clear Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Value, cranelift_codegen::ir::dfg::ValueDataPacked>>::clear Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::SigRef, cranelift_codegen::ir::extfunc::Signature>>::clear Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::FuncRef, cranelift_codegen::ir::extfunc::ExtFuncData>>::clear Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Immediate, cranelift_codegen::ir::constant::ConstantData>>::clear Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::JumpTable, cranelift_codegen::ir::jumptable::JumpTableData>>::clear Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, cranelift_codegen::ir::stackslot::StackSlotData>>::clear <cranelift_entity::primary::PrimaryMap<cranelift_frontend::variable::Variable, cranelift_codegen::ir::types::Type>>::clear Line | Count | Source | 121 | 333k | pub fn clear(&mut self) { | 122 | 333k | self.elems.clear() | 123 | 333k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_bforest::Node, cranelift_bforest::node::NodeData<cranelift_bforest::map::MapTypes<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::entities::Block>>>>::clear Line | Count | Source | 121 | 2.67M | pub fn clear(&mut self) { | 122 | 2.67M | self.elems.clear() | 123 | 2.67M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_bforest::Node, cranelift_bforest::node::NodeData<cranelift_bforest::set::SetTypes<cranelift_codegen::ir::entities::Block>>>>::clear Line | Count | Source | 121 | 2.67M | pub fn clear(&mut self) { | 122 | 2.67M | self.elems.clear() | 123 | 2.67M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::loop_analysis::Loop, cranelift_codegen::loop_analysis::LoopData>>::clear Line | Count | Source | 121 | 667k | pub fn clear(&mut self) { | 122 | 667k | self.elems.clear() | 123 | 667k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::MemoryType, cranelift_codegen::ir::memtype::MemoryTypeData>>::clear Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicType, cranelift_codegen::ir::dynamic_type::DynamicTypeData>>::clear Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::GlobalValue, cranelift_codegen::ir::globalvalue::GlobalValueData>>::clear Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, cranelift_codegen::ir::stackslot::DynamicStackSlotData>>::clear Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::UserExternalNameRef, cranelift_codegen::ir::extname::UserExternalName>>::clear Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::instructions::InstructionData>>::clear Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Block, cranelift_codegen::ir::dfg::BlockData>>::clear Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Value, cranelift_codegen::ir::dfg::ValueDataPacked>>::clear Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::SigRef, cranelift_codegen::ir::extfunc::Signature>>::clear Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::FuncRef, cranelift_codegen::ir::extfunc::ExtFuncData>>::clear Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Immediate, cranelift_codegen::ir::constant::ConstantData>>::clear Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::JumpTable, cranelift_codegen::ir::jumptable::JumpTableData>>::clear Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, cranelift_codegen::ir::stackslot::StackSlotData>>::clear |
124 | | |
125 | | /// Get the key that will be assigned to the next pushed value. |
126 | 93.7M | pub fn next_key(&self) -> K { |
127 | 93.7M | K::new(self.elems.len()) |
128 | 93.7M | } Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData>>::next_key Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Immediate, cranelift_codegen::ir::constant::ConstantData>>::next_key <cranelift_entity::primary::PrimaryMap<cranelift_frontend::variable::Variable, cranelift_codegen::ir::types::Type>>::next_key Line | Count | Source | 126 | 369k | pub fn next_key(&self) -> K { | 127 | 369k | K::new(self.elems.len()) | 128 | 369k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_bforest::Node, cranelift_bforest::node::NodeData<cranelift_bforest::map::MapTypes<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::entities::Block>>>>::next_key Line | Count | Source | 126 | 882k | pub fn next_key(&self) -> K { | 127 | 882k | K::new(self.elems.len()) | 128 | 882k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_bforest::Node, cranelift_bforest::node::NodeData<cranelift_bforest::set::SetTypes<cranelift_codegen::ir::entities::Block>>>>::next_key Line | Count | Source | 126 | 879k | pub fn next_key(&self) -> K { | 127 | 879k | K::new(self.elems.len()) | 128 | 879k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::loop_analysis::Loop, cranelift_codegen::loop_analysis::LoopData>>::next_key Line | Count | Source | 126 | 798 | pub fn next_key(&self) -> K { | 127 | 798 | K::new(self.elems.len()) | 128 | 798 | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::MemoryType, cranelift_codegen::ir::memtype::MemoryTypeData>>::next_key Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicType, cranelift_codegen::ir::dynamic_type::DynamicTypeData>>::next_key <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::GlobalValue, cranelift_codegen::ir::globalvalue::GlobalValueData>>::next_key Line | Count | Source | 126 | 11.4k | pub fn next_key(&self) -> K { | 127 | 11.4k | K::new(self.elems.len()) | 128 | 11.4k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData>>::next_key Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, cranelift_codegen::ir::stackslot::DynamicStackSlotData>>::next_key Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, u32>>::next_key <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::UserExternalNameRef, cranelift_codegen::ir::extname::UserExternalName>>::next_key Line | Count | Source | 126 | 36.0k | pub fn next_key(&self) -> K { | 127 | 36.0k | K::new(self.elems.len()) | 128 | 36.0k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::instructions::InstructionData>>::next_key Line | Count | Source | 126 | 3.18M | pub fn next_key(&self) -> K { | 127 | 3.18M | K::new(self.elems.len()) | 128 | 3.18M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Block, cranelift_codegen::ir::dfg::BlockData>>::next_key Line | Count | Source | 126 | 235k | pub fn next_key(&self) -> K { | 127 | 235k | K::new(self.elems.len()) | 128 | 235k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Value, cranelift_codegen::ir::dfg::ValueDataPacked>>::next_key Line | Count | Source | 126 | 4.25M | pub fn next_key(&self) -> K { | 127 | 4.25M | K::new(self.elems.len()) | 128 | 4.25M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::SigRef, cranelift_codegen::ir::extfunc::Signature>>::next_key Line | Count | Source | 126 | 65.1k | pub fn next_key(&self) -> K { | 127 | 65.1k | K::new(self.elems.len()) | 128 | 65.1k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::FuncRef, cranelift_codegen::ir::extfunc::ExtFuncData>>::next_key Line | Count | Source | 126 | 866 | pub fn next_key(&self) -> K { | 127 | 866 | K::new(self.elems.len()) | 128 | 866 | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Immediate, cranelift_codegen::ir::constant::ConstantData>>::next_key <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::JumpTable, cranelift_codegen::ir::jumptable::JumpTableData>>::next_key Line | Count | Source | 126 | 106 | pub fn next_key(&self) -> K { | 127 | 106 | K::new(self.elems.len()) | 128 | 106 | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, cranelift_codegen::ir::stackslot::StackSlotData>>::next_key Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, u32>>::next_key <cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::abi::Sig, cranelift_codegen::machinst::abi::SigData>>::next_key Line | Count | Source | 126 | 161k | pub fn next_key(&self) -> K { | 127 | 161k | K::new(self.elems.len()) | 128 | 161k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::vcode::VCodeConstantData>>::next_key Line | Count | Source | 126 | 12.1k | pub fn next_key(&self) -> K { | 127 | 12.1k | K::new(self.elems.len()) | 128 | 12.1k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::buffer::MachBufferConstant>>::next_key Line | Count | Source | 126 | 12.1k | pub fn next_key(&self) -> K { | 127 | 12.1k | K::new(self.elems.len()) | 128 | 12.1k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData>>::next_key Line | Count | Source | 126 | 3.42k | pub fn next_key(&self) -> K { | 127 | 3.42k | K::new(self.elems.len()) | 128 | 3.42k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Immediate, cranelift_codegen::ir::constant::ConstantData>>::next_key <cranelift_entity::primary::PrimaryMap<cranelift_frontend::variable::Variable, cranelift_codegen::ir::types::Type>>::next_key Line | Count | Source | 126 | 2.94M | pub fn next_key(&self) -> K { | 127 | 2.94M | K::new(self.elems.len()) | 128 | 2.94M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_bforest::Node, cranelift_bforest::node::NodeData<cranelift_bforest::map::MapTypes<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::entities::Block>>>>::next_key Line | Count | Source | 126 | 11.3M | pub fn next_key(&self) -> K { | 127 | 11.3M | K::new(self.elems.len()) | 128 | 11.3M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_bforest::Node, cranelift_bforest::node::NodeData<cranelift_bforest::set::SetTypes<cranelift_codegen::ir::entities::Block>>>>::next_key Line | Count | Source | 126 | 10.5M | pub fn next_key(&self) -> K { | 127 | 10.5M | K::new(self.elems.len()) | 128 | 10.5M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::loop_analysis::Loop, cranelift_codegen::loop_analysis::LoopData>>::next_key Line | Count | Source | 126 | 9.86k | pub fn next_key(&self) -> K { | 127 | 9.86k | K::new(self.elems.len()) | 128 | 9.86k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::MemoryType, cranelift_codegen::ir::memtype::MemoryTypeData>>::next_key Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicType, cranelift_codegen::ir::dynamic_type::DynamicTypeData>>::next_key <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::GlobalValue, cranelift_codegen::ir::globalvalue::GlobalValueData>>::next_key Line | Count | Source | 126 | 148k | pub fn next_key(&self) -> K { | 127 | 148k | K::new(self.elems.len()) | 128 | 148k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData>>::next_key Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, cranelift_codegen::ir::stackslot::DynamicStackSlotData>>::next_key Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, u32>>::next_key <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::UserExternalNameRef, cranelift_codegen::ir::extname::UserExternalName>>::next_key Line | Count | Source | 126 | 199k | pub fn next_key(&self) -> K { | 127 | 199k | K::new(self.elems.len()) | 128 | 199k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::instructions::InstructionData>>::next_key Line | Count | Source | 126 | 23.1M | pub fn next_key(&self) -> K { | 127 | 23.1M | K::new(self.elems.len()) | 128 | 23.1M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Block, cranelift_codegen::ir::dfg::BlockData>>::next_key Line | Count | Source | 126 | 2.20M | pub fn next_key(&self) -> K { | 127 | 2.20M | K::new(self.elems.len()) | 128 | 2.20M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Value, cranelift_codegen::ir::dfg::ValueDataPacked>>::next_key Line | Count | Source | 126 | 32.2M | pub fn next_key(&self) -> K { | 127 | 32.2M | K::new(self.elems.len()) | 128 | 32.2M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::SigRef, cranelift_codegen::ir::extfunc::Signature>>::next_key Line | Count | Source | 126 | 182k | pub fn next_key(&self) -> K { | 127 | 182k | K::new(self.elems.len()) | 128 | 182k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::FuncRef, cranelift_codegen::ir::extfunc::ExtFuncData>>::next_key Line | Count | Source | 126 | 4.58k | pub fn next_key(&self) -> K { | 127 | 4.58k | K::new(self.elems.len()) | 128 | 4.58k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Immediate, cranelift_codegen::ir::constant::ConstantData>>::next_key <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::JumpTable, cranelift_codegen::ir::jumptable::JumpTableData>>::next_key Line | Count | Source | 126 | 1.12k | pub fn next_key(&self) -> K { | 127 | 1.12k | K::new(self.elems.len()) | 128 | 1.12k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, cranelift_codegen::ir::stackslot::StackSlotData>>::next_key Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, u32>>::next_key <cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::abi::Sig, cranelift_codegen::machinst::abi::SigData>>::next_key Line | Count | Source | 126 | 516k | pub fn next_key(&self) -> K { | 127 | 516k | K::new(self.elems.len()) | 128 | 516k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::vcode::VCodeConstantData>>::next_key Line | Count | Source | 126 | 121k | pub fn next_key(&self) -> K { | 127 | 121k | K::new(self.elems.len()) | 128 | 121k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::buffer::MachBufferConstant>>::next_key Line | Count | Source | 126 | 121k | pub fn next_key(&self) -> K { | 127 | 121k | K::new(self.elems.len()) | 128 | 121k | } |
|
129 | | |
130 | | /// Append `v` to the mapping, assigning a new key which is returned. |
131 | 87.2M | pub fn push(&mut self, v: V) -> K { |
132 | 87.2M | let k = self.next_key(); |
133 | 87.2M | self.elems.push(v); |
134 | 87.2M | k |
135 | 87.2M | } Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData>>::push Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Immediate, cranelift_codegen::ir::constant::ConstantData>>::push <cranelift_entity::primary::PrimaryMap<cranelift_frontend::variable::Variable, cranelift_codegen::ir::types::Type>>::push Line | Count | Source | 131 | 369k | pub fn push(&mut self, v: V) -> K { | 132 | 369k | let k = self.next_key(); | 133 | 369k | self.elems.push(v); | 134 | 369k | k | 135 | 369k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_bforest::Node, cranelift_bforest::node::NodeData<cranelift_bforest::map::MapTypes<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::entities::Block>>>>::push Line | Count | Source | 131 | 882k | pub fn push(&mut self, v: V) -> K { | 132 | 882k | let k = self.next_key(); | 133 | 882k | self.elems.push(v); | 134 | 882k | k | 135 | 882k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_bforest::Node, cranelift_bforest::node::NodeData<cranelift_bforest::set::SetTypes<cranelift_codegen::ir::entities::Block>>>>::push Line | Count | Source | 131 | 879k | pub fn push(&mut self, v: V) -> K { | 132 | 879k | let k = self.next_key(); | 133 | 879k | self.elems.push(v); | 134 | 879k | k | 135 | 879k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::loop_analysis::Loop, cranelift_codegen::loop_analysis::LoopData>>::push Line | Count | Source | 131 | 798 | pub fn push(&mut self, v: V) -> K { | 132 | 798 | let k = self.next_key(); | 133 | 798 | self.elems.push(v); | 134 | 798 | k | 135 | 798 | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::MemoryType, cranelift_codegen::ir::memtype::MemoryTypeData>>::push Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicType, cranelift_codegen::ir::dynamic_type::DynamicTypeData>>::push <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::GlobalValue, cranelift_codegen::ir::globalvalue::GlobalValueData>>::push Line | Count | Source | 131 | 11.4k | pub fn push(&mut self, v: V) -> K { | 132 | 11.4k | let k = self.next_key(); | 133 | 11.4k | self.elems.push(v); | 134 | 11.4k | k | 135 | 11.4k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData>>::push Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, cranelift_codegen::ir::stackslot::DynamicStackSlotData>>::push Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, u32>>::push <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::UserExternalNameRef, cranelift_codegen::ir::extname::UserExternalName>>::push Line | Count | Source | 131 | 36.0k | pub fn push(&mut self, v: V) -> K { | 132 | 36.0k | let k = self.next_key(); | 133 | 36.0k | self.elems.push(v); | 134 | 36.0k | k | 135 | 36.0k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::instructions::InstructionData>>::push Line | Count | Source | 131 | 3.18M | pub fn push(&mut self, v: V) -> K { | 132 | 3.18M | let k = self.next_key(); | 133 | 3.18M | self.elems.push(v); | 134 | 3.18M | k | 135 | 3.18M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Block, cranelift_codegen::ir::dfg::BlockData>>::push Line | Count | Source | 131 | 235k | pub fn push(&mut self, v: V) -> K { | 132 | 235k | let k = self.next_key(); | 133 | 235k | self.elems.push(v); | 134 | 235k | k | 135 | 235k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Value, cranelift_codegen::ir::dfg::ValueDataPacked>>::push Line | Count | Source | 131 | 3.55M | pub fn push(&mut self, v: V) -> K { | 132 | 3.55M | let k = self.next_key(); | 133 | 3.55M | self.elems.push(v); | 134 | 3.55M | k | 135 | 3.55M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::SigRef, cranelift_codegen::ir::extfunc::Signature>>::push Line | Count | Source | 131 | 65.1k | pub fn push(&mut self, v: V) -> K { | 132 | 65.1k | let k = self.next_key(); | 133 | 65.1k | self.elems.push(v); | 134 | 65.1k | k | 135 | 65.1k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::FuncRef, cranelift_codegen::ir::extfunc::ExtFuncData>>::push Line | Count | Source | 131 | 866 | pub fn push(&mut self, v: V) -> K { | 132 | 866 | let k = self.next_key(); | 133 | 866 | self.elems.push(v); | 134 | 866 | k | 135 | 866 | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Immediate, cranelift_codegen::ir::constant::ConstantData>>::push <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::JumpTable, cranelift_codegen::ir::jumptable::JumpTableData>>::push Line | Count | Source | 131 | 106 | pub fn push(&mut self, v: V) -> K { | 132 | 106 | let k = self.next_key(); | 133 | 106 | self.elems.push(v); | 134 | 106 | k | 135 | 106 | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, cranelift_codegen::ir::stackslot::StackSlotData>>::push Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, u32>>::push <cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::abi::Sig, cranelift_codegen::machinst::abi::SigData>>::push Line | Count | Source | 131 | 161k | pub fn push(&mut self, v: V) -> K { | 132 | 161k | let k = self.next_key(); | 133 | 161k | self.elems.push(v); | 134 | 161k | k | 135 | 161k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::vcode::VCodeConstantData>>::push Line | Count | Source | 131 | 12.1k | pub fn push(&mut self, v: V) -> K { | 132 | 12.1k | let k = self.next_key(); | 133 | 12.1k | self.elems.push(v); | 134 | 12.1k | k | 135 | 12.1k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::buffer::MachBufferConstant>>::push Line | Count | Source | 131 | 12.1k | pub fn push(&mut self, v: V) -> K { | 132 | 12.1k | let k = self.next_key(); | 133 | 12.1k | self.elems.push(v); | 134 | 12.1k | k | 135 | 12.1k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData>>::push Line | Count | Source | 131 | 3.42k | pub fn push(&mut self, v: V) -> K { | 132 | 3.42k | let k = self.next_key(); | 133 | 3.42k | self.elems.push(v); | 134 | 3.42k | k | 135 | 3.42k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Immediate, cranelift_codegen::ir::constant::ConstantData>>::push <cranelift_entity::primary::PrimaryMap<cranelift_frontend::variable::Variable, cranelift_codegen::ir::types::Type>>::push Line | Count | Source | 131 | 2.94M | pub fn push(&mut self, v: V) -> K { | 132 | 2.94M | let k = self.next_key(); | 133 | 2.94M | self.elems.push(v); | 134 | 2.94M | k | 135 | 2.94M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_bforest::Node, cranelift_bforest::node::NodeData<cranelift_bforest::map::MapTypes<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::entities::Block>>>>::push Line | Count | Source | 131 | 11.3M | pub fn push(&mut self, v: V) -> K { | 132 | 11.3M | let k = self.next_key(); | 133 | 11.3M | self.elems.push(v); | 134 | 11.3M | k | 135 | 11.3M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_bforest::Node, cranelift_bforest::node::NodeData<cranelift_bforest::set::SetTypes<cranelift_codegen::ir::entities::Block>>>>::push Line | Count | Source | 131 | 10.5M | pub fn push(&mut self, v: V) -> K { | 132 | 10.5M | let k = self.next_key(); | 133 | 10.5M | self.elems.push(v); | 134 | 10.5M | k | 135 | 10.5M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::loop_analysis::Loop, cranelift_codegen::loop_analysis::LoopData>>::push Line | Count | Source | 131 | 9.86k | pub fn push(&mut self, v: V) -> K { | 132 | 9.86k | let k = self.next_key(); | 133 | 9.86k | self.elems.push(v); | 134 | 9.86k | k | 135 | 9.86k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::MemoryType, cranelift_codegen::ir::memtype::MemoryTypeData>>::push Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicType, cranelift_codegen::ir::dynamic_type::DynamicTypeData>>::push <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::GlobalValue, cranelift_codegen::ir::globalvalue::GlobalValueData>>::push Line | Count | Source | 131 | 148k | pub fn push(&mut self, v: V) -> K { | 132 | 148k | let k = self.next_key(); | 133 | 148k | self.elems.push(v); | 134 | 148k | k | 135 | 148k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData>>::push Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, cranelift_codegen::ir::stackslot::DynamicStackSlotData>>::push Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, u32>>::push <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::UserExternalNameRef, cranelift_codegen::ir::extname::UserExternalName>>::push Line | Count | Source | 131 | 199k | pub fn push(&mut self, v: V) -> K { | 132 | 199k | let k = self.next_key(); | 133 | 199k | self.elems.push(v); | 134 | 199k | k | 135 | 199k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::instructions::InstructionData>>::push Line | Count | Source | 131 | 23.1M | pub fn push(&mut self, v: V) -> K { | 132 | 23.1M | let k = self.next_key(); | 133 | 23.1M | self.elems.push(v); | 134 | 23.1M | k | 135 | 23.1M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Block, cranelift_codegen::ir::dfg::BlockData>>::push Line | Count | Source | 131 | 2.20M | pub fn push(&mut self, v: V) -> K { | 132 | 2.20M | let k = self.next_key(); | 133 | 2.20M | self.elems.push(v); | 134 | 2.20M | k | 135 | 2.20M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Value, cranelift_codegen::ir::dfg::ValueDataPacked>>::push Line | Count | Source | 131 | 26.4M | pub fn push(&mut self, v: V) -> K { | 132 | 26.4M | let k = self.next_key(); | 133 | 26.4M | self.elems.push(v); | 134 | 26.4M | k | 135 | 26.4M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::SigRef, cranelift_codegen::ir::extfunc::Signature>>::push Line | Count | Source | 131 | 182k | pub fn push(&mut self, v: V) -> K { | 132 | 182k | let k = self.next_key(); | 133 | 182k | self.elems.push(v); | 134 | 182k | k | 135 | 182k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::FuncRef, cranelift_codegen::ir::extfunc::ExtFuncData>>::push Line | Count | Source | 131 | 4.58k | pub fn push(&mut self, v: V) -> K { | 132 | 4.58k | let k = self.next_key(); | 133 | 4.58k | self.elems.push(v); | 134 | 4.58k | k | 135 | 4.58k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Immediate, cranelift_codegen::ir::constant::ConstantData>>::push <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::JumpTable, cranelift_codegen::ir::jumptable::JumpTableData>>::push Line | Count | Source | 131 | 1.12k | pub fn push(&mut self, v: V) -> K { | 132 | 1.12k | let k = self.next_key(); | 133 | 1.12k | self.elems.push(v); | 134 | 1.12k | k | 135 | 1.12k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, cranelift_codegen::ir::stackslot::StackSlotData>>::push Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, u32>>::push <cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::abi::Sig, cranelift_codegen::machinst::abi::SigData>>::push Line | Count | Source | 131 | 516k | pub fn push(&mut self, v: V) -> K { | 132 | 516k | let k = self.next_key(); | 133 | 516k | self.elems.push(v); | 134 | 516k | k | 135 | 516k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::vcode::VCodeConstantData>>::push Line | Count | Source | 131 | 121k | pub fn push(&mut self, v: V) -> K { | 132 | 121k | let k = self.next_key(); | 133 | 121k | self.elems.push(v); | 134 | 121k | k | 135 | 121k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::buffer::MachBufferConstant>>::push Line | Count | Source | 131 | 121k | pub fn push(&mut self, v: V) -> K { | 132 | 121k | let k = self.next_key(); | 133 | 121k | self.elems.push(v); | 134 | 121k | k | 135 | 121k | } |
|
136 | | |
137 | | /// Returns the last element that was inserted in the map. |
138 | | pub fn last(&self) -> Option<(K, &V)> { |
139 | | let len = self.elems.len(); |
140 | | let last = self.elems.last()?; |
141 | | Some((K::new(len - 1), last)) |
142 | | } |
143 | | |
144 | | /// Returns the last element that was inserted in the map. |
145 | | pub fn last_mut(&mut self) -> Option<(K, &mut V)> { |
146 | | let len = self.elems.len(); |
147 | | let last = self.elems.last_mut()?; |
148 | | Some((K::new(len - 1), last)) |
149 | | } |
150 | | |
151 | | /// Reserves capacity for at least `additional` more elements to be inserted. |
152 | 0 | pub fn reserve(&mut self, additional: usize) { |
153 | 0 | self.elems.reserve(additional) |
154 | 0 | } Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicType, cranelift_codegen::ir::dynamic_type::DynamicTypeData>>::reserve Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::GlobalValue, cranelift_codegen::ir::globalvalue::GlobalValueData>>::reserve Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, cranelift_codegen::ir::stackslot::DynamicStackSlotData>>::reserve Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Block, cranelift_codegen::ir::dfg::BlockData>>::reserve Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::SigRef, cranelift_codegen::ir::extfunc::Signature>>::reserve Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::FuncRef, cranelift_codegen::ir::extfunc::ExtFuncData>>::reserve Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Immediate, cranelift_codegen::ir::constant::ConstantData>>::reserve Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, cranelift_codegen::ir::stackslot::StackSlotData>>::reserve Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicType, cranelift_codegen::ir::dynamic_type::DynamicTypeData>>::reserve Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::GlobalValue, cranelift_codegen::ir::globalvalue::GlobalValueData>>::reserve Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, cranelift_codegen::ir::stackslot::DynamicStackSlotData>>::reserve Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Block, cranelift_codegen::ir::dfg::BlockData>>::reserve Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::SigRef, cranelift_codegen::ir::extfunc::Signature>>::reserve Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::FuncRef, cranelift_codegen::ir::extfunc::ExtFuncData>>::reserve Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Immediate, cranelift_codegen::ir::constant::ConstantData>>::reserve Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, cranelift_codegen::ir::stackslot::StackSlotData>>::reserve |
155 | | |
156 | | /// Reserves the minimum capacity for exactly `additional` more elements to be inserted. |
157 | | pub fn reserve_exact(&mut self, additional: usize) { |
158 | | self.elems.reserve_exact(additional) |
159 | | } |
160 | | |
161 | | /// Shrinks the capacity of the `PrimaryMap` as much as possible. |
162 | | pub fn shrink_to_fit(&mut self) { |
163 | | self.elems.shrink_to_fit() |
164 | | } |
165 | | |
166 | | /// Consumes this `PrimaryMap` and produces a `BoxedSlice`. |
167 | | pub fn into_boxed_slice(self) -> BoxedSlice<K, V> { |
168 | | unsafe { BoxedSlice::<K, V>::from_raw(Box::<[V]>::into_raw(self.elems.into_boxed_slice())) } |
169 | | } |
170 | | |
171 | | /// Returns mutable references to many elements at once. |
172 | | /// |
173 | | /// Returns an error if an element does not exist, or if the same key was passed more than |
174 | | /// once. |
175 | | pub fn get_disjoint_mut<const N: usize>( |
176 | | &mut self, |
177 | | indices: [K; N], |
178 | | ) -> Result<[&mut V; N], slice::GetDisjointMutError> { |
179 | | self.elems.get_disjoint_mut(indices.map(|k| k.index())) |
180 | | } |
181 | | |
182 | | /// Performs a binary search on the values with a key extraction function. |
183 | | /// |
184 | | /// Assumes that the values are sorted by the key extracted by the function. |
185 | | /// |
186 | | /// If the value is found then `Ok(K)` is returned, containing the entity key |
187 | | /// of the matching value. |
188 | | /// |
189 | | /// If there are multiple matches, then any one of the matches could be returned. |
190 | | /// |
191 | | /// If the value is not found then Err(K) is returned, containing the entity key |
192 | | /// where a matching element could be inserted while maintaining sorted order. |
193 | | pub fn binary_search_values_by_key<'a, B, F>(&'a self, b: &B, f: F) -> Result<K, K> |
194 | | where |
195 | | F: FnMut(&'a V) -> B, |
196 | | B: Ord, |
197 | | { |
198 | | self.elems |
199 | | .binary_search_by_key(b, f) |
200 | | .map(|i| K::new(i)) |
201 | | .map_err(|i| K::new(i)) |
202 | | } |
203 | | |
204 | | /// Analog of `get_raw` except that a raw pointer is returned rather than a |
205 | | /// mutable reference. |
206 | | /// |
207 | | /// The default accessors of items in [`PrimaryMap`] will invalidate all |
208 | | /// previous borrows obtained from the map according to miri. This function |
209 | | /// can be used to acquire a pointer and then subsequently acquire a second |
210 | | /// pointer later on without invalidating the first one. In other words |
211 | | /// this is only here to help borrow two elements simultaneously with miri. |
212 | | pub fn get_raw_mut(&mut self, k: K) -> Option<*mut V> { |
213 | | if k.index() < self.elems.len() { |
214 | | // SAFETY: the `add` function requires that the index is in-bounds |
215 | | // with respect to the allocation which is satisfied here due to |
216 | | // the bounds-check above. |
217 | | unsafe { Some(self.elems.as_mut_ptr().add(k.index())) } |
218 | | } else { |
219 | | None |
220 | | } |
221 | | } |
222 | | } |
223 | | |
224 | | impl<K, V> Default for PrimaryMap<K, V> |
225 | | where |
226 | | K: EntityRef, |
227 | | { |
228 | 1.96M | fn default() -> PrimaryMap<K, V> { |
229 | 1.96M | PrimaryMap::new() |
230 | 1.96M | } <cranelift_entity::primary::PrimaryMap<cranelift_frontend::variable::Variable, cranelift_codegen::ir::types::Type> as core::default::Default>::default Line | Count | Source | 228 | 352k | fn default() -> PrimaryMap<K, V> { | 229 | 352k | PrimaryMap::new() | 230 | 352k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::UserExternalNameRef, cranelift_codegen::ir::extname::UserExternalName> as core::default::Default>::default Line | Count | Source | 228 | 157k | fn default() -> PrimaryMap<K, V> { | 229 | 157k | PrimaryMap::new() | 230 | 157k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::vcode::VCodeConstantData> as core::default::Default>::default <cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::buffer::MachBufferConstant> as core::default::Default>::default Line | Count | Source | 228 | 96.6k | fn default() -> PrimaryMap<K, V> { | 229 | 96.6k | PrimaryMap::new() | 230 | 96.6k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_frontend::variable::Variable, cranelift_codegen::ir::types::Type> as core::default::Default>::default Line | Count | Source | 228 | 554k | fn default() -> PrimaryMap<K, V> { | 229 | 554k | PrimaryMap::new() | 230 | 554k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::UserExternalNameRef, cranelift_codegen::ir::extname::UserExternalName> as core::default::Default>::default Line | Count | Source | 228 | 472k | fn default() -> PrimaryMap<K, V> { | 229 | 472k | PrimaryMap::new() | 230 | 472k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::vcode::VCodeConstantData> as core::default::Default>::default <cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::buffer::MachBufferConstant> as core::default::Default>::default Line | Count | Source | 228 | 333k | fn default() -> PrimaryMap<K, V> { | 229 | 333k | PrimaryMap::new() | 230 | 333k | } |
|
231 | | } |
232 | | |
233 | | /// Immutable indexing into an `PrimaryMap`. |
234 | | /// The indexed value must be in the map. |
235 | | impl<K, V> Index<K> for PrimaryMap<K, V> |
236 | | where |
237 | | K: EntityRef, |
238 | | { |
239 | | type Output = V; |
240 | | |
241 | 5.72G | fn index(&self, k: K) -> &V { |
242 | 5.72G | &self.elems[k.index()] |
243 | 5.72G | } <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::UserExternalNameRef, cranelift_codegen::ir::extname::UserExternalName> as core::ops::index::Index<cranelift_codegen::ir::entities::UserExternalNameRef>>::index Line | Count | Source | 241 | 43.1k | fn index(&self, k: K) -> &V { | 242 | 43.1k | &self.elems[k.index()] | 243 | 43.1k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::SigRef, cranelift_codegen::ir::extfunc::Signature> as core::ops::index::Index<cranelift_codegen::ir::entities::SigRef>>::index Line | Count | Source | 241 | 15.7k | fn index(&self, k: K) -> &V { | 242 | 15.7k | &self.elems[k.index()] | 243 | 15.7k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::FuncRef, cranelift_codegen::ir::extfunc::ExtFuncData> as core::ops::index::Index<cranelift_codegen::ir::entities::FuncRef>>::index Line | Count | Source | 241 | 23.1k | fn index(&self, k: K) -> &V { | 242 | 23.1k | &self.elems[k.index()] | 243 | 23.1k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_frontend::variable::Variable, cranelift_codegen::ir::types::Type> as core::ops::index::Index<cranelift_frontend::variable::Variable>>::index Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData> as core::ops::index::Index<cranelift_codegen::ir::entities::ExceptionTable>>::index <cranelift_entity::primary::PrimaryMap<cranelift_bforest::Node, cranelift_bforest::node::NodeData<cranelift_bforest::map::MapTypes<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::entities::Block>>> as core::ops::index::Index<cranelift_bforest::Node>>::index Line | Count | Source | 241 | 4.28M | fn index(&self, k: K) -> &V { | 242 | 4.28M | &self.elems[k.index()] | 243 | 4.28M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_bforest::Node, cranelift_bforest::node::NodeData<cranelift_bforest::set::SetTypes<cranelift_codegen::ir::entities::Block>>> as core::ops::index::Index<cranelift_bforest::Node>>::index Line | Count | Source | 241 | 1.93M | fn index(&self, k: K) -> &V { | 242 | 1.93M | &self.elems[k.index()] | 243 | 1.93M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::loop_analysis::Loop, cranelift_codegen::loop_analysis::LoopData> as core::ops::index::Index<cranelift_codegen::loop_analysis::Loop>>::index Line | Count | Source | 241 | 19.3k | fn index(&self, k: K) -> &V { | 242 | 19.3k | &self.elems[k.index()] | 243 | 19.3k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::MemoryType, cranelift_codegen::ir::memtype::MemoryTypeData> as core::ops::index::Index<cranelift_codegen::ir::entities::MemoryType>>::index <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::GlobalValue, cranelift_codegen::ir::globalvalue::GlobalValueData> as core::ops::index::Index<cranelift_codegen::ir::entities::GlobalValue>>::index Line | Count | Source | 241 | 738k | fn index(&self, k: K) -> &V { | 242 | 738k | &self.elems[k.index()] | 243 | 738k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData> as core::ops::index::Index<cranelift_codegen::ir::entities::ExceptionTable>>::index Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, u32> as core::ops::index::Index<cranelift_codegen::ir::entities::DynamicStackSlot>>::index Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::UserExternalNameRef, cranelift_codegen::ir::extname::UserExternalName> as core::ops::index::Index<cranelift_codegen::ir::entities::UserExternalNameRef>>::index <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::instructions::InstructionData> as core::ops::index::Index<cranelift_codegen::ir::entities::Inst>>::index Line | Count | Source | 241 | 492M | fn index(&self, k: K) -> &V { | 242 | 492M | &self.elems[k.index()] | 243 | 492M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Block, cranelift_codegen::ir::dfg::BlockData> as core::ops::index::Index<cranelift_codegen::ir::entities::Block>>::index Line | Count | Source | 241 | 26.8M | fn index(&self, k: K) -> &V { | 242 | 26.8M | &self.elems[k.index()] | 243 | 26.8M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Value, cranelift_codegen::ir::dfg::ValueDataPacked> as core::ops::index::Index<cranelift_codegen::ir::entities::Value>>::index Line | Count | Source | 241 | 242M | fn index(&self, k: K) -> &V { | 242 | 242M | &self.elems[k.index()] | 243 | 242M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::SigRef, cranelift_codegen::ir::extfunc::Signature> as core::ops::index::Index<cranelift_codegen::ir::entities::SigRef>>::index Line | Count | Source | 241 | 25.8M | fn index(&self, k: K) -> &V { | 242 | 25.8M | &self.elems[k.index()] | 243 | 25.8M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::FuncRef, cranelift_codegen::ir::extfunc::ExtFuncData> as core::ops::index::Index<cranelift_codegen::ir::entities::FuncRef>>::index Line | Count | Source | 241 | 225k | fn index(&self, k: K) -> &V { | 242 | 225k | &self.elems[k.index()] | 243 | 225k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::JumpTable, cranelift_codegen::ir::jumptable::JumpTableData> as core::ops::index::Index<cranelift_codegen::ir::entities::JumpTable>>::index Line | Count | Source | 241 | 2.24k | fn index(&self, k: K) -> &V { | 242 | 2.24k | &self.elems[k.index()] | 243 | 2.24k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, u32> as core::ops::index::Index<cranelift_codegen::ir::entities::StackSlot>>::index <cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::abi::Sig, cranelift_codegen::machinst::abi::SigData> as core::ops::index::Index<cranelift_codegen::machinst::abi::Sig>>::index Line | Count | Source | 241 | 4.54M | fn index(&self, k: K) -> &V { | 242 | 4.54M | &self.elems[k.index()] | 243 | 4.54M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::vcode::VCodeConstantData> as core::ops::index::Index<cranelift_codegen::machinst::vcode::VCodeConstant>>::index Line | Count | Source | 241 | 12.1k | fn index(&self, k: K) -> &V { | 242 | 12.1k | &self.elems[k.index()] | 243 | 12.1k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::buffer::MachBufferConstant> as core::ops::index::Index<cranelift_codegen::machinst::vcode::VCodeConstant>>::index Line | Count | Source | 241 | 26.1k | fn index(&self, k: K) -> &V { | 242 | 26.1k | &self.elems[k.index()] | 243 | 26.1k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::UserExternalNameRef, cranelift_codegen::ir::extname::UserExternalName> as core::ops::index::Index<cranelift_codegen::ir::entities::UserExternalNameRef>>::index Line | Count | Source | 241 | 237k | fn index(&self, k: K) -> &V { | 242 | 237k | &self.elems[k.index()] | 243 | 237k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::SigRef, cranelift_codegen::ir::extfunc::Signature> as core::ops::index::Index<cranelift_codegen::ir::entities::SigRef>>::index Line | Count | Source | 241 | 89.5k | fn index(&self, k: K) -> &V { | 242 | 89.5k | &self.elems[k.index()] | 243 | 89.5k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::FuncRef, cranelift_codegen::ir::extfunc::ExtFuncData> as core::ops::index::Index<cranelift_codegen::ir::entities::FuncRef>>::index Line | Count | Source | 241 | 130k | fn index(&self, k: K) -> &V { | 242 | 130k | &self.elems[k.index()] | 243 | 130k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_frontend::variable::Variable, cranelift_codegen::ir::types::Type> as core::ops::index::Index<cranelift_frontend::variable::Variable>>::index Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData> as core::ops::index::Index<cranelift_codegen::ir::entities::ExceptionTable>>::index <cranelift_entity::primary::PrimaryMap<cranelift_bforest::Node, cranelift_bforest::node::NodeData<cranelift_bforest::map::MapTypes<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::entities::Block>>> as core::ops::index::Index<cranelift_bforest::Node>>::index Line | Count | Source | 241 | 51.3M | fn index(&self, k: K) -> &V { | 242 | 51.3M | &self.elems[k.index()] | 243 | 51.3M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_bforest::Node, cranelift_bforest::node::NodeData<cranelift_bforest::set::SetTypes<cranelift_codegen::ir::entities::Block>>> as core::ops::index::Index<cranelift_bforest::Node>>::index Line | Count | Source | 241 | 22.0M | fn index(&self, k: K) -> &V { | 242 | 22.0M | &self.elems[k.index()] | 243 | 22.0M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::loop_analysis::Loop, cranelift_codegen::loop_analysis::LoopData> as core::ops::index::Index<cranelift_codegen::loop_analysis::Loop>>::index Line | Count | Source | 241 | 2.60M | fn index(&self, k: K) -> &V { | 242 | 2.60M | &self.elems[k.index()] | 243 | 2.60M | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::MemoryType, cranelift_codegen::ir::memtype::MemoryTypeData> as core::ops::index::Index<cranelift_codegen::ir::entities::MemoryType>>::index <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::GlobalValue, cranelift_codegen::ir::globalvalue::GlobalValueData> as core::ops::index::Index<cranelift_codegen::ir::entities::GlobalValue>>::index Line | Count | Source | 241 | 9.92M | fn index(&self, k: K) -> &V { | 242 | 9.92M | &self.elems[k.index()] | 243 | 9.92M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData> as core::ops::index::Index<cranelift_codegen::ir::entities::ExceptionTable>>::index Line | Count | Source | 241 | 308k | fn index(&self, k: K) -> &V { | 242 | 308k | &self.elems[k.index()] | 243 | 308k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::DynamicStackSlot, u32> as core::ops::index::Index<cranelift_codegen::ir::entities::DynamicStackSlot>>::index Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::UserExternalNameRef, cranelift_codegen::ir::extname::UserExternalName> as core::ops::index::Index<cranelift_codegen::ir::entities::UserExternalNameRef>>::index <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::instructions::InstructionData> as core::ops::index::Index<cranelift_codegen::ir::entities::Inst>>::index Line | Count | Source | 241 | 3.09G | fn index(&self, k: K) -> &V { | 242 | 3.09G | &self.elems[k.index()] | 243 | 3.09G | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Block, cranelift_codegen::ir::dfg::BlockData> as core::ops::index::Index<cranelift_codegen::ir::entities::Block>>::index Line | Count | Source | 241 | 164M | fn index(&self, k: K) -> &V { | 242 | 164M | &self.elems[k.index()] | 243 | 164M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Value, cranelift_codegen::ir::dfg::ValueDataPacked> as core::ops::index::Index<cranelift_codegen::ir::entities::Value>>::index Line | Count | Source | 241 | 1.48G | fn index(&self, k: K) -> &V { | 242 | 1.48G | &self.elems[k.index()] | 243 | 1.48G | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::SigRef, cranelift_codegen::ir::extfunc::Signature> as core::ops::index::Index<cranelift_codegen::ir::entities::SigRef>>::index Line | Count | Source | 241 | 69.7M | fn index(&self, k: K) -> &V { | 242 | 69.7M | &self.elems[k.index()] | 243 | 69.7M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::FuncRef, cranelift_codegen::ir::extfunc::ExtFuncData> as core::ops::index::Index<cranelift_codegen::ir::entities::FuncRef>>::index Line | Count | Source | 241 | 1.38M | fn index(&self, k: K) -> &V { | 242 | 1.38M | &self.elems[k.index()] | 243 | 1.38M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::JumpTable, cranelift_codegen::ir::jumptable::JumpTableData> as core::ops::index::Index<cranelift_codegen::ir::entities::JumpTable>>::index Line | Count | Source | 241 | 23.7k | fn index(&self, k: K) -> &V { | 242 | 23.7k | &self.elems[k.index()] | 243 | 23.7k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, u32> as core::ops::index::Index<cranelift_codegen::ir::entities::StackSlot>>::index <cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::abi::Sig, cranelift_codegen::machinst::abi::SigData> as core::ops::index::Index<cranelift_codegen::machinst::abi::Sig>>::index Line | Count | Source | 241 | 18.6M | fn index(&self, k: K) -> &V { | 242 | 18.6M | &self.elems[k.index()] | 243 | 18.6M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::vcode::VCodeConstantData> as core::ops::index::Index<cranelift_codegen::machinst::vcode::VCodeConstant>>::index Line | Count | Source | 241 | 121k | fn index(&self, k: K) -> &V { | 242 | 121k | &self.elems[k.index()] | 243 | 121k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::buffer::MachBufferConstant> as core::ops::index::Index<cranelift_codegen::machinst::vcode::VCodeConstant>>::index Line | Count | Source | 241 | 257k | fn index(&self, k: K) -> &V { | 242 | 257k | &self.elems[k.index()] | 243 | 257k | } |
|
244 | | } |
245 | | |
246 | | /// Mutable indexing into an `PrimaryMap`. |
247 | | impl<K, V> IndexMut<K> for PrimaryMap<K, V> |
248 | | where |
249 | | K: EntityRef, |
250 | | { |
251 | 62.3M | fn index_mut(&mut self, k: K) -> &mut V { |
252 | 62.3M | &mut self.elems[k.index()] |
253 | 62.3M | } Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData> as core::ops::index::IndexMut<cranelift_codegen::ir::entities::ExceptionTable>>::index_mut <cranelift_entity::primary::PrimaryMap<cranelift_bforest::Node, cranelift_bforest::node::NodeData<cranelift_bforest::map::MapTypes<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::entities::Block>>> as core::ops::index::IndexMut<cranelift_bforest::Node>>::index_mut Line | Count | Source | 251 | 249k | fn index_mut(&mut self, k: K) -> &mut V { | 252 | 249k | &mut self.elems[k.index()] | 253 | 249k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_bforest::Node, cranelift_bforest::node::NodeData<cranelift_bforest::set::SetTypes<cranelift_codegen::ir::entities::Block>>> as core::ops::index::IndexMut<cranelift_bforest::Node>>::index_mut Line | Count | Source | 251 | 229k | fn index_mut(&mut self, k: K) -> &mut V { | 252 | 229k | &mut self.elems[k.index()] | 253 | 229k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::loop_analysis::Loop, cranelift_codegen::loop_analysis::LoopData> as core::ops::index::IndexMut<cranelift_codegen::loop_analysis::Loop>>::index_mut Line | Count | Source | 251 | 966 | fn index_mut(&mut self, k: K) -> &mut V { | 252 | 966 | &mut self.elems[k.index()] | 253 | 966 | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData> as core::ops::index::IndexMut<cranelift_codegen::ir::entities::ExceptionTable>>::index_mut <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::instructions::InstructionData> as core::ops::index::IndexMut<cranelift_codegen::ir::entities::Inst>>::index_mut Line | Count | Source | 251 | 4.92M | fn index_mut(&mut self, k: K) -> &mut V { | 252 | 4.92M | &mut self.elems[k.index()] | 253 | 4.92M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Block, cranelift_codegen::ir::dfg::BlockData> as core::ops::index::IndexMut<cranelift_codegen::ir::entities::Block>>::index_mut Line | Count | Source | 251 | 873k | fn index_mut(&mut self, k: K) -> &mut V { | 252 | 873k | &mut self.elems[k.index()] | 253 | 873k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Value, cranelift_codegen::ir::dfg::ValueDataPacked> as core::ops::index::IndexMut<cranelift_codegen::ir::entities::Value>>::index_mut Line | Count | Source | 251 | 677k | fn index_mut(&mut self, k: K) -> &mut V { | 252 | 677k | &mut self.elems[k.index()] | 253 | 677k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::buffer::MachBufferConstant> as core::ops::index::IndexMut<cranelift_codegen::machinst::vcode::VCodeConstant>>::index_mut Line | Count | Source | 251 | 24.3k | fn index_mut(&mut self, k: K) -> &mut V { | 252 | 24.3k | &mut self.elems[k.index()] | 253 | 24.3k | } |
Unexecuted instantiation: <cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData> as core::ops::index::IndexMut<cranelift_codegen::ir::entities::ExceptionTable>>::index_mut <cranelift_entity::primary::PrimaryMap<cranelift_bforest::Node, cranelift_bforest::node::NodeData<cranelift_bforest::map::MapTypes<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::entities::Block>>> as core::ops::index::IndexMut<cranelift_bforest::Node>>::index_mut Line | Count | Source | 251 | 5.02M | fn index_mut(&mut self, k: K) -> &mut V { | 252 | 5.02M | &mut self.elems[k.index()] | 253 | 5.02M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_bforest::Node, cranelift_bforest::node::NodeData<cranelift_bforest::set::SetTypes<cranelift_codegen::ir::entities::Block>>> as core::ops::index::IndexMut<cranelift_bforest::Node>>::index_mut Line | Count | Source | 251 | 2.95M | fn index_mut(&mut self, k: K) -> &mut V { | 252 | 2.95M | &mut self.elems[k.index()] | 253 | 2.95M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::loop_analysis::Loop, cranelift_codegen::loop_analysis::LoopData> as core::ops::index::IndexMut<cranelift_codegen::loop_analysis::Loop>>::index_mut Line | Count | Source | 251 | 13.6k | fn index_mut(&mut self, k: K) -> &mut V { | 252 | 13.6k | &mut self.elems[k.index()] | 253 | 13.6k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::ExceptionTable, cranelift_codegen::ir::exception_table::ExceptionTableData> as core::ops::index::IndexMut<cranelift_codegen::ir::entities::ExceptionTable>>::index_mut Line | Count | Source | 251 | 10.2k | fn index_mut(&mut self, k: K) -> &mut V { | 252 | 10.2k | &mut self.elems[k.index()] | 253 | 10.2k | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Inst, cranelift_codegen::ir::instructions::InstructionData> as core::ops::index::IndexMut<cranelift_codegen::ir::entities::Inst>>::index_mut Line | Count | Source | 251 | 30.1M | fn index_mut(&mut self, k: K) -> &mut V { | 252 | 30.1M | &mut self.elems[k.index()] | 253 | 30.1M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Block, cranelift_codegen::ir::dfg::BlockData> as core::ops::index::IndexMut<cranelift_codegen::ir::entities::Block>>::index_mut Line | Count | Source | 251 | 8.15M | fn index_mut(&mut self, k: K) -> &mut V { | 252 | 8.15M | &mut self.elems[k.index()] | 253 | 8.15M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::Value, cranelift_codegen::ir::dfg::ValueDataPacked> as core::ops::index::IndexMut<cranelift_codegen::ir::entities::Value>>::index_mut Line | Count | Source | 251 | 8.78M | fn index_mut(&mut self, k: K) -> &mut V { | 252 | 8.78M | &mut self.elems[k.index()] | 253 | 8.78M | } |
<cranelift_entity::primary::PrimaryMap<cranelift_codegen::machinst::vcode::VCodeConstant, cranelift_codegen::machinst::buffer::MachBufferConstant> as core::ops::index::IndexMut<cranelift_codegen::machinst::vcode::VCodeConstant>>::index_mut Line | Count | Source | 251 | 242k | fn index_mut(&mut self, k: K) -> &mut V { | 252 | 242k | &mut self.elems[k.index()] | 253 | 242k | } |
|
254 | | } |
255 | | |
256 | | impl<K, V> IntoIterator for PrimaryMap<K, V> |
257 | | where |
258 | | K: EntityRef, |
259 | | { |
260 | | type Item = (K, V); |
261 | | type IntoIter = IntoIter<K, V>; |
262 | | |
263 | | fn into_iter(self) -> Self::IntoIter { |
264 | | IntoIter::new(self.elems.into_iter()) |
265 | | } |
266 | | } |
267 | | |
268 | | impl<'a, K, V> IntoIterator for &'a PrimaryMap<K, V> |
269 | | where |
270 | | K: EntityRef, |
271 | | { |
272 | | type Item = (K, &'a V); |
273 | | type IntoIter = Iter<'a, K, V>; |
274 | | |
275 | 3.01M | fn into_iter(self) -> Self::IntoIter { |
276 | 3.01M | Iter::new(self.elems.iter()) |
277 | 3.01M | } <&cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::MemoryType, cranelift_codegen::ir::memtype::MemoryTypeData> as core::iter::traits::collect::IntoIterator>::into_iter Line | Count | Source | 275 | 579k | fn into_iter(self) -> Self::IntoIter { | 276 | 579k | Iter::new(self.elems.iter()) | 277 | 579k | } |
Unexecuted instantiation: <&cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::GlobalValue, cranelift_codegen::ir::globalvalue::GlobalValueData> as core::iter::traits::collect::IntoIterator>::into_iter Unexecuted instantiation: <&cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::SigRef, cranelift_codegen::ir::extfunc::Signature> as core::iter::traits::collect::IntoIterator>::into_iter Unexecuted instantiation: <&cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::FuncRef, cranelift_codegen::ir::extfunc::ExtFuncData> as core::iter::traits::collect::IntoIterator>::into_iter <&cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, u32> as core::iter::traits::collect::IntoIterator>::into_iter Line | Count | Source | 275 | 96.6k | fn into_iter(self) -> Self::IntoIter { | 276 | 96.6k | Iter::new(self.elems.iter()) | 277 | 96.6k | } |
<&cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::MemoryType, cranelift_codegen::ir::memtype::MemoryTypeData> as core::iter::traits::collect::IntoIterator>::into_iter Line | Count | Source | 275 | 2.00M | fn into_iter(self) -> Self::IntoIter { | 276 | 2.00M | Iter::new(self.elems.iter()) | 277 | 2.00M | } |
Unexecuted instantiation: <&cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::GlobalValue, cranelift_codegen::ir::globalvalue::GlobalValueData> as core::iter::traits::collect::IntoIterator>::into_iter Unexecuted instantiation: <&cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::SigRef, cranelift_codegen::ir::extfunc::Signature> as core::iter::traits::collect::IntoIterator>::into_iter Unexecuted instantiation: <&cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::FuncRef, cranelift_codegen::ir::extfunc::ExtFuncData> as core::iter::traits::collect::IntoIterator>::into_iter <&cranelift_entity::primary::PrimaryMap<cranelift_codegen::ir::entities::StackSlot, u32> as core::iter::traits::collect::IntoIterator>::into_iter Line | Count | Source | 275 | 333k | fn into_iter(self) -> Self::IntoIter { | 276 | 333k | Iter::new(self.elems.iter()) | 277 | 333k | } |
|
278 | | } |
279 | | |
280 | | impl<'a, K, V> IntoIterator for &'a mut PrimaryMap<K, V> |
281 | | where |
282 | | K: EntityRef, |
283 | | { |
284 | | type Item = (K, &'a mut V); |
285 | | type IntoIter = IterMut<'a, K, V>; |
286 | | |
287 | | fn into_iter(self) -> Self::IntoIter { |
288 | | IterMut::new(self.elems.iter_mut()) |
289 | | } |
290 | | } |
291 | | |
292 | | impl<K, V> FromIterator<V> for PrimaryMap<K, V> |
293 | | where |
294 | | K: EntityRef, |
295 | | { |
296 | | fn from_iter<T>(iter: T) -> Self |
297 | | where |
298 | | T: IntoIterator<Item = V>, |
299 | | { |
300 | | Self { |
301 | | elems: Vec::from_iter(iter), |
302 | | unused: PhantomData, |
303 | | } |
304 | | } |
305 | | } |
306 | | |
307 | | impl<K, V> Extend<V> for PrimaryMap<K, V> |
308 | | where |
309 | | K: EntityRef, |
310 | | { |
311 | | fn extend<T>(&mut self, iter: T) |
312 | | where |
313 | | T: IntoIterator<Item = V>, |
314 | | { |
315 | | self.elems.extend(iter); |
316 | | } |
317 | | } |
318 | | |
319 | | impl<K, V> From<Vec<V>> for PrimaryMap<K, V> |
320 | | where |
321 | | K: EntityRef, |
322 | | { |
323 | | fn from(elems: Vec<V>) -> Self { |
324 | | Self { |
325 | | elems, |
326 | | unused: PhantomData, |
327 | | } |
328 | | } |
329 | | } |
330 | | |
331 | | impl<K, V> From<PrimaryMap<K, V>> for Vec<V> |
332 | | where |
333 | | K: EntityRef, |
334 | | { |
335 | | fn from(map: PrimaryMap<K, V>) -> Self { |
336 | | map.elems |
337 | | } |
338 | | } |
339 | | |
340 | | impl<K: EntityRef + fmt::Debug, V: fmt::Debug> fmt::Debug for PrimaryMap<K, V> { |
341 | | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { |
342 | | let mut struct_ = f.debug_struct("PrimaryMap"); |
343 | | for (k, v) in self { |
344 | | struct_.field(&alloc::format!("{k:?}"), v); |
345 | | } |
346 | | struct_.finish() |
347 | | } |
348 | | } |
349 | | |
350 | | #[cfg(test)] |
351 | | mod tests { |
352 | | use super::*; |
353 | | |
354 | | // `EntityRef` impl for testing. |
355 | | #[derive(Clone, Copy, Debug, PartialEq, Eq)] |
356 | | struct E(u32); |
357 | | |
358 | | impl EntityRef for E { |
359 | | fn new(i: usize) -> Self { |
360 | | E(i as u32) |
361 | | } |
362 | | fn index(self) -> usize { |
363 | | self.0 as usize |
364 | | } |
365 | | } |
366 | | |
367 | | #[test] |
368 | | fn basic() { |
369 | | let r0 = E(0); |
370 | | let r1 = E(1); |
371 | | let m = PrimaryMap::<E, isize>::new(); |
372 | | |
373 | | let v: Vec<E> = m.keys().collect(); |
374 | | assert_eq!(v, []); |
375 | | |
376 | | assert!(!m.is_valid(r0)); |
377 | | assert!(!m.is_valid(r1)); |
378 | | } |
379 | | |
380 | | #[test] |
381 | | fn push() { |
382 | | let mut m = PrimaryMap::new(); |
383 | | let k0: E = m.push(12); |
384 | | let k1 = m.push(33); |
385 | | |
386 | | assert_eq!(m[k0], 12); |
387 | | assert_eq!(m[k1], 33); |
388 | | |
389 | | let v: Vec<E> = m.keys().collect(); |
390 | | assert_eq!(v, [k0, k1]); |
391 | | } |
392 | | |
393 | | #[test] |
394 | | fn iter() { |
395 | | let mut m: PrimaryMap<E, usize> = PrimaryMap::new(); |
396 | | m.push(12); |
397 | | m.push(33); |
398 | | |
399 | | let mut i = 0; |
400 | | for (key, value) in &m { |
401 | | assert_eq!(key.index(), i); |
402 | | match i { |
403 | | 0 => assert_eq!(*value, 12), |
404 | | 1 => assert_eq!(*value, 33), |
405 | | _ => panic!(), |
406 | | } |
407 | | i += 1; |
408 | | } |
409 | | i = 0; |
410 | | for (key_mut, value_mut) in m.iter_mut() { |
411 | | assert_eq!(key_mut.index(), i); |
412 | | match i { |
413 | | 0 => assert_eq!(*value_mut, 12), |
414 | | 1 => assert_eq!(*value_mut, 33), |
415 | | _ => panic!(), |
416 | | } |
417 | | i += 1; |
418 | | } |
419 | | } |
420 | | |
421 | | #[test] |
422 | | fn iter_rev() { |
423 | | let mut m: PrimaryMap<E, usize> = PrimaryMap::new(); |
424 | | m.push(12); |
425 | | m.push(33); |
426 | | |
427 | | let mut i = 2; |
428 | | for (key, value) in m.iter().rev() { |
429 | | i -= 1; |
430 | | assert_eq!(key.index(), i); |
431 | | match i { |
432 | | 0 => assert_eq!(*value, 12), |
433 | | 1 => assert_eq!(*value, 33), |
434 | | _ => panic!(), |
435 | | } |
436 | | } |
437 | | |
438 | | i = 2; |
439 | | for (key, value) in m.iter_mut().rev() { |
440 | | i -= 1; |
441 | | assert_eq!(key.index(), i); |
442 | | match i { |
443 | | 0 => assert_eq!(*value, 12), |
444 | | 1 => assert_eq!(*value, 33), |
445 | | _ => panic!(), |
446 | | } |
447 | | } |
448 | | } |
449 | | #[test] |
450 | | fn keys() { |
451 | | let mut m: PrimaryMap<E, usize> = PrimaryMap::new(); |
452 | | m.push(12); |
453 | | m.push(33); |
454 | | |
455 | | let mut i = 0; |
456 | | for key in m.keys() { |
457 | | assert_eq!(key.index(), i); |
458 | | i += 1; |
459 | | } |
460 | | } |
461 | | |
462 | | #[test] |
463 | | fn keys_rev() { |
464 | | let mut m: PrimaryMap<E, usize> = PrimaryMap::new(); |
465 | | m.push(12); |
466 | | m.push(33); |
467 | | |
468 | | let mut i = 2; |
469 | | for key in m.keys().rev() { |
470 | | i -= 1; |
471 | | assert_eq!(key.index(), i); |
472 | | } |
473 | | } |
474 | | |
475 | | #[test] |
476 | | fn values() { |
477 | | let mut m: PrimaryMap<E, usize> = PrimaryMap::new(); |
478 | | m.push(12); |
479 | | m.push(33); |
480 | | |
481 | | let mut i = 0; |
482 | | for value in m.values() { |
483 | | match i { |
484 | | 0 => assert_eq!(*value, 12), |
485 | | 1 => assert_eq!(*value, 33), |
486 | | _ => panic!(), |
487 | | } |
488 | | i += 1; |
489 | | } |
490 | | i = 0; |
491 | | for value_mut in m.values_mut() { |
492 | | match i { |
493 | | 0 => assert_eq!(*value_mut, 12), |
494 | | 1 => assert_eq!(*value_mut, 33), |
495 | | _ => panic!(), |
496 | | } |
497 | | i += 1; |
498 | | } |
499 | | } |
500 | | |
501 | | #[test] |
502 | | fn values_rev() { |
503 | | let mut m: PrimaryMap<E, usize> = PrimaryMap::new(); |
504 | | m.push(12); |
505 | | m.push(33); |
506 | | |
507 | | let mut i = 2; |
508 | | for value in m.values().rev() { |
509 | | i -= 1; |
510 | | match i { |
511 | | 0 => assert_eq!(*value, 12), |
512 | | 1 => assert_eq!(*value, 33), |
513 | | _ => panic!(), |
514 | | } |
515 | | } |
516 | | i = 2; |
517 | | for value_mut in m.values_mut().rev() { |
518 | | i -= 1; |
519 | | match i { |
520 | | 0 => assert_eq!(*value_mut, 12), |
521 | | 1 => assert_eq!(*value_mut, 33), |
522 | | _ => panic!(), |
523 | | } |
524 | | } |
525 | | } |
526 | | |
527 | | #[test] |
528 | | fn from_iter() { |
529 | | let mut m: PrimaryMap<E, usize> = PrimaryMap::new(); |
530 | | m.push(12); |
531 | | m.push(33); |
532 | | |
533 | | let n = m.values().collect::<PrimaryMap<E, _>>(); |
534 | | assert!(m.len() == n.len()); |
535 | | for (me, ne) in m.values().zip(n.values()) { |
536 | | assert!(*me == **ne); |
537 | | } |
538 | | } |
539 | | |
540 | | #[test] |
541 | | fn from_vec() { |
542 | | let mut m: PrimaryMap<E, usize> = PrimaryMap::new(); |
543 | | m.push(12); |
544 | | m.push(33); |
545 | | |
546 | | let n = PrimaryMap::<E, &usize>::from(m.values().collect::<Vec<_>>()); |
547 | | assert!(m.len() == n.len()); |
548 | | for (me, ne) in m.values().zip(n.values()) { |
549 | | assert!(*me == **ne); |
550 | | } |
551 | | } |
552 | | |
553 | | #[test] |
554 | | fn get_many_mut() { |
555 | | let mut m: PrimaryMap<E, usize> = PrimaryMap::new(); |
556 | | let _0 = m.push(0); |
557 | | let _1 = m.push(1); |
558 | | let _2 = m.push(2); |
559 | | |
560 | | assert_eq!([&mut 0, &mut 2], m.get_disjoint_mut([_0, _2]).unwrap()); |
561 | | assert_eq!( |
562 | | m.get_disjoint_mut([_0, _0]), |
563 | | Err(slice::GetDisjointMutError::OverlappingIndices) |
564 | | ); |
565 | | assert_eq!( |
566 | | m.get_disjoint_mut([E(4)]), |
567 | | Err(slice::GetDisjointMutError::IndexOutOfBounds) |
568 | | ); |
569 | | } |
570 | | } |