Skip to content

Commit 8611577

Browse files
committed
Auto merge of #57765 - Mark-Simulacrum:bootstrap-bump, r=alexcrichton
Bump bootstrap compiler to 1.33 beta r? @alexcrichton or @pietroalbini cc @rust-lang/release
2 parents 71c365c + cd39cf7 commit 8611577

File tree

58 files changed

+182
-243
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

58 files changed

+182
-243
lines changed

Cargo.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -204,15 +204,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
204204

205205
[[package]]
206206
name = "cargo"
207-
version = "0.34.0"
207+
version = "0.35.0"
208208
dependencies = [
209209
"atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
210210
"bufstream 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
211211
"byteorder 1.2.7 (registry+https://github.com/rust-lang/crates.io-index)",
212212
"bytesize 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
213213
"clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)",
214214
"core-foundation 0.6.3 (registry+https://github.com/rust-lang/crates.io-index)",
215-
"crates-io 0.22.0",
215+
"crates-io 0.23.0",
216216
"crossbeam-utils 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
217217
"crypto-hash 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
218218
"curl 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -496,7 +496,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
496496

497497
[[package]]
498498
name = "crates-io"
499-
version = "0.22.0"
499+
version = "0.23.0"
500500
dependencies = [
501501
"curl 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)",
502502
"failure 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -2113,7 +2113,7 @@ dependencies = [
21132113
name = "rls"
21142114
version = "1.31.6"
21152115
dependencies = [
2116-
"cargo 0.34.0",
2116+
"cargo 0.35.0",
21172117
"cargo_metadata 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
21182118
"clippy_lints 0.0.212",
21192119
"crossbeam-channel 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)",

src/bootstrap/builder.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ use crate::install;
2121
use crate::native;
2222
use crate::test;
2323
use crate::tool;
24-
use crate::util::{add_lib_path, exe, libdir};
24+
use crate::util::{self, add_lib_path, exe, libdir};
2525
use crate::{Build, DocTests, Mode, GitRepo};
2626

2727
pub use crate::Compiler;
@@ -791,6 +791,13 @@ impl<'a> Builder<'a> {
791791
.env("CARGO_TARGET_DIR", out_dir)
792792
.arg(cmd);
793793

794+
// See comment in librustc_llvm/build.rs for why this is necessary, largely llvm-config
795+
// needs to not accidentally link to libLLVM in stage0/lib.
796+
cargo.env("REAL_LIBRARY_PATH_VAR", &util::dylib_path_var());
797+
if let Some(e) = env::var_os(util::dylib_path_var()) {
798+
cargo.env("REAL_LIBRARY_PATH", e);
799+
}
800+
794801
if cmd != "install" {
795802
cargo.arg("--target")
796803
.arg(target);

src/bootstrap/channel.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use crate::Build;
1414
use crate::config::Config;
1515

1616
// The version number
17-
pub const CFG_RELEASE_NUM: &str = "1.33.0";
17+
pub const CFG_RELEASE_NUM: &str = "1.34.0";
1818

1919
pub struct GitInfo {
2020
inner: Option<Info>,

src/bootstrap/compile.rs

+1
Original file line numberDiff line numberDiff line change
@@ -712,6 +712,7 @@ pub fn build_codegen_backend(builder: &Builder,
712712
if builder.is_rust_llvm(target) && backend != "emscripten" {
713713
cargo.env("LLVM_RUSTLLVM", "1");
714714
}
715+
715716
cargo.env("LLVM_CONFIG", &llvm_config);
716717
if backend != "emscripten" {
717718
let target_config = builder.config.target_config.get(&target);

src/bootstrap/dist.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ fn make_win_dist(
226226
let trim_chars: &[_] = &[' ', '='];
227227
let value =
228228
line[(idx + 1)..]
229-
.trim_left_matches(trim_chars)
229+
.trim_start_matches(trim_chars)
230230
.split(';')
231231
.map(PathBuf::from);
232232

src/bootstrap/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ impl Build {
423423
Command::new(&build.initial_rustc).arg("--version").arg("--verbose"));
424424
let local_release = local_version_verbose
425425
.lines().filter(|x| x.starts_with("release:"))
426-
.next().unwrap().trim_left_matches("release:").trim();
426+
.next().unwrap().trim_start_matches("release:").trim();
427427
let my_version = channel::CFG_RELEASE_NUM;
428428
if local_release.split('.').take(2).eq(my_version.split('.').take(2)) {
429429
build.verbose(&format!("auto-detected local-rebuild {}", local_release));

src/bootstrap/util.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ pub fn dylib_path_var() -> &'static str {
7070
/// Parses the `dylib_path_var()` environment variable, returning a list of
7171
/// paths that are members of this lookup path.
7272
pub fn dylib_path() -> Vec<PathBuf> {
73-
env::split_paths(&env::var_os(dylib_path_var()).unwrap_or_default()).collect()
73+
let var = match env::var_os(dylib_path_var()) {
74+
Some(v) => v,
75+
None => return vec![],
76+
};
77+
env::split_paths(&var).collect()
7478
}
7579

7680
/// `push` all components to `buf`. On windows, append `.exe` to the last component.

src/build_helper/lib.rs

+19
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,25 @@ macro_rules! t {
2323
};
2424
}
2525

26+
// Because Cargo adds the compiler's dylib path to our library search path, llvm-config may
27+
// break: the dylib path for the compiler, as of this writing, contains a copy of the LLVM
28+
// shared library, which means that when our freshly built llvm-config goes to load it's
29+
// associated LLVM, it actually loads the compiler's LLVM. In particular when building the first
30+
// compiler (i.e., in stage 0) that's a problem, as the compiler's LLVM is likely different from
31+
// the one we want to use. As such, we restore the environment to what bootstrap saw. This isn't
32+
// perfect -- we might actually want to see something from Cargo's added library paths -- but
33+
// for now it works.
34+
pub fn restore_library_path() {
35+
println!("cargo:rerun-if-env-changed=REAL_LIBRARY_PATH_VAR");
36+
println!("cargo:rerun-if-env-changed=REAL_LIBRARY_PATH");
37+
let key = env::var_os("REAL_LIBRARY_PATH_VAR").expect("REAL_LIBRARY_PATH_VAR");
38+
if let Some(env) = env::var_os("REAL_LIBRARY_PATH") {
39+
env::set_var(&key, &env);
40+
} else {
41+
env::remove_var(&key);
42+
}
43+
}
44+
2645
pub fn run(cmd: &mut Command) {
2746
println!("running: {:?}", cmd);
2847
run_silent(cmd);

src/liballoc/benches/vec_deque_append.rs

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#![cfg_attr(stage0, feature(duration_as_u128))]
21
use std::{collections::VecDeque, time::Instant};
32

43
const VECDEQUE_LEN: i32 = 100000;

src/liballoc/tests/binary_heap.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::cmp;
22
use std::collections::BinaryHeap;
33
use std::collections::binary_heap::{Drain, PeekMut};
44
use std::panic::{self, AssertUnwindSafe};
5-
use std::sync::atomic::{AtomicUsize, ATOMIC_USIZE_INIT, Ordering};
5+
use std::sync::atomic::{AtomicUsize, Ordering};
66

77
use rand::{thread_rng, seq::SliceRandom};
88

@@ -283,7 +283,7 @@ fn assert_covariance() {
283283
// Destructors must be called exactly once per element.
284284
#[test]
285285
fn panic_safe() {
286-
static DROP_COUNTER: AtomicUsize = ATOMIC_USIZE_INIT;
286+
static DROP_COUNTER: AtomicUsize = AtomicUsize::new(0);
287287

288288
#[derive(Eq, PartialEq, Ord, Clone, Debug)]
289289
struct PanicOrd<T>(T, bool);

src/liballoc/tests/slice.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use std::mem;
55
use std::panic;
66
use std::rc::Rc;
77
use std::sync::atomic::Ordering::Relaxed;
8-
use std::sync::atomic::{ATOMIC_USIZE_INIT, AtomicUsize};
8+
use std::sync::atomic::AtomicUsize;
99
use std::thread;
1010

1111
use rand::{Rng, RngCore, thread_rng, seq::SliceRandom};
@@ -1500,7 +1500,7 @@ static DROP_COUNTS: [AtomicUsize; MAX_LEN] = [
15001500
AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0), AtomicUsize::new(0),
15011501
];
15021502

1503-
static VERSIONS: AtomicUsize = ATOMIC_USIZE_INIT;
1503+
static VERSIONS: AtomicUsize = AtomicUsize::new(0);
15041504

15051505
#[derive(Clone, Eq)]
15061506
struct DropCounter {

src/libcore/intrinsics.rs

-1
Original file line numberDiff line numberDiff line change
@@ -692,7 +692,6 @@ extern "rust-intrinsic" {
692692

693693
/// A guard for unsafe functions that cannot ever be executed if `T` is uninhabited:
694694
/// This will statically either panic, or do nothing.
695-
#[cfg(not(stage0))]
696695
pub fn panic_if_uninhabited<T>();
697696

698697
/// Creates a value initialized to zero.

src/libcore/lib.rs

+2-5
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,6 @@
7171
#![feature(cfg_target_has_atomic)]
7272
#![feature(concat_idents)]
7373
#![feature(const_fn)]
74-
#![cfg_attr(stage0, feature(const_int_ops))]
7574
#![feature(const_fn_union)]
7675
#![feature(custom_attribute)]
7776
#![feature(doc_cfg)]
@@ -112,19 +111,17 @@
112111
#![feature(aarch64_target_feature)]
113112
#![feature(wasm_target_feature)]
114113
#![feature(avx512_target_feature)]
115-
#![cfg_attr(not(stage0), feature(cmpxchg16b_target_feature))]
114+
#![feature(cmpxchg16b_target_feature)]
116115
#![feature(const_slice_len)]
117116
#![feature(const_str_as_bytes)]
118117
#![feature(const_str_len)]
119-
#![cfg_attr(stage0, feature(const_let))]
120-
#![cfg_attr(stage0, feature(const_int_rotate))]
121118
#![feature(const_int_conversion)]
122119
#![feature(const_transmute)]
123120
#![feature(reverse_bits)]
124121
#![feature(non_exhaustive)]
125122
#![feature(structural_match)]
126123
#![feature(abi_unadjusted)]
127-
#![cfg_attr(not(stage0), feature(adx_target_feature))]
124+
#![feature(adx_target_feature)]
128125

129126
#[prelude_import]
130127
#[allow(unused)]

src/libcore/mem.rs

-3
Original file line numberDiff line numberDiff line change
@@ -491,7 +491,6 @@ pub const fn needs_drop<T>() -> bool {
491491
#[inline]
492492
#[stable(feature = "rust1", since = "1.0.0")]
493493
pub unsafe fn zeroed<T>() -> T {
494-
#[cfg(not(stage0))]
495494
intrinsics::panic_if_uninhabited::<T>();
496495
intrinsics::init()
497496
}
@@ -625,7 +624,6 @@ pub unsafe fn zeroed<T>() -> T {
625624
#[rustc_deprecated(since = "2.0.0", reason = "use `mem::MaybeUninit::uninitialized` instead")]
626625
#[stable(feature = "rust1", since = "1.0.0")]
627626
pub unsafe fn uninitialized<T>() -> T {
628-
#[cfg(not(stage0))]
629627
intrinsics::panic_if_uninhabited::<T>();
630628
intrinsics::uninit()
631629
}
@@ -1104,7 +1102,6 @@ impl<T> MaybeUninit<T> {
11041102
#[unstable(feature = "maybe_uninit", issue = "53491")]
11051103
#[inline(always)]
11061104
pub unsafe fn into_inner(self) -> T {
1107-
#[cfg(not(stage0))]
11081105
intrinsics::panic_if_uninhabited::<T>();
11091106
ManuallyDrop::into_inner(self.value)
11101107
}

src/libcore/num/bignum.rs

-11
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,6 @@ macro_rules! impl_full_ops {
4646
($($ty:ty: add($addfn:path), mul/div($bigty:ident);)*) => (
4747
$(
4848
impl FullOps for $ty {
49-
#[cfg(stage0)]
50-
fn full_add(self, other: $ty, carry: bool) -> (bool, $ty) {
51-
// This cannot overflow; the output is between `0` and `2 * 2^nbits - 1`.
52-
// FIXME: will LLVM optimize this into ADC or similar?
53-
let (v, carry1) = unsafe { intrinsics::add_with_overflow(self, other) };
54-
let (v, carry2) = unsafe {
55-
intrinsics::add_with_overflow(v, if carry {1} else {0})
56-
};
57-
(carry1 || carry2, v)
58-
}
59-
#[cfg(not(stage0))]
6049
fn full_add(self, other: $ty, carry: bool) -> (bool, $ty) {
6150
// This cannot overflow; the output is between `0` and `2 * 2^nbits - 1`.
6251
// FIXME: will LLVM optimize this into ADC or similar?

0 commit comments

Comments
 (0)