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 9 pull requests #52433

Merged
merged 21 commits into from
Jul 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
0339244
Deny bare trait objects in src/librustc_errors
ljedrz Jul 12, 2018
384d04d
Reduce the number of clone()s needed in obligation_forest
ljedrz Jul 12, 2018
65e6b2b
Pass edition flags to compiler from rustdoc as expected
GuillaumeGomez Jul 14, 2018
02edc7e
AsRef doc wording tweaks
heycam Jul 15, 2018
21a1796
update nomicon
RalfJung Jul 16, 2018
f2f6cea
Rollup merge of #52285 - ljedrz:dyn_librustc_driver, r=nikomatsakis
kennytm Jul 16, 2018
827f656
Enable incremental independent of stage
Mark-Simulacrum Jul 16, 2018
d85bcef
Calculate the exact capacity for 2 HashMaps
ljedrz Jul 16, 2018
bc2f109
Rollup merge of #52392 - heycam:patch-1, r=steveklabnik
kennytm Jul 16, 2018
a9bcbb2
Block beta if clippy breaks.
kennytm Jul 16, 2018
f684f80
update miri
RalfJung Jul 13, 2018
114dc69
update miri (Windows tests fixed)
RalfJung Jul 16, 2018
9e10b12
update miri
RalfJung Jul 17, 2018
68b2928
Rollup merge of #52430 - RalfJung:nomicon, r=kennytm
kennytm Jul 16, 2018
b086b09
Rollup merge of #52286 - ljedrz:dyn_librustc_errors, r=varkor
kennytm Jul 16, 2018
2d18808
Rollup merge of #52306 - ljedrz:obligation_forest_clone, r=varkor
kennytm Jul 16, 2018
6af3e2d
Rollup merge of #52435 - ljedrz:misc_capacity, r=estebank
kennytm Jul 16, 2018
a07f213
Rollup merge of #52338 - RalfJung:miri, r=oli-obk
kennytm Jul 17, 2018
9ea0a85
Rollup merge of #52434 - Mark-Simulacrum:incremental-keep-stage, r=al…
kennytm Jul 17, 2018
c052a49
Rollup merge of #52446 - kennytm:block-beta-on-clippy, r=nrc
kennytm Jul 17, 2018
c0db1aa
Rollup merge of #52385 - GuillaumeGomez:pass-edition-to-parser, r=Qui…
kennytm Jul 17, 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
27 changes: 25 additions & 2 deletions src/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,18 @@ dependencies = [
"serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "cargo_metadata"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)",
"semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_derive 1.0.69 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.22 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "cargotest2"
version = "0.1.0"
Expand Down Expand Up @@ -629,6 +641,14 @@ dependencies = [
"backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "error-chain"
version = "0.12.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"backtrace 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
name = "error_index_generator"
version = "0.0.0"
Expand Down Expand Up @@ -1216,12 +1236,13 @@ name = "miri"
version = "0.1.0"
dependencies = [
"byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)",
"cargo_metadata 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)",
"cargo_metadata 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"colored 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
"compiletest_rs 0.3.11 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)",
]

[[package]]
Expand Down Expand Up @@ -3031,6 +3052,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum bufstream 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "f2f382711e76b9de6c744cc00d0497baba02fb00a787f088c879f01d09468e32"
"checksum byteorder 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "74c0b906e9446b0a2e4f760cdb3fa4b2c48cdc6db8766a845c54b6ff063fd2e9"
"checksum cargo_metadata 0.5.8 (registry+https://github.com/rust-lang/crates.io-index)" = "1efca0b863ca03ed4c109fb1c55e0bc4bbeb221d3e103d86251046b06a526bd0"
"checksum cargo_metadata 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2d6809b327f87369e6f3651efd2c5a96c49847a3ed2559477ecba79014751ee1"
"checksum cc 1.0.17 (registry+https://github.com/rust-lang/crates.io-index)" = "49ec142f5768efb5b7622aebc3fdbdbb8950a4b9ba996393cb76ef7466e8747d"
"checksum cfg-if 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "efe5c877e17a9c717a0bf3613b2709f723202c4e4675cc8f12926ded29bcb17e"
"checksum chalk-engine 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a146c19172c7eea48ea55a7123ac95da786639bc665097f1e14034ee5f1d8699"
Expand Down Expand Up @@ -3062,6 +3084,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum env_logger 0.5.10 (registry+https://github.com/rust-lang/crates.io-index)" = "0e6e40ebb0e66918a37b38c7acab4e10d299e0463fe2af5d29b9cc86710cfd2a"
"checksum environment 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "1f4b14e20978669064c33b4c1e0fb4083412e40fe56cbea2eae80fd7591503ee"
"checksum error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff511d5dc435d703f4971bc399647c9bc38e20cb41452e3b9feb4765419ed3f3"
"checksum error-chain 0.12.0 (registry+https://github.com/rust-lang/crates.io-index)" = "07e791d3be96241c77c43846b665ef1384606da2cd2a48730abe606a12906e02"
"checksum failure 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "934799b6c1de475a012a02dab0ace1ace43789ee4b99bcfbf1a2e3e8ced5de82"
"checksum failure_derive 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c7cdda555bb90c9bb67a3b670a0f42de8e73f5981524123ad8578aafec8ddb8b"
"checksum filetime 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "da4b9849e77b13195302c174324b5ba73eec9b236b24c221a61000daefb95c5f"
Expand Down
5 changes: 1 addition & 4 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -903,10 +903,7 @@ impl<'a> Builder<'a> {
.env("RUSTC_SNAPSHOT_LIBDIR", self.rustc_libdir(compiler));
}

// Ignore incremental modes except for stage0, since we're
// not guaranteeing correctness across builds if the compiler
// is changing under your feet.`
if self.config.incremental && compiler.stage == 0 {
if self.config.incremental {
cargo.env("CARGO_INCREMENTAL", "1");
}

Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub fn build(build: &mut Build) {
build_krate("", build, &mut resolves, "src/libtest");
build_krate(&build.rustc_features(), build, &mut resolves, "src/rustc");

let mut id2name = HashMap::new();
let mut id2name = HashMap::with_capacity(build.crates.len());
for (name, krate) in build.crates.iter() {
id2name.insert(krate.id.clone(), name.clone());
}
Expand Down
16 changes: 9 additions & 7 deletions src/ci/docker/x86_64-gnu-tools/checktools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ status_check() {
check_dispatch $1 beta rust-by-example src/doc/rust-by-example
check_dispatch $1 beta rls src/tools/rls
check_dispatch $1 beta rustfmt src/tools/rustfmt
check_dispatch $1 beta clippy-driver src/tools/clippy
# these tools are not required for beta to successfully branch
check_dispatch $1 nightly clippy-driver src/tools/clippy
check_dispatch $1 nightly miri src/tools/miri
}

Expand All @@ -106,12 +106,14 @@ $COMMIT\t$(cat "$TOOLSTATE_FILE")
fi
}

if [ "$RUST_RELEASE_CHANNEL" = nightly -a -n "${TOOLSTATE_REPO_ACCESS_TOKEN+is_set}" ]; then
. "$(dirname $0)/repo.sh"
MESSAGE_FILE=$(mktemp -t msg.XXXXXX)
echo "($OS CI update)" > "$MESSAGE_FILE"
commit_toolstate_change "$MESSAGE_FILE" change_toolstate
rm -f "$MESSAGE_FILE"
if [ "$RUST_RELEASE_CHANNEL" = nightly ]; then
if [ -n "${TOOLSTATE_REPO_ACCESS_TOKEN+is_set}" ]; then
. "$(dirname $0)/repo.sh"
MESSAGE_FILE=$(mktemp -t msg.XXXXXX)
echo "($OS CI update)" > "$MESSAGE_FILE"
commit_toolstate_change "$MESSAGE_FILE" change_toolstate
rm -f "$MESSAGE_FILE"
fi
exit 0
fi

Expand Down
2 changes: 1 addition & 1 deletion src/doc/nomicon
6 changes: 3 additions & 3 deletions src/libcore/convert.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@
///
/// The key difference between the two traits is the intention:
///
/// - Use `AsRef` when goal is to simply convert into a reference
/// - Use `Borrow` when goal is related to writing code that is agnostic to the
/// type of borrow and if is reference or value
/// - Use `AsRef` when the goal is to simply convert into a reference
/// - Use `Borrow` when the goal is related to writing code that is agnostic to
/// the type of borrow and whether it is a reference or value
///
/// See [the book][book] for a more detailed comparison.
///
Expand Down
11 changes: 8 additions & 3 deletions src/librustc_data_structures/obligation_forest/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -496,9 +496,14 @@ impl<O: ForestObligation> ObligationForest<O> {
}
}
NodeState::Done => {
self.waiting_cache.remove(self.nodes[i].obligation.as_predicate());
// FIXME(HashMap): why can't I get my key back?
self.done_cache.insert(self.nodes[i].obligation.as_predicate().clone());
// Avoid cloning the key (predicate) in case it exists in the waiting cache
if let Some((predicate, _)) = self.waiting_cache
.remove_entry(self.nodes[i].obligation.as_predicate())
{
self.done_cache.insert(predicate);
} else {
self.done_cache.insert(self.nodes[i].obligation.as_predicate().clone());
}
node_rewrites[i] = nodes_len;
dead_nodes += 1;
}
Expand Down
3 changes: 2 additions & 1 deletion src/librustc_driver/profile/trace.rs
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,8 @@ pub fn write_counts(count_file: &mut File, counts: &mut HashMap<String,QueryMetr
}

pub fn write_traces(html_file: &mut File, counts_file: &mut File, traces: &Vec<Rec>) {
let mut counts : HashMap<String,QueryMetric> = HashMap::new();
let capacity = traces.iter().fold(0, |acc, t| acc + 1 + t.extent.len());
let mut counts : HashMap<String, QueryMetric> = HashMap::with_capacity(capacity);
compute_counts_rec(&mut counts, traces);
write_counts(counts_file, &mut counts);

Expand Down
8 changes: 4 additions & 4 deletions src/librustc_errors/diagnostic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ impl Diagnostic {
}

pub fn note_expected_found(&mut self,
label: &fmt::Display,
label: &dyn fmt::Display,
expected: DiagnosticStyledString,
found: DiagnosticStyledString)
-> &mut Self
Expand All @@ -130,11 +130,11 @@ impl Diagnostic {
}

pub fn note_expected_found_extra(&mut self,
label: &fmt::Display,
label: &dyn fmt::Display,
expected: DiagnosticStyledString,
found: DiagnosticStyledString,
expected_extra: &fmt::Display,
found_extra: &fmt::Display)
expected_extra: &dyn fmt::Display,
found_extra: &dyn fmt::Display)
-> &mut Self
{
let mut msg: Vec<_> = vec![(format!("expected {} `", label), Style::NoStyle)];
Expand Down
8 changes: 4 additions & 4 deletions src/librustc_errors/diagnostic_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,17 +148,17 @@ impl<'a> DiagnosticBuilder<'a> {
}

forward!(pub fn note_expected_found(&mut self,
label: &fmt::Display,
label: &dyn fmt::Display,
expected: DiagnosticStyledString,
found: DiagnosticStyledString)
-> &mut Self);

forward!(pub fn note_expected_found_extra(&mut self,
label: &fmt::Display,
label: &dyn fmt::Display,
expected: DiagnosticStyledString,
found: DiagnosticStyledString,
expected_extra: &fmt::Display,
found_extra: &fmt::Display)
expected_extra: &dyn fmt::Display,
found_extra: &dyn fmt::Display)
-> &mut Self);

forward!(pub fn note(&mut self, msg: &str) -> &mut Self);
Expand Down
6 changes: 3 additions & 3 deletions src/librustc_errors/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl EmitterWriter {
}
}

pub fn new(dst: Box<Write + Send>,
pub fn new(dst: Box<dyn Write + Send>,
code_map: Option<Lrc<CodeMapperDyn>>,
short_message: bool,
teach: bool)
Expand Down Expand Up @@ -1469,13 +1469,13 @@ fn emit_to_destination(rendered_buffer: &Vec<Vec<StyledString>>,
pub enum Destination {
Terminal(StandardStream),
Buffered(BufferWriter),
Raw(Box<Write + Send>),
Raw(Box<dyn Write + Send>),
}

pub enum WritableDst<'a> {
Terminal(&'a mut StandardStream),
Buffered(&'a mut BufferWriter, Buffer),
Raw(&'a mut Box<Write + Send>),
Raw(&'a mut Box<dyn Write + Send>),
}

impl Destination {
Expand Down
11 changes: 7 additions & 4 deletions src/librustc_errors/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
// option. This file may not be copied, modified, or distributed
// except according to those terms.

#![deny(bare_trait_objects)]

#![doc(html_logo_url = "https://www.rust-lang.org/logos/rust-logo-128x128-blk-v2.png",
html_favicon_url = "https://doc.rust-lang.org/favicon.ico",
html_root_url = "https://doc.rust-lang.org/nightly/")]
Expand Down Expand Up @@ -110,7 +112,7 @@ pub struct SubstitutionPart {
pub snippet: String,
}

pub type CodeMapperDyn = CodeMapper + sync::Send + sync::Sync;
pub type CodeMapperDyn = dyn CodeMapper + sync::Send + sync::Sync;

pub trait CodeMapper {
fn lookup_char_pos(&self, pos: BytePos) -> Loc;
Expand Down Expand Up @@ -270,7 +272,7 @@ pub struct Handler {
pub flags: HandlerFlags,

err_count: AtomicUsize,
emitter: Lock<Box<Emitter + sync::Send>>,
emitter: Lock<Box<dyn Emitter + sync::Send>>,
continue_after_error: LockCell<bool>,
delayed_span_bug: Lock<Option<Diagnostic>>,

Expand Down Expand Up @@ -326,7 +328,7 @@ impl Handler {

pub fn with_emitter(can_emit_warnings: bool,
treat_err_as_bug: bool,
e: Box<Emitter + sync::Send>)
e: Box<dyn Emitter + sync::Send>)
-> Handler {
Handler::with_emitter_and_flags(
e,
Expand All @@ -337,7 +339,8 @@ impl Handler {
})
}

pub fn with_emitter_and_flags(e: Box<Emitter + sync::Send>, flags: HandlerFlags) -> Handler {
pub fn with_emitter_and_flags(e: Box<dyn Emitter + sync::Send>, flags: HandlerFlags) -> Handler
{
Handler {
flags,
err_count: AtomicUsize::new(0),
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_errors/lock.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use std::any::Any;

#[cfg(windows)]
#[allow(bad_style)]
pub fn acquire_global_lock(name: &str) -> Box<Any> {
pub fn acquire_global_lock(name: &str) -> Box<dyn Any> {
use std::ffi::CString;
use std::io;

Expand Down Expand Up @@ -110,6 +110,6 @@ pub fn acquire_global_lock(name: &str) -> Box<Any> {
}

#[cfg(unix)]
pub fn acquire_global_lock(_name: &str) -> Box<Any> {
pub fn acquire_global_lock(_name: &str) -> Box<dyn Any> {
Box::new(())
}
3 changes: 2 additions & 1 deletion src/librustdoc/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ use syntax::codemap::CodeMap;
use syntax::edition::Edition;
use syntax::feature_gate::UnstableFeatures;
use syntax::with_globals;
use syntax_pos::{BytePos, DUMMY_SP, Pos, Span, FileName};
use syntax_pos::{BytePos, DUMMY_SP, Pos, Span, FileName, hygiene};
use errors;
use errors::emitter::ColorConfig;

Expand Down Expand Up @@ -561,6 +561,7 @@ impl Collector {
rustc_driver::in_rustc_thread(move || with_globals(move || {
io::set_panic(panic);
io::set_print(print);
hygiene::set_default_edition(edition);
run_test(&test,
&cratename,
&filename,
Expand Down
24 changes: 24 additions & 0 deletions src/test/rustdoc/edition-flag.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

// compile-flags:--test -Z unstable-options
// edition:2018

#![feature(async_await)]

/// ```rust
/// #![feature(async_await)]
/// fn main() {
/// let _ = async { };
/// }
/// ```
fn main() {
let _ = async { };
}
2 changes: 1 addition & 1 deletion src/tools/miri
Submodule miri updated from 5b7bb3 to 911aed