Skip to content

Commit f74f700

Browse files
committed
Auto merge of rust-lang#118232 - matthiaskrgr:rollup-x8crvm0, r=matthiaskrgr
Rollup of 6 pull requests Successful merges: - rust-lang#116807 (Improve rewind documentation) - rust-lang#117656 (Update windows-bindgen and define `INVALID_HANDLE_VALUE` ourselves) - rust-lang#117940 (chore: remove unnecessary drop) - rust-lang#118028 (Document behavior of `<dyn Any as Any>::type_id()`) - rust-lang#118060 (Use an absolute path to the NUL device) - rust-lang#118224 (Sort unstable items last in rustdoc, instead of first) r? `@ghost` `@rustbot` modify labels: rollup
2 parents 8abf920 + 98bae81 commit f74f700

File tree

11 files changed

+37
-17
lines changed

11 files changed

+37
-17
lines changed

Cargo.lock

+4-4
Original file line numberDiff line numberDiff line change
@@ -6072,9 +6072,9 @@ dependencies = [
60726072

60736073
[[package]]
60746074
name = "windows-bindgen"
6075-
version = "0.51.1"
6075+
version = "0.52.0"
60766076
source = "registry+https://github.com/rust-lang/crates.io-index"
6077-
checksum = "bc1f16b778125675feee0d15d6dd9f6af0e3ac52b3233d63a10aa39230c1cd75"
6077+
checksum = "970efb0b6849eb8a87a898f586af7cc167567b070014c7434514c0bde0ca341c"
60786078
dependencies = [
60796079
"proc-macro2",
60806080
"rayon",
@@ -6084,9 +6084,9 @@ dependencies = [
60846084

60856085
[[package]]
60866086
name = "windows-metadata"
6087-
version = "0.51.1"
6087+
version = "0.52.0"
60886088
source = "registry+https://github.com/rust-lang/crates.io-index"
6089-
checksum = "753135d996f9da437c0b31dbde3032489a61708361929bcc07d4fba0b161000e"
6089+
checksum = "218fd59201e26acdbb894fa2b302d1de84bf3eec7d0eb894ac8e9c5a854ee4ef"
60906090

60916091
[[package]]
60926092
name = "windows-sys"

library/core/src/any.rs

+5
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ use crate::intrinsics;
115115
pub trait Any: 'static {
116116
/// Gets the `TypeId` of `self`.
117117
///
118+
/// If called on a `dyn Any` trait object
119+
/// (or a trait object of a subtrait of `Any`),
120+
/// this returns the `TypeId` of the underlying
121+
/// concrete type, not that of `dyn Any` itself.
122+
///
118123
/// # Examples
119124
///
120125
/// ```

library/core/src/cell.rs

+1-2
Original file line numberDiff line numberDiff line change
@@ -409,8 +409,7 @@ impl<T> Cell<T> {
409409
#[inline]
410410
#[stable(feature = "rust1", since = "1.0.0")]
411411
pub fn set(&self, val: T) {
412-
let old = self.replace(val);
413-
drop(old);
412+
self.replace(val);
414413
}
415414

416415
/// Swaps the values of two `Cell`s.

library/std/src/io/mod.rs

+4
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,10 @@ where
556556
/// therefore, using something that implements [`BufRead`], such as
557557
/// [`BufReader`], will be more efficient.
558558
///
559+
/// Repeated calls to the reader use the same cursor, so for example
560+
/// calling `read_to_end` twice on a [`File`] will only return the file's
561+
/// contents once. It's recommended to first call `rewind()` in that case.
562+
///
559563
/// # Examples
560564
///
561565
/// [`File`]s implement `Read`:

library/std/src/sys/windows/c.rs

+2
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,8 @@ pub use FD_SET as fd_set;
4747
pub use LINGER as linger;
4848
pub use TIMEVAL as timeval;
4949

50+
pub const INVALID_HANDLE_VALUE: HANDLE = ::core::ptr::invalid_mut(-1i32 as _);
51+
5052
// https://learn.microsoft.com/en-us/cpp/c-runtime-library/exit-success-exit-failure?view=msvc-170
5153
pub const EXIT_SUCCESS: u32 = 0;
5254
pub const EXIT_FAILURE: u32 = 1;

library/std/src/sys/windows/c/windows_sys.lst

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
--config flatten std
33
--filter
44
// tidy-alphabetical-start
5+
!Windows.Win32.Foundation.INVALID_HANDLE_VALUE
56
Windows.Wdk.Storage.FileSystem.FILE_COMPLETE_IF_OPLOCKED
67
Windows.Wdk.Storage.FileSystem.FILE_CONTAINS_EXTENDED_CREATE_INFORMATION
78
Windows.Wdk.Storage.FileSystem.FILE_CREATE
@@ -1923,7 +1924,6 @@ Windows.Win32.Foundation.HANDLE_FLAG_INHERIT
19231924
Windows.Win32.Foundation.HANDLE_FLAG_PROTECT_FROM_CLOSE
19241925
Windows.Win32.Foundation.HANDLE_FLAGS
19251926
Windows.Win32.Foundation.HMODULE
1926-
Windows.Win32.Foundation.INVALID_HANDLE_VALUE
19271927
Windows.Win32.Foundation.MAX_PATH
19281928
Windows.Win32.Foundation.NO_ERROR
19291929
Windows.Win32.Foundation.NTSTATUS
@@ -2483,7 +2483,6 @@ Windows.Win32.System.SystemInformation.GetSystemTimeAsFileTime
24832483
Windows.Win32.System.SystemInformation.GetWindowsDirectoryW
24842484
Windows.Win32.System.SystemInformation.PROCESSOR_ARCHITECTURE
24852485
Windows.Win32.System.SystemInformation.SYSTEM_INFO
2486-
Windows.Win32.System.SystemServices.ALL_PROCESSOR_GROUPS
24872486
Windows.Win32.System.SystemServices.DLL_PROCESS_DETACH
24882487
Windows.Win32.System.SystemServices.DLL_THREAD_DETACH
24892488
Windows.Win32.System.SystemServices.EXCEPTION_MAXIMUM_PARAMETERS
@@ -2492,6 +2491,7 @@ Windows.Win32.System.SystemServices.IO_REPARSE_TAG_SYMLINK
24922491
Windows.Win32.System.Threading.ABOVE_NORMAL_PRIORITY_CLASS
24932492
Windows.Win32.System.Threading.AcquireSRWLockExclusive
24942493
Windows.Win32.System.Threading.AcquireSRWLockShared
2494+
Windows.Win32.System.Threading.ALL_PROCESSOR_GROUPS
24952495
Windows.Win32.System.Threading.BELOW_NORMAL_PRIORITY_CLASS
24962496
Windows.Win32.System.Threading.CREATE_BREAKAWAY_FROM_JOB
24972497
Windows.Win32.System.Threading.CREATE_DEFAULT_ERROR_MODE

library/std/src/sys/windows/c/windows_sys.rs

+4-5
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// regenerate the bindings.
55
//
66
// ignore-tidy-filelength
7-
// Bindings generated by `windows-bindgen` 0.51.1
7+
// Bindings generated by `windows-bindgen` 0.52.0
88

99
#![allow(non_snake_case, non_upper_case_globals, non_camel_case_types, dead_code, clippy::all)]
1010
#[link(name = "advapi32")]
@@ -63,7 +63,7 @@ extern "system" {
6363
lpnewfilename: PCWSTR,
6464
lpprogressroutine: LPPROGRESS_ROUTINE,
6565
lpdata: *const ::core::ffi::c_void,
66-
pbcancel: *mut i32,
66+
pbcancel: *mut BOOL,
6767
dwcopyflags: u32,
6868
) -> BOOL;
6969
}
@@ -619,7 +619,7 @@ extern "system" {
619619
lpmultibytestr: PSTR,
620620
cbmultibyte: i32,
621621
lpdefaultchar: PCSTR,
622-
lpuseddefaultchar: *mut i32,
622+
lpuseddefaultchar: *mut BOOL,
623623
) -> i32;
624624
}
625625
#[link(name = "kernel32")]
@@ -869,7 +869,7 @@ pub const AF_INET: ADDRESS_FAMILY = 2u16;
869869
pub const AF_INET6: ADDRESS_FAMILY = 23u16;
870870
pub const AF_UNIX: u16 = 1u16;
871871
pub const AF_UNSPEC: ADDRESS_FAMILY = 0u16;
872-
pub const ALL_PROCESSOR_GROUPS: u32 = 65535u32;
872+
pub const ALL_PROCESSOR_GROUPS: u16 = 65535u16;
873873
#[repr(C)]
874874
pub union ARM64_NT_NEON128 {
875875
pub Anonymous: ARM64_NT_NEON128_0,
@@ -3498,7 +3498,6 @@ impl ::core::clone::Clone for INIT_ONCE {
34983498
}
34993499
pub const INIT_ONCE_INIT_FAILED: u32 = 4u32;
35003500
pub const INVALID_FILE_ATTRIBUTES: u32 = 4294967295u32;
3501-
pub const INVALID_HANDLE_VALUE: HANDLE = ::core::ptr::invalid_mut(-1i32 as _);
35023501
pub const INVALID_SOCKET: SOCKET = -1i32 as _;
35033502
#[repr(C)]
35043503
pub struct IN_ADDR {

library/std/src/sys/windows/process.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -597,7 +597,7 @@ impl Stdio {
597597
opts.read(stdio_id == c::STD_INPUT_HANDLE);
598598
opts.write(stdio_id != c::STD_INPUT_HANDLE);
599599
opts.security_attributes(&mut sa);
600-
File::open(Path::new("NUL"), &opts).map(|file| file.into_inner())
600+
File::open(Path::new(r"\\.\NUL"), &opts).map(|file| file.into_inner())
601601
}
602602
}
603603
}

src/librustdoc/html/render/print_item.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -369,8 +369,8 @@ fn item_module(w: &mut Buffer, cx: &mut Context<'_>, item: &clean::Item, items:
369369
if let (Some(a), Some(b)) = (s1, s2) {
370370
match (a.is_stable(), b.is_stable()) {
371371
(true, true) | (false, false) => {}
372-
(false, true) => return Ordering::Less,
373-
(true, false) => return Ordering::Greater,
372+
(false, true) => return Ordering::Greater,
373+
(true, false) => return Ordering::Less,
374374
}
375375
}
376376
let lhs = i1.name.unwrap_or(kw::Empty);

src/tools/generate-windows-sys/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ version = "0.1.0"
44
edition = "2021"
55

66
[dependencies.windows-bindgen]
7-
version = "0.51.1"
7+
version = "0.52.0"

tests/rustdoc/stability.rs

+11
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
#![unstable(feature = "test", issue = "none")]
44

5+
// @has stability/index.html
6+
// @has - '//ul[@class="item-table"]/li[1]//a' AaStable
7+
// @has - '//ul[@class="item-table"]/li[2]//a' ZzStable
8+
// @has - '//ul[@class="item-table"]/li[3]//a' Unstable
9+
10+
#[stable(feature = "rust2", since = "2.2.2")]
11+
pub struct AaStable;
12+
513
pub struct Unstable {
614
// @has stability/struct.Unstable.html \
715
// '//span[@class="item-info"]//div[@class="stab unstable"]' \
@@ -10,3 +18,6 @@ pub struct Unstable {
1018
pub foo: u32,
1119
pub bar: u32,
1220
}
21+
22+
#[stable(feature = "rust2", since = "2.2.2")]
23+
pub struct ZzStable;

0 commit comments

Comments
 (0)