Skip to content

Commit b862076

Browse files
committed
Auto merge of rust-lang#3913 - rust-lang:rustup-2024-09-25, r=RalfJung
Automatic Rustup
2 parents 878925e + 9433958 commit b862076

File tree

1,921 files changed

+12372
-12966
lines changed

Some content is hidden

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

1,921 files changed

+12372
-12966
lines changed

.git-blame-ignore-revs

+2
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,5 @@ ec2cc761bc7067712ecc7734502f703fe3b024c8
2727
84ac80f1921afc243d71fd0caaa4f2838c294102
2828
# bless mir-opt tests to add `copy`
2929
99cb0c6bc399fb94a0ddde7e9b38e9c00d523bad
30+
# reformat with rustfmt edition 2024
31+
c682aa162b0d41e21cc6748f4fecfe01efb69d1f

.gitmodules

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
[submodule "src/llvm-project"]
3434
path = src/llvm-project
3535
url = https://github.com/rust-lang/llvm-project.git
36-
branch = rustc/19.1-2024-07-30
36+
branch = rustc/19.1-2024-09-17
3737
shallow = true
3838
[submodule "src/doc/embedded-book"]
3939
path = src/doc/embedded-book

Cargo.lock

+2-2
Original file line numberDiff line numberDiff line change
@@ -2177,9 +2177,9 @@ dependencies = [
21772177

21782178
[[package]]
21792179
name = "memchr"
2180-
version = "2.5.0"
2180+
version = "2.7.4"
21812181
source = "registry+https://github.com/rust-lang/crates.io-index"
2182-
checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d"
2182+
checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3"
21832183

21842184
[[package]]
21852185
name = "memmap2"

compiler/rustc_abi/src/layout.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -999,8 +999,8 @@ impl<Cx: HasDataLayout> LayoutCalculator<Cx> {
999999
if repr.can_randomize_type_layout() && cfg!(feature = "randomize") {
10001000
#[cfg(feature = "randomize")]
10011001
{
1002-
use rand::seq::SliceRandom;
10031002
use rand::SeedableRng;
1003+
use rand::seq::SliceRandom;
10041004
// `ReprOptions.field_shuffle_seed` is a deterministic seed we can use to randomize field
10051005
// ordering.
10061006
let mut rng =

compiler/rustc_abi/src/lib.rs

+4-7
Original file line numberDiff line numberDiff line change
@@ -1138,13 +1138,10 @@ impl Scalar {
11381138
#[inline]
11391139
pub fn is_bool(&self) -> bool {
11401140
use Integer::*;
1141-
matches!(
1142-
self,
1143-
Scalar::Initialized {
1144-
value: Primitive::Int(I8, false),
1145-
valid_range: WrappingRange { start: 0, end: 1 }
1146-
}
1147-
)
1141+
matches!(self, Scalar::Initialized {
1142+
value: Primitive::Int(I8, false),
1143+
valid_range: WrappingRange { start: 0, end: 1 }
1144+
})
11481145
}
11491146

11501147
/// Get the primitive representation of this type, ignoring the valid range and whether the

compiler/rustc_ast/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,9 @@ version = "0.0.0"
44
edition = "2021"
55

66
[dependencies]
7-
# FIXME: bumping memchr to 2.7.1 causes linker errors in MSVC thin-lto
87
# tidy-alphabetical-start
98
bitflags = "2.4.1"
10-
memchr = "=2.5.0"
9+
memchr = "2.7.4"
1110
rustc_ast_ir = { path = "../rustc_ast_ir" }
1211
rustc_data_structures = { path = "../rustc_data_structures" }
1312
rustc_index = { path = "../rustc_index" }

compiler/rustc_ast/src/ast.rs

+7-7
Original file line numberDiff line numberDiff line change
@@ -21,19 +21,19 @@
2121
use std::borrow::Cow;
2222
use std::{cmp, fmt, mem};
2323

24+
pub use GenericArgs::*;
25+
pub use UnsafeSource::*;
2426
pub use rustc_ast_ir::{Movability, Mutability};
2527
use rustc_data_structures::packed::Pu128;
2628
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
2729
use rustc_data_structures::stack::ensure_sufficient_stack;
2830
use rustc_data_structures::sync::Lrc;
2931
use rustc_macros::{Decodable, Encodable, HashStable_Generic};
30-
use rustc_span::source_map::{respan, Spanned};
31-
use rustc_span::symbol::{kw, sym, Ident, Symbol};
3232
pub use rustc_span::AttrId;
33-
use rustc_span::{ErrorGuaranteed, Span, DUMMY_SP};
34-
use thin_vec::{thin_vec, ThinVec};
35-
pub use GenericArgs::*;
36-
pub use UnsafeSource::*;
33+
use rustc_span::source_map::{Spanned, respan};
34+
use rustc_span::symbol::{Ident, Symbol, kw, sym};
35+
use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span};
36+
use thin_vec::{ThinVec, thin_vec};
3737

3838
pub use crate::format::*;
3939
use crate::ptr::P;
@@ -288,7 +288,7 @@ impl ParenthesizedArgs {
288288
}
289289
}
290290

291-
pub use crate::node_id::{NodeId, CRATE_NODE_ID, DUMMY_NODE_ID};
291+
pub use crate::node_id::{CRATE_NODE_ID, DUMMY_NODE_ID, NodeId};
292292

293293
/// Modifiers on a trait bound like `~const`, `?` and `!`.
294294
#[derive(Copy, Clone, PartialEq, Eq, Encodable, Decodable, Debug)]

compiler/rustc_ast/src/attr/mod.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,15 @@ use std::iter;
44
use std::sync::atomic::{AtomicU32, Ordering};
55

66
use rustc_index::bit_set::GrowableBitSet;
7-
use rustc_span::symbol::{sym, Ident, Symbol};
87
use rustc_span::Span;
9-
use smallvec::{smallvec, SmallVec};
10-
use thin_vec::{thin_vec, ThinVec};
8+
use rustc_span::symbol::{Ident, Symbol, sym};
9+
use smallvec::{SmallVec, smallvec};
10+
use thin_vec::{ThinVec, thin_vec};
1111

1212
use crate::ast::{
13-
AttrArgs, AttrArgsEq, AttrId, AttrItem, AttrKind, AttrStyle, AttrVec, Attribute, DelimArgs,
14-
Expr, ExprKind, LitKind, MetaItem, MetaItemKind, MetaItemLit, NestedMetaItem, NormalAttr, Path,
15-
PathSegment, Safety, DUMMY_NODE_ID,
13+
AttrArgs, AttrArgsEq, AttrId, AttrItem, AttrKind, AttrStyle, AttrVec, Attribute, DUMMY_NODE_ID,
14+
DelimArgs, Expr, ExprKind, LitKind, MetaItem, MetaItemKind, MetaItemLit, NestedMetaItem,
15+
NormalAttr, Path, PathSegment, Safety,
1616
};
1717
use crate::ptr::P;
1818
use crate::token::{self, CommentKind, Delimiter, Token};

compiler/rustc_ast/src/entry.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
use rustc_span::symbol::sym;
21
use rustc_span::Symbol;
2+
use rustc_span::symbol::sym;
33

4-
use crate::{attr, Attribute};
4+
use crate::{Attribute, attr};
55

66
#[derive(Debug)]
77
pub enum EntryPointType {

compiler/rustc_ast/src/expand/allocator.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use rustc_macros::HashStable_Generic;
2-
use rustc_span::symbol::{sym, Symbol};
2+
use rustc_span::symbol::{Symbol, sym};
33

44
#[derive(Clone, Debug, Copy, Eq, PartialEq, HashStable_Generic)]
55
pub enum AllocatorKind {

compiler/rustc_ast/src/format.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
use rustc_data_structures::fx::FxHashMap;
22
use rustc_macros::{Decodable, Encodable};
3-
use rustc_span::symbol::{Ident, Symbol};
43
use rustc_span::Span;
4+
use rustc_span::symbol::{Ident, Symbol};
55

6-
use crate::ptr::P;
76
use crate::Expr;
7+
use crate::ptr::P;
88

99
// Definitions:
1010
//

compiler/rustc_ast/src/mut_visit.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ use std::panic;
1313
use rustc_data_structures::flat_map_in_place::FlatMapInPlace;
1414
use rustc_data_structures::stack::ensure_sufficient_stack;
1515
use rustc_data_structures::sync::Lrc;
16+
use rustc_span::Span;
1617
use rustc_span::source_map::Spanned;
1718
use rustc_span::symbol::Ident;
18-
use rustc_span::Span;
19-
use smallvec::{smallvec, Array, SmallVec};
19+
use smallvec::{Array, SmallVec, smallvec};
2020
use thin_vec::ThinVec;
2121

2222
use crate::ast::*;

compiler/rustc_ast/src/token.rs

+43-37
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
use std::borrow::Cow;
22
use std::fmt;
33

4+
pub use BinOpToken::*;
5+
pub use LitKind::*;
6+
pub use Nonterminal::*;
7+
pub use NtExprKind::*;
8+
pub use NtPatKind::*;
9+
pub use TokenKind::*;
410
use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
511
use rustc_data_structures::sync::Lrc;
612
use rustc_macros::{Decodable, Encodable, HashStable_Generic};
713
use rustc_span::edition::Edition;
8-
use rustc_span::symbol::{kw, sym};
914
#[allow(clippy::useless_attribute)] // FIXME: following use of `hidden_glob_reexports` incorrectly triggers `useless_attribute` lint.
1015
#[allow(hidden_glob_reexports)]
1116
use rustc_span::symbol::{Ident, Symbol};
12-
use rustc_span::{ErrorGuaranteed, Span, DUMMY_SP};
13-
pub use BinOpToken::*;
14-
pub use LitKind::*;
15-
pub use Nonterminal::*;
16-
pub use NtExprKind::*;
17-
pub use NtPatKind::*;
18-
pub use TokenKind::*;
17+
use rustc_span::symbol::{kw, sym};
18+
use rustc_span::{DUMMY_SP, ErrorGuaranteed, Span};
1919

2020
use crate::ast;
2121
use crate::ptr::P;
@@ -385,35 +385,41 @@ impl TokenKind {
385385
Literal(Lit::new(kind, symbol, suffix))
386386
}
387387

388-
/// An approximation to proc-macro-style single-character operators used by rustc parser.
389-
/// If the operator token can be broken into two tokens, the first of which is single-character,
390-
/// then this function performs that operation, otherwise it returns `None`.
391-
pub fn break_two_token_op(&self) -> Option<(TokenKind, TokenKind)> {
392-
Some(match *self {
393-
Le => (Lt, Eq),
394-
EqEq => (Eq, Eq),
395-
Ne => (Not, Eq),
396-
Ge => (Gt, Eq),
397-
AndAnd => (BinOp(And), BinOp(And)),
398-
OrOr => (BinOp(Or), BinOp(Or)),
399-
BinOp(Shl) => (Lt, Lt),
400-
BinOp(Shr) => (Gt, Gt),
401-
BinOpEq(Plus) => (BinOp(Plus), Eq),
402-
BinOpEq(Minus) => (BinOp(Minus), Eq),
403-
BinOpEq(Star) => (BinOp(Star), Eq),
404-
BinOpEq(Slash) => (BinOp(Slash), Eq),
405-
BinOpEq(Percent) => (BinOp(Percent), Eq),
406-
BinOpEq(Caret) => (BinOp(Caret), Eq),
407-
BinOpEq(And) => (BinOp(And), Eq),
408-
BinOpEq(Or) => (BinOp(Or), Eq),
409-
BinOpEq(Shl) => (Lt, Le),
410-
BinOpEq(Shr) => (Gt, Ge),
411-
DotDot => (Dot, Dot),
412-
DotDotDot => (Dot, DotDot),
413-
PathSep => (Colon, Colon),
414-
RArrow => (BinOp(Minus), Gt),
415-
LArrow => (Lt, BinOp(Minus)),
416-
FatArrow => (Eq, Gt),
388+
/// An approximation to proc-macro-style single-character operators used by
389+
/// rustc parser. If the operator token can be broken into two tokens, the
390+
/// first of which has `n` (1 or 2) chars, then this function performs that
391+
/// operation, otherwise it returns `None`.
392+
pub fn break_two_token_op(&self, n: u32) -> Option<(TokenKind, TokenKind)> {
393+
assert!(n == 1 || n == 2);
394+
Some(match (self, n) {
395+
(Le, 1) => (Lt, Eq),
396+
(EqEq, 1) => (Eq, Eq),
397+
(Ne, 1) => (Not, Eq),
398+
(Ge, 1) => (Gt, Eq),
399+
(AndAnd, 1) => (BinOp(And), BinOp(And)),
400+
(OrOr, 1) => (BinOp(Or), BinOp(Or)),
401+
(BinOp(Shl), 1) => (Lt, Lt),
402+
(BinOp(Shr), 1) => (Gt, Gt),
403+
(BinOpEq(Plus), 1) => (BinOp(Plus), Eq),
404+
(BinOpEq(Minus), 1) => (BinOp(Minus), Eq),
405+
(BinOpEq(Star), 1) => (BinOp(Star), Eq),
406+
(BinOpEq(Slash), 1) => (BinOp(Slash), Eq),
407+
(BinOpEq(Percent), 1) => (BinOp(Percent), Eq),
408+
(BinOpEq(Caret), 1) => (BinOp(Caret), Eq),
409+
(BinOpEq(And), 1) => (BinOp(And), Eq),
410+
(BinOpEq(Or), 1) => (BinOp(Or), Eq),
411+
(BinOpEq(Shl), 1) => (Lt, Le), // `<` + `<=`
412+
(BinOpEq(Shl), 2) => (BinOp(Shl), Eq), // `<<` + `=`
413+
(BinOpEq(Shr), 1) => (Gt, Ge), // `>` + `>=`
414+
(BinOpEq(Shr), 2) => (BinOp(Shr), Eq), // `>>` + `=`
415+
(DotDot, 1) => (Dot, Dot),
416+
(DotDotDot, 1) => (Dot, DotDot), // `.` + `..`
417+
(DotDotDot, 2) => (DotDot, Dot), // `..` + `.`
418+
(DotDotEq, 2) => (DotDot, Eq),
419+
(PathSep, 1) => (Colon, Colon),
420+
(RArrow, 1) => (BinOp(Minus), Gt),
421+
(LArrow, 1) => (Lt, BinOp(Minus)),
422+
(FatArrow, 1) => (Eq, Gt),
417423
_ => return None,
418424
})
419425
}

compiler/rustc_ast/src/tokenstream.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use rustc_data_structures::stable_hasher::{HashStable, StableHasher};
2020
use rustc_data_structures::sync::{self, Lrc};
2121
use rustc_macros::{Decodable, Encodable, HashStable_Generic};
2222
use rustc_serialize::{Decodable, Encodable};
23-
use rustc_span::{sym, Span, SpanDecoder, SpanEncoder, Symbol, DUMMY_SP};
23+
use rustc_span::{DUMMY_SP, Span, SpanDecoder, SpanEncoder, Symbol, sym};
2424

2525
use crate::ast::{AttrStyle, StmtKind};
2626
use crate::ast_traits::{HasAttrs, HasTokens};

compiler/rustc_ast/src/util/literal.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
use std::{ascii, fmt, str};
44

55
use rustc_lexer::unescape::{
6-
byte_from_char, unescape_byte, unescape_char, unescape_mixed, unescape_unicode, MixedUnit, Mode,
6+
MixedUnit, Mode, byte_from_char, unescape_byte, unescape_char, unescape_mixed, unescape_unicode,
77
};
8-
use rustc_span::symbol::{kw, sym, Symbol};
98
use rustc_span::Span;
9+
use rustc_span::symbol::{Symbol, kw, sym};
1010
use tracing::debug;
1111

1212
use crate::ast::{self, LitKind, MetaItemLit, StrStyle};

compiler/rustc_ast/src/visit.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
1616
pub use rustc_ast_ir::visit::VisitorResult;
1717
pub use rustc_ast_ir::{try_visit, visit_opt, walk_list, walk_visitable_list};
18-
use rustc_span::symbol::Ident;
1918
use rustc_span::Span;
19+
use rustc_span::symbol::Ident;
2020

2121
use crate::ast::*;
2222
use crate::ptr::P;

compiler/rustc_ast_lowering/src/asm.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,20 @@ use rustc_hir as hir;
88
use rustc_hir::def::{DefKind, Res};
99
use rustc_session::parse::feature_err;
1010
use rustc_span::symbol::kw;
11-
use rustc_span::{sym, Span};
11+
use rustc_span::{Span, sym};
1212
use rustc_target::asm;
1313

14+
use super::LoweringContext;
1415
use super::errors::{
1516
AbiSpecifiedMultipleTimes, AttSyntaxOnlyX86, ClobberAbiNotSupported,
1617
InlineAsmUnsupportedTarget, InvalidAbiClobberAbi, InvalidAsmTemplateModifierConst,
1718
InvalidAsmTemplateModifierLabel, InvalidAsmTemplateModifierRegClass,
1819
InvalidAsmTemplateModifierRegClassSub, InvalidAsmTemplateModifierSym, InvalidRegister,
1920
InvalidRegisterClass, RegisterClassOnlyClobber, RegisterConflict,
2021
};
21-
use super::LoweringContext;
2222
use crate::{
23-
fluent_generated as fluent, AllowReturnTypeNotation, ImplTraitContext, ImplTraitPosition,
24-
ParamMode, ResolverAstLoweringExt,
23+
AllowReturnTypeNotation, ImplTraitContext, ImplTraitPosition, ParamMode,
24+
ResolverAstLoweringExt, fluent_generated as fluent,
2525
};
2626

2727
impl<'a, 'hir> LoweringContext<'a, 'hir> {

compiler/rustc_ast_lowering/src/delegation.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@ use rustc_errors::ErrorGuaranteed;
4646
use rustc_hir::def_id::DefId;
4747
use rustc_middle::span_bug;
4848
use rustc_middle::ty::{Asyncness, ResolverAstLowering};
49-
use rustc_span::symbol::Ident;
5049
use rustc_span::Span;
50+
use rustc_span::symbol::Ident;
5151
use rustc_target::spec::abi;
5252
use {rustc_ast as ast, rustc_hir as hir};
5353

compiler/rustc_ast_lowering/src/expr.rs

+15-18
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,14 @@ use rustc_ast::ptr::P as AstP;
44
use rustc_ast::*;
55
use rustc_data_structures::stack::ensure_sufficient_stack;
66
use rustc_hir as hir;
7-
use rustc_hir::def::{DefKind, Res};
87
use rustc_hir::HirId;
8+
use rustc_hir::def::{DefKind, Res};
99
use rustc_middle::span_bug;
1010
use rustc_session::errors::report_lit_error;
11-
use rustc_span::source_map::{respan, Spanned};
12-
use rustc_span::symbol::{kw, sym, Ident, Symbol};
13-
use rustc_span::{DesugaringKind, Span, DUMMY_SP};
14-
use thin_vec::{thin_vec, ThinVec};
11+
use rustc_span::source_map::{Spanned, respan};
12+
use rustc_span::symbol::{Ident, Symbol, kw, sym};
13+
use rustc_span::{DUMMY_SP, DesugaringKind, Span};
14+
use thin_vec::{ThinVec, thin_vec};
1515

1616
use super::errors::{
1717
AsyncCoroutinesNotSupported, AwaitOnlyInAsyncFnAndBlocks, BaseExpressionDoubleDot,
@@ -23,7 +23,7 @@ use super::{
2323
GenericArgsMode, ImplTraitContext, LoweringContext, ParamMode, ResolverAstLoweringExt,
2424
};
2525
use crate::errors::YieldInClosure;
26-
use crate::{fluent_generated, AllowReturnTypeNotation, FnDeclKind, ImplTraitPosition};
26+
use crate::{AllowReturnTypeNotation, FnDeclKind, ImplTraitPosition, fluent_generated};
2727

2828
impl<'hir> LoweringContext<'_, 'hir> {
2929
fn lower_exprs(&mut self, exprs: &[AstP<Expr>]) -> &'hir [hir::Expr<'hir>] {
@@ -725,18 +725,15 @@ impl<'hir> LoweringContext<'_, 'hir> {
725725
span,
726726
Some(self.allow_gen_future.clone()),
727727
);
728-
self.lower_attrs(
729-
inner_hir_id,
730-
&[Attribute {
731-
kind: AttrKind::Normal(ptr::P(NormalAttr::from_ident(Ident::new(
732-
sym::track_caller,
733-
span,
734-
)))),
735-
id: self.tcx.sess.psess.attr_id_generator.mk_attr_id(),
736-
style: AttrStyle::Outer,
737-
span: unstable_span,
738-
}],
739-
);
728+
self.lower_attrs(inner_hir_id, &[Attribute {
729+
kind: AttrKind::Normal(ptr::P(NormalAttr::from_ident(Ident::new(
730+
sym::track_caller,
731+
span,
732+
)))),
733+
id: self.tcx.sess.psess.attr_id_generator.mk_attr_id(),
734+
style: AttrStyle::Outer,
735+
span: unstable_span,
736+
}]);
740737
}
741738
}
742739

0 commit comments

Comments
 (0)