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)]
"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],
}
};
- 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),
Config {
target,
- int_type,
- uint_type,
+ isize_ty,
+ usize_ty,
}
}
#[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;
// 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,
};
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)));
}
// 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,
};
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());
#[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);
}
]).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);
}
]).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);
}
}