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 10 pull requests #63571

Closed
wants to merge 45 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
3b229f1
check that ptr is valid already when doing Deref, not only when doing…
RalfJung Jul 27, 2019
5800bec
discourage use of ref_to_mplace
RalfJung Jul 28, 2019
3677c5b
the alignment checks on access can no longer fail now
RalfJung Jul 28, 2019
e4c39e1
better name for check_in_alloc
RalfJung Jul 28, 2019
388d99d
fix tests
RalfJung Jul 28, 2019
74fbdb6
move 'get me the access-checked version of an mplace' into separate f…
RalfJung Jul 28, 2019
647c0e0
'Ref' can now be sure it gets a 'Pointer'
RalfJung Jul 28, 2019
a4af9d1
parse_pat_with_range_pat: remove unnecessary assignments.
Centril Aug 12, 2019
90793c0
extract parse_pat_deref
Centril Aug 12, 2019
c69b3ed
extract parse_pat_tuple_or_parens
Centril Aug 12, 2019
3b65133
extract recover_pat_ident_mut_first
Centril Aug 12, 2019
231da7e
extract ban_pat_range_if_ambiguous
Centril Aug 12, 2019
e32bd69
extract parse_pat_mac_invoc
Centril Aug 12, 2019
e6f980f
extract parse_pat_range_starting_with_path
Centril Aug 12, 2019
49740b7
extract parse_pat_range_starting_with_lit
Centril Aug 12, 2019
37f37a5
parser/pat: minor misc cleanup
Centril Aug 12, 2019
ddf734d
extract fatal_unexpected_non_pat
Centril Aug 12, 2019
c8fc4c1
extract parse_pat_{tuple_}struct + recover_one_fewer_dotdot
Centril Aug 12, 2019
71415ef
Parse excess semicolons as empty stmts for linting
nathanwhit Jul 25, 2019
2f6cb5f
Add lint for excess trailing semicolons
nathanwhit Jul 30, 2019
76a1345
Update tests for excess semicolon lint
nathanwhit Jul 30, 2019
c037597
Remove redundant `ty` fields from `mir::Constant` and `hair::pattern:…
eddyb Aug 12, 2019
2882bee
rustc_mir: add sanity asserts for the types of `ty::Const`s.
eddyb Aug 12, 2019
22127b1
rustc_mir: use the right type for associated const literals.
eddyb Aug 12, 2019
d30f481
Fix indentation nit in src/librustc/mir/mod.rs.
eddyb Aug 12, 2019
e9b3a01
Bump to 1.39
Mark-Simulacrum Aug 11, 2019
376636e
syntax: Remove `DummyResult::expn_only`
petrochenkov Aug 13, 2019
0d29142
expand: `expand_fragment` -> `fully_expand_fragment`
petrochenkov Aug 13, 2019
d416ebe
expand: Unimplement `MutVisitor` on `MacroExpander`
petrochenkov Aug 13, 2019
9348af8
Add NodeId for Arm, Field and FieldPat
c410-f3r Aug 14, 2019
2601c86
Handle cfg(bootstrap) throughout
Mark-Simulacrum Aug 11, 2019
6575a96
Disable --cfg bootstrap in libcore
Mark-Simulacrum Aug 12, 2019
f7ff36d
Update error-format to match new Cargo flags for pipelining
alexcrichton Aug 12, 2019
264640c
move test that shouldn't be in test/run-pass/
Centril Aug 14, 2019
24693d7
Adjust tracking issues for `MaybeUninit<T>` gates
Centril Aug 14, 2019
be7f5f5
Rollup merge of #62984 - nathanwhit:extra_semi_lint, r=varkor
Centril Aug 14, 2019
95894cb
Rollup merge of #63075 - RalfJung:deref-checks, r=oli-obk
Centril Aug 14, 2019
75f2c9a
Rollup merge of #63490 - Centril:cleanup-pat-parser, r=petrochenkov
Centril Aug 14, 2019
ddeaf59
Rollup merge of #63495 - eddyb:mir-constant-ty, r=oli-obk
Centril Aug 14, 2019
66dd5b7
Rollup merge of #63528 - petrochenkov:anyany, r=estebank
Centril Aug 14, 2019
4ea9314
Rollup merge of #63534 - Mark-Simulacrum:stage0-bump, r=Centril
Centril Aug 14, 2019
76d02b3
Rollup merge of #63537 - petrochenkov:novisit, r=alexcrichton
Centril Aug 14, 2019
c7cb67b
Rollup merge of #63542 - c410-f3r:node_ids, r=petrochenkov
Centril Aug 14, 2019
8086c08
Rollup merge of #63560 - Centril:mv-generator-test, r=petrochenkov
Centril Aug 14, 2019
72e69f8
Rollup merge of #63570 - rust-lang:maybe-uninit-gates, r=RalfJung
Centril Aug 14, 2019
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
23 changes: 6 additions & 17 deletions src/bootstrap/bin/rustc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,6 @@ fn main() {
}
}

// Drop `--error-format json` because despite our desire for json messages
// from Cargo we don't want any from rustc itself.
if let Some(n) = args.iter().position(|n| n == "--error-format") {
args.remove(n);
args.remove(n);
}

if let Some(s) = env::var_os("RUSTC_ERROR_FORMAT") {
args.push("--error-format".into());
args.push(s);
}

// Detect whether or not we're a build script depending on whether --target
// is passed (a bit janky...)
let target = args.windows(2)
Expand Down Expand Up @@ -110,7 +98,11 @@ fn main() {

// Non-zero stages must all be treated uniformly to avoid problems when attempting to uplift
// compiler libraries and such from stage 1 to 2.
if stage == "0" {
//
// FIXME: the fact that core here is excluded is due to core_arch from our stdarch submodule
// being broken on the beta compiler with bootstrap passed, so this is a temporary workaround
// (we've just snapped, so there are no cfg(bootstrap) related annotations in core).
if stage == "0" && crate_name != Some("core") {
cmd.arg("--cfg").arg("bootstrap");
}

Expand All @@ -132,10 +124,7 @@ fn main() {
cmd.arg("-Dwarnings");
cmd.arg("-Drust_2018_idioms");
cmd.arg("-Dunused_lifetimes");
// cfg(not(bootstrap)): Remove this during the next stage 0 compiler update.
// `-Drustc::internal` is a new feature and `rustc_version` mis-reports the `stage`.
let cfg_not_bootstrap = stage != "0" && crate_name != Some("rustc_version");
if cfg_not_bootstrap && use_internal_lints(crate_name) {
if use_internal_lints(crate_name) {
cmd.arg("-Zunstable-options");
cmd.arg("-Drustc::internal");
}
Expand Down
5 changes: 1 addition & 4 deletions src/bootstrap/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ impl StepDescription {
only_hosts: S::ONLY_HOSTS,
should_run: S::should_run,
make_run: S::make_run,
name: unsafe { ::std::intrinsics::type_name::<S>() },
name: std::any::type_name::<S>(),
}
}

Expand Down Expand Up @@ -980,9 +980,6 @@ impl<'a> Builder<'a> {
if let Some(target_linker) = self.linker(target) {
cargo.env("RUSTC_TARGET_LINKER", target_linker);
}
if let Some(ref error_format) = self.config.rustc_error_format {
cargo.env("RUSTC_ERROR_FORMAT", error_format);
}
if !(["build", "check", "clippy", "fix", "rustc"].contains(&cmd)) && want_rustdoc {
cargo.env("RUSTDOC_LIBDIR", self.rustc_libdir(compiler));
}
Expand Down
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.38.0";
pub const CFG_RELEASE_NUM: &str = "1.39.0";

pub struct GitInfo {
inner: Option<Info>,
Expand Down
20 changes: 6 additions & 14 deletions src/bootstrap/compile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1116,10 +1116,6 @@ pub fn run_cargo(builder: &Builder<'_>,
},
..
} => (filenames, crate_types),
CargoMessage::CompilerMessage { message } => {
eprintln!("{}", message.rendered);
return;
}
_ => return,
};
for filename in filenames {
Expand Down Expand Up @@ -1256,8 +1252,12 @@ pub fn stream_cargo(
}
// Instruct Cargo to give us json messages on stdout, critically leaving
// stderr as piped so we can get those pretty colors.
cargo.arg("--message-format").arg("json")
.stdout(Stdio::piped());
let mut message_format = String::from("json-render-diagnostics");
if let Some(s) = &builder.config.rustc_error_format {
message_format.push_str(",json-diagnostic-");
message_format.push_str(s);
}
cargo.arg("--message-format").arg(message_format).stdout(Stdio::piped());

for arg in tail_args {
cargo.arg(arg);
Expand Down Expand Up @@ -1310,12 +1310,4 @@ pub enum CargoMessage<'a> {
BuildScriptExecuted {
package_id: Cow<'a, str>,
},
CompilerMessage {
message: ClippyMessage<'a>
}
}

#[derive(Deserialize)]
pub struct ClippyMessage<'a> {
rendered: Cow<'a, str>,
}
6 changes: 3 additions & 3 deletions src/liballoc/collections/btree/node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ impl<K, V> LeafNode<K, V> {
LeafNode {
// As a general policy, we leave fields uninitialized if they can be, as this should
// be both slightly faster and easier to track in Valgrind.
keys: uninit_array![_; CAPACITY],
vals: uninit_array![_; CAPACITY],
keys: [MaybeUninit::UNINIT; CAPACITY],
vals: [MaybeUninit::UNINIT; CAPACITY],
parent: ptr::null(),
parent_idx: MaybeUninit::uninit(),
len: 0
Expand Down Expand Up @@ -159,7 +159,7 @@ impl<K, V> InternalNode<K, V> {
unsafe fn new() -> Self {
InternalNode {
data: LeafNode::new(),
edges: uninit_array![_; 2*B],
edges: [MaybeUninit::UNINIT; 2*B]
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/liballoc/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
#![warn(missing_debug_implementations)]
#![deny(intra_doc_link_resolution_failure)] // rustdoc is run without -D warnings
#![allow(explicit_outlives_requirements)]
#![cfg_attr(not(bootstrap), allow(incomplete_features))]
#![allow(incomplete_features)]

#![cfg_attr(not(test), feature(generator_trait))]
#![cfg_attr(test, feature(test))]
Expand All @@ -84,7 +84,7 @@
#![feature(coerce_unsized)]
#![feature(const_generic_impls_guard)]
#![feature(const_generics)]
#![cfg_attr(not(bootstrap), feature(const_in_array_repeat_expressions))]
#![feature(const_in_array_repeat_expressions)]
#![feature(dispatch_from_dyn)]
#![feature(core_intrinsics)]
#![feature(dropck_eyepatch)]
Expand Down Expand Up @@ -118,7 +118,7 @@
#![feature(rustc_const_unstable)]
#![feature(const_vec_new)]
#![feature(slice_partition_dedup)]
#![feature(maybe_uninit_extra, maybe_uninit_slice, maybe_uninit_array)]
#![feature(maybe_uninit_extra, maybe_uninit_slice)]
#![feature(alloc_layout_extra)]
#![feature(try_trait)]
#![feature(mem_take)]
Expand Down
5 changes: 0 additions & 5 deletions src/libcore/any.rs
Original file line number Diff line number Diff line change
Expand Up @@ -470,10 +470,5 @@ impl TypeId {
#[stable(feature = "type_name", since = "1.38.0")]
#[rustc_const_unstable(feature = "const_type_name")]
pub const fn type_name<T: ?Sized>() -> &'static str {
#[cfg(bootstrap)]
unsafe {
intrinsics::type_name::<T>()
}
#[cfg(not(bootstrap))]
intrinsics::type_name::<T>()
}
14 changes: 2 additions & 12 deletions src/libcore/char/methods.rs
Original file line number Diff line number Diff line change
Expand Up @@ -553,12 +553,7 @@ impl char {
/// `XID_Start` is a Unicode Derived Property specified in
/// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications),
/// mostly similar to `ID_Start` but modified for closure under `NFKx`.
#[cfg_attr(bootstrap,
unstable(feature = "rustc_private",
reason = "mainly needed for compiler internals",
issue = "27812"))]
#[cfg_attr(not(bootstrap),
unstable(feature = "unicode_internals", issue = "0"))]
#[unstable(feature = "unicode_internals", issue = "0")]
pub fn is_xid_start(self) -> bool {
derived_property::XID_Start(self)
}
Expand All @@ -569,12 +564,7 @@ impl char {
/// `XID_Continue` is a Unicode Derived Property specified in
/// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications),
/// mostly similar to `ID_Continue` but modified for closure under NFKx.
#[cfg_attr(bootstrap,
unstable(feature = "rustc_private",
reason = "mainly needed for compiler internals",
issue = "27812"))]
#[cfg_attr(not(bootstrap),
unstable(feature = "unicode_internals", issue = "0"))]
#[unstable(feature = "unicode_internals", issue = "0")]
#[inline]
pub fn is_xid_continue(self) -> bool {
derived_property::XID_Continue(self)
Expand Down
1 change: 0 additions & 1 deletion src/libcore/clone.rs
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,6 @@ pub trait Clone : Sized {
}

/// Derive macro generating an impl of the trait `Clone`.
#[cfg(not(bootstrap))]
#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
Expand Down
4 changes: 0 additions & 4 deletions src/libcore/cmp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,6 @@ pub trait PartialEq<Rhs: ?Sized = Self> {
}

/// Derive macro generating an impl of the trait `PartialEq`.
#[cfg(not(bootstrap))]
#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
Expand Down Expand Up @@ -265,7 +264,6 @@ pub trait Eq: PartialEq<Self> {
}

/// Derive macro generating an impl of the trait `Eq`.
#[cfg(not(bootstrap))]
#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
Expand Down Expand Up @@ -617,7 +615,6 @@ pub trait Ord: Eq + PartialOrd<Self> {
}

/// Derive macro generating an impl of the trait `Ord`.
#[cfg(not(bootstrap))]
#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
Expand Down Expand Up @@ -867,7 +864,6 @@ pub trait PartialOrd<Rhs: ?Sized = Self>: PartialEq<Rhs> {
}

/// Derive macro generating an impl of the trait `PartialOrd`.
#[cfg(not(bootstrap))]
#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
Expand Down
1 change: 0 additions & 1 deletion src/libcore/default.rs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ pub trait Default: Sized {
}

/// Derive macro generating an impl of the trait `Default`.
#[cfg(not(bootstrap))]
#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
Expand Down
2 changes: 0 additions & 2 deletions src/libcore/fmt/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,6 @@ pub trait Debug {
}

// Separate module to reexport the macro `Debug` from prelude without the trait `Debug`.
#[cfg(not(bootstrap))]
pub(crate) mod macros {
/// Derive macro generating an impl of the trait `Debug`.
#[rustc_builtin_macro]
Expand All @@ -555,7 +554,6 @@ pub(crate) mod macros {
#[allow_internal_unstable(core_intrinsics)]
pub macro Debug($item:item) { /* compiler built-in */ }
}
#[cfg(not(bootstrap))]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[doc(inline)]
pub use macros::Debug;
Expand Down
2 changes: 0 additions & 2 deletions src/libcore/hash/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,6 @@ pub trait Hash {
}

// Separate module to reexport the macro `Hash` from prelude without the trait `Hash`.
#[cfg(not(bootstrap))]
pub(crate) mod macros {
/// Derive macro generating an impl of the trait `Hash`.
#[rustc_builtin_macro]
Expand All @@ -208,7 +207,6 @@ pub(crate) mod macros {
#[allow_internal_unstable(core_intrinsics)]
pub macro Hash($item:item) { /* compiler built-in */ }
}
#[cfg(not(bootstrap))]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
#[doc(inline)]
pub use macros::Hash;
Expand Down
4 changes: 2 additions & 2 deletions src/libcore/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
#![warn(missing_debug_implementations)]
#![deny(intra_doc_link_resolution_failure)] // rustdoc is run without -D warnings
#![allow(explicit_outlives_requirements)]
#![cfg_attr(not(bootstrap), allow(incomplete_features))]
#![allow(incomplete_features)]

#![feature(allow_internal_unstable)]
#![feature(arbitrary_self_types)]
Expand Down Expand Up @@ -129,7 +129,7 @@
#![feature(structural_match)]
#![feature(abi_unadjusted)]
#![feature(adx_target_feature)]
#![feature(maybe_uninit_slice, maybe_uninit_array)]
#![feature(maybe_uninit_slice)]
#![feature(external_doc)]
#![feature(mem_take)]
#![feature(associated_type_bounds)]
Expand Down
35 changes: 0 additions & 35 deletions src/libcore/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -635,46 +635,11 @@ macro_rules! todo {
($($arg:tt)+) => (panic!("not yet implemented: {}", format_args!($($arg)+)));
}

/// Creates an array of [`MaybeUninit`].
///
/// This macro constructs an uninitialized array of the type `[MaybeUninit<K>; N]`.
/// It exists solely because bootstrap does not yet support const array-init expressions.
///
/// [`MaybeUninit`]: mem/union.MaybeUninit.html
// FIXME: Remove both versions of this macro once bootstrap is 1.38.
#[macro_export]
#[unstable(feature = "maybe_uninit_array", issue = "53491")]
#[cfg(bootstrap)]
macro_rules! uninit_array {
// This `assume_init` is safe because an array of `MaybeUninit` does not
// require initialization.
($t:ty; $size:expr) => (unsafe {
MaybeUninit::<[MaybeUninit<$t>; $size]>::uninit().assume_init()
});
}

/// Creates an array of [`MaybeUninit`].
///
/// This macro constructs an uninitialized array of the type `[MaybeUninit<K>; N]`.
/// It exists solely because bootstrap does not yet support const array-init expressions.
///
/// [`MaybeUninit`]: mem/union.MaybeUninit.html
// FIXME: Just inline this version of the macro once bootstrap is 1.38.
#[macro_export]
#[unstable(feature = "maybe_uninit_array", issue = "53491")]
#[cfg(not(bootstrap))]
macro_rules! uninit_array {
($t:ty; $size:expr) => (
[MaybeUninit::<$t>::UNINIT; $size]
);
}

/// Definitions of built-in macros.
///
/// Most of the macro properties (stability, visibility, etc.) are taken from the source code here,
/// with exception of expansion functions transforming macro inputs into outputs,
/// those functions are provided by the compiler.
#[cfg(not(bootstrap))]
pub(crate) mod builtin {

/// Causes compilation to fail with the given error message when encountered.
Expand Down
1 change: 0 additions & 1 deletion src/libcore/marker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,6 @@ pub trait Copy : Clone {
}

/// Derive macro generating an impl of the trait `Copy`.
#[cfg(not(bootstrap))]
#[rustc_builtin_macro]
#[rustc_macro_transparency = "semitransparent"]
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]
Expand Down
Loading