-
Notifications
You must be signed in to change notification settings - Fork 12.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
treat &raw (const|mut) UNSAFE_STATIC
implied deref as safe
#125834
treat &raw (const|mut) UNSAFE_STATIC
implied deref as safe
#125834
Conversation
This comment has been minimized.
This comment has been minimized.
ah, miri. |
d871657
to
d570375
Compare
The Miri subtree was changed cc @rust-lang/miri |
@traviscross you tagged #125833 as T-lang, should I be r?ing lang on this or something |
Failed to set assignee to
|
@workingjubilee: On re-review, I've removed it. On first impression, it seemed potentially relevant to our recent discussions on various |
@traviscross Yeah, it doesn't seem irrelevant, in a sense, but it's not... like... Big Discussion Time for T-lang, just sort of an "FYI" footnote maybe. |
I am a bit confused... Why are extern statics treated differently? That does bot seem right to me.
|
man @RalfJung do you just like subscribe to all github PRs ever?
Hmm I think I had gotten a bit muddled after reading things a few times, and had over-indexed on this comment here: rust/compiler/rustc_mir_build/src/thir/cx/expr.rs Lines 942 to 943 in 20be84a
which is dated, it seems, because what I should have done is glance at the desugaring code (which I did read several times, but what is more important is...) rust/compiler/rustc_mir_build/src/thir/cx/expr.rs Lines 944 to 958 in 20be84a
and then glance behind rust/compiler/rustc_middle/src/ty/util.rs Lines 728 to 745 in 20be84a
@RalfJung Happy to change it so that it functions the same way for both |
Oh wait, you got tagged because of the miri diff, I see. |
Yes, exactly. ;) Touching Miri is enough to summon me.
Ah, I see. Certainly it'd be good to update the misleading comment. Now, whether this should be safe or not... I am not entirely sure. Raw pointers seem fine, but then there is the point that an extern static must be immutable -- should we have |
Hmm, note this doesn't commit to anything except that acquiring the address itself is safe: you can't "actually access" it (defining "actually access" as to read or write or call methods on it or whatever), as far as I know, because that would require another deref. It does imply that we have to be able to, at this point, answer some potentially-convoluted questions like "so uhh if we land weak linkage how does that... work... with this..." |
It feels clear, to me, that |
I don't see any reason |
Note that that this is in particular about extern statics.
|
Yes, the specific question for T-opsem here is "Should extern "C" {
static IMM_EXTERN: Type;
} have the same safety conditions for the static mut STATIC_MUT: Type = Type::new(); does, or should they be different?" Part of the problem is that (as I understand it):
|
As long as the computation of the address of the static is possible without UB (and I don't see how it wouldn't be, since it's a runtime constant to be determined by the linker), it should be safe to use |
Okay, yeah that makes sense. @workingjubilee mentioned weak linkage, which I know very little about -- is there something we need to be concerned about there? Also Cc @bjorn3 for more linker know-how. |
A weakly linked symbol that has not been resolved has the null address. A weakly linked symbol that has resolved has a non-null address. My understanding is that this can change at runtime considering e.g. dlopening things, so such a static may "move" in the address space. As I understand it, it is still safe to take the address, but it is a detail that seems worth mentioning. |
Is it the place itself that changes or its contents? The weak linkage statics I have seen in std have ptr type and their contents are whatever the symbol resolves to. So if that can change at runtime that would mean they have to be static mut, but otherwise nothing is special?
|
For all static with the
I recently made a PR to deny |
@bjorn3 Ah, that is interesting! Thank you for explaining, I didn't realize we were that tricksy about it. ( Part of why I was wondering exactly what was going on there... ) |
@bjorn3 thanks for explaining! extern "C" {
#[linkage = "extern_weak"]
static WEAK: Option<unsafe extern "C" fn($($t),*) -> $ret>;
} then that would mean that the value of |
Symbol resolution only happens once while loading the current DSO. If a symbol could be resolved by a future dlopen, this will only affect symbol resolution from that point onwards. The dynamic linker will not update existing weak references that have already been resolved to NULL. |
Rollup of 7 pull requests Successful merges: - rust-lang#124895 (Disallow hidden references to mutable static) - rust-lang#125834 (treat `&raw (const|mut) UNSAFE_STATIC` implied deref as safe) - rust-lang#126898 (Migrate `run-make/link-framework` to `rmake.rs`) - rust-lang#127962 (Cleanup compiletest dylib name calculation) - rust-lang#127990 (Migrate `lto-linkage-used-attr`, `no-duplicate-libs` and `pgo-gen-no-imp-symbols` `run-make` tests to rmake) - rust-lang#128067 (Get rid of `can_eq_shallow`) - rust-lang#128076 (Get rid of `InferCtxtExt` from `error_reporting::traits`) r? `@ghost` `@rustbot` modify labels: rollup
…iaskrgr Rollup of 6 pull requests Successful merges: - rust-lang#125834 (treat `&raw (const|mut) UNSAFE_STATIC` implied deref as safe) - rust-lang#127962 (Cleanup compiletest dylib name calculation) - rust-lang#128049 (Reword E0626 to mention static coroutine, add structured suggestion for adding `static`) - rust-lang#128067 (Get rid of `can_eq_shallow`) - rust-lang#128076 (Get rid of `InferCtxtExt` from `error_reporting::traits`) - rust-lang#128089 (std: Unsafe-wrap actually-universal platform code) r? `@ghost` `@rustbot` modify labels: rollup
Rollup merge of rust-lang#125834 - workingjubilee:weaken-thir-unsafeck-for-addr-of-static-mut, r=compiler-errors treat `&raw (const|mut) UNSAFE_STATIC` implied deref as safe Fixes rust-lang#125833 As reported in that and related issues, `static mut STATIC_MUT: T` is very often used in embedded code, and is in many ways equivalent to `static STATIC_CELL: SyncUnsafeCell<T>`. The Rust expression of `&raw mut STATIC_MUT` and `SyncUnsafeCell::get(&STATIC_CELL)` are approximately equal, and both evaluate to `*mut T`. The library function is safe because it has *declared itself* to be safe. However, the raw ref operator is unsafe because all uses of `static mut` are considered unsafe, even though the static's value is not used by this expression (unlike, for example, `&STATIC_MUT`). We can fix this unnatural difference by simply adding the proper exclusion for the safety check inside the THIR unsafeck, so that we do not declare it unsafe if it is not. While the primary concern here is `static mut`, this change is made for all instances of an "unsafe static", which includes a static declared inside `extern "abi" {}`. Hypothetically, we could go as far as generalizing this to all instances of `&raw (const|mut) *ptr`, but today we do not, as we have not actually considered the range of possible expressions that use a similar encoding. We do not even extend this to thread-local equivalents, because they have less clear semantics.
9cc3bc6add3 custom MIR: add support for tail calls 5674d1c07e5 Auto merge of rust-lang#128673 - matthiaskrgr:rollup-gtvpkm7, r=matthiaskrgr deb1d7576df Rollup merge of rust-lang#128619 - glandium:last_chunk, r=scottmcm 6449537a625 Rollup merge of rust-lang#128609 - swenson:smaller-faster-dragon, r=Amanieu acb2c303c36 Rollup merge of rust-lang#128026 - devnexen:available_parallelism_vxworks, r=Mark-Simulacrum 89fe6dfa6b9 Rollup merge of rust-lang#128309 - kmicklas:btreeset-cursor, r=Amanieu 313484bb62c Correct the const stabilization of `<[T]>::last_chunk` 22e026b048c Auto merge of rust-lang#128534 - bjorn3:split_stdlib_workspace, r=Mark-Simulacrum 18136032131 Rollup merge of rust-lang#128526 - tshepang:patch-1, r=Amanieu e8a1a4151ee Auto merge of rust-lang#128466 - sayantn:stdarch-update, r=tgross35 2adf9da42a3 Update stdarch dc85bdb60ce Chore: add `x86_amx_intrinsics` feature flag to `core/lib.rs` and remove `issue-120720-reduce-nan.rs` e88b04d135d Rollup merge of rust-lang#128551 - Konippi:refactor-backtrace-style-in-panic, r=tgross35 43a1e939ebe Rollup merge of rust-lang#128530 - scottmcm:repeat-n-unchecked, r=joboet 47df194eec6 Remove unnecessary constants from flt2dec dragon 0b5f1b8406f Auto merge of rust-lang#128404 - compiler-errors:revert-dead-code-changes, r=pnkfelix 35cd95f1edb Suppress new false-negatives that were masked by dead code analysis changes 9eb9fa6d7db Revert "Rollup merge of rust-lang#127107 - mu001999-contrib:dead/enhance-2, r=pnkfelix" 975dc19795e Rollup merge of rust-lang#128368 - nnethercote:rustfmt-tweaks, r=cuviper 0ee09fe87cf Rollup merge of rust-lang#128303 - NobodyXu:specialise-for-pipe, r=cuviper 1967a123728 Rollup merge of rust-lang#127586 - zachs18:more-must-use, r=cuviper fc53324c54d Rollup merge of rust-lang#126704 - sayantn:sha, r=Amanieu 74dd96fbea9 chore: refactor backtrace style in panic 0e4358de84e Auto merge of rust-lang#128528 - workingjubilee:you-dont-need-to-see-this-cpuid-move-along, r=Amanieu 9fa74abcf83 Move the standard library to a separate workspace e13d132801a Auto merge of rust-lang#128254 - Amanieu:orig-binary-search, r=tgross35 05d8d7c0765 Implement `UncheckedIterator` directly for `RepeatN` a5fa13e131b Rollup merge of rust-lang#128491 - c410-f3r:unlock-rfc-2011, r=workingjubilee 28e4d22aec0 Rollup merge of rust-lang#128453 - RalfJung:raw_eq, r=saethlin db770c6262d std: Remove has_cpuid 39aad04eaaf time.rs: remove "Basic usage text" 7df583ccfb3 Dogfood cb110515265 Add the `sha512`, `sm3` and `sm4` target features 86ea79fb335 Fix mutability in doc tests for `BTreeSet` cursors c7be27f744a Introduce `Cursor`/`CursorMut`/`CursorMutKey` thrichotomy for `BTreeSet` like map API 8835b0ffaef Fix some uses of "map" instead of "set" in `BTreeSet` cursor API docs 07f64a8e22c Share `UnorderedKeyError` with `BTReeMap` for set API f859e542648 Rollup merge of rust-lang#128499 - Konippi:refactor-backtrace-formatting, r=tgross35 fb966d2b046 Rollup merge of rust-lang#128497 - Bryanskiy:fix-dropck-doc, r=lcnr ab00ae63d7a Rollup merge of rust-lang#128433 - hermit-os:hermit-unsafe_op_in_unsafe_fn, r=joboet 2614bd2ae16 chore: refactor backtrace formatting a8a46595ff6 fix dropck documentation for `[T;0]` special-case 589c0a0e872 fix(os/hermit): `deny(unsafe_op_in_unsafe_fn)` 0260e47b16e fix(pal/hermit): `deny(unsafe_op_in_unsafe_fn)` 7bd6b11e0ad refactor(pal/hermit): make `ENV` a non-mutable static 32894e2b70e Rollup merge of rust-lang#128416 - maurer:remove-android-hack, r=tgross35 beb76c31275 Auto merge of rust-lang#128461 - matthiaskrgr:rollup-3dpp11g, r=matthiaskrgr 1e3976be11a Rollup merge of rust-lang#128162 - ChrisDenton:cleanup, r=joboet cde45b0a077 Rollup merge of rust-lang#127567 - joboet:once_wait, r=Amanieu 06076429681 Fix docs for OnceLock::get_mut_or_init da484175cbd raw_eq: using it on bytes with provenance is not UB (outside const-eval) cc6f37ff93f std: fix busy-waiting in `Once::wait_force`, add more tests 6fd82f18f54 std: implement the `once_wait` feature 0c56873d90f Remove unneeded `pub(crate)` 787a1f7a2e6 Rollup merge of rust-lang#128388 - beetrees:f16-f128-slightly-improve-windows-abi, r=tgross35 e3a4ed3406a Rollup merge of rust-lang#128387 - liigo:patch-14, r=tgross35 8b7f4ee6e3d refactor(pal/hermit): use default impl of `GlobalAlloc::alloc_zeroed` c3370198cca refactor(pal/hermit): return `!` to satisfy rust-analyzer 7aafdcf2fa2 android: Remove libstd hacks for unsupported Android APIs ba65c6c88c8 Move Windows implementation of anon pipe 176508ce960 Match LLVM ABI in `extern "C"` functions for `f128` on Windows 85e4ba09e56 Cleanup sys module to match house style ddff2b608a9 Auto merge of rust-lang#128083 - Mark-Simulacrum:bump-bootstrap, r=albertlarsan68 e4b0e6d427b Rewrite binary search implementation 556dc6028e1 More detailed note to deprecate ONCE_INIT 440ec835e8f Auto merge of rust-lang#128378 - matthiaskrgr:rollup-i3qz9uo, r=matthiaskrgr a50fe577e5d Auto merge of rust-lang#128250 - Amanieu:select_unpredictable, r=nikic 47f9d6175ee Rollup merge of rust-lang#128315 - zetanumbers:psvita-unsafe-in-unsafe, r=workingjubilee f70ce7f3e03 Auto merge of rust-lang#128234 - jcsp:retain-empty-case, r=tgross35 93b2f7c4e88 Insert some blank lines. db0222e3e80 Move a comment. cc96f3e2d19 Stabilize offset_of_nested 618fdd536b5 Auto merge of rust-lang#128334 - matthiaskrgr:rollup-nhxdt0c, r=matthiaskrgr e088cb1bcd7 Rollup merge of rust-lang#128333 - RalfJung:miri-sync, r=RalfJung 1ea0493512b Rollup merge of rust-lang#128307 - ojeda:unescaped_backticks, r=GuillaumeGomez 5d510999d8a Optimize empty case in Vec::retain f2bcbecd66e Auto merge of rust-lang#125016 - nicholasbishop:bishop-cb-112, r=tgross35 7a43febb9b1 Rollup merge of rust-lang#128310 - kmicklas:btree-map-peek-next-docs, r=tgross35 03e5078d0f6 Rollup merge of rust-lang#128055 - workingjubilee:deny-unsafe-ops-in-sys-personality-dwarf-eh, r=Amanieu f9befad9f51 Rollup merge of rust-lang#109174 - soerenmeier:cursor_fns, r=dtolnay ed7d02fcc9b Update compiler_builtins to 0.1.114 80254cd2f12 Warn on `rustdoc::unescaped_backticks` for `core/alloc/std/test/proc_macro` c8db8ead903 Remove spurious backticks detected by `rustdoc::unescaped_backticks` d1d4fb32943 Reformat `use` declarations. 3ec244feaeb Replace `io::Cursor::{remaining_slice, is_empty}` with `io::Cursor::{split, split_mut}` abc611ff511 step cfg(bootstrap) 78cd7797193 Update CURRENT_RUSTC_VERSION 70927dcd034 Add forbid(unsafe_op_in_unsafe_fn) 06a22c946e3 Rollup merge of rust-lang#128240 - mbrubeck:patch-3, r=joboet 604d6183e4d Rollup merge of rust-lang#128228 - slanterns:const_waker, r=dtolnay,oli-obk 2a70839bf8f Rollup merge of rust-lang#128103 - folkertdev:unsigned-int-is-multiple-of, r=Amanieu 058f1d3e3a7 Rollup merge of rust-lang#127765 - bitfield:fix_stdlib_doc_nits, r=dtolnay 9a6c84e26c1 fix: psvita's std code 5119266b79c Force LLVM to use CMOV for binary search d6b6e639162 stabilize const_waker 8e4f58a6520 Add missing periods on `BTreeMap` cursor `peek_next` docs 458b9b07517 Implement cursors for `BTreeSet` 02bf0de46e4 Enable `std::io::copy` specialisation for `std::pipe::{PipeReader, PipeWriter}` 1f83bf3100e Rollup merge of rust-lang#128282 - pitaj:nonzero_bitwise, r=workingjubilee 357ff7a0265 Rollup merge of rust-lang#128279 - slanterns:is_sorted, r=dtolnay fcbdcae5542 stabilize `is_sorted` c47f8bdd4f5 bitwise and bytewise methods on `NonZero` 4ea98d76cfd Rollup merge of rust-lang#128259 - sunshowers:msg-nosignal, r=Mark-Simulacrum d6f970a682d Rollup merge of rust-lang#125897 - RalfJung:from-ref, r=Amanieu 339f7567cf0 Auto merge of rust-lang#128255 - stepancheg:doc-shl, r=scottmcm 0d6a7dd333b Merge from rustc a66bc798ecd Auto merge of rust-lang#127946 - tgross35:fmt-builders-set-result, r=cuviper 2986bfed613 [illumos/solaris] set MSG_NOSIGNAL while writing to sockets 3e854937500 Document int.checked_shl(BITS - 1) 59f3fefb4cb Rollup merge of rust-lang#128235 - harryscholes:fix-iterator-filter-docs, r=tgross35 a2dbfd338e9 Rollup merge of rust-lang#124941 - Skgland:stabilize-const-int-from-str, r=dtolnay 5b78bae1394 Add links from `assert_eq!` docs to `debug_assert_eq!`, etc. a0f135d76af Always set `result` during `finish()` in debug builders bd11b3dcc6d Fix docs 22ce603b463 Auto merge of rust-lang#128165 - saethlin:optimize-clone-shims, r=compiler-errors fb7d2a81c80 Fix doc nits a1528206ab5 Rollup merge of rust-lang#128170 - saethlin:clone-fn, r=compiler-errors 0d636140614 Merge from rustc cb8f69be7aa Rollup merge of rust-lang#128211 - juliusl:pr/align-change-time, r=tgross35 ba0582bf6c4 Rollup merge of rust-lang#128150 - BoxyUwU:std_only_sized_const_params, r=workingjubilee 30cfde4b97a Rollup merge of rust-lang#127950 - nnethercote:rustfmt-skip-on-use-decls, r=cuviper 8488ae6d29f Make Clone::clone a lang item 1342ef157c3 fix: compilation issue w/ refactored type 92c0ad77d5d Let InstCombine remove Clone shims inside Clone shims c788415b025 Stop using `unsized_const_parameters` in core/std ef4d4a039fe Auto merge of rust-lang#128195 - matthiaskrgr:rollup-195dfdf, r=matthiaskrgr 5b6c1e1ad32 Rollup merge of rust-lang#128137 - GrigorenkoPV:cstr-derive, r=dtolnay aaeac06292c Rollup merge of rust-lang#127999 - ChrisDenton:arm32, r=Amanieu ea3a99f0fc7 Rollup merge of rust-lang#128158 - workingjubilee:unsafe-wrap-personality-gcc, r=ChrisDenton 886fe5b7f53 Rollup merge of rust-lang#127300 - biabbas:fix_connect_timeout, r=tgross35 b889a1defa7 CStr: derive PartialEq, Eq; add test for Ord 3a181105a62 In connect timeout, read readiness of socket for vxworks. Check pollhup or pollerr for refused connections in linux c4ee91f1305 Merge from rustc 244d8430769 std: update comments on gcc personality fn d252b6b475b std: unsafe-wrap gcc::rust_eh_personality and impl 09bda4f2acb Rollup merge of rust-lang#128135 - joboet:reduplicate_tls, r=tgross35 a4c88bc2fbb Rollup merge of rust-lang#128046 - GrigorenkoPV:90435, r=tgross35 2614d86fcb4 Rollup merge of rust-lang#126548 - rik86189:issue-88264-fix, r=tgross35 75a178fdfa7 Rollup merge of rust-lang#126042 - davidzeng0:master, r=Amanieu 1e118aec933 Rollup merge of rust-lang#128131 - ChrisDenton:stuff, r=workingjubilee cea2ca9af78 Rollup merge of rust-lang#128120 - compiler-errors:async-fn-name, r=oli-obk 92e3688370a Rollup merge of rust-lang#127733 - GrigorenkoPV:don't-forget, r=Amanieu 9b1cffdc1be Rollup merge of rust-lang#127480 - biabbas:vxworks, r=workingjubilee 2632261f008 Rollup merge of rust-lang#127252 - fitzgen:edge-cases-for-bitwise-operations, r=m-ou-se b0d74144ae4 Rollup merge of rust-lang#126152 - RalfJung:size_of_val_raw, r=saethlin 6d0b7146359 Improved clarity of documentation for std::fs::create_dir_all eb79e096922 std: use duplicate thread local state in tests 8456a976820 Forbid unsafe_op_in_unsafe_fn in sys/pal/windows 5a9fb1fc194 Import `core::ffi::c_void` in more places 16450f7b3e9 Merge from rustc 697c717b542 Add chroot unsupported implementation for VxWorks 6242470207d Rollup merge of rust-lang#128106 - hallfox:patch-1, r=ChrisDenton de086ea59d4 Rollup merge of rust-lang#128092 - ChrisDenton:wrappers, r=workingjubilee ccba33ca2dc Rollup merge of rust-lang#128043 - safinaskar:primitive, r=workingjubilee a069998a10d Rollup merge of rust-lang#127481 - a1phyr:pattern_gat, r=Amanieu bc7345c7866 Rollup merge of rust-lang#126770 - wr7:master, r=Amanieu 21f6b6516e2 Rollup merge of rust-lang#125962 - Coekjan:const-binary-heap, r=Amanieu eee5bbaed57 Auto merge of rust-lang#127153 - NobodyXu:pipe, r=ChrisDenton fd3a45fc3f9 Gate AsyncFn* under async_closure feature 0374ea22cab Add elem_offset and related methods 2b3eacb22c6 library/core/src/primitive.rs: small doc fix 45f80e6b25b Fix return type of FileAttr methods on AIX target 6cabb65c3fa add `is_multiple_of` for unsigned integer types 4c4a93a480e Initial implementation of anonymous_pipe 63d29970101 Update process vxworks, set default stack size of 256 Kib for vxworks. User can set the stack size using RUST_MIN_STACK, with min size of libc::PTHREAD_STACK_MIN(4kib) ee8604174b0 Rollup merge of rust-lang#128089 - workingjubilee:commonly-wrapped-to-make-safe, r=ChrisDenton ad9a52dcb35 Rollup merge of rust-lang#125834 - workingjubilee:weaken-thir-unsafeck-for-addr-of-static-mut, r=compiler-errors 642c69bbe40 Remove wrapper functions from c.rs de2a0378391 std: Unsafe-wrap backtrace code held in-common 155aef9d64b std: Unsafe-wrap alloc code held in-common bee0155d119 Cfg disable on_broken_pipe_flag_used() for vxworks 227b5afa55e Disable dirfd for vxworks, Return unsupported error from set_times and lchown for vxworks 22a6797af81 Allow unused unsafe for vxworks in read_at and write at 8be45a9e6a7 Docs for core::primitive: mention that "core" can be shadowed, too, so we should write "::core" c039ee8ff7e library: vary unsafety in bootstrapping for SEH 6765b971f38 std: unsafe-wrap personality::dwarf::eh 7ae76f0ee2d Rollup merge of rust-lang#128008 - weiznich:fix/121521, r=lcnr 323e962d2cd Rollup merge of rust-lang#127996 - ian-h-chamberlain:fix/horizon-warnings-unsafe-in-unsafe, r=tgross35 ae6187f170c Rollup merge of rust-lang#127415 - AljoschaMeyer:master, r=dtolnay d6a36f520f5 Use given allocator instad of Global d0bc9a0ec5d Start using `#[diagnostic::do_not_recommend]` in the standard library ba43261b233 Rollup merge of rust-lang#127583 - Nilstrieb:invalid-utf8, r=joboet 0727e53d393 Fix warnings when checking armv6k-nintendo-3ds bbe4da839fa Fix some `#[cfg_attr(not(doc), repr(..))]` 321dbf82a78 Deal with invalid UTF-8 from `gai_strerror` 6aa00e1eece std::thread: available_parallelism implementation for vxWorks proposal. 2fff48df757 Auto merge of rust-lang#127722 - BoxyUwU:new_adt_const_params_limitations, r=compiler-errors d7770e9cca2 Rollup merge of rust-lang#128005 - ChrisDenton:msvc-include, r=joboet 8fdee233d27 Rollup merge of rust-lang#127734 - ChrisDenton:netc, r=Mark-Simulacrum 3b2536ec206 Remove _tls_used hack 07dbb381321 Rollup merge of rust-lang#127873 - workingjubilee:forbid-unsafe-ops-for-kmc-solid, r=Amanieu bd262955725 Rollup merge of rust-lang#127843 - workingjubilee:break-up-big-ass-stack-overflow-fn, r=joboet 00b4f61ec49 Inject win arm32 shims into metadata generation 2b628674392 Rollup merge of rust-lang#127918 - ChrisDenton:thread-name-string, r=joboet a077eb1965c Rollup merge of rust-lang#123196 - Ayush1325:uefi-process, r=joboet eb09be43d35 std: forbid unwrapped unsafe in unsupported_backslash dcb98546d31 kmc-solid: forbid(unsafe_op_in_unsafe_fn) 845a2f78382 Auto merge of rust-lang#127982 - matthiaskrgr:rollup-nzyvphj, r=matthiaskrgr 00d6fc4cfef Rollup merge of rust-lang#127978 - nyurik:lib-refs, r=workingjubilee 4d8afcdd44b Avoid ref when using format! for perf 9f20a0f28ba Rollup merge of rust-lang#126199 - ivan-shrimp:nonzero_isqrt, r=tgross35 f06530cc0c3 Rollup merge of rust-lang#112328 - juliusl:pr/windows-add-change-time, r=ChrisDenton 8d5cf50b19d uefi: process: Fixes from PR c6cb67c41a3 uefi: process: Final Touchups afe1ef08b0e uefi: process: Add CommandArgs support ef6b1730a13 uefi: process: Add support for args 1991fe38c57 uefi: process Implement inherit 24a95828625 uefi: process: Add null protocol 36a0e1e01c8 uefi: process: Add stderr support b712e740ca4 uefi: process: Add support to capture stdout e6eeb4ee295 uefi: Add process f3b1c8a63e4 improve safety comment 93489988c77 add `NonZero<uN>::isqrt` edc4cdc351b Use `#[rustfmt::skip]` on some `use` groups to prevent reordering. 489f1ef8747 unix: acquire-load NEED_ALTSTACK 9e11e01d38f unix: Unsafe-wrap stack_overflow::{drop,make}_handler 72c7444faf0 unix: Unsafe-wrap stack_overflow::cleanup 33a32f20bfd unix: lift init of sigaltstack before sigaction 9fb6e4958f7 unix: Unsafe-wrap stack_overflow::signal_handler c99ebd411b7 Rollup merge of rust-lang#127594 - c6c7:fuchsia-status-code-match-arm, r=tmandry 83782615519 Move ThreadName conversions to &cstr/&str 68e23910a05 Style change 16bce8a458a Make `Thread::new_inner` a safe function d1d98933f8f Rollup merge of rust-lang#127748 - scottmcm:option_len, r=joboet b0c85badd9f Rollup merge of rust-lang#124881 - Sp00ph:reentrant_lock_tid, r=joboet 7e218501a06 Update `ReentrantLock` implementation, add `CURRENT_ID` thread local. c10a929ac5e Safely enforce thread name requirements cc4ed954619 Rollup merge of rust-lang#127077 - tbu-:pr_doc_fd_to_owned, r=workingjubilee 37d7bff7bb1 Rollup merge of rust-lang#127861 - Kriskras99:patch-1, r=tgross35 3d50720567e Rollup merge of rust-lang#127859 - RalfJung:ptr-dyn-metadata, r=scottmcm 1f3311b800b Rollup merge of rust-lang#127845 - workingjubilee:actually-break-up-big-ass-stack-overflow-fn, r=joboet 557859328cb Auto merge of rust-lang#127865 - matthiaskrgr:rollup-8m49dlg, r=matthiaskrgr 54728b12a9f feat: adding ext that returns change_time for Windows b164bab985b Auto merge of rust-lang#125942 - timokroeger:windows-once-futex, r=ChrisDenton 0eda3a36123 Rollup merge of rust-lang#127337 - celinval:intrinsics-fallback, r=oli-obk ed3c6d115e4 Mention how you can go from `BorrowedFd` to `OwnedFd` and back 455bd5705fb Make language around `ToOwned` for `BorrowedFd` more precise ab7a0d4d6a5 Document the column numbers for the dbg! macro 89cd225caaa ptr::metadata: update comment on vtable_ptr work-around 51e54a4f5de ptr::metadata: avoid references to extern types be0c06bc63e Split part of `adt_const_params` into `unsized_const_params` 857ed93c04e Forbid `!Sized` types and references aedc16cadfe unix: unsafe-wrap install_main_guard_default 4db3aa1e628 unix: clean up install_main_guard_freebsd d167f00072d unix: stack_start_aligned is a safe fn 27b79e6e1f7 unix: split stack_overflow::install_main_guard by os d50143fddb9 Update name of Windows abort constant to match platform documentation cbaa8317349 Add match arm for Fuchsia status code upon an abort in a test f15715f3e48 lib: replace some `mem::forget`'s with `ManuallyDrop` 9bbf09d3d07 Windows: move BSD socket shims to netc d76c965affa Remove generic lifetime parameter of trait `Pattern` ad3db57a529 Use Option's discriminant as its size hint 3b86ae3449f Explicitly ignore `into_raw_handle()` using `let _ =` in sys/pal/windows. 1cb5354fc6c Add `must_use` to IntoRawFd/IntoRawSocket/IntoRawHandle's methods. 697377abf32 Clarify/add `must_use` messages for more `into_raw*` functions of `alloc` types. a7bec568626 size_of_val_raw: for length 0 this is safe to call 39c4daabd50 Reset sigpipe not supported for vxworks ca537d2cb33 Fix them doc examples some more be23cef3a42 Fix doc examples 8d0199656c4 Run formatter on alloc/src/boxed.rs c3b602af8ce Add missing try_new_uninit_slice_in and try_new_zeroed_slice_in 54875740eef Document safety of a few intrinsics 87fcd2f5c73 Move a few intrinsics to use Rust abi 6b549baafd8 mark `can_not_overflow` as `#[rustc_const_stable(...)]` 259c058b9f7 stabilize `const_int_from_str` 538fe8146ef Add edge-case examples to `{count,leading,trailing}_{ones,zeros}` methods 5fc66ddb6d3 Implement `unsigned_signed_diff` dbbb4ab477a less garbage, more examples 4952644d73e update tracking issue for `const_binary_heap_new_in` 33389b0e051 more explicitly state the basic rules of working with the obtained raw pointers 395ad9f8afc Windows: Use futex implementation for `Once` 7953644ecec from_ref, from_mut: clarify domain of quantification git-subtree-dir: library git-subtree-split: 9cc3bc6add336a695c0570fb8655164ac96cc365
9cc3bc6add3 custom MIR: add support for tail calls 5674d1c07e5 Auto merge of rust-lang#128673 - matthiaskrgr:rollup-gtvpkm7, r=matthiaskrgr deb1d7576df Rollup merge of rust-lang#128619 - glandium:last_chunk, r=scottmcm 6449537a625 Rollup merge of rust-lang#128609 - swenson:smaller-faster-dragon, r=Amanieu acb2c303c36 Rollup merge of rust-lang#128026 - devnexen:available_parallelism_vxworks, r=Mark-Simulacrum 89fe6dfa6b9 Rollup merge of rust-lang#128309 - kmicklas:btreeset-cursor, r=Amanieu 313484bb62c Correct the const stabilization of `<[T]>::last_chunk` 22e026b048c Auto merge of rust-lang#128534 - bjorn3:split_stdlib_workspace, r=Mark-Simulacrum 18136032131 Rollup merge of rust-lang#128526 - tshepang:patch-1, r=Amanieu e8a1a4151ee Auto merge of rust-lang#128466 - sayantn:stdarch-update, r=tgross35 2adf9da42a3 Update stdarch dc85bdb60ce Chore: add `x86_amx_intrinsics` feature flag to `core/lib.rs` and remove `issue-120720-reduce-nan.rs` e88b04d135d Rollup merge of rust-lang#128551 - Konippi:refactor-backtrace-style-in-panic, r=tgross35 43a1e939ebe Rollup merge of rust-lang#128530 - scottmcm:repeat-n-unchecked, r=joboet 47df194eec6 Remove unnecessary constants from flt2dec dragon 0b5f1b8406f Auto merge of rust-lang#128404 - compiler-errors:revert-dead-code-changes, r=pnkfelix 35cd95f1edb Suppress new false-negatives that were masked by dead code analysis changes 9eb9fa6d7db Revert "Rollup merge of rust-lang#127107 - mu001999-contrib:dead/enhance-2, r=pnkfelix" 975dc19795e Rollup merge of rust-lang#128368 - nnethercote:rustfmt-tweaks, r=cuviper 0ee09fe87cf Rollup merge of rust-lang#128303 - NobodyXu:specialise-for-pipe, r=cuviper 1967a123728 Rollup merge of rust-lang#127586 - zachs18:more-must-use, r=cuviper fc53324c54d Rollup merge of rust-lang#126704 - sayantn:sha, r=Amanieu 74dd96fbea9 chore: refactor backtrace style in panic 0e4358de84e Auto merge of rust-lang#128528 - workingjubilee:you-dont-need-to-see-this-cpuid-move-along, r=Amanieu 9fa74abcf83 Move the standard library to a separate workspace e13d132801a Auto merge of rust-lang#128254 - Amanieu:orig-binary-search, r=tgross35 05d8d7c0765 Implement `UncheckedIterator` directly for `RepeatN` a5fa13e131b Rollup merge of rust-lang#128491 - c410-f3r:unlock-rfc-2011, r=workingjubilee 28e4d22aec0 Rollup merge of rust-lang#128453 - RalfJung:raw_eq, r=saethlin db770c6262d std: Remove has_cpuid 39aad04eaaf time.rs: remove "Basic usage text" 7df583ccfb3 Dogfood cb110515265 Add the `sha512`, `sm3` and `sm4` target features 86ea79fb335 Fix mutability in doc tests for `BTreeSet` cursors c7be27f744a Introduce `Cursor`/`CursorMut`/`CursorMutKey` thrichotomy for `BTreeSet` like map API 8835b0ffaef Fix some uses of "map" instead of "set" in `BTreeSet` cursor API docs 07f64a8e22c Share `UnorderedKeyError` with `BTReeMap` for set API f859e542648 Rollup merge of rust-lang#128499 - Konippi:refactor-backtrace-formatting, r=tgross35 fb966d2b046 Rollup merge of rust-lang#128497 - Bryanskiy:fix-dropck-doc, r=lcnr ab00ae63d7a Rollup merge of rust-lang#128433 - hermit-os:hermit-unsafe_op_in_unsafe_fn, r=joboet 2614bd2ae16 chore: refactor backtrace formatting a8a46595ff6 fix dropck documentation for `[T;0]` special-case 589c0a0e872 fix(os/hermit): `deny(unsafe_op_in_unsafe_fn)` 0260e47b16e fix(pal/hermit): `deny(unsafe_op_in_unsafe_fn)` 7bd6b11e0ad refactor(pal/hermit): make `ENV` a non-mutable static 32894e2b70e Rollup merge of rust-lang#128416 - maurer:remove-android-hack, r=tgross35 beb76c31275 Auto merge of rust-lang#128461 - matthiaskrgr:rollup-3dpp11g, r=matthiaskrgr 1e3976be11a Rollup merge of rust-lang#128162 - ChrisDenton:cleanup, r=joboet cde45b0a077 Rollup merge of rust-lang#127567 - joboet:once_wait, r=Amanieu 06076429681 Fix docs for OnceLock::get_mut_or_init da484175cbd raw_eq: using it on bytes with provenance is not UB (outside const-eval) cc6f37ff93f std: fix busy-waiting in `Once::wait_force`, add more tests 6fd82f18f54 std: implement the `once_wait` feature 0c56873d90f Remove unneeded `pub(crate)` 787a1f7a2e6 Rollup merge of rust-lang#128388 - beetrees:f16-f128-slightly-improve-windows-abi, r=tgross35 e3a4ed3406a Rollup merge of rust-lang#128387 - liigo:patch-14, r=tgross35 8b7f4ee6e3d refactor(pal/hermit): use default impl of `GlobalAlloc::alloc_zeroed` c3370198cca refactor(pal/hermit): return `!` to satisfy rust-analyzer 7aafdcf2fa2 android: Remove libstd hacks for unsupported Android APIs ba65c6c88c8 Move Windows implementation of anon pipe 176508ce960 Match LLVM ABI in `extern "C"` functions for `f128` on Windows 85e4ba09e56 Cleanup sys module to match house style ddff2b608a9 Auto merge of rust-lang#128083 - Mark-Simulacrum:bump-bootstrap, r=albertlarsan68 e4b0e6d427b Rewrite binary search implementation 556dc6028e1 More detailed note to deprecate ONCE_INIT 440ec835e8f Auto merge of rust-lang#128378 - matthiaskrgr:rollup-i3qz9uo, r=matthiaskrgr a50fe577e5d Auto merge of rust-lang#128250 - Amanieu:select_unpredictable, r=nikic 47f9d6175ee Rollup merge of rust-lang#128315 - zetanumbers:psvita-unsafe-in-unsafe, r=workingjubilee f70ce7f3e03 Auto merge of rust-lang#128234 - jcsp:retain-empty-case, r=tgross35 93b2f7c4e88 Insert some blank lines. db0222e3e80 Move a comment. cc96f3e2d19 Stabilize offset_of_nested 618fdd536b5 Auto merge of rust-lang#128334 - matthiaskrgr:rollup-nhxdt0c, r=matthiaskrgr e088cb1bcd7 Rollup merge of rust-lang#128333 - RalfJung:miri-sync, r=RalfJung 1ea0493512b Rollup merge of rust-lang#128307 - ojeda:unescaped_backticks, r=GuillaumeGomez 5d510999d8a Optimize empty case in Vec::retain f2bcbecd66e Auto merge of rust-lang#125016 - nicholasbishop:bishop-cb-112, r=tgross35 7a43febb9b1 Rollup merge of rust-lang#128310 - kmicklas:btree-map-peek-next-docs, r=tgross35 03e5078d0f6 Rollup merge of rust-lang#128055 - workingjubilee:deny-unsafe-ops-in-sys-personality-dwarf-eh, r=Amanieu f9befad9f51 Rollup merge of rust-lang#109174 - soerenmeier:cursor_fns, r=dtolnay ed7d02fcc9b Update compiler_builtins to 0.1.114 80254cd2f12 Warn on `rustdoc::unescaped_backticks` for `core/alloc/std/test/proc_macro` c8db8ead903 Remove spurious backticks detected by `rustdoc::unescaped_backticks` d1d4fb32943 Reformat `use` declarations. 3ec244feaeb Replace `io::Cursor::{remaining_slice, is_empty}` with `io::Cursor::{split, split_mut}` abc611ff511 step cfg(bootstrap) 78cd7797193 Update CURRENT_RUSTC_VERSION 70927dcd034 Add forbid(unsafe_op_in_unsafe_fn) 06a22c946e3 Rollup merge of rust-lang#128240 - mbrubeck:patch-3, r=joboet 604d6183e4d Rollup merge of rust-lang#128228 - slanterns:const_waker, r=dtolnay,oli-obk 2a70839bf8f Rollup merge of rust-lang#128103 - folkertdev:unsigned-int-is-multiple-of, r=Amanieu 058f1d3e3a7 Rollup merge of rust-lang#127765 - bitfield:fix_stdlib_doc_nits, r=dtolnay 9a6c84e26c1 fix: psvita's std code 5119266b79c Force LLVM to use CMOV for binary search d6b6e639162 stabilize const_waker 8e4f58a6520 Add missing periods on `BTreeMap` cursor `peek_next` docs 458b9b07517 Implement cursors for `BTreeSet` 02bf0de46e4 Enable `std::io::copy` specialisation for `std::pipe::{PipeReader, PipeWriter}` 1f83bf3100e Rollup merge of rust-lang#128282 - pitaj:nonzero_bitwise, r=workingjubilee 357ff7a0265 Rollup merge of rust-lang#128279 - slanterns:is_sorted, r=dtolnay fcbdcae5542 stabilize `is_sorted` c47f8bdd4f5 bitwise and bytewise methods on `NonZero` 4ea98d76cfd Rollup merge of rust-lang#128259 - sunshowers:msg-nosignal, r=Mark-Simulacrum d6f970a682d Rollup merge of rust-lang#125897 - RalfJung:from-ref, r=Amanieu 339f7567cf0 Auto merge of rust-lang#128255 - stepancheg:doc-shl, r=scottmcm 0d6a7dd333b Merge from rustc a66bc798ecd Auto merge of rust-lang#127946 - tgross35:fmt-builders-set-result, r=cuviper 2986bfed613 [illumos/solaris] set MSG_NOSIGNAL while writing to sockets 3e854937500 Document int.checked_shl(BITS - 1) 59f3fefb4cb Rollup merge of rust-lang#128235 - harryscholes:fix-iterator-filter-docs, r=tgross35 a2dbfd338e9 Rollup merge of rust-lang#124941 - Skgland:stabilize-const-int-from-str, r=dtolnay 5b78bae1394 Add links from `assert_eq!` docs to `debug_assert_eq!`, etc. a0f135d76af Always set `result` during `finish()` in debug builders bd11b3dcc6d Fix docs 22ce603b463 Auto merge of rust-lang#128165 - saethlin:optimize-clone-shims, r=compiler-errors fb7d2a81c80 Fix doc nits a1528206ab5 Rollup merge of rust-lang#128170 - saethlin:clone-fn, r=compiler-errors 0d636140614 Merge from rustc cb8f69be7aa Rollup merge of rust-lang#128211 - juliusl:pr/align-change-time, r=tgross35 ba0582bf6c4 Rollup merge of rust-lang#128150 - BoxyUwU:std_only_sized_const_params, r=workingjubilee 30cfde4b97a Rollup merge of rust-lang#127950 - nnethercote:rustfmt-skip-on-use-decls, r=cuviper 8488ae6d29f Make Clone::clone a lang item 1342ef157c3 fix: compilation issue w/ refactored type 92c0ad77d5d Let InstCombine remove Clone shims inside Clone shims c788415b025 Stop using `unsized_const_parameters` in core/std ef4d4a039fe Auto merge of rust-lang#128195 - matthiaskrgr:rollup-195dfdf, r=matthiaskrgr 5b6c1e1ad32 Rollup merge of rust-lang#128137 - GrigorenkoPV:cstr-derive, r=dtolnay aaeac06292c Rollup merge of rust-lang#127999 - ChrisDenton:arm32, r=Amanieu ea3a99f0fc7 Rollup merge of rust-lang#128158 - workingjubilee:unsafe-wrap-personality-gcc, r=ChrisDenton 886fe5b7f53 Rollup merge of rust-lang#127300 - biabbas:fix_connect_timeout, r=tgross35 b889a1defa7 CStr: derive PartialEq, Eq; add test for Ord 3a181105a62 In connect timeout, read readiness of socket for vxworks. Check pollhup or pollerr for refused connections in linux c4ee91f1305 Merge from rustc 244d8430769 std: update comments on gcc personality fn d252b6b475b std: unsafe-wrap gcc::rust_eh_personality and impl 09bda4f2acb Rollup merge of rust-lang#128135 - joboet:reduplicate_tls, r=tgross35 a4c88bc2fbb Rollup merge of rust-lang#128046 - GrigorenkoPV:90435, r=tgross35 2614d86fcb4 Rollup merge of rust-lang#126548 - rik86189:issue-88264-fix, r=tgross35 75a178fdfa7 Rollup merge of rust-lang#126042 - davidzeng0:master, r=Amanieu 1e118aec933 Rollup merge of rust-lang#128131 - ChrisDenton:stuff, r=workingjubilee cea2ca9af78 Rollup merge of rust-lang#128120 - compiler-errors:async-fn-name, r=oli-obk 92e3688370a Rollup merge of rust-lang#127733 - GrigorenkoPV:don't-forget, r=Amanieu 9b1cffdc1be Rollup merge of rust-lang#127480 - biabbas:vxworks, r=workingjubilee 2632261f008 Rollup merge of rust-lang#127252 - fitzgen:edge-cases-for-bitwise-operations, r=m-ou-se b0d74144ae4 Rollup merge of rust-lang#126152 - RalfJung:size_of_val_raw, r=saethlin 6d0b7146359 Improved clarity of documentation for std::fs::create_dir_all eb79e096922 std: use duplicate thread local state in tests 8456a976820 Forbid unsafe_op_in_unsafe_fn in sys/pal/windows 5a9fb1fc194 Import `core::ffi::c_void` in more places 16450f7b3e9 Merge from rustc 697c717b542 Add chroot unsupported implementation for VxWorks 6242470207d Rollup merge of rust-lang#128106 - hallfox:patch-1, r=ChrisDenton de086ea59d4 Rollup merge of rust-lang#128092 - ChrisDenton:wrappers, r=workingjubilee ccba33ca2dc Rollup merge of rust-lang#128043 - safinaskar:primitive, r=workingjubilee a069998a10d Rollup merge of rust-lang#127481 - a1phyr:pattern_gat, r=Amanieu bc7345c7866 Rollup merge of rust-lang#126770 - wr7:master, r=Amanieu 21f6b6516e2 Rollup merge of rust-lang#125962 - Coekjan:const-binary-heap, r=Amanieu eee5bbaed57 Auto merge of rust-lang#127153 - NobodyXu:pipe, r=ChrisDenton fd3a45fc3f9 Gate AsyncFn* under async_closure feature 0374ea22cab Add elem_offset and related methods 2b3eacb22c6 library/core/src/primitive.rs: small doc fix 45f80e6b25b Fix return type of FileAttr methods on AIX target 6cabb65c3fa add `is_multiple_of` for unsigned integer types 4c4a93a480e Initial implementation of anonymous_pipe 63d29970101 Update process vxworks, set default stack size of 256 Kib for vxworks. User can set the stack size using RUST_MIN_STACK, with min size of libc::PTHREAD_STACK_MIN(4kib) ee8604174b0 Rollup merge of rust-lang#128089 - workingjubilee:commonly-wrapped-to-make-safe, r=ChrisDenton ad9a52dcb35 Rollup merge of rust-lang#125834 - workingjubilee:weaken-thir-unsafeck-for-addr-of-static-mut, r=compiler-errors 642c69bbe40 Remove wrapper functions from c.rs de2a0378391 std: Unsafe-wrap backtrace code held in-common 155aef9d64b std: Unsafe-wrap alloc code held in-common bee0155d119 Cfg disable on_broken_pipe_flag_used() for vxworks 227b5afa55e Disable dirfd for vxworks, Return unsupported error from set_times and lchown for vxworks 22a6797af81 Allow unused unsafe for vxworks in read_at and write at 8be45a9e6a7 Docs for core::primitive: mention that "core" can be shadowed, too, so we should write "::core" c039ee8ff7e library: vary unsafety in bootstrapping for SEH 6765b971f38 std: unsafe-wrap personality::dwarf::eh 7ae76f0ee2d Rollup merge of rust-lang#128008 - weiznich:fix/121521, r=lcnr 323e962d2cd Rollup merge of rust-lang#127996 - ian-h-chamberlain:fix/horizon-warnings-unsafe-in-unsafe, r=tgross35 ae6187f170c Rollup merge of rust-lang#127415 - AljoschaMeyer:master, r=dtolnay d6a36f520f5 Use given allocator instad of Global d0bc9a0ec5d Start using `#[diagnostic::do_not_recommend]` in the standard library ba43261b233 Rollup merge of rust-lang#127583 - Nilstrieb:invalid-utf8, r=joboet 0727e53d393 Fix warnings when checking armv6k-nintendo-3ds bbe4da839fa Fix some `#[cfg_attr(not(doc), repr(..))]` 321dbf82a78 Deal with invalid UTF-8 from `gai_strerror` 6aa00e1eece std::thread: available_parallelism implementation for vxWorks proposal. 2fff48df757 Auto merge of rust-lang#127722 - BoxyUwU:new_adt_const_params_limitations, r=compiler-errors d7770e9cca2 Rollup merge of rust-lang#128005 - ChrisDenton:msvc-include, r=joboet 8fdee233d27 Rollup merge of rust-lang#127734 - ChrisDenton:netc, r=Mark-Simulacrum 3b2536ec206 Remove _tls_used hack 07dbb381321 Rollup merge of rust-lang#127873 - workingjubilee:forbid-unsafe-ops-for-kmc-solid, r=Amanieu bd262955725 Rollup merge of rust-lang#127843 - workingjubilee:break-up-big-ass-stack-overflow-fn, r=joboet 00b4f61ec49 Inject win arm32 shims into metadata generation 2b628674392 Rollup merge of rust-lang#127918 - ChrisDenton:thread-name-string, r=joboet a077eb1965c Rollup merge of rust-lang#123196 - Ayush1325:uefi-process, r=joboet eb09be43d35 std: forbid unwrapped unsafe in unsupported_backslash dcb98546d31 kmc-solid: forbid(unsafe_op_in_unsafe_fn) 845a2f78382 Auto merge of rust-lang#127982 - matthiaskrgr:rollup-nzyvphj, r=matthiaskrgr 00d6fc4cfef Rollup merge of rust-lang#127978 - nyurik:lib-refs, r=workingjubilee 4d8afcdd44b Avoid ref when using format! for perf 9f20a0f28ba Rollup merge of rust-lang#126199 - ivan-shrimp:nonzero_isqrt, r=tgross35 f06530cc0c3 Rollup merge of rust-lang#112328 - juliusl:pr/windows-add-change-time, r=ChrisDenton 8d5cf50b19d uefi: process: Fixes from PR c6cb67c41a3 uefi: process: Final Touchups afe1ef08b0e uefi: process: Add CommandArgs support ef6b1730a13 uefi: process: Add support for args 1991fe38c57 uefi: process Implement inherit 24a95828625 uefi: process: Add null protocol 36a0e1e01c8 uefi: process: Add stderr support b712e740ca4 uefi: process: Add support to capture stdout e6eeb4ee295 uefi: Add process f3b1c8a63e4 improve safety comment 93489988c77 add `NonZero<uN>::isqrt` edc4cdc351b Use `#[rustfmt::skip]` on some `use` groups to prevent reordering. 489f1ef8747 unix: acquire-load NEED_ALTSTACK 9e11e01d38f unix: Unsafe-wrap stack_overflow::{drop,make}_handler 72c7444faf0 unix: Unsafe-wrap stack_overflow::cleanup 33a32f20bfd unix: lift init of sigaltstack before sigaction 9fb6e4958f7 unix: Unsafe-wrap stack_overflow::signal_handler c99ebd411b7 Rollup merge of rust-lang#127594 - c6c7:fuchsia-status-code-match-arm, r=tmandry 83782615519 Move ThreadName conversions to &cstr/&str 68e23910a05 Style change 16bce8a458a Make `Thread::new_inner` a safe function d1d98933f8f Rollup merge of rust-lang#127748 - scottmcm:option_len, r=joboet b0c85badd9f Rollup merge of rust-lang#124881 - Sp00ph:reentrant_lock_tid, r=joboet 7e218501a06 Update `ReentrantLock` implementation, add `CURRENT_ID` thread local. c10a929ac5e Safely enforce thread name requirements cc4ed954619 Rollup merge of rust-lang#127077 - tbu-:pr_doc_fd_to_owned, r=workingjubilee 37d7bff7bb1 Rollup merge of rust-lang#127861 - Kriskras99:patch-1, r=tgross35 3d50720567e Rollup merge of rust-lang#127859 - RalfJung:ptr-dyn-metadata, r=scottmcm 1f3311b800b Rollup merge of rust-lang#127845 - workingjubilee:actually-break-up-big-ass-stack-overflow-fn, r=joboet 557859328cb Auto merge of rust-lang#127865 - matthiaskrgr:rollup-8m49dlg, r=matthiaskrgr 54728b12a9f feat: adding ext that returns change_time for Windows b164bab985b Auto merge of rust-lang#125942 - timokroeger:windows-once-futex, r=ChrisDenton 0eda3a36123 Rollup merge of rust-lang#127337 - celinval:intrinsics-fallback, r=oli-obk ed3c6d115e4 Mention how you can go from `BorrowedFd` to `OwnedFd` and back 455bd5705fb Make language around `ToOwned` for `BorrowedFd` more precise ab7a0d4d6a5 Document the column numbers for the dbg! macro 89cd225caaa ptr::metadata: update comment on vtable_ptr work-around 51e54a4f5de ptr::metadata: avoid references to extern types be0c06bc63e Split part of `adt_const_params` into `unsized_const_params` 857ed93c04e Forbid `!Sized` types and references aedc16cadfe unix: unsafe-wrap install_main_guard_default 4db3aa1e628 unix: clean up install_main_guard_freebsd d167f00072d unix: stack_start_aligned is a safe fn 27b79e6e1f7 unix: split stack_overflow::install_main_guard by os d50143fddb9 Update name of Windows abort constant to match platform documentation cbaa8317349 Add match arm for Fuchsia status code upon an abort in a test f15715f3e48 lib: replace some `mem::forget`'s with `ManuallyDrop` 9bbf09d3d07 Windows: move BSD socket shims to netc d76c965affa Remove generic lifetime parameter of trait `Pattern` ad3db57a529 Use Option's discriminant as its size hint 3b86ae3449f Explicitly ignore `into_raw_handle()` using `let _ =` in sys/pal/windows. 1cb5354fc6c Add `must_use` to IntoRawFd/IntoRawSocket/IntoRawHandle's methods. 697377abf32 Clarify/add `must_use` messages for more `into_raw*` functions of `alloc` types. a7bec568626 size_of_val_raw: for length 0 this is safe to call 39c4daabd50 Reset sigpipe not supported for vxworks ca537d2cb33 Fix them doc examples some more be23cef3a42 Fix doc examples 8d0199656c4 Run formatter on alloc/src/boxed.rs c3b602af8ce Add missing try_new_uninit_slice_in and try_new_zeroed_slice_in 54875740eef Document safety of a few intrinsics 87fcd2f5c73 Move a few intrinsics to use Rust abi 6b549baafd8 mark `can_not_overflow` as `#[rustc_const_stable(...)]` 259c058b9f7 stabilize `const_int_from_str` 538fe8146ef Add edge-case examples to `{count,leading,trailing}_{ones,zeros}` methods 5fc66ddb6d3 Implement `unsigned_signed_diff` dbbb4ab477a less garbage, more examples 4952644d73e update tracking issue for `const_binary_heap_new_in` 33389b0e051 more explicitly state the basic rules of working with the obtained raw pointers 395ad9f8afc Windows: Use futex implementation for `Once` 7953644ecec from_ref, from_mut: clarify domain of quantification git-subtree-dir: library git-subtree-split: 9cc3bc6add336a695c0570fb8655164ac96cc365
The compiler no longer does as well; see rust-lang/rust#125834.
Do not report missing unsafe on `addr_of[_mut]!(EXTERN_OR_MUT_STATIC)` The compiler no longer does as well; see rust-lang/rust#125834. Also require unsafe when accessing `extern` `static` (other than by `addr_of!()`). Fixes #17978.
The compiler no longer does as well; see rust-lang#125834.
…=Veykril Do not report missing unsafe on `addr_of[_mut]!(EXTERN_OR_MUT_STATIC)` The compiler no longer does as well; see rust-lang#125834. Also require unsafe when accessing `extern` `static` (other than by `addr_of!()`). Fixes rust-lang#17978.
Since rust 1.82.0, addr_of is no longer unsafe: rust-lang/rust#125834 Just removing the unsafe statement would break builds with older versions of rust. Instead, allow the unused_unsafe lint.
Since rust 1.82.0, addr_of is no longer unsafe: rust-lang/rust#125834 Just removing the unsafe statement would break builds with older versions of rust. Instead, allow the unused_unsafe lint.
This MR contains the following updates: | Package | Update | Change | |---|---|---| | [rust](https://github.com/rust-lang/rust) | minor | `1.81.0` -> `1.82.0` | MR created with the help of [el-capitano/tools/renovate-bot](https://gitlab.com/el-capitano/tools/renovate-bot). **Proposed changes to behavior should be submitted there as MRs.** --- ### Release Notes <details> <summary>rust-lang/rust (rust)</summary> ### [`v1.82.0`](https://github.com/rust-lang/rust/blob/HEAD/RELEASES.md#Version-1820-2024-10-17) [Compare Source](rust-lang/rust@1.81.0...1.82.0) \========================== <a id="1.82.0-Language"></a> ## Language - [Don't make statement nonterminals match pattern nonterminals](rust-lang/rust#120221) - [Patterns matching empty types can now be omitted in common cases](rust-lang/rust#122792) - [Enforce supertrait outlives obligations when using trait impls](rust-lang/rust#124336) - [`addr_of(_mut)!` macros and the newly stabilized `&raw (const|mut)` are now safe to use with all static items](rust-lang/rust#125834) - [size_of_val_raw: for length 0 this is safe to call](rust-lang/rust#126152) - [Reorder trait bound modifiers *after* `for<...>` binder in trait bounds](rust-lang/rust#127054) - [Stabilize opaque type precise capturing (RFC 3617)](rust-lang/rust#127672) - [Stabilize `&raw const` and `&raw mut` operators (RFC 2582)](rust-lang/rust#127679) - [Stabilize unsafe extern blocks (RFC 3484)](rust-lang/rust#127921) - [Stabilize nested field access in `offset_of!`](rust-lang/rust#128284) - [Do not require `T` to be live when dropping `[T; 0]`](rust-lang/rust#128438) - [Stabilize `const` operands in inline assembly](rust-lang/rust#128570) - [Stabilize floating-point arithmetic in `const fn`](rust-lang/rust#128596) - [Stabilize explicit opt-in to unsafe attributes](rust-lang/rust#128771) - [Document NaN bit patterns guarantees](rust-lang/rust#129559) <a id="1.82.0-Compiler"></a> ## Compiler - [Promote riscv64gc-unknown-linux-musl to tier 2](rust-lang/rust#122049) - [Promote Mac Catalyst targets `aarch64-apple-ios-macabi` and `x86_64-apple-ios-macabi` to Tier 2, and ship them with rustup](rust-lang/rust#126450) - [Add tier 3 NuttX based targets for RISC-V and ARM](rust-lang/rust#127755) - [Add tier 3 powerpc-unknown-linux-muslspe target](rust-lang/rust#127905) - [Improved diagnostics to explain why a pattern is unreachable](rust-lang/rust#128034) - [The compiler now triggers the unreachable code warning properly for async functions that don't return/are `-> !`](rust-lang/rust#128443) - [Promote `aarch64-apple-darwin` to Tier 1](rust-lang/rust#128592) - [Add Trusty OS target `aarch64-unknown-trusty` and `armv7-unknown-trusty` as tier 3 targets](rust-lang/rust#129490) - [Promote `wasm32-wasip2` to Tier 2.](rust-lang/rust#126967) <a id="1.82.0-Libraries"></a> ## Libraries - [Generalize `{Rc,Arc}::make_mut()` to `Path`, `OsStr`, and `CStr`.](rust-lang/rust#126877) <a id="1.82.0-Stabilized-APIs"></a> ## Stabilized APIs - [`std::thread::Builder::spawn_unchecked`](https://doc.rust-lang.org/stable/std/thread/struct.Builder.html#method.spawn_unchecked) - [`std::str::CharIndices::offset`](https://doc.rust-lang.org/nightly/std/str/struct.CharIndices.html#method.offset) - [`std::option::Option::is_none_or`](https://doc.rust-lang.org/nightly/std/option/enum.Option.html#method.is_none_or) - [`[T]::is_sorted`](https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.is_sorted) - [`[T]::is_sorted_by`](https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.is_sorted_by) - [`[T]::is_sorted_by_key`](https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.is_sorted_by_key) - [`Iterator::is_sorted`](https://doc.rust-lang.org/nightly/std/iter/trait.Iterator.html#method.is_sorted) - [`Iterator::is_sorted_by`](https://doc.rust-lang.org/nightly/std/iter/trait.Iterator.html#method.is_sorted_by) - [`Iterator::is_sorted_by_key`](https://doc.rust-lang.org/nightly/std/iter/trait.Iterator.html#method.is_sorted_by_key) - [`std::future::Ready::into_inner`](https://doc.rust-lang.org/nightly/std/future/struct.Ready.html#method.into_inner) - [`std::iter::repeat_n`](https://doc.rust-lang.org/nightly/std/iter/fn.repeat_n.html) - [`impl<T: Clone> DoubleEndedIterator for Take<Repeat<T>>`](https://doc.rust-lang.org/nightly/std/iter/struct.Take.html#impl-DoubleEndedIterator-for-Take%3CRepeat%3CT%3E%3E) - [`impl<T: Clone> ExactSizeIterator for Take<Repeat<T>>`](https://doc.rust-lang.org/nightly/std/iter/struct.Take.html#impl-ExactSizeIterator-for-Take%3CRepeat%3CT%3E%3E) - [`impl<T: Clone> ExactSizeIterator for Take<RepeatWith<T>>`](https://doc.rust-lang.org/nightly/std/iter/struct.Take.html#impl-ExactSizeIterator-for-Take%3CRepeatWith%3CF%3E%3E) - [`impl Default for std::collections::binary_heap::Iter`](https://doc.rust-lang.org/nightly/std/collections/binary_heap/struct.Iter.html#impl-Default-for-Iter%3C'\_,+T%3E) - [`impl Default for std::collections::btree_map::RangeMut`](https://doc.rust-lang.org/nightly/std/collections/btree_map/struct.RangeMut.html#impl-Default-for-RangeMut%3C'\_,+K,+V%3E) - [`impl Default for std::collections::btree_map::ValuesMut`](https://doc.rust-lang.org/nightly/std/collections/btree_map/struct.ValuesMut.html#impl-Default-for-ValuesMut%3C'\_,+K,+V%3E) - [`impl Default for std::collections::vec_deque::Iter`](https://doc.rust-lang.org/nightly/std/collections/vec_deque/struct.Iter.html#impl-Default-for-Iter%3C'\_,+T%3E) - [`impl Default for std::collections::vec_deque::IterMut`](https://doc.rust-lang.org/nightly/std/collections/vec_deque/struct.IterMut.html#impl-Default-for-IterMut%3C'\_,+T%3E) - [`Rc<T>::new_uninit`](https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html#method.new_uninit) - [`Rc<T>::assume_init`](https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html#method.assume_init) - [`Rc<[T]>::new_uninit_slice`](https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html#method.new_uninit_slice) - [`Rc<[MaybeUninit<T>]>::assume_init`](https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html#method.assume_init-1) - [`Arc<T>::new_uninit`](https://doc.rust-lang.org/nightly/std/sync/struct.Arc.html#method.new_uninit) - [`Arc<T>::assume_init`](https://doc.rust-lang.org/nightly/std/sync/struct.Arc.html#method.assume_init) - [`Arc<[T]>::new_uninit_slice`](https://doc.rust-lang.org/nightly/std/sync/struct.Arc.html#method.new_uninit_slice) - [`Arc<[MaybeUninit<T>]>::assume_init`](https://doc.rust-lang.org/nightly/std/sync/struct.Arc.html#method.assume_init-1) - [`Box<T>::new_uninit`](https://doc.rust-lang.org/nightly/std/boxed/struct.Box.html#method.new_uninit) - [`Box<T>::assume_init`](https://doc.rust-lang.org/nightly/std/boxed/struct.Box.html#method.assume_init) - [`Box<[T]>::new_uninit_slice`](https://doc.rust-lang.org/nightly/std/boxed/struct.Box.html#method.new_uninit_slice) - [`Box<[MaybeUninit<T>]>::assume_init`](https://doc.rust-lang.org/nightly/std/boxed/struct.Box.html#method.assume_init-1) - [`core::arch::x86_64::_bextri_u64`](https://doc.rust-lang.org/stable/core/arch/x86\_64/fn.\_bextri_u64.html) - [`core::arch::x86_64::_bextri_u32`](https://doc.rust-lang.org/stable/core/arch/x86\_64/fn.\_bextri_u32.html) - [`core::arch::x86::_mm_broadcastsi128_si256`](https://doc.rust-lang.org/stable/core/arch/x86/fn.\_mm_broadcastsi128\_si256.html) - [`core::arch::x86::_mm256_stream_load_si256`](https://doc.rust-lang.org/stable/core/arch/x86/fn.\_mm256\_stream_load_si256.html) - [`core::arch::x86::_tzcnt_u16`](https://doc.rust-lang.org/stable/core/arch/x86/fn.\_tzcnt_u16.html) - [`core::arch::x86::_mm_extracti_si64`](https://doc.rust-lang.org/stable/core/arch/x86/fn.\_mm_extracti_si64.html) - [`core::arch::x86::_mm_inserti_si64`](https://doc.rust-lang.org/stable/core/arch/x86/fn.\_mm_inserti_si64.html) - [`core::arch::x86::_mm_storeu_si16`](https://doc.rust-lang.org/stable/core/arch/x86/fn.\_mm_storeu_si16.html) - [`core::arch::x86::_mm_storeu_si32`](https://doc.rust-lang.org/stable/core/arch/x86/fn.\_mm_storeu_si32.html) - [`core::arch::x86::_mm_storeu_si64`](https://doc.rust-lang.org/stable/core/arch/x86/fn.\_mm_storeu_si64.html) - [`core::arch::x86::_mm_loadu_si16`](https://doc.rust-lang.org/stable/core/arch/x86/fn.\_mm_loadu_si16.html) - [`core::arch::x86::_mm_loadu_si32`](https://doc.rust-lang.org/stable/core/arch/x86/fn.\_mm_loadu_si32.html) - [`core::arch::wasm32::u8x16_relaxed_swizzle`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u8x16\_relaxed_swizzle.html) - [`core::arch::wasm32::i8x16_relaxed_swizzle`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i8x16\_relaxed_swizzle.html) - [`core::arch::wasm32::i32x4_relaxed_trunc_f32x4`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i32x4\_relaxed_trunc_f32x4.html) - [`core::arch::wasm32::u32x4_relaxed_trunc_f32x4`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u32x4\_relaxed_trunc_f32x4.html) - [`core::arch::wasm32::i32x4_relaxed_trunc_f64x2_zero`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i32x4\_relaxed_trunc_f64x2\_zero.html) - [`core::arch::wasm32::u32x4_relaxed_trunc_f64x2_zero`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u32x4\_relaxed_trunc_f64x2\_zero.html) - [`core::arch::wasm32::f32x4_relaxed_madd`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f32x4\_relaxed_madd.html) - [`core::arch::wasm32::f32x4_relaxed_nmadd`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f32x4\_relaxed_nmadd.html) - [`core::arch::wasm32::f64x2_relaxed_madd`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f64x2\_relaxed_madd.html) - [`core::arch::wasm32::f64x2_relaxed_nmadd`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f64x2\_relaxed_nmadd.html) - [`core::arch::wasm32::i8x16_relaxed_laneselect`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i8x16\_relaxed_laneselect.html) - [`core::arch::wasm32::u8x16_relaxed_laneselect`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u8x16\_relaxed_laneselect.html) - [`core::arch::wasm32::i16x8_relaxed_laneselect`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i16x8\_relaxed_laneselect.html) - [`core::arch::wasm32::u16x8_relaxed_laneselect`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u16x8\_relaxed_laneselect.html) - [`core::arch::wasm32::i32x4_relaxed_laneselect`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i32x4\_relaxed_laneselect.html) - [`core::arch::wasm32::u32x4_relaxed_laneselect`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u32x4\_relaxed_laneselect.html) - [`core::arch::wasm32::i64x2_relaxed_laneselect`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i64x2\_relaxed_laneselect.html) - [`core::arch::wasm32::u64x2_relaxed_laneselect`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u64x2\_relaxed_laneselect.html) - [`core::arch::wasm32::f32x4_relaxed_min`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f32x4\_relaxed_min.html) - [`core::arch::wasm32::f32x4_relaxed_max`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f32x4\_relaxed_max.html) - [`core::arch::wasm32::f64x2_relaxed_min`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f64x2\_relaxed_min.html) - [`core::arch::wasm32::f64x2_relaxed_max`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f64x2\_relaxed_max.html) - [`core::arch::wasm32::i16x8_relaxed_q15mulr`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i16x8\_relaxed_q15mulr.html) - [`core::arch::wasm32::u16x8_relaxed_q15mulr`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u16x8\_relaxed_q15mulr.html) - [`core::arch::wasm32::i16x8_relaxed_dot_i8x16_i7x16`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i16x8\_relaxed_dot_i8x16\_i7x16.html) - [`core::arch::wasm32::u16x8_relaxed_dot_i8x16_i7x16`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u16x8\_relaxed_dot_i8x16\_i7x16.html) - [`core::arch::wasm32::i32x4_relaxed_dot_i8x16_i7x16_add`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i32x4\_relaxed_dot_i8x16\_i7x16\_add.html) - [`core::arch::wasm32::u32x4_relaxed_dot_i8x16_i7x16_add`](https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u32x4\_relaxed_dot_i8x16\_i7x16\_add.html) These APIs are now stable in const contexts: - [`std::task::Waker::from_raw`](https://doc.rust-lang.org/nightly/std/task/struct.Waker.html#method.from_raw) - [`std::task::Context::from_waker`](https://doc.rust-lang.org/nightly/std/task/struct.Context.html#method.from_waker) - [`std::task::Context::waker`](https://doc.rust-lang.org/nightly/std/task/struct.Context.html#method.waker) - [`$integer::from_str_radix`](https://doc.rust-lang.org/nightly/std/primitive.u32.html#method.from_str_radix) - [`std::num::ParseIntError::kind`](https://doc.rust-lang.org/nightly/std/num/struct.ParseIntError.html#method.kind) <a id="1.82.0-Cargo"></a> ## Cargo - [feat: Add `info` cargo subcommand](rust-lang/cargo#14141) <a id="1.82.0-Compatibility-Notes"></a> ## Compatibility Notes - We now [disallow setting some built-in cfgs via the command-line](rust-lang/rust#126158) with the newly added [`explicit_builtin_cfgs_in_flags`](https://doc.rust-lang.org/rustc/lints/listing/deny-by-default.html#explicit-builtin-cfgs-in-flags) lint in order to prevent incoherent state, eg. `windows` cfg active but target is Linux based. The appropriate [`rustc` flag](https://doc.rust-lang.org/rustc/command-line-arguments.html) should be used instead. - The standard library has a new implementation of `binary_search` which is significantly improves performance ([#​128254](rust-lang/rust#128254)). However when a sorted slice has multiple values which compare equal, the new implementation may select a different value among the equal ones than the old implementation. - [illumos/Solaris now sets `MSG_NOSIGNAL` when writing to sockets](rust-lang/rust#128259). This avoids killing the process with SIGPIPE when writing to a closed socket, which matches the existing behavior on other UNIX targets. - [Removes a problematic hack that always passed the --whole-archive linker flag for tests, which may cause linker errors for code accidentally relying on it.](rust-lang/rust#128400) - The WebAssembly target features `multivalue` and `reference-types` are now both enabled by default. These two features both have subtle changes implied for generated WebAssembly binaries. For the `multivalue` feature, WebAssembly target support has changed when upgrading to LLVM 19. Support for generating functions with multiple returns no longer works and `-Ctarget-feature=+multivalue` has a different meaning than it did in LLVM 18 and prior. There is no longer any supported means to generate a module that has a function with multiple returns in WebAssembly from Rust source code. For the `reference-types` feature the encoding of immediates in the `call_indirect`, a commonly used instruction by the WebAssembly backend, has changed. Validators and parsers which don't understand the `reference-types` proposal will no longer accept modules produced by LLVM due to this change in encoding of immediates. Additionally these features being enabled are encoded in the `target_features` custom section and may affect downstream tooling such as `wasm-opt` consuming the module. Generating a WebAssembly module that disables default features requires `-Zbuild-std` support from Cargo and more information can be found at [rust-lang/rust#128511](rust-lang/rust#128511). - [Rust now raises unsafety errors for union patterns in parameter-position](rust-lang/rust#130531) <a id="1.82.0-Internal-Changes"></a> ## Internal Changes These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools. - [Update to LLVM 19](rust-lang/rust#127513) </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever MR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this MR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this MR, check this box --- This MR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy40NDAuNyIsInVwZGF0ZWRJblZlciI6IjM3LjQ0MC43IiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJSZW5vdmF0ZSBCb3QiXX0=-->
Pkgsrc changes: * Adapt patches, apply to new vendored crates where needed. * Back-port rust pull request 130110, "make dist vendoring configurable" * Disable "dist vendoring", otherwise cargo would try to access the network during the build phase. Upstream changes: Version 1.82.0 (2024-10-17) ========================== Language -------- - [Don't make statement nonterminals match pattern nonterminals] (rust-lang/rust#120221) - [Patterns matching empty types can now be omitted in common cases] (rust-lang/rust#122792) - [Enforce supertrait outlives obligations when using trait impls] (rust-lang/rust#124336) - [`addr_of(_mut)!` macros and the newly stabilized `&raw (const|mut)` are now safe to use with all static items] (rust-lang/rust#125834) - [size_of_val_raw: for length 0 this is safe to call] (rust-lang/rust#126152) - [Reorder trait bound modifiers *after* `for<...>` binder in trait bounds] (rust-lang/rust#127054) - [Stabilize opaque type precise capturing (RFC 3617)] (rust-lang/rust#127672) - [Stabilize `&raw const` and `&raw mut` operators (RFC 2582)] (rust-lang/rust#127679) - [Stabilize unsafe extern blocks (RFC 3484)] (rust-lang/rust#127921) - [Stabilize nested field access in `offset_of!`] (rust-lang/rust#128284) - [Do not require `T` to be live when dropping `[T; 0]`] (rust-lang/rust#128438) - [Stabilize `const` operands in inline assembly] (rust-lang/rust#128570) - [Stabilize floating-point arithmetic in `const fn`] (rust-lang/rust#128596) - [Stabilize explicit opt-in to unsafe attributes] (rust-lang/rust#128771) - [Document NaN bit patterns guarantees] (rust-lang/rust#129559) Compiler -------- - [Promote riscv64gc-unknown-linux-musl to tier 2] (rust-lang/rust#122049) - [Promote Mac Catalyst targets `aarch64-apple-ios-macabi` and `x86_64-apple-ios-macabi` to Tier 2, and ship them with rustup] (rust-lang/rust#126450) - [Add tier 3 NuttX based targets for RISC-V and ARM] (rust-lang/rust#127755) - [Add tier 3 powerpc-unknown-linux-muslspe target] (rust-lang/rust#127905) - [Improved diagnostics to explain why a pattern is unreachable] (rust-lang/rust#128034) - [The compiler now triggers the unreachable code warning properly for async functions that don't return/are `-> !`] (rust-lang/rust#128443) - [Promote `aarch64-apple-darwin` to Tier 1] (rust-lang/rust#128592) - [Add Trusty OS target `aarch64-unknown-trusty` and `armv7-unknown-trusty` as tier 3 targets] (rust-lang/rust#129490) - [Promote `wasm32-wasip2` to Tier 2.] (rust-lang/rust#126967) Libraries --------- - [Generalize `{Rc,Arc}::make_mut()` to `Path`, `OsStr`, and `CStr`.] (rust-lang/rust#126877) Stabilized APIs --------------- - [`std::thread::Builder::spawn_unchecked`] (https://doc.rust-lang.org/stable/std/thread/struct.Builder.html#method.spawn_unchecked) - [`std::str::CharIndices::offset`] (https://doc.rust-lang.org/nightly/std/str/struct.CharIndices.html#method.offset) - [`std::option::Option::is_none_or`] (https://doc.rust-lang.org/nightly/std/option/enum.Option.html#method.is_none_or) - [`[T]::is_sorted`] (https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.is_sorted) - [`[T]::is_sorted_by`] (https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.is_sorted_by) - [`[T]::is_sorted_by_key`] (https://doc.rust-lang.org/nightly/std/primitive.slice.html#method.is_sorted_by_key) - [`Iterator::is_sorted`] (https://doc.rust-lang.org/nightly/std/iter/trait.Iterator.html#method.is_sorted) - [`Iterator::is_sorted_by`] (https://doc.rust-lang.org/nightly/std/iter/trait.Iterator.html#method.is_sorted_by) - [`Iterator::is_sorted_by_key`] (https://doc.rust-lang.org/nightly/std/iter/trait.Iterator.html#method.is_sorted_by_key) - [`std::future::Ready::into_inner`] (https://doc.rust-lang.org/nightly/std/future/struct.Ready.html#method.into_inner) - [`std::iter::repeat_n`] (https://doc.rust-lang.org/nightly/std/iter/fn.repeat_n.html) - [`impl<T: Clone> DoubleEndedIterator for Take<Repeat<T>>`] (https://doc.rust-lang.org/nightly/std/iter/struct.Take.html#impl-DoubleEndedIterator-for-Take%3CRepeat%3CT%3E%3E) - [`impl<T: Clone> ExactSizeIterator for Take<Repeat<T>>`] (https://doc.rust-lang.org/nightly/std/iter/struct.Take.html#impl-ExactSizeIterator-for-Take%3CRepeat%3CT%3E%3E) - [`impl<T: Clone> ExactSizeIterator for Take<RepeatWith<T>>`] (https://doc.rust-lang.org/nightly/std/iter/struct.Take.html#impl-ExactSizeIterator-for-Take%3CRepeatWith%3CF%3E%3E) - [`impl Default for std::collections::binary_heap::Iter`] (https://doc.rust-lang.org/nightly/std/collections/binary_heap/struct.Iter.html#impl-Default-for-Iter%3C'_,+T%3E) - [`impl Default for std::collections::btree_map::RangeMut`] (https://doc.rust-lang.org/nightly/std/collections/btree_map/struct.RangeMut.html#impl-Default-for-RangeMut%3C'_,+K,+V%3E) - [`impl Default for std::collections::btree_map::ValuesMut`] (https://doc.rust-lang.org/nightly/std/collections/btree_map/struct.ValuesMut.html#impl-Default-for-ValuesMut%3C'_,+K,+V%3E) - [`impl Default for std::collections::vec_deque::Iter`] (https://doc.rust-lang.org/nightly/std/collections/vec_deque/struct.Iter.html#impl-Default-for-Iter%3C'_,+T%3E) - [`impl Default for std::collections::vec_deque::IterMut`] (https://doc.rust-lang.org/nightly/std/collections/vec_deque/struct.IterMut.html#impl-Default-for-IterMut%3C'_,+T%3E) - [`Rc<T>::new_uninit`] (https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html#method.new_uninit) - [`Rc<T>::assume_init`] (https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html#method.assume_init) - [`Rc<[T]>::new_uninit_slice`] (https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html#method.new_uninit_slice) - [`Rc<[MaybeUninit<T>]>::assume_init`] (https://doc.rust-lang.org/nightly/std/rc/struct.Rc.html#method.assume_init-1) - [`Arc<T>::new_uninit`] (https://doc.rust-lang.org/nightly/std/sync/struct.Arc.html#method.new_uninit) - [`Arc<T>::assume_init`] (https://doc.rust-lang.org/nightly/std/sync/struct.Arc.html#method.assume_init) - [`Arc<[T]>::new_uninit_slice`] (https://doc.rust-lang.org/nightly/std/sync/struct.Arc.html#method.new_uninit_slice) - [`Arc<[MaybeUninit<T>]>::assume_init`] (https://doc.rust-lang.org/nightly/std/sync/struct.Arc.html#method.assume_init-1) - [`Box<T>::new_uninit`] (https://doc.rust-lang.org/nightly/std/boxed/struct.Box.html#method.new_uninit) - [`Box<T>::assume_init`] (https://doc.rust-lang.org/nightly/std/boxed/struct.Box.html#method.assume_init) - [`Box<[T]>::new_uninit_slice`] (https://doc.rust-lang.org/nightly/std/boxed/struct.Box.html#method.new_uninit_slice) - [`Box<[MaybeUninit<T>]>::assume_init`] (https://doc.rust-lang.org/nightly/std/boxed/struct.Box.html#method.assume_init-1) - [`core::arch::x86_64::_bextri_u64`] (https://doc.rust-lang.org/stable/core/arch/x86_64/fn._bextri_u64.html) - [`core::arch::x86_64::_bextri_u32`] (https://doc.rust-lang.org/stable/core/arch/x86_64/fn._bextri_u32.html) - [`core::arch::x86::_mm_broadcastsi128_si256`] (https://doc.rust-lang.org/stable/core/arch/x86/fn._mm_broadcastsi128_si256.html) - [`core::arch::x86::_mm256_stream_load_si256`] (https://doc.rust-lang.org/stable/core/arch/x86/fn._mm256_stream_load_si256.html) - [`core::arch::x86::_tzcnt_u16`] (https://doc.rust-lang.org/stable/core/arch/x86/fn._tzcnt_u16.html) - [`core::arch::x86::_mm_extracti_si64`] (https://doc.rust-lang.org/stable/core/arch/x86/fn._mm_extracti_si64.html) - [`core::arch::x86::_mm_inserti_si64`] (https://doc.rust-lang.org/stable/core/arch/x86/fn._mm_inserti_si64.html) - [`core::arch::x86::_mm_storeu_si16`] (https://doc.rust-lang.org/stable/core/arch/x86/fn._mm_storeu_si16.html) - [`core::arch::x86::_mm_storeu_si32`] (https://doc.rust-lang.org/stable/core/arch/x86/fn._mm_storeu_si32.html) - [`core::arch::x86::_mm_storeu_si64`] (https://doc.rust-lang.org/stable/core/arch/x86/fn._mm_storeu_si64.html) - [`core::arch::x86::_mm_loadu_si16`] (https://doc.rust-lang.org/stable/core/arch/x86/fn._mm_loadu_si16.html) - [`core::arch::x86::_mm_loadu_si32`] (https://doc.rust-lang.org/stable/core/arch/x86/fn._mm_loadu_si32.html) - [`core::arch::wasm32::u8x16_relaxed_swizzle`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u8x16_relaxed_swizzle.html) - [`core::arch::wasm32::i8x16_relaxed_swizzle`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i8x16_relaxed_swizzle.html) - [`core::arch::wasm32::i32x4_relaxed_trunc_f32x4`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i32x4_relaxed_trunc_f32x4.html) - [`core::arch::wasm32::u32x4_relaxed_trunc_f32x4`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u32x4_relaxed_trunc_f32x4.html) - [`core::arch::wasm32::i32x4_relaxed_trunc_f64x2_zero`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i32x4_relaxed_trunc_f64x2_zero.html) - [`core::arch::wasm32::u32x4_relaxed_trunc_f64x2_zero`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u32x4_relaxed_trunc_f64x2_zero.html) - [`core::arch::wasm32::f32x4_relaxed_madd`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f32x4_relaxed_madd.html) - [`core::arch::wasm32::f32x4_relaxed_nmadd`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f32x4_relaxed_nmadd.html) - [`core::arch::wasm32::f64x2_relaxed_madd`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f64x2_relaxed_madd.html) - [`core::arch::wasm32::f64x2_relaxed_nmadd`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f64x2_relaxed_nmadd.html) - [`core::arch::wasm32::i8x16_relaxed_laneselect`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i8x16_relaxed_laneselect.html) - [`core::arch::wasm32::u8x16_relaxed_laneselect`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u8x16_relaxed_laneselect.html) - [`core::arch::wasm32::i16x8_relaxed_laneselect`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i16x8_relaxed_laneselect.html) - [`core::arch::wasm32::u16x8_relaxed_laneselect`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u16x8_relaxed_laneselect.html) - [`core::arch::wasm32::i32x4_relaxed_laneselect`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i32x4_relaxed_laneselect.html) - [`core::arch::wasm32::u32x4_relaxed_laneselect`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u32x4_relaxed_laneselect.html) - [`core::arch::wasm32::i64x2_relaxed_laneselect`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i64x2_relaxed_laneselect.html) - [`core::arch::wasm32::u64x2_relaxed_laneselect`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u64x2_relaxed_laneselect.html) - [`core::arch::wasm32::f32x4_relaxed_min`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f32x4_relaxed_min.html) - [`core::arch::wasm32::f32x4_relaxed_max`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f32x4_relaxed_max.html) - [`core::arch::wasm32::f64x2_relaxed_min`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f64x2_relaxed_min.html) - [`core::arch::wasm32::f64x2_relaxed_max`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.f64x2_relaxed_max.html) - [`core::arch::wasm32::i16x8_relaxed_q15mulr`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i16x8_relaxed_q15mulr.html) - [`core::arch::wasm32::u16x8_relaxed_q15mulr`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u16x8_relaxed_q15mulr.html) - [`core::arch::wasm32::i16x8_relaxed_dot_i8x16_i7x16`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i16x8_relaxed_dot_i8x16_i7x16.html) - [`core::arch::wasm32::u16x8_relaxed_dot_i8x16_i7x16`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u16x8_relaxed_dot_i8x16_i7x16.html) - [`core::arch::wasm32::i32x4_relaxed_dot_i8x16_i7x16_add`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.i32x4_relaxed_dot_i8x16_i7x16_add.html) - [`core::arch::wasm32::u32x4_relaxed_dot_i8x16_i7x16_add`] (https://doc.rust-lang.org/nightly/core/arch/wasm32/fn.u32x4_relaxed_dot_i8x16_i7x16_add.html) These APIs are now stable in const contexts: - [`std::task::Waker::from_raw`] (https://doc.rust-lang.org/nightly/std/task/struct.Waker.html#method.from_raw) - [`std::task::Waker::waker`] (https://doc.rust-lang.org/nightly/std/task/struct.Waker.html#method.from_raw) - [`std::task::Context::from_waker`] (https://doc.rust-lang.org/nightly/std/task/struct.Context.html#method.from_waker) - [`std::task::Context::waker`] (https://doc.rust-lang.org/nightly/std/task/struct.Context.html#method.waker) - [`$integer::from_str_radix`] (https://doc.rust-lang.org/nightly/std/primitive.u32.html#method.from_str_radix) - [`std::num::ParseIntError::kind`] (https://doc.rust-lang.org/nightly/std/num/struct.ParseIntError.html#method.kind) Cargo ----- - [feat: Add `info` cargo subcommand] (rust-lang/cargo#14141) Compatibility Notes ------------------- - We now [disallow setting some built-in cfgs via the command-line](rust-lang/rust#126158) with the newly added [`explicit_builtin_cfgs_in_flags`] (https://doc.rust-lang.org/rustc/lints/listing/deny-by-default.html#explicit-builtin-cfgs-in-flags) lint in order to prevent incoherent state, eg. `windows` cfg active but target is Linux based. The appropriate [`rustc` flag] (https://doc.rust-lang.org/rustc/command-line-arguments.html) should be used instead. - The standard library has a new implementation of `binary_search` which is significantly improves performance ([#128254](rust-lang/rust#128254)). However when a sorted slice has multiple values which compare equal, the new implementation may select a different value among the equal ones than the old implementation. - [illumos/Solaris now sets `MSG_NOSIGNAL` when writing to sockets](rust-lang/rust#128259). This avoids killing the process with SIGPIPE when writing to a closed socket, which matches the existing behavior on other UNIX targets. - [Removes a problematic hack that always passed the --whole-archive linker flag for tests, which may cause linker errors for code accidentally relying on it.] (rust-lang/rust#128400) - The WebAssembly target features `multivalue` and `reference-types` are now both enabled by default. These two features both have subtle changes implied for generated WebAssembly binaries. For the `multivalue` feature, WebAssembly target support has changed when upgrading to LLVM 19. Support for generating functions with multiple returns no longer works and `-Ctarget-feature=+multivalue` has a different meaning than it did in LLVM 18 and prior. There is no longer any supported means to generate a module that has a function with multiple returns in WebAssembly from Rust source code. For the `reference-types` feature the encoding of immediates in the `call_indirect`, a commonly used instruction by the WebAssembly backend, has changed. Validators and parsers which don't understand the `reference-types` proposal will no longer accept modules produced by LLVM due to this change in encoding of immediates. Additionally these features being enabled are encoded in the `target_features` custom section and may affect downstream tooling such as `wasm-opt` consuming the module. Generating a WebAssembly module that disables default features requires `-Zbuild-std` support from Cargo and more information can be found at [rust-lang/rust#128511](rust-lang/rust#128511). - [Rust now raises unsafety errors for union patterns in parameter-position] (rust-lang/rust#130531) Internal Changes ---------------- These changes do not affect any public interfaces of Rust, but they represent significant improvements to the performance or internals of rustc and related tools. - [Update to LLVM 19] (rust-lang/rust#127513)
Fixes #125833
As reported in that and related issues,
static mut STATIC_MUT: T
is very often used in embedded code, and is in many ways equivalent tostatic STATIC_CELL: SyncUnsafeCell<T>
. The Rust expression of&raw mut STATIC_MUT
andSyncUnsafeCell::get(&STATIC_CELL)
are approximately equal, and both evaluate to*mut T
. The library function is safe because it has declared itself to be safe. However, the raw ref operator is unsafe because all uses ofstatic mut
are considered unsafe, even though the static's value is not used by this expression (unlike, for example,&STATIC_MUT
).We can fix this unnatural difference by simply adding the proper exclusion for the safety check inside the THIR unsafeck, so that we do not declare it unsafe if it is not.
While the primary concern here is
static mut
, this change is made for all instances of an "unsafe static", which includes a static declared insideextern "abi" {}
. Hypothetically, we could go as far as generalizing this to all instances of&raw (const|mut) *ptr
, but today we do not, as we have not actually considered the range of possible expressions that use a similar encoding. We do not even extend this to thread-local equivalents, because they have less clear semantics.