]>
Commit | Line | Data |
---|---|---|
dfeec247 | 1 | pub mod codegen_fn_attrs; |
dfeec247 XL |
2 | pub mod dependency_format; |
3 | pub mod exported_symbols; | |
dfeec247 XL |
4 | pub mod lang_items; |
5 | pub 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 | 29 | pub mod limits; |
dfeec247 | 30 | pub mod privacy; |
dfeec247 XL |
31 | pub mod region; |
32 | pub mod resolve_lifetime; | |
33 | pub mod stability; | |
136023e0 XL |
34 | |
35 | pub fn provide(providers: &mut crate::ty::query::Providers) { | |
36 | limits::provide(providers); | |
37 | } |