about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-03-14Rollup merge of #136230 - clarfonthey:net-memory-layout-assumptions, r=cuviperJacob Pratt-11/+21
Reword incorrect documentation about SocketAddr having varying layout This has no longer been the case since these types were moved to `core`. The note on portability remains, but it is reworded to not imply that the size varies by target.
2025-03-14Rollup merge of #136001 - hkBst:patch-21, r=cuviperJacob Pratt-49/+75
Overhaul examples for PermissionsExt This fixes #91707 by including one overarching example, instead of the small examples that can be misleading.
2025-03-14Auto merge of #138391 - scottmcm:SSA-discriminants, r=WaffleLapkinbors-167/+186
Don't `alloca` just to look at a discriminant Today we're making LLVM do a bunch of extra work when you match on trivial stuff like `Option<bool>` or `ControlFlow<u8>`. This PR changes that so that simple types like `Option<u32>` or `Result<(), Box<Error>>` can stay as `OperandValue::ScalarPair` and we can still read the discriminant from them, rather than needing to write them into memory to have a `PlaceValue` just to get the discriminant out. Fixes #137503
2025-03-13Auto merge of #138459 - matthiaskrgr:rollup-hddfg18, r=matthiaskrgrbors-717/+366
Rollup of 8 pull requests Successful merges: - #138126 (Add an opt-out in pretty printing for RTN rendering) - #138399 (Delegation: allow foreign fns `reuse`) - #138406 (Update mdbook to 0.4.47) - #138417 (minor interpreter cleanups) - #138420 (Adapt to LLVM dropping CfiFunctionIndex::begin()/end()) - #138423 (Don't emit error within cast function, propagate it as a `CastError`) - #138425 (Remove `feature = "hash_raw_entry"`) - #138427 (Fix RISC-V VxWorks LLVM target triples) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-13Rollup merge of #138427 - madsmtm:vxworks-llvm-target, r=jieyouxuMatthias Krüger-2/+2
Fix RISC-V VxWorks LLVM target triples The targets `riscv32-wrs-vxworks` and `riscv64-wrs-vxworks` uses the plain `$ARCH` LLVM triple, which LLVM normalizes to `$ARCH-unknown-unknown`, we should use `$ARCH-unknown-linux-gnu$ABI` which is consistent with the the other VxWorks targets. Motivation: To make it easier to verify that [`cc-rs`' conversion from `rustc` to Clang/LLVM triples](https://github.com/rust-lang/cc-rs/issues/1431) is correct. Alternative: Pass `$ARCH-unknown-none` in the other VxWorks LLVM triples, I don't know anything about VxWorks, so am unsure which is the most correct option. CC target maintainer `@biabbas.` r? jieyouxu
2025-03-13Rollup merge of #138425 - cuviper:remove-hash_raw_entry, r=jhprattMatthias Krüger-564/+0
Remove `feature = "hash_raw_entry"` The `hash_raw_entry` feature finished [fcp-close](https://github.com/rust-lang/rust/issues/56167#issuecomment-2293805510) back in August, and its remaining uses in the compiler have now been removed, so we should be all clear to remove it from `std`. Closes #56167
2025-03-13Rollup merge of #138423 - compiler-errors:delay-emit, r=WaffleLapkinMatthias Krüger-14/+19
Don't emit error within cast function, propagate it as a `CastError` Minor nitpick from #136764. r? `@WaffleLapkin`
2025-03-13Rollup merge of #138420 - zmodem:cfifunctionindex_fix, r=durin42Matthias Krüger-0/+9
Adapt to LLVM dropping CfiFunctionIndex::begin()/end() After https://github.com/llvm/llvm-project/pull/130382, RustWrapper needs to call CfiFunctionIndex::symbols() instead.
2025-03-13Rollup merge of #138417 - RalfJung:interpret-cleanup, r=oli-obkMatthias Krüger-91/+85
minor interpreter cleanups - remove the `eval_inline_asm` hook that `@saethlin` added; the usage never materialized and he agreed with removing it - I tried merging `init_alloc_extra` and `adjust_global_allocation` and it didn't work; leave a comment as to why. Also, make the allocation code path a bit more clear by renaming `init_alloc_extra` to `init_local_allocation`. r? `@oli-obk`
2025-03-13Rollup merge of #138406 - ehuss:update-mdbook, r=jieyouxuMatthias Krüger-3/+12
Update mdbook to 0.4.47 This updates mdbook to bring in an important fix that enables the `output.html.hash-files` option to deal with network caching. Changelog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-0446 https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-0447
2025-03-13Rollup merge of #138399 - Bryanskiy:delegation-extern-fn, r=petrochenkovMatthias Krüger-13/+87
Delegation: allow foreign fns `reuse` In example: ```rust unsafe extern "C" { fn foo(); } reuse foo as bar; ``` Desugaring before: ```rust fn bar() { foo() //~^ ERROR call to unsafe function `foo` is unsafe and requires unsafe function or block } ``` after: ```rust unsafe extern "C" fn bar() { foo() } ``` Fixes https://github.com/rust-lang/rust/issues/127412 r? `@petrochenkov`
2025-03-13Rollup merge of #138126 - compiler-errors:rtn-for-sugg, r=oli-obkMatthias Krüger-30/+152
Add an opt-out in pretty printing for RTN rendering Today, we render RPITIT types like `impl Sized { T::method(..) }` when RTN is enabled. This is very useful for diagnostics, since it's often not clear what the `impl Sized` type means by itself, and it makes it clear that that's an RPITIT that can be bounded using RTN syntax. See #115624. However, since we don't distinguish types that are rendered for the purposes of printing messages vs suggestions, this representation leaks into suggestions and turns into code that can't be parsed. This PR adds a new `with_types_for_suggestion! {}` and `with_types_for_signature! {}` options to the pretty printing architecture to make it clear that we're rendering a type for code suggestions. This can be applied later as we find that we need it.
2025-03-13Auto merge of #137152 - saethlin:bss-const-allocs, r=wesleywiserbors-4/+117
Add a .bss-like scheme for encoded const allocs This check if all bytes are zero feel like it should be too slow, and instead we should have a flag that we track, but that seems hard. Let's see how this perfs first. Also we can probably stash the "it's all zero actually" flag inside one of the other struct members that's already not using an entire byte. This optimization doesn't fire all that often, so it's possible that by sticking it in the varint length field, this PR actually makes rmeta size worse.
2025-03-13Auto merge of #138450 - matthiaskrgr:rollup-4im25vf, r=matthiaskrgrbors-128/+269
Rollup of 6 pull requests Successful merges: - #137816 (attempt to support `BinaryFormat::Xcoff` in `naked_asm!`) - #138109 (make precise capturing args in rustdoc Json typed) - #138343 (Enable `f16` tests for `powf`) - #138356 (bump libc to 0.2.171 to fix xous) - #138371 (Update compiletest's `has_asm_support` to match rustc) - #138404 (Cleanup sysroot locating a bit) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-13Delegation: allow foreign fns `reuse`Bryanskiy-13/+87
2025-03-13Rollup merge of #138404 - bjorn3:sysroot_handling_cleanup, ↵Matthias Krüger-52/+43
r=petrochenkov,jieyouxu Cleanup sysroot locating a bit All commits should preserve existing behavior.
2025-03-13Rollup merge of #138371 - cuviper:stable-asm-test, r=jieyouxuMatthias Krüger-1/+10
Update compiletest's `has_asm_support` to match rustc The list of `ASM_SUPPORTED_ARCHS` was missing a few from the compiler's actual stable list.
2025-03-13Rollup merge of #138356 - betrusted-io:bump-libc-0.2.171, r=jhprattMatthias Krüger-3/+3
bump libc to 0.2.171 to fix xous Due to a reorganization in the `libc` crate, the `xous` target broke with version `0.2.170`. Bump libc to `0.2.171` to fix nightly.
2025-03-13Rollup merge of #138343 - tgross35:f16-powf, r=joboetMatthias Krüger-43/+41
Enable `f16` tests for `powf` The LLVM issue [1] was fixed with [2], which is included in the LLVM20 upgrade. Tests no longer fail, so enable them here. [1]: https://github.com/llvm/llvm-project/pull/98681 [2]: https://github.com/llvm/llvm-project/pull/98681 try-job: aarch64-gnu try-job: x86_64-gnu-aux
2025-03-13Rollup merge of #138109 - Kohei316:feat/rust-doc-precise-capturing-arg, ↵Matthias Krüger-20/+96
r=aDotInTheVoid,compiler-errors make precise capturing args in rustdoc Json typed close #137616 This PR includes below changes. - Add `rustc_hir::PreciseCapturingArgKind` which allows the query system to return a arg's data. - Add `rustdoc::clean::types::PreciseCapturingArg` and change to use it. - Add `rustdoc-json-types::PreciseCapturingArg` and change to use it. - Update `tests/rustdoc-json/impl-trait-precise-capturing.rs`. - Bump `rustdoc_json_types::FORMAT_VERSION`.
2025-03-13Rollup merge of #137816 - folkertdev:naked-asm-xcoff, r=NoratriebMatthias Krüger-9/+76
attempt to support `BinaryFormat::Xcoff` in `naked_asm!` Fixes https://github.com/rust-lang/rust/issues/137219 So, the inline assembly support for xcoff is extremely limited. The LLVM [XCOFFAsmParser](https://github.com/llvm/llvm-project/blob/1b25c0c4da968fe78921ce77736e5baef4db75e3/llvm/lib/MC/MCParser/XCOFFAsmParser.cpp) does not support many of the attributes that LLVM itself emits, and that should exist based on [the assembler docs](https://www.ibm.com/docs/en/ssw_aix_71/assembler/assembler_pdf.pdf). It also does accept some that should not exist based on those docs. So, I've tried to do the best I can given those limitations. At least it's better than emitting the directives for elf and having that fail somewhere deep in LLVM. Given that inline assembly for this target is incomplete (under `asm_experimental_arch`), I think that's OK (and again I don't see how we can do better given the limitations in LLVM). r? ```@Noratrieb``` (given that you reviewed https://github.com/rust-lang/rust/pull/136637) It seems reasonable to ping the [`powerpc64-ibm-aix` target maintainers](https://doc.rust-lang.org/rustc/platform-support/aix.html), hopefully they have thoughts too: ```@daltenty``` ```@gilamn5tr```
2025-03-13Auto merge of #138448 - matthiaskrgr:rollup-3onhkse, r=matthiaskrgrbors-406/+560
Rollup of 8 pull requests Successful merges: - #126856 (remove deprecated tool `rls`) - #133981 (rustdoc-json: Refractor and document Id's) - #136842 (Add libstd support for Trusty targets) - #137355 (Implement `read_buf` and vectored read/write for SGX stdio) - #138162 (Update the standard library to Rust 2024) - #138273 (metadata: Ignore sysroot when doing the manual native lib search in rustc) - #138346 (naked functions: on windows emit `.endef` without the symbol name) - #138370 (Simulate OOM for the `try_oom_error` test) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-13Rollup merge of #138370 - cuviper:try_oom_error, r=jhprattMatthias Krüger-6/+10
Simulate OOM for the `try_oom_error` test We can create the expected error manually, rather than trying to produce a real one, so the error conversion test can run on all targets. Before, it was only running on 64-bit and not miri. In Fedora, we also found that s390x was not getting the expected error, "successfully" allocating the huge size because it was optimizing the real `malloc` call away. It's possible to counter that by looking at the pointer in any way, like a debug print, but it's more robust to just deal with errors directly, since this test is only about conversion. Related: #133806
2025-03-13Rollup merge of #138346 - folkertdev:naked-asm-windows-endef, r=ChrisDentonMatthias Krüger-25/+49
naked functions: on windows emit `.endef` without the symbol name tracking issue: https://github.com/rust-lang/rust/issues/90957 fixes https://github.com/rust-lang/rust/issues/138320 The `.endef` directive does not take the name as an argument. Apparently the LLVM x86_64 parser does accept this, but on i686 it's rejected. In general `i686` does some special name mangling stuff, so it's good to include it in the naked function tests. r? ````@ChrisDenton```` (because windows)
2025-03-13Rollup merge of #138273 - petrochenkov:nonatroot, r=bjorn3Matthias Krüger-47/+46
metadata: Ignore sysroot when doing the manual native lib search in rustc This is the opposite alternative to https://github.com/rust-lang/rust/pull/138170 and another way to make native library search consistent between rustc and linker. This way the directory list searched by rustc is still a prefix of the directory list considered by linker, but it's a shorter prefix than in #138170. We can include the sysroot directories into rustc's search again later if the issues with #138170 are resolved, it will be a backward compatible change. This may break some code doing weird things on unstable rustc, or tier 2-3 targets, like bundling `libunwind.a` or sanitizers into something. Note that this doesn't affect shipped `libc.a`, because it lives in `self-contained` directories in sysroot, and `self-contained` sysroot is already not included into the rustc's search. All libunwind and sanitizer libs should be moved to `self-contained` sysroot too eventually. With the consistent search directory list between rustc and linker we can make rustc own the native library search (at least for static libs) and use linker search only as a fallback (like in #123436). This will allow addressing issues like https://github.com/rust-lang/rust/pull/132394 once and for all on all targets. r? ``@bjorn3``
2025-03-13Rollup merge of #138162 - ehuss:library-2024, r=cuviperMatthias Krüger-31/+44
Update the standard library to Rust 2024 This updates the standard library to Rust 2024. This includes the following notable changes: - Macros are updated to use new expression fragment specifiers. This PR includes a test to illustrate the changes, primarily allowing `const {...}` expressions now. - Some tests show a change in MIR drop order. We do not believe this will be an observable change ([see zulip discussion](https://rust-lang.zulipchat.com/#narrow/channel/268952-edition/topic/standard.20library.20migration/near/500972873)). Fixes https://github.com/rust-lang/rust/issues/133081
2025-03-13Rollup merge of #137355 - thaliaarchi:io-optional-methods/sgx, r=ChrisDentonMatthias Krüger-19/+97
Implement `read_buf` and vectored read/write for SGX stdio Implement `read_buf`, `read_vectored`, and `write_vectored` for the SGX stdio types. Additionally, extend `User<T>::copy_to_enclave` to work for copying to uninitialized values and fix unsoundness in `UserRef<[T]>::copy_to_enclave_vec`. cc ``@jethrogb`` Tracked in https://github.com/rust-lang/rust/issues/136756
2025-03-13Rollup merge of #136842 - randomPoison:trusty-libstd-v3, r=ChrisDentonMatthias Krüger-15/+181
Add libstd support for Trusty targets This PR adds support for `alloc` and `std` for the Trusty targets based on the internal patches used in Android. The original patches can be seen [here](https://android.googlesource.com/toolchain/android_rust/+/refs/heads/main/patches/development/rustc-0023-Add-Trusty-OS-support-to-Rust-std.patch) and [here](https://android.googlesource.com/toolchain/android_rust/+/refs/heads/main/patches/development/rustc-0054-Add-std-os-fd-support-for-Trusty.patch). Please let me know if there's any additional context I need to add.
2025-03-13Rollup merge of #133981 - aDotInTheVoid:document-docs-ids, r=fmeaseMatthias Krüger-74/+126
rustdoc-json: Refractor and document Id's Closes #133780 While working on documenting Id's, I realized alot of the way they were generated was weird and unnecessary. Eg: 1. The fully uninterned id type was `(FullItemId, Option<FullItemId>)`, meaning it wasn't actually full! 2. None of the extra fields in `Option<FullItemId>` would ever be used 3. `imported_item_id` was a `rustdoc_json_types::Id` instead of a simpler `DefId`. I believe the new implementation still covers all the same cases, but in a more principled way (and explaining why each piece is needed). This was written to be reviewed commit-by-commit, but it might be easier to review all at once if you're not interested in tracking how the original code became the final code. cc ``@its-the-shrimp`` r? ``@fmease``
2025-03-13Rollup merge of #126856 - onur-ozkan:remove-rls, r=clubby789Matthias Krüger-189/+7
remove deprecated tool `rls` This tool has been deprecated for two years and now it only gives warning without doing anything useful. Zulip discussion: https://rust-lang.zulipchat.com/#narrow/stream/241545-t-release/topic/excluding.20rls.20from.20the.20release try-job: x86_64-gnu-distcheck
2025-03-13Add more comments to discriminant calculations.Scott McMurray-0/+9
2025-03-13Auto merge of #138249 - compiler-errors:auto-self, r=lcnrbors-43/+4
Do not register `Self: AutoTrait` when confirming auto trait (in old solver) Every built-in auto impl for a trait goal like `Ty: Auto` immediately registers another obligation of `Ty: Auto` as one of its nested obligations, leading to us stressing the cycle detection machinery a lot more than we need to. This is because all traits have a `Self: Trait` predicate. To fix this, remove the call to `impl_or_trait_obligations` in `vtable_auto_impl`, since auto traits do not have where clauses. r? lcnr
2025-03-13Auto merge of #138416 - Manishearth:rollup-fejor9p, r=Manishearthbors-1448/+1488
Rollup of 12 pull requests Successful merges: - #134076 (Stabilize `std::io::ErrorKind::InvalidFilename`) - #137504 (Move methods from Map to TyCtxt, part 4.) - #138175 (Support rmeta inputs for --crate-type=bin --emit=obj) - #138259 (Disentangle `ForwardGenericParamBan` and `ConstParamTy` ribs) - #138280 (fix ICE in pretty-printing `global_asm!`) - #138318 (Rustdoc: remove a bunch of `@ts-expect-error` from main.js) - #138331 (Use `RUSTC_LINT_FLAGS` more) - #138357 (merge `TypeChecker` and `TypeVerifier`) - #138394 (remove unnecessary variant) - #138403 (Delegation: one more ICE fix for `MethodCall` generation) - #138407 (Delegation: reject C-variadics) - #138409 (Use sa_sigaction instead of sa_union.__su_sigaction for AIX) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-12Auto merge of #138076 - tmiasko:pred-count, r=matthewjasperbors-3/+6
Calculate predecessor count directly Avoid allocating a vector of small vectors merely to determine how many predecessors each basic block has. Additionally use u8 and saturating operations. The pass only needs to distinguish between [0..1] and [2..].
2025-03-12rustdoc-json: Clean up & Document id handlingAlona Enraght-Moony-44/+85
Alot of the current id handling is weird and unnecessary. e.g: 1. The fully uninterned id type was (FullItemId, Option<FullItemId>) meaning it wasn't actually full! 2. None of the extra fields in Option<FullItemId> would ever be used 3. imported_item_id was a rustdoc_json_types::Id instead of a simpler DefId This commit removes the unnessessary complexity, and documents where the remaining complexity comes from. Co-authored-by: León Orell Valerian Liehr <me@fmease.dev>
2025-03-12Fix RISC-V VxWorks LLVM target triplesMads Marquart-2/+2
The targets used the plain `$ARCH` triple, which LLVM normalizes to `$ARCH-unknown-unknown`, which is inconsistent with the the other VxWorks targets which all use `$ARCH-unknown-linux-gnu$ABI`.
2025-03-12rustdoc-json: Extract Id handling into its own moduleAlona Enraght-Moony-74/+85
I want to work on this in a followup commit, so in this commit I make it self-contained. Contains no code changes, all functions are defined exactly as they were in conversions.rs.
2025-03-12Remove `feature = "hash_raw_entry"`Josh Stone-564/+0
2025-03-12Add an opt-out in pretty printing for RTN renderingMichael Goulet-30/+152
2025-03-12Don't emit error within cast function, propagate it as a CastErrorMichael Goulet-14/+19
2025-03-12Adapt to LLVM dropping CfiFunctionIndex::begin()/end()Hans Wennborg-0/+9
After https://github.com/llvm/llvm-project/pull/130382, RustWrapper needs to call CfiFunctionIndex::symbols() instead.
2025-03-12minor interpret cleanupsRalf Jung-91/+85
2025-03-12Auto merge of #138414 - matthiaskrgr:rollup-9ablqdb, r=matthiaskrgrbors-815/+836
Rollup of 7 pull requests Successful merges: - #137314 (change definitely unproductive cycles to error) - #137701 (Convert `ShardedHashMap` to use `hashbrown::HashTable`) - #138269 (uefi: fs: Implement FileType, FilePermissions and FileAttr) - #138331 (Use `RUSTC_LINT_FLAGS` more) - #138345 (Some autodiff cleanups) - #138387 (intrinsics: remove unnecessary leading underscore from argument names) - #138390 (fix incorrect tracing log) r? `@ghost` `@rustbot` modify labels: rollup
2025-03-12Rollup merge of #138409 - xingxue-ibm:use-sigaction, r=compiler-errorsManish Goregaokar-24/+3
Use sa_sigaction instead of sa_union.__su_sigaction for AIX Revert test cases to use `sa_sigaction` instead of `sa_union.__su_sigaction`, now that the `libc` crate implementation for AIX defines `sa_sigaction` as a direct member of `struct sigaction`, aligning it with implementations on other similar platforms. ([[AIX] Use sa_sigaction instead of the union](https://github.com/rust-lang/libc/pull/4250)).
2025-03-12Rollup merge of #138407 - Bryanskiy:delegation-variadic, r=petrochenkovManish Goregaokar-11/+52
Delegation: reject C-variadics The explanation is contained in attached issues. Fixes https://github.com/rust-lang/rust/issues/127443 Fixes https://github.com/rust-lang/rust/issues/127413 r? `@petrochenkov`
2025-03-12Rollup merge of #138403 - Bryanskiy:delegation-ice-2, r=petrochenkovManish Goregaokar-0/+35
Delegation: one more ICE fix for `MethodCall` generation self-explanatory Fixes https://github.com/rust-lang/rust/issues/138362 r? `@petrochenkov`
2025-03-12Rollup merge of #138394 - lcnr:yeet-variant, r=compiler-errorsManish Goregaokar-11/+6
remove unnecessary variant
2025-03-12Rollup merge of #138357 - lcnr:goodbye-TypeVerifier-rarw, r=compiler-errorsManish Goregaokar-806/+697
merge `TypeChecker` and `TypeVerifier` Stacked on top of #138354. Best reviewed commit by commit. r? `@compiler-errors`
2025-03-12Rollup merge of #138331 - nnethercote:use-RUSTC_LINT_FLAGS-more, ↵Manish Goregaokar-95/+39
r=onur-ozkan,jieyouxu Use `RUSTC_LINT_FLAGS` more An alternative to the failed #138084. Fixes #138106. r? `````@jieyouxu`````
2025-03-12Rollup merge of #138318 - lolbinarycat:rustdoc-js-less-expect-error-part2, ↵Manish Goregaokar-37/+52
r=notriddle Rustdoc: remove a bunch of @ts-expect-error from main.js r? ```````@notriddle``````` Most remaining instances of ````````@ts-expect-error```````` in `search.js` and `main.js` are some sort of unchecked assertion, most of them involving nullibility, and we have yet to decide on how to handle these.