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 12 pull requests #63588

Closed
wants to merge 40 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
5e6619e
Fix UWP build
mfkl Jul 31, 2019
54e268c
Fix README MSVC URI
mfkl Jul 31, 2019
6e4d023
Add UWP MSVC targets
mfkl Jul 31, 2019
3c6f6f0
Fix tidy checks
mfkl Jul 31, 2019
e3d8b68
review feedback: find lib root path from registry
mfkl Aug 5, 2019
89044a9
move store lib probing code to librustc_codegen_ssa
mfkl Aug 7, 2019
30fcd50
rustc_target: add n64 musl targets for MIPS64 arches
xen0n Jul 28, 2019
af1e668
Add initial files for iOS catalyst / macabi support
terhechte Aug 11, 2019
c9da160
review feedback: move uwp link code to get_linker
mfkl Aug 9, 2019
c037597
Remove redundant `ty` fields from `mir::Constant` and `hair::pattern:…
eddyb Aug 12, 2019
2882bee
rustc_mir: add sanity asserts for the types of `ty::Const`s.
eddyb Aug 12, 2019
22127b1
rustc_mir: use the right type for associated const literals.
eddyb Aug 12, 2019
d30f481
Fix indentation nit in src/librustc/mir/mod.rs.
eddyb Aug 12, 2019
1581c43
review feedback: add comments and use local flavor variable
mfkl Aug 13, 2019
417f9ea
Utilize -Zbinary-dep-depinfo for dependency tracking
Mark-Simulacrum Aug 11, 2019
c1758d5
rustc_codegen_utils: account for 1-indexed anonymous lifetimes in v0 …
eddyb Aug 14, 2019
ed7317c
remove unused Level::PhaseFatal
matklad Aug 14, 2019
e5017de
Test HRTB issue accepted by compiler
meffij Aug 14, 2019
5b88fba
Check FnHeader not to cause ICE
JohnTitor Aug 15, 2019
66dc08a
Make sure that all file loading happens via SourceMap
matklad Aug 13, 2019
14bc998
Add regression test for include_str! normalization
matklad Aug 15, 2019
29b5ebf
Use a match guard to avoid code repetition
JohnTitor Aug 15, 2019
e688352
Adjust regression test
JohnTitor Aug 15, 2019
7adb20e
Use is_const()
JohnTitor Aug 15, 2019
73d2da0
Remove `Spanned` from `mk_name_value_item_str` and `expr_to_spanned_s…
petrochenkov Aug 14, 2019
433b1e3
Remove `Spanned` from `ast::Mac`
petrochenkov Aug 14, 2019
6e8639a
Remove uses of `mem::uninitialized()` from cloudabi
tesuji Aug 14, 2019
a618271
Remove `Spanned` from `{ast,hir}::FieldPat`
petrochenkov Aug 14, 2019
bb36b9d
Rollup merge of #63155 - mfkl:uwp-msvc, r=alexcrichton
Centril Aug 15, 2019
fa9670d
Rollup merge of #63165 - xen0n:mips64-musl-targets, r=alexcrichton
Centril Aug 15, 2019
44b581e
Rollup merge of #63467 - terhechte:support-ios-catalyst-macabi-target…
Centril Aug 15, 2019
677edc3
Rollup merge of #63470 - Mark-Simulacrum:rustc-depdep, r=alexcrichton
Centril Aug 15, 2019
7ff5b38
Rollup merge of #63495 - eddyb:mir-constant-ty, r=oli-obk
Centril Aug 15, 2019
ce4a45d
Rollup merge of #63525 - matklad:centraliza-file-loading, r=petrochenkov
Centril Aug 15, 2019
87e3393
Rollup merge of #63546 - lzutao:clouldabi-maybeuninit, r=RalfJung
Centril Aug 15, 2019
5d0b7b6
Rollup merge of #63559 - eddyb:v0-mangling-off-by-1, r=estebank
Centril Aug 15, 2019
9d2ebc2
Rollup merge of #63572 - matklad:no-phase-fatal, r=estebank
Centril Aug 15, 2019
8576227
Rollup merge of #63577 - meffij:test-hrtb, r=alexcrichton
Centril Aug 15, 2019
3815c5d
Rollup merge of #63582 - JohnTitor:fix-ice-63226, r=oli-obk
Centril Aug 15, 2019
432e886
Rollup merge of #63586 - petrochenkov:nospanned, r=eddyb
Centril Aug 15, 2019
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ then you may need to force rustbuild to use an older version. This can be done
by manually calling the appropriate vcvars file before running the bootstrap.

```batch
> CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliary\Build\vcvars64.bat"
> CALL "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64.bat"
> python x.py build
```

Expand Down
87 changes: 22 additions & 65 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -754,76 +754,20 @@ impl<'a> Builder<'a> {
let mut cargo = Command::new(&self.initial_cargo);
let out_dir = self.stage_out(compiler, mode);

// command specific path, we call clear_if_dirty with this
let mut my_out = match cmd {
"build" => self.cargo_out(compiler, mode, target),

// This is the intended out directory for crate documentation.
"doc" | "rustdoc" => self.crate_doc_out(target),

_ => self.stage_out(compiler, mode),
};

// This is for the original compiler, but if we're forced to use stage 1, then
// std/test/rustc stamps won't exist in stage 2, so we need to get those from stage 1, since
// we copy the libs forward.
let cmp = self.compiler_for(compiler.stage, compiler.host, target);

let libstd_stamp = match cmd {
"check" | "clippy" | "fix" => check::libstd_stamp(self, cmp, target),
_ => compile::libstd_stamp(self, cmp, target),
};

let libtest_stamp = match cmd {
"check" | "clippy" | "fix" => check::libtest_stamp(self, cmp, target),
_ => compile::libtest_stamp(self, cmp, target),
};

let librustc_stamp = match cmd {
"check" | "clippy" | "fix" => check::librustc_stamp(self, cmp, target),
_ => compile::librustc_stamp(self, cmp, target),
};
// Codegen backends are not yet tracked by -Zbinary-dep-depinfo,
// so we need to explicitly clear out if they've been updated.
for backend in self.codegen_backends(compiler) {
self.clear_if_dirty(&out_dir, &backend);
}

if cmd == "doc" || cmd == "rustdoc" {
if mode == Mode::Rustc || mode == Mode::ToolRustc || mode == Mode::Codegen {
let my_out = match mode {
// This is the intended out directory for compiler documentation.
my_out = self.compiler_doc_out(target);
}
Mode::Rustc | Mode::ToolRustc | Mode::Codegen => self.compiler_doc_out(target),
_ => self.crate_doc_out(target),
};
let rustdoc = self.rustdoc(compiler);
self.clear_if_dirty(&my_out, &rustdoc);
} else if cmd != "test" {
match mode {
Mode::Std => {
self.clear_if_dirty(&my_out, &self.rustc(compiler));
for backend in self.codegen_backends(compiler) {
self.clear_if_dirty(&my_out, &backend);
}
},
Mode::Test => {
self.clear_if_dirty(&my_out, &libstd_stamp);
},
Mode::Rustc => {
self.clear_if_dirty(&my_out, &self.rustc(compiler));
self.clear_if_dirty(&my_out, &libstd_stamp);
self.clear_if_dirty(&my_out, &libtest_stamp);
},
Mode::Codegen => {
self.clear_if_dirty(&my_out, &librustc_stamp);
},
Mode::ToolBootstrap => { },
Mode::ToolStd => {
self.clear_if_dirty(&my_out, &libstd_stamp);
},
Mode::ToolTest => {
self.clear_if_dirty(&my_out, &libstd_stamp);
self.clear_if_dirty(&my_out, &libtest_stamp);
},
Mode::ToolRustc => {
self.clear_if_dirty(&my_out, &libstd_stamp);
self.clear_if_dirty(&my_out, &libtest_stamp);
self.clear_if_dirty(&my_out, &librustc_stamp);
},
}
}

cargo
Expand Down Expand Up @@ -861,6 +805,19 @@ impl<'a> Builder<'a> {
},
}

// This tells Cargo (and in turn, rustc) to output more complete
// dependency information. Most importantly for rustbuild, this
// includes sysroot artifacts, like libstd, which means that we don't
// need to track those in rustbuild (an error prone process!). This
// feature is currently unstable as there may be some bugs and such, but
// it represents a big improvement in rustbuild's reliability on
// rebuilds, so we're using it here.
//
// For some additional context, see #63470 (the PR originally adding
// this), as well as #63012 which is the tracking issue for this
// feature on the rustc side.
cargo.arg("-Zbinary-dep-depinfo");

cargo.arg("-j").arg(self.jobs().to_string());
// Remove make-related flags to ensure Cargo can correctly set things up
cargo.env_remove("MAKEFLAGS");
Expand Down
1 change: 0 additions & 1 deletion src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ impl Step for Rustdoc {
let libdir = builder.sysroot_libdir(compiler, target);
let hostdir = builder.sysroot_libdir(compiler, compiler.host);
add_to_sysroot(&builder, &libdir, &hostdir, &rustdoc_stamp(builder, compiler, target));
builder.cargo(compiler, Mode::ToolRustc, target, "clean");
}
}

Expand Down
35 changes: 1 addition & 34 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use std::path::{Path, PathBuf};
use std::process::{Command, Stdio, exit};
use std::str;

use build_helper::{output, mtime, t, up_to_date};
use build_helper::{output, t, up_to_date};
use filetime::FileTime;
use serde::Deserialize;
use serde_json;
Expand Down Expand Up @@ -274,8 +274,6 @@ impl Step for StdLink {
// for reason why the sanitizers are not built in stage0.
copy_apple_sanitizer_dylibs(builder, &builder.native_dir(target), "osx", &libdir);
}

builder.cargo(target_compiler, Mode::ToolStd, target, "clean");
}
}

Expand Down Expand Up @@ -480,8 +478,6 @@ impl Step for TestLink {
&builder.sysroot_libdir(target_compiler, compiler.host),
&libtest_stamp(builder, compiler, target)
);

builder.cargo(target_compiler, Mode::ToolTest, target, "clean");
}
}

Expand Down Expand Up @@ -639,7 +635,6 @@ impl Step for RustcLink {
&builder.sysroot_libdir(target_compiler, compiler.host),
&librustc_stamp(builder, compiler, target)
);
builder.cargo(target_compiler, Mode::ToolRustc, target, "clean");
}
}

Expand Down Expand Up @@ -1202,41 +1197,13 @@ pub fn run_cargo(builder: &Builder<'_>,
deps.push((path_to_add.into(), false));
}

// Now we want to update the contents of the stamp file, if necessary. First
// we read off the previous contents along with its mtime. If our new
// contents (the list of files to copy) is different or if any dep's mtime
// is newer then we rewrite the stamp file.
deps.sort();
let stamp_contents = fs::read(stamp);
let stamp_mtime = mtime(&stamp);
let mut new_contents = Vec::new();
let mut max = None;
let mut max_path = None;
for (dep, proc_macro) in deps.iter() {
let mtime = mtime(dep);
if Some(mtime) > max {
max = Some(mtime);
max_path = Some(dep.clone());
}
new_contents.extend(if *proc_macro { b"h" } else { b"t" });
new_contents.extend(dep.to_str().unwrap().as_bytes());
new_contents.extend(b"\0");
}
let max = max.unwrap();
let max_path = max_path.unwrap();
let contents_equal = stamp_contents
.map(|contents| contents == new_contents)
.unwrap_or_default();
if contents_equal && max <= stamp_mtime {
builder.verbose(&format!("not updating {:?}; contents equal and {:?} <= {:?}",
stamp, max, stamp_mtime));
return deps.into_iter().map(|(d, _)| d).collect()
}
if max > stamp_mtime {
builder.verbose(&format!("updating {:?} as {:?} changed", stamp, max_path));
} else {
builder.verbose(&format!("updating {:?} as deps changed", stamp));
}
t!(fs::write(&stamp, &new_contents));
deps.into_iter().map(|(d, _)| d).collect()
}
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/cfg/construct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ impl<'a, 'tcx> CFGBuilder<'a, 'tcx> {
}

PatKind::Struct(_, ref subpats, _) => {
let pats_exit = self.pats_all(subpats.iter().map(|f| &f.node.pat), pred);
let pats_exit = self.pats_all(subpats.iter().map(|f| &f.pat), pred);
self.add_ast_node(pat.hir_id.local_id, &[pats_exit])
}

Expand Down
6 changes: 3 additions & 3 deletions src/librustc/hir/intravisit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -704,9 +704,9 @@ pub fn walk_pat<'v, V: Visitor<'v>>(visitor: &mut V, pattern: &'v Pat) {
PatKind::Struct(ref qpath, ref fields, _) => {
visitor.visit_qpath(qpath, pattern.hir_id, pattern.span);
for field in fields {
visitor.visit_id(field.node.hir_id);
visitor.visit_ident(field.node.ident);
visitor.visit_pat(&field.node.pat)
visitor.visit_id(field.hir_id);
visitor.visit_ident(field.ident);
visitor.visit_pat(&field.pat)
}
}
PatKind::Tuple(ref tuple_elements, _) => {
Expand Down
16 changes: 6 additions & 10 deletions src/librustc/hir/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2691,16 +2691,12 @@ impl<'a> LoweringContext<'a> {

let fs = fields
.iter()
.map(|f| {
Spanned {
span: f.span,
node: hir::FieldPat {
hir_id: self.next_id(),
ident: f.node.ident,
pat: self.lower_pat(&f.node.pat),
is_shorthand: f.node.is_shorthand,
},
}
.map(|f| hir::FieldPat {
hir_id: self.next_id(),
ident: f.ident,
pat: self.lower_pat(&f.pat),
is_shorthand: f.is_shorthand,
span: f.span,
})
.collect();
hir::PatKind::Struct(qpath, fs, etc)
Expand Down
5 changes: 3 additions & 2 deletions src/librustc/hir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ impl Pat {
match self.node {
PatKind::Binding(.., Some(ref p)) => p.walk_(it),
PatKind::Struct(_, ref fields, _) => {
fields.iter().all(|field| field.node.pat.walk_(it))
fields.iter().all(|field| field.pat.walk_(it))
}
PatKind::TupleStruct(_, ref s, _) | PatKind::Tuple(ref s, _) => {
s.iter().all(|p| p.walk_(it))
Expand Down Expand Up @@ -923,6 +923,7 @@ pub struct FieldPat {
/// The pattern the field is destructured to.
pub pat: P<Pat>,
pub is_shorthand: bool,
pub span: Span,
}

/// Explicit binding annotations given in the HIR for a binding. Note
Expand Down Expand Up @@ -968,7 +969,7 @@ pub enum PatKind {

/// A struct or struct variant pattern (e.g., `Variant {x, y, ..}`).
/// The `bool` is `true` in the presence of a `..`.
Struct(QPath, HirVec<Spanned<FieldPat>>, bool),
Struct(QPath, HirVec<FieldPat>, bool),

/// A tuple struct/variant pattern `Variant(x, y, .., z)`.
/// If the `..` pattern fragment is present, then `Option<usize>` denotes its position.
Expand Down
8 changes: 4 additions & 4 deletions src/librustc/hir/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1670,14 +1670,14 @@ impl<'a> State<'a> {
&fields[..],
|s, f| {
s.cbox(INDENT_UNIT);
if !f.node.is_shorthand {
s.print_ident(f.node.ident);
if !f.is_shorthand {
s.print_ident(f.ident);
s.word_nbsp(":");
}
s.print_pat(&f.node.pat);
s.print_pat(&f.pat);
s.end()
},
|f| f.node.pat.span);
|f| f.pat.span);
if etc {
if !fields.is_empty() {
self.word_space(",");
Expand Down
4 changes: 0 additions & 4 deletions src/librustc/ich/impls_hir.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,8 +153,6 @@ impl<'a> HashStable<StableHashingContext<'a>> for hir::Ty {
}
}

impl_stable_hash_for_spanned!(hir::FieldPat);

impl_stable_hash_for_spanned!(hir::BinOpKind);

impl_stable_hash_for!(struct hir::Stmt {
Expand Down Expand Up @@ -187,8 +185,6 @@ impl<'a> HashStable<StableHashingContext<'a>> for hir::Expr {

impl_stable_hash_for_spanned!(usize);

impl_stable_hash_for_spanned!(ast::Ident);

impl_stable_hash_for!(struct ast::Ident {
name,
span,
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/lint/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1345,7 +1345,7 @@ impl<'a, T: EarlyLintPass> ast_visit::Visitor<'a> for EarlyContextAndPass<'a, T>
// part of `walk_mac`, and (b) we should be calling
// `visit_path`, *but* that would require a `NodeId`, and I
// want to get #53686 fixed quickly. -nmatsakis
ast_visit::walk_path(self, &mac.node.path);
ast_visit::walk_path(self, &mac.path);

run_early_pass!(self, check_mac, mac);
}
Expand Down
10 changes: 4 additions & 6 deletions src/librustc/middle/dead.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ use crate::util::nodemap::FxHashSet;

use rustc_data_structures::fx::FxHashMap;

use syntax::{ast, source_map};
use syntax::attr;
use syntax::{ast, attr};
use syntax::symbol::sym;
use syntax_pos;

Expand Down Expand Up @@ -119,17 +118,16 @@ impl<'a, 'tcx> MarkSymbolVisitor<'a, 'tcx> {
}
}

fn handle_field_pattern_match(&mut self, lhs: &hir::Pat, res: Res,
pats: &[source_map::Spanned<hir::FieldPat>]) {
fn handle_field_pattern_match(&mut self, lhs: &hir::Pat, res: Res, pats: &[hir::FieldPat]) {
let variant = match self.tables.node_type(lhs.hir_id).sty {
ty::Adt(adt, _) => adt.variant_of_res(res),
_ => span_bug!(lhs.span, "non-ADT in struct pattern")
};
for pat in pats {
if let PatKind::Wild = pat.node.pat.node {
if let PatKind::Wild = pat.pat.node {
continue;
}
let index = self.tcx.field_index(pat.node.hir_id, self.tables);
let index = self.tcx.field_index(pat.hir_id, self.tables);
self.insert_def_id(variant.fields[index].did);
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/middle/liveness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,8 +418,8 @@ fn add_from_pat<'tcx>(ir: &mut IrMaps<'tcx>, pat: &P<hir::Pat>) {
}
Struct(_, ref fields, _) => {
for field in fields {
if field.node.is_shorthand {
shorthand_field_ids.insert(field.node.pat.hir_id);
if field.is_shorthand {
shorthand_field_ids.insert(field.pat.hir_id);
}
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/librustc/middle/mem_categorization.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1282,11 +1282,11 @@ impl<'a, 'tcx> MemCategorizationContext<'a, 'tcx> {
};

for fp in field_pats {
let field_ty = self.pat_ty_adjusted(&fp.node.pat)?; // see (*2)
let f_index = self.tcx.field_index(fp.node.hir_id, self.tables);
let field_ty = self.pat_ty_adjusted(&fp.pat)?; // see (*2)
let f_index = self.tcx.field_index(fp.hir_id, self.tables);
let cmt_field = Rc::new(self.cat_field(pat, cmt.clone(), f_index,
fp.node.ident, field_ty));
self.cat_pattern_(cmt_field, &fp.node.pat, op)?;
fp.ident, field_ty));
self.cat_pattern_(cmt_field, &fp.pat, op)?;
}
}

Expand Down
8 changes: 8 additions & 0 deletions src/librustc/middle/reachable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ fn item_might_be_inlined(tcx: TyCtxt<'tcx>, item: &hir::Item, attrs: CodegenFnAt
}

match item.node {
hir::ItemKind::Fn(_, header, ..) if header.is_const() => {
return true;
}
hir::ItemKind::Impl(..) |
hir::ItemKind::Fn(..) => {
let generics = tcx.generics_of(tcx.hir().local_def_id(item.hir_id));
Expand All @@ -52,6 +55,11 @@ fn method_might_be_inlined(
if codegen_fn_attrs.requests_inline() || generics.requires_monomorphization(tcx) {
return true
}
if let hir::ImplItemKind::Method(method_sig, _) = &impl_item.node {
if method_sig.header.is_const() {
return true
}
}
if let Some(impl_hir_id) = tcx.hir().as_local_hir_id(impl_src) {
match tcx.hir().find(impl_hir_id) {
Some(Node::Item(item)) =>
Expand Down
Loading