Skip to content

Commit 010f029

Browse files
committed
Auto merge of rust-lang#3306 - rust-lang:rustup-2024-02-19, r=RalfJung
Automatic Rustup
2 parents 90fccaa + e118c3e commit 010f029

File tree

460 files changed

+10168
-3968
lines changed

Some content is hidden

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

460 files changed

+10168
-3968
lines changed

Cargo.lock

+23-57
Original file line numberDiff line numberDiff line change
@@ -931,43 +931,19 @@ dependencies = [
931931

932932
[[package]]
933933
name = "darling"
934-
version = "0.14.4"
934+
version = "0.20.6"
935935
source = "registry+https://github.com/rust-lang/crates.io-index"
936-
checksum = "7b750cb3417fd1b327431a470f388520309479ab0bf5e323505daf0290cd3850"
936+
checksum = "c376d08ea6aa96aafe61237c7200d1241cb177b7d3a542d791f2d118e9cbb955"
937937
dependencies = [
938-
"darling_core 0.14.4",
939-
"darling_macro 0.14.4",
940-
]
941-
942-
[[package]]
943-
name = "darling"
944-
version = "0.20.5"
945-
source = "registry+https://github.com/rust-lang/crates.io-index"
946-
checksum = "fc5d6b04b3fd0ba9926f945895de7d806260a2d7431ba82e7edaecb043c4c6b8"
947-
dependencies = [
948-
"darling_core 0.20.5",
949-
"darling_macro 0.20.5",
938+
"darling_core",
939+
"darling_macro",
950940
]
951941

952942
[[package]]
953943
name = "darling_core"
954-
version = "0.14.4"
944+
version = "0.20.6"
955945
source = "registry+https://github.com/rust-lang/crates.io-index"
956-
checksum = "109c1ca6e6b7f82cc233a97004ea8ed7ca123a9af07a8230878fcfda9b158bf0"
957-
dependencies = [
958-
"fnv",
959-
"ident_case",
960-
"proc-macro2",
961-
"quote",
962-
"strsim 0.10.0",
963-
"syn 1.0.109",
964-
]
965-
966-
[[package]]
967-
name = "darling_core"
968-
version = "0.20.5"
969-
source = "registry+https://github.com/rust-lang/crates.io-index"
970-
checksum = "04e48a959bcd5c761246f5d090ebc2fbf7b9cd527a492b07a67510c108f1e7e3"
946+
checksum = "33043dcd19068b8192064c704b3f83eb464f91f1ff527b44a4e2b08d9cdb8855"
971947
dependencies = [
972948
"fnv",
973949
"ident_case",
@@ -979,22 +955,11 @@ dependencies = [
979955

980956
[[package]]
981957
name = "darling_macro"
982-
version = "0.14.4"
983-
source = "registry+https://github.com/rust-lang/crates.io-index"
984-
checksum = "a4aab4dbc9f7611d8b55048a3a16d2d010c2c8334e46304b40ac1cc14bf3b48e"
985-
dependencies = [
986-
"darling_core 0.14.4",
987-
"quote",
988-
"syn 1.0.109",
989-
]
990-
991-
[[package]]
992-
name = "darling_macro"
993-
version = "0.20.5"
958+
version = "0.20.6"
994959
source = "registry+https://github.com/rust-lang/crates.io-index"
995-
checksum = "1d1545d67a2149e1d93b7e5c7752dce5a7426eb5d1357ddcfd89336b94444f77"
960+
checksum = "c5a91391accf613803c2a9bf9abccdbaa07c54b4244a5b64883f9c3c137c86be"
996961
dependencies = [
997-
"darling_core 0.20.5",
962+
"darling_core",
998963
"quote",
999964
"syn 2.0.48",
1000965
]
@@ -1036,33 +1001,33 @@ dependencies = [
10361001

10371002
[[package]]
10381003
name = "derive_builder"
1039-
version = "0.12.0"
1004+
version = "0.20.0"
10401005
source = "registry+https://github.com/rust-lang/crates.io-index"
1041-
checksum = "8d67778784b508018359cbc8696edb3db78160bab2c2a28ba7f56ef6932997f8"
1006+
checksum = "0350b5cb0331628a5916d6c5c0b72e97393b8b6b03b47a9284f4e7f5a405ffd7"
10421007
dependencies = [
10431008
"derive_builder_macro",
10441009
]
10451010

10461011
[[package]]
10471012
name = "derive_builder_core"
1048-
version = "0.12.0"
1013+
version = "0.20.0"
10491014
source = "registry+https://github.com/rust-lang/crates.io-index"
1050-
checksum = "c11bdc11a0c47bc7d37d582b5285da6849c96681023680b906673c5707af7b0f"
1015+
checksum = "d48cda787f839151732d396ac69e3473923d54312c070ee21e9effcaa8ca0b1d"
10511016
dependencies = [
1052-
"darling 0.14.4",
1017+
"darling",
10531018
"proc-macro2",
10541019
"quote",
1055-
"syn 1.0.109",
1020+
"syn 2.0.48",
10561021
]
10571022

10581023
[[package]]
10591024
name = "derive_builder_macro"
1060-
version = "0.12.0"
1025+
version = "0.20.0"
10611026
source = "registry+https://github.com/rust-lang/crates.io-index"
1062-
checksum = "ebcda35c7a396850a55ffeac740804b40ffec779b98fffbb1738f4033f0ee79e"
1027+
checksum = "206868b8242f27cecce124c19fd88157fbd0dd334df2587f36417bafbc85097b"
10631028
dependencies = [
10641029
"derive_builder_core",
1065-
"syn 1.0.109",
1030+
"syn 2.0.48",
10661031
]
10671032

10681033
[[package]]
@@ -1084,7 +1049,7 @@ version = "0.1.6"
10841049
source = "registry+https://github.com/rust-lang/crates.io-index"
10851050
checksum = "4e8ef033054e131169b8f0f9a7af8f5533a9436fadf3c500ed547f730f07090d"
10861051
dependencies = [
1087-
"darling 0.20.5",
1052+
"darling",
10881053
"proc-macro2",
10891054
"quote",
10901055
"syn 2.0.48",
@@ -6206,11 +6171,12 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
62066171

62076172
[[package]]
62086173
name = "windows"
6209-
version = "0.48.0"
6174+
version = "0.52.0"
62106175
source = "registry+https://github.com/rust-lang/crates.io-index"
6211-
checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f"
6176+
checksum = "e48a53791691ab099e5e2ad123536d0fff50652600abaf43bbf952894110d0be"
62126177
dependencies = [
6213-
"windows-targets 0.48.5",
6178+
"windows-core",
6179+
"windows-targets 0.52.0",
62146180
]
62156181

62166182
[[package]]

compiler/rustc_codegen_cranelift/example/mini_core_hello_world.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -112,8 +112,8 @@ fn start<T: Termination + 'static>(
112112

113113
static mut NUM: u8 = 6 * 7;
114114

115-
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint
116-
#[allow(static_mut_ref)]
115+
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint
116+
#[allow(static_mut_refs)]
117117
static NUM_REF: &'static u8 = unsafe { &NUM };
118118

119119
unsafe fn zeroed<T>() -> T {

compiler/rustc_codegen_gcc/example/mini_core_hello_world.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,8 @@ fn start<T: Termination + 'static>(
9999

100100
static mut NUM: u8 = 6 * 7;
101101

102-
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_ref` lint
103-
#[allow(static_mut_ref)]
102+
// FIXME: Use `SyncUnsafeCell` instead of allowing `static_mut_refs` lint
103+
#[allow(static_mut_refs)]
104104
static NUM_REF: &'static u8 = unsafe { &NUM };
105105

106106
macro_rules! assert {

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", "xcoff", "unaligned", "archive", "write"]
5252

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

compiler/rustc_codegen_ssa/src/errors.rs

+5-2
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,11 @@ impl<G: EmissionGuarantee> IntoDiagnostic<'_, G> for LinkingFailed<'_> {
362362
// which by now we have no way to translate.
363363
if contains_undefined_ref {
364364
diag.note(fluent::codegen_ssa_extern_funcs_not_found)
365-
.note(fluent::codegen_ssa_specify_libraries_to_link)
366-
.note(fluent::codegen_ssa_use_cargo_directive);
365+
.note(fluent::codegen_ssa_specify_libraries_to_link);
366+
367+
if rustc_session::utils::was_invoked_from_cargo() {
368+
diag.note(fluent::codegen_ssa_use_cargo_directive);
369+
}
367370
}
368371
diag
369372
}

compiler/rustc_data_structures/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ tracing = "0.1"
3333
version = "0.12"
3434

3535
[target.'cfg(windows)'.dependencies.windows]
36-
version = "0.48.0"
36+
version = "0.52.0"
3737
features = [
3838
"Win32_Foundation",
3939
"Win32_Storage_FileSystem",

compiler/rustc_data_structures/src/flock/windows.rs

-1
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ impl Lock {
6969
&mut overlapped,
7070
)
7171
}
72-
.ok()
7372
.map_err(|e| {
7473
let err = io::Error::from_raw_os_error(e.code().0);
7574
debug!("failed acquiring file lock: {}", err);

compiler/rustc_data_structures/src/owned_slice.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::sync::Lrc;
44
// Use our fake Send/Sync traits when on not parallel compiler,
55
// so that `OwnedSlice` only implements/requires Send/Sync
66
// for parallel compiler builds.
7-
use crate::sync::{Send, Sync};
7+
use crate::sync;
88

99
/// An owned slice.
1010
///
@@ -33,7 +33,7 @@ pub struct OwnedSlice {
3333
// \/
3434
// ⊂(´・◡・⊂ )∘˚˳° (I am the phantom remnant of #97770)
3535
#[expect(dead_code)]
36-
owner: Lrc<dyn Send + Sync>,
36+
owner: Lrc<dyn sync::Send + sync::Sync>,
3737
}
3838

3939
/// Makes an [`OwnedSlice`] out of an `owner` and a `slicer` function.
@@ -60,7 +60,7 @@ pub struct OwnedSlice {
6060
/// ```
6161
pub fn slice_owned<O, F>(owner: O, slicer: F) -> OwnedSlice
6262
where
63-
O: Send + Sync + 'static,
63+
O: sync::Send + sync::Sync + 'static,
6464
F: FnOnce(&O) -> &[u8],
6565
{
6666
try_slice_owned(owner, |x| Ok::<_, !>(slicer(x))).into_ok()
@@ -71,7 +71,7 @@ where
7171
/// See [`slice_owned`] for the infallible version.
7272
pub fn try_slice_owned<O, F, E>(owner: O, slicer: F) -> Result<OwnedSlice, E>
7373
where
74-
O: Send + Sync + 'static,
74+
O: sync::Send + sync::Sync + 'static,
7575
F: FnOnce(&O) -> Result<&[u8], E>,
7676
{
7777
// We wrap the owner of the bytes in, so it doesn't move.
@@ -139,11 +139,11 @@ impl Borrow<[u8]> for OwnedSlice {
139139

140140
// Safety: `OwnedSlice` is conceptually `(&'self.1 [u8], Arc<dyn Send + Sync>)`, which is `Send`
141141
#[cfg(parallel_compiler)]
142-
unsafe impl Send for OwnedSlice {}
142+
unsafe impl sync::Send for OwnedSlice {}
143143

144144
// Safety: `OwnedSlice` is conceptually `(&'self.1 [u8], Arc<dyn Send + Sync>)`, which is `Sync`
145145
#[cfg(parallel_compiler)]
146-
unsafe impl Sync for OwnedSlice {}
146+
unsafe impl sync::Sync for OwnedSlice {}
147147

148148
#[cfg(test)]
149149
mod tests;

compiler/rustc_data_structures/src/profiling.rs

+2-4
Original file line numberDiff line numberDiff line change
@@ -866,16 +866,14 @@ cfg_match! {
866866
use std::mem;
867867

868868
use windows::{
869-
// FIXME: change back to K32GetProcessMemoryInfo when windows crate
870-
// updated to 0.49.0+ to drop dependency on psapi.dll
871-
Win32::System::ProcessStatus::{GetProcessMemoryInfo, PROCESS_MEMORY_COUNTERS},
869+
Win32::System::ProcessStatus::{K32GetProcessMemoryInfo, PROCESS_MEMORY_COUNTERS},
872870
Win32::System::Threading::GetCurrentProcess,
873871
};
874872

875873
let mut pmc = PROCESS_MEMORY_COUNTERS::default();
876874
let pmc_size = mem::size_of_val(&pmc);
877875
unsafe {
878-
GetProcessMemoryInfo(
876+
K32GetProcessMemoryInfo(
879877
GetCurrentProcess(),
880878
&mut pmc,
881879
pmc_size as u32,

compiler/rustc_driver_impl/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ libc = "0.2"
6060
# tidy-alphabetical-end
6161

6262
[target.'cfg(windows)'.dependencies.windows]
63-
version = "0.48.0"
63+
version = "0.52.0"
6464
features = [
6565
"Win32_System_Diagnostics_Debug",
6666
]
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,26 @@
1-
Reference of mutable static.
1+
You have created a reference to a mutable static.
22

33
Erroneous code example:
44

55
```compile_fail,edition2024,E0796
66
static mut X: i32 = 23;
7-
static mut Y: i32 = 24;
87
9-
unsafe {
10-
let y = &X;
11-
let ref x = X;
12-
let (x, y) = (&X, &Y);
13-
foo(&X);
8+
fn work() {
9+
let _val = unsafe { X };
1410
}
1511
16-
fn foo<'a>(_x: &'a i32) {}
12+
let x_ref = unsafe { &mut X };
13+
work();
14+
// The next line has Undefined Behavior!
15+
// `x_ref` is a mutable reference and allows no aliases,
16+
// but `work` has been reading the reference between
17+
// the moment `x_ref` was created and when it was used.
18+
// This violates the uniqueness of `x_ref`.
19+
*x_ref = 42;
1720
```
1821

19-
Mutable statics can be written to by multiple threads: aliasing violations or
20-
data races will cause undefined behavior.
22+
A reference to a mutable static has lifetime `'static`. This is very dangerous
23+
as it is easy to accidentally overlap the lifetime of that reference with
24+
other, conflicting accesses to the same static.
2125

22-
Reference of mutable static is a hard error from 2024 edition.
26+
References to mutable statics are a hard error in the 2024 edition.

compiler/rustc_errors/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ unicode-width = "0.1.4"
3030
# tidy-alphabetical-end
3131

3232
[target.'cfg(windows)'.dependencies.windows]
33-
version = "0.48.0"
33+
version = "0.52.0"
3434
features = [
3535
"Win32_Foundation",
3636
"Win32_Security",

compiler/rustc_errors/src/lock.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@ pub fn acquire_global_lock(name: &str) -> Box<dyn Any> {
2727
impl Drop for Handle {
2828
fn drop(&mut self) {
2929
unsafe {
30-
CloseHandle(self.0);
30+
// FIXME can panic here
31+
CloseHandle(self.0).unwrap();
3132
}
3233
}
3334
}
@@ -37,7 +38,8 @@ pub fn acquire_global_lock(name: &str) -> Box<dyn Any> {
3738
impl Drop for Guard {
3839
fn drop(&mut self) {
3940
unsafe {
40-
ReleaseMutex((self.0).0);
41+
// FIXME can panic here
42+
ReleaseMutex((self.0).0).unwrap();
4143
}
4244
}
4345
}

compiler/rustc_expand/messages.ftl

+5
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,11 @@ expand_invalid_cfg_multiple_predicates = multiple `cfg` predicates are specified
6161
expand_invalid_cfg_no_parens = `cfg` is not followed by parentheses
6262
expand_invalid_cfg_no_predicate = `cfg` predicate is not specified
6363
expand_invalid_cfg_predicate_literal = `cfg` predicate key cannot be a literal
64+
65+
expand_invalid_fragment_specifier =
66+
invalid fragment specifier `{$fragment}`
67+
.help = {$help}
68+
6469
expand_macro_body_stability =
6570
macros cannot have body stability attributes
6671
.label = invalid body stability attribute

compiler/rustc_expand/src/errors.rs

+10
Original file line numberDiff line numberDiff line change
@@ -408,3 +408,13 @@ pub struct DuplicateMatcherBinding {
408408
#[label(expand_label2)]
409409
pub prev: Span,
410410
}
411+
412+
#[derive(Diagnostic)]
413+
#[diag(expand_invalid_fragment_specifier)]
414+
#[help]
415+
pub struct InvalidFragmentSpecifier {
416+
#[primary_span]
417+
pub span: Span,
418+
pub fragment: Ident,
419+
pub help: String,
420+
}

compiler/rustc_expand/src/lib.rs

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#![feature(if_let_guard)]
77
#![feature(let_chains)]
88
#![feature(macro_metavar_expr)]
9+
#![feature(map_try_insert)]
910
#![feature(proc_macro_diagnostic)]
1011
#![feature(proc_macro_internals)]
1112
#![feature(proc_macro_span)]

0 commit comments

Comments
 (0)