Commit Graph

13 Commits

Author SHA1 Message Date
joboet
c14d137bfc std: update internal uses of io::const_error! 2024-11-26 18:38:24 +01:00
Matthias Krüger
1f700139f8 Rollup merge of #127586 - zachs18:more-must-use, r=cuviper
Add `#[must_use]` to some `into_raw*` functions.

cc #121287

r? ``@cuviper``

Adds `#[must_use = "losing the pointer will leak memory"]`[^1] to `Box::into_raw(_with_allocator)`, `Vec::into_raw_parts(_with_alloc)`, `String::into_raw_parts`[^2], and `rc::{Rc, Weak}::into_raw_with_allocator` (Rc's normal `into_raw` and all of `Arc`'s `into_raw*`s are already `must_use`).

Adds `#[must_use = "losing the raw <resource name may leak resources"]` to `IntoRawFd::into_raw_fd`, `IntoRawSocket::into_raw_socket`, and `IntoRawHandle::into_raw_handle`.

[^1]: "*will* leak memory" may be too-strong wording (since `Box`/`Vec`/`String`/`rc::Weak` might not have a backing allocation), but I left it as-is for simplicity and consistency.

[^2]: `String::into_raw_parts`'s `must_use` message is changed from the previous (possibly misleading) "`self` will be dropped if the result is not used".
2024-08-03 11:17:42 +02:00
Nicholas Nethercote
84ac80f192 Reformat use declarations.
The previous commit updated `rustfmt.toml` appropriately. This commit is
the outcome of running `x fmt --all` with the new formatting options.
2024-07-29 08:26:52 +10:00
Chris Denton
ffe8fc276e Don't re-export c_int from c 2024-07-15 05:01:23 +00:00
Chris Denton
e2b062c9b5 Remove DWORD 2024-07-15 05:01:22 +00:00
Chris Denton
d8d7c5c3b9 Remove ULONG 2024-07-15 05:01:22 +00:00
Chris Denton
84dd7e4959 Remove LPVOID 2024-07-15 05:01:21 +00:00
Chris Denton
e70cc28831 Remove LPWSTR 2024-07-15 05:01:20 +00:00
Zachary S
84d84daf17 Explicitly ignore into_raw_handle() using let _ = in sys/pal/windows. 2024-07-10 21:03:25 -05:00
Chris Denton
34860a56f0 Update windows-bindgen to 0.58.0 2024-07-04 12:18:38 +00:00
Chris Denton
3606818010 Migrate more things to WinError 2024-06-09 14:29:28 +00:00
joboet
d6efeadb06 std: fix module references on Windows 2024-01-11 20:26:20 +01:00
joboet
99128b7e45 std: begin moving platform support modules into pal 2024-01-11 20:10:25 +01:00