rustc_middle/mir/
coverage.rs

1//! Metadata from source code coverage analysis and instrumentation.
2
3use std::fmt::{self, Debug, Formatter};
4
5use rustc_data_structures::fx::FxIndexMap;
6use rustc_index::{Idx, IndexVec};
7use rustc_macros::{HashStable, TyDecodable, TyEncodable};
8use rustc_span::Span;
9
10impl ::std::fmt::Debug for BlockMarkerId {
    fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        fmt.write_fmt(format_args!("BlockMarkerId({0})", self.as_u32()))
    }
}rustc_index::newtype_index! {
11    /// Used by [`CoverageKind::BlockMarker`] to mark blocks during THIR-to-MIR
12    /// lowering, so that those blocks can be identified later.
13    #[derive(HashStable)]
14    #[encodable]
15    #[debug_format = "BlockMarkerId({})"]
16    pub struct BlockMarkerId {}
17}
18
19impl ::std::fmt::Debug for CounterId {
    fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        fmt.write_fmt(format_args!("CounterId({0})", self.as_u32()))
    }
}rustc_index::newtype_index! {
20    /// ID of a coverage counter. Values ascend from 0.
21    ///
22    /// Before MIR inlining, counter IDs are local to their enclosing function.
23    /// After MIR inlining, coverage statements may have been inlined into
24    /// another function, so use the statement's source-scope to find which
25    /// function/instance its IDs are meaningful for.
26    ///
27    /// Note that LLVM handles counter IDs as `uint32_t`, so there is no need
28    /// to use a larger representation on the Rust side.
29    #[derive(HashStable)]
30    #[encodable]
31    #[orderable]
32    #[debug_format = "CounterId({})"]
33    pub struct CounterId {}
34}
35
36impl ::std::fmt::Debug for ExpressionId {
    fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        fmt.write_fmt(format_args!("ExpressionId({0})", self.as_u32()))
    }
}rustc_index::newtype_index! {
37    /// ID of a coverage-counter expression. Values ascend from 0.
38    ///
39    /// Before MIR inlining, expression IDs are local to their enclosing function.
40    /// After MIR inlining, coverage statements may have been inlined into
41    /// another function, so use the statement's source-scope to find which
42    /// function/instance its IDs are meaningful for.
43    ///
44    /// Note that LLVM handles expression IDs as `uint32_t`, so there is no need
45    /// to use a larger representation on the Rust side.
46    #[derive(HashStable)]
47    #[encodable]
48    #[orderable]
49    #[debug_format = "ExpressionId({})"]
50    pub struct ExpressionId {}
51}
52
53/// Enum that can hold a constant zero value, the ID of an physical coverage
54/// counter, or the ID of a coverage-counter expression.
55#[derive(#[automatically_derived]
impl ::core::marker::Copy for CovTerm { }Copy, #[automatically_derived]
impl ::core::clone::Clone for CovTerm {
    #[inline]
    fn clone(&self) -> CovTerm {
        let _: ::core::clone::AssertParamIsClone<CounterId>;
        let _: ::core::clone::AssertParamIsClone<ExpressionId>;
        *self
    }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for CovTerm {
    #[inline]
    fn eq(&self, other: &CovTerm) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (CovTerm::Counter(__self_0), CovTerm::Counter(__arg1_0)) =>
                    __self_0 == __arg1_0,
                (CovTerm::Expression(__self_0), CovTerm::Expression(__arg1_0))
                    => __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for CovTerm {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_eq(&self) -> () {
        let _: ::core::cmp::AssertParamIsEq<CounterId>;
        let _: ::core::cmp::AssertParamIsEq<ExpressionId>;
    }
}Eq, #[automatically_derived]
impl ::core::cmp::PartialOrd for CovTerm {
    #[inline]
    fn partial_cmp(&self, other: &CovTerm)
        -> ::core::option::Option<::core::cmp::Ordering> {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        match (self, other) {
            (CovTerm::Counter(__self_0), CovTerm::Counter(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            (CovTerm::Expression(__self_0), CovTerm::Expression(__arg1_0)) =>
                ::core::cmp::PartialOrd::partial_cmp(__self_0, __arg1_0),
            _ =>
                ::core::cmp::PartialOrd::partial_cmp(&__self_discr,
                    &__arg1_discr),
        }
    }
}PartialOrd, #[automatically_derived]
impl ::core::cmp::Ord for CovTerm {
    #[inline]
    fn cmp(&self, other: &CovTerm) -> ::core::cmp::Ordering {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        match ::core::cmp::Ord::cmp(&__self_discr, &__arg1_discr) {
            ::core::cmp::Ordering::Equal =>
                match (self, other) {
                    (CovTerm::Counter(__self_0), CovTerm::Counter(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    (CovTerm::Expression(__self_0),
                        CovTerm::Expression(__arg1_0)) =>
                        ::core::cmp::Ord::cmp(__self_0, __arg1_0),
                    _ => ::core::cmp::Ordering::Equal,
                },
            cmp => cmp,
        }
    }
}Ord)]
56#[derive(const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for CovTerm {
            fn encode(&self, __encoder: &mut __E) {
                let disc =
                    match *self {
                        CovTerm::Zero => { 0usize }
                        CovTerm::Counter(ref __binding_0) => { 1usize }
                        CovTerm::Expression(ref __binding_0) => { 2usize }
                    };
                ::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
                match *self {
                    CovTerm::Zero => {}
                    CovTerm::Counter(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    CovTerm::Expression(ref __binding_0) => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                }
            }
        }
    };TyEncodable, const _: () =
    {
        impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
            ::rustc_serialize::Decodable<__D> for CovTerm {
            fn decode(__decoder: &mut __D) -> Self {
                match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
                    {
                    0usize => { CovTerm::Zero }
                    1usize => {
                        CovTerm::Counter(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    2usize => {
                        CovTerm::Expression(::rustc_serialize::Decodable::decode(__decoder))
                    }
                    n => {
                        ::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `CovTerm`, expected 0..3, actual {0}",
                                n));
                    }
                }
            }
        }
    };TyDecodable, #[automatically_derived]
impl ::core::hash::Hash for CovTerm {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            CovTerm::Counter(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            CovTerm::Expression(__self_0) =>
                ::core::hash::Hash::hash(__self_0, state),
            _ => {}
        }
    }
}Hash, const _: () =
    {
        impl<'__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for CovTerm {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                ::std::mem::discriminant(self).hash_stable(__hcx, __hasher);
                match *self {
                    CovTerm::Zero => {}
                    CovTerm::Counter(ref __binding_0) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    CovTerm::Expression(ref __binding_0) => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable)]
57pub enum CovTerm {
58    Zero,
59    Counter(CounterId),
60    Expression(ExpressionId),
61}
62
63impl Debug for CovTerm {
64    fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result {
65        match self {
66            Self::Zero => f.write_fmt(format_args!("Zero"))write!(f, "Zero"),
67            Self::Counter(id) => f.debug_tuple("Counter").field(&id.as_u32()).finish(),
68            Self::Expression(id) => f.debug_tuple("Expression").field(&id.as_u32()).finish(),
69        }
70    }
71}
72
73#[derive(#[automatically_derived]
impl ::core::clone::Clone for CoverageKind {
    #[inline]
    fn clone(&self) -> CoverageKind {
        match self {
            CoverageKind::SpanMarker => CoverageKind::SpanMarker,
            CoverageKind::BlockMarker { id: __self_0 } =>
                CoverageKind::BlockMarker {
                    id: ::core::clone::Clone::clone(__self_0),
                },
            CoverageKind::VirtualCounter { bcb: __self_0 } =>
                CoverageKind::VirtualCounter {
                    bcb: ::core::clone::Clone::clone(__self_0),
                },
        }
    }
}Clone, #[automatically_derived]
impl ::core::cmp::PartialEq for CoverageKind {
    #[inline]
    fn eq(&self, other: &CoverageKind) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr &&
            match (self, other) {
                (CoverageKind::BlockMarker { id: __self_0 },
                    CoverageKind::BlockMarker { id: __arg1_0 }) =>
                    __self_0 == __arg1_0,
                (CoverageKind::VirtualCounter { bcb: __self_0 },
                    CoverageKind::VirtualCounter { bcb: __arg1_0 }) =>
                    __self_0 == __arg1_0,
                _ => true,
            }
    }
}PartialEq, const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for CoverageKind {
            fn encode(&self, __encoder: &mut __E) {
                let disc =
                    match *self {
                        CoverageKind::SpanMarker => { 0usize }
                        CoverageKind::BlockMarker { id: ref __binding_0 } => {
                            1usize
                        }
                        CoverageKind::VirtualCounter { bcb: ref __binding_0 } => {
                            2usize
                        }
                    };
                ::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
                match *self {
                    CoverageKind::SpanMarker => {}
                    CoverageKind::BlockMarker { id: ref __binding_0 } => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    CoverageKind::VirtualCounter { bcb: ref __binding_0 } => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                }
            }
        }
    };TyEncodable, const _: () =
    {
        impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
            ::rustc_serialize::Decodable<__D> for CoverageKind {
            fn decode(__decoder: &mut __D) -> Self {
                match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
                    {
                    0usize => { CoverageKind::SpanMarker }
                    1usize => {
                        CoverageKind::BlockMarker {
                            id: ::rustc_serialize::Decodable::decode(__decoder),
                        }
                    }
                    2usize => {
                        CoverageKind::VirtualCounter {
                            bcb: ::rustc_serialize::Decodable::decode(__decoder),
                        }
                    }
                    n => {
                        ::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `CoverageKind`, expected 0..3, actual {0}",
                                n));
                    }
                }
            }
        }
    };TyDecodable, #[automatically_derived]
impl ::core::hash::Hash for CoverageKind {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            CoverageKind::BlockMarker { id: __self_0 } =>
                ::core::hash::Hash::hash(__self_0, state),
            CoverageKind::VirtualCounter { bcb: __self_0 } =>
                ::core::hash::Hash::hash(__self_0, state),
            _ => {}
        }
    }
}Hash, const _: () =
    {
        impl<'__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for CoverageKind {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                ::std::mem::discriminant(self).hash_stable(__hcx, __hasher);
                match *self {
                    CoverageKind::SpanMarker => {}
                    CoverageKind::BlockMarker { id: ref __binding_0 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    CoverageKind::VirtualCounter { bcb: ref __binding_0 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable)]
74pub enum CoverageKind {
75    /// Marks a span that might otherwise not be represented in MIR, so that
76    /// coverage instrumentation can associate it with its enclosing block/BCB.
77    ///
78    /// Should be erased before codegen (at some point after `InstrumentCoverage`).
79    SpanMarker,
80
81    /// Marks its enclosing basic block with an ID that can be referred to by
82    /// side data in [`CoverageInfoHi`].
83    ///
84    /// Should be erased before codegen (at some point after `InstrumentCoverage`).
85    BlockMarker { id: BlockMarkerId },
86
87    /// Marks its enclosing basic block with the ID of the coverage graph node
88    /// that it was part of during the `InstrumentCoverage` MIR pass.
89    ///
90    /// During codegen, this might be lowered to `llvm.instrprof.increment` or
91    /// to a no-op, depending on the outcome of counter-creation.
92    VirtualCounter { bcb: BasicCoverageBlock },
93}
94
95impl Debug for CoverageKind {
96    fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
97        use CoverageKind::*;
98        match self {
99            SpanMarker => fmt.write_fmt(format_args!("SpanMarker"))write!(fmt, "SpanMarker"),
100            BlockMarker { id } => fmt.write_fmt(format_args!("BlockMarker({0:?})", id.index()))write!(fmt, "BlockMarker({:?})", id.index()),
101            VirtualCounter { bcb } => fmt.write_fmt(format_args!("VirtualCounter({0:?})", bcb))write!(fmt, "VirtualCounter({bcb:?})"),
102        }
103    }
104}
105
106#[derive(#[automatically_derived]
impl ::core::marker::Copy for Op { }Copy, #[automatically_derived]
impl ::core::clone::Clone for Op {
    #[inline]
    fn clone(&self) -> Op { *self }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for Op {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::write_str(f,
            match self { Op::Subtract => "Subtract", Op::Add => "Add", })
    }
}Debug, #[automatically_derived]
impl ::core::cmp::PartialEq for Op {
    #[inline]
    fn eq(&self, other: &Op) -> bool {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        let __arg1_discr = ::core::intrinsics::discriminant_value(other);
        __self_discr == __arg1_discr
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for Op {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_eq(&self) -> () {}
}Eq, #[automatically_derived]
impl ::core::hash::Hash for Op {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state)
    }
}Hash, const _: () =
    {
        impl<'__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for Op {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                ::std::mem::discriminant(self).hash_stable(__hcx, __hasher);
                match *self { Op::Subtract => {} Op::Add => {} }
            }
        }
    };HashStable)]
107#[derive(const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for Op {
            fn encode(&self, __encoder: &mut __E) {
                let disc =
                    match *self {
                        Op::Subtract => { 0usize }
                        Op::Add => { 1usize }
                    };
                ::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
                match *self { Op::Subtract => {} Op::Add => {} }
            }
        }
    };TyEncodable, const _: () =
    {
        impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
            ::rustc_serialize::Decodable<__D> for Op {
            fn decode(__decoder: &mut __D) -> Self {
                match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
                    {
                    0usize => { Op::Subtract }
                    1usize => { Op::Add }
                    n => {
                        ::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `Op`, expected 0..2, actual {0}",
                                n));
                    }
                }
            }
        }
    };TyDecodable)]
108pub enum Op {
109    Subtract,
110    Add,
111}
112
113impl Op {
114    pub fn is_add(&self) -> bool {
115        #[allow(non_exhaustive_omitted_patterns)] match self {
    Self::Add => true,
    _ => false,
}matches!(self, Self::Add)
116    }
117
118    pub fn is_subtract(&self) -> bool {
119        #[allow(non_exhaustive_omitted_patterns)] match self {
    Self::Subtract => true,
    _ => false,
}matches!(self, Self::Subtract)
120    }
121}
122
123#[derive(#[automatically_derived]
impl ::core::clone::Clone for Expression {
    #[inline]
    fn clone(&self) -> Expression {
        Expression {
            lhs: ::core::clone::Clone::clone(&self.lhs),
            op: ::core::clone::Clone::clone(&self.op),
            rhs: ::core::clone::Clone::clone(&self.rhs),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for Expression {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f, "Expression",
            "lhs", &self.lhs, "op", &self.op, "rhs", &&self.rhs)
    }
}Debug, #[automatically_derived]
impl ::core::cmp::PartialEq for Expression {
    #[inline]
    fn eq(&self, other: &Expression) -> bool {
        self.lhs == other.lhs && self.op == other.op && self.rhs == other.rhs
    }
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for Expression {
    #[inline]
    #[doc(hidden)]
    #[coverage(off)]
    fn assert_receiver_is_total_eq(&self) -> () {
        let _: ::core::cmp::AssertParamIsEq<CovTerm>;
        let _: ::core::cmp::AssertParamIsEq<Op>;
    }
}Eq)]
124#[derive(const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for Expression {
            fn encode(&self, __encoder: &mut __E) {
                match *self {
                    Expression {
                        lhs: ref __binding_0,
                        op: ref __binding_1,
                        rhs: ref __binding_2 } => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_2,
                            __encoder);
                    }
                }
            }
        }
    };TyEncodable, const _: () =
    {
        impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
            ::rustc_serialize::Decodable<__D> for Expression {
            fn decode(__decoder: &mut __D) -> Self {
                Expression {
                    lhs: ::rustc_serialize::Decodable::decode(__decoder),
                    op: ::rustc_serialize::Decodable::decode(__decoder),
                    rhs: ::rustc_serialize::Decodable::decode(__decoder),
                }
            }
        }
    };TyDecodable, #[automatically_derived]
impl ::core::hash::Hash for Expression {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
        ::core::hash::Hash::hash(&self.lhs, state);
        ::core::hash::Hash::hash(&self.op, state);
        ::core::hash::Hash::hash(&self.rhs, state)
    }
}Hash, const _: () =
    {
        impl<'__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for Expression {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                match *self {
                    Expression {
                        lhs: ref __binding_0,
                        op: ref __binding_1,
                        rhs: ref __binding_2 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                        { __binding_2.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable)]
125pub struct Expression {
126    pub lhs: CovTerm,
127    pub op: Op,
128    pub rhs: CovTerm,
129}
130
131#[derive(#[automatically_derived]
impl ::core::clone::Clone for MappingKind {
    #[inline]
    fn clone(&self) -> MappingKind {
        match self {
            MappingKind::Code { bcb: __self_0 } =>
                MappingKind::Code {
                    bcb: ::core::clone::Clone::clone(__self_0),
                },
            MappingKind::Branch { true_bcb: __self_0, false_bcb: __self_1 } =>
                MappingKind::Branch {
                    true_bcb: ::core::clone::Clone::clone(__self_0),
                    false_bcb: ::core::clone::Clone::clone(__self_1),
                },
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for MappingKind {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        match self {
            MappingKind::Code { bcb: __self_0 } =>
                ::core::fmt::Formatter::debug_struct_field1_finish(f, "Code",
                    "bcb", &__self_0),
            MappingKind::Branch { true_bcb: __self_0, false_bcb: __self_1 } =>
                ::core::fmt::Formatter::debug_struct_field2_finish(f,
                    "Branch", "true_bcb", __self_0, "false_bcb", &__self_1),
        }
    }
}Debug)]
132#[derive(const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for MappingKind {
            fn encode(&self, __encoder: &mut __E) {
                let disc =
                    match *self {
                        MappingKind::Code { bcb: ref __binding_0 } => { 0usize }
                        MappingKind::Branch {
                            true_bcb: ref __binding_0, false_bcb: ref __binding_1 } => {
                            1usize
                        }
                    };
                ::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
                match *self {
                    MappingKind::Code { bcb: ref __binding_0 } => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                    }
                    MappingKind::Branch {
                        true_bcb: ref __binding_0, false_bcb: ref __binding_1 } => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                    }
                }
            }
        }
    };TyEncodable, const _: () =
    {
        impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
            ::rustc_serialize::Decodable<__D> for MappingKind {
            fn decode(__decoder: &mut __D) -> Self {
                match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
                    {
                    0usize => {
                        MappingKind::Code {
                            bcb: ::rustc_serialize::Decodable::decode(__decoder),
                        }
                    }
                    1usize => {
                        MappingKind::Branch {
                            true_bcb: ::rustc_serialize::Decodable::decode(__decoder),
                            false_bcb: ::rustc_serialize::Decodable::decode(__decoder),
                        }
                    }
                    n => {
                        ::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `MappingKind`, expected 0..2, actual {0}",
                                n));
                    }
                }
            }
        }
    };TyDecodable, #[automatically_derived]
impl ::core::hash::Hash for MappingKind {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
        let __self_discr = ::core::intrinsics::discriminant_value(self);
        ::core::hash::Hash::hash(&__self_discr, state);
        match self {
            MappingKind::Code { bcb: __self_0 } =>
                ::core::hash::Hash::hash(__self_0, state),
            MappingKind::Branch { true_bcb: __self_0, false_bcb: __self_1 } =>
                {
                ::core::hash::Hash::hash(__self_0, state);
                ::core::hash::Hash::hash(__self_1, state)
            }
        }
    }
}Hash, const _: () =
    {
        impl<'__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for MappingKind {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                ::std::mem::discriminant(self).hash_stable(__hcx, __hasher);
                match *self {
                    MappingKind::Code { bcb: ref __binding_0 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                    }
                    MappingKind::Branch {
                        true_bcb: ref __binding_0, false_bcb: ref __binding_1 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable)]
133pub enum MappingKind {
134    /// Associates a normal region of code with a counter/expression/zero.
135    Code { bcb: BasicCoverageBlock },
136    /// Associates a branch region with separate counters for true and false.
137    Branch { true_bcb: BasicCoverageBlock, false_bcb: BasicCoverageBlock },
138}
139
140#[derive(#[automatically_derived]
impl ::core::clone::Clone for Mapping {
    #[inline]
    fn clone(&self) -> Mapping {
        Mapping {
            kind: ::core::clone::Clone::clone(&self.kind),
            span: ::core::clone::Clone::clone(&self.span),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for Mapping {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f, "Mapping",
            "kind", &self.kind, "span", &&self.span)
    }
}Debug)]
141#[derive(const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for Mapping {
            fn encode(&self, __encoder: &mut __E) {
                match *self {
                    Mapping { kind: ref __binding_0, span: ref __binding_1 } =>
                        {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                    }
                }
            }
        }
    };TyEncodable, const _: () =
    {
        impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
            ::rustc_serialize::Decodable<__D> for Mapping {
            fn decode(__decoder: &mut __D) -> Self {
                Mapping {
                    kind: ::rustc_serialize::Decodable::decode(__decoder),
                    span: ::rustc_serialize::Decodable::decode(__decoder),
                }
            }
        }
    };TyDecodable, #[automatically_derived]
impl ::core::hash::Hash for Mapping {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
        ::core::hash::Hash::hash(&self.kind, state);
        ::core::hash::Hash::hash(&self.span, state)
    }
}Hash, const _: () =
    {
        impl<'__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for Mapping {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                match *self {
                    Mapping { kind: ref __binding_0, span: ref __binding_1 } =>
                        {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable)]
142pub struct Mapping {
143    pub kind: MappingKind,
144    pub span: Span,
145}
146
147/// Stores per-function coverage information attached to a `mir::Body`,
148/// to be used in conjunction with the individual coverage statements injected
149/// into the function's basic blocks.
150#[derive(#[automatically_derived]
impl ::core::clone::Clone for FunctionCoverageInfo {
    #[inline]
    fn clone(&self) -> FunctionCoverageInfo {
        FunctionCoverageInfo {
            function_source_hash: ::core::clone::Clone::clone(&self.function_source_hash),
            node_flow_data: ::core::clone::Clone::clone(&self.node_flow_data),
            priority_list: ::core::clone::Clone::clone(&self.priority_list),
            mappings: ::core::clone::Clone::clone(&self.mappings),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for FunctionCoverageInfo {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field4_finish(f,
            "FunctionCoverageInfo", "function_source_hash",
            &self.function_source_hash, "node_flow_data",
            &self.node_flow_data, "priority_list", &self.priority_list,
            "mappings", &&self.mappings)
    }
}Debug)]
151#[derive(const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for FunctionCoverageInfo {
            fn encode(&self, __encoder: &mut __E) {
                match *self {
                    FunctionCoverageInfo {
                        function_source_hash: ref __binding_0,
                        node_flow_data: ref __binding_1,
                        priority_list: ref __binding_2,
                        mappings: ref __binding_3 } => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_2,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_3,
                            __encoder);
                    }
                }
            }
        }
    };TyEncodable, const _: () =
    {
        impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
            ::rustc_serialize::Decodable<__D> for FunctionCoverageInfo {
            fn decode(__decoder: &mut __D) -> Self {
                FunctionCoverageInfo {
                    function_source_hash: ::rustc_serialize::Decodable::decode(__decoder),
                    node_flow_data: ::rustc_serialize::Decodable::decode(__decoder),
                    priority_list: ::rustc_serialize::Decodable::decode(__decoder),
                    mappings: ::rustc_serialize::Decodable::decode(__decoder),
                }
            }
        }
    };TyDecodable, #[automatically_derived]
impl ::core::hash::Hash for FunctionCoverageInfo {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
        ::core::hash::Hash::hash(&self.function_source_hash, state);
        ::core::hash::Hash::hash(&self.node_flow_data, state);
        ::core::hash::Hash::hash(&self.priority_list, state);
        ::core::hash::Hash::hash(&self.mappings, state)
    }
}Hash, const _: () =
    {
        impl<'__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for FunctionCoverageInfo {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                match *self {
                    FunctionCoverageInfo {
                        function_source_hash: ref __binding_0,
                        node_flow_data: ref __binding_1,
                        priority_list: ref __binding_2,
                        mappings: ref __binding_3 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                        { __binding_2.hash_stable(__hcx, __hasher); }
                        { __binding_3.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable)]
152pub struct FunctionCoverageInfo {
153    pub function_source_hash: u64,
154
155    /// Used in conjunction with `priority_list` to create physical counters
156    /// and counter expressions, after MIR optimizations.
157    pub node_flow_data: NodeFlowData<BasicCoverageBlock>,
158    pub priority_list: Vec<BasicCoverageBlock>,
159
160    pub mappings: Vec<Mapping>,
161}
162
163/// Coverage information for a function, recorded during MIR building and
164/// attached to the corresponding `mir::Body`. Used by the `InstrumentCoverage`
165/// MIR pass.
166///
167/// ("Hi" indicates that this is "high-level" information collected at the
168/// THIR/MIR boundary, before the MIR-based coverage instrumentation pass.)
169#[derive(#[automatically_derived]
impl ::core::clone::Clone for CoverageInfoHi {
    #[inline]
    fn clone(&self) -> CoverageInfoHi {
        CoverageInfoHi {
            num_block_markers: ::core::clone::Clone::clone(&self.num_block_markers),
            branch_spans: ::core::clone::Clone::clone(&self.branch_spans),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for CoverageInfoHi {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f,
            "CoverageInfoHi", "num_block_markers", &self.num_block_markers,
            "branch_spans", &&self.branch_spans)
    }
}Debug)]
170#[derive(const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for CoverageInfoHi {
            fn encode(&self, __encoder: &mut __E) {
                match *self {
                    CoverageInfoHi {
                        num_block_markers: ref __binding_0,
                        branch_spans: ref __binding_1 } => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                    }
                }
            }
        }
    };TyEncodable, const _: () =
    {
        impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
            ::rustc_serialize::Decodable<__D> for CoverageInfoHi {
            fn decode(__decoder: &mut __D) -> Self {
                CoverageInfoHi {
                    num_block_markers: ::rustc_serialize::Decodable::decode(__decoder),
                    branch_spans: ::rustc_serialize::Decodable::decode(__decoder),
                }
            }
        }
    };TyDecodable, #[automatically_derived]
impl ::core::hash::Hash for CoverageInfoHi {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
        ::core::hash::Hash::hash(&self.num_block_markers, state);
        ::core::hash::Hash::hash(&self.branch_spans, state)
    }
}Hash, const _: () =
    {
        impl<'__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for CoverageInfoHi {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                match *self {
                    CoverageInfoHi {
                        num_block_markers: ref __binding_0,
                        branch_spans: ref __binding_1 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable)]
171pub struct CoverageInfoHi {
172    /// 1 more than the highest-numbered [`CoverageKind::BlockMarker`] that was
173    /// injected into the MIR body. This makes it possible to allocate per-ID
174    /// data structures without having to scan the entire body first.
175    pub num_block_markers: usize,
176    pub branch_spans: Vec<BranchSpan>,
177}
178
179#[derive(#[automatically_derived]
impl ::core::clone::Clone for BranchSpan {
    #[inline]
    fn clone(&self) -> BranchSpan {
        BranchSpan {
            span: ::core::clone::Clone::clone(&self.span),
            true_marker: ::core::clone::Clone::clone(&self.true_marker),
            false_marker: ::core::clone::Clone::clone(&self.false_marker),
        }
    }
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for BranchSpan {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field3_finish(f, "BranchSpan",
            "span", &self.span, "true_marker", &self.true_marker,
            "false_marker", &&self.false_marker)
    }
}Debug)]
180#[derive(const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for BranchSpan {
            fn encode(&self, __encoder: &mut __E) {
                match *self {
                    BranchSpan {
                        span: ref __binding_0,
                        true_marker: ref __binding_1,
                        false_marker: ref __binding_2 } => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_2,
                            __encoder);
                    }
                }
            }
        }
    };TyEncodable, const _: () =
    {
        impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
            ::rustc_serialize::Decodable<__D> for BranchSpan {
            fn decode(__decoder: &mut __D) -> Self {
                BranchSpan {
                    span: ::rustc_serialize::Decodable::decode(__decoder),
                    true_marker: ::rustc_serialize::Decodable::decode(__decoder),
                    false_marker: ::rustc_serialize::Decodable::decode(__decoder),
                }
            }
        }
    };TyDecodable, #[automatically_derived]
impl ::core::hash::Hash for BranchSpan {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
        ::core::hash::Hash::hash(&self.span, state);
        ::core::hash::Hash::hash(&self.true_marker, state);
        ::core::hash::Hash::hash(&self.false_marker, state)
    }
}Hash, const _: () =
    {
        impl<'__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for BranchSpan {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                match *self {
                    BranchSpan {
                        span: ref __binding_0,
                        true_marker: ref __binding_1,
                        false_marker: ref __binding_2 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                        { __binding_2.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable)]
181pub struct BranchSpan {
182    pub span: Span,
183    pub true_marker: BlockMarkerId,
184    pub false_marker: BlockMarkerId,
185}
186
187/// Contains information needed during codegen, obtained by inspecting the
188/// function's MIR after MIR optimizations.
189///
190/// Returned by the `coverage_ids_info` query.
191#[derive(#[automatically_derived]
impl ::core::clone::Clone for CoverageIdsInfo {
    #[inline]
    fn clone(&self) -> CoverageIdsInfo {
        CoverageIdsInfo {
            num_counters: ::core::clone::Clone::clone(&self.num_counters),
            phys_counter_for_node: ::core::clone::Clone::clone(&self.phys_counter_for_node),
            term_for_bcb: ::core::clone::Clone::clone(&self.term_for_bcb),
            expressions: ::core::clone::Clone::clone(&self.expressions),
        }
    }
}Clone, const _: () =
    {
        impl<'tcx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for CoverageIdsInfo {
            fn encode(&self, __encoder: &mut __E) {
                match *self {
                    CoverageIdsInfo {
                        num_counters: ref __binding_0,
                        phys_counter_for_node: ref __binding_1,
                        term_for_bcb: ref __binding_2,
                        expressions: ref __binding_3 } => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_2,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_3,
                            __encoder);
                    }
                }
            }
        }
    };TyEncodable, const _: () =
    {
        impl<'tcx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
            ::rustc_serialize::Decodable<__D> for CoverageIdsInfo {
            fn decode(__decoder: &mut __D) -> Self {
                CoverageIdsInfo {
                    num_counters: ::rustc_serialize::Decodable::decode(__decoder),
                    phys_counter_for_node: ::rustc_serialize::Decodable::decode(__decoder),
                    term_for_bcb: ::rustc_serialize::Decodable::decode(__decoder),
                    expressions: ::rustc_serialize::Decodable::decode(__decoder),
                }
            }
        }
    };TyDecodable, #[automatically_derived]
impl ::core::fmt::Debug for CoverageIdsInfo {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field4_finish(f,
            "CoverageIdsInfo", "num_counters", &self.num_counters,
            "phys_counter_for_node", &self.phys_counter_for_node,
            "term_for_bcb", &self.term_for_bcb, "expressions",
            &&self.expressions)
    }
}Debug, const _: () =
    {
        impl<'__ctx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for CoverageIdsInfo {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                match *self {
                    CoverageIdsInfo {
                        num_counters: ref __binding_0,
                        phys_counter_for_node: ref __binding_1,
                        term_for_bcb: ref __binding_2,
                        expressions: ref __binding_3 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                        { __binding_2.hash_stable(__hcx, __hasher); }
                        { __binding_3.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable)]
192pub struct CoverageIdsInfo {
193    pub num_counters: u32,
194    pub phys_counter_for_node: FxIndexMap<BasicCoverageBlock, CounterId>,
195    pub term_for_bcb: IndexVec<BasicCoverageBlock, Option<CovTerm>>,
196    pub expressions: IndexVec<ExpressionId, Expression>,
197}
198
199impl ::std::fmt::Debug for BasicCoverageBlock {
    fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
        fmt.write_fmt(format_args!("bcb{0}", self.as_u32()))
    }
}rustc_index::newtype_index! {
200    /// During the `InstrumentCoverage` MIR pass, a BCB is a node in the
201    /// "coverage graph", which is a refinement of the MIR control-flow graph
202    /// that merges or omits some blocks that aren't relevant to coverage.
203    ///
204    /// After that pass is complete, the coverage graph no longer exists, so a
205    /// BCB is effectively an opaque ID.
206    #[derive(HashStable)]
207    #[encodable]
208    #[orderable]
209    #[debug_format = "bcb{}"]
210    pub struct BasicCoverageBlock {
211        const START_BCB = 0;
212    }
213}
214
215/// Data representing a view of some underlying graph, in which each node's
216/// successors have been merged into a single "supernode".
217///
218/// The resulting supernodes have no obvious meaning on their own.
219/// However, merging successor nodes means that a node's out-edges can all
220/// be combined into a single out-edge, whose flow is the same as the flow
221/// (execution count) of its corresponding node in the original graph.
222///
223/// With all node flows now in the original graph now represented as edge flows
224/// in the merged graph, it becomes possible to analyze the original node flows
225/// using techniques for analyzing edge flows.
226#[derive(#[automatically_derived]
impl<Node: ::core::clone::Clone + Idx> ::core::clone::Clone for
    NodeFlowData<Node> {
    #[inline]
    fn clone(&self) -> NodeFlowData<Node> {
        NodeFlowData {
            supernodes: ::core::clone::Clone::clone(&self.supernodes),
            succ_supernodes: ::core::clone::Clone::clone(&self.succ_supernodes),
        }
    }
}Clone, #[automatically_derived]
impl<Node: ::core::fmt::Debug + Idx> ::core::fmt::Debug for NodeFlowData<Node>
    {
    #[inline]
    fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
        ::core::fmt::Formatter::debug_struct_field2_finish(f, "NodeFlowData",
            "supernodes", &self.supernodes, "succ_supernodes",
            &&self.succ_supernodes)
    }
}Debug)]
227#[derive(const _: () =
    {
        impl<'tcx, Node: Idx, __E: ::rustc_middle::ty::codec::TyEncoder<'tcx>>
            ::rustc_serialize::Encodable<__E> for NodeFlowData<Node> where
            IndexVec<Node, Node>: ::rustc_serialize::Encodable<__E> {
            fn encode(&self, __encoder: &mut __E) {
                match *self {
                    NodeFlowData {
                        supernodes: ref __binding_0,
                        succ_supernodes: ref __binding_1 } => {
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_0,
                            __encoder);
                        ::rustc_serialize::Encodable::<__E>::encode(__binding_1,
                            __encoder);
                    }
                }
            }
        }
    };TyEncodable, const _: () =
    {
        impl<'tcx, Node: Idx, __D: ::rustc_middle::ty::codec::TyDecoder<'tcx>>
            ::rustc_serialize::Decodable<__D> for NodeFlowData<Node> where
            IndexVec<Node, Node>: ::rustc_serialize::Decodable<__D> {
            fn decode(__decoder: &mut __D) -> Self {
                NodeFlowData {
                    supernodes: ::rustc_serialize::Decodable::decode(__decoder),
                    succ_supernodes: ::rustc_serialize::Decodable::decode(__decoder),
                }
            }
        }
    };TyDecodable, #[automatically_derived]
impl<Node: ::core::hash::Hash + Idx> ::core::hash::Hash for NodeFlowData<Node>
    {
    #[inline]
    fn hash<__H: ::core::hash::Hasher>(&self, state: &mut __H) -> () {
        ::core::hash::Hash::hash(&self.supernodes, state);
        ::core::hash::Hash::hash(&self.succ_supernodes, state)
    }
}Hash, const _: () =
    {
        impl<'__ctx, Node: Idx>
            ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            for NodeFlowData<Node> where
            Node: ::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
            {
            #[inline]
            fn hash_stable(&self,
                __hcx:
                    &mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
                __hasher:
                    &mut ::rustc_data_structures::stable_hasher::StableHasher) {
                match *self {
                    NodeFlowData {
                        supernodes: ref __binding_0,
                        succ_supernodes: ref __binding_1 } => {
                        { __binding_0.hash_stable(__hcx, __hasher); }
                        { __binding_1.hash_stable(__hcx, __hasher); }
                    }
                }
            }
        }
    };HashStable)]
228pub struct NodeFlowData<Node: Idx> {
229    /// Maps each node to the supernode that contains it, indicated by some
230    /// arbitrary "root" node that is part of that supernode.
231    pub supernodes: IndexVec<Node, Node>,
232    /// For each node, stores the single supernode that all of its successors
233    /// have been merged into.
234    ///
235    /// (Note that each node in a supernode can potentially have a _different_
236    /// successor supernode from its peers.)
237    pub succ_supernodes: IndexVec<Node, Node>,
238}