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

Switch master to 1.38 #62376

Merged
merged 2 commits into from
Jul 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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: 1 addition & 1 deletion src/bootstrap/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ use build_helper::output;
use crate::Build;

// The version number
pub const CFG_RELEASE_NUM: &str = "1.37.0";
pub const CFG_RELEASE_NUM: &str = "1.38.0";

pub struct GitInfo {
inner: Option<Info>,
Expand Down
3 changes: 1 addition & 2 deletions src/liballoc/alloc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ extern "Rust" {
// them from the `#[global_allocator]` attribute if there is one, or uses the
// default implementations in libstd (`__rdl_alloc` etc in `src/libstd/alloc.rs`)
// otherwise.
#[cfg_attr(bootstrap, allocator)]
#[cfg_attr(not(bootstrap), rustc_allocator)]
#[rustc_allocator]
#[rustc_allocator_nounwind]
fn __rust_alloc(size: usize, align: usize) -> *mut u8;
#[rustc_allocator_nounwind]
Expand Down
1 change: 0 additions & 1 deletion src/liballoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@
#![feature(coerce_unsized)]
#![feature(dispatch_from_dyn)]
#![feature(core_intrinsics)]
#![cfg_attr(bootstrap, feature(custom_attribute))]
#![feature(dropck_eyepatch)]
#![feature(exact_size_is_empty)]
#![feature(fmt_internals)]
Expand Down
6 changes: 0 additions & 6 deletions src/libcore/ffi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -302,7 +302,6 @@ impl<T> sealed_trait::VaArgSafe for *const T {}
reason = "the `c_variadic` feature has not been properly tested on \
all supported platforms",
issue = "44930")]
#[cfg(not(bootstrap))]
impl<'f> VaListImpl<'f> {
/// Advance to the next arg.
#[inline]
Expand All @@ -324,7 +323,6 @@ impl<'f> VaListImpl<'f> {
reason = "the `c_variadic` feature has not been properly tested on \
all supported platforms",
issue = "44930")]
#[cfg(not(bootstrap))]
impl<'f> Clone for VaListImpl<'f> {
#[inline]
fn clone(&self) -> Self {
Expand All @@ -340,7 +338,6 @@ impl<'f> Clone for VaListImpl<'f> {
reason = "the `c_variadic` feature has not been properly tested on \
all supported platforms",
issue = "44930")]
#[cfg(not(bootstrap))]
impl<'f> Drop for VaListImpl<'f> {
fn drop(&mut self) {
// FIXME: this should call `va_end`, but there's no clean way to
Expand All @@ -359,15 +356,12 @@ impl<'f> Drop for VaListImpl<'f> {
extern "rust-intrinsic" {
/// Destroy the arglist `ap` after initialization with `va_start` or
/// `va_copy`.
#[cfg(not(bootstrap))]
fn va_end(ap: &mut VaListImpl<'_>);

/// Copies the current location of arglist `src` to the arglist `dst`.
#[cfg(not(bootstrap))]
fn va_copy<'f>(dest: *mut VaListImpl<'f>, src: &VaListImpl<'f>);

/// Loads an argument of type `T` from the `va_list` `ap` and increment the
/// argument `ap` points to.
#[cfg(not(bootstrap))]
fn va_arg<T: sealed_trait::VaArgSafe>(ap: &mut VaListImpl<'_>) -> T;
}
2 changes: 1 addition & 1 deletion src/libcore/future/future.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ use crate::task::{Context, Poll};
#[doc(spotlight)]
#[must_use = "futures do nothing unless you `.await` or poll them"]
#[stable(feature = "futures_api", since = "1.36.0")]
#[cfg_attr(not(bootstrap), lang = "future_trait")]
#[lang = "future_trait"]
pub trait Future {
/// The type of value produced on completion.
#[stable(feature = "futures_api", since = "1.36.0")]
Expand Down
57 changes: 0 additions & 57 deletions src/libcore/intrinsics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1052,16 +1052,12 @@ extern "rust-intrinsic" {
pub fn fabsf64(x: f64) -> f64;

/// Returns the minimum of two `f32` values.
#[cfg(not(bootstrap))]
pub fn minnumf32(x: f32, y: f32) -> f32;
/// Returns the minimum of two `f64` values.
#[cfg(not(bootstrap))]
pub fn minnumf64(x: f64, y: f64) -> f64;
/// Returns the maximum of two `f32` values.
#[cfg(not(bootstrap))]
pub fn maxnumf32(x: f32, y: f32) -> f32;
/// Returns the maximum of two `f64` values.
#[cfg(not(bootstrap))]
pub fn maxnumf64(x: f64, y: f64) -> f64;

/// Copies the sign from `y` to `x` for `f32` values.
Expand Down Expand Up @@ -1255,17 +1251,14 @@ extern "rust-intrinsic" {

/// Returns the result of an unchecked addition, resulting in
/// undefined behavior when `x + y > T::max_value()` or `x + y < T::min_value()`.
#[cfg(not(bootstrap))]
pub fn unchecked_add<T>(x: T, y: T) -> T;

/// Returns the result of an unchecked substraction, resulting in
/// undefined behavior when `x - y > T::max_value()` or `x - y < T::min_value()`.
#[cfg(not(bootstrap))]
pub fn unchecked_sub<T>(x: T, y: T) -> T;

/// Returns the result of an unchecked multiplication, resulting in
/// undefined behavior when `x * y > T::max_value()` or `x * y < T::min_value()`.
#[cfg(not(bootstrap))]
pub fn unchecked_mul<T>(x: T, y: T) -> T;

/// Performs rotate left.
Expand Down Expand Up @@ -1563,53 +1556,3 @@ pub unsafe fn write_bytes<T>(dst: *mut T, val: u8, count: usize) {
}
write_bytes(dst, val, count)
}

// Simple bootstrap implementations of minnum/maxnum for stage0 compilation.

/// Returns the minimum of two `f32` values.
#[cfg(bootstrap)]
pub fn minnumf32(x: f32, y: f32) -> f32 {
// IEEE754 says: minNum(x, y) is the canonicalized number x if x < y, y if y < x, the
// canonicalized number if one operand is a number and the other a quiet NaN. Otherwise it
// is either x or y, canonicalized (this means results might differ among implementations).
// When either x or y is a signaling NaN, then the result is according to 6.2.
//
// Since we do not support sNaN in Rust yet, we do not need to handle them.
// FIXME(nagisa): due to https://bugs.llvm.org/show_bug.cgi?id=33303 we canonicalize by
// multiplying by 1.0. Should switch to the `canonicalize` when it works.
(if x < y || y != y { x } else { y }) * 1.0
}

/// Returns the minimum of two `f64` values.
#[cfg(bootstrap)]
pub fn minnumf64(x: f64, y: f64) -> f64 {
// Identical to the `f32` case.
(if x < y || y != y { x } else { y }) * 1.0
}

/// Returns the maximum of two `f32` values.
#[cfg(bootstrap)]
pub fn maxnumf32(x: f32, y: f32) -> f32 {
// IEEE754 says: maxNum(x, y) is the canonicalized number y if x < y, x if y < x, the
// canonicalized number if one operand is a number and the other a quiet NaN. Otherwise it
// is either x or y, canonicalized (this means results might differ among implementations).
// When either x or y is a signaling NaN, then the result is according to 6.2.
//
// Since we do not support sNaN in Rust yet, we do not need to handle them.
// FIXME(nagisa): due to https://bugs.llvm.org/show_bug.cgi?id=33303 we canonicalize by
// multiplying by 1.0. Should switch to the `canonicalize` when it works.
(if x < y || x != x { y } else { x }) * 1.0
}

/// Returns the maximum of two `f64` values.
#[cfg(bootstrap)]
pub fn maxnumf64(x: f64, y: f64) -> f64 {
// Identical to the `f32` case.
(if x < y || x != x { y } else { x }) * 1.0
}

/// For bootstrapping, implement unchecked_sub as just wrapping_sub.
#[cfg(bootstrap)]
pub unsafe fn unchecked_sub<T>(x: T, y: T) -> T {
sub_with_overflow(x, y).0
}
2 changes: 1 addition & 1 deletion src/libcore/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
#![feature(staged_api)]
#![feature(std_internals)]
#![feature(stmt_expr_attributes)]
#![cfg_attr(not(bootstrap), feature(transparent_unions))]
#![feature(transparent_unions)]
#![feature(unboxed_closures)]
#![feature(unsized_locals)]
#![feature(untagged_unions)]
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/mem/maybe_uninit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ use crate::mem::ManuallyDrop;
#[allow(missing_debug_implementations)]
#[stable(feature = "maybe_uninit", since = "1.36.0")]
#[derive(Copy)]
#[cfg_attr(not(bootstrap), repr(transparent))]
#[repr(transparent)]
pub union MaybeUninit<T> {
uninit: (),
value: ManuallyDrop<T>,
Expand Down
2 changes: 1 addition & 1 deletion src/libcore/num/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ assert_eq!(size_of::<Option<core::num::", stringify!($Ty), ">>(), size_of::<", s
#[derive(Copy, Clone, Eq, PartialEq, Ord, PartialOrd, Hash)]
#[repr(transparent)]
#[rustc_layout_scalar_valid_range_start(1)]
#[cfg_attr(not(bootstrap), rustc_nonnull_optimization_guaranteed)]
#[rustc_nonnull_optimization_guaranteed]
pub struct $Ty($Int);
}

Expand Down
2 changes: 1 addition & 1 deletion src/libcore/ptr/non_null.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use crate::cmp::Ordering;
#[stable(feature = "nonnull", since = "1.25.0")]
#[repr(transparent)]
#[rustc_layout_scalar_valid_range_start(1)]
#[cfg_attr(not(bootstrap), rustc_nonnull_optimization_guaranteed)]
#[rustc_nonnull_optimization_guaranteed]
pub struct NonNull<T: ?Sized> {
pointer: *const T,
}
Expand Down
1 change: 1 addition & 0 deletions src/librustc_codegen_llvm/common.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ impl CodegenCx<'ll, 'tcx> {
pub fn const_get_real(&self, v: &'ll Value) -> Option<(f64, bool)> {
unsafe {
if self.is_const_real(v) {
#[allow(deprecated)]
let mut loses_info: llvm::Bool = ::std::mem::uninitialized();
let r = llvm::LLVMConstRealGetDouble(v, &mut loses_info);
let loses_info = if loses_info == 1 { true } else { false };
Expand Down
4 changes: 1 addition & 3 deletions src/librustc_data_structures/macros.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/// A simple static assertion macro.
#[macro_export]
#[cfg_attr(bootstrap, allow_internal_unstable(type_ascription, underscore_const_names))]
#[cfg_attr(not(bootstrap), allow_internal_unstable(type_ascription))]
#[allow_internal_unstable(type_ascription)]
macro_rules! static_assert {
($test:expr) => {
// Use the bool to access an array such that if the bool is false, the access
Expand All @@ -13,7 +12,6 @@ macro_rules! static_assert {

/// Type size assertion. The first argument is a type and the second argument is its expected size.
#[macro_export]
#[cfg_attr(bootstrap, allow_internal_unstable(underscore_const_names))]
macro_rules! static_assert_size {
($ty:ty, $size:expr) => {
const _: [(); $size] = [(); ::std::mem::size_of::<$ty>()];
Expand Down
1 change: 0 additions & 1 deletion src/librustc_resolve/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#![feature(mem_take)]
#![feature(nll)]
#![feature(rustc_diagnostic_macros)]
#![cfg_attr(bootstrap, feature(type_alias_enum_variants))]

#![recursion_limit="256"]

Expand Down
1 change: 1 addition & 0 deletions src/libstd/io/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ pub fn copy<R: ?Sized, W: ?Sized>(reader: &mut R, writer: &mut W) -> io::Result<
where R: Read, W: Write
{
let mut buf = unsafe {
#[allow(deprecated)]
let mut buf: [u8; super::DEFAULT_BUF_SIZE] = mem::uninitialized();
reader.initializer().initialize(&mut buf);
buf
Expand Down
2 changes: 2 additions & 0 deletions src/libstd/sys/cloudabi/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(deprecated)] // mem::uninitialized

use crate::io::ErrorKind;
use crate::mem;

Expand Down
2 changes: 2 additions & 0 deletions src/libstd/sys/sgx/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
//! This module contains the facade (aka platform-specific) implementations of
//! OS level functionality for Fortanix SGX.

#![allow(deprecated)]

use crate::io::ErrorKind;
use crate::os::raw::c_char;
use crate::sync::atomic::{AtomicBool, Ordering};
Expand Down
11 changes: 0 additions & 11 deletions src/libsyntax/tokenstream.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,17 +59,6 @@ where
TokenStream: Send + Sync,
{}

// These are safe since we ensure that they hold for all fields in the `_dummy` function.
//
// These impls are only here because the compiler takes forever to compute the Send and Sync
// bounds without them.
// FIXME: Remove these impls when the compiler can compute the bounds quickly again.
// See https://github.com/rust-lang/rust/issues/60846
#[cfg(all(bootstrap, parallel_compiler))]
unsafe impl Send for TokenTree {}
#[cfg(all(bootstrap, parallel_compiler))]
unsafe impl Sync for TokenTree {}

impl TokenTree {
/// Use this token tree as a matcher to parse given tts.
pub fn parse(cx: &base::ExtCtxt<'_>, mtch: &[quoted::TokenTree], tts: TokenStream)
Expand Down
1 change: 1 addition & 0 deletions src/libterm/win.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ impl<T: Write + Send + 'static> WinConsole<T> {
let fg;
let bg;
unsafe {
#[allow(deprecated)]
let mut buffer_info = ::std::mem::uninitialized();
if GetConsoleScreenBufferInfo(GetStdHandle(-11i32 as DWORD), &mut buffer_info) != 0 {
fg = bits_to_color(buffer_info.wAttributes);
Expand Down
8 changes: 3 additions & 5 deletions src/libunwind/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ fn main() {
println!("cargo:rerun-if-changed=build.rs");
let target = env::var("TARGET").expect("TARGET was not set");

// FIXME: the not(bootstrap) part is needed because of the issue addressed by #62286,
// and could be removed once that change is in beta.
if cfg!(all(not(bootstrap), feature = "llvm-libunwind")) &&
if cfg!(feature = "llvm-libunwind") &&
(target.contains("linux") ||
target.contains("fuchsia")) {
// Build the unwinding from libunwind C/C++ source code.
#[cfg(all(not(bootstrap), feature = "llvm-libunwind"))]
#[cfg(feature = "llvm-libunwind")]
llvm_libunwind::compile();
} else if target.contains("linux") {
if target.contains("musl") {
Expand Down Expand Up @@ -44,7 +42,7 @@ fn main() {
}
}

#[cfg(all(not(bootstrap), feature = "llvm-libunwind"))]
#[cfg(feature = "llvm-libunwind")]
mod llvm_libunwind {
use std::env;
use std::path::Path;
Expand Down
10 changes: 5 additions & 5 deletions src/libunwind/libunwind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub enum _Unwind_Context {}

pub type _Unwind_Exception_Cleanup_Fn = extern "C" fn(unwind_code: _Unwind_Reason_Code,
exception: *mut _Unwind_Exception);
#[cfg_attr(all(not(bootstrap), feature = "llvm-libunwind"),
#[cfg_attr(feature = "llvm-libunwind",
link(name = "unwind", kind = "static"))]
extern "C" {
#[unwind(allowed)]
Expand All @@ -93,7 +93,7 @@ if #[cfg(all(any(target_os = "ios", target_os = "netbsd", not(target_arch = "arm
}
pub use _Unwind_Action::*;

#[cfg_attr(all(not(bootstrap), feature = "llvm-libunwind"),
#[cfg_attr(feature = "llvm-libunwind",
link(name = "unwind", kind = "static"))]
extern "C" {
pub fn _Unwind_GetGR(ctx: *mut _Unwind_Context, reg_index: c_int) -> _Unwind_Word;
Expand Down Expand Up @@ -148,7 +148,7 @@ if #[cfg(all(any(target_os = "ios", target_os = "netbsd", not(target_arch = "arm
pub const UNWIND_POINTER_REG: c_int = 12;
pub const UNWIND_IP_REG: c_int = 15;

#[cfg_attr(all(not(bootstrap), feature = "llvm-libunwind"),
#[cfg_attr(feature = "llvm-libunwind",
link(name = "unwind", kind = "static"))]
extern "C" {
fn _Unwind_VRS_Get(ctx: *mut _Unwind_Context,
Expand Down Expand Up @@ -212,7 +212,7 @@ if #[cfg(all(any(target_os = "ios", target_os = "netbsd", not(target_arch = "arm
cfg_if::cfg_if! {
if #[cfg(not(all(target_os = "ios", target_arch = "arm")))] {
// Not 32-bit iOS
#[cfg_attr(all(not(bootstrap), feature = "llvm-libunwind"),
#[cfg_attr(feature = "llvm-libunwind",
link(name = "unwind", kind = "static"))]
extern "C" {
#[unwind(allowed)]
Expand All @@ -223,7 +223,7 @@ if #[cfg(not(all(target_os = "ios", target_arch = "arm")))] {
}
} else {
// 32-bit iOS uses SjLj and does not provide _Unwind_Backtrace()
#[cfg_attr(all(not(bootstrap), feature = "llvm-libunwind"),
#[cfg_attr(feature = "llvm-libunwind",
link(name = "unwind", kind = "static"))]
extern "C" {
#[unwind(allowed)]
Expand Down
2 changes: 1 addition & 1 deletion src/stage0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# source tarball for a stable release you'll likely see `1.x.0` for rustc and
# `0.x.0` for Cargo where they were released on `date`.

date: 2019-05-23
date: 2019-07-04
rustc: beta
cargo: beta

Expand Down
1 change: 1 addition & 0 deletions src/test/run-make-fulldeps/sanitizer-memory/uninit.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use std::mem;

fn main() {
#[allow(deprecated)]
let xs: [u8; 4] = unsafe { mem::uninitialized() };
let y = xs[0] + xs[1];
}
1 change: 1 addition & 0 deletions src/test/run-pass/for-loop-while/for-loop-has-unit-body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
fn main() {
// Check that the tail statement in the body unifies with something
for _ in 0..3 {
#[allow(deprecated)]
unsafe { std::mem::uninitialized() }
}

Expand Down
1 change: 1 addition & 0 deletions src/test/run-pass/issues/issue-58212.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ trait FromUnchecked {

impl FromUnchecked for [u8; 1] {
unsafe fn from_unchecked() {
#[allow(deprecated)]
let mut array: Self = std::mem::uninitialized();
let _ptr = &mut array as *mut [u8] as *mut u8;
}
Expand Down
1 change: 1 addition & 0 deletions src/test/run-pass/panic-uninitialized-zeroed.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
// in a runtime panic.

#![feature(never_type)]
#![allow(deprecated)]

use std::{mem, panic};

Expand Down
Loading