]> git.proxmox.com Git - rustc.git/blame - compiler/rustc_middle/src/middle/mod.rs
New upstream version 1.59.0+dfsg1
[rustc.git] / compiler / rustc_middle / src / middle / mod.rs
CommitLineData
dfeec247 1pub mod codegen_fn_attrs;
dfeec247
XL
2pub mod dependency_format;
3pub mod exported_symbols;
dfeec247
XL
4pub mod lang_items;
5pub mod lib_features {
6 use rustc_data_structures::fx::{FxHashMap, FxHashSet};
7 use rustc_span::symbol::Symbol;
8
5869c6ff 9 #[derive(HashStable, Debug)]
dfeec247
XL
10 pub struct LibFeatures {
11 // A map from feature to stabilisation version.
12 pub stable: FxHashMap<Symbol, Symbol>,
13 pub unstable: FxHashSet<Symbol>,
14 }
15
16 impl LibFeatures {
17 pub fn to_vec(&self) -> Vec<(Symbol, Option<Symbol>)> {
18 let mut all_features: Vec<_> = self
19 .stable
20 .iter()
21 .map(|(f, s)| (*f, Some(*s)))
22 .chain(self.unstable.iter().map(|f| (*f, None)))
23 .collect();
a2a8927a 24 all_features.sort_unstable_by(|a, b| a.0.as_str().partial_cmp(b.0.as_str()).unwrap());
dfeec247
XL
25 all_features
26 }
27 }
28}
74b04a01 29pub mod limits;
dfeec247 30pub mod privacy;
dfeec247
XL
31pub mod region;
32pub mod resolve_lifetime;
33pub mod stability;
136023e0
XL
34
35pub fn provide(providers: &mut crate::ty::query::Providers) {
36 limits::provide(providers);
37}