Skip to content

Commit 6edcad1

Browse files
committed
Auto merge of #63563 - Centril:rollup-j9nld0c, r=Centril
Rollup of 10 pull requests Successful merges: - #62984 (Add lint for excess trailing semicolons) - #63075 (Miri: Check that a ptr is aligned and inbounds already when evaluating `*`) - #63490 (libsyntax: cleanup and refactor `pat.rs`) - #63495 ( Remove redundant `ty` fields from `mir::Constant` and `hair::pattern::PatternRange`.) - #63509 (Point at the right enclosing scope when using `await` in non-async fn) - #63528 (syntax: Remove `DummyResult::expr_only`) - #63534 (Bump to 1.39) - #63537 (expand: Unimplement `MutVisitor` on `MacroExpander`) - #63542 (Add NodeId for Arm, Field and FieldPat) - #63560 (move test that shouldn't be in test/run-pass/) Failed merges: r? @ghost
2 parents c43d03a + a1f564b commit 6edcad1

File tree

104 files changed

+640
-645
lines changed

Some content is hidden

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

104 files changed

+640
-645
lines changed

src/bootstrap/bin/rustc.rs

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -45,18 +45,6 @@ fn main() {
4545
}
4646
}
4747

48-
// Drop `--error-format json` because despite our desire for json messages
49-
// from Cargo we don't want any from rustc itself.
50-
if let Some(n) = args.iter().position(|n| n == "--error-format") {
51-
args.remove(n);
52-
args.remove(n);
53-
}
54-
55-
if let Some(s) = env::var_os("RUSTC_ERROR_FORMAT") {
56-
args.push("--error-format".into());
57-
args.push(s);
58-
}
59-
6048
// Detect whether or not we're a build script depending on whether --target
6149
// is passed (a bit janky...)
6250
let target = args.windows(2)
@@ -110,7 +98,11 @@ fn main() {
11098

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

@@ -132,10 +124,7 @@ fn main() {
132124
cmd.arg("-Dwarnings");
133125
cmd.arg("-Drust_2018_idioms");
134126
cmd.arg("-Dunused_lifetimes");
135-
// cfg(not(bootstrap)): Remove this during the next stage 0 compiler update.
136-
// `-Drustc::internal` is a new feature and `rustc_version` mis-reports the `stage`.
137-
let cfg_not_bootstrap = stage != "0" && crate_name != Some("rustc_version");
138-
if cfg_not_bootstrap && use_internal_lints(crate_name) {
127+
if use_internal_lints(crate_name) {
139128
cmd.arg("-Zunstable-options");
140129
cmd.arg("-Drustc::internal");
141130
}

src/bootstrap/builder.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ impl StepDescription {
145145
only_hosts: S::ONLY_HOSTS,
146146
should_run: S::should_run,
147147
make_run: S::make_run,
148-
name: unsafe { ::std::intrinsics::type_name::<S>() },
148+
name: std::any::type_name::<S>(),
149149
}
150150
}
151151

@@ -980,9 +980,6 @@ impl<'a> Builder<'a> {
980980
if let Some(target_linker) = self.linker(target) {
981981
cargo.env("RUSTC_TARGET_LINKER", target_linker);
982982
}
983-
if let Some(ref error_format) = self.config.rustc_error_format {
984-
cargo.env("RUSTC_ERROR_FORMAT", error_format);
985-
}
986983
if !(["build", "check", "clippy", "fix", "rustc"].contains(&cmd)) && want_rustdoc {
987984
cargo.env("RUSTDOC_LIBDIR", self.rustc_libdir(compiler));
988985
}

src/bootstrap/channel.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ use build_helper::output;
1313
use crate::Build;
1414

1515
// The version number
16-
pub const CFG_RELEASE_NUM: &str = "1.38.0";
16+
pub const CFG_RELEASE_NUM: &str = "1.39.0";
1717

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

src/bootstrap/compile.rs

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1116,10 +1116,6 @@ pub fn run_cargo(builder: &Builder<'_>,
11161116
},
11171117
..
11181118
} => (filenames, crate_types),
1119-
CargoMessage::CompilerMessage { message } => {
1120-
eprintln!("{}", message.rendered);
1121-
return;
1122-
}
11231119
_ => return,
11241120
};
11251121
for filename in filenames {
@@ -1256,8 +1252,12 @@ pub fn stream_cargo(
12561252
}
12571253
// Instruct Cargo to give us json messages on stdout, critically leaving
12581254
// stderr as piped so we can get those pretty colors.
1259-
cargo.arg("--message-format").arg("json")
1260-
.stdout(Stdio::piped());
1255+
let mut message_format = String::from("json-render-diagnostics");
1256+
if let Some(s) = &builder.config.rustc_error_format {
1257+
message_format.push_str(",json-diagnostic-");
1258+
message_format.push_str(s);
1259+
}
1260+
cargo.arg("--message-format").arg(message_format).stdout(Stdio::piped());
12611261

12621262
for arg in tail_args {
12631263
cargo.arg(arg);
@@ -1310,12 +1310,4 @@ pub enum CargoMessage<'a> {
13101310
BuildScriptExecuted {
13111311
package_id: Cow<'a, str>,
13121312
},
1313-
CompilerMessage {
1314-
message: ClippyMessage<'a>
1315-
}
1316-
}
1317-
1318-
#[derive(Deserialize)]
1319-
pub struct ClippyMessage<'a> {
1320-
rendered: Cow<'a, str>,
13211313
}

src/liballoc/collections/btree/node.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ impl<K, V> LeafNode<K, V> {
106106
LeafNode {
107107
// As a general policy, we leave fields uninitialized if they can be, as this should
108108
// be both slightly faster and easier to track in Valgrind.
109-
keys: uninit_array![_; CAPACITY],
110-
vals: uninit_array![_; CAPACITY],
109+
keys: [MaybeUninit::UNINIT; CAPACITY],
110+
vals: [MaybeUninit::UNINIT; CAPACITY],
111111
parent: ptr::null(),
112112
parent_idx: MaybeUninit::uninit(),
113113
len: 0
@@ -159,7 +159,7 @@ impl<K, V> InternalNode<K, V> {
159159
unsafe fn new() -> Self {
160160
InternalNode {
161161
data: LeafNode::new(),
162-
edges: uninit_array![_; 2*B],
162+
edges: [MaybeUninit::UNINIT; 2*B]
163163
}
164164
}
165165
}

src/liballoc/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@
6969
#![warn(missing_debug_implementations)]
7070
#![deny(intra_doc_link_resolution_failure)] // rustdoc is run without -D warnings
7171
#![allow(explicit_outlives_requirements)]
72-
#![cfg_attr(not(bootstrap), allow(incomplete_features))]
72+
#![allow(incomplete_features)]
7373

7474
#![cfg_attr(not(test), feature(generator_trait))]
7575
#![cfg_attr(test, feature(test))]
@@ -84,7 +84,7 @@
8484
#![feature(coerce_unsized)]
8585
#![feature(const_generic_impls_guard)]
8686
#![feature(const_generics)]
87-
#![cfg_attr(not(bootstrap), feature(const_in_array_repeat_expressions))]
87+
#![feature(const_in_array_repeat_expressions)]
8888
#![feature(dispatch_from_dyn)]
8989
#![feature(core_intrinsics)]
9090
#![feature(dropck_eyepatch)]
@@ -118,7 +118,7 @@
118118
#![feature(rustc_const_unstable)]
119119
#![feature(const_vec_new)]
120120
#![feature(slice_partition_dedup)]
121-
#![feature(maybe_uninit_extra, maybe_uninit_slice, maybe_uninit_array)]
121+
#![feature(maybe_uninit_extra, maybe_uninit_slice)]
122122
#![feature(alloc_layout_extra)]
123123
#![feature(try_trait)]
124124
#![feature(mem_take)]

src/libcore/any.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -470,10 +470,5 @@ impl TypeId {
470470
#[stable(feature = "type_name", since = "1.38.0")]
471471
#[rustc_const_unstable(feature = "const_type_name")]
472472
pub const fn type_name<T: ?Sized>() -> &'static str {
473-
#[cfg(bootstrap)]
474-
unsafe {
475-
intrinsics::type_name::<T>()
476-
}
477-
#[cfg(not(bootstrap))]
478473
intrinsics::type_name::<T>()
479474
}

src/libcore/char/methods.rs

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -553,12 +553,7 @@ impl char {
553553
/// `XID_Start` is a Unicode Derived Property specified in
554554
/// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications),
555555
/// mostly similar to `ID_Start` but modified for closure under `NFKx`.
556-
#[cfg_attr(bootstrap,
557-
unstable(feature = "rustc_private",
558-
reason = "mainly needed for compiler internals",
559-
issue = "27812"))]
560-
#[cfg_attr(not(bootstrap),
561-
unstable(feature = "unicode_internals", issue = "0"))]
556+
#[unstable(feature = "unicode_internals", issue = "0")]
562557
pub fn is_xid_start(self) -> bool {
563558
derived_property::XID_Start(self)
564559
}
@@ -569,12 +564,7 @@ impl char {
569564
/// `XID_Continue` is a Unicode Derived Property specified in
570565
/// [UAX #31](http://unicode.org/reports/tr31/#NFKC_Modifications),
571566
/// mostly similar to `ID_Continue` but modified for closure under NFKx.
572-
#[cfg_attr(bootstrap,
573-
unstable(feature = "rustc_private",
574-
reason = "mainly needed for compiler internals",
575-
issue = "27812"))]
576-
#[cfg_attr(not(bootstrap),
577-
unstable(feature = "unicode_internals", issue = "0"))]
567+
#[unstable(feature = "unicode_internals", issue = "0")]
578568
#[inline]
579569
pub fn is_xid_continue(self) -> bool {
580570
derived_property::XID_Continue(self)

src/libcore/clone.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,6 @@ pub trait Clone : Sized {
134134
}
135135

136136
/// Derive macro generating an impl of the trait `Clone`.
137-
#[cfg(not(bootstrap))]
138137
#[rustc_builtin_macro]
139138
#[rustc_macro_transparency = "semitransparent"]
140139
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]

src/libcore/cmp.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,6 @@ pub trait PartialEq<Rhs: ?Sized = Self> {
201201
}
202202

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

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

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

869866
/// Derive macro generating an impl of the trait `PartialOrd`.
870-
#[cfg(not(bootstrap))]
871867
#[rustc_builtin_macro]
872868
#[rustc_macro_transparency = "semitransparent"]
873869
#[stable(feature = "builtin_macro_prelude", since = "1.38.0")]

0 commit comments

Comments
 (0)