rustc_middle/middle/
mod.rs1pub mod codegen_fn_attrs;
2pub mod debugger_visualizer;
3pub mod deduced_param_attrs;
4pub mod dependency_format;
5pub mod exported_symbols;
6pub mod lang_items;
7pub mod lib_features {
8 use rustc_data_structures::unord::UnordMap;
9 use rustc_macros::{BlobDecodable, Encodable, HashStable};
10 use rustc_span::{Span, Symbol};
11
12 #[derive(#[automatically_derived]
impl ::core::marker::Copy for FeatureStability { }Copy, #[automatically_derived]
impl ::core::clone::Clone for FeatureStability {
#[inline]
fn clone(&self) -> FeatureStability {
let _: ::core::clone::AssertParamIsClone<Symbol>;
let _: ::core::clone::AssertParamIsClone<Option<Symbol>>;
*self
}
}Clone, #[automatically_derived]
impl ::core::fmt::Debug for FeatureStability {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
match self {
FeatureStability::AcceptedSince(__self_0) =>
::core::fmt::Formatter::debug_tuple_field1_finish(f,
"AcceptedSince", &__self_0),
FeatureStability::Unstable { old_name: __self_0 } =>
::core::fmt::Formatter::debug_struct_field1_finish(f,
"Unstable", "old_name", &__self_0),
}
}
}Debug, #[automatically_derived]
impl ::core::cmp::PartialEq for FeatureStability {
#[inline]
fn eq(&self, other: &FeatureStability) -> bool {
let __self_discr = ::core::intrinsics::discriminant_value(self);
let __arg1_discr = ::core::intrinsics::discriminant_value(other);
__self_discr == __arg1_discr &&
match (self, other) {
(FeatureStability::AcceptedSince(__self_0),
FeatureStability::AcceptedSince(__arg1_0)) =>
__self_0 == __arg1_0,
(FeatureStability::Unstable { old_name: __self_0 },
FeatureStability::Unstable { old_name: __arg1_0 }) =>
__self_0 == __arg1_0,
_ => unsafe { ::core::intrinsics::unreachable() }
}
}
}PartialEq, #[automatically_derived]
impl ::core::cmp::Eq for FeatureStability {
#[inline]
#[doc(hidden)]
#[coverage(off)]
fn assert_receiver_is_total_eq(&self) -> () {
let _: ::core::cmp::AssertParamIsEq<Symbol>;
let _: ::core::cmp::AssertParamIsEq<Option<Symbol>>;
}
}Eq)]
13 #[derive(const _: () =
{
impl<'__ctx>
::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
for FeatureStability {
#[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 {
FeatureStability::AcceptedSince(ref __binding_0) => {
{ __binding_0.hash_stable(__hcx, __hasher); }
}
FeatureStability::Unstable { old_name: ref __binding_0 } =>
{
{ __binding_0.hash_stable(__hcx, __hasher); }
}
}
}
}
};HashStable, const _: () =
{
impl<__E: ::rustc_span::SpanEncoder> ::rustc_serialize::Encodable<__E>
for FeatureStability {
fn encode(&self, __encoder: &mut __E) {
let disc =
match *self {
FeatureStability::AcceptedSince(ref __binding_0) => {
0usize
}
FeatureStability::Unstable { old_name: ref __binding_0 } =>
{
1usize
}
};
::rustc_serialize::Encoder::emit_u8(__encoder, disc as u8);
match *self {
FeatureStability::AcceptedSince(ref __binding_0) => {
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
FeatureStability::Unstable { old_name: ref __binding_0 } =>
{
::rustc_serialize::Encodable::<__E>::encode(__binding_0,
__encoder);
}
}
}
}
};Encodable, const _: () =
{
impl<__D: ::rustc_span::BlobDecoder> ::rustc_serialize::Decodable<__D>
for FeatureStability {
fn decode(__decoder: &mut __D) -> Self {
match ::rustc_serialize::Decoder::read_u8(__decoder) as usize
{
0usize => {
FeatureStability::AcceptedSince(::rustc_serialize::Decodable::decode(__decoder))
}
1usize => {
FeatureStability::Unstable {
old_name: ::rustc_serialize::Decodable::decode(__decoder),
}
}
n => {
::core::panicking::panic_fmt(format_args!("invalid enum variant tag while decoding `FeatureStability`, expected 0..2, actual {0}",
n));
}
}
}
}
};BlobDecodable)]
14 pub enum FeatureStability {
15 AcceptedSince(Symbol),
16 Unstable { old_name: Option<Symbol> },
17 }
18
19 #[derive(const _: () =
{
impl<'__ctx>
::rustc_data_structures::stable_hasher::HashStable<::rustc_query_system::ich::StableHashingContext<'__ctx>>
for LibFeatures {
#[inline]
fn hash_stable(&self,
__hcx:
&mut ::rustc_query_system::ich::StableHashingContext<'__ctx>,
__hasher:
&mut ::rustc_data_structures::stable_hasher::StableHasher) {
match *self {
LibFeatures { stability: ref __binding_0 } => {
{ __binding_0.hash_stable(__hcx, __hasher); }
}
}
}
}
};HashStable, #[automatically_derived]
impl ::core::fmt::Debug for LibFeatures {
#[inline]
fn fmt(&self, f: &mut ::core::fmt::Formatter) -> ::core::fmt::Result {
::core::fmt::Formatter::debug_struct_field1_finish(f, "LibFeatures",
"stability", &&self.stability)
}
}Debug, #[automatically_derived]
impl ::core::default::Default for LibFeatures {
#[inline]
fn default() -> LibFeatures {
LibFeatures { stability: ::core::default::Default::default() }
}
}Default)]
20 pub struct LibFeatures {
21 pub stability: UnordMap<Symbol, (FeatureStability, Span)>,
22 }
23
24 impl LibFeatures {
25 pub fn to_sorted_vec(&self) -> Vec<(Symbol, FeatureStability)> {
26 self.stability
27 .to_sorted_stable_ord()
28 .iter()
29 .map(|&(&sym, &(stab, _))| (sym, stab))
30 .collect()
31 }
32 }
33}
34pub mod privacy;
35pub mod region;
36pub mod resolve_bound_vars;
37pub mod stability;