Skip to content

Commit

Permalink
Auto merge of #64264 - Centril:rollup-w1khzun, r=Centril
Browse files Browse the repository at this point in the history
Rollup of 7 pull requests

Successful merges:

 - #64023 (libstd fuchsia fixes)
 - #64098 (Ensure edition lints and internal lints are enabled with deny-warnings=false)
 - #64139 (Migrate internal diagnostic registration to macro_rules)
 - #64226 (Aggregation of cosmetic changes made during work on REPL PRs: libsyntax)
 - #64227 (Aggregation of cosmetic changes made during work on REPL PRs: librustc)
 - #64235 (Upgrade env_logger to 0.6)
 - #64258 (compiletest: Match suffixed environments)

Failed merges:

r? @ghost
  • Loading branch information
bors committed Sep 7, 2019
2 parents ef54f57 + 635c3bc commit 43a5ff4
Show file tree
Hide file tree
Showing 133 changed files with 1,805 additions and 2,036 deletions.
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

0 comments on commit 43a5ff4

Please sign in to comment.