Skip to content

Commit 033f7a3

Browse files
committed
Merge branch 'master' into remove-lib-feature
2 parents 002a2fd + 364da5d commit 033f7a3

File tree

1,428 files changed

+25495
-12790
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,428 files changed

+25495
-12790
lines changed

.editorconfig

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,23 @@ root = true
88
end_of_line = lf
99
charset = utf-8
1010
insert_final_newline = true
11+
trim_trailing_whitespace = true
12+
indent_style = space
13+
indent_size = 4
1114

1215
# some tests need trailing whitespace in output snapshots
13-
[!tests/]
14-
trim_trailing_whitespace = true
16+
[tests/**]
17+
trim_trailing_whitespace = false
1518
# for actual source code files of test, we still don't want trailing whitespace
1619
[tests/**.{rs,js}]
1720
trim_trailing_whitespace = true
1821
# these specific source files need to have trailing whitespace.
1922
[tests/ui/{frontmatter/frontmatter-whitespace-3.rs,parser/shebang/shebang-space.rs}]
2023
trim_trailing_whitespace = false
2124

22-
[!src/llvm-project]
23-
indent_style = space
24-
indent_size = 4
25+
[src/llvm-project]
26+
indent_style = unset
27+
indent_size = unset
2528

2629
[*.rs]
2730
max_line_length = 100

Cargo.lock

Lines changed: 30 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -158,11 +158,11 @@ checksum = "b0674a1ddeecb70197781e945de4b3b8ffb61fa939a5597bcf48503737663100"
158158

159159
[[package]]
160160
name = "ar_archive_writer"
161-
version = "0.4.2"
161+
version = "0.5.1"
162162
source = "registry+https://github.com/rust-lang/crates.io-index"
163-
checksum = "01667f6f40216b9a0b2945e05fed5f1ad0ab6470e69cb9378001e37b1c0668e4"
163+
checksum = "7eb93bbb63b9c227414f6eb3a0adfddca591a8ce1e9b60661bb08969b87e340b"
164164
dependencies = [
165-
"object 0.36.7",
165+
"object 0.37.3",
166166
]
167167

168168
[[package]]
@@ -336,7 +336,7 @@ dependencies = [
336336
"curl",
337337
"indexmap",
338338
"serde",
339-
"toml 0.7.8",
339+
"toml 0.8.23",
340340
]
341341

342342
[[package]]
@@ -2167,6 +2167,7 @@ version = "0.1.0"
21672167
dependencies = [
21682168
"html5ever",
21692169
"regex",
2170+
"urlencoding",
21702171
]
21712172

21722173
[[package]]
@@ -3204,9 +3205,9 @@ dependencies = [
32043205

32053206
[[package]]
32063207
name = "rustc-build-sysroot"
3207-
version = "0.5.9"
3208+
version = "0.5.11"
32083209
source = "registry+https://github.com/rust-lang/crates.io-index"
3209-
checksum = "fdb13874a0e55baf4ac3d49d38206aecb31a55b75d6c4d04fd850b53942c8cc8"
3210+
checksum = "3b881c015c729b43105bbd3702a9bdecee28fafaa21126d1d62e454ec011a4b7"
32103211
dependencies = [
32113212
"anyhow",
32123213
"rustc_version",
@@ -3248,6 +3249,7 @@ dependencies = [
32483249
"rustc_driver_impl",
32493250
"rustc_public",
32503251
"rustc_public_bridge",
3252+
"rustc_windows_rc",
32513253
"tikv-jemalloc-sys",
32523254
]
32533255

@@ -3623,6 +3625,7 @@ name = "rustc_driver"
36233625
version = "0.0.0"
36243626
dependencies = [
36253627
"rustc_driver_impl",
3628+
"rustc_windows_rc",
36263629
]
36273630

36283631
[[package]]
@@ -4022,6 +4025,7 @@ dependencies = [
40224025
name = "rustc_lint"
40234026
version = "0.0.0"
40244027
dependencies = [
4028+
"bitflags",
40254029
"rustc_abi",
40264030
"rustc_ast",
40274031
"rustc_ast_pretty",
@@ -4072,7 +4076,6 @@ name = "rustc_log"
40724076
version = "0.0.0"
40734077
dependencies = [
40744078
"tracing",
4075-
"tracing-core",
40764079
"tracing-subscriber",
40774080
"tracing-tree",
40784081
]
@@ -4409,7 +4412,6 @@ dependencies = [
44094412
"rustc_middle",
44104413
"rustc_query_system",
44114414
"rustc_serialize",
4412-
"rustc_session",
44134415
"rustc_span",
44144416
"tracing",
44154417
]
@@ -4681,6 +4683,7 @@ dependencies = [
46814683
name = "rustc_type_ir"
46824684
version = "0.0.0"
46834685
dependencies = [
4686+
"arrayvec",
46844687
"bitflags",
46854688
"derive-where",
46864689
"ena",
@@ -4718,6 +4721,13 @@ dependencies = [
47184721
"semver",
47194722
]
47204723

4724+
[[package]]
4725+
name = "rustc_windows_rc"
4726+
version = "0.0.0"
4727+
dependencies = [
4728+
"cc",
4729+
]
4730+
47214731
[[package]]
47224732
name = "rustdoc"
47234733
version = "0.0.0"
@@ -5152,9 +5162,9 @@ dependencies = [
51525162

51535163
[[package]]
51545164
name = "stringdex"
5155-
version = "0.0.1-alpha4"
5165+
version = "0.0.1-alpha9"
51565166
source = "registry+https://github.com/rust-lang/crates.io-index"
5157-
checksum = "2841fd43df5b1ff1b042e167068a1fe9b163dc93041eae56ab2296859013a9a0"
5167+
checksum = "7081029913fd7d591c0112182aba8c98ae886b4f12edb208130496cd17dc3c15"
51585168
dependencies = [
51595169
"stacker",
51605170
]
@@ -5518,11 +5528,10 @@ checksum = "5d99f8c9a7727884afe522e9bd5edbfc91a3312b36a77b5fb8926e4c31a41801"
55185528

55195529
[[package]]
55205530
name = "tracing"
5521-
version = "0.1.37"
5531+
version = "0.1.41"
55225532
source = "registry+https://github.com/rust-lang/crates.io-index"
5523-
checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8"
5533+
checksum = "784e0ac535deb450455cbfa28a6f0df145ea1bb7ae51b821cf5e7927fdcfbdd0"
55245534
dependencies = [
5525-
"cfg-if",
55265535
"pin-project-lite",
55275536
"tracing-attributes",
55285537
"tracing-core",
@@ -5541,9 +5550,9 @@ dependencies = [
55415550

55425551
[[package]]
55435552
name = "tracing-core"
5544-
version = "0.1.30"
5553+
version = "0.1.34"
55455554
source = "registry+https://github.com/rust-lang/crates.io-index"
5546-
checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a"
5555+
checksum = "b9d12581f227e93f094d3af2ae690a574abb8a2b9b7a96e7cfe9647b2b617678"
55475556
dependencies = [
55485557
"once_cell",
55495558
"valuable",
@@ -5825,6 +5834,12 @@ dependencies = [
58255834
"percent-encoding",
58265835
]
58275836

5837+
[[package]]
5838+
name = "urlencoding"
5839+
version = "2.1.3"
5840+
source = "registry+https://github.com/rust-lang/crates.io-index"
5841+
checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da"
5842+
58285843
[[package]]
58295844
name = "utf-8"
58305845
version = "0.7.6"

Cargo.toml

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -59,33 +59,6 @@ exclude = [
5959
"obj",
6060
]
6161

62-
[workspace.dependencies]
63-
# tidy-alphabetical-start
64-
bitflags = "2.9.3"
65-
derive-where = "1.6.0"
66-
either = "1.15.0"
67-
indexmap = "2.10.0"
68-
itertools = "0.12.1"
69-
# FIXME: Remove this pin once this rustix issue is resolved
70-
# https://github.com/bytecodealliance/rustix/issues/1496
71-
libc = "=0.2.174"
72-
measureme = "12.0.3"
73-
memchr = "2.7.5"
74-
odht = { version = "0.3.1", features = ["nightly"] }
75-
polonius-engine = "0.13.0"
76-
proc-macro2 = "1.0.101"
77-
quote = "1.0.40"
78-
rustc-demangle = "0.1.26"
79-
rustc-hash = "2.1.1"
80-
rustc-literal-escaper = "0.0.5"
81-
rustc_apfloat = "0.2.3"
82-
scoped-tls = "1.0.1"
83-
serde_json = "1.0.142"
84-
tempfile = "3.20.0"
85-
thin-vec = "0.2.14"
86-
tracing = "0.1.37"
87-
# tidy-alphabetical-end
88-
8962
[profile.release.package.rustc_thread_pool]
9063
# The rustc fork of Rayon has deadlock detection code which intermittently
9164
# causes overflows in the CI (see https://github.com/rust-lang/rust/issues/90227)

bootstrap.example.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -856,6 +856,9 @@
856856
# as libstd features, this option can also be used to configure features such as optimize_for_size.
857857
#rust.std-features = ["panic_unwind"]
858858

859+
# Trigger a `DebugBreak` after an internal compiler error during bootstrap on Windows
860+
#rust.break-on-ice = true
861+
859862
# =============================================================================
860863
# Distribution options
861864
#

compiler/rustc/Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,8 @@ llvm = ['rustc_driver_impl/llvm']
3333
max_level_info = ['rustc_driver_impl/max_level_info']
3434
rustc_randomized_layouts = ['rustc_driver_impl/rustc_randomized_layouts']
3535
# tidy-alphabetical-end
36+
37+
[build-dependencies]
38+
# tidy-alphabetical-start
39+
rustc_windows_rc = { path = "../rustc_windows_rc" }
40+
# tidy-alphabetical-end

compiler/rustc/build.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
use std::env;
1+
use std::{env, path};
2+
3+
use rustc_windows_rc::{VersionInfoFileType, compile_windows_resource_file};
24

35
fn main() {
46
let target_os = env::var("CARGO_CFG_TARGET_OS");
@@ -13,6 +15,18 @@ fn main() {
1315

1416
// Add a manifest file to rustc.exe.
1517
fn set_windows_exe_options() {
18+
set_windows_resource();
19+
set_windows_manifest();
20+
}
21+
22+
fn set_windows_resource() {
23+
let stem = path::PathBuf::from("rustc_main_resource");
24+
let file_description = "rustc";
25+
let res_file = compile_windows_resource_file(&stem, file_description, VersionInfoFileType::App);
26+
println!("cargo:rustc-link-arg={}", res_file.display());
27+
}
28+
29+
fn set_windows_manifest() {
1630
static WINDOWS_MANIFEST_FILE: &str = "Windows Manifest.xml";
1731

1832
let mut manifest = env::current_dir().unwrap();

compiler/rustc_abi/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ edition = "2024"
55

66
[dependencies]
77
# tidy-alphabetical-start
8-
bitflags.workspace = true
8+
bitflags = "2.4.1"
99
rand = { version = "0.9.0", default-features = false, optional = true }
1010
rand_xoshiro = { version = "0.7.0", optional = true }
1111
rustc_data_structures = { path = "../rustc_data_structures", optional = true }
@@ -15,7 +15,7 @@ rustc_index = { path = "../rustc_index", default-features = false }
1515
rustc_macros = { path = "../rustc_macros", optional = true }
1616
rustc_serialize = { path = "../rustc_serialize", optional = true }
1717
rustc_span = { path = "../rustc_span", optional = true }
18-
tracing.workspace = true
18+
tracing = "0.1"
1919
# tidy-alphabetical-end
2020

2121
[features]

compiler/rustc_abi/src/extern_abi.rs

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ use std::hash::{Hash, Hasher};
66
use rustc_data_structures::stable_hasher::{HashStable, StableHasher, StableOrd};
77
#[cfg(feature = "nightly")]
88
use rustc_macros::{Decodable, Encodable};
9+
#[cfg(feature = "nightly")]
10+
use rustc_span::Symbol;
911

1012
use crate::AbiFromStrErr;
1113

@@ -226,6 +228,13 @@ impl StableOrd for ExternAbi {
226228
#[cfg(feature = "nightly")]
227229
rustc_error_messages::into_diag_arg_using_display!(ExternAbi);
228230

231+
#[cfg(feature = "nightly")]
232+
pub enum CVariadicStatus {
233+
NotSupported,
234+
Stable,
235+
Unstable { feature: Symbol },
236+
}
237+
229238
impl ExternAbi {
230239
/// An ABI "like Rust"
231240
///
@@ -238,23 +247,33 @@ impl ExternAbi {
238247
matches!(self, Rust | RustCall | RustCold)
239248
}
240249

241-
pub fn supports_varargs(self) -> bool {
250+
/// Returns whether the ABI supports C variadics. This only controls whether we allow *imports*
251+
/// of such functions via `extern` blocks; there's a separate check during AST construction
252+
/// guarding *definitions* of variadic functions.
253+
#[cfg(feature = "nightly")]
254+
pub fn supports_c_variadic(self) -> CVariadicStatus {
242255
// * C and Cdecl obviously support varargs.
243256
// * C can be based on Aapcs, SysV64 or Win64, so they must support varargs.
244257
// * EfiApi is based on Win64 or C, so it also supports it.
258+
// * System automatically falls back to C when used with variadics, therefore supports it.
245259
//
246260
// * Stdcall does not, because it would be impossible for the callee to clean
247261
// up the arguments. (callee doesn't know how many arguments are there)
248262
// * Same for Fastcall, Vectorcall and Thiscall.
249263
// * Other calling conventions are related to hardware or the compiler itself.
264+
//
265+
// All of the supported ones must have a test in `tests/codegen/cffi/c-variadic-ffi.rs`.
250266
match self {
251267
Self::C { .. }
252268
| Self::Cdecl { .. }
253269
| Self::Aapcs { .. }
254270
| Self::Win64 { .. }
255271
| Self::SysV64 { .. }
256-
| Self::EfiApi => true,
257-
_ => false,
272+
| Self::EfiApi => CVariadicStatus::Stable,
273+
Self::System { .. } => {
274+
CVariadicStatus::Unstable { feature: rustc_span::sym::extern_system_varargs }
275+
}
276+
_ => CVariadicStatus::NotSupported,
258277
}
259278
}
260279
}

compiler/rustc_abi/src/lib.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,8 @@ mod tests;
6363

6464
pub use callconv::{Heterogeneous, HomogeneousAggregate, Reg, RegKind};
6565
pub use canon_abi::{ArmCall, CanonAbi, InterruptKind, X86Call};
66+
#[cfg(feature = "nightly")]
67+
pub use extern_abi::CVariadicStatus;
6668
pub use extern_abi::{ExternAbi, all_names};
6769
#[cfg(feature = "nightly")]
6870
pub use layout::{FIRST_VARIANT, FieldIdx, Layout, TyAbiInterface, TyAndLayout, VariantIdx};
@@ -315,7 +317,7 @@ pub enum TargetDataLayoutErrors<'a> {
315317
MissingAlignment { cause: &'a str },
316318
InvalidAlignment { cause: &'a str, err: AlignFromBytesError },
317319
InconsistentTargetArchitecture { dl: &'a str, target: &'a str },
318-
InconsistentTargetPointerWidth { pointer_size: u64, target: u32 },
320+
InconsistentTargetPointerWidth { pointer_size: u64, target: u16 },
319321
InvalidBitsSize { err: String },
320322
UnknownPointerSpecification { err: String },
321323
}

compiler/rustc_ast/Cargo.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ edition = "2024"
55

66
[dependencies]
77
# tidy-alphabetical-start
8-
bitflags.workspace = true
9-
memchr.workspace = true
10-
rustc-literal-escaper.workspace = true
8+
bitflags = "2.4.1"
9+
memchr = "2.7.4"
10+
rustc-literal-escaper = "0.0.5"
1111
rustc_ast_ir = { path = "../rustc_ast_ir" }
1212
rustc_data_structures = { path = "../rustc_data_structures" }
1313
rustc_index = { path = "../rustc_index" }
1414
rustc_macros = { path = "../rustc_macros" }
1515
rustc_serialize = { path = "../rustc_serialize" }
1616
rustc_span = { path = "../rustc_span" }
1717
smallvec = { version = "1.8.1", features = ["union", "may_dangle"] }
18-
thin-vec.workspace = true
19-
tracing.workspace = true
18+
thin-vec = "0.2.12"
19+
tracing = "0.1"
2020
# tidy-alphabetical-end

0 commit comments

Comments
 (0)