about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-05-18Rollup merge of #141127 - klensy:windows-bump-61, r=albertlarsan68,jieyouxuLeón Orell Valerian Liehr-128/+34
bump windows crate for compiler,bootstrap and tools This dedupes crate versions. For `x86_64-pc-windows-msvc` stage1 cuts few kb from `rustc_driver.dll`, nice.
2025-05-18Rollup merge of #140926 - ↵León Orell Valerian Liehr-14/+25
azhogin:azhogin/async-drop-coroutine-layout-returns-layout-error, r=oli-obk Return value of coroutine_layout fn changed to Result with LayoutError Continue of https://github.com/rust-lang/rust/pull/140902: `coroutine_layout` fn is now returns `Result` with `LayoutError` to have consistent error with `layout_of_uncached`. `async_drop_coroutine_layout` fn is now return `LayoutError::TooGeneric` in case of not-fully-specialized `async_drop_in_place<T>::{closure}` coroutine.
2025-05-18Rollup merge of #140746 - dianne:guard-pat-res, r=oli-obkLeón Orell Valerian Liehr-62/+320
name resolution for guard patterns This PR provides an initial implementation of name resolution for guard patterns [(RFC 3637)](https://github.com/rust-lang/rfcs/blob/master/text/3637-guard-patterns.md). This does not change the requirement that the bindings on either side of an or-pattern must be the same [(proposal here)](https://github.com/rust-lang/rfcs/blob/master/text/3637-guard-patterns.md#allowing-mismatching-bindings-when-possible); the code that handles that is separate from what this PR touches, so I'm saving it for a follow-up. On a technical level, this separates "collecting the bindings in a pattern" (which was already done for or-patterns) from "introducing those bindings into scope". I believe the approach used here can be extended straightforwardly in the future to work with `if let` guard patterns, but I haven't tried it myself since we don't allow those yet. Tracking issue for guard patterns: #129967 cc ``@Nadrieril``
2025-05-18Rollup merge of #140628 - joboet:async_signal_safe, r=Mark-SimulacrumLeón Orell Valerian Liehr-58/+215
std: stop using TLS in signal handler TLS is not async-signal-safe, making its use in the signal handler used to detect stack overflows unsound (c.f. #133698). POSIX however lists two thread-specific identifiers that can be obtained in a signal handler: the current `pthread_t` and the address of `errno`. Since `pthread_equal` is not AS-safe, `pthread_t` should be considered opaque, so for our purposes, `&errno` is the only option. This however works nicely: we can use the address as a key into a map that stores information for each thread. This PR uses a `BTreeMap` protected by a spin lock to hold the guard page address and thread name and thus fixes #133698.
2025-05-18Rollup merge of #140490 - folkertdev:asm-parser-changes, r=Amanieu,traviscrossLeón Orell Valerian Liehr-287/+335
split `asm!` parsing and validation This PR splits `asm!` parsing and validation into two separate steps. The parser constructs a `Vec<RawAsmArg>`, with each element corresponding to an argument to one of the `asm!` macros. The validation then checks things like ordering of arguments or that options are not provided twice. The motivation is https://github.com/rust-lang/rust/issues/140279, which wants to add `#[cfg(...)]` support to these arguments. This support can now be added in a straightforward way by adding an `attributes: ast::AttrVec` field to `RawAsmArg`. An extra reason for this split is that `rustfmt` probably wants to format the assembly at some point (currently that appears to be stubbed out, and the formatting is unstable https://github.com/rust-lang/style-team/issues/152). r? ``@ghost`` (just want to look at CI for now) cc ``@ytmimi`` we discussed asm formatting a little while ago in https://github.com/rust-lang/rustfmt/issues/6526. Am I correct in assuming that `AsmArgs` does not give enough information for formatting, but that `RawAsmArgs` would (it e.g. does not join information from multiple lines). This must have been an issue before? try-job: aarch64-apple
2025-05-18Rollup merge of #138940 - sayantn:stabilize-avx512, r=Amanieu,traviscrossLeón Orell Valerian Liehr-63/+53
Stabilize the avx512 target features This PR stabilizes the AVX512 target features - see [this comment](https://github.com/rust-lang/rust/issues/111137#issuecomment-2745821279). Tracking Issue - #44839 The target feature UI tests have been changed to `x87` (chosen because this is very unlikely to stablize ever, please comment if some other feature will be better) related: #111137
2025-05-18Auto merge of #141216 - fmease:rollup-pa5mvx3, r=fmeasebors-165/+449
Rollup of 8 pull requests Successful merges: - #140113 (Add per page TOC in the `rustc` book) - #140511 (Stabilize `#![feature(non_null_from_ref)]`) - #140924 (Make some `f32`/`f64` tests also run in const-context) - #140966 (Remove #![feature(let_chains)] from library and src/librustdoc) - #141045 ([win][arm64] Remove 'Arm64 Hazard' undocumented MSVC option and instead disable problematic test) - #141071 (Enable [behind-upstream] triagebot option for rust-lang/rust) - #141132 (Use `crate::` prefix for root macro suggestions) - #141139 (Fix Rust for Linux ping group label) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-18name resolution for guard patternsdianne-30/+255
2025-05-18add `AsmOptions` with some named fieldsFolkert de Vries-19/+31
2025-05-18rename to get rid of the 'raw' conceptFolkert de Vries-69/+67
2025-05-18delay error for unsupported optionsFolkert de Vries-79/+39
2025-05-18attempt to have rustfmt use the new logicFolkert de Vries-20/+14
apparently it doesn't really use the asm parsing at present, so this may work?
2025-05-18a new parser generating the exact same error messagesFolkert de Vries-150/+226
Co-authored-by: Travis Cross <tc@traviscross.com>
2025-05-18Rollup merge of #141139 - jieyouxu:fix-rfl, r=UrgauLeón Orell Valerian Liehr-3/+3
Fix Rust for Linux ping group label Noticed in https://github.com/rust-lang/rust/pull/140966#issuecomment-2886704667. Seems like a broken label can cause the triagebot ping message to not be issued. See https://github.com/rust-lang/triagebot/issues/1992. ```@rustbot``` label: +A-rust-for-linux
2025-05-18Rollup merge of #141132 - bvanjoi:issue-141082, r=fmeaseLeón Orell Valerian Liehr-6/+51
Use `crate::` prefix for root macro suggestions Fixes #141082 I've changed the prefix to `crate` directly, since it's compatible across all editions.
2025-05-18Rollup merge of #141071 - xizheyin:behind-upstream, r=UrgauLeón Orell Valerian Liehr-0/+3
Enable [behind-upstream] triagebot option for rust-lang/rust After testing in [rustc-develop-guide](https://github.com/rust-lang/rustc-dev-guide/pull/2384#issuecomment-2876631306), we can turn on `behind-upstream` here. Doc: https://forge.rust-lang.org/triagebot/behind-upstream.html r? ```@Urgau```
2025-05-18Rollup merge of #141045 - dpaoliello:noarmhazard, r=jieyouxuLeón Orell Valerian Liehr-6/+8
[win][arm64] Remove 'Arm64 Hazard' undocumented MSVC option and instead disable problematic test PR #140758 added the undocumented `/arm64hazardfree` MSVC linker flag to work around a test failure where LLVM generated code that would trip a hazard in an outdated ARM processor. Adding this flag caused issues with LLD, as it doesn't recognize it. Rethinking the issue, using the undocumented flag seems like the incorrect solution: there's no guarantee that the flag won't be removed in the future, or change its meaning. Instead, I've disabled the problematic test for Arm64 Windows and have filed a bug with the MSVC team to have the check removed: <https://developercommunity.microsoft.com/t/Remove-checking-for-and-fixing-Cortex-A/10905134> This PR supersedes #140977 r? ```@jieyouxu```
2025-05-18Rollup merge of #140966 - est31:let_chains_library, r=tgross35León Orell Valerian Liehr-4/+1
Remove #![feature(let_chains)] from library and src/librustdoc PR https://github.com/rust-lang/rust/pull/132833 has stabilized the `let_chains` feature. This PR removes the last occurences from the library, the compiler, and librustdoc (also because #140887 missed the conditional in one of the crates as it was behind the "rustc" feature). We keep `core` as exercise for the future as updating it is non-trivial (see PR thread).
2025-05-18Rollup merge of #140924 - Urgau:f32_f64_const_tests, r=Mark-SimulacrumLeón Orell Valerian Liehr-143/+189
Make some `f32`/`f64` tests also run in const-context
2025-05-18Rollup merge of #140511 - mathisbot:master, r=dtolnayLeón Orell Valerian Liehr-3/+4
Stabilize `#![feature(non_null_from_ref)]` This PR stabilizes the following: ```rust impl<T: ?Sized> NonNull<T> { pub const fn from_ref(reference: &T) -> NonNull<T>; pub const fn from_mut(reference: &mut T) -> NonNull<T>; } ``` The feature is tracked in [#130823](https://github.com/rust-lang/rust/issues/130823).
2025-05-18Rollup merge of #140113 - Urgau:rustc-book-page-toc, r=ehussLeón Orell Valerian Liehr-0/+190
Add per page TOC in the `rustc` book This PR adds per page Table of Content (TOC) in the `rustc` book (to be extended in the future to our other books). The goal is to easy the navigation inside the page by providing quick overview of the page content and our position inside that page. That functionality is unfortunately not available natively in `mdbook`, which prompted community members to create [mdBook-pagetoc](https://github.com/JorelAli/mdBook-pagetoc/) (which this PR is heavily inspired by). It's "only" a JS file (to handle the TOC) and a CSS file (to handle the margin, colors, screen size, ...), there is no "post-processor" needed (in mdbook sense). ![image](https://github.com/user-attachments/assets/9e790bea-059d-414e-b4a5-ac8170f57e27) Live preview at: http://urgau.rf.gd/book r? ```@jieyouxu```
2025-05-18Auto merge of #141129 - compiler-errors:register-region-obl, r=oli-obkbors-0/+8
Fast path for `register_region_obligation` If a type has no params, infer, placeholder, or non-`'static` free regions, then we can skip registering outlives obligations since the type has no components which affect lifetime checking in an interesting way.
2025-05-18Remove uses of `#[feature(avx512_target_feature)]`sayantn-27/+17
2025-05-18Stabilize `avx512_target_feature`sayantn-36/+36
2025-05-18Auto merge of #141063 - dianqk:llvm-20.1.5, r=cuviperbors-0/+0
Update to LLVM 20.1.5 `@rustbot` label A-LLVM T-compiler
2025-05-18Auto merge of #141039 - lqd:expensive-sanity, r=compiler-errorsbors-9/+13
move expensive layout sanity check to debug assertions It is [hard to fix](https://github.com/rust-lang/rust/issues/141006#issuecomment-2883415000) the slowness in the uninhabitedness computation for very big types but we can fix the very specific case of them being called during the layout sanity checks, as described in #140944. So this PR moves this uninhabitedness check to the other expensive layout sanity checks that are ran under `debug_assertions`. It makes building the `lemmy_api_routes` crate's self-profile `layout_of` query go from ``` +--------------------------------------------------------+-----------+-----------------+----------+------------+---------------------------------+ | Item | Self time | % of total time | Time | Item count | Incremental result hashing time | +--------------------------------------------------------+-----------+-----------------+----------+------------+---------------------------------+ | layout_of | 63.02s | 41.895 | 244.26s | 123703 | 50.30ms | +--------------------------------------------------------+-----------+-----------------+----------+------------+---------------------------------+ ``` on master (2m17s total), to ``` | layout_of | 330.21ms | 0.372 | 26.90s | 123703 | 53.19ms | ``` with this PR (1m15s total). (Note that the [perf run results](https://github.com/rust-lang/rust/pull/141039#issuecomment-2884688756) below look a bit better than [an earlier run](https://perf.rust-lang.org/compare.html?start=4eca99a18eab3d4e28ed1ce3ee620d442955a470&end=c4a00993f8ee02c7565e7be652608817ea2fb97d&stat=instructions:u) I did in another PR. There may be some positive noise there, or post-merge results could differ a bit) Since we discussed this today, r? `@compiler-errors` — and cc `@lcnr` and `@RalfJung.`
2025-05-17Auto merge of #140856 - oli-obk:merge-queries2, r=nnethercotebors-24/+16
Merge mir query analysis invocations r? `@ghost` same thing as https://github.com/rust-lang/rust/pull/140854 just a different set of queries Doing this in general has some bad cache coherence issues because the query caches are laid out in Vec<QueryResult> lists per query where each index refers to a DefId in the same order as we're iterating. Iterating two or more lists at the same time does have cache issues, so I want to poke a bit at it to see if we can't merge just a few of them at a time.
2025-05-17extract operand parserFolkert de Vries-83/+93
2025-05-17determine later whether an explicit reg was usedFolkert de Vries-11/+9
2025-05-17Fast path for register_region_obligationMichael Goulet-0/+8
2025-05-17Auto merge of #138087 - tgross35:core-float-math, r=Amanieubors-3704/+4711
Initial implementation of `core_float_math` Since [1], `compiler-builtins` makes a certain set of math symbols weakly available on all platforms. This means we can begin exposing some of the related functions in `core`, so begin this process here. It is not possible to provide inherent methods in both `core` and `std` while giving them different stability gates, so standalone functions are added instead. This provides a way to experiment with the functionality while unstable; once it is time to stabilize, they can be converted to inherent. For `f16` and `f128`, everything is unstable so we can move the inherent methods. The following are included to start: * floor * ceil * round * round_ties_even * trunc * fract * mul_add * div_euclid * rem_euclid * powi * sqrt * abs_sub * cbrt These mirror the set of functions that we have in `compiler-builtins` since [1], with the exception of `powi` that has been there longer. Details for each of the changes is in the commit messages. Tracking issue: https://github.com/rust-lang/rust/issues/137578 [1]: https://github.com/rust-lang/compiler-builtins/pull/763 try-job: aarch64-gnu tru-job: armhf-gnu try-job: i686-msvc-1 try-job: test-various try-job: x86_64-mingw-1 try-job: x86_64-mingw-2
2025-05-17Auto merge of #141133 - matthiaskrgr:rollup-u8ndxyz, r=matthiaskrgrbors-311/+427
Rollup of 9 pull requests Successful merges: - #135808 (Implement Display for ``rustc_target::callconv::Conv``) - #137432 (Add as_ascii_unchecked() methods to char, u8, and str) - #139103 (deduplicate abort implementations) - #140917 (checktools.sh: fix bashism) - #141035 (turn lld warning on old gccs into info log) - #141118 (Enable rust-analyzer to go from query definition to the corresponding provider field) - #141121 (Only select true errors in `impossible_predicates`) - #141125 (check coroutines with `TypingMode::Borrowck` to avoid cyclic reasoning) - #141131 (Make some `match`es slightly more ergonomic in `librustdoc`) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-17rustc-dev-guide: fix Rust for Linux rust-lang/rust labelJieyou Xu-2/+2
2025-05-17triagebot: fix Rust for Linux ping group rust-lang/rust labelJieyou Xu-1/+1
2025-05-17Update triagebot.tomlxizheyin-1/+1
Co-authored-by: Urgau <3616612+Urgau@users.noreply.github.com>
2025-05-17Use `crate::` prefix for root macro suggestionsbohan-6/+51
2025-05-17Rollup merge of #141131 - yotamofek:pr/rustdoc/match-ergo, r=fmeaseMatthias Krüger-121/+99
Make some `match`es slightly more ergonomic in `librustdoc` Bunch of small cleanups I found while working on other stuff, mostly getting rid of superfluous `*`s and `ref [mut]`s in `match`es, makes the code less sigil/keyword-heavy, and slightly improves readability IMHO. Also flattens a few nested `match`es.
2025-05-17Rollup merge of #141125 - lcnr:coroutine_obligations_use_borrowck, ↵Matthias Krüger-7/+61
r=compiler-errors check coroutines with `TypingMode::Borrowck` to avoid cyclic reasoning MIR borrowck taints its output if an obligation fails. This could then cause `check_coroutine_obligations` to silence its error, causing us to not emit and actual error and ICE. Fixes the ICE in https://github.com/rust-lang/trait-system-refactor-initiative/issues/199. It is unfortunately still a regression. r? compiler-errors
2025-05-17Rollup merge of #141121 - compiler-errors:ambig-is-not-err, r=lcnrMatthias Krüger-2/+45
Only select true errors in `impossible_predicates` See description in test. Fixes #141119 r? lcnr
2025-05-17Rollup merge of #141118 - Veykril:lw-ymmtxytkrrqs, r=compiler-errorsMatthias Krüger-0/+14
Enable rust-analyzer to go from query definition to the corresponding provider field r? `@compiler-errors`
2025-05-17Rollup merge of #141035 - lqd:lld-warn, r=Mark-SimulacrumMatthias Krüger-1/+1
turn lld warning on old gccs into info log As discussed in #140964 and IRL, this PR switches the spammy warning shown unconditionally when an old gcc doesn't support `-fuse-ld=lld` and we retry linking without it, to an info debug log so we don't lose it. r? `@Mark-Simulacrum` Fixes #140964
2025-05-17Rollup merge of #140917 - RalfJung:checktools, r=WaffleLapkinMatthias Krüger-1/+1
checktools.sh: fix bashism Follow-up to https://github.com/rust-lang/rust/pull/140903. Turns out `tests/{pass,panic}` only properly expands in bash, not in dash. :/ r? `@WaffleLapkin`
2025-05-17Rollup merge of #139103 - joboet:abort_dedup, r=tgross35Matthias Krüger-152/+85
deduplicate abort implementations Currently, the code for process aborts is duplicated across `panic_abort` and `std`. This PR uses `#[rustc_std_internal_symbol]` to make the `std` implementation available to `panic_abort` via the linker, thereby deduplicating the code.
2025-05-17Rollup merge of #137432 - djscythe:char_u8_str_as_ascii_unchecked, r=scottmcmMatthias Krüger-0/+63
Add as_ascii_unchecked() methods to char, u8, and str This PR adds the `as_ascii_unchecked()` method to `char`, `u8`, and `str`, allowing users to convert these types to `ascii::Char`s (see #110998) in an `unsafe` context without first checking for validity. This method was already available for `[u8]`, so this PR makes the API more consistent across other types.
2025-05-17Rollup merge of #135808 - tiif:conv_display, r=workingjubileeMatthias Krüger-27/+58
Implement Display for ``rustc_target::callconv::Conv`` Follow up of https://github.com/rust-lang/rust/pull/133103#discussion_r1885552854
2025-05-17Make some `match`es slightly more ergonomic in `librustdoc`Yotam Ofek-121/+99
2025-05-17Auto merge of #141116 - RalfJung:miri-sync, r=RalfJungbors-111/+69
Miri subtree update r? `@ghost`
2025-05-17bootstrap: bump windows tooklensy-65/+11
2025-05-17check coroutines with TypingMode::Borrowck to avoid cyclic reasoninglcnr-7/+61
MIR borrowck taints its output if an obligation fails. This could then cause `check_coroutine_obligations` to silence its error, causing us to not emit and actual error and ICE.
2025-05-17compiler & tools: bump windows crate to dedupe versionsklensy-63/+23