Skip to content

Commit f408492

Browse files
committed
Auto merge of #3126 - rust-lang:rustup-2023-10-17, r=RalfJung
Automatic Rustup
2 parents c1dbc19 + d6f52bf commit f408492

File tree

787 files changed

+8973
-5939
lines changed

Some content is hidden

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

787 files changed

+8973
-5939
lines changed

.git-blame-ignore-revs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,3 +18,5 @@ b39a1d6f1a30ba29f25d7141038b9a5bf0126e36
1818
f97fddab91fbf290ea5b691fe355d6f915220b6e
1919
# format let-else
2020
cc907f80b95c6ec530c5ee1b05b044a468f07eca
21+
# format let-chains
22+
b2d2184edea578109a48ec3d8decbee5948e8f35

.mailmap

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,9 @@ Lindsey Kuper <[email protected]> <[email protected]>
346346
347347
Liu Dingming <[email protected]>
348348
Loo Maclin <[email protected]>
349-
Loïc BRANSTETT <[email protected]>
349+
350+
351+
350352
351353
352354
Lukas Lueg <[email protected]>
@@ -445,6 +447,8 @@ Oliver Scherer <[email protected]> <[email protected]
445447
446448
447449
Oliver Scherer <[email protected]>
450+
451+
Onur Özkan <[email protected]>
448452
Ömer Sinan Ağacan <[email protected]>
449453
Ophir LOJKINE <[email protected]>
450454
Ožbolt Menegatti <[email protected]> gareins <[email protected]>

Cargo.lock

Lines changed: 9 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -2150,9 +2150,9 @@ checksum = "db13adb97ab515a3691f56e4dbab09283d0b86cb45abd991d8634a9d6f501760"
21502150

21512151
[[package]]
21522152
name = "libc"
2153-
version = "0.2.148"
2153+
version = "0.2.149"
21542154
source = "registry+https://github.com/rust-lang/crates.io-index"
2155-
checksum = "9cdc71e17332e86d2e1d38c1f99edcb6288ee11b815fb1a4b049eaa2114d369b"
2155+
checksum = "a08173bc88b7955d1b3145aa561539096c421ac8debde8cbc3612ec635fee29b"
21562156
dependencies = [
21572157
"rustc-std-workspace-core",
21582158
]
@@ -2245,9 +2245,9 @@ dependencies = [
22452245

22462246
[[package]]
22472247
name = "linux-raw-sys"
2248-
version = "0.4.7"
2248+
version = "0.4.10"
22492249
source = "registry+https://github.com/rust-lang/crates.io-index"
2250-
checksum = "1a9bad9f94746442c783ca431b22403b519cd7fbeed0533fdd6328b2f2212128"
2250+
checksum = "da2479e8c062e40bf0066ffa0bc823de0a9368974af99c9f6df941d2c231e03f"
22512251

22522252
[[package]]
22532253
name = "litemap"
@@ -2418,9 +2418,9 @@ dependencies = [
24182418

24192419
[[package]]
24202420
name = "minifier"
2421-
version = "0.2.2"
2421+
version = "0.2.3"
24222422
source = "registry+https://github.com/rust-lang/crates.io-index"
2423-
checksum = "8eb022374af2f446981254e6bf9efb6e2c9e1a53176d395fca02792fd4435729"
2423+
checksum = "5394aa376422b4b2b6c02fd9cfcb657e4ec544ae98e43d7d5d785fd0d042fd6d"
24242424

24252425
[[package]]
24262426
name = "minimal-lexical"
@@ -2970,30 +2970,6 @@ dependencies = [
29702970
"pad",
29712971
]
29722972

2973-
[[package]]
2974-
name = "proc-macro-error"
2975-
version = "1.0.4"
2976-
source = "registry+https://github.com/rust-lang/crates.io-index"
2977-
checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c"
2978-
dependencies = [
2979-
"proc-macro-error-attr",
2980-
"proc-macro2",
2981-
"quote",
2982-
"syn 1.0.109",
2983-
"version_check",
2984-
]
2985-
2986-
[[package]]
2987-
name = "proc-macro-error-attr"
2988-
version = "1.0.4"
2989-
source = "registry+https://github.com/rust-lang/crates.io-index"
2990-
checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869"
2991-
dependencies = [
2992-
"proc-macro2",
2993-
"quote",
2994-
"version_check",
2995-
]
2996-
29972973
[[package]]
29982974
name = "proc-macro-hack"
29992975
version = "0.5.20+deprecated"
@@ -4480,6 +4456,7 @@ dependencies = [
44804456
name = "rustc_session"
44814457
version = "0.0.0"
44824458
dependencies = [
4459+
"bitflags 1.3.2",
44834460
"getopts",
44844461
"libc",
44854462
"rustc_ast",
@@ -4779,9 +4756,9 @@ dependencies = [
47794756

47804757
[[package]]
47814758
name = "rustix"
4782-
version = "0.38.14"
4759+
version = "0.38.19"
47834760
source = "registry+https://github.com/rust-lang/crates.io-index"
4784-
checksum = "747c788e9ce8e92b12cd485c49ddf90723550b654b32508f979b71a7b1ecda4f"
4761+
checksum = "745ecfa778e66b2b63c88a61cb36e0eea109e803b0b86bf9879fbc77c70e86ed"
47854762
dependencies = [
47864763
"bitflags 2.4.0",
47874764
"errno",
@@ -5252,23 +5229,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
52525229
checksum = "4d38d39c754ae037a9bc3ca1580a985db7371cd14f1229172d1db9093feb6739"
52535230
dependencies = [
52545231
"papergrid",
5255-
"tabled_derive",
52565232
"unicode-width",
52575233
]
52585234

5259-
[[package]]
5260-
name = "tabled_derive"
5261-
version = "0.6.0"
5262-
source = "registry+https://github.com/rust-lang/crates.io-index"
5263-
checksum = "99f688a08b54f4f02f0a3c382aefdb7884d3d69609f785bd253dc033243e3fe4"
5264-
dependencies = [
5265-
"heck",
5266-
"proc-macro-error",
5267-
"proc-macro2",
5268-
"quote",
5269-
"syn 1.0.109",
5270-
]
5271-
52725235
[[package]]
52735236
name = "tar"
52745237
version = "0.4.38"

compiler/rustc_abi/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
#![cfg_attr(feature = "nightly", feature(step_trait))]
22
#![cfg_attr(feature = "nightly", allow(internal_features))]
3+
#![cfg_attr(all(not(bootstrap), feature = "nightly"), doc(rust_logo))]
4+
#![cfg_attr(all(not(bootstrap), feature = "nightly"), feature(rustdoc_internals))]
35

46
use std::fmt;
57
use std::num::{NonZeroUsize, ParseIntError};
@@ -681,6 +683,7 @@ impl fmt::Display for AlignFromBytesError {
681683

682684
impl Align {
683685
pub const ONE: Align = Align { pow2: 0 };
686+
// LLVM has a maximal supported alignment of 2^29, we inherit that.
684687
pub const MAX: Align = Align { pow2: 29 };
685688

686689
#[inline]

compiler/rustc_ast/src/attr/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -520,9 +520,7 @@ impl NestedMetaItem {
520520
I: Iterator<Item = &'a TokenTree>,
521521
{
522522
match tokens.peek() {
523-
Some(TokenTree::Token(token, _))
524-
if let Some(lit) = MetaItemLit::from_token(token) =>
525-
{
523+
Some(TokenTree::Token(token, _)) if let Some(lit) = MetaItemLit::from_token(token) => {
526524
tokens.next();
527525
return Some(NestedMetaItem::Lit(lit));
528526
}

compiler/rustc_ast/src/entry.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ pub fn entry_point_type(
2121
} else if attr::contains_name(attrs, sym::rustc_main) {
2222
EntryPointType::RustcMainAttr
2323
} else {
24-
if let Some(name) = name && name == sym::main {
24+
if let Some(name) = name
25+
&& name == sym::main
26+
{
2527
if at_root {
2628
// This is a top-level function so it can be `main`.
2729
EntryPointType::MainNamed

compiler/rustc_ast/src/token.rs

Lines changed: 35 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,13 +107,11 @@ impl Lit {
107107
/// Keep this in sync with `Token::can_begin_literal_or_bool` excluding unary negation.
108108
pub fn from_token(token: &Token) -> Option<Lit> {
109109
match token.uninterpolate().kind {
110-
Ident(name, false) if name.is_bool_lit() => {
111-
Some(Lit::new(Bool, name, None))
112-
}
110+
Ident(name, false) if name.is_bool_lit() => Some(Lit::new(Bool, name, None)),
113111
Literal(token_lit) => Some(token_lit),
114112
Interpolated(ref nt)
115113
if let NtExpr(expr) | NtLiteral(expr) = &**nt
116-
&& let ast::ExprKind::Lit(token_lit) = expr.kind =>
114+
&& let ast::ExprKind::Lit(token_lit) = expr.kind =>
117115
{
118116
Some(token_lit)
119117
}
@@ -229,35 +227,61 @@ fn ident_can_begin_type(name: Symbol, span: Span, is_raw: bool) -> bool {
229227
#[derive(PartialEq, Encodable, Decodable, Debug, HashStable_Generic)]
230228
pub enum TokenKind {
231229
/* Expression-operator symbols. */
230+
/// `=`
232231
Eq,
232+
/// `<`
233233
Lt,
234+
/// `<=`
234235
Le,
236+
/// `==`
235237
EqEq,
238+
/// `!=`
236239
Ne,
240+
/// `>`
237241
Ge,
242+
/// `>=`
238243
Gt,
244+
/// `&&`
239245
AndAnd,
246+
/// `||`
240247
OrOr,
248+
/// `!`
241249
Not,
250+
/// `~`
242251
Tilde,
243252
BinOp(BinOpToken),
244253
BinOpEq(BinOpToken),
245254

246255
/* Structural symbols */
256+
/// `@`
247257
At,
258+
/// `.`
248259
Dot,
260+
/// `..`
249261
DotDot,
262+
/// `...`
250263
DotDotDot,
264+
/// `..=`
251265
DotDotEq,
266+
/// `,`
252267
Comma,
268+
/// `;`
253269
Semi,
270+
/// `:`
254271
Colon,
272+
/// `::`
255273
ModSep,
274+
/// `->`
256275
RArrow,
276+
/// `<-`
257277
LArrow,
278+
/// `=>`
258279
FatArrow,
280+
/// `#`
259281
Pound,
282+
/// `$`
260283
Dollar,
284+
/// `?`
261285
Question,
262286
/// Used by proc macros for representing lifetimes, not generated by lexer right now.
263287
SingleQuote,
@@ -296,6 +320,7 @@ pub enum TokenKind {
296320
/// similarly to symbols in string literal tokens.
297321
DocComment(CommentKind, ast::AttrStyle, Symbol),
298322

323+
/// End Of File
299324
Eof,
300325
}
301326

@@ -628,7 +653,9 @@ impl Token {
628653

629654
/// Returns `true` if the token is an interpolated path.
630655
fn is_path(&self) -> bool {
631-
if let Interpolated(nt) = &self.kind && let NtPath(..) = **nt {
656+
if let Interpolated(nt) = &self.kind
657+
&& let NtPath(..) = **nt
658+
{
632659
return true;
633660
}
634661

@@ -650,7 +677,9 @@ impl Token {
650677

651678
/// Is the token an interpolated block (`$b:block`)?
652679
pub fn is_whole_block(&self) -> bool {
653-
if let Interpolated(nt) = &self.kind && let NtBlock(..) = **nt {
680+
if let Interpolated(nt) = &self.kind
681+
&& let NtBlock(..) = **nt
682+
{
654683
return true;
655684
}
656685

compiler/rustc_ast/src/tokenstream.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,9 @@ impl TokenStream {
550550

551551
let stream_iter = stream.0.iter().cloned();
552552

553-
if let Some(first) = stream.0.first() && Self::try_glue_to_last(vec_mut, first) {
553+
if let Some(first) = stream.0.first()
554+
&& Self::try_glue_to_last(vec_mut, first)
555+
{
554556
// Now skip the first token tree from `stream`.
555557
vec_mut.extend(stream_iter.skip(1));
556558
} else {

compiler/rustc_ast_lowering/messages.ftl

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,6 @@ ast_lowering_template_modifier = template modifier
136136
137137
ast_lowering_this_not_async = this is not `async`
138138
139-
ast_lowering_trait_fn_async =
140-
functions in traits cannot be declared `async`
141-
.label = `async` because of this
142-
.note = `async` trait functions are not currently supported
143-
.note2 = consider using the `async-trait` crate: https://crates.io/crates/async-trait
144-
145139
ast_lowering_underscore_expr_lhs_assign =
146140
in expressions, `_` can only be used on the left-hand side of an assignment
147141
.label = `_` not allowed here

compiler/rustc_ast_lowering/src/errors.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -354,17 +354,6 @@ pub struct InclusiveRangeWithNoEnd {
354354
pub span: Span,
355355
}
356356

357-
#[derive(Diagnostic, Clone, Copy)]
358-
#[diag(ast_lowering_trait_fn_async, code = "E0706")]
359-
#[note]
360-
#[note(ast_lowering_note2)]
361-
pub struct TraitFnAsync {
362-
#[primary_span]
363-
pub fn_span: Span,
364-
#[label]
365-
pub span: Span,
366-
}
367-
368357
#[derive(Diagnostic)]
369358
pub enum BadReturnTypeNotation {
370359
#[diag(ast_lowering_bad_return_type_notation_inputs)]

compiler/rustc_ast_lowering/src/expr.rs

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -673,12 +673,18 @@ impl<'hir> LoweringContext<'_, 'hir> {
673673
&& let Some(attrs) = self.attrs.get(&outer_hir_id.local_id)
674674
&& attrs.into_iter().any(|attr| attr.has_name(sym::track_caller))
675675
{
676-
let unstable_span =
677-
self.mark_span_with_reason(DesugaringKind::Async, span, self.allow_gen_future.clone());
676+
let unstable_span = self.mark_span_with_reason(
677+
DesugaringKind::Async,
678+
span,
679+
self.allow_gen_future.clone(),
680+
);
678681
self.lower_attrs(
679682
inner_hir_id,
680683
&[Attribute {
681-
kind: AttrKind::Normal(ptr::P(NormalAttr::from_ident(Ident::new(sym::track_caller, span)))),
684+
kind: AttrKind::Normal(ptr::P(NormalAttr::from_ident(Ident::new(
685+
sym::track_caller,
686+
span,
687+
)))),
682688
id: self.tcx.sess.parse_sess.attr_id_generator.mk_attr_id(),
683689
style: AttrStyle::Outer,
684690
span: unstable_span,
@@ -1102,7 +1108,9 @@ impl<'hir> LoweringContext<'_, 'hir> {
11021108
if let ExprKind::Path(qself, path) = &expr.kind {
11031109
// Does the path resolve to something disallowed in a tuple struct/variant pattern?
11041110
if let Some(partial_res) = self.resolver.get_partial_res(expr.id) {
1105-
if let Some(res) = partial_res.full_res() && !res.expected_in_tuple_struct_pat() {
1111+
if let Some(res) = partial_res.full_res()
1112+
&& !res.expected_in_tuple_struct_pat()
1113+
{
11061114
return None;
11071115
}
11081116
}
@@ -1122,7 +1130,9 @@ impl<'hir> LoweringContext<'_, 'hir> {
11221130
if let ExprKind::Path(qself, path) = &expr.kind {
11231131
// Does the path resolve to something disallowed in a unit struct/variant pattern?
11241132
if let Some(partial_res) = self.resolver.get_partial_res(expr.id) {
1125-
if let Some(res) = partial_res.full_res() && !res.expected_in_unit_struct_pat() {
1133+
if let Some(res) = partial_res.full_res()
1134+
&& !res.expected_in_unit_struct_pat()
1135+
{
11261136
return None;
11271137
}
11281138
}

compiler/rustc_ast_lowering/src/format.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,12 @@ fn flatten_format_args(mut fmt: Cow<'_, FormatArgs>) -> Cow<'_, FormatArgs> {
6161
let remaining_args = args.split_off(arg_index + 1);
6262
let old_arg_offset = args.len();
6363
let mut fmt2 = &mut args.pop().unwrap().expr; // The inner FormatArgs.
64-
let fmt2 = loop { // Unwrap the Expr to get to the FormatArgs.
64+
let fmt2 = loop {
65+
// Unwrap the Expr to get to the FormatArgs.
6566
match &mut fmt2.kind {
66-
ExprKind::Paren(inner) | ExprKind::AddrOf(BorrowKind::Ref, _, inner) => fmt2 = inner,
67+
ExprKind::Paren(inner) | ExprKind::AddrOf(BorrowKind::Ref, _, inner) => {
68+
fmt2 = inner
69+
}
6770
ExprKind::FormatArgs(fmt2) => break fmt2,
6871
_ => unreachable!(),
6972
}

0 commit comments

Comments
 (0)