From f5c63e7b27cfb94cbc0b78ab109616c7c4706779 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sun, 29 Dec 2019 11:57:30 +0100 Subject: [PATCH] Introduce librustc/middle/mod.rs --- src/librustc/lib.rs | 40 +------------------------------------- src/librustc/middle/mod.rs | 35 +++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+), 39 deletions(-) create mode 100644 src/librustc/middle/mod.rs diff --git a/src/librustc/lib.rs b/src/librustc/lib.rs index 35c20cdbaf59..76588dfa5e25 100644 --- a/src/librustc/lib.rs +++ b/src/librustc/lib.rs @@ -95,45 +95,7 @@ pub mod ich; pub mod infer; pub mod lint; - -pub mod middle { - pub mod cstore; - pub mod dependency_format; - pub mod exported_symbols; - pub mod free_region; - pub mod lang_items; - pub mod lib_features { - use rustc_data_structures::fx::{FxHashMap, FxHashSet}; - use syntax::symbol::Symbol; - - #[derive(HashStable)] - pub struct LibFeatures { - // A map from feature to stabilisation version. - pub stable: FxHashMap, - pub unstable: FxHashSet, - } - - impl LibFeatures { - pub fn to_vec(&self) -> Vec<(Symbol, Option)> { - let mut all_features: Vec<_> = self - .stable - .iter() - .map(|(f, s)| (*f, Some(*s))) - .chain(self.unstable.iter().map(|f| (*f, None))) - .collect(); - all_features.sort_unstable_by_key(|f| f.0.as_str()); - all_features - } - } - } - pub mod privacy; - pub mod recursion_limit; - pub mod region; - pub mod resolve_lifetime; - pub mod stability; - pub mod weak_lang_items; -} - +pub mod middle; pub mod mir; pub use rustc_session as session; pub mod traits; diff --git a/src/librustc/middle/mod.rs b/src/librustc/middle/mod.rs new file mode 100644 index 000000000000..030bcf3bf423 --- /dev/null +++ b/src/librustc/middle/mod.rs @@ -0,0 +1,35 @@ +pub mod cstore; +pub mod dependency_format; +pub mod exported_symbols; +pub mod free_region; +pub mod lang_items; +pub mod lib_features { + use rustc_data_structures::fx::{FxHashMap, FxHashSet}; + use syntax::symbol::Symbol; + + #[derive(HashStable)] + pub struct LibFeatures { + // A map from feature to stabilisation version. + pub stable: FxHashMap, + pub unstable: FxHashSet, + } + + impl LibFeatures { + pub fn to_vec(&self) -> Vec<(Symbol, Option)> { + let mut all_features: Vec<_> = self + .stable + .iter() + .map(|(f, s)| (*f, Some(*s))) + .chain(self.unstable.iter().map(|f| (*f, None))) + .collect(); + all_features.sort_unstable_by_key(|f| f.0.as_str()); + all_features + } + } +} +pub mod privacy; +pub mod recursion_limit; +pub mod region; +pub mod resolve_lifetime; +pub mod stability; +pub mod weak_lang_items;