1use 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 #[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 #[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 #[derive(HashStable)]
47 #[encodable]
48 #[orderable]
49 #[debug_format = "ExpressionId({})"]
50 pub struct ExpressionId {}
51}
52
53#[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 SpanMarker,
80
81 BlockMarker { id: BlockMarkerId },
86
87 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 Code { bcb: BasicCoverageBlock },
136 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#[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 pub node_flow_data: NodeFlowData<BasicCoverageBlock>,
158 pub priority_list: Vec<BasicCoverageBlock>,
159
160 pub mappings: Vec<Mapping>,
161}
162
163#[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 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#[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 #[derive(HashStable)]
207 #[encodable]
208 #[orderable]
209 #[debug_format = "bcb{}"]
210 pub struct BasicCoverageBlock {
211 const START_BCB = 0;
212 }
213}
214
215#[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 pub supernodes: IndexVec<Node, Node>,
232 pub succ_supernodes: IndexVec<Node, Node>,
238}