]> git.lizzy.rs Git - rust.git/blobdiff - src/librustc/session/config.rs
Rollup merge of #44562 - eddyb:ugh-rustdoc, r=nikomatsakis
[rust.git] / src / librustc / session / config.rs
index b538c6a6eca7bcefdaf233bd5fa8b675d5237f73..df2de17f1e4711409610e76c9a49a87217dfabbb 100644 (file)
@@ -48,8 +48,8 @@
 
 pub struct Config {
     pub target: Target,
-    pub int_type: IntTy,
-    pub uint_type: UintTy,
+    pub isize_ty: IntTy,
+    pub usize_ty: UintTy,
 }
 
 #[derive(Clone, Hash, Debug)]
@@ -919,6 +919,8 @@ fn parse_optimization_fuel(slot: &mut Option<(String, u64)>, v: Option<&str>) ->
         "when debug-printing compiler state, do not include spans"), // o/w tests have closure@path
     identify_regions: bool = (false, parse_bool, [UNTRACKED],
         "make unnamed regions display as '# (where # is some non-ident unique id)"),
+    emit_end_regions: bool = (false, parse_bool, [UNTRACKED],
+        "emit EndRegion as part of MIR; enable transforms that solely process EndRegion"),
     borrowck_mir: bool = (false, parse_bool, [UNTRACKED],
         "implicitly treat functions as if they have `#[rustc_mir_borrowck]` attribute"),
     time_passes: bool = (false, parse_bool, [UNTRACKED],
@@ -1147,7 +1149,7 @@ pub fn build_target_config(opts: &Options, sp: &Handler) -> Config {
         }
     };
 
-    let (int_type, uint_type) = match &target.target_pointer_width[..] {
+    let (isize_ty, usize_ty) = match &target.target_pointer_width[..] {
         "16" => (ast::IntTy::I16, ast::UintTy::U16),
         "32" => (ast::IntTy::I32, ast::UintTy::U32),
         "64" => (ast::IntTy::I64, ast::UintTy::U64),
@@ -1157,8 +1159,8 @@ pub fn build_target_config(opts: &Options, sp: &Handler) -> Config {
 
     Config {
         target,
-        int_type,
-        uint_type,
+        isize_ty,
+        usize_ty,
     }
 }
 
@@ -1947,17 +1949,15 @@ pub fn stable_hash(sub_hashes: BTreeMap<&'static str, &DepTrackingHash>,
 
 #[cfg(test)]
 mod tests {
-    use dep_graph::DepGraph;
     use errors;
     use getopts;
     use lint;
-    use middle::cstore::{self, DummyCrateStore};
+    use middle::cstore;
     use session::config::{build_configuration, build_session_options_and_crate_config};
     use session::build_session;
     use std::collections::{BTreeMap, BTreeSet};
     use std::iter::FromIterator;
     use std::path::PathBuf;
-    use std::rc::Rc;
     use super::{OutputType, OutputTypes, Externs};
     use rustc_back::{PanicStrategy, RelroLevel};
     use syntax::symbol::Symbol;
@@ -1981,7 +1981,6 @@ fn mk_set<V: Ord>(entries: Vec<V>) -> BTreeSet<V> {
     // When the user supplies --test we should implicitly supply --cfg test
     #[test]
     fn test_switch_implies_cfg_test() {
-        let dep_graph = DepGraph::new(false);
         let matches =
             &match optgroups().parse(&["--test".to_string()]) {
               Ok(m) => m,
@@ -1989,7 +1988,7 @@ fn test_switch_implies_cfg_test() {
             };
         let registry = errors::registry::Registry::new(&[]);
         let (sessopts, cfg) = build_session_options_and_crate_config(matches);
-        let sess = build_session(sessopts, &dep_graph, None, registry, Rc::new(DummyCrateStore));
+        let sess = build_session(sessopts, None, registry);
         let cfg = build_configuration(&sess, cfg);
         assert!(cfg.contains(&(Symbol::intern("test"), None)));
     }
@@ -1998,7 +1997,6 @@ fn test_switch_implies_cfg_test() {
     // another --cfg test
     #[test]
     fn test_switch_implies_cfg_test_unless_cfg_test() {
-        let dep_graph = DepGraph::new(false);
         let matches =
             &match optgroups().parse(&["--test".to_string(), "--cfg=test".to_string()]) {
               Ok(m) => m,
@@ -2008,8 +2006,7 @@ fn test_switch_implies_cfg_test_unless_cfg_test() {
             };
         let registry = errors::registry::Registry::new(&[]);
         let (sessopts, cfg) = build_session_options_and_crate_config(matches);
-        let sess = build_session(sessopts, &dep_graph, None, registry,
-                                 Rc::new(DummyCrateStore));
+        let sess = build_session(sessopts, None, registry);
         let cfg = build_configuration(&sess, cfg);
         let mut test_items = cfg.iter().filter(|&&(name, _)| name == "test");
         assert!(test_items.next().is_some());
@@ -2018,15 +2015,13 @@ fn test_switch_implies_cfg_test_unless_cfg_test() {
 
     #[test]
     fn test_can_print_warnings() {
-        let dep_graph = DepGraph::new(false);
         {
             let matches = optgroups().parse(&[
                 "-Awarnings".to_string()
             ]).unwrap();
             let registry = errors::registry::Registry::new(&[]);
             let (sessopts, _) = build_session_options_and_crate_config(&matches);
-            let sess = build_session(sessopts, &dep_graph, None, registry,
-                                     Rc::new(DummyCrateStore));
+            let sess = build_session(sessopts, None, registry);
             assert!(!sess.diagnostic().can_emit_warnings);
         }
 
@@ -2037,8 +2032,7 @@ fn test_can_print_warnings() {
             ]).unwrap();
             let registry = errors::registry::Registry::new(&[]);
             let (sessopts, _) = build_session_options_and_crate_config(&matches);
-            let sess = build_session(sessopts, &dep_graph, None, registry,
-                                     Rc::new(DummyCrateStore));
+            let sess = build_session(sessopts, None, registry);
             assert!(sess.diagnostic().can_emit_warnings);
         }
 
@@ -2048,8 +2042,7 @@ fn test_can_print_warnings() {
             ]).unwrap();
             let registry = errors::registry::Registry::new(&[]);
             let (sessopts, _) = build_session_options_and_crate_config(&matches);
-            let sess = build_session(sessopts, &dep_graph, None, registry,
-                                     Rc::new(DummyCrateStore));
+            let sess = build_session(sessopts, None, registry);
             assert!(sess.diagnostic().can_emit_warnings);
         }
     }