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 10 pull requests #54790

Closed
wants to merge 28 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
fcda7b2
Add doc for impl From for Std Error
phungleson Sep 5, 2018
a7cc1fc
Examples for docs
phungleson Sep 25, 2018
53254a8
Add enable-missing-tools option
pvdrz Sep 28, 2018
0724ed6
Add DIST_REQUIRE_ALL_TOOLS to CI scripts
pvdrz Sep 28, 2018
2765575
Fix conditions to allow missing tools in CI
pvdrz Sep 30, 2018
922b9d8
[NFC] `getopts` is used by `librustc` and `librustc_driver`, but isn'…
DiamondLovesYou Sep 30, 2018
ec59188
Make spec_extend use for_each()
Lucretiel Oct 2, 2018
8da08c0
Run debuginfo tests against rust-enabled lldb, when possible
tromey Oct 2, 2018
84f75f0
Fix typo in CONTRIBUTING.md
Oct 2, 2018
30f2e96
Remove main() in examples
phungleson Oct 2, 2018
d686896
Update a FIXME in memory.rs
wesleywiser Oct 3, 2018
187bcb9
rustc/ty: whitespace fixes
ljedrz Oct 2, 2018
f8cacca
rustc/ty: simplify some patterns
ljedrz Oct 2, 2018
774881d
rustc/ty: mark a comment as FIXME
ljedrz Oct 2, 2018
db17164
rustc/ty: calculate span after a possible early continue
ljedrz Oct 2, 2018
04b99bc
rustc/ty: improve allocations
ljedrz Oct 2, 2018
f0de294
A handful of cleanups for rustc/mir
ljedrz Oct 3, 2018
c2c8f8a
Update clippy
Manishearth Oct 3, 2018
3c22127
Rollup merge of #53523 - phungleson:fix-impl-from-for-std-error, r=Gu…
kennytm Oct 3, 2018
72aad24
Rollup merge of #54638 - christianpoveda:master, r=kennytm
kennytm Oct 3, 2018
f66f01e
Rollup merge of #54698 - DiamondLovesYou:getopts-deps, r=davidtwco
kennytm Oct 3, 2018
8b9145e
Rollup merge of #54743 - ljedrz:cleanup_ty_p2, r=zackmdavis
kennytm Oct 3, 2018
2b84507
Rollup merge of #54761 - Lucretiel:patch-1, r=cramertj
kennytm Oct 3, 2018
61a5a51
Rollup merge of #54764 - tromey:test-rust-lldb, r=alexcrichton
kennytm Oct 3, 2018
09b4913
Rollup merge of #54769 - jacobherrington:patch-1, r=kennytm
kennytm Oct 3, 2018
0ba5d74
Rollup merge of #54773 - rust-lang:wesleywiser-patch-1, r=oli-obk
kennytm Oct 3, 2018
a42a4d6
Rollup merge of #54784 - Manishearth:clippyup, r=oli-obk
kennytm Oct 3, 2018
94508ca
Rollup merge of #54788 - ljedrz:cleanup_rustc_mir, r=oli-obk
kennytm Oct 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: 2 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ matrix:
MACOSX_DEPLOYMENT_TARGET=10.7
NO_LLVM_ASSERTIONS=1
NO_DEBUG_ASSERTIONS=1
DIST_REQUIRE_ALL_TOOLS=1
CI_JOB_NAME=dist-i686-apple
os: osx
osx_image: xcode9.3-moar
Expand All @@ -108,6 +109,7 @@ matrix:
MACOSX_DEPLOYMENT_TARGET=10.7
NO_LLVM_ASSERTIONS=1
NO_DEBUG_ASSERTIONS=1
DIST_REQUIRE_ALL_TOOLS=1
CI_JOB_NAME=dist-x86_64-apple
os: osx
osx_image: xcode9.3-moar
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ labels to triage issues:
to fix the issue.

* The dark blue **final-comment-period** label marks bugs that are using the
RFC signoff functionality of [rfcbot][rfcbot] and are currenty in the final
RFC signoff functionality of [rfcbot][rfcbot] and are currently in the final
comment period.

* Red, **I**-prefixed labels indicate the **importance** of the issue. The
Expand Down
4 changes: 4 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ environment:
--enable-full-tools
--enable-profiler
SCRIPT: python x.py dist
DIST_REQUIRE_ALL_TOOLS: 1
DEPLOY: 1
CI_JOB_NAME: dist-x86_64-msvc
- RUST_CONFIGURE_ARGS: >
Expand All @@ -93,6 +94,7 @@ environment:
--enable-full-tools
--enable-profiler
SCRIPT: python x.py dist
DIST_REQUIRE_ALL_TOOLS: 1
DEPLOY: 1
CI_JOB_NAME: dist-i686-msvc
- MSYS_BITS: 32
Expand All @@ -101,6 +103,7 @@ environment:
MINGW_URL: https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror
MINGW_ARCHIVE: i686-6.3.0-release-posix-dwarf-rt_v5-rev2.7z
MINGW_DIR: mingw32
DIST_REQUIRE_ALL_TOOLS: 1
DEPLOY: 1
CI_JOB_NAME: dist-i686-mingw
- MSYS_BITS: 64
Expand All @@ -109,6 +112,7 @@ environment:
MINGW_URL: https://s3-us-west-1.amazonaws.com/rust-lang-ci2/rust-ci-mirror
MINGW_ARCHIVE: x86_64-6.3.0-release-posix-seh-rt_v5-rev2.7z
MINGW_DIR: mingw64
DIST_REQUIRE_ALL_TOOLS: 1
DEPLOY: 1
CI_JOB_NAME: dist-x86_64-mingw

Expand Down
4 changes: 4 additions & 0 deletions config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -481,3 +481,7 @@
# as the one built on Windows will contain backslashes in paths causing problems
# on linux
#src-tarball = true
#

# Whether to allow failures when building tools
#missing-tools = false
3 changes: 3 additions & 0 deletions src/Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1901,6 +1901,7 @@ dependencies = [
"chalk-engine 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"flate2 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
"fmt_macros 0.0.0",
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
"graphviz 0.0.0",
"jobserver 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
"lazy_static 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
Expand Down Expand Up @@ -2074,6 +2075,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
name = "rustc-workspace-hack"
version = "1.0.0"
dependencies = [
"serde_json 1.0.31 (registry+https://github.com/rust-lang/crates.io-index)",
"syn 0.14.9 (registry+https://github.com/rust-lang/crates.io-index)",
"winapi 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)",
]
Expand Down Expand Up @@ -2186,6 +2188,7 @@ version = "0.0.0"
dependencies = [
"arena 0.0.0",
"env_logger 0.5.12 (registry+https://github.com/rust-lang/crates.io-index)",
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
"graphviz 0.0.0",
"log 0.4.4 (registry+https://github.com/rust-lang/crates.io-index)",
"rustc 0.0.0",
Expand Down
4 changes: 4 additions & 0 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ pub struct Config {
pub test_miri: bool,
pub save_toolstates: Option<PathBuf>,
pub print_step_timings: bool,
pub missing_tools: bool,

// Fallback musl-root for all targets
pub musl_root: Option<PathBuf>,
Expand Down Expand Up @@ -271,6 +272,7 @@ struct Dist {
gpg_password_file: Option<String>,
upload_addr: Option<String>,
src_tarball: Option<bool>,
missing_tools: Option<bool>,
}

#[derive(Deserialize)]
Expand Down Expand Up @@ -375,6 +377,7 @@ impl Config {
config.rust_codegen_backends = vec![INTERNER.intern_str("llvm")];
config.rust_codegen_backends_dir = "codegen-backends".to_owned();
config.deny_warnings = true;
config.missing_tools = false;

// set by bootstrap.py
config.build = INTERNER.intern_str(&env::var("BUILD").expect("'BUILD' to be set"));
Expand Down Expand Up @@ -613,6 +616,7 @@ impl Config {
config.dist_gpg_password_file = t.gpg_password_file.clone().map(PathBuf::from);
config.dist_upload_addr = t.upload_addr.clone();
set(&mut config.rust_dist_src, t.src_tarball);
set(&mut config.missing_tools, t.missing_tools);
}

// Now that we've reached the end of our configuration, infer the
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/configure.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ def v(*args):
o("emscripten", None, "compile the emscripten backend as well as LLVM")
o("full-tools", None, "enable all tools")
o("lldb", "rust.lldb", "build lldb")
o("missing-tools", "dist.missing-tools", "allow failures when building tools")

# Optimization and debugging options. These may be overridden by the release
# channel, etc.
Expand Down
18 changes: 13 additions & 5 deletions src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ fn rust_installer(builder: &Builder) -> Command {
builder.tool_cmd(Tool::RustInstaller)
}

fn missing_tool(tool_name: &str, skip: bool) {
if skip {
println!("Unable to build {}, skipping dist", tool_name)
} else {
panic!("Unable to build {}", tool_name)
}
}

#[derive(Debug, PartialOrd, Ord, Copy, Clone, Hash, PartialEq, Eq)]
pub struct Docs {
pub stage: u32,
Expand Down Expand Up @@ -1166,7 +1174,7 @@ impl Step for Rls {
let rls = builder.ensure(tool::Rls {
compiler: builder.compiler(stage, builder.config.build),
target, extra_features: Vec::new()
}).or_else(|| { println!("Unable to build RLS, skipping dist"); None })?;
}).or_else(|| { missing_tool("RLS", builder.build.config.missing_tools); None })?;

builder.install(&rls, &image.join("bin"), 0o755);
let doc = image.join("share/doc/rls");
Expand Down Expand Up @@ -1245,11 +1253,11 @@ impl Step for Clippy {
let clippy = builder.ensure(tool::Clippy {
compiler: builder.compiler(stage, builder.config.build),
target, extra_features: Vec::new()
}).or_else(|| { println!("Unable to build clippy, skipping dist"); None })?;
}).or_else(|| { missing_tool("clippy", builder.build.config.missing_tools); None })?;
let cargoclippy = builder.ensure(tool::CargoClippy {
compiler: builder.compiler(stage, builder.config.build),
target, extra_features: Vec::new()
}).or_else(|| { println!("Unable to build cargo clippy, skipping dist"); None })?;
}).or_else(|| { missing_tool("cargo clippy", builder.build.config.missing_tools); None })?;

builder.install(&clippy, &image.join("bin"), 0o755);
builder.install(&cargoclippy, &image.join("bin"), 0o755);
Expand Down Expand Up @@ -1324,11 +1332,11 @@ impl Step for Rustfmt {
let rustfmt = builder.ensure(tool::Rustfmt {
compiler: builder.compiler(stage, builder.config.build),
target, extra_features: Vec::new()
}).or_else(|| { println!("Unable to build Rustfmt, skipping dist"); None })?;
}).or_else(|| { missing_tool("Rustfmt", builder.build.config.missing_tools); None })?;
let cargofmt = builder.ensure(tool::Cargofmt {
compiler: builder.compiler(stage, builder.config.build),
target, extra_features: Vec::new()
}).or_else(|| { println!("Unable to build Cargofmt, skipping dist"); None })?;
}).or_else(|| { missing_tool("Cargofmt", builder.build.config.missing_tools); None })?;

builder.install(&rustfmt, &image.join("bin"), 0o755);
builder.install(&cargofmt, &image.join("bin"), 0o755);
Expand Down
6 changes: 0 additions & 6 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,10 +278,6 @@ pub struct Build {
initial_rustc: PathBuf,
initial_cargo: PathBuf,

// Probed tools at runtime
lldb_version: Option<String>,
lldb_python_dir: Option<String>,

// Runtime state filled in later on
// C/C++ compilers and archiver for all targets
cc: HashMap<Interned<String>, cc::Tool>,
Expand Down Expand Up @@ -416,8 +412,6 @@ impl Build {
ar: HashMap::new(),
ranlib: HashMap::new(),
crates: HashMap::new(),
lldb_version: None,
lldb_python_dir: None,
is_sudo,
ci_env: CiEnv::current(),
delayed_failures: RefCell::new(Vec::new()),
Expand Down
13 changes: 0 additions & 13 deletions src/bootstrap/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -236,19 +236,6 @@ $ pacman -R cmake && pacman -S mingw-w64-x86_64-cmake
}
}

let run = |cmd: &mut Command| {
cmd.output().map(|output| {
String::from_utf8_lossy(&output.stdout)
.lines().next().unwrap_or_else(|| {
panic!("{:?} failed {:?}", cmd, output)
}).to_string()
})
};
build.lldb_version = run(Command::new("lldb").arg("--version")).ok();
if build.lldb_version.is_some() {
build.lldb_python_dir = run(Command::new("lldb").arg("-P")).ok();
}

if let Some(ref s) = build.config.ccache {
cmd_finder.must_have(s);
}
Expand Down
31 changes: 27 additions & 4 deletions src/bootstrap/test.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1082,11 +1082,34 @@ impl Step for Compiletest {
if let Some(ref gdb) = builder.config.gdb {
cmd.arg("--gdb").arg(gdb);
}
if let Some(ref vers) = builder.lldb_version {

let run = |cmd: &mut Command| {
cmd.output().map(|output| {
String::from_utf8_lossy(&output.stdout)
.lines().next().unwrap_or_else(|| {
panic!("{:?} failed {:?}", cmd, output)
}).to_string()
})
};
let lldb_exe = if builder.config.lldb_enabled && !target.contains("emscripten") {
// Test against the lldb that was just built.
builder.llvm_out(target)
.join("bin")
.join("lldb")
} else {
PathBuf::from("lldb")
};
let lldb_version = Command::new(&lldb_exe)
.arg("--version")
.output()
.map(|output| { String::from_utf8_lossy(&output.stdout).to_string() })
.ok();
if let Some(ref vers) = lldb_version {
cmd.arg("--lldb-version").arg(vers);
}
if let Some(ref dir) = builder.lldb_python_dir {
cmd.arg("--lldb-python-dir").arg(dir);
let lldb_python_dir = run(Command::new(&lldb_exe).arg("-P")).ok();
if let Some(ref dir) = lldb_python_dir {
cmd.arg("--lldb-python-dir").arg(dir);
}
}

// Get paths from cmd args
Expand Down
2 changes: 2 additions & 0 deletions src/ci/docker/dist-i686-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -110,3 +110,5 @@ ENV CFLAGS -mstackrealign
# When we build cargo in this container, we don't want it to use the system
# libcurl, instead it should compile its own.
ENV LIBCURL_NO_PKG_CONFIG 1

ENV DIST_REQUIRE_ALL_TOOLS 1
2 changes: 2 additions & 0 deletions src/ci/docker/dist-x86_64-linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -106,3 +106,5 @@ ENV DIST_SRC 1
# When we build cargo in this container, we don't want it to use the system
# libcurl, instead it should compile its own.
ENV LIBCURL_NO_PKG_CONFIG 1

ENV DIST_REQUIRE_ALL_TOOLS 1
4 changes: 4 additions & 0 deletions src/ci/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ else
fi
fi

if [ "$RUST_RELEASE_CHANNEL" = "nightly" ] || [ "$DIST_REQUIRE_ALL_TOOLS" = "" ]; then
RUST_CONFIGURE_ARGS="$RUST_CONFIGURE_ARGS --enable-missing-tools"
fi

# We've had problems in the past of shell scripts leaking fds into the sccache
# server (#48192) which causes Cargo to erroneously think that a build script
# hasn't finished yet. Try to solve that problem by starting a very long-lived
Expand Down
4 changes: 2 additions & 2 deletions src/liballoc/vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1822,12 +1822,12 @@ impl<T, I> SpecExtend<T, I> for Vec<T>
unsafe {
let mut ptr = self.as_mut_ptr().add(self.len());
let mut local_len = SetLenOnDrop::new(&mut self.len);
for element in iterator {
iterator.for_each(move |element| {
ptr::write(ptr, element);
ptr = ptr.offset(1);
// NB can't overflow since we would have had to alloc the address space
local_len.increment_len(1);
}
});
}
} else {
self.extend_desugared(iterator)
Expand Down
1 change: 1 addition & 0 deletions src/librustc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ byteorder = { version = "1.1", features = ["i128"]}
chalk-engine = { version = "0.7.0", default-features=false }
rustc_fs_util = { path = "../librustc_fs_util" }
smallvec = { version = "0.6.5", features = ["union"] }
getopts = "=0.2.17"

# Note that these dependencies are a lie, they're just here to get linkage to
# work.
Expand Down
4 changes: 2 additions & 2 deletions src/librustc/mir/interpret/value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ impl<'tcx> Scalar {
pub fn from_uint(i: impl Into<u128>, size: Size) -> Self {
let i = i.into();
debug_assert_eq!(truncate(i, size), i,
"Unsigned value {} does not fit in {} bits", i, size.bits());
"Unsigned value {} does not fit in {} bits", i, size.bits());
Scalar::Bits { bits: i, size: size.bytes() as u8 }
}

Expand All @@ -181,7 +181,7 @@ impl<'tcx> Scalar {
// `into` performed sign extension, we have to truncate
let truncated = truncate(i as u128, size);
debug_assert_eq!(sign_extend(truncated, size) as i128, i,
"Signed value {} does not fit in {} bits", i, size.bits());
"Signed value {} does not fit in {} bits", i, size.bits());
Scalar::Bits { bits: truncated, size: size.bytes() as u8 }
}

Expand Down
Loading