Skip to content

Commit f82938d

Browse files
authored
Merge branch 'master' into parallel
2 parents a3af573 + 613bdd4 commit f82938d

File tree

119 files changed

+1935
-734
lines changed

Some content is hidden

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

119 files changed

+1935
-734
lines changed

Cargo.lock

+130-23
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ dependencies = [
4343
"cfg-if",
4444
"once_cell",
4545
"version_check",
46-
"zerocopy",
46+
"zerocopy 0.7.35",
4747
]
4848

4949
[[package]]
@@ -567,7 +567,7 @@ dependencies = [
567567
"termize",
568568
"tokio",
569569
"toml 0.7.8",
570-
"ui_test",
570+
"ui_test 0.26.5",
571571
"walkdir",
572572
]
573573

@@ -1442,7 +1442,19 @@ checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7"
14421442
dependencies = [
14431443
"cfg-if",
14441444
"libc",
1445-
"wasi",
1445+
"wasi 0.11.0+wasi-snapshot-preview1",
1446+
]
1447+
1448+
[[package]]
1449+
name = "getrandom"
1450+
version = "0.3.1"
1451+
source = "registry+https://github.com/rust-lang/crates.io-index"
1452+
checksum = "43a49c392881ce6d5c3b8cb70f98717b7c07aabbdff06687b9030dbfbe2725f8"
1453+
dependencies = [
1454+
"cfg-if",
1455+
"libc",
1456+
"wasi 0.13.3+wasi-0.2.2",
1457+
"windows-targets 0.52.6",
14461458
]
14471459

14481460
[[package]]
@@ -2342,18 +2354,18 @@ dependencies = [
23422354
"chrono-tz",
23432355
"colored",
23442356
"directories",
2345-
"getrandom",
2357+
"getrandom 0.3.1",
23462358
"libc",
23472359
"libffi",
23482360
"libloading",
23492361
"measureme",
2350-
"rand",
2362+
"rand 0.9.0",
23512363
"regex",
23522364
"rustc_version",
23532365
"smallvec",
23542366
"tempfile",
23552367
"tikv-jemalloc-sys",
2356-
"ui_test",
2368+
"ui_test 0.28.0",
23572369
"windows-sys 0.52.0",
23582370
]
23592371

@@ -2782,7 +2794,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
27822794
checksum = "5d5285893bb5eb82e6aaf5d59ee909a06a16737a8970984dd7746ba9283498d6"
27832795
dependencies = [
27842796
"phf_shared 0.10.0",
2785-
"rand",
2797+
"rand 0.8.5",
27862798
]
27872799

27882800
[[package]]
@@ -2792,7 +2804,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
27922804
checksum = "3c80231409c20246a13fddb31776fb942c38553c51e871f8cbd687a4cfb5843d"
27932805
dependencies = [
27942806
"phf_shared 0.11.3",
2795-
"rand",
2807+
"rand 0.8.5",
27962808
]
27972809

27982810
[[package]]
@@ -2860,7 +2872,7 @@ version = "0.2.20"
28602872
source = "registry+https://github.com/rust-lang/crates.io-index"
28612873
checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04"
28622874
dependencies = [
2863-
"zerocopy",
2875+
"zerocopy 0.7.35",
28642876
]
28652877

28662878
[[package]]
@@ -2978,8 +2990,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
29782990
checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
29792991
dependencies = [
29802992
"libc",
2981-
"rand_chacha",
2982-
"rand_core",
2993+
"rand_chacha 0.3.1",
2994+
"rand_core 0.6.4",
2995+
]
2996+
2997+
[[package]]
2998+
name = "rand"
2999+
version = "0.9.0"
3000+
source = "registry+https://github.com/rust-lang/crates.io-index"
3001+
checksum = "3779b94aeb87e8bd4e834cee3650289ee9e0d5677f976ecdb6d219e5f4f6cd94"
3002+
dependencies = [
3003+
"rand_chacha 0.9.0",
3004+
"rand_core 0.9.0",
3005+
"zerocopy 0.8.14",
29833006
]
29843007

29853008
[[package]]
@@ -2989,7 +3012,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
29893012
checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
29903013
dependencies = [
29913014
"ppv-lite86",
2992-
"rand_core",
3015+
"rand_core 0.6.4",
3016+
]
3017+
3018+
[[package]]
3019+
name = "rand_chacha"
3020+
version = "0.9.0"
3021+
source = "registry+https://github.com/rust-lang/crates.io-index"
3022+
checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb"
3023+
dependencies = [
3024+
"ppv-lite86",
3025+
"rand_core 0.9.0",
29933026
]
29943027

29953028
[[package]]
@@ -2998,7 +3031,17 @@ version = "0.6.4"
29983031
source = "registry+https://github.com/rust-lang/crates.io-index"
29993032
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
30003033
dependencies = [
3001-
"getrandom",
3034+
"getrandom 0.2.15",
3035+
]
3036+
3037+
[[package]]
3038+
name = "rand_core"
3039+
version = "0.9.0"
3040+
source = "registry+https://github.com/rust-lang/crates.io-index"
3041+
checksum = "b08f3c9802962f7e1b25113931d94f43ed9725bebc59db9d0c3e9a23b67e15ff"
3042+
dependencies = [
3043+
"getrandom 0.3.1",
3044+
"zerocopy 0.8.14",
30023045
]
30033046

30043047
[[package]]
@@ -3007,7 +3050,7 @@ version = "0.6.0"
30073050
source = "registry+https://github.com/rust-lang/crates.io-index"
30083051
checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa"
30093052
dependencies = [
3010-
"rand_core",
3053+
"rand_core 0.6.4",
30113054
]
30123055

30133056
[[package]]
@@ -3045,7 +3088,7 @@ version = "0.4.6"
30453088
source = "registry+https://github.com/rust-lang/crates.io-index"
30463089
checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43"
30473090
dependencies = [
3048-
"getrandom",
3091+
"getrandom 0.2.15",
30493092
"libredox",
30503093
"thiserror 1.0.69",
30513094
]
@@ -3283,7 +3326,7 @@ name = "rustc_abi"
32833326
version = "0.0.0"
32843327
dependencies = [
32853328
"bitflags",
3286-
"rand",
3329+
"rand 0.8.5",
32873330
"rand_xoshiro",
32883331
"rustc_data_structures",
32893332
"rustc_feature",
@@ -3897,7 +3940,7 @@ dependencies = [
38973940
name = "rustc_incremental"
38983941
version = "0.0.0"
38993942
dependencies = [
3900-
"rand",
3943+
"rand 0.8.5",
39013944
"rustc_ast",
39023945
"rustc_data_structures",
39033946
"rustc_errors",
@@ -5218,7 +5261,7 @@ checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704"
52185261
dependencies = [
52195262
"cfg-if",
52205263
"fastrand",
5221-
"getrandom",
5264+
"getrandom 0.2.15",
52225265
"once_cell",
52235266
"rustix",
52245267
"windows-sys 0.59.0",
@@ -5281,8 +5324,8 @@ version = "0.1.0"
52815324
dependencies = [
52825325
"indicatif",
52835326
"num",
5284-
"rand",
5285-
"rand_chacha",
5327+
"rand 0.8.5",
5328+
"rand_chacha 0.3.1",
52865329
"rayon",
52875330
]
52885331

@@ -5602,7 +5645,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
56025645
checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675"
56035646
dependencies = [
56045647
"cfg-if",
5605-
"rand",
5648+
"rand 0.8.5",
56065649
"static_assertions",
56075650
]
56085651

@@ -5662,6 +5705,32 @@ dependencies = [
56625705
"spanned",
56635706
]
56645707

5708+
[[package]]
5709+
name = "ui_test"
5710+
version = "0.28.0"
5711+
source = "registry+https://github.com/rust-lang/crates.io-index"
5712+
checksum = "7484683d60d50ca1d1b6433c3dbf6c5ad71d20387acdcfb16fe79573f3fba576"
5713+
dependencies = [
5714+
"annotate-snippets 0.11.5",
5715+
"anyhow",
5716+
"bstr",
5717+
"cargo-platform",
5718+
"cargo_metadata 0.18.1",
5719+
"color-eyre",
5720+
"colored",
5721+
"comma",
5722+
"crossbeam-channel",
5723+
"indicatif",
5724+
"levenshtein",
5725+
"prettydiff",
5726+
"regex",
5727+
"rustc_version",
5728+
"rustfix",
5729+
"serde",
5730+
"serde_json",
5731+
"spanned",
5732+
]
5733+
56655734
[[package]]
56665735
name = "unic-langid"
56675736
version = "0.9.5"
@@ -5843,7 +5912,7 @@ version = "1.12.0"
58435912
source = "registry+https://github.com/rust-lang/crates.io-index"
58445913
checksum = "744018581f9a3454a9e15beb8a33b017183f1e7c0cd170232a2d1453b23a51c4"
58455914
dependencies = [
5846-
"getrandom",
5915+
"getrandom 0.2.15",
58475916
]
58485917

58495918
[[package]]
@@ -5880,6 +5949,15 @@ version = "0.11.0+wasi-snapshot-preview1"
58805949
source = "registry+https://github.com/rust-lang/crates.io-index"
58815950
checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
58825951

5952+
[[package]]
5953+
name = "wasi"
5954+
version = "0.13.3+wasi-0.2.2"
5955+
source = "registry+https://github.com/rust-lang/crates.io-index"
5956+
checksum = "26816d2e1a4a36a2940b96c5296ce403917633dff8f3440e9b236ed6f6bacad2"
5957+
dependencies = [
5958+
"wit-bindgen-rt",
5959+
]
5960+
58835961
[[package]]
58845962
name = "wasi-preview1-component-adapter-provider"
58855963
version = "29.0.1"
@@ -6475,6 +6553,15 @@ version = "0.1.0"
64756553
source = "registry+https://github.com/rust-lang/crates.io-index"
64766554
checksum = "3ab703352da6a72f35c39a533526393725640575bb211f61987a2748323ad956"
64776555

6556+
[[package]]
6557+
name = "wit-bindgen-rt"
6558+
version = "0.33.0"
6559+
source = "registry+https://github.com/rust-lang/crates.io-index"
6560+
checksum = "3268f3d866458b787f390cf61f4bbb563b922d091359f9608842999eaee3943c"
6561+
dependencies = [
6562+
"bitflags",
6563+
]
6564+
64786565
[[package]]
64796566
name = "wit-component"
64806567
version = "0.223.0"
@@ -6584,7 +6671,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
65846671
checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0"
65856672
dependencies = [
65866673
"byteorder",
6587-
"zerocopy-derive",
6674+
"zerocopy-derive 0.7.35",
6675+
]
6676+
6677+
[[package]]
6678+
name = "zerocopy"
6679+
version = "0.8.14"
6680+
source = "registry+https://github.com/rust-lang/crates.io-index"
6681+
checksum = "a367f292d93d4eab890745e75a778da40909cab4d6ff8173693812f79c4a2468"
6682+
dependencies = [
6683+
"zerocopy-derive 0.8.14",
65886684
]
65896685

65906686
[[package]]
@@ -6598,6 +6694,17 @@ dependencies = [
65986694
"syn 2.0.96",
65996695
]
66006696

6697+
[[package]]
6698+
name = "zerocopy-derive"
6699+
version = "0.8.14"
6700+
source = "registry+https://github.com/rust-lang/crates.io-index"
6701+
checksum = "d3931cb58c62c13adec22e38686b559c86a30565e16ad6e8510a337cedc611e1"
6702+
dependencies = [
6703+
"proc-macro2",
6704+
"quote",
6705+
"syn 2.0.96",
6706+
]
6707+
66016708
[[package]]
66026709
name = "zerofrom"
66036710
version = "0.1.5"

compiler/rustc_codegen_llvm/src/consts.rs

+8-2
Original file line numberDiff line numberDiff line change
@@ -420,8 +420,14 @@ impl<'ll> CodegenCx<'ll, '_> {
420420
let g = if val_llty == llty {
421421
g
422422
} else {
423-
// If we created the global with the wrong type,
424-
// correct the type.
423+
// codegen_static_initializer creates the global value just from the
424+
// `Allocation` data by generating one big struct value that is just
425+
// all the bytes and pointers after each other. This will almost never
426+
// match the type that the static was declared with. Unfortunately
427+
// we can't just LLVMConstBitCast our way out of it because that has very
428+
// specific rules on what can be cast. So instead of adding a new way to
429+
// generate static initializers that match the static's type, we picked
430+
// the easier option and retroactively change the type of the static item itself.
425431
let name = llvm::get_value_name(g).to_vec();
426432
llvm::set_value_name(g, b"");
427433

compiler/rustc_const_eval/src/interpret/validity.rs

+11
Original file line numberDiff line numberDiff line change
@@ -1240,6 +1240,17 @@ impl<'rt, 'tcx, M: Machine<'tcx>> ValueVisitor<'tcx, M> for ValidityVisitor<'rt,
12401240
self.visit_field(val, 0, &self.ecx.project_index(val, 0)?)?;
12411241
}
12421242
}
1243+
ty::Pat(base, pat) => {
1244+
// First check that the base type is valid
1245+
self.visit_value(&val.transmute(self.ecx.layout_of(*base)?, self.ecx)?)?;
1246+
// When you extend this match, make sure to also add tests to
1247+
// tests/ui/type/pattern_types/validity.rs((
1248+
match **pat {
1249+
// Range patterns are precisely reflected into `valid_range` and thus
1250+
// handled fully by `visit_scalar` (called below).
1251+
ty::PatternKind::Range { .. } => {},
1252+
}
1253+
}
12431254
_ => {
12441255
// default handler
12451256
try_validation!(

compiler/rustc_driver_impl/src/args.rs

+9-10
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
use std::{env, error, fmt, fs, io};
22

33
use rustc_session::EarlyDiagCtxt;
4-
use rustc_span::ErrorGuaranteed;
54

65
/// Expands argfiles in command line arguments.
76
#[derive(Default)]
@@ -118,22 +117,22 @@ pub fn arg_expand_all(early_dcx: &EarlyDiagCtxt, at_args: &[String]) -> Vec<Stri
118117
///
119118
/// This function is identical to [`env::args()`] except that it emits an error when it encounters
120119
/// non-Unicode arguments instead of panicking.
121-
pub fn raw_args(early_dcx: &EarlyDiagCtxt) -> Result<Vec<String>, ErrorGuaranteed> {
122-
let mut res = Ok(Vec::new());
120+
pub fn raw_args(early_dcx: &EarlyDiagCtxt) -> Vec<String> {
121+
let mut args = Vec::new();
122+
let mut guar = Ok(());
123123
for (i, arg) in env::args_os().enumerate() {
124124
match arg.into_string() {
125-
Ok(arg) => {
126-
if let Ok(args) = &mut res {
127-
args.push(arg);
128-
}
129-
}
125+
Ok(arg) => args.push(arg),
130126
Err(arg) => {
131-
res =
127+
guar =
132128
Err(early_dcx.early_err(format!("argument {i} is not valid Unicode: {arg:?}")))
133129
}
134130
}
135131
}
136-
res
132+
if let Err(guar) = guar {
133+
guar.raise_fatal();
134+
}
135+
args
137136
}
138137

139138
#[derive(Debug)]

0 commit comments

Comments
 (0)