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 #52013

Closed
wants to merge 36 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
b4d64b7
Initialize LLVM's AMDGPU target machine, if available.
DiamondLovesYou Jun 14, 2018
7015dfd
Add read_exact_at and write_all_at methods to FileExt on unix
drrlvn Jun 26, 2018
011eaed
factor built-in attribute parsing into submodule
euclio Jun 30, 2018
f315943
move deprecation-sanity test to ui
euclio Jun 30, 2018
5468e12
add label to unknown meta item error
euclio Jun 30, 2018
de2ecea
Provide llvm-strip in llvm-tools component
crlf0710 Jul 1, 2018
e89db30
Do not suggest changes to str literal if it isn't one
estebank Jul 2, 2018
6e5b9c1
Get rid of `TyImplTraitExistential`
oli-obk Jun 29, 2018
75a6fde
Update rustdoc
oli-obk Jul 2, 2018
3779a4c
Emit column info in debuginfo for non msvc like targets
est31 Jul 2, 2018
79d8d08
incr.comp.: Take names of children into account when computing the IC…
michaelwoerister Jul 2, 2018
73166f7
Fill in tracking issue number for read_exact_at/write_all_at
drrlvn Jul 2, 2018
59f2edb
add outlives annotations to `BTreeMap`
nikomatsakis Feb 20, 2018
ddc1d29
bootstrap: tests should use rustc from config.toml
mnd Jul 1, 2018
29851ba
add entry for cargo-metadata feature to RELEASES
euclio Jul 2, 2018
9797665
Make Stdio handle UnwindSafe
estk Jul 1, 2018
f5570d0
Make explicit that assemble is not run from CLI
Mark-Simulacrum Jul 2, 2018
d914574
Fix the tool's path in toolstate verification.
kennytm Jul 2, 2018
20231d7
Fixed detection of test-fail for doctests.
kennytm Jul 2, 2018
689cffa
Run "tools" job on PR when commit message starts with "Update RLS/mir…
kennytm Jul 2, 2018
9eda4aa
Change --keep-stage to apply more
Mark-Simulacrum Jul 2, 2018
447f1f3
Avoid sorting the item_ids array the StableHash impl of hir::Mod.
michaelwoerister Jul 3, 2018
f1c7255
Rollup merge of #51548 - DiamondLovesYou:amdgpu-target-machine, r=ale…
pietroalbini Jul 3, 2018
80016fd
Rollup merge of #51809 - drrlvn:rw_exact_all_at, r=alexcrichton
pietroalbini Jul 3, 2018
f678fac
Rollup merge of #51914 - nikomatsakis:nll-fix-issue-issue-btreemap-an…
pietroalbini Jul 3, 2018
855436f
Rollup merge of #51958 - euclio:attr-refactor, r=petrochenkov
pietroalbini Jul 3, 2018
33b065d
Rollup merge of #51962 - crlf0710:patch-2, r=alexcrichton
pietroalbini Jul 3, 2018
ce8f206
Rollup merge of #51973 - estk:master, r=abonander
pietroalbini Jul 3, 2018
bed04c1
Rollup merge of #51977 - mnd:fix-bootstrap-test-with-local-stage0, r=…
pietroalbini Jul 3, 2018
2c2ab84
Rollup merge of #51978 - estebank:issue-48364, r=oli-obk
pietroalbini Jul 3, 2018
fe668b9
Rollup merge of #51979 - oli-obk:lowering_cleanups4, r=nikomatsakis
pietroalbini Jul 3, 2018
c7a0996
Rollup merge of #51980 - est31:columns, r=alexcrichton
pietroalbini Jul 3, 2018
2346398
Rollup merge of #51982 - michaelwoerister:hash-modules-properly, r=ni…
pietroalbini Jul 3, 2018
ef356d6
Rollup merge of #51997 - euclio:release-notes, r=Aaronepower
pietroalbini Jul 3, 2018
09ba8fb
Rollup merge of #52004 - kennytm:toolstate-fixes, r=Mark-Simulacrum
pietroalbini Jul 3, 2018
59931c6
Rollup merge of #52006 - Mark-Simulacrum:keep-stage-fix, r=alexcrichton
pietroalbini Jul 3, 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
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ matrix:
- env: IMAGE=x86_64-gnu-aux
if: branch = auto
- env: IMAGE=x86_64-gnu-tools
if: branch = auto
if: branch = auto OR (type = pull_request AND commit_message =~ /(?i:^update.*\b(rls|rustfmt|clippy|miri)\b)/)
- env: IMAGE=x86_64-gnu-debug
if: branch = auto
- env: IMAGE=x86_64-gnu-nopt
Expand Down
2 changes: 2 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Cargo
-----
- [`cargo-metadata` now includes `authors`, `categories`, `keywords`,
`readme`, and `repository` fields.][cargo/5386]
- [`cargo-metadata` now includes a package's `metadata` table.][cargo/5360]
- [Added the `--target-dir` optional argument.][cargo/5393] This allows you to specify
a different directory than `target` for placing compilation artifacts.
- [Cargo will be adding automatic target inference for binaries, benchmarks,
Expand Down Expand Up @@ -114,6 +115,7 @@ Compatibility Notes
[cargo/5203]: https://github.com/rust-lang/cargo/pull/5203/
[cargo/5335]: https://github.com/rust-lang/cargo/pull/5335/
[cargo/5359]: https://github.com/rust-lang/cargo/pull/5359/
[cargo/5360]: https://github.com/rust-lang/cargo/pull/5360/
[cargo/5386]: https://github.com/rust-lang/cargo/pull/5386/
[cargo/5393]: https://github.com/rust-lang/cargo/pull/5393/
[`DoubleEndedIterator::rfind`]: https://doc.rust-lang.org/std/iter/trait.DoubleEndedIterator.html#method.rfind
Expand Down
2 changes: 2 additions & 0 deletions src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,8 @@ def bootstrap(help_triggered):
env["BOOTSTRAP_PYTHON"] = sys.executable
env["BUILD_DIR"] = build.build_dir
env["RUSTC_BOOTSTRAP"] = '1'
env["CARGO"] = build.cargo()
env["RUSTC"] = build.rustc()
run(args, env=env, verbose=build.verbose)


Expand Down
65 changes: 44 additions & 21 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ use std::io::prelude::*;
use std::path::{Path, PathBuf};
use std::process::{Command, Stdio};
use std::str;
use std::cmp::min;

use build_helper::{output, mtime, up_to_date};
use filetime::FileTime;
Expand Down Expand Up @@ -68,6 +67,18 @@ impl Step for Std {
let target = self.target;
let compiler = self.compiler;

if let Some(keep_stage) = builder.config.keep_stage {
if keep_stage <= compiler.stage {
println!("Warning: Using a potentially old libstd. This may not behave well.");
builder.ensure(StdLink {
compiler: compiler,
target_compiler: compiler,
target,
});
return;
}
}

builder.ensure(StartupObjects { compiler, target });

if builder.force_use_stage1(compiler, target) {
Expand Down Expand Up @@ -351,6 +362,18 @@ impl Step for Test {
let target = self.target;
let compiler = self.compiler;

if let Some(keep_stage) = builder.config.keep_stage {
if keep_stage <= compiler.stage {
println!("Warning: Using a potentially old libtest. This may not behave well.");
builder.ensure(TestLink {
compiler: compiler,
target_compiler: compiler,
target,
});
return;
}
}

builder.ensure(Std { compiler, target });

if builder.force_use_stage1(compiler, target) {
Expand Down Expand Up @@ -467,6 +490,18 @@ impl Step for Rustc {
let compiler = self.compiler;
let target = self.target;

if let Some(keep_stage) = builder.config.keep_stage {
if keep_stage <= compiler.stage {
println!("Warning: Using a potentially old librustc. This may not behave well.");
builder.ensure(RustcLink {
compiler: compiler,
target_compiler: compiler,
target,
});
return;
}
}

builder.ensure(Test { compiler, target });

if builder.force_use_stage1(compiler, target) {
Expand Down Expand Up @@ -873,7 +908,7 @@ impl Step for Assemble {
type Output = Compiler;

fn should_run(run: ShouldRun) -> ShouldRun {
run.all_krates("rustc-main")
run.never()
}

/// Prepare a new compiler from the artifacts in `stage`
Expand Down Expand Up @@ -915,28 +950,16 @@ impl Step for Assemble {
// link to these. (FIXME: Is that correct? It seems to be correct most
// of the time but I think we do link to these for stage2/bin compilers
// when not performing a full bootstrap).
if builder.config.keep_stage.map_or(false, |s| target_compiler.stage <= s) {
builder.verbose("skipping compilation of compiler due to --keep-stage");
let compiler = build_compiler;
for stage in 0..min(target_compiler.stage, builder.config.keep_stage.unwrap()) {
let target_compiler = builder.compiler(stage, target_compiler.host);
let target = target_compiler.host;
builder.ensure(StdLink { compiler, target_compiler, target });
builder.ensure(TestLink { compiler, target_compiler, target });
builder.ensure(RustcLink { compiler, target_compiler, target });
}
} else {
builder.ensure(Rustc {
builder.ensure(Rustc {
compiler: build_compiler,
target: target_compiler.host,
});
for &backend in builder.config.rust_codegen_backends.iter() {
builder.ensure(CodegenBackend {
compiler: build_compiler,
target: target_compiler.host,
backend,
});
for &backend in builder.config.rust_codegen_backends.iter() {
builder.ensure(CodegenBackend {
compiler: build_compiler,
target: target_compiler.host,
backend,
});
}
}

let lld_install = if builder.config.lld_enabled {
Expand Down
6 changes: 2 additions & 4 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ use std::cmp;

use num_cpus;
use toml;
use util::exe;
use cache::{INTERNER, Interned};
use flags::Flags;
pub use flags::Subcommand;
Expand Down Expand Up @@ -367,9 +366,8 @@ impl Config {
config.src = Config::path_from_python("SRC");
config.out = Config::path_from_python("BUILD_DIR");

let stage0_root = config.out.join(&config.build).join("stage0/bin");
config.initial_rustc = stage0_root.join(exe("rustc", &config.build));
config.initial_cargo = stage0_root.join(exe("cargo", &config.build));
config.initial_rustc = Config::path_from_python("RUSTC");
config.initial_cargo = Config::path_from_python("CARGO");

config
}
Expand Down
3 changes: 2 additions & 1 deletion src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,8 @@ const LLVM_TOOLS: &[&str] = &[
"llvm-objcopy", // used to transform ELFs into binary format which flashing tools consume
"llvm-objdump", // used to disassemble programs
"llvm-profdata", // used to inspect and merge files generated by profiles
"llvm-size", // prints the size of the linker sections of a program
"llvm-size", // used to prints the size of the linker sections of a program
"llvm-strip", // used to discard symbols from binary files to reduce their size
];

/// A structure representing a Rust compiler.
Expand Down
14 changes: 6 additions & 8 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1269,17 +1269,15 @@ impl Step for DocTest {

files.sort();

let mut toolstate = ToolState::TestPass;
for file in files {
let test_result = markdown_test(builder, compiler, &file);
if self.is_ext_doc {
let toolstate = if test_result {
ToolState::TestPass
} else {
ToolState::TestFail
};
builder.save_toolstate(self.name, toolstate);
if !markdown_test(builder, compiler, &file) {
toolstate = ToolState::TestFail;
}
}
if self.is_ext_doc {
builder.save_toolstate(self.name, toolstate);
}
}
}

Expand Down
8 changes: 4 additions & 4 deletions src/ci/docker/x86_64-gnu-tools/checktools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,11 @@ status_check() {
check_dispatch $1 beta nomicon src/doc/nomicon
check_dispatch $1 beta reference src/doc/reference
check_dispatch $1 beta rust-by-example src/doc/rust-by-example
check_dispatch $1 beta rls src/tool/rls
check_dispatch $1 beta rustfmt src/tool/rustfmt
check_dispatch $1 beta rls src/tools/rls
check_dispatch $1 beta rustfmt src/tools/rustfmt
# these tools are not required for beta to successfully branch
check_dispatch $1 nightly clippy-driver src/tool/clippy
check_dispatch $1 nightly miri src/tool/miri
check_dispatch $1 nightly clippy-driver src/tools/clippy
check_dispatch $1 nightly miri src/tools/miri
}

# If this PR is intended to update one of these tools, do not let the build pass
Expand Down
17 changes: 10 additions & 7 deletions src/liballoc/collections/btree/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,11 @@ unsafe impl<#[may_dangle] K, #[may_dangle] V> Drop for BTreeMap<K, V> {
#[stable(feature = "rust1", since = "1.0.0")]
impl<K: Clone, V: Clone> Clone for BTreeMap<K, V> {
fn clone(&self) -> BTreeMap<K, V> {
fn clone_subtree<K: Clone, V: Clone>(node: node::NodeRef<marker::Immut,
K,
V,
marker::LeafOrInternal>)
-> BTreeMap<K, V> {

fn clone_subtree<'a, K: Clone, V: Clone>(
node: node::NodeRef<marker::Immut<'a>, K, V, marker::LeafOrInternal>
) -> BTreeMap<K, V>
where K: 'a, V: 'a,
{
match node.force() {
Leaf(leaf) => {
let mut out_tree = BTreeMap {
Expand Down Expand Up @@ -1080,7 +1079,11 @@ impl<K: Ord, V> BTreeMap<K, V> {

/// Calculates the number of elements if it is incorrect.
fn recalc_length(&mut self) {
fn dfs<K, V>(node: NodeRef<marker::Immut, K, V, marker::LeafOrInternal>) -> usize {
fn dfs<'a, K, V>(
node: NodeRef<marker::Immut<'a>, K, V, marker::LeafOrInternal>
) -> usize
where K: 'a, V: 'a
{
let mut res = node.len();

if let Internal(node) = node.force() {
Expand Down
7 changes: 0 additions & 7 deletions src/librustc/hir/intravisit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -607,13 +607,6 @@ pub fn walk_ty<'v, V: Visitor<'v>>(visitor: &mut V, typ: &'v Ty) {
}
visitor.visit_lifetime(lifetime);
}
TyImplTraitExistential(_, def_id, ref lifetimes) => {
// we are not recursing into the `existential` item, because it is already being visited
// as part of the surrounding module. The `NodeId` just exists so we don't have to look
// it up everywhere else in the compiler
visitor.visit_def_mention(Def::Existential(def_id));
walk_list!(visitor, visit_lifetime, lifetimes);
}
TyTypeof(ref expression) => {
visitor.visit_anon_const(expression)
}
Expand Down
29 changes: 18 additions & 11 deletions src/librustc/hir/lowering.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1306,13 +1306,20 @@ impl<'a> LoweringContext<'a> {
lctx.items.insert(exist_ty_id.node_id, exist_ty_item);

// `impl Trait` now just becomes `Foo<'a, 'b, ..>`
hir::TyImplTraitExistential(
hir::ItemId {
id: exist_ty_id.node_id
},
DefId::local(exist_ty_def_index),
lifetimes,
)
let path = P(hir::Path {
span: exist_ty_span,
def: Def::Existential(DefId::local(exist_ty_def_index)),
segments: hir_vec![hir::PathSegment {
infer_types: false,
ident: Ident::new(keywords::Invalid.name(), exist_ty_span),
args: Some(P(hir::GenericArgs {
parenthesized: false,
bindings: HirVec::new(),
args: lifetimes,
}))
}],
});
hir::TyPath(hir::QPath::Resolved(None, path))
})
}

Expand All @@ -1321,7 +1328,7 @@ impl<'a> LoweringContext<'a> {
exist_ty_id: NodeId,
parent_index: DefIndex,
bounds: &hir::GenericBounds,
) -> (HirVec<hir::Lifetime>, HirVec<hir::GenericParam>) {
) -> (HirVec<hir::GenericArg>, HirVec<hir::GenericParam>) {
// This visitor walks over impl trait bounds and creates defs for all lifetimes which
// appear in the bounds, excluding lifetimes that are created within the bounds.
// e.g. 'a, 'b, but not 'c in `impl for<'c> SomeTrait<'a, 'b, 'c>`
Expand All @@ -1332,7 +1339,7 @@ impl<'a> LoweringContext<'a> {
collect_elided_lifetimes: bool,
currently_bound_lifetimes: Vec<hir::LifetimeName>,
already_defined_lifetimes: HashSet<hir::LifetimeName>,
output_lifetimes: Vec<hir::Lifetime>,
output_lifetimes: Vec<hir::GenericArg>,
output_lifetime_params: Vec<hir::GenericParam>,
}

Expand Down Expand Up @@ -1416,11 +1423,11 @@ impl<'a> LoweringContext<'a> {
&& !self.already_defined_lifetimes.contains(&name) {
self.already_defined_lifetimes.insert(name);

self.output_lifetimes.push(hir::Lifetime {
self.output_lifetimes.push(hir::GenericArg::Lifetime(hir::Lifetime {
id: self.context.next_id().node_id,
span: lifetime.span,
name,
});
}));

// We need to manually create the ids here, because the
// definitions will go into the explicit `existential type`
Expand Down
8 changes: 8 additions & 0 deletions src/librustc/hir/map/definitions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use rustc_data_structures::indexed_vec::{IndexVec};
use rustc_data_structures::stable_hasher::StableHasher;
use serialize::{Encodable, Decodable, Encoder, Decoder};
use session::CrateDisambiguator;
use std::borrow::Borrow;
use std::fmt::Write;
use std::hash::Hash;
use syntax::ast;
Expand Down Expand Up @@ -389,6 +390,13 @@ pub struct DefPathHash(pub Fingerprint);

impl_stable_hash_for!(tuple_struct DefPathHash { fingerprint });

impl Borrow<Fingerprint> for DefPathHash {
#[inline]
fn borrow(&self) -> &Fingerprint {
&self.0
}
}

impl Definitions {
/// Create new empty definition map.
pub fn new() -> Definitions {
Expand Down
12 changes: 0 additions & 12 deletions src/librustc/hir/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1692,18 +1692,6 @@ pub enum Ty_ {
/// A trait object type `Bound1 + Bound2 + Bound3`
/// where `Bound` is a trait or a lifetime.
TyTraitObject(HirVec<PolyTraitRef>, Lifetime),
/// An existentially quantified (there exists a type satisfying) `impl
/// Bound1 + Bound2 + Bound3` type where `Bound` is a trait or a lifetime.
///
/// The `Item` is the generated
/// `existential type Foo<'a, 'b>: MyTrait<'a, 'b>;`.
///
/// The `HirVec<Lifetime>` is the list of lifetimes applied as parameters
/// to the `abstract type`, e.g. the `'c` and `'d` in `-> Foo<'c, 'd>`.
/// This list is only a list of lifetimes and not type parameters
/// because all in-scope type parameters are captured by `impl Trait`,
/// so they are resolved directly through the parent `Generics`.
TyImplTraitExistential(ItemId, DefId, HirVec<Lifetime>),
/// Unused for now
TyTypeof(AnonConst),
/// TyInfer means the type should be inferred instead of it having been
Expand Down
9 changes: 0 additions & 9 deletions src/librustc/hir/print.rs
Original file line number Diff line number Diff line change
Expand Up @@ -420,15 +420,6 @@ impl<'a> State<'a> {
self.print_lifetime(lifetime)?;
}
}
hir::TyImplTraitExistential(hir_id, _def_id, ref _lifetimes) => {
match self.ann.try_fetch_item(hir_id.id).map(|it| &it.node) {
None => self.word_space("impl {{Trait}}")?,
Some(&hir::ItemExistential(ref exist_ty)) => {
self.print_bounds("impl", &exist_ty.bounds)?;
},
other => bug!("impl Trait pointed to {:#?}", other),
}
}
hir::TyArray(ref ty, ref length) => {
self.s.word("[")?;
self.print_type(&ty)?;
Expand Down
12 changes: 12 additions & 0 deletions src/librustc/ich/fingerprint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,18 @@ impl Fingerprint {
)
}

// Combines two hashes in an order independent way. Make sure this is what
// you want.
#[inline]
pub fn combine_commutative(self, other: Fingerprint) -> Fingerprint {
let a = (self.1 as u128) << 64 | self.0 as u128;
let b = (other.1 as u128) << 64 | other.0 as u128;

let c = a.wrapping_add(b);

Fingerprint((c >> 64) as u64, c as u64)
}

pub fn to_hex(&self) -> String {
format!("{:x}{:x}", self.0, self.1)
}
Expand Down
Loading