Skip to content

Commit f243a2a

Browse files
committed
Auto merge of rust-lang#77917 - JohnTitor:rollup-e47h2qt, r=JohnTitor
Rollup of 14 pull requests Successful merges: - rust-lang#77239 (Enable building Cargo for aarch64-apple-darwin) - rust-lang#77569 (BTreeMap: type-specific variants of node_as_mut and cast_unchecked) - rust-lang#77719 (Remove unnecessary rustc_const_stable attributes.) - rust-lang#77722 (Remove unsafety from sys/unsupported and add deny(unsafe_op_in_unsafe_fn).) - rust-lang#77725 (Add regression issue template) - rust-lang#77776 ( Give an error when running `x.py test --stage 0 src/test/ui`) - rust-lang#77786 (Mention rustdoc in `x.py setup`) - rust-lang#77825 (`min_const_generics` diagnostics improvements) - rust-lang#77868 (Include `llvm-dis`, `llc` and `opt` in `llvm-tools-preview` component) - rust-lang#77884 (Use Option::unwrap_or instead of open-coding it) - rust-lang#77886 (Replace trivial bool matches with the `matches!` macro) - rust-lang#77892 (Replace absolute paths with relative ones) - rust-lang#77895 (Include aarch64-apple-darwin in the dist manifests) - rust-lang#77909 (bootstrap: set correct path for the build-manifest binary) Failed merges: - rust-lang#77902 (Include aarch64-pc-windows-msvc in the dist manifests) r? `@ghost`
2 parents adef9da + b4a3b56 commit f243a2a

File tree

107 files changed

+426
-359
lines changed

Some content is hidden

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

107 files changed

+426
-359
lines changed

.github/ISSUE_TEMPLATE/regression.md

+68
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
---
2+
name: Regression
3+
about: Report something that unexpectedly changed between Rust versions.
4+
labels: C-bug regression-untriaged
5+
---
6+
<!--
7+
Thank you for filing a regression report! 🐛 A regression is something that changed between versions of Rust but was not supposed to.
8+
9+
Please provide a short summary of the regression, along with any information you feel is relevant to replicate it.
10+
-->
11+
12+
### Code
13+
14+
I tried this code:
15+
16+
```rust
17+
<code>
18+
```
19+
20+
I expected to see this happen: *explanation*
21+
22+
Instead, this happened: *explanation*
23+
24+
### Version it worked on
25+
26+
<!--
27+
Provide the most recent version this worked on, for example:
28+
29+
It most recently worked on: Rust 1.47
30+
-->
31+
32+
It most recently worked on: <!-- version -->
33+
34+
### Version with regression
35+
36+
<!--
37+
Provide the version you are using that has the regression.
38+
-->
39+
40+
`rustc --version --verbose`:
41+
```
42+
<version>
43+
```
44+
45+
<!--
46+
Did the compiler crash? If so, please provide a backtrace.
47+
-->
48+
49+
### Backtrace
50+
<!--
51+
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
52+
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
53+
-->
54+
<details><summary>Backtrace</summary>
55+
<p>
56+
57+
```
58+
<backtrace>
59+
```
60+
61+
</p>
62+
</details>
63+
64+
<!--
65+
If you know when this regression occurred, please add a line like below, replacing `{channel}` with one of stable, beta, or nightly.
66+
67+
@rustbot modify labels: +regression-from-stable-to-{channel} -regression-untriaged
68+
-->

.github/workflows/ci.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -306,14 +306,16 @@ jobs:
306306
- name: dist-aarch64-apple
307307
env:
308308
SCRIPT: "./x.py dist --stage 2"
309-
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --host=aarch64-apple-darwin --target=aarch64-apple-darwin --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false --tools=rls,clippy,rustfmt,analysis,src"
309+
RUST_CONFIGURE_ARGS: "--build=x86_64-apple-darwin --host=aarch64-apple-darwin --target=aarch64-apple-darwin --enable-full-tools --enable-sanitizers --enable-profiler --set rust.jemalloc --set llvm.ninja=false"
310310
RUSTC_RETRY_LINKER_ON_SEGFAULT: 1
311311
SELECT_XCODE: /Applications/Xcode_12_beta.app
312312
USE_XCODE_CLANG: 1
313313
MACOSX_DEPLOYMENT_TARGET: 11.0
314314
MACOSX_STD_DEPLOYMENT_TARGET: 11.0
315315
NO_LLVM_ASSERTIONS: 1
316316
NO_DEBUG_ASSERTIONS: 1
317+
DIST_REQUIRE_ALL_TOOLS: 1
318+
JEMALLOC_SYS_WITH_LG_PAGE: 14
317319
os: macos-latest
318320
- name: x86_64-msvc-1
319321
env:

Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -2192,9 +2192,9 @@ checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de"
21922192

21932193
[[package]]
21942194
name = "openssl-src"
2195-
version = "111.10.2+1.1.1g"
2195+
version = "111.12.0+1.1.1h"
21962196
source = "registry+https://github.com/rust-lang/crates.io-index"
2197-
checksum = "a287fdb22e32b5b60624d4a5a7a02dbe82777f730ec0dbc42a0554326fef5a70"
2197+
checksum = "858a4132194f8570a7ee9eb8629e85b23cbc4565f2d4a162e87556e5956abf61"
21982198
dependencies = [
21992199
"cc",
22002200
]

compiler/rustc_ast_pretty/src/pp.rs

+5-14
Original file line numberDiff line numberDiff line change
@@ -170,17 +170,11 @@ pub enum Token {
170170

171171
impl Token {
172172
crate fn is_eof(&self) -> bool {
173-
match *self {
174-
Token::Eof => true,
175-
_ => false,
176-
}
173+
matches!(self, Token::Eof)
177174
}
178175

179176
pub fn is_hardbreak_tok(&self) -> bool {
180-
match *self {
181-
Token::Break(BreakToken { offset: 0, blank_space: bs }) if bs == SIZE_INFINITY => true,
182-
_ => false,
183-
}
177+
matches!(self, Token::Break(BreakToken { offset: 0, blank_space: SIZE_INFINITY }))
184178
}
185179
}
186180

@@ -491,12 +485,9 @@ impl Printer {
491485
}
492486

493487
fn get_top(&mut self) -> PrintStackElem {
494-
match self.print_stack.last() {
495-
Some(el) => *el,
496-
None => {
497-
PrintStackElem { offset: 0, pbreak: PrintStackBreak::Broken(Breaks::Inconsistent) }
498-
}
499-
}
488+
*self.print_stack.last().unwrap_or({
489+
&PrintStackElem { offset: 0, pbreak: PrintStackBreak::Broken(Breaks::Inconsistent) }
490+
})
500491
}
501492

502493
fn print_begin(&mut self, b: BeginToken, l: isize) {

compiler/rustc_codegen_llvm/src/llvm_util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ unsafe fn configure_llvm(sess: &Session) {
122122

123123
llvm::LLVMInitializePasses();
124124

125-
::rustc_llvm::initialize_available_targets();
125+
rustc_llvm::initialize_available_targets();
126126

127127
llvm::LLVMRustSetLLVMOptions(llvm_args.len() as c_int, llvm_args.as_ptr());
128128
}

compiler/rustc_codegen_ssa/src/back/write.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1175,7 +1175,7 @@ fn start_executing_work<B: ExtraBackendMethods>(
11751175
// necessary. There's already optimizations in place to avoid sending work
11761176
// back to the coordinator if LTO isn't requested.
11771177
return thread::spawn(move || {
1178-
let max_workers = ::num_cpus::get();
1178+
let max_workers = num_cpus::get();
11791179
let mut worker_id_counter = 0;
11801180
let mut free_worker_ids = Vec::new();
11811181
let mut get_worker_id = |free_worker_ids: &mut Vec<usize>| {

compiler/rustc_codegen_ssa/src/base.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,7 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
695695
total_codegen_time.into_inner(),
696696
);
697697

698-
::rustc_incremental::assert_module_sources::assert_module_sources(tcx);
698+
rustc_incremental::assert_module_sources::assert_module_sources(tcx);
699699

700700
symbol_names_test::report_symbol_names(tcx);
701701

@@ -754,8 +754,8 @@ impl<B: ExtraBackendMethods> Drop for AbortCodegenOnDrop<B> {
754754
}
755755

756756
fn finalize_tcx(tcx: TyCtxt<'_>) {
757-
tcx.sess.time("assert_dep_graph", || ::rustc_incremental::assert_dep_graph(tcx));
758-
tcx.sess.time("serialize_dep_graph", || ::rustc_incremental::save_dep_graph(tcx));
757+
tcx.sess.time("assert_dep_graph", || rustc_incremental::assert_dep_graph(tcx));
758+
tcx.sess.time("serialize_dep_graph", || rustc_incremental::save_dep_graph(tcx));
759759

760760
// We assume that no queries are run past here. If there are new queries
761761
// after this point, they'll show up as "<unknown>" in self-profiling data.

compiler/rustc_codegen_ssa/src/traits/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ impl<'tcx, T> CodegenMethods<'tcx> for T where
8585
}
8686

8787
pub trait HasCodegen<'tcx>:
88-
Backend<'tcx> + ::std::ops::Deref<Target = <Self as HasCodegen<'tcx>>::CodegenCx>
88+
Backend<'tcx> + std::ops::Deref<Target = <Self as HasCodegen<'tcx>>::CodegenCx>
8989
{
9090
type CodegenCx: CodegenMethods<'tcx>
9191
+ BackendTypes<

compiler/rustc_data_structures/src/fingerprint.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ impl Fingerprint {
7171
}
7272
}
7373

74-
impl ::std::fmt::Display for Fingerprint {
75-
fn fmt(&self, formatter: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
74+
impl std::fmt::Display for Fingerprint {
75+
fn fmt(&self, formatter: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
7676
write!(formatter, "{:x}-{:x}", self.0, self.1)
7777
}
7878
}

compiler/rustc_data_structures/src/obligation_forest/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ pub enum ProcessResult<O, E> {
129129
struct ObligationTreeId(usize);
130130

131131
type ObligationTreeIdGenerator =
132-
::std::iter::Map<::std::ops::RangeFrom<usize>, fn(usize) -> ObligationTreeId>;
132+
std::iter::Map<std::ops::RangeFrom<usize>, fn(usize) -> ObligationTreeId>;
133133

134134
pub struct ObligationForest<O: ForestObligation> {
135135
/// The list of obligations. In between calls to `process_obligations`,

compiler/rustc_data_structures/src/sorted_map.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ impl<K: Ord, V> SortedMap<K, V> {
9393

9494
/// Iterate over elements, sorted by key
9595
#[inline]
96-
pub fn iter(&self) -> ::std::slice::Iter<'_, (K, V)> {
96+
pub fn iter(&self) -> std::slice::Iter<'_, (K, V)> {
9797
self.data.iter()
9898
}
9999

@@ -134,7 +134,7 @@ impl<K: Ord, V> SortedMap<K, V> {
134134
R: RangeBounds<K>,
135135
{
136136
let (start, end) = self.range_slice_indices(range);
137-
self.data.splice(start..end, ::std::iter::empty());
137+
self.data.splice(start..end, std::iter::empty());
138138
}
139139

140140
/// Mutate all keys with the given function `f`. This mutation must not
@@ -241,7 +241,7 @@ impl<K: Ord, V> SortedMap<K, V> {
241241

242242
impl<K: Ord, V> IntoIterator for SortedMap<K, V> {
243243
type Item = (K, V);
244-
type IntoIter = ::std::vec::IntoIter<(K, V)>;
244+
type IntoIter = std::vec::IntoIter<(K, V)>;
245245

246246
fn into_iter(self) -> Self::IntoIter {
247247
self.data.into_iter()

compiler/rustc_data_structures/src/stable_hasher.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ pub struct StableHasher {
2020
}
2121

2222
impl ::std::fmt::Debug for StableHasher {
23-
fn fmt(&self, f: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
23+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
2424
write!(f, "{:?}", self.state)
2525
}
2626
}

compiler/rustc_hir/src/definitions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ impl DefKey {
118118

119119
let DisambiguatedDefPathData { ref data, disambiguator } = self.disambiguated_data;
120120

121-
::std::mem::discriminant(data).hash(&mut hasher);
121+
std::mem::discriminant(data).hash(&mut hasher);
122122
if let Some(name) = data.get_opt_name() {
123123
// Get a stable hash by considering the symbol chars rather than
124124
// the symbol index.

compiler/rustc_infer/src/infer/nll_relate/mod.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ where
341341
// been fully instantiated and hence the set of scopes we have
342342
// doesn't matter -- just to be sure, put an empty vector
343343
// in there.
344-
let old_a_scopes = ::std::mem::take(pair.vid_scopes(self));
344+
let old_a_scopes = std::mem::take(pair.vid_scopes(self));
345345

346346
// Relate the generalized kind to the original one.
347347
let result = pair.relate_generalized_ty(self, generalized_ty);
@@ -680,7 +680,7 @@ where
680680
// itself occurs. Note that `'b` and `'c` must both
681681
// include P. At the point, the call works because of
682682
// subtyping (i.e., `&'b u32 <: &{P} u32`).
683-
let variance = ::std::mem::replace(&mut self.ambient_variance, ty::Variance::Covariant);
683+
let variance = std::mem::replace(&mut self.ambient_variance, ty::Variance::Covariant);
684684

685685
self.relate(a.skip_binder(), b.skip_binder())?;
686686

@@ -709,7 +709,7 @@ where
709709
// Reset ambient variance to contravariance. See the
710710
// covariant case above for an explanation.
711711
let variance =
712-
::std::mem::replace(&mut self.ambient_variance, ty::Variance::Contravariant);
712+
std::mem::replace(&mut self.ambient_variance, ty::Variance::Contravariant);
713713

714714
self.relate(a.skip_binder(), b.skip_binder())?;
715715

compiler/rustc_infer/src/infer/outlives/obligations.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ impl<'cx, 'tcx> InferCtxt<'cx, 'tcx> {
110110

111111
/// Trait queries just want to pass back type obligations "as is"
112112
pub fn take_registered_region_obligations(&self) -> Vec<(hir::HirId, RegionObligation<'tcx>)> {
113-
::std::mem::take(&mut self.inner.borrow_mut().region_obligations)
113+
std::mem::take(&mut self.inner.borrow_mut().region_obligations)
114114
}
115115

116116
/// Process the region obligations that must be proven (during

compiler/rustc_middle/src/ich/impls_syntax.rs

+8-14
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use crate::ich::StableHashingContext;
55

66
use rustc_ast as ast;
77
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
8-
use rustc_span::SourceFile;
8+
use rustc_span::{BytePos, NormalizedPos, SourceFile};
99

1010
use smallvec::SmallVec;
1111

@@ -102,34 +102,28 @@ impl<'a> HashStable<StableHashingContext<'a>> for SourceFile {
102102
}
103103
}
104104

105-
fn stable_byte_pos(pos: ::rustc_span::BytePos, source_file_start: ::rustc_span::BytePos) -> u32 {
105+
fn stable_byte_pos(pos: BytePos, source_file_start: BytePos) -> u32 {
106106
pos.0 - source_file_start.0
107107
}
108108

109-
fn stable_multibyte_char(
110-
mbc: ::rustc_span::MultiByteChar,
111-
source_file_start: ::rustc_span::BytePos,
112-
) -> (u32, u32) {
113-
let ::rustc_span::MultiByteChar { pos, bytes } = mbc;
109+
fn stable_multibyte_char(mbc: rustc_span::MultiByteChar, source_file_start: BytePos) -> (u32, u32) {
110+
let rustc_span::MultiByteChar { pos, bytes } = mbc;
114111

115112
(pos.0 - source_file_start.0, bytes as u32)
116113
}
117114

118115
fn stable_non_narrow_char(
119-
swc: ::rustc_span::NonNarrowChar,
120-
source_file_start: ::rustc_span::BytePos,
116+
swc: rustc_span::NonNarrowChar,
117+
source_file_start: BytePos,
121118
) -> (u32, u32) {
122119
let pos = swc.pos();
123120
let width = swc.width();
124121

125122
(pos.0 - source_file_start.0, width as u32)
126123
}
127124

128-
fn stable_normalized_pos(
129-
np: ::rustc_span::NormalizedPos,
130-
source_file_start: ::rustc_span::BytePos,
131-
) -> (u32, u32) {
132-
let ::rustc_span::NormalizedPos { pos, diff } = np;
125+
fn stable_normalized_pos(np: NormalizedPos, source_file_start: BytePos) -> (u32, u32) {
126+
let NormalizedPos { pos, diff } = np;
133127

134128
(pos.0 - source_file_start.0, diff)
135129
}

compiler/rustc_middle/src/mir/interpret/allocation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ pub struct Allocation<Tag = (), Extra = ()> {
4040
pub extra: Extra,
4141
}
4242

43-
pub trait AllocationExtra<Tag>: ::std::fmt::Debug + Clone {
43+
pub trait AllocationExtra<Tag>: std::fmt::Debug + Clone {
4444
// There is no constructor in here because the constructor's type depends
4545
// on `MemoryKind`, and making things sufficiently generic leads to painful
4646
// inference failure.

compiler/rustc_middle/src/mir/interpret/value.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl<'tcx> ConstValue<'tcx> {
5858

5959
pub fn try_to_str_slice(&self) -> Option<&'tcx str> {
6060
if let ConstValue::Slice { data, start, end } = *self {
61-
::std::str::from_utf8(data.inspect_with_uninit_and_ptr_outside_interpreter(start..end))
61+
std::str::from_utf8(data.inspect_with_uninit_and_ptr_outside_interpreter(start..end))
6262
.ok()
6363
} else {
6464
None
@@ -465,7 +465,7 @@ impl<'tcx, Tag> Scalar<Tag> {
465465

466466
pub fn to_char(self) -> InterpResult<'tcx, char> {
467467
let val = self.to_u32()?;
468-
match ::std::char::from_u32(val) {
468+
match std::char::from_u32(val) {
469469
Some(c) => Ok(c),
470470
None => throw_ub!(InvalidChar(val)),
471471
}

compiler/rustc_middle/src/mir/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -775,7 +775,7 @@ mod binding_form_impl {
775775
impl<'a, 'tcx> HashStable<StableHashingContext<'a>> for super::BindingForm<'tcx> {
776776
fn hash_stable(&self, hcx: &mut StableHashingContext<'a>, hasher: &mut StableHasher) {
777777
use super::BindingForm::*;
778-
::std::mem::discriminant(self).hash_stable(hcx, hasher);
778+
std::mem::discriminant(self).hash_stable(hcx, hasher);
779779

780780
match self {
781781
Var(binding) => binding.hash_stable(hcx, hasher),

compiler/rustc_middle/src/ty/layout.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1894,7 +1894,7 @@ impl<'tcx, T: HasTyCtxt<'tcx>> HasTyCtxt<'tcx> for LayoutCx<'tcx, T> {
18941894
}
18951895
}
18961896

1897-
pub type TyAndLayout<'tcx> = ::rustc_target::abi::TyAndLayout<'tcx, Ty<'tcx>>;
1897+
pub type TyAndLayout<'tcx> = rustc_target::abi::TyAndLayout<'tcx, Ty<'tcx>>;
18981898

18991899
impl<'tcx> LayoutOf for LayoutCx<'tcx, TyCtxt<'tcx>> {
19001900
type Ty = Ty<'tcx>;

compiler/rustc_middle/src/ty/normalize_erasing_regions.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ impl<'tcx> TyCtxt<'tcx> {
2323
{
2424
debug!(
2525
"normalize_erasing_regions::<{}>(value={:?}, param_env={:?})",
26-
::std::any::type_name::<T>(),
26+
std::any::type_name::<T>(),
2727
value,
2828
param_env,
2929
);

compiler/rustc_middle/src/ty/print/pretty.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1142,7 +1142,7 @@ pub trait PrettyPrinter<'tcx>:
11421142
// relocations (we have an active `str` reference here). We don't use this
11431143
// result to affect interpreter execution.
11441144
let slice = data.inspect_with_uninit_and_ptr_outside_interpreter(start..end);
1145-
let s = ::std::str::from_utf8(slice).expect("non utf8 str from miri");
1145+
let s = std::str::from_utf8(slice).expect("non utf8 str from miri");
11461146
p!(write("{:?}", s));
11471147
Ok(self)
11481148
}

0 commit comments

Comments
 (0)