Skip to content

Commit 5f7cfd1

Browse files
authored
Merge pull request #37549 from brson/beta-next
[beta] backports
2 parents 68fcc17 + 47e2644 commit 5f7cfd1

File tree

23 files changed

+252
-145
lines changed

23 files changed

+252
-145
lines changed

RELEASES.md

+27
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,30 @@
1+
Version 1.12.1 (2016-10-20)
2+
===========================
3+
4+
Regression Fixes
5+
----------------
6+
7+
* [ICE: 'rustc' panicked at 'assertion failed: concrete_substs.is_normalized_for_trans()' #36381][36381]
8+
* [Confusion with double negation and booleans][36856]
9+
* [rustc 1.12.0 fails with SIGSEGV in release mode (syn crate 0.8.0)][36875]
10+
* [Rustc 1.12.0 Windows build of `ethcore` crate fails with LLVM error][36924]
11+
* [1.12.0: High memory usage when linking in release mode with debug info][36926]
12+
* [Corrupted memory after updated to 1.12][36936]
13+
* ["Let NullaryConstructor = something;" causes internal compiler error: "tried to overwrite interned AdtDef"][37026]
14+
* [Fix ICE: inject bitcast if types mismatch for invokes/calls/stores][37112]
15+
* [debuginfo: Handle spread_arg case in MIR-trans in a more stable way.][37153]
16+
17+
[36381]: https://github.com/rust-lang/rust/issues/36381
18+
[36856]: https://github.com/rust-lang/rust/issues/36856
19+
[36875]: https://github.com/rust-lang/rust/issues/36875
20+
[36924]: https://github.com/rust-lang/rust/issues/36924
21+
[36926]: https://github.com/rust-lang/rust/issues/36926
22+
[36936]: https://github.com/rust-lang/rust/issues/36936
23+
[37026]: https://github.com/rust-lang/rust/issues/37026
24+
[37112]: https://github.com/rust-lang/rust/issues/37112
25+
[37153]: https://github.com/rust-lang/rust/issues/37153
26+
27+
128
Version 1.12.0 (2016-09-29)
229
===========================
330

mk/main.mk

+6-22
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ CFG_RELEASE_NUM=1.13.0
1818
# An optional number to put after the label, e.g. '.2' -> '-beta.2'
1919
# NB Make sure it starts with a dot to conform to semver pre-release
2020
# versions (section 9)
21-
CFG_PRERELEASE_VERSION=.2
21+
CFG_PRERELEASE_VERSION=.3
2222

2323
ifeq ($(CFG_RELEASE_CHANNEL),stable)
2424
# This is the normal semver version string, e.g. "0.12.0", "0.12.0-nightly"
@@ -53,17 +53,6 @@ endif
5353
# versions in the same place
5454
CFG_FILENAME_EXTRA=$(shell printf '%s' $(CFG_RELEASE)$(CFG_EXTRA_FILENAME) | $(CFG_HASH_COMMAND))
5555

56-
# A magic value that allows the compiler to use unstable features during the
57-
# bootstrap even when doing so would normally be an error because of feature
58-
# staging or because the build turns on warnings-as-errors and unstable features
59-
# default to warnings. The build has to match this key in an env var.
60-
#
61-
# This value is keyed off the release to ensure that all compilers for one
62-
# particular release have the same bootstrap key. Note that this is
63-
# intentionally not "secure" by any definition, this is largely just a deterrent
64-
# from users enabling unstable features on the stable compiler.
65-
CFG_BOOTSTRAP_KEY=$(CFG_FILENAME_EXTRA)
66-
6756
# If local-rust is the same as the current version, then force a local-rebuild
6857
ifdef CFG_ENABLE_LOCAL_RUST
6958
ifeq ($(CFG_RELEASE),\
@@ -73,14 +62,6 @@ ifeq ($(CFG_RELEASE),\
7362
endif
7463
endif
7564

76-
# The stage0 compiler needs to use the previous key recorded in src/stage0.txt,
77-
# except for local-rebuild when it just uses the same current key.
78-
ifdef CFG_ENABLE_LOCAL_REBUILD
79-
CFG_BOOTSTRAP_KEY_STAGE0=$(CFG_BOOTSTRAP_KEY)
80-
else
81-
CFG_BOOTSTRAP_KEY_STAGE0=$(shell sed -ne 's/^rustc_key: //p' $(S)src/stage0.txt)
82-
endif
83-
8465
# The name of the package to use for creating tarballs, installers etc.
8566
CFG_PACKAGE_NAME=rustc-$(CFG_PACKAGE_VERS)
8667

@@ -387,13 +368,16 @@ CFG_INFO := $(info cfg: disabling unstable features (CFG_DISABLE_UNSTABLE_FEATUR
387368
# Turn on feature-staging
388369
export CFG_DISABLE_UNSTABLE_FEATURES
389370
# Subvert unstable feature lints to do the self-build
390-
export RUSTC_BOOTSTRAP_KEY:=$(CFG_BOOTSTRAP_KEY)
371+
export RUSTC_BOOTSTRAP
391372
endif
392-
export CFG_BOOTSTRAP_KEY
393373
ifdef CFG_MUSL_ROOT
394374
export CFG_MUSL_ROOT
395375
endif
396376

377+
# FIXME: Transitionary measure to bootstrap using the old bootstrap logic.
378+
# Remove this once the bootstrap compiler uses the new login in Issue #36548.
379+
export RUSTC_BOOTSTRAP_KEY=5c6cf767
380+
397381
######################################################################
398382
# Per-stage targets and runner
399383
######################################################################

mk/target.mk

-21
Original file line numberDiff line numberDiff line change
@@ -42,23 +42,6 @@ $(foreach host,$(CFG_HOST), \
4242
$(foreach crate,$(CRATES), \
4343
$(eval $(call RUST_CRATE_FULLDEPS,$(stage),$(target),$(host),$(crate)))))))
4444

45-
# $(1) stage
46-
# $(2) target
47-
# $(3) host
48-
define DEFINE_BOOTSTRAP_KEY
49-
BOOTSTRAP_KEY$(1)_T_$(2)_H_$(3) := $$(CFG_BOOTSTRAP_KEY)
50-
ifeq ($(1),0)
51-
ifeq ($(3),$$(CFG_BUILD))
52-
BOOTSTRAP_KEY$(1)_T_$(2)_H_$(3) := $$(CFG_BOOTSTRAP_KEY_STAGE0)
53-
endif
54-
endif
55-
endef
56-
57-
$(foreach host,$(CFG_TARGET), \
58-
$(foreach target,$(CFG_TARGET), \
59-
$(foreach stage,$(STAGES), \
60-
$(eval $(call DEFINE_BOOTSTRAP_KEY,$(stage),$(target),$(host))))))
61-
6245
# RUST_TARGET_STAGE_N template: This defines how target artifacts are built
6346
# for all stage/target architecture combinations. This is one giant rule which
6447
# works as follows:
@@ -83,8 +66,6 @@ $(foreach host,$(CFG_TARGET), \
8366
define RUST_TARGET_STAGE_N
8467

8568
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): CFG_COMPILER_HOST_TRIPLE = $(2)
86-
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
87-
export RUSTC_BOOTSTRAP_KEY := $$(BOOTSTRAP_KEY$(1)_T_$(2)_H_$(3))
8869
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$(4): \
8970
$$(CRATEFILE_$(4)) \
9071
$$(CRATE_FULLDEPS_$(1)_T_$(2)_H_$(3)_$(4)) \
@@ -132,8 +113,6 @@ endef
132113
# $(4) - name of the tool being built
133114
define TARGET_TOOL
134115

135-
$$(TBIN$(1)_T_$(2)_H_$(3))/$(4)$$(X_$(2)): \
136-
export RUSTC_BOOTSTRAP_KEY := $$(BOOTSTRAP_KEY$(1)_T_$(2)_H_$(3))
137116
$$(TBIN$(1)_T_$(2)_H_$(3))/$(4)$$(X_$(2)): \
138117
$$(TOOL_SOURCE_$(4)) \
139118
$$(TOOL_INPUTS_$(4)) \

src/bootstrap/check.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ pub fn compiletest(build: &Build,
185185
}
186186
}
187187
}
188-
build.add_bootstrap_key(compiler, &mut cmd);
188+
build.add_bootstrap_key(&mut cmd);
189189

190190
cmd.arg("--adb-path").arg("adb");
191191
cmd.arg("--adb-test-dir").arg(ADB_TEST_DIR);

src/bootstrap/compile.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ fn build_startup_objects(build: &Build, target: &str, into: &Path) {
133133
for file in t!(fs::read_dir(build.src.join("src/rtstartup"))) {
134134
let file = t!(file);
135135
let mut cmd = Command::new(&compiler_path);
136-
build.add_bootstrap_key(&compiler, &mut cmd);
136+
build.add_bootstrap_key(&mut cmd);
137137
build.run(cmd.arg("--target").arg(target)
138138
.arg("--emit=obj")
139139
.arg("--out-dir").arg(into)
@@ -199,7 +199,6 @@ pub fn rustc<'a>(build: &'a Build, target: &str, compiler: &Compiler<'a>) {
199199
cargo.env("CFG_RELEASE", &build.release)
200200
.env("CFG_RELEASE_CHANNEL", &build.config.channel)
201201
.env("CFG_VERSION", &build.version)
202-
.env("CFG_BOOTSTRAP_KEY", &build.bootstrap_key)
203202
.env("CFG_PREFIX", build.config.prefix.clone().unwrap_or(String::new()))
204203
.env("CFG_LIBDIR_RELATIVE", "lib");
205204

src/bootstrap/lib.rs

+6-11
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ impl Build {
647647
.env("RUSTDOC_REAL", self.rustdoc(compiler))
648648
.env("RUSTC_FLAGS", self.rustc_flags(target).join(" "));
649649

650-
self.add_bootstrap_key(compiler, &mut cargo);
650+
self.add_bootstrap_key(&mut cargo);
651651

652652
// Specify some various options for build scripts used throughout
653653
// the build.
@@ -862,16 +862,11 @@ impl Build {
862862
}
863863

864864
/// Adds the compiler's bootstrap key to the environment of `cmd`.
865-
fn add_bootstrap_key(&self, compiler: &Compiler, cmd: &mut Command) {
866-
// In stage0 we're using a previously released stable compiler, so we
867-
// use the stage0 bootstrap key. Otherwise we use our own build's
868-
// bootstrap key.
869-
let bootstrap_key = if compiler.is_snapshot(self) && !self.local_rebuild {
870-
&self.bootstrap_key_stage0
871-
} else {
872-
&self.bootstrap_key
873-
};
874-
cmd.env("RUSTC_BOOTSTRAP_KEY", bootstrap_key);
865+
fn add_bootstrap_key(&self, cmd: &mut Command) {
866+
cmd.env("RUSTC_BOOTSTRAP", "");
867+
// FIXME: Transitionary measure to bootstrap using the old bootstrap logic.
868+
// Remove this once the bootstrap compiler uses the new login in Issue #36548.
869+
cmd.env("RUSTC_BOOTSTRAP_KEY", "5c6cf767");
875870
}
876871

877872
/// Returns the compiler's libdir where it stores the dynamic libraries that

src/librustc/mir/repr.rs

+2-3
Original file line numberDiff line numberDiff line change
@@ -1131,8 +1131,7 @@ impl<'tcx> Debug for Rvalue<'tcx> {
11311131
Adt(adt_def, variant, substs, _) => {
11321132
let variant_def = &adt_def.variants[variant];
11331133

1134-
ppaux::parameterized(fmt, substs, variant_def.did,
1135-
ppaux::Ns::Value, &[])?;
1134+
ppaux::parameterized(fmt, substs, variant_def.did, &[])?;
11361135

11371136
match variant_def.kind {
11381137
ty::VariantKind::Unit => Ok(()),
@@ -1227,7 +1226,7 @@ impl<'tcx> Debug for Literal<'tcx> {
12271226
use self::Literal::*;
12281227
match *self {
12291228
Item { def_id, substs } => {
1230-
ppaux::parameterized(fmt, substs, def_id, ppaux::Ns::Value, &[])
1229+
ppaux::parameterized(fmt, substs, def_id, &[])
12311230
}
12321231
Value { ref value } => {
12331232
write!(fmt, "const ")?;

src/librustc/traits/select.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ impl<'cx, 'gcx, 'tcx> SelectionContext<'cx, 'gcx, 'tcx> {
336336
self.infcx.tcx
337337
}
338338

339-
pub fn param_env(&self) -> &'cx ty::ParameterEnvironment<'tcx> {
339+
pub fn param_env(&self) -> &'cx ty::ParameterEnvironment<'gcx> {
340340
self.infcx.param_env()
341341
}
342342

src/librustc/traits/specialize/mod.rs

+8-8
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ pub fn find_method<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
148148
pub fn specializes<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
149149
impl1_def_id: DefId,
150150
impl2_def_id: DefId) -> bool {
151+
debug!("specializes({:?}, {:?})", impl1_def_id, impl2_def_id);
152+
151153
if let Some(r) = tcx.specializes_cache.borrow().check(impl1_def_id, impl2_def_id) {
152154
return r;
153155
}
@@ -177,21 +179,22 @@ pub fn specializes<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
177179
}
178180

179181
// create a parameter environment corresponding to a (skolemized) instantiation of impl1
180-
let mut penv = tcx.construct_parameter_environment(DUMMY_SP,
181-
impl1_def_id,
182-
region::DUMMY_CODE_EXTENT);
182+
let penv = tcx.construct_parameter_environment(DUMMY_SP,
183+
impl1_def_id,
184+
region::DUMMY_CODE_EXTENT);
183185
let impl1_trait_ref = tcx.impl_trait_ref(impl1_def_id)
184186
.unwrap()
185187
.subst(tcx, &penv.free_substs);
186188

187-
let result = tcx.infer_ctxt(None, None, Reveal::ExactMatch).enter(|mut infcx| {
189+
// Create a infcx, taking the predicates of impl1 as assumptions:
190+
let result = tcx.infer_ctxt(None, Some(penv), Reveal::ExactMatch).enter(|mut infcx| {
188191
// Normalize the trait reference, adding any obligations
189192
// that arise into the impl1 assumptions.
190193
let Normalized { value: impl1_trait_ref, obligations: normalization_obligations } = {
191194
let selcx = &mut SelectionContext::new(&infcx);
192195
traits::normalize(selcx, ObligationCause::dummy(), &impl1_trait_ref)
193196
};
194-
penv.caller_bounds.extend(normalization_obligations.into_iter().map(|o| {
197+
infcx.parameter_environment.caller_bounds.extend(normalization_obligations.into_iter().map(|o| {
195198
match tcx.lift_to_global(&o.predicate) {
196199
Some(predicate) => predicate,
197200
None => {
@@ -200,9 +203,6 @@ pub fn specializes<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
200203
}
201204
}));
202205

203-
// Install the parameter environment, taking the predicates of impl1 as assumptions:
204-
infcx.parameter_environment = penv;
205-
206206
// Attempt to prove that impl2 applies, given all of the above.
207207
fulfill_implication(&infcx, impl1_trait_ref, impl2_def_id).is_ok()
208208
});

src/librustc/ty/mod.rs

+14-2
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use util::nodemap::FnvHashMap;
3434

3535
use serialize::{self, Encodable, Encoder};
3636
use std::borrow::Cow;
37-
use std::cell::Cell;
37+
use std::cell::{Cell, RefCell};
3838
use std::hash::{Hash, Hasher};
3939
use std::iter;
4040
use std::ops::Deref;
@@ -1220,6 +1220,12 @@ pub struct ParameterEnvironment<'tcx> {
12201220
/// regions don't have this implicit scope and instead introduce
12211221
/// relationships in the environment.
12221222
pub free_id_outlive: CodeExtent,
1223+
1224+
/// A cache for `moves_by_default`.
1225+
pub is_copy_cache: RefCell<FnvHashMap<Ty<'tcx>, bool>>,
1226+
1227+
/// A cache for `type_is_sized`
1228+
pub is_sized_cache: RefCell<FnvHashMap<Ty<'tcx>, bool>>,
12231229
}
12241230

12251231
impl<'a, 'tcx> ParameterEnvironment<'tcx> {
@@ -1232,6 +1238,8 @@ impl<'a, 'tcx> ParameterEnvironment<'tcx> {
12321238
implicit_region_bound: self.implicit_region_bound,
12331239
caller_bounds: caller_bounds,
12341240
free_id_outlive: self.free_id_outlive,
1241+
is_copy_cache: RefCell::new(FnvHashMap()),
1242+
is_sized_cache: RefCell::new(FnvHashMap()),
12351243
}
12361244
}
12371245

@@ -2782,7 +2790,9 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
27822790
free_substs: Substs::empty(self),
27832791
caller_bounds: Vec::new(),
27842792
implicit_region_bound: self.mk_region(ty::ReEmpty),
2785-
free_id_outlive: free_id_outlive
2793+
free_id_outlive: free_id_outlive,
2794+
is_copy_cache: RefCell::new(FnvHashMap()),
2795+
is_sized_cache: RefCell::new(FnvHashMap()),
27862796
}
27872797
}
27882798

@@ -2853,6 +2863,8 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
28532863
implicit_region_bound: tcx.mk_region(ty::ReScope(free_id_outlive)),
28542864
caller_bounds: predicates,
28552865
free_id_outlive: free_id_outlive,
2866+
is_copy_cache: RefCell::new(FnvHashMap()),
2867+
is_sized_cache: RefCell::new(FnvHashMap()),
28562868
};
28572869

28582870
let cause = traits::ObligationCause::misc(span, free_id_outlive.node_id(&self.region_maps));

src/librustc/ty/structural_impls.rs

-17
Original file line numberDiff line numberDiff line change
@@ -908,23 +908,6 @@ impl<'tcx> TypeFoldable<'tcx> for ty::ClosureUpvar<'tcx> {
908908
}
909909
}
910910

911-
impl<'tcx> TypeFoldable<'tcx> for ty::ParameterEnvironment<'tcx> {
912-
fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self {
913-
ty::ParameterEnvironment {
914-
free_substs: self.free_substs.fold_with(folder),
915-
implicit_region_bound: self.implicit_region_bound.fold_with(folder),
916-
caller_bounds: self.caller_bounds.fold_with(folder),
917-
free_id_outlive: self.free_id_outlive,
918-
}
919-
}
920-
921-
fn super_visit_with<V: TypeVisitor<'tcx>>(&self, visitor: &mut V) -> bool {
922-
self.free_substs.visit_with(visitor) ||
923-
self.implicit_region_bound.visit_with(visitor) ||
924-
self.caller_bounds.visit_with(visitor)
925-
}
926-
}
927-
928911
impl<'tcx, T: TypeFoldable<'tcx>> TypeFoldable<'tcx> for ty::error::ExpectedFound<T> {
929912
fn super_fold_with<'gcx: 'tcx, F: TypeFolder<'gcx, 'tcx>>(&self, folder: &mut F) -> Self {
930913
ty::error::ExpectedFound {

0 commit comments

Comments
 (0)