Skip to content

Commit a25ec22

Browse files
committed
Auto merge of #3801 - RalfJung:rustup, r=RalfJung
Rustup
2 parents 3456432 + 14f9284 commit a25ec22

File tree

883 files changed

+19238
-9734
lines changed

Some content is hidden

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

883 files changed

+19238
-9734
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ Session.vim
1919
*.iml
2020
.vscode
2121
.project
22+
.vim/
23+
.helix/
24+
.zed/
2225
.favorites.json
2326
.settings/
2427
.vs/

Cargo.lock

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -205,11 +205,11 @@ dependencies = [
205205

206206
[[package]]
207207
name = "ar_archive_writer"
208-
version = "0.3.0"
208+
version = "0.3.3"
209209
source = "registry+https://github.com/rust-lang/crates.io-index"
210-
checksum = "f8412a2d690663356cba5a2532f3ed55d1e8090743bc6695b88403b27df67733"
210+
checksum = "3f2bcb7cf51decfbbfc7ef476e28b0775b13e5eb1190f8b7df145cd53d4f4374"
211211
dependencies = [
212-
"object 0.35.0",
212+
"object 0.36.2",
213213
]
214214

215215
[[package]]
@@ -564,14 +564,15 @@ dependencies = [
564564
"termize",
565565
"tokio",
566566
"toml 0.7.8",
567-
"ui_test 0.24.0",
567+
"ui_test 0.25.0",
568568
"walkdir",
569569
]
570570

571571
[[package]]
572572
name = "clippy_config"
573573
version = "0.1.82"
574574
dependencies = [
575+
"itertools",
575576
"rustc-semver",
576577
"serde",
577578
"toml 0.7.8",
@@ -1406,8 +1407,11 @@ name = "generate-copyright"
14061407
version = "0.1.0"
14071408
dependencies = [
14081409
"anyhow",
1410+
"cargo_metadata 0.18.1",
1411+
"rinja",
14091412
"serde",
14101413
"serde_json",
1414+
"thiserror",
14111415
]
14121416

14131417
[[package]]
@@ -2454,15 +2458,6 @@ dependencies = [
24542458
"ruzstd 0.5.0",
24552459
]
24562460

2457-
[[package]]
2458-
name = "object"
2459-
version = "0.35.0"
2460-
source = "registry+https://github.com/rust-lang/crates.io-index"
2461-
checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e"
2462-
dependencies = [
2463-
"memchr",
2464-
]
2465-
24662461
[[package]]
24672462
name = "object"
24682463
version = "0.36.2"
@@ -3103,7 +3098,10 @@ version = "0.3.0"
31033098
source = "registry+https://github.com/rust-lang/crates.io-index"
31043099
checksum = "6d3762e3740cdbf2fd2be465cc2c26d643ad17353cc2e0223d211c1b096118bd"
31053100
dependencies = [
3101+
"humansize",
31063102
"itoa",
3103+
"num-traits",
3104+
"percent-encoding",
31073105
"rinja_derive",
31083106
]
31093107

@@ -4939,9 +4937,9 @@ dependencies = [
49394937

49404938
[[package]]
49414939
name = "spanned"
4942-
version = "0.2.1"
4940+
version = "0.3.0"
49434941
source = "registry+https://github.com/rust-lang/crates.io-index"
4944-
checksum = "ed14ba8b4b82241bd5daba2c49185d4a0581a0058355fe96537338f002b8605d"
4942+
checksum = "86af297923fbcfd107c20a189a6e9c872160df71a7190ae4a7a6c5dce4b2feb6"
49454943
dependencies = [
49464944
"bstr",
49474945
"color-eyre",
@@ -5565,9 +5563,9 @@ dependencies = [
55655563

55665564
[[package]]
55675565
name = "ui_test"
5568-
version = "0.24.0"
5566+
version = "0.25.0"
55695567
source = "registry+https://github.com/rust-lang/crates.io-index"
5570-
checksum = "bc1c6c78d55482388711c8d417b8e547263046a607512278fed274c54633bbe4"
5568+
checksum = "f7e4f339f62edc873975c47115f9e71c5454ddaa37c1142b42fc0b2672c8dacb"
55715569
dependencies = [
55725570
"annotate-snippets 0.11.4",
55735571
"anyhow",

REUSE.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ SPDX-License-Identifier = "MIT OR Apache-2.0"
163163
path = "src/llvm-project/**"
164164
precedence = "override"
165165
SPDX-FileCopyrightText = [
166-
"2003-2019 by the contributors listed in [CREDITS.TXT](https://github.com/rust-lang/llvm-project/blob/7738295178045041669876bf32b0543ec8319a5c/llvm/CREDITS.TXT)",
166+
"2003-2019 by the contributors listed in CREDITS.TXT (https://github.com/rust-lang/llvm-project/blob/7738295178045041669876bf32b0543ec8319a5c/llvm/CREDITS.TXT)",
167167
"2010 Apple Inc",
168168
"2003-2019 University of Illinois at Urbana-Champaign.",
169169
]

compiler/rustc/src/main.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
// We need this feature as it changes `dylib` linking behavior and allows us to link to `rustc_driver`.
2+
#![feature(rustc_private)]
3+
14
// A note about jemalloc: rustc uses jemalloc when built for CI and
25
// distribution. The obvious way to do this is with the `#[global_allocator]`
36
// mechanism. However, for complicated reasons (see

compiler/rustc_ast/src/ast.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -585,7 +585,9 @@ impl Pat {
585585
}
586586
// A slice/array pattern `[P]` can be reparsed as `[T]`, an unsized array,
587587
// when `P` can be reparsed as a type `T`.
588-
PatKind::Slice(pats) if pats.len() == 1 => pats[0].to_ty().map(TyKind::Slice)?,
588+
PatKind::Slice(pats) if let [pat] = pats.as_slice() => {
589+
pat.to_ty().map(TyKind::Slice)?
590+
}
589591
// A tuple pattern `(P0, .., Pn)` can be reparsed as `(T0, .., Tn)`
590592
// assuming `T0` to `Tn` are all syntactically valid as types.
591593
PatKind::Tuple(pats) => {
@@ -1187,8 +1189,8 @@ impl Expr {
11871189
/// Does not ensure that the path resolves to a const param, the caller should check this.
11881190
pub fn is_potential_trivial_const_arg(&self) -> bool {
11891191
let this = if let ExprKind::Block(block, None) = &self.kind
1190-
&& block.stmts.len() == 1
1191-
&& let StmtKind::Expr(expr) = &block.stmts[0].kind
1192+
&& let [stmt] = block.stmts.as_slice()
1193+
&& let StmtKind::Expr(expr) = &stmt.kind
11921194
{
11931195
expr
11941196
} else {
@@ -1248,7 +1250,9 @@ impl Expr {
12481250
expr.to_ty().map(|ty| TyKind::Array(ty, expr_len.clone()))?
12491251
}
12501252

1251-
ExprKind::Array(exprs) if exprs.len() == 1 => exprs[0].to_ty().map(TyKind::Slice)?,
1253+
ExprKind::Array(exprs) if let [expr] = exprs.as_slice() => {
1254+
expr.to_ty().map(TyKind::Slice)?
1255+
}
12521256

12531257
ExprKind::Tup(exprs) => {
12541258
let tys = exprs.iter().map(|expr| expr.to_ty()).collect::<Option<ThinVec<_>>>()?;

compiler/rustc_ast_lowering/src/delegation.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -275,8 +275,8 @@ impl<'hir> LoweringContext<'_, 'hir> {
275275
// FIXME(fn_delegation): Alternatives for target expression lowering:
276276
// https://github.com/rust-lang/rfcs/pull/3530#issuecomment-2197170600.
277277
fn lower_target_expr(&mut self, block: &Block) -> hir::Expr<'hir> {
278-
if block.stmts.len() == 1
279-
&& let StmtKind::Expr(expr) = &block.stmts[0].kind
278+
if let [stmt] = block.stmts.as_slice()
279+
&& let StmtKind::Expr(expr) = &stmt.kind
280280
{
281281
return self.lower_expr_mut(expr);
282282
}

compiler/rustc_ast_lowering/src/item.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1668,7 +1668,6 @@ impl<'hir> LoweringContext<'_, 'hir> {
16681668
}),
16691669
)),
16701670
)),
1671-
// FIXME(effects) we might not need a default.
16721671
default: Some(default_ct),
16731672
is_host_effect: true,
16741673
synthetic: true,

compiler/rustc_ast_pretty/src/pprust/state.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -502,8 +502,8 @@ pub trait PrintState<'a>: std::ops::Deref<Target = pp::Printer> + std::ops::Dere
502502
if !self.is_beginning_of_line() {
503503
self.word(" ");
504504
}
505-
if cmnt.lines.len() == 1 {
506-
self.word(cmnt.lines[0].clone());
505+
if let [line] = cmnt.lines.as_slice() {
506+
self.word(line.clone());
507507
self.hardbreak()
508508
} else {
509509
self.visual_align();

compiler/rustc_ast_pretty/src/pprust/state/item.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -783,8 +783,8 @@ impl<'a> State<'a> {
783783
}
784784
if items.is_empty() {
785785
self.word("{}");
786-
} else if items.len() == 1 {
787-
self.print_use_tree(&items[0].0);
786+
} else if let [(item, _)] = items.as_slice() {
787+
self.print_use_tree(item);
788788
} else {
789789
self.cbox(INDENT_UNIT);
790790
self.word("{");

compiler/rustc_attr/src/builtin.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -665,12 +665,12 @@ pub fn eval_condition(
665665
res & eval_condition(mi.meta_item().unwrap(), sess, features, eval)
666666
}),
667667
sym::not => {
668-
if mis.len() != 1 {
668+
let [mi] = mis.as_slice() else {
669669
dcx.emit_err(session_diagnostics::ExpectedOneCfgPattern { span: cfg.span });
670670
return false;
671-
}
671+
};
672672

673-
!eval_condition(mis[0].meta_item().unwrap(), sess, features, eval)
673+
!eval_condition(mi.meta_item().unwrap(), sess, features, eval)
674674
}
675675
sym::target => {
676676
if let Some(features) = features
@@ -1051,10 +1051,10 @@ pub fn parse_repr_attr(sess: &Session, attr: &Attribute) -> Vec<ReprAttr> {
10511051
MetaItemKind::List(nested_items) => {
10521052
if meta_item.has_name(sym::align) {
10531053
recognised = true;
1054-
if nested_items.len() == 1 {
1054+
if let [nested_item] = nested_items.as_slice() {
10551055
sess.dcx().emit_err(
10561056
session_diagnostics::IncorrectReprFormatExpectInteger {
1057-
span: nested_items[0].span(),
1057+
span: nested_item.span(),
10581058
},
10591059
);
10601060
} else {
@@ -1066,10 +1066,10 @@ pub fn parse_repr_attr(sess: &Session, attr: &Attribute) -> Vec<ReprAttr> {
10661066
}
10671067
} else if meta_item.has_name(sym::packed) {
10681068
recognised = true;
1069-
if nested_items.len() == 1 {
1069+
if let [nested_item] = nested_items.as_slice() {
10701070
sess.dcx().emit_err(
10711071
session_diagnostics::IncorrectReprFormatPackedExpectInteger {
1072-
span: nested_items[0].span(),
1072+
span: nested_item.span(),
10731073
},
10741074
);
10751075
} else {

0 commit comments

Comments
 (0)