Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rollup of 14 pull requests #47678

Merged
merged 33 commits into from
Jan 23, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
38ddb44
Check for deadlinks from the summary during book generation
est31 Jan 14, 2018
f4bcfc5
Fixes sparc64 cabi fixes.
psumbera Jan 18, 2018
af632bc
Removed uneeded change.
psumbera Jan 18, 2018
1203b3d
Removed uneeded argument to make_indirect.
psumbera Jan 18, 2018
66d53ca
Make liballoc_jemalloc work on CloudABI.
EdSchouten Jan 18, 2018
ebfa6c7
Change the --unpretty flag to -Z unpretty
mark-i-m Jan 15, 2018
db41f1e
Add rustc-args option to test runner
spastorino Jan 18, 2018
101f1e1
Add regression test for #29723
Manishearth Jan 18, 2018
2975955
s/foo/main/
nikomatsakis Jan 19, 2018
9d629c6
add ERROR annotation
nikomatsakis Jan 19, 2018
67f922b
fix line
nikomatsakis Jan 19, 2018
e2f6b28
Update DW_OP_plus to DW_OP_plus_uconst
cuviper Jan 20, 2018
e47cc69
Add testing coverage for assigning to immutable thread-locals.
EdSchouten Jan 20, 2018
643e71e
Remove the IGNORED_ATTR_NAMES thread local
Zoxc Dec 3, 2017
e1bffbd
Fix spurious warning on empty proc macro crates
etaoins Jan 22, 2018
c3fabce
Inline some rustc_driver function
bjorn3 Jan 22, 2018
90aef18
Add dynamic-drop test to nll tests also
spastorino Jan 22, 2018
7cc3cb2
Fix quoted search
GuillaumeGomez Jan 22, 2018
04a8847
rustdoc: Show when traits are auto traits
ollie27 Jan 23, 2018
116fb72
Rollup merge of #47423 - est31:rustbook_checking, r=alexcrichton
kennytm Jan 23, 2018
0c9b3ec
Rollup merge of #47425 - EdSchouten:immutable-tls, r=nikomatsakis
kennytm Jan 23, 2018
150f2ba
Rollup merge of #47440 - mark-i-m:zunpretty, r=nikomatsakis
kennytm Jan 23, 2018
82981a7
Rollup merge of #47541 - psumbera:master, r=eddyb
kennytm Jan 23, 2018
658ccae
Rollup merge of #47549 - Manishearth:29723-regression, r=nikomatsakis
kennytm Jan 23, 2018
60b987d
Rollup merge of #47554 - EdSchouten:cloudabi-jemalloc, r=nikomatsakis
kennytm Jan 23, 2018
52f8d2d
Rollup merge of #47558 - spastorino:rustc_args, r=nikomatsakis
kennytm Jan 23, 2018
cb0a8bf
Rollup merge of #47610 - cuviper:captured-dwarf, r=eddyb
kennytm Jan 23, 2018
9d26a25
Rollup merge of #47635 - Zoxc:remove-attr, r=michaelwoerister
kennytm Jan 23, 2018
117eb68
Rollup merge of #47655 - etaoins:fix-spurious-warning-on-empty-proc-m…
kennytm Jan 23, 2018
6dcaa0a
Rollup merge of #47661 - bjorn3:refactor_driver, r=michaelwoerister
kennytm Jan 23, 2018
4cc2f96
Rollup merge of #47662 - spastorino:add_test_to_nll, r=nikomatsakis
kennytm Jan 23, 2018
9735864
Rollup merge of #47667 - GuillaumeGomez:fix-quoted-search, r=QuietMis…
kennytm Jan 23, 2018
9707b31
Rollup merge of #47672 - ollie27:rustdoc_auto_traits, r=GuillaumeGomez
kennytm Jan 23, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -792,6 +792,7 @@ impl Step for Compiletest {
flags.push("-g".to_string());
}
flags.push("-Zmiri -Zunstable-options".to_string());
flags.push(build.config.cmd.rustc_args().join(" "));

if let Some(linker) = build.linker(target) {
cmd.arg("--linker").arg(linker);
Expand Down
17 changes: 17 additions & 0 deletions src/bootstrap/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ pub enum Subcommand {
Test {
paths: Vec<PathBuf>,
test_args: Vec<String>,
rustc_args: Vec<String>,
fail_fast: bool,
},
Bench {
Expand Down Expand Up @@ -150,6 +151,12 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`");
"test" => {
opts.optflag("", "no-fail-fast", "Run all tests regardless of failure");
opts.optmulti("", "test-args", "extra arguments", "ARGS");
opts.optmulti(
"",
"rustc-args",
"extra options to pass the compiler when running tests",
"ARGS",
);
},
"bench" => { opts.optmulti("", "test-args", "extra arguments", "ARGS"); },
"clean" => { opts.optflag("", "all", "clean all build artifacts"); },
Expand Down Expand Up @@ -283,6 +290,7 @@ Arguments:
Subcommand::Test {
paths,
test_args: matches.opt_strs("test-args"),
rustc_args: matches.opt_strs("rustc-args"),
fail_fast: !matches.opt_present("no-fail-fast"),
}
}
Expand Down Expand Up @@ -362,6 +370,15 @@ impl Subcommand {
}
}

pub fn rustc_args(&self) -> Vec<&str> {
match *self {
Subcommand::Test { ref rustc_args, .. } => {
rustc_args.iter().flat_map(|s| s.split_whitespace()).collect()
}
_ => Vec::new(),
}
}

pub fn fail_fast(&self) -> bool {
match *self {
Subcommand::Test { fail_fast, .. } => fail_fast,
Expand Down
13 changes: 10 additions & 3 deletions src/liballoc_jemalloc/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,20 @@ fn main() {
// for targets like emscripten, even if we don't use it.
let target = env::var("TARGET").expect("TARGET was not set");
let host = env::var("HOST").expect("HOST was not set");
if target.contains("bitrig") || target.contains("cloudabi") || target.contains("emscripten") ||
target.contains("fuchsia") || target.contains("msvc") || target.contains("openbsd") ||
target.contains("redox") || target.contains("rumprun") || target.contains("wasm32") {
if target.contains("bitrig") || target.contains("emscripten") || target.contains("fuchsia") ||
target.contains("msvc") || target.contains("openbsd") || target.contains("redox") ||
target.contains("rumprun") || target.contains("wasm32") {
println!("cargo:rustc-cfg=dummy_jemalloc");
return;
}

// CloudABI ships with a copy of jemalloc that has been patched to
// work well with sandboxing. Don't attempt to build our own copy,
// as it won't build.
if target.contains("cloudabi") {
return;
}

if target.contains("android") {
println!("cargo:rustc-link-lib=gcc");
} else if !target.contains("windows") && !target.contains("musl") {
Expand Down
21 changes: 6 additions & 15 deletions src/librustc/ich/hcx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ use session::Session;

use std::cmp::Ord;
use std::hash as std_hash;
use std::cell::RefCell;
use std::collections::HashMap;
use std::cell::RefCell;

use syntax::ast;

Expand All @@ -36,8 +36,10 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHashingContextProvi
use rustc_data_structures::accumulate_vec::AccumulateVec;
use rustc_data_structures::fx::{FxHashSet, FxHashMap};

thread_local!(static IGNORED_ATTR_NAMES: RefCell<FxHashSet<Symbol>> =
RefCell::new(FxHashSet()));
pub fn compute_ignored_attr_names() -> FxHashSet<Symbol> {
debug_assert!(ich::IGNORED_ATTRIBUTES.len() > 0);
ich::IGNORED_ATTRIBUTES.iter().map(|&s| Symbol::intern(s)).collect()
}

/// This is the context state available during incr. comp. hashing. It contains
/// enough information to transform DefIds and HirIds into stable DefPaths (i.e.
Expand Down Expand Up @@ -90,15 +92,6 @@ impl<'gcx> StableHashingContext<'gcx> {
-> Self {
let hash_spans_initial = !sess.opts.debugging_opts.incremental_ignore_spans;

debug_assert!(ich::IGNORED_ATTRIBUTES.len() > 0);
IGNORED_ATTR_NAMES.with(|names| {
let mut names = names.borrow_mut();
if names.is_empty() {
names.extend(ich::IGNORED_ATTRIBUTES.iter()
.map(|&s| Symbol::intern(s)));
}
});

StableHashingContext {
sess,
body_resolver: BodyResolver(krate),
Expand Down Expand Up @@ -186,9 +179,7 @@ impl<'gcx> StableHashingContext<'gcx> {

#[inline]
pub fn is_ignored_attr(&self, name: Symbol) -> bool {
IGNORED_ATTR_NAMES.with(|names| {
names.borrow().contains(&name)
})
self.sess.ignored_attr_names.contains(&name)
}

pub fn hash_hir_item_like<F: FnOnce(&mut Self)>(&mut self, f: F) {
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ich/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
pub use self::fingerprint::Fingerprint;
pub use self::caching_codemap_view::CachingCodemapView;
pub use self::hcx::{StableHashingContext, NodeIdHashingMode,
hash_stable_trait_impls};
hash_stable_trait_impls, compute_ignored_attr_names};
mod fingerprint;
mod caching_codemap_view;
mod hcx;
Expand Down
36 changes: 24 additions & 12 deletions src/librustc/session/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -778,6 +778,8 @@ macro_rules! options {
Some(::rustc_back::LinkerFlavor::one_of());
pub const parse_optimization_fuel: Option<&'static str> =
Some("crate=integer");
pub const parse_unpretty: Option<&'static str> =
Some("`string` or `string=string`");
}

#[allow(dead_code)]
Expand Down Expand Up @@ -965,6 +967,17 @@ macro_rules! options {
}
}
}

fn parse_unpretty(slot: &mut Option<String>, v: Option<&str>) -> bool {
match v {
None => false,
Some(s) if s.split('=').count() <= 2 => {
*slot = Some(s.to_string());
true
}
_ => false,
}
}
}
) }

Expand Down Expand Up @@ -1104,13 +1117,13 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
"write syntax and type analysis (in JSON format) information, in \
addition to normal output"),
flowgraph_print_loans: bool = (false, parse_bool, [UNTRACKED],
"include loan analysis data in --unpretty flowgraph output"),
"include loan analysis data in -Z unpretty flowgraph output"),
flowgraph_print_moves: bool = (false, parse_bool, [UNTRACKED],
"include move analysis data in --unpretty flowgraph output"),
"include move analysis data in -Z unpretty flowgraph output"),
flowgraph_print_assigns: bool = (false, parse_bool, [UNTRACKED],
"include assignment analysis data in --unpretty flowgraph output"),
"include assignment analysis data in -Z unpretty flowgraph output"),
flowgraph_print_all: bool = (false, parse_bool, [UNTRACKED],
"include all dataflow analysis data in --unpretty flowgraph output"),
"include all dataflow analysis data in -Z unpretty flowgraph output"),
print_region_graph: bool = (false, parse_bool, [UNTRACKED],
"prints region inference graph. \
Use with RUST_REGION_GRAPH=help for more info"),
Expand Down Expand Up @@ -1241,6 +1254,13 @@ options! {DebuggingOptions, DebuggingSetter, basic_debugging_options,
dep_info_omit_d_target: bool = (false, parse_bool, [TRACKED],
"in dep-info output, omit targets for tracking dependencies of the dep-info files \
themselves"),
unpretty: Option<String> = (None, parse_unpretty, [UNTRACKED],
"Present the input source, unstable (and less-pretty) variants;
valid types are any of the types for `--pretty`, as well as:
`flowgraph=<nodeid>` (graphviz formatted flowgraph for node),
`everybody_loops` (all function bodies replaced with `loop {}`),
`hir` (the HIR), `hir,identified`, or
`hir,typed` (HIR with types for each node)."),
}

pub fn default_lib_output() -> CrateType {
Expand Down Expand Up @@ -1514,14 +1534,6 @@ pub fn rustc_optgroups() -> Vec<RustcOptGroup> {
`expanded` (crates expanded), or
`expanded,identified` (fully parenthesized, AST nodes with IDs).",
"TYPE"),
opt::opt("", "unpretty",
"Present the input source, unstable (and less-pretty) variants;
valid types are any of the types for `--pretty`, as well as:
`flowgraph=<nodeid>` (graphviz formatted flowgraph for node),
`everybody_loops` (all function bodies replaced with `loop {}`),
`hir` (the HIR), `hir,identified`, or
`hir,typed` (HIR with types for each node).",
"TYPE"),
]);
opts
}
Expand Down
6 changes: 6 additions & 0 deletions src/librustc/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ pub use self::code_stats::{SizeKind, TypeSizeInfo, VariantInfo};
use hir::def_id::CrateNum;
use ich::Fingerprint;

use ich;
use lint;
use middle::allocator::AllocatorKind;
use middle::dependency_format;
Expand All @@ -28,6 +29,7 @@ use errors::{self, DiagnosticBuilder, DiagnosticId};
use errors::emitter::{Emitter, EmitterWriter};
use syntax::json::JsonEmitter;
use syntax::feature_gate;
use syntax::symbol::Symbol;
use syntax::parse;
use syntax::parse::ParseSess;
use syntax::{ast, codemap};
Expand Down Expand Up @@ -112,6 +114,9 @@ pub struct Session {

incr_comp_session: RefCell<IncrCompSession>,

/// A cache of attributes ignored by StableHashingContext
pub ignored_attr_names: FxHashSet<Symbol>,

/// Some measurements that are being gathered during compilation.
pub perf_stats: PerfStats,

Expand Down Expand Up @@ -975,6 +980,7 @@ pub fn build_session_(sopts: config::Options,
injected_panic_runtime: Cell::new(None),
imported_macro_spans: RefCell::new(HashMap::new()),
incr_comp_session: RefCell::new(IncrCompSession::NotInitialized),
ignored_attr_names: ich::compute_ignored_attr_names(),
perf_stats: PerfStats {
svh_time: Cell::new(Duration::from_secs(0)),
incr_comp_hashes_time: Cell::new(Duration::from_secs(0)),
Expand Down
30 changes: 9 additions & 21 deletions src/librustc_driver/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,12 @@ use std::iter;
use std::path::{Path, PathBuf};
use std::rc::Rc;
use std::sync::mpsc;
use syntax::{ast, diagnostics, visit};
use syntax::attr;
use syntax::{self, ast, attr, diagnostics, visit};
use syntax::ext::base::ExtCtxt;
use syntax::fold::Folder;
use syntax::parse::{self, PResult};
use syntax::util::node_count::NodeCounter;
use syntax_pos::FileName;
use syntax;
use syntax_ext;

use derive_registrar;
Expand Down Expand Up @@ -274,10 +272,6 @@ pub fn compile_input(trans: Box<TransCrate>,
Ok(())
}

fn keep_hygiene_data(sess: &Session) -> bool {
sess.opts.debugging_opts.keep_hygiene_data
}

pub fn source_name(input: &Input) -> FileName {
match *input {
Input::File(ref ifile) => ifile.clone().into(),
Expand Down Expand Up @@ -851,7 +845,7 @@ pub fn phase_2_configure_and_expand<F>(sess: &Session,
|| lint::check_ast_crate(sess, &krate));

// Discard hygiene data, which isn't required after lowering to HIR.
if !keep_hygiene_data(sess) {
if !sess.opts.debugging_opts.keep_hygiene_data {
syntax::ext::hygiene::clear_markings();
}

Expand Down Expand Up @@ -915,18 +909,6 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(trans: &TransCrate,
mpsc::Receiver<Box<Any + Send>>,
CompileResult) -> R
{
macro_rules! try_with_f {
($e: expr, ($($t:tt)*)) => {
match $e {
Ok(x) => x,
Err(x) => {
f($($t)*, Err(x));
return Err(x);
}
}
}
}

let time_passes = sess.time_passes();

let query_result_on_disk_cache = time(time_passes,
Expand Down Expand Up @@ -987,7 +969,13 @@ pub fn phase_3_run_analysis_passes<'tcx, F, R>(trans: &TransCrate,
|| stability::check_unstable_api_usage(tcx));

// passes are timed inside typeck
try_with_f!(typeck::check_crate(tcx), (tcx, analysis, rx));
match typeck::check_crate(tcx) {
Ok(x) => x,
Err(x) => {
f(tcx, analysis, rx, Err(x));
return Err(x);
}
}

time(time_passes,
"const checking",
Expand Down
Loading