Skip to content

Commit d075b6c

Browse files
authored
Rollup merge of #111393 - klensy:win-0.48, r=oli-obk
bump windows crate 0.46 -> 0.48 This drops duped version of crate(0.46), reduces `rustc_driver.dll` ~800kb and reduces exported functions number from 26k to 22k. Also while here, added `tidy-alphabetical` sorting to lists in tidy allowed lists.
2 parents ea332b5 + 4f12412 commit d075b6c

File tree

11 files changed

+69
-59
lines changed

11 files changed

+69
-59
lines changed

Cargo.lock

+7-16
Original file line numberDiff line numberDiff line change
@@ -741,7 +741,7 @@ dependencies = [
741741
"tracing-subscriber",
742742
"unified-diff",
743743
"walkdir",
744-
"windows 0.46.0",
744+
"windows",
745745
]
746746

747747
[[package]]
@@ -1647,7 +1647,7 @@ dependencies = [
16471647
"iana-time-zone-haiku",
16481648
"js-sys",
16491649
"wasm-bindgen",
1650-
"windows 0.48.0",
1650+
"windows",
16511651
]
16521652

16531653
[[package]]
@@ -3259,7 +3259,7 @@ dependencies = [
32593259
"tempfile",
32603260
"thorin-dwp",
32613261
"tracing",
3262-
"windows 0.46.0",
3262+
"windows",
32633263
]
32643264

32653265
[[package]]
@@ -3315,7 +3315,7 @@ dependencies = [
33153315
"tempfile",
33163316
"thin-vec",
33173317
"tracing",
3318-
"windows 0.46.0",
3318+
"windows",
33193319
]
33203320

33213321
[[package]]
@@ -3376,7 +3376,7 @@ dependencies = [
33763376
"rustc_ty_utils",
33773377
"serde_json",
33783378
"tracing",
3379-
"windows 0.46.0",
3379+
"windows",
33803380
]
33813381

33823382
[[package]]
@@ -3426,7 +3426,7 @@ dependencies = [
34263426
"termize",
34273427
"tracing",
34283428
"unicode-width",
3429-
"windows 0.46.0",
3429+
"windows",
34303430
]
34313431

34323432
[[package]]
@@ -4096,7 +4096,7 @@ dependencies = [
40964096
"smallvec",
40974097
"termize",
40984098
"tracing",
4099-
"windows 0.46.0",
4099+
"windows",
41004100
]
41014101

41024102
[[package]]
@@ -5498,15 +5498,6 @@ version = "0.4.0"
54985498
source = "registry+https://github.com/rust-lang/crates.io-index"
54995499
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
55005500

5501-
[[package]]
5502-
name = "windows"
5503-
version = "0.46.0"
5504-
source = "registry+https://github.com/rust-lang/crates.io-index"
5505-
checksum = "cdacb41e6a96a052c6cb63a144f24900236121c6f63f4f8219fef5977ecb0c25"
5506-
dependencies = [
5507-
"windows-targets 0.42.2",
5508-
]
5509-
55105501
[[package]]
55115502
name = "windows"
55125503
version = "0.48.0"

compiler/rustc_codegen_ssa/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,5 +51,5 @@ default-features = false
5151
features = ["read_core", "elf", "macho", "pe", "unaligned", "archive", "write"]
5252

5353
[target.'cfg(windows)'.dependencies.windows]
54-
version = "0.46.0"
54+
version = "0.48.0"
5555
features = ["Win32_Globalization"]

compiler/rustc_data_structures/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ itertools = "0.10.1"
3737
version = "0.11"
3838

3939
[target.'cfg(windows)'.dependencies.windows]
40-
version = "0.46.0"
40+
version = "0.48.0"
4141
features = [
4242
"Win32_Foundation",
4343
"Win32_Storage_FileSystem",

compiler/rustc_data_structures/src/profiling.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -865,14 +865,16 @@ cfg_if! {
865865
use std::mem;
866866

867867
use windows::{
868-
Win32::System::ProcessStatus::{K32GetProcessMemoryInfo, PROCESS_MEMORY_COUNTERS},
868+
// FIXME: change back to K32GetProcessMemoryInfo when windows crate
869+
// updated to 0.49.0+ to drop dependency on psapi.dll
870+
Win32::System::ProcessStatus::{GetProcessMemoryInfo, PROCESS_MEMORY_COUNTERS},
869871
Win32::System::Threading::GetCurrentProcess,
870872
};
871873

872874
let mut pmc = PROCESS_MEMORY_COUNTERS::default();
873875
let pmc_size = mem::size_of_val(&pmc);
874876
unsafe {
875-
K32GetProcessMemoryInfo(
877+
GetProcessMemoryInfo(
876878
GetCurrentProcess(),
877879
&mut pmc,
878880
pmc_size as u32,

compiler/rustc_driver_impl/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ rustc_mir_transform = { path = "../rustc_mir_transform" }
5757
libc = "0.2"
5858

5959
[target.'cfg(windows)'.dependencies.windows]
60-
version = "0.46.0"
60+
version = "0.48.0"
6161
features = [
6262
"Win32_System_Diagnostics_Debug",
6363
]

compiler/rustc_errors/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,11 @@ serde = { version = "1.0.125", features = [ "derive" ] }
2727
serde_json = "1.0.59"
2828

2929
[target.'cfg(windows)'.dependencies.windows]
30-
version = "0.46.0"
30+
version = "0.48.0"
3131
features = [
3232
"Win32_Foundation",
3333
"Win32_Security",
3434
"Win32_System_Threading",
35-
"Win32_System_WindowsProgramming",
3635
]
3736

3837
[features]

compiler/rustc_errors/src/lock.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ pub fn acquire_global_lock(name: &str) -> Box<dyn Any> {
1919
use windows::{
2020
core::PCSTR,
2121
Win32::Foundation::{CloseHandle, HANDLE, WAIT_ABANDONED, WAIT_OBJECT_0},
22-
Win32::System::Threading::{CreateMutexA, ReleaseMutex, WaitForSingleObject},
23-
Win32::System::WindowsProgramming::INFINITE,
22+
Win32::System::Threading::{CreateMutexA, ReleaseMutex, WaitForSingleObject, INFINITE},
2423
};
2524

2625
struct Handle(HANDLE);

compiler/rustc_session/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ termize = "0.1.1"
2525
libc = "0.2"
2626

2727
[target.'cfg(windows)'.dependencies.windows]
28-
version = "0.46.0"
28+
version = "0.48.0"
2929
features = [
3030
"Win32_Foundation",
3131
"Win32_System_LibraryLoader",

compiler/rustc_session/src/filesearch.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,13 @@ fn current_dll_path() -> Result<PathBuf, String> {
135135

136136
use windows::{
137137
core::PCWSTR,
138-
Win32::Foundation::HINSTANCE,
138+
Win32::Foundation::HMODULE,
139139
Win32::System::LibraryLoader::{
140140
GetModuleFileNameW, GetModuleHandleExW, GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,
141141
},
142142
};
143143

144-
let mut module = HINSTANCE::default();
144+
let mut module = HMODULE::default();
145145
unsafe {
146146
GetModuleHandleExW(
147147
GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS,

src/tools/compiletest/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ libc = "0.2"
2828
miow = "0.5"
2929

3030
[target.'cfg(windows)'.dependencies.windows]
31-
version = "0.46.0"
31+
version = "0.48.0"
3232
features = [
3333
"Win32_Foundation",
3434
"Win32_System_Diagnostics_Debug",

src/tools/tidy/src/deps.rs

+49-30
Original file line numberDiff line numberDiff line change
@@ -6,47 +6,53 @@ use std::path::Path;
66

77
/// These are licenses that are allowed for all crates, including the runtime,
88
/// rustc, tools, etc.
9+
#[rustfmt::skip]
910
const LICENSES: &[&str] = &[
10-
"MIT/Apache-2.0",
11-
"MIT / Apache-2.0",
12-
"Apache-2.0/MIT",
11+
// tidy-alphabetical-start
12+
"(MIT OR Apache-2.0) AND Unicode-DFS-2016", // unicode_ident
13+
"0BSD OR MIT OR Apache-2.0", // adler license
14+
"0BSD",
1315
"Apache-2.0 / MIT",
14-
"MIT OR Apache-2.0",
1516
"Apache-2.0 OR MIT",
1617
"Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT", // wasi license
17-
"MIT",
18+
"Apache-2.0/MIT",
1819
"ISC",
19-
"Unlicense/MIT",
20+
"MIT / Apache-2.0",
21+
"MIT OR Apache-2.0 OR Zlib", // tinyvec_macros
22+
"MIT OR Apache-2.0",
23+
"MIT OR Zlib OR Apache-2.0", // miniz_oxide
24+
"MIT",
25+
"MIT/Apache-2.0",
26+
"Unicode-DFS-2016", // tinystr and icu4x
2027
"Unlicense OR MIT",
21-
"0BSD",
22-
"0BSD OR MIT OR Apache-2.0", // adler license
23-
"Zlib OR Apache-2.0 OR MIT", // tinyvec
24-
"MIT OR Apache-2.0 OR Zlib", // tinyvec_macros
25-
"MIT OR Zlib OR Apache-2.0", // miniz_oxide
26-
"(MIT OR Apache-2.0) AND Unicode-DFS-2016", // unicode_ident
27-
"Unicode-DFS-2016", // tinystr and icu4x
28+
"Unlicense/MIT",
29+
"Zlib OR Apache-2.0 OR MIT", // tinyvec
30+
// tidy-alphabetical-end
2831
];
2932

3033
/// These are exceptions to Rust's permissive licensing policy, and
3134
/// should be considered bugs. Exceptions are only allowed in Rust
3235
/// tooling. It is _crucial_ that no exception crates be dependencies
3336
/// of the Rust runtime (std/test).
37+
#[rustfmt::skip]
3438
const EXCEPTIONS: &[(&str, &str)] = &[
39+
// tidy-alphabetical-start
3540
("ar_archive_writer", "Apache-2.0 WITH LLVM-exception"), // rustc
36-
("mdbook", "MPL-2.0"), // mdbook
41+
("codespan-reporting", "Apache-2.0"), // cxx via iana-time-zone-haiku via time, only on haiku
3742
("colored", "MPL-2.0"), // rustfmt
43+
("dissimilar", "Apache-2.0"), // rustdoc, rustc_lexer (few tests) via expect-test, (dev deps)
44+
("fluent-langneg", "Apache-2.0"), // rustc (fluent translations)
45+
("fortanix-sgx-abi", "MPL-2.0"), // libstd but only for `sgx` target. FIXME: this dependency violates the documentation comment above.
46+
("instant", "BSD-3-Clause"), // rustc_driver/tracing-subscriber/parking_lot
47+
("mdbook", "MPL-2.0"), // mdbook
3848
("ryu", "Apache-2.0 OR BSL-1.0"), // cargo/... (because of serde)
39-
("codespan-reporting", "Apache-2.0"), // cxx via iana-time-zone-haiku via time, only on haiku
40-
("instant", "BSD-3-Clause"), // rustc_driver/tracing-subscriber/parking_lot
41-
("snap", "BSD-3-Clause"), // rustc
42-
("fluent-langneg", "Apache-2.0"), // rustc (fluent translations)
43-
("self_cell", "Apache-2.0"), // rustc (fluent translations)
44-
// FIXME: this dependency violates the documentation comment above:
45-
("fortanix-sgx-abi", "MPL-2.0"), // libstd but only for `sgx` target
46-
("dissimilar", "Apache-2.0"), // rustdoc, rustc_lexer (few tests) via expect-test, (dev deps)
49+
("self_cell", "Apache-2.0"), // rustc (fluent translations)
50+
("snap", "BSD-3-Clause"), // rustc
51+
// tidy-alphabetical-end
4752
];
4853

4954
const EXCEPTIONS_CARGO: &[(&str, &str)] = &[
55+
// tidy-alphabetical-start
5056
("bitmaps", "MPL-2.0+"),
5157
("bytesize", "Apache-2.0"),
5258
("dunce", "CC0-1.0 OR MIT-0"),
@@ -62,9 +68,11 @@ const EXCEPTIONS_CARGO: &[(&str, &str)] = &[
6268
("sized-chunks", "MPL-2.0+"),
6369
("subtle", "BSD-3-Clause"),
6470
("unicode-bom", "Apache-2.0"),
71+
// tidy-alphabetical-end
6572
];
6673

6774
const EXCEPTIONS_CRANELIFT: &[(&str, &str)] = &[
75+
// tidy-alphabetical-start
6876
("cranelift-bforest", "Apache-2.0 WITH LLVM-exception"),
6977
("cranelift-codegen", "Apache-2.0 WITH LLVM-exception"),
7078
("cranelift-codegen-meta", "Apache-2.0 WITH LLVM-exception"),
@@ -80,6 +88,7 @@ const EXCEPTIONS_CRANELIFT: &[(&str, &str)] = &[
8088
("regalloc2", "Apache-2.0 WITH LLVM-exception"),
8189
("target-lexicon", "Apache-2.0 WITH LLVM-exception"),
8290
("wasmtime-jit-icache-coherence", "Apache-2.0 WITH LLVM-exception"),
91+
// tidy-alphabetical-end
8392
];
8493

8594
const EXCEPTIONS_BOOTSTRAP: &[(&str, &str)] = &[
@@ -95,6 +104,7 @@ const RUNTIME_CRATES: &[&str] = &["std", "core", "alloc", "test", "panic_abort",
95104
/// This list is here to provide a speed-bump to adding a new dependency to
96105
/// rustc. Please check with the compiler team before adding an entry.
97106
const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
107+
// tidy-alphabetical-start
98108
"addr2line",
99109
"adler",
100110
"ahash",
@@ -113,8 +123,8 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
113123
"chalk-engine",
114124
"chalk-ir",
115125
"chalk-solve",
116-
"convert_case", // dependency of derive_more
117126
"compiler_builtins",
127+
"convert_case", // dependency of derive_more
118128
"cpufeatures",
119129
"crc32fast",
120130
"crossbeam-channel",
@@ -187,8 +197,8 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
187197
"ppv-lite86",
188198
"proc-macro-hack",
189199
"proc-macro2",
190-
"pulldown-cmark",
191200
"psm",
201+
"pulldown-cmark",
192202
"punycode",
193203
"quote",
194204
"rand",
@@ -227,14 +237,14 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
227237
"tempfile",
228238
"termcolor",
229239
"termize",
240+
"thin-vec",
230241
"thiserror",
231242
"thiserror-impl",
232243
"thorin-dwp",
233244
"thread_local",
234245
"tinystr",
235246
"tinyvec",
236247
"tinyvec_macros",
237-
"thin-vec",
238248
"tracing",
239249
"tracing-attributes",
240250
"tracing-core",
@@ -263,29 +273,37 @@ const PERMITTED_RUSTC_DEPENDENCIES: &[&str] = &[
263273
"valuable",
264274
"version_check",
265275
"wasi",
266-
"windows",
267276
"winapi",
268277
"winapi-i686-pc-windows-gnu",
269278
"winapi-util",
270279
"winapi-x86_64-pc-windows-gnu",
280+
"windows",
281+
"windows-targets",
282+
"windows_aarch64_gnullvm",
283+
"windows_aarch64_msvc",
284+
"windows_i686_gnu",
285+
"windows_i686_msvc",
286+
"windows_x86_64_gnu",
287+
"windows_x86_64_gnullvm",
288+
"windows_x86_64_msvc",
271289
"writeable",
272-
// this is a false-positive: it's only used by rustfmt, but because it's enabled through a
273-
// feature, tidy thinks it's used by rustc as well.
274-
"yansi-term",
290+
"yansi-term", // this is a false-positive: it's only used by rustfmt, but because it's enabled through a feature, tidy thinks it's used by rustc as well.
275291
"yoke",
276292
"yoke-derive",
277293
"zerofrom",
278294
"zerofrom-derive",
279295
"zerovec",
280296
"zerovec-derive",
297+
// tidy-alphabetical-end
281298
];
282299

283300
const PERMITTED_CRANELIFT_DEPENDENCIES: &[&str] = &[
301+
// tidy-alphabetical-start
284302
"ahash",
285303
"anyhow",
286304
"autocfg",
287-
"bumpalo",
288305
"bitflags",
306+
"bumpalo",
289307
"byteorder",
290308
"cfg-if",
291309
"cranelift-bforest",
@@ -324,6 +342,7 @@ const PERMITTED_CRANELIFT_DEPENDENCIES: &[&str] = &[
324342
"winapi-i686-pc-windows-gnu",
325343
"winapi-x86_64-pc-windows-gnu",
326344
"windows-sys",
345+
// tidy-alphabetical-end
327346
];
328347

329348
/// Dependency checks.

0 commit comments

Comments
 (0)