Skip to content

Commit 552b63c

Browse files
committed
Auto merge of #2715 - RalfJung:rustup, r=RalfJung
Rustup
2 parents faec289 + 7481ba7 commit 552b63c

File tree

261 files changed

+3309
-2591
lines changed

Some content is hidden

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

261 files changed

+3309
-2591
lines changed

.github/workflows/ci.yml

+6-6
Original file line numberDiff line numberDiff line change
@@ -309,7 +309,7 @@ jobs:
309309
NO_DEBUG_ASSERTIONS: 1
310310
NO_OVERFLOW_CHECKS: 1
311311
DIST_REQUIRE_ALL_TOOLS: 1
312-
os: macos-latest
312+
os: macos-12-xl
313313
- name: dist-apple-various
314314
env:
315315
SCRIPT: "./x.py dist bootstrap --include-default-paths --host='' --target=aarch64-apple-ios,x86_64-apple-ios,aarch64-apple-ios-sim"
@@ -320,7 +320,7 @@ jobs:
320320
NO_LLVM_ASSERTIONS: 1
321321
NO_DEBUG_ASSERTIONS: 1
322322
NO_OVERFLOW_CHECKS: 1
323-
os: macos-latest
323+
os: macos-12-xl
324324
- name: dist-x86_64-apple-alt
325325
env:
326326
SCRIPT: "./x.py dist bootstrap --include-default-paths"
@@ -331,7 +331,7 @@ jobs:
331331
NO_LLVM_ASSERTIONS: 1
332332
NO_DEBUG_ASSERTIONS: 1
333333
NO_OVERFLOW_CHECKS: 1
334-
os: macos-latest
334+
os: macos-12-xl
335335
- name: x86_64-apple-1
336336
env:
337337
SCRIPT: "./x.py --stage 2 test --exclude src/test/ui --exclude src/test/rustdoc --exclude src/test/run-make-fulldeps"
@@ -342,7 +342,7 @@ jobs:
342342
NO_LLVM_ASSERTIONS: 1
343343
NO_DEBUG_ASSERTIONS: 1
344344
NO_OVERFLOW_CHECKS: 1
345-
os: macos-latest
345+
os: macos-12-xl
346346
- name: x86_64-apple-2
347347
env:
348348
SCRIPT: "./x.py --stage 2 test src/test/ui src/test/rustdoc src/test/run-make-fulldeps"
@@ -353,7 +353,7 @@ jobs:
353353
NO_LLVM_ASSERTIONS: 1
354354
NO_DEBUG_ASSERTIONS: 1
355355
NO_OVERFLOW_CHECKS: 1
356-
os: macos-latest
356+
os: macos-12-xl
357357
- name: dist-aarch64-apple
358358
env:
359359
SCRIPT: "./x.py dist bootstrap --include-default-paths --stage 2"
@@ -368,7 +368,7 @@ jobs:
368368
NO_OVERFLOW_CHECKS: 1
369369
DIST_REQUIRE_ALL_TOOLS: 1
370370
JEMALLOC_SYS_WITH_LG_PAGE: 14
371-
os: macos-latest
371+
os: macos-12-xl
372372
- name: x86_64-msvc-1
373373
env:
374374
RUST_CONFIGURE_ARGS: "--build=x86_64-pc-windows-msvc --enable-profiler"

Cargo.lock

+21-11
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,15 @@ version = "1.0.65"
9292
source = "registry+https://github.com/rust-lang/crates.io-index"
9393
checksum = "98161a4e3e2184da77bb14f02184cdd111e83bbbcc9979dfee3c44b9a85f5602"
9494

95+
[[package]]
96+
name = "ar_archive_writer"
97+
version = "0.1.1"
98+
source = "registry+https://github.com/rust-lang/crates.io-index"
99+
checksum = "276881980556fdadeb88aa1ffc667e4d2e8fe72531dfabcb7a82bb3c9ea9ba31"
100+
dependencies = [
101+
"object",
102+
]
103+
95104
[[package]]
96105
name = "array_tool"
97106
version = "1.0.3"
@@ -906,9 +915,9 @@ version = "0.0.0"
906915

907916
[[package]]
908917
name = "cpufeatures"
909-
version = "0.2.1"
918+
version = "0.2.5"
910919
source = "registry+https://github.com/rust-lang/crates.io-index"
911-
checksum = "95059428f66df56b63431fdb4e1947ed2190586af5c5a8a8b71122bdf5a7f469"
920+
checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320"
912921
dependencies = [
913922
"libc",
914923
]
@@ -1085,12 +1094,6 @@ version = "0.1.13"
10851094
source = "registry+https://github.com/rust-lang/crates.io-index"
10861095
checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8"
10871096

1088-
[[package]]
1089-
name = "difference"
1090-
version = "2.0.0"
1091-
source = "registry+https://github.com/rust-lang/crates.io-index"
1092-
checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198"
1093-
10941097
[[package]]
10951098
name = "digest"
10961099
version = "0.10.2"
@@ -1162,6 +1165,12 @@ dependencies = [
11621165
"syn",
11631166
]
11641167

1168+
[[package]]
1169+
name = "dissimilar"
1170+
version = "1.0.4"
1171+
source = "registry+https://github.com/rust-lang/crates.io-index"
1172+
checksum = "8c97b9233581d84b8e1e689cdd3a47b6f69770084fc246e86a7f78b0d9c1d4a5"
1173+
11651174
[[package]]
11661175
name = "dlmalloc"
11671176
version = "0.2.3"
@@ -1283,11 +1292,11 @@ dependencies = [
12831292

12841293
[[package]]
12851294
name = "expect-test"
1286-
version = "1.0.1"
1295+
version = "1.4.0"
12871296
source = "registry+https://github.com/rust-lang/crates.io-index"
1288-
checksum = "ceb96f3eaa0d4e8769c52dacfd4eb60183b817ed2f176171b3c691d5022b0f2e"
1297+
checksum = "1d4661aca38d826eb7c72fe128e4238220616de4c0cc00db7bfc38e2e1364dd3"
12891298
dependencies = [
1290-
"difference",
1299+
"dissimilar",
12911300
"once_cell",
12921301
]
12931302

@@ -3495,6 +3504,7 @@ dependencies = [
34953504
name = "rustc_codegen_ssa"
34963505
version = "0.0.0"
34973506
dependencies = [
3507+
"ar_archive_writer",
34983508
"bitflags",
34993509
"cc",
35003510
"itertools",

LICENSES/LLVM-exception.txt

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---- LLVM Exceptions to the Apache 2.0 License ----
2+
3+
As an exception, if, as a result of your compiling your source code, portions
4+
of this Software are embedded into an Object form of such source code, you
5+
may redistribute such embedded portions in such Object form without complying
6+
with the conditions of Sections 4(a), 4(b) and 4(d) of the License.
7+
8+
In addition, if you combine or link compiled forms of this Software with
9+
software that is licensed under the GPLv2 ("Combined Software") and if a
10+
court of competent jurisdiction determines that the patent provision (Section
11+
3), the indemnity provision (Section 9) or other Section of the License
12+
conflicts with the conditions of the GPLv2, you may retroactively and
13+
prospectively choose to deem waived or otherwise exclude such Section(s) of
14+
the License, but only in their entirety and only with respect to the Combined
15+
Software.

compiler/rustc_abi/src/layout.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -354,7 +354,7 @@ pub trait LayoutCalculator {
354354
if !always_sized { StructKind::MaybeUnsized } else { StructKind::AlwaysSized }
355355
};
356356

357-
let mut st = self.univariant(dl, &variants[v], &repr, kind)?;
357+
let mut st = self.univariant(dl, &variants[v], repr, kind)?;
358358
st.variants = Variants::Single { index: v };
359359

360360
if is_unsafe_cell {
@@ -457,7 +457,7 @@ pub trait LayoutCalculator {
457457
let mut variant_layouts = variants
458458
.iter_enumerated()
459459
.map(|(j, v)| {
460-
let mut st = self.univariant(dl, v, &repr, StructKind::AlwaysSized)?;
460+
let mut st = self.univariant(dl, v, repr, StructKind::AlwaysSized)?;
461461
st.variants = Variants::Single { index: j };
462462

463463
align = align.max(st.align);
@@ -647,8 +647,8 @@ pub trait LayoutCalculator {
647647
.map(|(i, field_layouts)| {
648648
let mut st = self.univariant(
649649
dl,
650-
&field_layouts,
651-
&repr,
650+
field_layouts,
651+
repr,
652652
StructKind::Prefixed(min_ity.size(), prefix_align),
653653
)?;
654654
st.variants = Variants::Single { index: i };
@@ -755,7 +755,7 @@ pub trait LayoutCalculator {
755755
// Try to use a ScalarPair for all tagged enums.
756756
let mut common_prim = None;
757757
let mut common_prim_initialized_in_all_variants = true;
758-
for (field_layouts, layout_variant) in iter::zip(&*variants, &layout_variants) {
758+
for (field_layouts, layout_variant) in iter::zip(variants, &layout_variants) {
759759
let FieldsShape::Arbitrary { ref offsets, .. } = layout_variant.fields else {
760760
panic!();
761761
};

compiler/rustc_ast/src/ast.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,7 @@ impl Expr {
11791179
pub fn peel_parens(&self) -> &Expr {
11801180
let mut expr = self;
11811181
while let ExprKind::Paren(inner) = &expr.kind {
1182-
expr = &inner;
1182+
expr = inner;
11831183
}
11841184
expr
11851185
}
@@ -1312,8 +1312,10 @@ pub struct Closure {
13121312
pub movability: Movability,
13131313
pub fn_decl: P<FnDecl>,
13141314
pub body: P<Expr>,
1315-
/// The span of the argument block `|...|`.
1315+
/// The span of the declaration block: 'move |...| -> ...'
13161316
pub fn_decl_span: Span,
1317+
/// The span of the argument block `|...|`
1318+
pub fn_arg_span: Span,
13171319
}
13181320

13191321
/// Limit types of a range (inclusive or exclusive)
@@ -2027,7 +2029,7 @@ impl Ty {
20272029
pub fn peel_refs(&self) -> &Self {
20282030
let mut final_ty = self;
20292031
while let TyKind::Rptr(_, MutTy { ty, .. }) = &final_ty.kind {
2030-
final_ty = &ty;
2032+
final_ty = ty;
20312033
}
20322034
final_ty
20332035
}

compiler/rustc_ast/src/mut_visit.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -736,8 +736,7 @@ pub fn visit_token<T: MutVisitor>(t: &mut Token, vis: &mut T) {
736736
return; // Avoid visiting the span for the second time.
737737
}
738738
token::Interpolated(nt) => {
739-
let mut nt = Lrc::make_mut(nt);
740-
visit_nonterminal(&mut nt, vis);
739+
visit_nonterminal(Lrc::make_mut(nt), vis);
741740
}
742741
_ => {}
743742
}
@@ -1368,6 +1367,7 @@ pub fn noop_visit_expr<T: MutVisitor>(
13681367
fn_decl,
13691368
body,
13701369
fn_decl_span,
1370+
fn_arg_span: _,
13711371
}) => {
13721372
vis.visit_closure_binder(binder);
13731373
vis.visit_asyncness(asyncness);

compiler/rustc_ast/src/tokenstream.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ impl TokenTree {
6464
match (self, other) {
6565
(TokenTree::Token(token, _), TokenTree::Token(token2, _)) => token.kind == token2.kind,
6666
(TokenTree::Delimited(_, delim, tts), TokenTree::Delimited(_, delim2, tts2)) => {
67-
delim == delim2 && tts.eq_unspanned(&tts2)
67+
delim == delim2 && tts.eq_unspanned(tts2)
6868
}
6969
_ => false,
7070
}
@@ -402,7 +402,7 @@ impl TokenStream {
402402
let mut t1 = self.trees();
403403
let mut t2 = other.trees();
404404
for (t1, t2) in iter::zip(&mut t1, &mut t2) {
405-
if !t1.eq_unspanned(&t2) {
405+
if !t1.eq_unspanned(t2) {
406406
return false;
407407
}
408408
}
@@ -475,7 +475,7 @@ impl TokenStream {
475475
token::Interpolated(nt) => TokenTree::Delimited(
476476
DelimSpan::from_single(token.span),
477477
Delimiter::Invisible,
478-
TokenStream::from_nonterminal_ast(&nt).flattened(),
478+
TokenStream::from_nonterminal_ast(nt).flattened(),
479479
),
480480
_ => TokenTree::Token(token.clone(), spacing),
481481
}
@@ -511,7 +511,7 @@ impl TokenStream {
511511
fn try_glue_to_last(vec: &mut Vec<TokenTree>, tt: &TokenTree) -> bool {
512512
if let Some(TokenTree::Token(last_tok, Spacing::Joint)) = vec.last()
513513
&& let TokenTree::Token(tok, spacing) = tt
514-
&& let Some(glued_tok) = last_tok.glue(&tok)
514+
&& let Some(glued_tok) = last_tok.glue(tok)
515515
{
516516
// ...then overwrite the last token tree in `vec` with the
517517
// glued token, and skip the first token tree from `stream`.

compiler/rustc_ast/src/util/classify.rs

+1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ pub fn expr_requires_semi_to_be_stmt(e: &ast::Expr) -> bool {
2121
| ast::ExprKind::Loop(..)
2222
| ast::ExprKind::ForLoop(..)
2323
| ast::ExprKind::TryBlock(..)
24+
| ast::ExprKind::ConstBlock(..)
2425
)
2526
}
2627

compiler/rustc_ast/src/util/comments.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ pub fn beautify_doc_string(data: Symbol, kind: CommentKind) -> Symbol {
110110
} else {
111111
&mut lines
112112
};
113-
if let Some(horizontal) = get_horizontal_trim(&lines, kind) {
113+
if let Some(horizontal) = get_horizontal_trim(lines, kind) {
114114
changes = true;
115115
// remove a "[ \t]*\*" block from each line, if possible
116116
for line in lines.iter_mut() {
@@ -147,7 +147,7 @@ fn all_whitespace(s: &str, col: CharPos) -> Option<usize> {
147147

148148
fn trim_whitespace_prefix(s: &str, col: CharPos) -> &str {
149149
let len = s.len();
150-
match all_whitespace(&s, col) {
150+
match all_whitespace(s, col) {
151151
Some(col) => {
152152
if col < len {
153153
&s[col..]

compiler/rustc_ast/src/util/literal.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,14 @@ impl LitKind {
5252
// new symbol because the string in the LitKind is different to the
5353
// string in the token.
5454
let s = symbol.as_str();
55-
let symbol = if s.contains(&['\\', '\r']) {
55+
let symbol = if s.contains(['\\', '\r']) {
5656
let mut buf = String::with_capacity(s.len());
5757
let mut error = Ok(());
5858
// Force-inlining here is aggressive but the closure is
5959
// called on every char in the string, so it can be
6060
// hot in programs with many long strings.
6161
unescape_literal(
62-
&s,
62+
s,
6363
Mode::Str,
6464
&mut #[inline(always)]
6565
|_, unescaped_char| match unescaped_char {
@@ -85,7 +85,7 @@ impl LitKind {
8585
if s.contains('\r') {
8686
let mut buf = String::with_capacity(s.len());
8787
let mut error = Ok(());
88-
unescape_literal(&s, Mode::RawStr, &mut |_, unescaped_char| {
88+
unescape_literal(s, Mode::RawStr, &mut |_, unescaped_char| {
8989
match unescaped_char {
9090
Ok(c) => buf.push(c),
9191
Err(err) => {
@@ -106,7 +106,7 @@ impl LitKind {
106106
let s = symbol.as_str();
107107
let mut buf = Vec::with_capacity(s.len());
108108
let mut error = Ok(());
109-
unescape_literal(&s, Mode::ByteStr, &mut |_, c| match c {
109+
unescape_literal(s, Mode::ByteStr, &mut |_, c| match c {
110110
Ok(c) => buf.push(byte_from_char(c)),
111111
Err(err) => {
112112
if err.is_fatal() {
@@ -122,7 +122,7 @@ impl LitKind {
122122
let bytes = if s.contains('\r') {
123123
let mut buf = Vec::with_capacity(s.len());
124124
let mut error = Ok(());
125-
unescape_literal(&s, Mode::RawByteStr, &mut |_, c| match c {
125+
unescape_literal(s, Mode::RawByteStr, &mut |_, c| match c {
126126
Ok(c) => buf.push(byte_from_char(c)),
127127
Err(err) => {
128128
if err.is_fatal() {

compiler/rustc_ast/src/util/parser.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -384,7 +384,7 @@ pub fn contains_exterior_struct_lit(value: &ast::Expr) -> bool {
384384
| ast::ExprKind::AssignOp(_, lhs, rhs)
385385
| ast::ExprKind::Binary(_, lhs, rhs) => {
386386
// X { y: 1 } + X { y: 2 }
387-
contains_exterior_struct_lit(&lhs) || contains_exterior_struct_lit(&rhs)
387+
contains_exterior_struct_lit(lhs) || contains_exterior_struct_lit(rhs)
388388
}
389389
ast::ExprKind::Await(x)
390390
| ast::ExprKind::Unary(_, x)
@@ -393,12 +393,12 @@ pub fn contains_exterior_struct_lit(value: &ast::Expr) -> bool {
393393
| ast::ExprKind::Field(x, _)
394394
| ast::ExprKind::Index(x, _) => {
395395
// &X { y: 1 }, X { y: 1 }.y
396-
contains_exterior_struct_lit(&x)
396+
contains_exterior_struct_lit(x)
397397
}
398398

399399
ast::ExprKind::MethodCall(box ast::MethodCall { receiver, .. }) => {
400400
// X { y: 1 }.bar(...)
401-
contains_exterior_struct_lit(&receiver)
401+
contains_exterior_struct_lit(receiver)
402402
}
403403

404404
_ => false,

compiler/rustc_ast/src/util/unicode.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub fn contains_text_flow_control_chars(s: &str) -> bool {
1717
// U+2069 - E2 81 A9
1818
let mut bytes = s.as_bytes();
1919
loop {
20-
match core::slice::memchr::memchr(0xE2, &bytes) {
20+
match core::slice::memchr::memchr(0xE2, bytes) {
2121
Some(idx) => {
2222
// bytes are valid UTF-8 -> E2 must be followed by two bytes
2323
let ch = &bytes[idx..idx + 3];

compiler/rustc_ast/src/visit.rs

+1
Original file line numberDiff line numberDiff line change
@@ -840,6 +840,7 @@ pub fn walk_expr<'a, V: Visitor<'a>>(visitor: &mut V, expression: &'a Expr) {
840840
fn_decl,
841841
body,
842842
fn_decl_span: _,
843+
fn_arg_span: _,
843844
}) => {
844845
visitor.visit_fn(FnKind::Closure(binder, fn_decl, body), expression.span, expression.id)
845846
}

compiler/rustc_ast_lowering/src/asm.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,12 @@ impl<'a, 'hir> LoweringContext<'a, 'hir> {
222222
// Wrap the expression in an AnonConst.
223223
let parent_def_id = self.current_hir_id_owner;
224224
let node_id = self.next_node_id();
225-
self.create_def(parent_def_id.def_id, node_id, DefPathData::AnonConst);
225+
self.create_def(
226+
parent_def_id.def_id,
227+
node_id,
228+
DefPathData::AnonConst,
229+
*op_sp,
230+
);
226231
let anon_const = AnonConst { id: node_id, value: P(expr) };
227232
hir::InlineAsmOperand::SymFn {
228233
anon_const: self.lower_anon_const(&anon_const),

0 commit comments

Comments
 (0)