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