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 7 pull requests #64264

Merged
merged 25 commits into from
Sep 7, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5da1123
Update zx_time_t to an i64
tmandry Aug 30, 2019
403701f
Don't try to use /dev/null on Fuchsia
tmandry Aug 30, 2019
7bfa2be
fuchsia: Don't fail to spawn if no stdin exists
tmandry Aug 31, 2019
5f91ad0
fuchsia: Fix default environment behavior when spawning
tmandry Aug 31, 2019
c86ea34
Ensure all warnings are emitted even on warnings=warn
Mark-Simulacrum Sep 2, 2019
fda251b
Rename --warnings=allow to --warnings=warn
Mark-Simulacrum Sep 2, 2019
74563b4
Restrict error code length to 80 columns
Mark-Simulacrum Sep 4, 2019
b437240
Replace diagnostic plugins with macro_rules
Mark-Simulacrum Sep 4, 2019
3f1dc32
Remove codegen dependencies
Mark-Simulacrum Sep 4, 2019
4de4f30
Fix error index generator for new register_diagnostics API
Mark-Simulacrum Sep 4, 2019
41b39fc
Remove rustc_diagnostic_macros feature
Mark-Simulacrum Sep 4, 2019
5153db1
Explicitly create test tempdir
Mark-Simulacrum Sep 5, 2019
8ddbe76
Upgrade env_logger to 0.6
mati865 Aug 29, 2019
c1d29ee
Aggregation of cosmetic changes made during work on REPL PRs: librustc
alexreg Sep 6, 2019
fd48ca2
Apply suggestions from code review
alexreg Sep 6, 2019
49d2fd1
Aggregation of cosmetic changes made during work on REPL PRs: libsyntax
alexreg Sep 6, 2019
553a56d
Apply suggestions from code review
alexreg Sep 6, 2019
2bcabf6
compiletest: Match suffixed environments
smaeul Sep 3, 2019
8bee18b
Rollup merge of #64023 - tmandry:libstd-fuchsia-fixes, r=cramertj
Centril Sep 7, 2019
3c4a586
Rollup merge of #64098 - Mark-Simulacrum:always-warn, r=alexcrichton
Centril Sep 7, 2019
89a69fd
Rollup merge of #64139 - Mark-Simulacrum:strip-legacy-proc-macro, r=p…
Centril Sep 7, 2019
c530672
Rollup merge of #64226 - alexreg:rush-pr-3, r=centril
Centril Sep 7, 2019
c70b768
Rollup merge of #64227 - alexreg:rush-pr-4, r=centril
Centril Sep 7, 2019
448b38f
Rollup merge of #64235 - mati865:env_logger, r=alexcrichton
Centril Sep 7, 2019
635c3bc
Rollup merge of #64258 - smaeul:patch/arm-tests, r=Mark-Simulacrum
Centril Sep 7, 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
40 changes: 12 additions & 28 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ dependencies = [
"crypto-hash",
"curl",
"curl-sys",
"env_logger 0.6.0",
"env_logger",
"failure",
"filetime",
"flate2",
Expand Down Expand Up @@ -507,7 +507,7 @@ name = "compiletest"
version = "0.0.0"
dependencies = [
"diff",
"env_logger 0.5.13",
"env_logger",
"getopts",
"lazy_static 1.3.0",
"libc",
Expand Down Expand Up @@ -909,21 +909,9 @@ dependencies = [

[[package]]
name = "env_logger"
version = "0.5.13"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "15b0a4d2e39f8420210be8b27eeda28029729e2fd4291019455016c348240c38"
dependencies = [
"atty",
"humantime",
"log",
"termcolor",
]

[[package]]
name = "env_logger"
version = "0.6.0"
version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "afb070faf94c85d17d50ca44f6ad076bce18ae92f0037d350947240a36e9d42e"
checksum = "aafcde04e90a5226a6443b7aabdb016ba2f8307c847d524724bd9b346dd1a2d3"
dependencies = [
"atty",
"humantime",
Expand Down Expand Up @@ -1774,7 +1762,7 @@ dependencies = [
"chrono",
"clap",
"elasticlunr-rs",
"env_logger 0.6.0",
"env_logger",
"error-chain",
"handlebars",
"itertools 0.8.0",
Expand All @@ -1799,7 +1787,7 @@ version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "77d1f0ba4d1e6b86fa18e8853d026d7d76a97eb7eb5eb052ed80901e43b7fc10"
dependencies = [
"env_logger 0.6.0",
"env_logger",
"failure",
"log",
"mdbook",
Expand Down Expand Up @@ -1992,7 +1980,7 @@ dependencies = [
"colored",
"compiletest_rs",
"directories",
"env_logger 0.6.0",
"env_logger",
"getrandom",
"hex",
"log",
Expand Down Expand Up @@ -2363,7 +2351,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "df8b3f4e0475def7d9c2e5de8e5a1306949849761e107b360d03e98eafaffd61"
dependencies = [
"chrono",
"env_logger 0.6.0",
"env_logger",
"log",
]

Expand Down Expand Up @@ -2440,7 +2428,7 @@ dependencies = [
"bitflags",
"clap",
"derive_more",
"env_logger 0.6.0",
"env_logger",
"humantime",
"lazy_static 1.3.0",
"log",
Expand Down Expand Up @@ -2734,7 +2722,7 @@ dependencies = [
"clippy_lints",
"crossbeam-channel",
"difference",
"env_logger 0.6.0",
"env_logger",
"failure",
"futures",
"heck",
Expand Down Expand Up @@ -3129,11 +3117,7 @@ dependencies = [
name = "rustc_codegen_llvm"
version = "0.0.0"
dependencies = [
"cc",
"memmap",
"num_cpus",
"rustc_llvm",
"tempfile",
]

[[package]]
Expand Down Expand Up @@ -3203,7 +3187,7 @@ dependencies = [
name = "rustc_driver"
version = "0.0.0"
dependencies = [
"env_logger 0.5.13",
"env_logger",
"graphviz",
"log",
"rustc",
Expand Down Expand Up @@ -3590,7 +3574,7 @@ dependencies = [
"derive-new",
"diff",
"dirs",
"env_logger 0.6.0",
"env_logger",
"failure",
"getopts",
"ignore",
Expand Down
13 changes: 7 additions & 6 deletions src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,17 +119,18 @@ fn main() {
cmd.arg(format!("-Cdebuginfo={}", debuginfo_level));
}

if env::var_os("RUSTC_DENY_WARNINGS").is_some() &&
env::var_os("RUSTC_EXTERNAL_TOOL").is_none() {
if env::var_os("RUSTC_EXTERNAL_TOOL").is_none() {
// When extending this list, add the new lints to the RUSTFLAGS of the
// build_bootstrap function of src/bootstrap/bootstrap.py as well as
// some code doesn't go through this `rustc` wrapper.
cmd.arg("-Dwarnings");
cmd.arg("-Drust_2018_idioms");
cmd.arg("-Dunused_lifetimes");
cmd.arg("-Wrust_2018_idioms");
cmd.arg("-Wunused_lifetimes");
if use_internal_lints(crate_name) {
cmd.arg("-Zunstable-options");
cmd.arg("-Drustc::internal");
cmd.arg("-Wrustc::internal");
}
if env::var_os("RUSTC_DENY_WARNINGS").is_some() {
cmd.arg("-Dwarnings");
}
}

Expand Down
3 changes: 2 additions & 1 deletion src/bootstrap/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -631,8 +631,9 @@ def build_bootstrap(self):
target_linker = self.get_toml("linker", build_section)
if target_linker is not None:
env["RUSTFLAGS"] += "-C linker=" + target_linker + " "
env["RUSTFLAGS"] += " -Wrust_2018_idioms -Wunused_lifetimes "
if self.get_toml("deny-warnings", "rust") != "false":
env["RUSTFLAGS"] += "-Dwarnings -Drust_2018_idioms -Dunused_lifetimes "
env["RUSTFLAGS"] += "-Dwarnings "

env["PATH"] = os.path.join(self.bin_root(), "bin") + \
os.pathsep + env["PATH"]
Expand Down
6 changes: 3 additions & 3 deletions src/bootstrap/flags.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ pub struct Flags {
// This overrides the deny-warnings configuation option,
// which passes -Dwarnings to the compiler invocations.
//
// true => deny, false => allow
// true => deny, false => warn
pub deny_warnings: Option<bool>,
}

Expand Down Expand Up @@ -556,10 +556,10 @@ fn split(s: &[String]) -> Vec<String> {
fn parse_deny_warnings(matches: &getopts::Matches) -> Option<bool> {
match matches.opt_str("warnings").as_ref().map(|v| v.as_str()) {
Some("deny") => Some(true),
Some("allow") => Some(false),
Some("warn") => Some(false),
Some(value) => {
eprintln!(
r#"invalid value for --warnings: {:?}, expected "allow" or "deny""#,
r#"invalid value for --warnings: {:?}, expected "warn" or "deny""#,
value,
);
process::exit(1);
Expand Down
5 changes: 4 additions & 1 deletion src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1327,7 +1327,10 @@ impl Step for Compiletest {
cmd.env("RUSTC_PROFILER_SUPPORT", "1");
}

cmd.env("RUST_TEST_TMPDIR", builder.out.join("tmp"));
let tmp = builder.out.join("tmp");
std::fs::create_dir_all(&tmp).unwrap();
cmd.env("RUST_TEST_TMPDIR", tmp);


cmd.arg("--adb-path").arg("adb");
cmd.arg("--adb-test-dir").arg(ADB_TEST_DIR);
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/arena.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ impl<T: Copy> ArenaAllocatable for T {}

unsafe trait ArenaField<'tcx>: Sized {
/// Returns a specific arena to allocate from.
/// If None is returned, the DropArena will be used.
/// If `None` is returned, the `DropArena` will be used.
fn arena<'a>(arena: &'a Arena<'tcx>) -> Option<&'a TypedArena<Self>>;
}

Expand Down
24 changes: 12 additions & 12 deletions src/librustc/error_codes.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// Error messages for EXXXX errors.
// Each message should start and end with a new line, and be wrapped to 80 characters.
// In vim you can `:set tw=80` and use `gq` to wrap paragraphs. Use `:set tw=0` to disable.
register_long_diagnostics! {
// Each message should start and end with a new line, and be wrapped to 80
// characters. In vim you can `:set tw=80` and use `gq` to wrap paragraphs. Use
// `:set tw=0` to disable.
syntax::register_diagnostics! {
E0038: r##"
Trait objects like `Box<Trait>` can only be constructed when certain
requirements are satisfied by the trait in question.
Expand Down Expand Up @@ -2183,11 +2184,7 @@ Examples of erroneous code:
static X: u32 = 42;
```
"##,

}


register_diagnostics! {
;
// E0006, // merged with E0005
// E0101, // replaced with E0282
// E0102, // replaced with E0282
Expand All @@ -2206,7 +2203,8 @@ register_diagnostics! {
// E0305, // expected constant
E0311, // thing may not live long enough
E0312, // lifetime of reference outlives lifetime of borrowed content
E0313, // lifetime of borrowed pointer outlives lifetime of captured variable
E0313, // lifetime of borrowed pointer outlives lifetime of captured
// variable
E0314, // closure outlives stack frame
E0315, // cannot invoke closure outside of its lifetime
E0316, // nested quantification of lifetimes
Expand All @@ -2223,12 +2221,13 @@ register_diagnostics! {
E0483, // lifetime of operand does not outlive the operation
E0484, // reference is not valid at the time of borrow
E0485, // automatically reference is not valid at the time of borrow
E0486, // type of expression contains references that are not valid during...
E0486, // type of expression contains references that are not valid during..
E0487, // unsafe use of destructor: destructor might be called while...
E0488, // lifetime of variable does not enclose its declaration
E0489, // type/lifetime parameter not in scope here
E0490, // a value of type `..` is borrowed for too long
E0495, // cannot infer an appropriate lifetime due to conflicting requirements
E0495, // cannot infer an appropriate lifetime due to conflicting
// requirements
E0566, // conflicting representation hints
E0623, // lifetime mismatch where both parameters are anonymous regions
E0628, // generators cannot have explicit parameters
Expand All @@ -2239,7 +2238,8 @@ register_diagnostics! {
E0688, // in-band lifetimes cannot be mixed with explicit lifetime binders
E0697, // closures cannot be static
E0707, // multiple elided lifetimes used in arguments of `async fn`
E0708, // `async` non-`move` closures with parameters are not currently supported
E0708, // `async` non-`move` closures with parameters are not currently
// supported
E0709, // multiple different lifetimes used in arguments of `async fn`
E0710, // an unknown tool name found in scoped lint
E0711, // a feature has been declared with conflicting stability attributes
Expand Down
7 changes: 3 additions & 4 deletions src/librustc/hir/check_attr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@
//! conflicts between multiple such attributes attached to the same
//! item.


use crate::ty::TyCtxt;
use crate::ty::query::Providers;

use crate::hir;
use crate::hir::def_id::DefId;
use crate::hir::intravisit::{self, Visitor, NestedVisitorMap};
use crate::ty::TyCtxt;
use crate::ty::query::Providers;

use std::fmt::{self, Display};
use syntax::symbol::sym;
use syntax_pos::Span;
Expand Down
22 changes: 14 additions & 8 deletions src/librustc/hir/def.rs
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
use self::Namespace::*;

use crate::hir::def_id::{DefId, CRATE_DEF_INDEX, LOCAL_CRATE};
use crate::hir;
use crate::ty;
use crate::util::nodemap::DefIdMap;

use syntax::ast;
use syntax::ext::base::MacroKind;
use syntax::ast::NodeId;
use syntax_pos::Span;
use rustc_macros::HashStable;
use crate::hir;
use crate::ty;
use std::fmt::Debug;

use self::Namespace::*;
use std::fmt::Debug;

/// Encodes if a `DefKind::Ctor` is the constructor of an enum variant or a struct.
#[derive(Clone, Copy, PartialEq, Eq, RustcEncodable, RustcDecodable, Hash, Debug, HashStable)]
Expand Down Expand Up @@ -115,7 +117,7 @@ impl DefKind {
}
}

/// An English article for the def.
/// Gets an English article for the definition.
pub fn article(&self) -> &'static str {
match *self {
DefKind::AssocTy
Expand All @@ -134,18 +136,22 @@ pub enum Res<Id = hir::HirId> {
Def(DefKind, DefId),

// Type namespace

PrimTy(hir::PrimTy),
SelfTy(Option<DefId> /* trait */, Option<DefId> /* impl */),
ToolMod, // e.g., `rustfmt` in `#[rustfmt::skip]`

// Value namespace

SelfCtor(DefId /* impl */), // `DefId` refers to the impl
Local(Id),

// Macro namespace

NonMacroAttr(NonMacroAttrKind), // e.g., `#[inline]` or `#[rustfmt::skip]`

// All namespaces

Err,
}

Expand Down Expand Up @@ -330,7 +336,7 @@ impl NonMacroAttrKind {
}

impl<Id> Res<Id> {
/// Return the `DefId` of this `Def` if it has an id, else panic.
/// Return the `DefId` of this `Def` if it has an ID, else panic.
pub fn def_id(&self) -> DefId
where
Id: Debug,
Expand All @@ -340,7 +346,7 @@ impl<Id> Res<Id> {
})
}

/// Return `Some(..)` with the `DefId` of this `Res` if it has a id, else `None`.
/// Return `Some(..)` with the `DefId` of this `Res` if it has a ID, else `None`.
pub fn opt_def_id(&self) -> Option<DefId> {
match *self {
Res::Def(_, id) => Some(id),
Expand Down Expand Up @@ -379,7 +385,7 @@ impl<Id> Res<Id> {
}
}

/// An English article for the res.
/// Gets an English article for the `Res`.
pub fn article(&self) -> &'static str {
match *self {
Res::Def(kind, _) => kind.article(),
Expand Down
7 changes: 3 additions & 4 deletions src/librustc/hir/def_id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ newtype_index! {

#[derive(Copy, Clone, PartialEq, Eq, PartialOrd, Ord, Hash)]
pub enum CrateNum {
/// A special CrateNum that we use for the tcx.rcache when decoding from
/// A special `CrateNum` that we use for the `tcx.rcache` when decoding from
/// the incr. comp. cache.
ReservedForIncrCompCache,
Index(CrateId),
Expand All @@ -26,11 +26,10 @@ impl ::std::fmt::Debug for CrateNum {
}
}

/// Item definitions in the currently-compiled crate would have the CrateNum
/// LOCAL_CRATE in their DefId.
/// Item definitions in the currently-compiled crate would have the `CrateNum`
/// `LOCAL_CRATE` in their `DefId`.
pub const LOCAL_CRATE: CrateNum = CrateNum::Index(CrateId::from_u32_const(0));


impl Idx for CrateNum {
#[inline]
fn new(value: usize) -> Self {
Expand Down
Loading