about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-06-01Add `visit_id` to ast `Visitor`Deadbeef-327/+232
This helps with efforts to deduplicate the `MutVisitor` and the `Visitor` code. All users of `Visitor`'s methods that have extra `NodeId` as parameters really just want to visit the id on its own. Also includes some methods deduplicated and cleaned up as a result of this change.
2025-05-31Auto merge of #141453 - compiler-errors:pgo-solver, r=Kobzolbors-0/+1
[DONT MERGE] PGO new solver 🤔 I hope I did this right...
2025-05-31Add some new solver to PGOMichael Goulet-0/+1
2025-05-31Auto merge of #141678 - Kobzol:revert-141516, r=workingjubileebors-32/+2
Revert "increase perf of charsearcher for single ascii characters" This reverts commit 245bf503e2a948ac98170516d11df632e85a948b (PR https://github.com/rust-lang/rust/pull/141516). It caused a large `doc` perf. regression in https://github.com/rust-lang/rust/pull/141605.
2025-05-31Auto merge of #141667 - lqd:lazy-maybe-init, r=matthewjasperbors-48/+67
Add fast path for maybe-initializedness in liveness r? `@matthewjasper` Correct me if I'm wrong Matthew, but my understanding is that 1. `MaybeInitializedPlaces` is currently eagerly computed, in `do_mir_borrowck` 2. but this data is only used in liveness 3. and `liveness::trace` actually only uses it for drop-liveness This PR moves the computation to `liveness::trace` which looks to be its only use-site. We also add a fast path there, so that it's only computed by drop-liveness. This is interesting because 1) liveness is only computed for relevant live locals, 2) drop-liveness is only computed for relevant live locals with >0 drop points; 0 is the common case from our benchmarks, as far as I can tell, so even just computing the entire data lazily helps. It seems possible to also reduce the domain here, and speed up the analysis for the cases where it has to be computed -- so I've left a fixme for that, and may look into it soon. (I've come upon this while doing implementation work for polonius, so don't be too enamored with possible wins: the goal is to reduce the eventual polonius overhead and make it more palatable 😓)
2025-05-31Auto merge of #141796 - weihanglo:update-cargo, r=weihanglobors-0/+0
Update cargo 12 commits in 68db37499f2de8acef704c73d9031be6fbcbaee4..64a12460708cf146e16cc61f28aba5dc2463bbb4 2025-05-22 14:27:15 +0000 to 2025-05-30 18:25:08 +0000 - chore: remove HTML comments and inline guide (rust-lang/cargo#15613) - Add .git-blame-ignore-revs (rust-lang/cargo#15612) - refactor: cleanup for `CompileMode` (rust-lang/cargo#15608) - refactor: separate "global" mode from CompileMode (rust-lang/cargo#15601) - fix(doc): pass `toolchain-shared-resources` to get doc styled (rust-lang/cargo#15605) - fix(embedded): Resolve multiple bugs in frontmatter parser (rust-lang/cargo#15573) - chore: Upgrade schemars (rust-lang/cargo#15602) - Update gix & socket2 (rust-lang/cargo#15600) - Add `-Zfix-edition` (rust-lang/cargo#15596) - chore(toml): disable `toml`'s default features, unless necessary (rust-lang/cargo#15598) - docs(README): fix the link to the changelog in the Cargo book (rust-lang/cargo#15597) - Add the future edition (rust-lang/cargo#15595) r? ghost
2025-05-30Auto merge of #141791 - workingjubilee:rollup-qnqicy9, r=workingjubileebors-217/+716
Rollup of 8 pull requests Successful merges: - rust-lang/rust#140825 (Add Range parameter to `BTreeMap::extract_if` and `BTreeSet::extract_if`) - rust-lang/rust#141077 (Fix the issue of typo of comma in arm parsing) - rust-lang/rust#141237 (Implement ((un)checked_)exact_div methods for integers) - rust-lang/rust#141494 (mir-opt: Do not transform non-int type in match_branches) - rust-lang/rust#141609 (core: begin deduplicating pointer docs) - rust-lang/rust#141768 (ci: use arm to calculate job matrix) - rust-lang/rust#141771 (Increase timeout for new bors try builds) - rust-lang/rust#141781 (Fix spans for unsafe binders) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-30Update cargoWeihang Lo-0/+0
2025-05-30Rollup merge of #141781 - matthewjasper:unused-unsafe-lifetimes, ↵Jubilee-2/+111
r=compiler-errors Fix spans for unsafe binders closes rust-lang/rust#141758 r? ``@compiler-errors``
2025-05-30Rollup merge of #141771 - Kobzol:bors-increase-timeout, r=marcoieniJubilee-1/+2
Increase timeout for new bors try builds To sync it with [homu](https://github.com/rust-lang/homu/blob/master/cfg.production.toml#L34). Saw the timeout [here](https://github.com/rust-lang/rust/pull/138699#issuecomment-2922456283), it was set to only 4 hours for new bors. r? ``@marcoieni``
2025-05-30Rollup merge of #141768 - marcoieni:calculate-matrix-arm, r=KobzolJubilee-1/+1
ci: use arm to calculate job matrix
2025-05-30Rollup merge of #141609 - lolbinarycat:core-dedup-ptr-docs-139190, ↵Jubilee-123/+67
r=workingjubilee core: begin deduplicating pointer docs this also cleans up two inconsistancies: 1. both doctests on the ::add methods were actually calling the const version. 2. on of the ::offset methods was missing a line of clarification. part of https://github.com/rust-lang/rust/issues/139190
2025-05-30Rollup merge of #141494 - dianqk:match-br-non-int, r=wesleywiserJubilee-2/+65
mir-opt: Do not transform non-int type in match_branches Fixes #141378. r? mir-opt
2025-05-30Rollup merge of #141237 - Qelxiros:139911-exact-div, r=workingjubileeJubilee-1/+207
Implement ((un)checked_)exact_div methods for integers tracking issue: #139911 I see that there might still be some bikeshedding to be done, so if people want changes to this implementation, I'm happy to make those. I did also see that there was a previous attempt at this PR (#116632), but I'm not sure why it got closed.
2025-05-30Rollup merge of #141077 - chenyukang:yukang-fix-140991-comma, r=wesleywiserJubilee-18/+110
Fix the issue of typo of comma in arm parsing Fixes #140991 I also checked is it a '/', since it's near from ',' from keyboard.
2025-05-30Rollup merge of #140825 - rs-sac:ext, r=workingjubileeJubilee-69/+153
Add Range parameter to `BTreeMap::extract_if` and `BTreeSet::extract_if` This new parameter was requested in the btree_extract_if tracking issue: https://github.com/rust-lang/rust/issues/70530#issuecomment-2486566328 I attempted to follow the style used by `Vec::extract_if`. Before: ```rust impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> { #[unstable(feature = "btree_extract_if", issue = "70530")] pub fn extract_if<F>(&mut self, pred: F) -> ExtractIf<'_, K, V, F, A> where K: Ord, F: FnMut(&K, &mut V) -> bool; } ``` After: ```rust impl<K, V, A: Allocator + Clone> BTreeMap<K, V, A> { #[unstable(feature = "btree_extract_if", issue = "70530")] pub fn extract_if<F, R>(&mut self, range: R, pred: F) -> ExtractIf<'_, K, V, R, F, A> where K: Ord, R: RangeBounds<K>, F: FnMut(&K, &mut V) -> bool; } ``` Related: #70530 — While I believe I have adjusted all of the necessary bits, as this is my first attempt to contribute to Rust, I may have overlooked something out of ignorance, but if you can point out any oversight, I shall attempt to remedy it.
2025-05-30Auto merge of #141657 - petrochenkov:nobinroot, r=jieyouxubors-1/+0
bootstrap: Remove `bin_root` from `PATH` It's not currently load bearing in typical setups on typical targets. Basically, if it passes the standard CI, then we can remove it, I think. If someone later reports this breaking the build, then we can address it in a more fine grained way. E.g. add it to `PATH` last and not first, only on specific targets, and only if specific files are not already found in `PATH` directories. Fixes [#t-infra/bootstrap > Build broken in MSYS2 @ 💬](https://rust-lang.zulipchat.com/#narrow/channel/326414-t-infra.2Fbootstrap/topic/Build.20broken.20in.20MSYS2/near/520709527)
2025-05-30Fix spans for unsafe bindersMatthew Jasper-2/+111
2025-05-30Auto merge of #139385 - joboet:threadlocal_address, r=nikicbors-9/+20
rustc_codegen_llvm: use `threadlocal.address` intrinsic to access TLS Fixes #136044 r? `@nikic`
2025-05-30Increase timeout for new bors try buildsJakub Beránek-1/+2
2025-05-30ci: use arm to calculate job matrixMarcoIeni-1/+1
2025-05-30Auto merge of #141765 - matthiaskrgr:rollup-4hug83b, r=matthiaskrgrbors-169/+251
Rollup of 5 pull requests Successful merges: - rust-lang/rust#141703 (Structurally normalize types as needed in `projection_ty_core`) - rust-lang/rust#141719 (Add tls_model for cygwin and enable has_thread_local) - rust-lang/rust#141736 (resolve stage0 sysroot from rustc) - rust-lang/rust#141746 (Rework `#[doc(cfg(..))]` checks as distinct pass in rustdoc) - rust-lang/rust#141749 (Remove RUSTC_RETRY_LINKER_ON_SEGFAULT hack) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-30Rollup merge of #141749 - ↵Matthias Krüger-57/+2
Noratrieb:RUSTC_ACTUALLY_DO_NOT_RETRY_LINKER_ON_SEGFAULT, r=petrochenkov Remove RUSTC_RETRY_LINKER_ON_SEGFAULT hack It looks like this was added in rust-lang/rust#40422 6 years ago because of issues with the MacOS linker. MacOS got a new linker in the meantime, so that should probably be resolved now. Hopefully. r? petrochenkov
2025-05-30Rollup merge of #141746 - Urgau:rework-doc_cfg-checks, r=GuillaumeGomezMatthias Krüger-65/+127
Rework `#[doc(cfg(..))]` checks as distinct pass in rustdoc This PR reworks how rustdoc calls `rustc_attr_parsing::cfg_matches` to be in a separate pass, instead of being wired-up in a ad-hoc way, which is causing problems in https://github.com/rust-lang/rust/pull/138907#issuecomment-2920026627. This un-does most part of https://github.com/rust-lang/rust/pull/140894, but the result is IMO much cleaner, easier to reason about, and most importantly no longer interfears with rust-lang/rust#138907. r? `@GuillaumeGomez`
2025-05-30Rollup merge of #141736 - onur-ozkan:resolve-stage0-syroot-from-rustc, r=KobzolMatthias Krüger-1/+3
resolve stage0 sysroot from rustc Similar to https://github.com/rust-lang/rust/pull/141729, instead of manually navigating directories based on stage0 rustc, use `--print sysroot` to get the sysroot directly. This also works when using the bootstrap `rustc` shim. r? Kobzol
2025-05-30Rollup merge of #141719 - Berrysoft:cygwin-tls-model, r=mati865Matthias Krüger-1/+4
Add tls_model for cygwin and enable has_thread_local I've also tried to set `has_thread_local` to `true` and found it works actually. Why do we still implement our own `thread_local` instead of delegating all of them to LLVM? cc: `@jeremyd2019`
2025-05-30Rollup merge of #141703 - compiler-errors:deref-place, r=lcnrMatthias Krüger-45/+115
Structurally normalize types as needed in `projection_ty_core` Introduce a `structurally_normalize` callback to `projection_ty_core`, and then use it before we match on the ty kind in `projection_ty_core`. Previously we were only structurally normalizing the return type of the `handle_field` struct, but if we were to (e.g.) apply a deref projection to that type, then the resulting type is not guaranteed to be structurally normalized and any subsequent projections applied would ICE. Fixes https://github.com/rust-lang/trait-system-refactor-initiative/issues/221 I'll leave a few comments inline to explain the changes. r? lcnr --- Also fixes rust-lang/rust#141708
2025-05-30Auto merge of #141573 - nnethercote:rustdoc-alloc-cleanups, r=camelidbors-146/+140
rustdoc: cleanups relating to allocations These commits generally clean up the code a bit and also reduce allocation rates a bit. r? `@camelid`
2025-05-30Auto merge of #141753 - matthiaskrgr:rollup-bw4j2u0, r=matthiaskrgrbors-1322/+2060
Rollup of 8 pull requests Successful merges: - rust-lang/rust#133823 (Use `cfg_attr_trace` in AST with a placeholder attribute for accurate suggestion) - rust-lang/rust#141004 (Report text_direction_codepoint_in_literal when parsing) - rust-lang/rust#141407 (Refactor the two-phase check for impls and impl items) - rust-lang/rust#141430 (remove `visit_clobber` and move `DummyAstNode` to `rustc_expand`) - rust-lang/rust#141507 (atomic_load intrinsic: use const generic parameter for ordering) - rust-lang/rust#141538 (implement `va_arg` for x86_64 systemv) - rust-lang/rust#141669 (float: Replace some approximate assertions with exact) - rust-lang/rust#141747 (rustdoc: display doc(cfg(false)) properly) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-30Rollup merge of #141747 - lolbinarycat:rustdoc-cfg-138112, r=GuillaumeGomezMatthias Krüger-3/+25
rustdoc: display doc(cfg(false)) properly before we had an extra 'on' that was ungramatical. fixes https://github.com/rust-lang/rust/issues/138112 this is what it looks like now: ![screenshot: Available nowhere](https://github.com/user-attachments/assets/e27b4990-09a7-4f13-8bcf-26d44c8c1bea)
2025-05-30Rollup merge of #141669 - tgross35:float-test-cleanup, r=RalfJungMatthias Krüger-717/+680
float: Replace some approximate assertions with exact As was mentioned at [1], we currently use `assert_approx_eq` for testing some math functions that guarantee exact results. Replace approximate assertions with exact ones for the following: * `ceil` * `floor` * `fract` * `from_bits` * `mul_add` * `round_ties_even` * `round` * `trunc` This likely wasn't done in the past to avoid writing out exact decimals that don't match the intuitive answer (e.g. 1.3 - 1.0 = 0.300...004), but ensuring our results are accurate seems more important here. [1]: https://github.com/rust-lang/rust/pull/138087#issuecomment-2842069281 The first commit is a small bit of macro cleanup. try-job: aarch64-gnu try-job: x86_64-gnu-aux
2025-05-30Rollup merge of #141538 - folkertdev:systemv-x86_64-va_arg, r=workingjubileeMatthias Krüger-11/+331
implement `va_arg` for x86_64 systemv tracking issue: https://github.com/rust-lang/rust/issues/44930 Turns out LLVM's `va_arg` is also unreliable for this target. https://github.com/llvm/llvm-project/issues/141361 So, like clang, we implement our own. I used - the spec at https://gitlab.com/x86-psABIs/x86-64-ABI - the clang implementation at https://github.com/llvm/llvm-project/blob/9a440f84773c56d3803f330774acb2b4f471d5b4/clang/lib/CodeGen/Targets/X86.cpp#L3041 We can take a bunch of shortcuts because the return type of `va_list` must implement `VaArgSafe`. I also extended some of the tests, because up to 11 floats can be stored in the `reg_safe_area` for this calling convention. r? `@workingjubilee` `@rustbot` label +F-c_variadic try-job: x86_64-apple-1
2025-05-30Rollup merge of #141507 - RalfJung:atomic-intrinsics, r=bjorn3Matthias Krüger-105/+210
atomic_load intrinsic: use const generic parameter for ordering We have a gazillion intrinsics for the atomics because we encode the ordering into the intrinsic name rather than making it a parameter. This is particularly bad for those operations that take two orderings. Let's fix that! This PR only converts `load`, to see if there's any feedback that would fundamentally change the strategy we pursue for the const generic intrinsics. The first two commits are preparation and could be a separate PR if you prefer. `@BoxyUwU` -- I hope this is a use of const generics that is unlikely to explode? All we need is a const generic of enum type. We could funnel it through an integer if we had to but an enum is obviously nicer... `@bjorn3` it seems like the cranelift backend entirely ignores the ordering?
2025-05-30Rollup merge of #141430 - fee1-dead-contrib:push-nmzoprvtsvww, r=petrochenkovMatthias Krüger-146/+95
remove `visit_clobber` and move `DummyAstNode` to `rustc_expand` `visit_clobber` is not really useful except for one niche purpose involving generic code. We should just use the replace logic where we can.
2025-05-30Rollup merge of #141407 - mu001999-contrib:dead-code/refactor, r=petrochenkovMatthias Krüger-133/+181
Refactor the two-phase check for impls and impl items Refactor the two-phase dead code check to make the logic clearer and simpler: 1. adding assoc fn and impl into `unsolved_items` directly during the initial construction of the worklist 2. converge the logic of checking whether assoc fn and impl are used to `item_should_be_checked`, and the item is considered used only when its corresponding trait and Self adt are used This PR only refactors as much as possible to avoid affecting the original functions. However, due to the adjustment of the order of checks, the test results are slightly different, but overall, there is no regression problem Fixes rust-lang/rust#127911 Fixes rust-lang/rust#128839 Extracted from https://github.com/rust-lang/rust/pull/128637. r? petrochenkov try-job: dist-aarch64-linux
2025-05-30Rollup merge of #141004 - matthewjasper:unicode-before-expansion, r=davidtwcoMatthias Krüger-180/+311
Report text_direction_codepoint_in_literal when parsing The lint is now reported in code that gets removed/modified/duplicated by macro expansion, and spans are more accurate so we don't get ICEs from trying to split a span in the middle of a character. This removes support for lint level attributes for `text_direction_codepoint_in_literal` except at the crate level, I don't think that there's an easy way around this when the lint can be reported on code that's removed by `cfg` or that is only in the input of a macro. Fixes #140281
2025-05-30Rollup merge of #133823 - estebank:issue-56328, r=petrochenkovMatthias Krüger-27/+227
Use `cfg_attr_trace` in AST with a placeholder attribute for accurate suggestion In rust-lang/rust#138515, we insert a placeholder attribute so that checks for attributes can still know about the placement of `cfg` attributes. When we suggest removing items with `cfg_attr`s (fix rust-lang/rust#56328) and make them verbose. We tweak the wording of the existing "unused `extern crate`" lint. ``` warning: unused `extern crate` --> $DIR/removing-extern-crate.rs:9:1 | LL | extern crate removing_extern_crate as foo; | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ unused | note: the lint level is defined here --> $DIR/removing-extern-crate.rs:6:9 | LL | #![warn(rust_2018_idioms)] | ^^^^^^^^^^^^^^^^ = note: `#[warn(unused_extern_crates)]` implied by `#[warn(rust_2018_idioms)]` help: remove the unused `extern crate` | LL - #[cfg_attr(test, macro_use)] LL - extern crate removing_extern_crate as foo; | ``` r? `@petrochenkov` try-job: x86_64-gnu-aux
2025-05-30Address review comments.Nicholas Nethercote-6/+6
2025-05-30Auto merge of #141651 - compiler-errors:less-assert, r=lcnrbors-11/+12
Make some assertions in solver into debug assertions These may or may not be expensive :> r? lcnr
2025-05-29Auto merge of #141739 - GuillaumeGomez:rollup-ivboqwd, r=GuillaumeGomezbors-275/+348
Rollup of 11 pull requests Successful merges: - rust-lang/rust#137574 (Make `std/src/num` mirror `core/src/num`) - rust-lang/rust#141384 (Enable review queue tracking) - rust-lang/rust#141448 (A variety of improvements to the codegen backends) - rust-lang/rust#141636 (avoid some usages of `&mut P<T>` in AST visitors) - rust-lang/rust#141676 (float: Disable `total_cmp` sNaN tests for `f16`) - rust-lang/rust#141705 (Add eslint as part of `tidy` run) - rust-lang/rust#141715 (Add `loongarch64` with `d` feature to `f32::midpoint` fast path) - rust-lang/rust#141723 (Provide secrets to try builds with new bors) - rust-lang/rust#141728 (Fix false documentation of FnCtxt::diverges) - rust-lang/rust#141729 (resolve target-libdir directly from rustc) - rust-lang/rust#141732 (creader: Remove extraenous String::clone) r? `@ghost` `@rustbot` modify labels: rollup
2025-05-29Remove RUSTC_RETRY_LINKER_ON_SEGFAULT hackNoratrieb-57/+2
It looks like this was added 6 years ago because of issues with the MacOS linker. MacOS got a new linker in the meantime, so that should probably be resolved now. Hopefully.
2025-05-29float: Use `assert_biteq!` where possibleTrevor Gross-482/+492
`assert_eq!` ignores the sign of zero, but for any tests involving zeros we do care about this sign. Replace `assert_eq!` with `assert_biteq!` everywhere possible for float tests to ensure we don't miss this. `assert_biteq!` is also updated to check equality on non-NaNs, to catch the unlikely case that bitwise equality works but our `==` implementation is broken. There is one notable output change: we were asserting that `(-0.0).fract()` and `(-1.0).fract()` both return -0.0, but both actually return +0.0.
2025-05-29float: Enable some f16 and f128 rounding tests on miriTrevor Gross-60/+26
The rounding tests are now supported, so there is no longer any reason to skip these.
2025-05-29float: Replace some approximate assertions with exactTrevor Gross-276/+276
As was mentioned at [1], we currently use `assert_approx_eq` for testing some math functions that guarantee exact results. Replace approximate assertions with exact ones for the following: * `ceil` * `floor` * `fract` * `from_bits` * `mul_add` * `round_ties_even` * `round` * `trunc` This likely wasn't done in the past to avoid writing out exact decimals that don't match the intuitive answer (e.g. 1.3 - 1.0 = 0.300...004), but ensuring our results are accurate seems more important here. [1]: https://github.com/rust-lang/rust/pull/138087#issuecomment-2842069281
2025-05-29float: Use a shared `assert_biteq!` macro for testsTrevor Gross-176/+163
Clean up the separate `assert_f{16,32,64,128}` macros with a single `assert_biteq!` macro that works for all float widths.
2025-05-29rustdoc: display doc(cfg(false)) properlybinarycat-3/+25
before we had an extra 'on' that was ungramatical. fixes https://github.com/rust-lang/rust/issues/138112
2025-05-29implement `va_arg` for x86_64 systemv and macOSFolkert de Vries-4/+326
Turns out LLVM's `va_arg` is also unreliable for this target, so we need our own implementation.
2025-05-29Rework `#[doc(cfg(..))]` checks as distinct pass in rustdocUrgau-65/+127
2025-05-29Auto merge of #141490 - compiler-errors:bump-pgo, r=Kobzolbors-11/+11
Bump rustc-perf and update PGO crates Updates rustc-perf to rust-lang/rustc-perf@8158f78f738715c060d230351623a7f7cc01bf97, and updates the crates. r? `@Kobzol`
2025-05-30Add tls_model for cygwin and enable has_thread_localBerrysoft-1/+4