Skip to content

Commit f5c63e7

Browse files
committed
Introduce librustc/middle/mod.rs
1 parent 5768162 commit f5c63e7

File tree

2 files changed

+36
-39
lines changed

2 files changed

+36
-39
lines changed

src/librustc/lib.rs

+1-39
Original file line numberDiff line numberDiff line change
@@ -95,45 +95,7 @@ pub mod hir;
9595
pub mod ich;
9696
pub mod infer;
9797
pub mod lint;
98-
99-
pub mod middle {
100-
pub mod cstore;
101-
pub mod dependency_format;
102-
pub mod exported_symbols;
103-
pub mod free_region;
104-
pub mod lang_items;
105-
pub mod lib_features {
106-
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
107-
use syntax::symbol::Symbol;
108-
109-
#[derive(HashStable)]
110-
pub struct LibFeatures {
111-
// A map from feature to stabilisation version.
112-
pub stable: FxHashMap<Symbol, Symbol>,
113-
pub unstable: FxHashSet<Symbol>,
114-
}
115-
116-
impl LibFeatures {
117-
pub fn to_vec(&self) -> Vec<(Symbol, Option<Symbol>)> {
118-
let mut all_features: Vec<_> = self
119-
.stable
120-
.iter()
121-
.map(|(f, s)| (*f, Some(*s)))
122-
.chain(self.unstable.iter().map(|f| (*f, None)))
123-
.collect();
124-
all_features.sort_unstable_by_key(|f| f.0.as_str());
125-
all_features
126-
}
127-
}
128-
}
129-
pub mod privacy;
130-
pub mod recursion_limit;
131-
pub mod region;
132-
pub mod resolve_lifetime;
133-
pub mod stability;
134-
pub mod weak_lang_items;
135-
}
136-
98+
pub mod middle;
13799
pub mod mir;
138100
pub use rustc_session as session;
139101
pub mod traits;

src/librustc/middle/mod.rs

+35
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
pub mod cstore;
2+
pub mod dependency_format;
3+
pub mod exported_symbols;
4+
pub mod free_region;
5+
pub mod lang_items;
6+
pub mod lib_features {
7+
use rustc_data_structures::fx::{FxHashMap, FxHashSet};
8+
use syntax::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 privacy;
31+
pub mod recursion_limit;
32+
pub mod region;
33+
pub mod resolve_lifetime;
34+
pub mod stability;
35+
pub mod weak_lang_items;

0 commit comments

Comments
 (0)