Skip to content

Commit 5a28e1e

Browse files
author
The rustc-dev-guide Cronjob Bot
committed
Merge from rustc
2 parents f74e85e + 25a615b commit 5a28e1e

File tree

1,048 files changed

+10369
-8474
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,048 files changed

+10369
-8474
lines changed

.mailmap

+7-1
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ Jacob Greenfield <[email protected]>
276276
277277
278278
Jake Goulding <[email protected]>
279-
279+
280280
281281
Jake Vossen <[email protected]>
282282
@@ -408,10 +408,13 @@ Luqman Aden <[email protected]> <[email protected]>
408408
409409
410410
Maik Klein <[email protected]>
411+
412+
411413
Malo Jaffré <[email protected]>
412414
Manish Goregaokar <[email protected]>
413415
414416
Marcell Pardavi <[email protected]>
417+
Marco Ieni <[email protected]>
415418
Marcus Klaas de Vries <[email protected]>
416419
Margaret Meyerhofer <[email protected]> <mmeyerho@andrew>
417420
Mark Mansi <[email protected]>
@@ -565,6 +568,9 @@ Robert Habermeier <[email protected]>
565568
Robert Millar <[email protected]>
566569
567570
Rohit Joshi <[email protected]> Rohit Joshi <[email protected]>
571+
Ross Smyth <[email protected]>
572+
573+
568574
Roxane Fruytier <[email protected]>
569575
570576
Russell Johnston <[email protected]>

Cargo.lock

+34-27
Original file line numberDiff line numberDiff line change
@@ -239,9 +239,9 @@ checksum = "5c8214115b7bf84099f1309324e63141d4c5d7cc26862f97a0a857dbefe165bd"
239239

240240
[[package]]
241241
name = "blake3"
242-
version = "1.8.0"
242+
version = "1.8.1"
243243
source = "registry+https://github.com/rust-lang/crates.io-index"
244-
checksum = "34a796731680be7931955498a16a10b2270c7762963d5d570fdbfe02dcbf314f"
244+
checksum = "389a099b34312839e16420d499a9cad9650541715937ffbdd40d36f49e77eeb3"
245245
dependencies = [
246246
"arrayref",
247247
"arrayvec",
@@ -800,9 +800,9 @@ dependencies = [
800800

801801
[[package]]
802802
name = "ctrlc"
803-
version = "3.4.5"
803+
version = "3.4.6"
804804
source = "registry+https://github.com/rust-lang/crates.io-index"
805-
checksum = "90eeab0aa92f3f9b4e87f258c72b139c207d251f9cbc1080a0086b86a8870dd3"
805+
checksum = "697b5419f348fd5ae2478e8018cb016c00a5881c7f46c717de98ffd135a5651c"
806806
dependencies = [
807807
"nix",
808808
"windows-sys 0.59.0",
@@ -1079,9 +1079,9 @@ dependencies = [
10791079

10801080
[[package]]
10811081
name = "env_logger"
1082-
version = "0.11.7"
1082+
version = "0.11.8"
10831083
source = "registry+https://github.com/rust-lang/crates.io-index"
1084-
checksum = "c3716d7a920fb4fac5d84e9d4bce8ceb321e9414b4409da61b07b75c1e3d0697"
1084+
checksum = "13c863f0904021b108aa8b2f55046443e6b1ebde8fd4a15c399893aae4fa069f"
10851085
dependencies = [
10861086
"anstream",
10871087
"anstyle",
@@ -1098,9 +1098,9 @@ checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
10981098

10991099
[[package]]
11001100
name = "errno"
1101-
version = "0.3.10"
1101+
version = "0.3.11"
11021102
source = "registry+https://github.com/rust-lang/crates.io-index"
1103-
checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d"
1103+
checksum = "976dd42dc7e85965fe702eb8164f21f450704bdde31faefd6471dba214cb594e"
11041104
dependencies = [
11051105
"libc",
11061106
"windows-sys 0.59.0",
@@ -1163,12 +1163,12 @@ dependencies = [
11631163

11641164
[[package]]
11651165
name = "flate2"
1166-
version = "1.1.0"
1166+
version = "1.1.1"
11671167
source = "registry+https://github.com/rust-lang/crates.io-index"
1168-
checksum = "11faaf5a5236997af9848be0bef4db95824b1d534ebc64d0f0c6cf3e67bd38dc"
1168+
checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece"
11691169
dependencies = [
11701170
"crc32fast",
1171-
"miniz_oxide 0.8.5",
1171+
"miniz_oxide 0.8.7",
11721172
]
11731173

11741174
[[package]]
@@ -1773,9 +1773,9 @@ checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683"
17731773

17741774
[[package]]
17751775
name = "indexmap"
1776-
version = "2.8.0"
1776+
version = "2.9.0"
17771777
source = "registry+https://github.com/rust-lang/crates.io-index"
1778-
checksum = "3954d50fe15b02142bf25d3b8bdadb634ec3948f103d04ffe3031bc8fe9d7058"
1778+
checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e"
17791779
dependencies = [
17801780
"equivalent",
17811781
"hashbrown",
@@ -2252,9 +2252,9 @@ dependencies = [
22522252

22532253
[[package]]
22542254
name = "miniz_oxide"
2255-
version = "0.8.5"
2255+
version = "0.8.7"
22562256
source = "registry+https://github.com/rust-lang/crates.io-index"
2257-
checksum = "8e3e04debbb59698c15bacbb6d93584a8c0ca9cc3213cb423d31f760d8843ce5"
2257+
checksum = "ff70ce3e48ae43fa075863cef62e8b43b71a4f2382229920e0df362592919430"
22582258
dependencies = [
22592259
"adler2",
22602260
]
@@ -2506,9 +2506,9 @@ checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e"
25062506

25072507
[[package]]
25082508
name = "openssl-sys"
2509-
version = "0.9.106"
2509+
version = "0.9.107"
25102510
source = "registry+https://github.com/rust-lang/crates.io-index"
2511-
checksum = "8bb61ea9811cc39e3c2069f40b8b8e2e70d8569b361f879786cc7ed48b777cdd"
2511+
checksum = "8288979acd84749c744a9014b4382d42b8f7b2592847b5afb2ed29e5d16ede07"
25122512
dependencies = [
25132513
"cc",
25142514
"libc",
@@ -2970,9 +2970,9 @@ dependencies = [
29702970

29712971
[[package]]
29722972
name = "redox_syscall"
2973-
version = "0.5.10"
2973+
version = "0.5.11"
29742974
source = "registry+https://github.com/rust-lang/crates.io-index"
2975-
checksum = "0b8c0c260b63a8219631167be35e6a988e9554dbd323f8bd08439c8ed1302bd1"
2975+
checksum = "d2f103c6d277498fbceb16e84d317e2a400f160f46904d5f5410848c829511a3"
29762976
dependencies = [
29772977
"bitflags",
29782978
]
@@ -3150,6 +3150,12 @@ version = "2.1.1"
31503150
source = "registry+https://github.com/rust-lang/crates.io-index"
31513151
checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d"
31523152

3153+
[[package]]
3154+
name = "rustc-literal-escaper"
3155+
version = "0.0.2"
3156+
source = "registry+https://github.com/rust-lang/crates.io-index"
3157+
checksum = "0041b6238913c41fe704213a4a9329e2f685a156d1781998128b4149c230ad04"
3158+
31533159
[[package]]
31543160
name = "rustc-main"
31553161
version = "0.0.0"
@@ -3242,10 +3248,10 @@ version = "0.0.0"
32423248
dependencies = [
32433249
"bitflags",
32443250
"memchr",
3251+
"rustc-literal-escaper",
32453252
"rustc_ast_ir",
32463253
"rustc_data_structures",
32473254
"rustc_index",
3248-
"rustc_lexer",
32493255
"rustc_macros",
32503256
"rustc_serialize",
32513257
"rustc_span",
@@ -4200,6 +4206,7 @@ name = "rustc_parse"
42004206
version = "0.0.0"
42014207
dependencies = [
42024208
"bitflags",
4209+
"rustc-literal-escaper",
42034210
"rustc_ast",
42044211
"rustc_ast_pretty",
42054212
"rustc_data_structures",
@@ -4222,6 +4229,7 @@ dependencies = [
42224229
name = "rustc_parse_format"
42234230
version = "0.0.0"
42244231
dependencies = [
4232+
"rustc-literal-escaper",
42254233
"rustc_index",
42264234
"rustc_lexer",
42274235
]
@@ -4432,7 +4440,7 @@ dependencies = [
44324440
"rustc_span",
44334441
"rustc_target",
44344442
"scoped-tls",
4435-
"stable_mir",
4443+
"serde",
44364444
"tracing",
44374445
]
44384446

@@ -4918,9 +4926,9 @@ dependencies = [
49184926

49194927
[[package]]
49204928
name = "smallvec"
4921-
version = "1.14.0"
4929+
version = "1.15.0"
49224930
source = "registry+https://github.com/rust-lang/crates.io-index"
4923-
checksum = "7fcf8323ef1faaee30a44a340193b1ac6814fd9b7b4e88e9d4519a3e4abe1cfd"
4931+
checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9"
49244932

49254933
[[package]]
49264934
name = "socket2"
@@ -4990,8 +4998,7 @@ checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3"
49904998
name = "stable_mir"
49914999
version = "0.1.0-preview"
49925000
dependencies = [
4993-
"scoped-tls",
4994-
"serde",
5001+
"rustc_smir",
49955002
]
49965003

49975004
[[package]]
@@ -5369,9 +5376,9 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20"
53695376

53705377
[[package]]
53715378
name = "tokio"
5372-
version = "1.44.1"
5379+
version = "1.44.2"
53735380
source = "registry+https://github.com/rust-lang/crates.io-index"
5374-
checksum = "f382da615b842244d4b8738c82ed1275e6c5dd90c459a30941cd07080b06c91a"
5381+
checksum = "e6b88822cbe49de4185e3a4cbf8321dd487cf5fe0c5c65695fef6346371e9c48"
53755382
dependencies = [
53765383
"backtrace",
53775384
"bytes",

compiler/rustc_ast/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ edition = "2024"
77
# tidy-alphabetical-start
88
bitflags = "2.4.1"
99
memchr = "2.7.4"
10+
rustc-literal-escaper = "0.0.2"
1011
rustc_ast_ir = { path = "../rustc_ast_ir" }
1112
rustc_data_structures = { path = "../rustc_data_structures" }
1213
rustc_index = { path = "../rustc_index" }
13-
rustc_lexer = { path = "../rustc_lexer" }
1414
rustc_macros = { path = "../rustc_macros" }
1515
rustc_serialize = { path = "../rustc_serialize" }
1616
rustc_span = { path = "../rustc_span" }

compiler/rustc_ast/src/ast.rs

+70-1
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,75 @@ impl BinOpKind {
981981

982982
pub type BinOp = Spanned<BinOpKind>;
983983

984+
// Sometimes `BinOpKind` and `AssignOpKind` need the same treatment. The
985+
// operations covered by `AssignOpKind` are a subset of those covered by
986+
// `BinOpKind`, so it makes sense to convert `AssignOpKind` to `BinOpKind`.
987+
impl From<AssignOpKind> for BinOpKind {
988+
fn from(op: AssignOpKind) -> BinOpKind {
989+
match op {
990+
AssignOpKind::AddAssign => BinOpKind::Add,
991+
AssignOpKind::SubAssign => BinOpKind::Sub,
992+
AssignOpKind::MulAssign => BinOpKind::Mul,
993+
AssignOpKind::DivAssign => BinOpKind::Div,
994+
AssignOpKind::RemAssign => BinOpKind::Rem,
995+
AssignOpKind::BitXorAssign => BinOpKind::BitXor,
996+
AssignOpKind::BitAndAssign => BinOpKind::BitAnd,
997+
AssignOpKind::BitOrAssign => BinOpKind::BitOr,
998+
AssignOpKind::ShlAssign => BinOpKind::Shl,
999+
AssignOpKind::ShrAssign => BinOpKind::Shr,
1000+
}
1001+
}
1002+
}
1003+
1004+
#[derive(Clone, Copy, Debug, PartialEq, Encodable, Decodable, HashStable_Generic)]
1005+
pub enum AssignOpKind {
1006+
/// The `+=` operator (addition)
1007+
AddAssign,
1008+
/// The `-=` operator (subtraction)
1009+
SubAssign,
1010+
/// The `*=` operator (multiplication)
1011+
MulAssign,
1012+
/// The `/=` operator (division)
1013+
DivAssign,
1014+
/// The `%=` operator (modulus)
1015+
RemAssign,
1016+
/// The `^=` operator (bitwise xor)
1017+
BitXorAssign,
1018+
/// The `&=` operator (bitwise and)
1019+
BitAndAssign,
1020+
/// The `|=` operator (bitwise or)
1021+
BitOrAssign,
1022+
/// The `<<=` operator (shift left)
1023+
ShlAssign,
1024+
/// The `>>=` operator (shift right)
1025+
ShrAssign,
1026+
}
1027+
1028+
impl AssignOpKind {
1029+
pub fn as_str(&self) -> &'static str {
1030+
use AssignOpKind::*;
1031+
match self {
1032+
AddAssign => "+=",
1033+
SubAssign => "-=",
1034+
MulAssign => "*=",
1035+
DivAssign => "/=",
1036+
RemAssign => "%=",
1037+
BitXorAssign => "^=",
1038+
BitAndAssign => "&=",
1039+
BitOrAssign => "|=",
1040+
ShlAssign => "<<=",
1041+
ShrAssign => ">>=",
1042+
}
1043+
}
1044+
1045+
/// AssignOps are always by value.
1046+
pub fn is_by_value(self) -> bool {
1047+
true
1048+
}
1049+
}
1050+
1051+
pub type AssignOp = Spanned<AssignOpKind>;
1052+
9841053
/// Unary operator.
9851054
///
9861055
/// Note that `&data` is not an operator, it's an `AddrOf` expression.
@@ -1593,7 +1662,7 @@ pub enum ExprKind {
15931662
/// An assignment with an operator.
15941663
///
15951664
/// E.g., `a += 1`.
1596-
AssignOp(BinOp, P<Expr>, P<Expr>),
1665+
AssignOp(AssignOp, P<Expr>, P<Expr>),
15971666
/// Access of a named (e.g., `obj.foo`) or unnamed (e.g., `obj.0`) struct field.
15981667
Field(P<Expr>, Ident),
15991668
/// An indexing operation (e.g., `foo[2]`).

compiler/rustc_ast/src/attr/mod.rs

+8
Original file line numberDiff line numberDiff line change
@@ -570,6 +570,14 @@ impl MetaItemInner {
570570
}
571571
}
572572

573+
/// Returns the bool if `self` is a boolean `MetaItemInner::Literal`.
574+
pub fn boolean_literal(&self) -> Option<bool> {
575+
match self {
576+
MetaItemInner::Lit(MetaItemLit { kind: LitKind::Bool(b), .. }) => Some(*b),
577+
_ => None,
578+
}
579+
}
580+
573581
/// Returns the `MetaItem` if `self` is a `MetaItemInner::MetaItem` or if it's
574582
/// `MetaItemInner::Lit(MetaItemLit { kind: LitKind::Bool(_), .. })`.
575583
pub fn meta_item_or_bool(&self) -> Option<&MetaItemInner> {

compiler/rustc_ast/src/expand/autodiff_attrs.rs

+13
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,17 @@ pub struct AutoDiffAttrs {
7777
/// e.g. in the [JAX
7878
/// Documentation](https://jax.readthedocs.io/en/latest/_tutorials/advanced-autodiff.html#how-it-s-made-two-foundational-autodiff-functions).
7979
pub mode: DiffMode,
80+
/// A user-provided, batching width. If not given, we will default to 1 (no batching).
81+
/// Calling a differentiated, non-batched function through a loop 100 times is equivalent to:
82+
/// - Calling the function 50 times with a batch size of 2
83+
/// - Calling the function 25 times with a batch size of 4,
84+
/// etc. A batched function takes more (or longer) arguments, and might be able to benefit from
85+
/// cache locality, better re-usal of primal values, and other optimizations.
86+
/// We will (before LLVM's vectorizer runs) just generate most LLVM-IR instructions `width`
87+
/// times, so this massively increases code size. As such, values like 1024 are unlikely to
88+
/// work. We should consider limiting this to u8 or u16, but will leave it at u32 for
89+
/// experiments for now and focus on documenting the implications of a large width.
90+
pub width: u32,
8091
pub ret_activity: DiffActivity,
8192
pub input_activity: Vec<DiffActivity>,
8293
}
@@ -222,13 +233,15 @@ impl AutoDiffAttrs {
222233
pub const fn error() -> Self {
223234
AutoDiffAttrs {
224235
mode: DiffMode::Error,
236+
width: 0,
225237
ret_activity: DiffActivity::None,
226238
input_activity: Vec::new(),
227239
}
228240
}
229241
pub fn source() -> Self {
230242
AutoDiffAttrs {
231243
mode: DiffMode::Source,
244+
width: 0,
232245
ret_activity: DiffActivity::None,
233246
input_activity: Vec::new(),
234247
}

compiler/rustc_ast/src/util/literal.rs

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

5-
use rustc_lexer::unescape::{
5+
use rustc_literal_escaper::{
66
MixedUnit, Mode, byte_from_char, unescape_byte, unescape_char, unescape_mixed, unescape_unicode,
77
};
88
use rustc_span::{Span, Symbol, kw, sym};

0 commit comments

Comments
 (0)