Remove quadratic behaviour from -Zunpretty=hir-tree.
This commit is contained in:
parent
52cc779524
commit
cd90406090
1 changed files with 12 additions and 1 deletions
|
@ -796,7 +796,6 @@ impl<'tcx> AttributeMap<'tcx> {
|
||||||
/// Map of all HIR nodes inside the current owner.
|
/// Map of all HIR nodes inside the current owner.
|
||||||
/// These nodes are mapped by `ItemLocalId` alongside the index of their parent node.
|
/// These nodes are mapped by `ItemLocalId` alongside the index of their parent node.
|
||||||
/// The HIR tree, including bodies, is pre-hashed.
|
/// The HIR tree, including bodies, is pre-hashed.
|
||||||
#[derive(Debug)]
|
|
||||||
pub struct OwnerNodes<'tcx> {
|
pub struct OwnerNodes<'tcx> {
|
||||||
/// Pre-computed hash of the full HIR.
|
/// Pre-computed hash of the full HIR.
|
||||||
pub hash_including_bodies: Fingerprint,
|
pub hash_including_bodies: Fingerprint,
|
||||||
|
@ -822,6 +821,18 @@ impl<'tcx> OwnerNodes<'tcx> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl fmt::Debug for OwnerNodes<'_> {
|
||||||
|
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
|
||||||
|
f.debug_struct("OwnerNodes")
|
||||||
|
.field("node", &self.nodes[ItemLocalId::from_u32(0)])
|
||||||
|
.field("bodies", &self.bodies)
|
||||||
|
.field("local_id_to_def_id", &self.local_id_to_def_id)
|
||||||
|
.field("hash_without_bodies", &self.hash_without_bodies)
|
||||||
|
.field("hash_including_bodies", &self.hash_including_bodies)
|
||||||
|
.finish()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Full information resulting from lowering an AST node.
|
/// Full information resulting from lowering an AST node.
|
||||||
#[derive(Debug, HashStable_Generic)]
|
#[derive(Debug, HashStable_Generic)]
|
||||||
pub struct OwnerInfo<'hir> {
|
pub struct OwnerInfo<'hir> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue