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 17 pull requests #37581

Closed
wants to merge 50 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
f89ba5d
Fix some mistakes in HRTB docs
mbrubeck Oct 18, 2016
9ae9930
Introduce iterator trait TrustedLen
bluss Oct 20, 2016
4955711
Use TrustedLen for Vec's FromIterator and Extend
bluss Oct 20, 2016
69b9400
Implement TrustedLen for more iterators
bluss Oct 20, 2016
a3cab90
Document TrustedLen’s contract
bluss Oct 20, 2016
e47da0c
Add release notes for 1.12.1
brson Oct 21, 2016
622f24f
vec: Use Vec::extend specializations in extend_from_slice and more
bluss Oct 21, 2016
ee84ec1
vec: Add a debug assertion where TrustedLen is used
bluss Oct 21, 2016
f69cd1b
Implement ops on `&Wrapping<T>`
cristicbz Oct 23, 2016
df0e5a9
Add `Sum` and `Product` impls for `Wrapping`
cristicbz Oct 22, 2016
8b2108c
core::ptr: Add .wrapping_offset() methods
bluss Oct 26, 2016
2411be5
impl TrustedLen for vec::IntoIter
bluss Oct 26, 2016
5dc9db5
vec: Remove the Vec specialization for .extend()
bluss Oct 26, 2016
20c3013
rustc: Add knowledge of Windows subsystems.
alexcrichton Oct 31, 2016
eba93c3
Don't reuse RandomState seeds
arthurprs Oct 29, 2016
9253e12
adapt debuginfo tests for gdb with native rust support
TimNN Oct 25, 2016
6554fb0
add gdb_native_rust config to compiletest
TimNN Oct 29, 2016
dce4600
detect gdb version & rust support in compiletest
TimNN Oct 29, 2016
5cb5c85
rustbuild+configure: improve bin/exe joining
TimNN Oct 31, 2016
f7107f3
rustbuild+configure: convert unix style paths on windows
TimNN Oct 31, 2016
c8578db
rustc: unify and simplify managing associated items.
eddyb Oct 28, 2016
af0b27e
Don't hash span filenames twice in IchHasher.
nnethercote Oct 26, 2016
942f909
Add missing urls for ErrorKind's variants
GuillaumeGomez Nov 2, 2016
d73c68c
leb128-encode integers before hashing them in IchHasher.
nnethercote Oct 26, 2016
7d06bdd
set frame pointer elimination attribute for main
dinfuehr Nov 3, 2016
dc138b3
use DefId's in const eval for cross-crate const fn's
TimNN Nov 3, 2016
ed0230e
Peekable::peek(): Use Option::as_ref()
mglagla Nov 3, 2016
d5f72d2
Fix ICE when querying DefId on Def::Err.
Mark-Simulacrum Nov 3, 2016
6a34feb
Set RUSTC_BOOTSTRAP to some value.
brson Nov 3, 2016
67626e0
core::ptr: Specify issue for ptr_wrapping_offset feature
bluss Nov 3, 2016
f0e6b90
Link the tracking issue for TrustedLen
bluss Nov 3, 2016
9366ba3
Reorder `hir::Expr` fields.
nnethercote Nov 3, 2016
43452a3
Shrink `Expr_::ExprStruct`.
nnethercote Nov 4, 2016
776e4ed
Rollup merge of #37255 - mbrubeck:doc-edit, r=steveklabnik
Nov 4, 2016
74de6eb
Rollup merge of #37306 - bluss:trusted-len, r=alexcrichton
Nov 4, 2016
d3ff61f
Rollup merge of #37317 - brson:relnotes, r=brson
Nov 4, 2016
5714cd2
Rollup merge of #37356 - cristicbz:wrapsum, r=alexcrichton
Nov 4, 2016
2f98448
Rollup merge of #37402 - eddyb:lazy-3, r=nikomatsakis
Nov 4, 2016
0538044
Rollup merge of #37410 - TimNN:gdb-next-gen, r=alexcrichton
Nov 4, 2016
a267214
Rollup merge of #37422 - bluss:wrapping-offset, r=alexcrichton
Nov 4, 2016
e5ebb60
Rollup merge of #37427 - nnethercote:opt-IchHasher, r=michaelwoerister
Nov 4, 2016
7e6799d
Rollup merge of #37470 - arthurprs:sip-smaller, r=alexcrichton
Nov 4, 2016
f625f74
Rollup merge of #37501 - alexcrichton:windows-subsystem, r=brson
Nov 4, 2016
c5752f0
Rollup merge of #37537 - GuillaumeGomez:error_kind_doc, r=steveklabnik
Nov 4, 2016
be98e20
Rollup merge of #37556 - dinfuehr:main_frame_pointer, r=eddyb
Nov 4, 2016
fbcb057
Rollup merge of #37557 - TimNN:fix-36954, r=eddyb
Nov 4, 2016
0c85ad8
Rollup merge of #37564 - Mark-Simulacrum:sized-ice, r=eddyb
Nov 4, 2016
8b9287d
Rollup merge of #37565 - mglagla:peek_use_as_ref, r=alexcrichton
Nov 4, 2016
f6539dd
Rollup merge of #37566 - brson:env, r=alexcrichton
Nov 4, 2016
323ce27
Rollup merge of #37577 - nnethercote:shrink-Expr-slightly, r=eddyb
Nov 4, 2016
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: 27 additions & 0 deletions RELEASES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,30 @@
Version 1.12.1 (2016-10-20)
===========================

Regression Fixes
----------------

* [ICE: 'rustc' panicked at 'assertion failed: concrete_substs.is_normalized_for_trans()' #36381][36381]
* [Confusion with double negation and booleans][36856]
* [rustc 1.12.0 fails with SIGSEGV in release mode (syn crate 0.8.0)][36875]
* [Rustc 1.12.0 Windows build of `ethcore` crate fails with LLVM error][36924]
* [1.12.0: High memory usage when linking in release mode with debug info][36926]
* [Corrupted memory after updated to 1.12][36936]
* ["Let NullaryConstructor = something;" causes internal compiler error: "tried to overwrite interned AdtDef"][37026]
* [Fix ICE: inject bitcast if types mismatch for invokes/calls/stores][37112]
* [debuginfo: Handle spread_arg case in MIR-trans in a more stable way.][37153]

[36381]: https://github.com/rust-lang/rust/issues/36381
[36856]: https://github.com/rust-lang/rust/issues/36856
[36875]: https://github.com/rust-lang/rust/issues/36875
[36924]: https://github.com/rust-lang/rust/issues/36924
[36926]: https://github.com/rust-lang/rust/issues/36926
[36936]: https://github.com/rust-lang/rust/issues/36936
[37026]: https://github.com/rust-lang/rust/issues/37026
[37112]: https://github.com/rust-lang/rust/issues/37112
[37153]: https://github.com/rust-lang/rust/issues/37153


Version 1.12.0 (2016-09-29)
===========================

Expand Down
7 changes: 0 additions & 7 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -868,13 +868,6 @@ then
fi
fi

if [ -n "$CFG_GDB" ]
then
# Store GDB's version
CFG_GDB_VERSION=$($CFG_GDB --version 2>/dev/null | head -1)
putvar CFG_GDB_VERSION
fi

if [ -n "$CFG_LLDB" ]
then
# Store LLDB's version
Expand Down
2 changes: 1 addition & 1 deletion mk/main.mk
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ CFG_INFO := $(info cfg: disabling unstable features (CFG_DISABLE_UNSTABLE_FEATUR
# Turn on feature-staging
export CFG_DISABLE_UNSTABLE_FEATURES
# Subvert unstable feature lints to do the self-build
export RUSTC_BOOTSTRAP
export RUSTC_BOOTSTRAP=1
endif
ifdef CFG_MUSL_ROOT
export CFG_MUSL_ROOT
Expand Down
2 changes: 1 addition & 1 deletion mk/tests.mk
Original file line number Diff line number Diff line change
Expand Up @@ -648,7 +648,7 @@ CTEST_COMMON_ARGS$(1)-T-$(2)-H-$(3) = \
--host $(3) \
--docck-python $$(CFG_PYTHON) \
--lldb-python $$(CFG_LLDB_PYTHON) \
--gdb-version="$(CFG_GDB_VERSION)" \
--gdb="$(CFG_GDB)" \
--lldb-version="$(CFG_LLDB_VERSION)" \
--llvm-version="$$(LLVM_VERSION_$(3))" \
--android-cross-path=$(CFG_ARM_LINUX_ANDROIDEABI_NDK) \
Expand Down
4 changes: 2 additions & 2 deletions src/bootstrap/check.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ pub fn compiletest(build: &Build,
cmd.arg("--lldb-python").arg(python_default);
}

if let Some(ref vers) = build.gdb_version {
cmd.arg("--gdb-version").arg(vers);
if let Some(ref gdb) = build.config.gdb {
cmd.arg("--gdb").arg(gdb);
}
if let Some(ref vers) = build.lldb_version {
cmd.arg("--lldb-version").arg(vers);
Expand Down
61 changes: 46 additions & 15 deletions src/bootstrap/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ use std::process;
use num_cpus;
use rustc_serialize::Decodable;
use toml::{Parser, Decoder, Value};
use util::push_exe_path;

/// Global configuration for the entire build and/or bootstrap.
///
Expand Down Expand Up @@ -86,6 +87,7 @@ pub struct Config {
pub mandir: Option<String>,
pub codegen_tests: bool,
pub nodejs: Option<PathBuf>,
pub gdb: Option<PathBuf>,
}

/// Per-target configuration stored in the global configuration structure.
Expand Down Expand Up @@ -123,6 +125,7 @@ struct Build {
compiler_docs: Option<bool>,
docs: Option<bool>,
submodules: Option<bool>,
gdb: Option<String>,
}

/// TOML representation of how the LLVM build is configured.
Expand Down Expand Up @@ -227,6 +230,7 @@ impl Config {
}
config.rustc = build.rustc.map(PathBuf::from);
config.cargo = build.cargo.map(PathBuf::from);
config.gdb = build.gdb.map(PathBuf::from);
set(&mut config.compiler_docs, build.compiler_docs);
set(&mut config.docs, build.docs);
set(&mut config.submodules, build.submodules);
Expand Down Expand Up @@ -356,44 +360,47 @@ impl Config {
.collect();
}
"CFG_MUSL_ROOT" if value.len() > 0 => {
self.musl_root = Some(PathBuf::from(value));
self.musl_root = Some(parse_configure_path(value));
}
"CFG_MUSL_ROOT_X86_64" if value.len() > 0 => {
let target = "x86_64-unknown-linux-musl".to_string();
let target = self.target_config.entry(target)
.or_insert(Target::default());
target.musl_root = Some(PathBuf::from(value));
target.musl_root = Some(parse_configure_path(value));
}
"CFG_MUSL_ROOT_I686" if value.len() > 0 => {
let target = "i686-unknown-linux-musl".to_string();
let target = self.target_config.entry(target)
.or_insert(Target::default());
target.musl_root = Some(PathBuf::from(value));
target.musl_root = Some(parse_configure_path(value));
}
"CFG_MUSL_ROOT_ARM" if value.len() > 0 => {
let target = "arm-unknown-linux-musleabi".to_string();
let target = self.target_config.entry(target)
.or_insert(Target::default());
target.musl_root = Some(PathBuf::from(value));
target.musl_root = Some(parse_configure_path(value));
}
"CFG_MUSL_ROOT_ARMHF" if value.len() > 0 => {
let target = "arm-unknown-linux-musleabihf".to_string();
let target = self.target_config.entry(target)
.or_insert(Target::default());
target.musl_root = Some(PathBuf::from(value));
target.musl_root = Some(parse_configure_path(value));
}
"CFG_MUSL_ROOT_ARMV7" if value.len() > 0 => {
let target = "armv7-unknown-linux-musleabihf".to_string();
let target = self.target_config.entry(target)
.or_insert(Target::default());
target.musl_root = Some(PathBuf::from(value));
target.musl_root = Some(parse_configure_path(value));
}
"CFG_DEFAULT_AR" if value.len() > 0 => {
self.rustc_default_ar = Some(value.to_string());
}
"CFG_DEFAULT_LINKER" if value.len() > 0 => {
self.rustc_default_linker = Some(value.to_string());
}
"CFG_GDB" if value.len() > 0 => {
self.gdb = Some(parse_configure_path(value));
}
"CFG_RELEASE_CHANNEL" => {
self.channel = value.to_string();
}
Expand All @@ -412,48 +419,72 @@ impl Config {
"CFG_LLVM_ROOT" if value.len() > 0 => {
let target = self.target_config.entry(self.build.clone())
.or_insert(Target::default());
let root = PathBuf::from(value);
target.llvm_config = Some(root.join("bin/llvm-config"));
let root = parse_configure_path(value);
target.llvm_config = Some(push_exe_path(root, &["bin", "llvm-config"]));
}
"CFG_JEMALLOC_ROOT" if value.len() > 0 => {
let target = self.target_config.entry(self.build.clone())
.or_insert(Target::default());
target.jemalloc = Some(PathBuf::from(value));
target.jemalloc = Some(parse_configure_path(value));
}
"CFG_ARM_LINUX_ANDROIDEABI_NDK" if value.len() > 0 => {
let target = "arm-linux-androideabi".to_string();
let target = self.target_config.entry(target)
.or_insert(Target::default());
target.ndk = Some(PathBuf::from(value));
target.ndk = Some(parse_configure_path(value));
}
"CFG_ARMV7_LINUX_ANDROIDEABI_NDK" if value.len() > 0 => {
let target = "armv7-linux-androideabi".to_string();
let target = self.target_config.entry(target)
.or_insert(Target::default());
target.ndk = Some(PathBuf::from(value));
target.ndk = Some(parse_configure_path(value));
}
"CFG_I686_LINUX_ANDROID_NDK" if value.len() > 0 => {
let target = "i686-linux-android".to_string();
let target = self.target_config.entry(target)
.or_insert(Target::default());
target.ndk = Some(PathBuf::from(value));
target.ndk = Some(parse_configure_path(value));
}
"CFG_AARCH64_LINUX_ANDROID_NDK" if value.len() > 0 => {
let target = "aarch64-linux-android".to_string();
let target = self.target_config.entry(target)
.or_insert(Target::default());
target.ndk = Some(PathBuf::from(value));
target.ndk = Some(parse_configure_path(value));
}
"CFG_LOCAL_RUST_ROOT" if value.len() > 0 => {
self.rustc = Some(PathBuf::from(value).join("bin/rustc"));
self.cargo = Some(PathBuf::from(value).join("bin/cargo"));
let path = parse_configure_path(value);
self.rustc = Some(push_exe_path(path.clone(), &["bin", "rustc"]));
self.cargo = Some(push_exe_path(path, &["bin", "cargo"]));
}
_ => {}
}
}
}
}

#[cfg(not(windows))]
fn parse_configure_path(path: &str) -> PathBuf {
path.into()
}

#[cfg(windows)]
fn parse_configure_path(path: &str) -> PathBuf {
// on windows, configure produces unix style paths e.g. /c/some/path but we
// only want real windows paths

use build_helper;

// '/' is invalid in windows paths, so we can detect unix paths by the presence of it
if !path.contains('/') {
return path.into();
}

let win_path = build_helper::output(Command::new("cygpath").arg("-w").arg(path));
let win_path = win_path.trim();

win_path.into()
}

fn set<T>(field: &mut T, val: Option<T>) {
if let Some(v) = val {
*field = v;
Expand Down
3 changes: 3 additions & 0 deletions src/bootstrap/config.toml.example
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@
# Indicate whether submodules are managed and updated automatically.
#submodules = true

# The path to (or name of) the GDB executable to use
#gdb = "gdb"

# =============================================================================
# Options for compiling Rust code itself
# =============================================================================
Expand Down
4 changes: 1 addition & 3 deletions src/bootstrap/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ pub struct Build {
bootstrap_key_stage0: String,

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

Expand Down Expand Up @@ -196,7 +195,6 @@ impl Build {
package_vers: String::new(),
cc: HashMap::new(),
cxx: HashMap::new(),
gdb_version: None,
lldb_version: None,
lldb_python_dir: None,
}
Expand Down Expand Up @@ -873,7 +871,7 @@ impl Build {

/// Adds the compiler's bootstrap key to the environment of `cmd`.
fn add_bootstrap_key(&self, cmd: &mut Command) {
cmd.env("RUSTC_BOOTSTRAP", "");
cmd.env("RUSTC_BOOTSTRAP", "1");
// FIXME: Transitionary measure to bootstrap using the old bootstrap logic.
// Remove this once the bootstrap compiler uses the new login in Issue #36548.
cmd.env("RUSTC_BOOTSTRAP_KEY", "62b3e239");
Expand Down
7 changes: 6 additions & 1 deletion src/bootstrap/sanity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ pub fn check(build: &mut Build) {
need_cmd(s.as_ref());
}

if let Some(ref gdb) = build.config.gdb {
need_cmd(gdb.as_ref());
} else {
build.config.gdb = have_cmd("gdb".as_ref());
}

// We're gonna build some custom C code here and there, host triples
// also build some C++ shims for LLVM so we need a C++ compiler.
for target in build.config.target.iter() {
Expand Down Expand Up @@ -198,7 +204,6 @@ $ pacman -R cmake && pacman -S mingw-w64-x86_64-cmake
.to_string()
})
};
build.gdb_version = run(Command::new("gdb").arg("--version")).ok();
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();
Expand Down
18 changes: 18 additions & 0 deletions src/bootstrap/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -172,3 +172,21 @@ pub fn dylib_path() -> Vec<PathBuf> {
env::split_paths(&env::var_os(dylib_path_var()).unwrap_or(OsString::new()))
.collect()
}

/// `push` all components to `buf`. On windows, append `.exe` to the last component.
pub fn push_exe_path(mut buf: PathBuf, components: &[&str]) -> PathBuf {
let (&file, components) = components.split_last().expect("at least one component required");
let mut file = file.to_owned();

if cfg!(windows) {
file.push_str(".exe");
}

for c in components {
buf.push(c);
}

buf.push(file);

buf
}
19 changes: 10 additions & 9 deletions src/doc/book/closures.md
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ that takes a reference like so:
fn call_with_ref<F>(some_closure:F) -> i32
where F: Fn(&i32) -> i32 {

let mut value = 0;
let value = 0;
some_closure(&value)
}
```
Expand All @@ -340,14 +340,15 @@ fn call_with_ref<'a, F>(some_closure:F) -> i32
where F: Fn(&'a i32) -> i32 {
```

However this presents a problem in our case. When you specify the explicit
lifetime on a function it binds that lifetime to the *entire* scope of the function
instead of just the invocation scope of our closure. This means that the borrow checker
will see a mutable reference in the same lifetime as our immutable reference and fail
to compile.
However, this presents a problem in our case. When a function has an explicit
lifetime parameter, that lifetime must be at least as long as the *entire*
call to that function. The borrow checker will complain that `value` doesn't
live long enough, because it is only in scope after its declaration inside the
function body.

In order to say that we only need the lifetime to be valid for the invocation scope
of the closure we can use Higher-Ranked Trait Bounds with the `for<...>` syntax:
What we need is a closure that can borrow its argument only for its own
invocation scope, not for the outer function's scope. In order to say that,
we can use Higher-Ranked Trait Bounds with the `for<...>` syntax:

```ignore
fn call_with_ref<F>(some_closure:F) -> i32
Expand All @@ -362,7 +363,7 @@ expect.
fn call_with_ref<F>(some_closure:F) -> i32
where F: for<'a> Fn(&'a i32) -> i32 {

let mut value = 0;
let value = 0;
some_closure(&value)
}
```
Expand Down
1 change: 1 addition & 0 deletions src/libcollections/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
#![feature(specialization)]
#![feature(staged_api)]
#![feature(step_by)]
#![feature(trusted_len)]
#![feature(unicode)]
#![feature(unique)]
#![cfg_attr(test, feature(rand, test))]
Expand Down
Loading