]> git.proxmox.com Git - rustc.git/blob - compiler/rustc_middle/src/middle/mod.rs
New upstream version 1.48.0~beta.8+dfsg1
[rustc.git] / compiler / rustc_middle / src / middle / mod.rs
1 pub mod codegen_fn_attrs;
2 pub mod cstore;
3 pub mod dependency_format;
4 pub mod exported_symbols;
5 pub mod lang_items;
6 pub mod lib_features {
7 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
8 use rustc_span::symbol::Symbol;
9
10 #[derive(HashStable)]
11 pub struct LibFeatures {
12 // A map from feature to stabilisation version.
13 pub stable: FxHashMap<Symbol, Symbol>,
14 pub unstable: FxHashSet<Symbol>,
15 }
16
17 impl LibFeatures {
18 pub fn to_vec(&self) -> Vec<(Symbol, Option<Symbol>)> {
19 let mut all_features: Vec<_> = self
20 .stable
21 .iter()
22 .map(|(f, s)| (*f, Some(*s)))
23 .chain(self.unstable.iter().map(|f| (*f, None)))
24 .collect();
25 all_features.sort_unstable_by_key(|f| f.0.as_str());
26 all_features
27 }
28 }
29 }
30 pub mod limits;
31 pub mod privacy;
32 pub mod region;
33 pub mod resolve_lifetime;
34 pub mod stability;