Skip to content

Commit

Permalink
Auto merge of #94224 - Mark-Simulacrum:stable-next, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
[stable] 1.59.0 release

This adds in a few backports:

*  Destabilise entry_insert #94105
*  Update compiler_builtins to fix duplicate symbols in armv7-linux-androideabi rlib #93436

This also includes a fresh commit replicating the 1.52.1 patch soft-disabling incremental for 1.59, in light of discussion on #94124. This hasn't yet been fully approved but I think is the likely way things will go, so preparing the first round of stable artifacts with that in mind.

r? `@Mark-Simulacrum`
  • Loading branch information
bors committed Feb 22, 2022
2 parents 1945ce6 + 6af5faf commit 3a06854
Show file tree
Hide file tree
Showing 10 changed files with 407 additions and 107 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock
Original file line number Diff line number Diff line change
Expand Up @@ -678,9 +678,9 @@ dependencies = [

[[package]]
name = "compiler_builtins"
version = "0.1.66"
version = "0.1.67"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "191424db7756bbed2c4996959a0fbda94388abcf4f5a2728a8af17481ad9c4f7"
checksum = "a68c69e9451f1df4b215c9588c621670c12286b53e60fb5ec4b59aaa1138d18e"
dependencies = [
"cc",
"rustc-std-workspace-core",
Expand Down
458 changes: 360 additions & 98 deletions RELEASES.md

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion compiler/rustc_session/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2102,7 +2102,12 @@ pub fn build_session_options(matches: &getopts::Matches) -> Options {

check_thread_count(&debugging_opts, error_format);

let incremental = cg.incremental.as_ref().map(PathBuf::from);
let incremental =
if std::env::var_os("RUSTC_FORCE_INCREMENTAL").map(|v| v == "1").unwrap_or(false) {
cg.incremental.as_ref().map(PathBuf::from)
} else {
None
};

let assert_incr_state =
parse_assert_incr_state(&debugging_opts.assert_incr_state, error_format);
Expand Down
2 changes: 1 addition & 1 deletion library/std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ panic_unwind = { path = "../panic_unwind", optional = true }
panic_abort = { path = "../panic_abort" }
core = { path = "../core" }
libc = { version = "0.2.108", default-features = false, features = ['rustc-dep-of-std'] }
compiler_builtins = { version = "0.1.66" }
compiler_builtins = { version = "0.1.67" }
profiler_builtins = { path = "../profiler_builtins", optional = true }
unwind = { path = "../unwind" }
hashbrown = { version = "0.11", default-features = false, features = ['rustc-dep-of-std'] }
Expand Down
6 changes: 4 additions & 2 deletions library/std/src/collections/hash/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2462,6 +2462,7 @@ impl<'a, K, V> Entry<'a, K, V> {
/// # Examples
///
/// ```
/// #![feature(entry_insert)]
/// use std::collections::HashMap;
///
/// let mut map: HashMap<&str, String> = HashMap::new();
Expand All @@ -2470,7 +2471,7 @@ impl<'a, K, V> Entry<'a, K, V> {
/// assert_eq!(entry.key(), &"poneyland");
/// ```
#[inline]
#[stable(feature = "entry_insert", since = "1.59.0")]
#[unstable(feature = "entry_insert", issue = "65225")]
pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V> {
match self {
Occupied(mut entry) => {
Expand Down Expand Up @@ -2804,6 +2805,7 @@ impl<'a, K: 'a, V: 'a> VacantEntry<'a, K, V> {
/// # Examples
///
/// ```
/// #![feature(entry_insert)]
/// use std::collections::HashMap;
/// use std::collections::hash_map::Entry;
///
Expand All @@ -2815,7 +2817,7 @@ impl<'a, K: 'a, V: 'a> VacantEntry<'a, K, V> {
/// assert_eq!(map["poneyland"], 37);
/// ```
#[inline]
#[stable(feature = "entry_insert", since = "1.59.0")]
#[unstable(feature = "entry_insert", issue = "65225")]
pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V> {
let base = self.base.insert_entry(value);
OccupiedEntry { base }
Expand Down
2 changes: 1 addition & 1 deletion src/ci/channel
Original file line number Diff line number Diff line change
@@ -1 +1 @@
beta
stable
3 changes: 3 additions & 0 deletions src/doc/rustc/src/codegen-options/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ to save information after compiling a crate to be reused when recompiling the
crate, improving re-compile times. This takes a path to a directory where
incremental files will be stored.

Note that this option currently does not take effect unless
`RUSTC_FORCE_INCREMENTAL=1` in the environment.

## inline-threshold

This option lets you set the default threshold for inlining a function. It
Expand Down
4 changes: 3 additions & 1 deletion src/test/run-make/dep-graph/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
# Just verify that we successfully run and produce dep graphs when requested.

all:
RUST_DEP_GRAPH=$(TMPDIR)/dep-graph $(RUSTC) \
RUST_DEP_GRAPH=$(TMPDIR)/dep-graph \
RUSTC_FORCE_INCREMENTAL=1 \
$(RUSTC) \
-Cincremental=$(TMPDIR)/incr \
-Zquery-dep-graph -Zdump-dep-graph foo.rs
test -f $(TMPDIR)/dep-graph.txt
Expand Down
1 change: 1 addition & 0 deletions src/test/run-make/incremental-session-fail/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ all:
# Make it so that rustc will fail to create a session directory.
touch $(SESSION_DIR)
# Check exit code is 1 for an error, and not 101 for ICE.
RUSTC_FORCE_INCREMENTAL=1 \
$(RUSTC) foo.rs --crate-type=rlib -C incremental=$(SESSION_DIR) > $(OUTPUT_FILE) 2>&1; [ $$? -eq 1 ]
$(CGREP) "Could not create incremental compilation crate directory" < $(OUTPUT_FILE)
# -v tests are fragile, hopefully this text won't change
Expand Down
27 changes: 26 additions & 1 deletion src/tools/compiletest/src/runtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,15 @@ pub fn run(config: Config, testpaths: &TestPaths, revision: Option<&str>) {
}
debug!("running {:?}", testpaths.file.display());
let mut props = TestProps::from_file(&testpaths.file, revision, &config);

// Currently, incremental is soft disabled unless this environment
// variable is set. A bunch of our tests assume it's enabled, though - so
// just enable it for our tests.
//
// This is deemed preferable to ignoring those tests; we still want to test
// incremental somewhat, as users can opt in to it.
props.rustc_env.push((String::from("RUSTC_FORCE_INCREMENTAL"), String::from("1")));

if props.incremental {
props.incremental_dir = Some(incremental_dir(&config, testpaths));
}
Expand All @@ -146,6 +155,12 @@ pub fn run(config: Config, testpaths: &TestPaths, revision: Option<&str>) {
assert!(!props.revisions.is_empty(), "Incremental tests require revisions.");
for revision in &props.revisions {
let mut revision_props = TestProps::from_file(&testpaths.file, Some(revision), &config);

// See above - need to enable it explicitly for now.
revision_props
.rustc_env
.push((String::from("RUSTC_FORCE_INCREMENTAL"), String::from("1")));

revision_props.incremental_dir = props.incremental_dir.clone();
let rev_cx = TestCx {
config: &config,
Expand Down Expand Up @@ -1630,7 +1645,17 @@ impl<'test> TestCx<'test> {
/// Returns whether or not it is a dylib.
fn build_auxiliary(&self, source_path: &str, aux_dir: &Path) -> bool {
let aux_testpaths = self.compute_aux_test_paths(source_path);
let aux_props = self.props.from_aux_file(&aux_testpaths.file, self.revision, self.config);
let mut aux_props =
self.props.from_aux_file(&aux_testpaths.file, self.revision, self.config);

// Currently, incremental is soft disabled unless this environment
// variable is set. A bunch of our tests assume it's enabled, though - so
// just enable it for our tests.
//
// This is deemed preferable to ignoring those tests; we still want to test
// incremental somewhat, as users can opt in to it.
aux_props.rustc_env.push((String::from("RUSTC_FORCE_INCREMENTAL"), String::from("1")));

let aux_output = TargetLocation::ThisDirectory(self.aux_output_dir_name());
let aux_cx = TestCx {
config: self.config,
Expand Down

0 comments on commit 3a06854

Please sign in to comment.