about summary refs log tree commit diff
AgeCommit message (Collapse)AuthorLines
2025-02-23downgrade bootstrap `cc`onur-ozkan-3/+5
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-02-18Auto merge of #133852 - x17jiri:cold_path, r=saethlinbors-15/+230
improve cold_path() #120370 added a new instrinsic `cold_path()` and used it to fix `likely` and `unlikely` However, in order to limit scope, the information about cold code paths is only used in 2-target switch instructions. This is sufficient for `likely` and `unlikely`, but limits usefulness of `cold_path` for idiomatic rust. For example, code like this: ``` if let Some(x) = y { ... } ``` may generate 3-target switch: ``` switch y.discriminator: 0 => true branch 1 = > false branch _ => unreachable ``` and therefore marking a branch as cold will have no effect. This PR improves `cold_path()` to work with arbitrary switch instructions. Note that for 2-target switches, we can use `llvm.expect`, but for multiple targets we need to manually emit branch weights. I checked Clang and it also emits weights in this situation. The Clang's weight calculation is more complex that this PR, which I believe is mainly because `switch` in `C/C++` can have multiple cases going to the same target.
2025-02-18Auto merge of #137162 - nnethercote:remove-Map-2, r=Zalatharbors-346/+314
Move methods from `Map` to `TyCtxt`, part 2. Continuing the work started in #136466. Every method gains a `hir_` prefix, though for the ones that already have a `par_` or `try_par_` prefix I added the `hir_` after that. r? Zalathar
2025-02-18Auto merge of #137176 - matthiaskrgr:rollup-eht05gr, r=matthiaskrgrbors-3088/+9812
Rollup of 9 pull requests Successful merges: - #136959 (Simplify switch sources) - #137020 (Pass vendored sources from bootstrap to generate-copyright) - #137073 (boostrap: skip no_std targets in Std doc step) - #137165 (Use `tell` for `<File as Seek>::stream_position`) - #137166 (Update default loongarch code model in docs) - #137168 (correct comment) - #137169 (CI: rfl: move job forward to Linux v6.14-rc3) - #137170 (Allow configuring jemalloc per target) - #137173 (Subtree update of `rust-analyzer`) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-18Move methods from `Map` to `TyCtxt`, part 2.Nicholas Nethercote-346/+314
Continuing the work started in #136466. Every method gains a `hir_` prefix, though for the ones that already have a `par_` or `try_par_` prefix I added the `hir_` after that.
2025-02-17Rollup merge of #137173 - lnicola:sync-from-ra, r=lnicolaMatthias Krüger-2949/+9573
Subtree update of `rust-analyzer` r? `@ghost`
2025-02-17Rollup merge of #137170 - ferrocene:pa-target-jemalloc, r=KobzolMatthias Krüger-4/+24
Allow configuring jemalloc per target In Ferrocene we're trying to switch from `./configure` to a predefined `config.toml` file. One of the limitations of doing that is the `rust.jemalloc` configuration option, which we need to conditionally disable based on the target. This PR adds a `target.$tuple.jemalloc` option to override `rust.jemalloc` to make that possible.
2025-02-17Rollup merge of #137169 - ojeda:rfl, r=lqdMatthias Krüger-2/+2
CI: rfl: move job forward to Linux v6.14-rc3 Linux v6.14-rc3 contains commit 6273a058383e ("x86: rust: set rustc-abi=x86-softfloat on rustc>=1.86.0"), which resolves the error from https://github.com/rust-lang/rust/pull/136146. r? `@lqd` `@Kobzol` try-job: x86_64-rust-for-linux `@rustbot` label A-rust-for-linux `@bors` try
2025-02-17Rollup merge of #137168 - klensy:rc--, r=lcnrMatthias Krüger-3/+1
correct comment Rc was removed in #113573, so r? `@lcnr`
2025-02-17Rollup merge of #137166 - nikic:loongarch-code-model, r=workingjubileeMatthias Krüger-1/+1
Update default loongarch code model in docs Since https://github.com/rust-lang/rust/pull/130266 loongarch defaults to medium code model.
2025-02-17Rollup merge of #137165 - thaliaarchi:file-tell, r=ChrisDentonMatthias Krüger-1/+34
Use `tell` for `<File as Seek>::stream_position` Some platforms have a more efficient way to get the current offset of the file than by seeking. For example, Wasi has `fd_tell` and SOLID has `SOLID_FS_Ftell`. Implement `<File as Seek>::stream_position()` in terms of those. I do not use any APIs that were not already used in `std`. Although, the `libc` crate has [`ftell`](https://docs.rs/libc/latest/libc/fn.ftell.html), [`ftello`](https://docs.rs/libc/latest/libc/fn.ftello.html), and [`ftello64`](https://docs.rs/libc/latest/libc/fn.ftello64.html), I do not know platform coverage. It appears that Windows has no `tell`-like API. I have checked that it builds on each relevant platform.
2025-02-17Rollup merge of #137073 - niklaskorz:bootstrap-doc-fix-empty-no-std, r=clubby789Matthias Krüger-0/+4
boostrap: skip no_std targets in Std doc step This fixes a bug that currently prevents us from adding no_std library targets to rustc in nixpkgs (https://github.com/NixOS/nixpkgs/pull/382166). When running `./x.py doc`, the `Std` doc step generally fails for no_std targets, logs: https://gist.github.com/niklaskorz/fb83f9503ce19b75e8b1af02cdebd592 Skipping no_std targets in this step will allow using no_std targets such as `bpfel-unknown-none` together with other targets in the same config without blocking the doc generator for them, e.g. ``` ./configure --release-channel=stable --tools=rustc,rustdoc,rust-analyzer-proc-macro-srv --build=aarch64-apple-darwin --host=aarch64-apple-darwin --target=aarch64-apple-darwin,bpfel-unknown-none ./x.py doc ``` Logs with this fix applied: https://gist.github.com/niklaskorz/cdd50aaea33ede579f737434286d800b
2025-02-17Rollup merge of #137020 - ferrocene:pa-vendor-sources, r=KobzolMatthias Krüger-82/+105
Pass vendored sources from bootstrap to generate-copyright In addition to doing the vendoring in bootstrap, this PR also loads the list of manifests to parse from bootstrap (instead of hardcoding a smaller list in generate-copyright). This is best reviewed commit-by-commit. Fixes https://github.com/rust-lang/rust/issues/136955
2025-02-17Rollup merge of #136959 - nnethercote:simplify-SwitchSources, r=tmiaskoMatthias Krüger-46/+68
Simplify switch sources `SwitchSources` and the code around it can be simplified. r? `@tmiasko`
2025-02-17Auto merge of #135763 - nikic:llvm-20, r=cuviperbors-9/+17
Update to LLVM 20 LLVM 20 GA is scheduled for March 11th. Rust 1.87 will be stable on May 15th. * [x] https://github.com/rust-lang/rust/pull/135764 * [x] https://github.com/rust-lang/rust/pull/136134 * [x] https://github.com/rust-lang/compiler-builtins/pull/752 * [x] https://github.com/llvm/llvm-project/pull/125287 * [x] https://github.com/rust-lang/rust/pull/136537 * [x] https://github.com/rust-lang/rust/pull/136895 * [x] Wait for beta branch (Feb 14). Tested: host-x86_64, host-aarch64, apple, mingw, msvc
2025-02-17use the shared vendor impl for plan source tarballsPietro Albini-21/+17
2025-02-17Use tell for <File as Seek>::stream_positionThalia Archibald-1/+34
2025-02-17Merge pull request #19170 from lnicola/update-lockfileLaurențiu Nicola-12/+12
minor: Update lockfile
2025-02-17Update lockfileLaurențiu Nicola-12/+12
2025-02-17Merge pull request #19169 from lnicola/sync-from-rustLaurențiu Nicola-19952/+29737
minor: Sync from downstream
2025-02-17Bump rustc cratesLaurențiu Nicola-5/+5
2025-02-17Default to the medium code model for the loongarch64-linux toolchainsWANG Rui-0/+4
The medium code model is already the default on the Rust side. Make sure that linked in C objects (e.g. from glibc) also use medium code model.
2025-02-17Merge pull request #19167 from ChayimFriedman2/fix-ref-patLukas Wirth-17/+64
fix: Fix detection of ref patterns for path patterns
2025-02-17Merge from rust-lang/rustLaurențiu Nicola-19946/+29731
2025-02-17Preparing for merge from rust-lang/rustLaurențiu Nicola-1/+1
2025-02-17Auto merge of #137164 - matthiaskrgr:rollup-dj5826k, r=matthiaskrgrbors-454/+462
Rollup of 7 pull requests Successful merges: - #137095 (Replace some u64 hashes with Hash64) - #137100 (HIR analysis: Remove unnecessary abstraction over list of clauses) - #137105 (Restrict DerefPure for Cow<T> impl to T = impl Clone, [impl Clone], str.) - #137120 (Enable `relative-path-include-bytes-132203` rustdoc-ui test on Windows) - #137125 (Re-add missing empty lines in the releases notes) - #137145 (use add-core-stubs / minicore for a few more tests) - #137149 (Remove SSE ABI from i586-pc-windows-msvc) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-17allow configuring jemalloc per targetPietro Albini-4/+24
2025-02-17generate-copyright: pass the vendored sources from bootstrapPietro Albini-52/+41
2025-02-17Fix detection of ref patterns for path patternsChayim Refael Friedman-17/+64
I was wrong on #19127, I thought hir-def resolver is enough for them, but it turns out not because of paths like `<Enum>::Variant` and `Type::AssocThatIsEnum::Variant`.
2025-02-17Merge pull request #19158 from PoignardAzur/expaned_pub_glob_importsLukas Wirth-92/+297
Implement expand_glob_reexport assist
2025-02-17CI: rfl: move job forward to Linux v6.14-rc3Miguel Ojeda-2/+2
Linux v6.14-rc3 contains commit 6273a058383e ("x86: rust: set rustc-abi=x86-softfloat on rustc>=1.86.0"), which resolves the error from https://github.com/rust-lang/rust/pull/136146. Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2025-02-17Merge pull request #19122 from Austaras/masterLukas Wirth-20/+37
pass struct fields to chalk
2025-02-17correct commentklensy-3/+1
2025-02-17Update default loongarch code model in docsNikita Popov-1/+1
Since https://github.com/rust-lang/rust/pull/130266 loongarch defaults to medium code model.
2025-02-17Merge pull request #19127 from ChayimFriedman2/different-generic-argsLukas Wirth-1144/+1222
feat: Refactor path lowering and serve a new path diagnostic
2025-02-17Auto merge of #137163 - matthiaskrgr:rollup-ovgfkns, r=matthiaskrgrbors-1098/+1845
Rollup of 7 pull requests Successful merges: - #136466 (Start removing `rustc_middle::hir::map::Map`) - #136671 (Overhaul `rustc_middle::limits`) - #136817 (Pattern Migration 2024: clean up and comment) - #136844 (Use `const_error!` when possible) - #137080 (bootstrap: add more tracing to compiler/std/llvm flows) - #137101 (`invalid_from_utf8[_unchecked]`: also lint inherent methods) - #137140 (Fix const items not being allowed to be called `r#move` or `r#static`) r? `@ghost` `@rustbot` modify labels: rollup
2025-02-17Merge pull request #19166 from ChayimFriedman2/runnables-orderLaurențiu Nicola-11/+4
fix: Fix sorting of runnables
2025-02-17improve cold_path()Jiri Bobek-15/+230
2025-02-17Rollup merge of #137149 - Noratrieb:wtf-is-this-target, r=RalfJungMatthias Krüger-0/+1
Remove SSE ABI from i586-pc-windows-msvc As an i586 target, it should not have SSE. This caused the following warning to be emitted: ``` warning: target feature `sse2` must be enabled to ensure that the ABI of the current target can be implemented correctly | = note: this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release! = note: for more information, see issue #116344 <https://github.com/rust-lang/rust/issues/116344> warning: 1 warning emitted ``` see #116344. r? RalfJung
2025-02-17Rollup merge of #137145 - RalfJung:minicore, r=jieyouxuMatthias Krüger-164/+154
use add-core-stubs / minicore for a few more tests See https://github.com/rust-lang/rust/issues/131485 for context. These are some tests I worked on in the past so I figured I'd see if `minicore` works for them. :)
2025-02-17Rollup merge of #137125 - Urgau:reapply-empty-lines-relnotes, r=Mark-SimulacrumMatthias Krüger-2/+6
Re-add missing empty lines in the releases notes cf. https://github.com/rust-lang/rust/pull/135797#discussion_r1957168194 and https://rust-lang.zulipchat.com/#narrow/channel/241545-t-release/topic/1.2E85/near/499937064
2025-02-17Rollup merge of #137120 - ChrisDenton:its-all-relative, r=GuillaumeGomezMatthias Krüger-3/+3
Enable `relative-path-include-bytes-132203` rustdoc-ui test on Windows The problem with the error message on Windows is: - The path separators are different - The OS error message string is different Normalizing those two things makes the test pass on Windows.
2025-02-17Rollup merge of #137105 - zachs18:cow-derefpure-restrict, r=NadrierilMatthias Krüger-1/+11
Restrict DerefPure for Cow<T> impl to T = impl Clone, [impl Clone], str. Fixes #136046 `feature(deref_patterns)` tracking issue: https://github.com/rust-lang/rust/issues/87121 `Cow<'_, T>` should only implement `DerefPure` if its `Deref` impl is pure, which requires `<T::Owned as Borrow<T>>::borrow` to be pure. This PR restricts `impl DerefPure for Cow<'_, T>` to `T: Sized + Clone`, `T = [U: Clone]`, and `T = str` (for all of whom `<T::Owned as Borrow<T>>::borrow` is implemented in the stdlib and is pure). cc ``@Nadrieril`` ------ An alternate approach would be to introduce a new `unsafe trait BorrowPure<T>` analogous to `DerefPure` that could be implemented for `T: Sized`, `&T`, `&mut T`, `String`, `Vec`, `Box`, `PathBuf`, `OsString`, etc. https://github.com/rust-lang/rust/compare/master...zachs18:borrow-pure-trait
2025-02-17Rollup merge of #137100 - fmease:hirtylow-rm-clauses-wrapper, r=compiler-errorsMatthias Krüger-206/+114
HIR analysis: Remove unnecessary abstraction over list of clauses `rustc_hir_analysis::bounds::Bounds` with its methods is nowadays a paper-thin wrapper around `Vec<(Clause, Span)>`s and `Vec::push` essentially. Its existence slightly annoyed me (and I keep opening its corresp. file instead of the identically named `bounds.rs` in `hir_ty_lowering/` that I actually want most of the time :P). Opening to check if you agree with inlining it. r? compiler-errors or reassign
2025-02-17Rollup merge of #137095 - saethlin:use-hash64-for-hashes, r=workingjubileeMatthias Krüger-78/+173
Replace some u64 hashes with Hash64 I introduced the Hash64 and Hash128 types in https://github.com/rust-lang/rust/pull/110083, essentially as a mechanism to prevent hashes from landing in our leb128 encoding paths. If you just have a u64 or u128 field in a struct then derive Encodable/Decodable, that number gets leb128 encoding. So if you need to store a hash or some other value which behaves very close to a hash, don't store it as a u64. This reverts part of https://github.com/rust-lang/rust/pull/117603, which turned an encoded Hash64 into a u64. Based on https://github.com/rust-lang/rust/pull/110083, I don't expect this to be perf-sensitive on its own, though I expect that it may help stabilize some of the small rmeta size fluctuations we currently see in perf reports.
2025-02-17Rollup merge of #137140 - Noratrieb:const-move, r=jieyouxu,compiler-errorsMatthias Krüger-3/+163
Fix const items not being allowed to be called `r#move` or `r#static` Because of an ambiguity with const closures, the parser needs to ensure that for a const item, the `const` keyword isn't followed by a `move` or `static` keyword, as that would indicate a const closure: ```rust fn main() { const move // ... } ``` This check did not take raw identifiers into account, therefore being unable to distinguish between `const move` and `const r#move`. The latter is obviously not a const closure, so it should be allowed as a const item. This fixes the check in the parser to only treat `const ...` as a const closure if it's followed by the *proper keyword*, and not a raw identifier. Additionally, this adds a large test that tests for all raw identifiers in all kinds of positions, including `const`, to prevent issues like this one from occurring again. fixes #137128
2025-02-17Rollup merge of #137101 - GrigorenkoPV:str-inherent-lint, r=UrgauMatthias Krüger-47/+274
`invalid_from_utf8[_unchecked]`: also lint inherent methods Addressing https://github.com/rust-lang/rust/issues/131114#issuecomment-2646663535 Also corrected a typo: "_an_ invalid literal", not "_a_ invalid literal".
2025-02-17Rollup merge of #137080 - jieyouxu:more-tracing, r=onur-ozkanMatthias Krüger-31/+340
bootstrap: add more tracing to compiler/std/llvm flows - Add more tracing to compiler/std/llvm flows. - Two drive-by nits: 1. Take `TargetSelection` by-value for `builder.is_builder_target()`. Noticed while adding tracing; follow-up to #136767. 2. Coalesce enzyme build logic into one branch. - Document `COMPILER{,_FOR}` tracing targets for #96176. - No functional changes. ### Testing You can play with the tracing locally with: ``` $ BOOTSTRAP_TRACING=bootstrap=debug ./x build library $ BOOTSTRAP_TRACING=bootstrap=trace ./x build library $ BOOTSTRAP_TRACING=bootstrap=trace,COMPILER=trace,COMPILER_FOR=trace ./x build library ``` ### Previews ``` $ BOOTSTRAP_TRACING=bootstrap=debug ./x build library ``` ![Screenshot 2025-02-15 230824](https://github.com/user-attachments/assets/c3b02b62-d52e-4c03-a00a-da0d95618989) ``` $ BOOTSTRAP_TRACING=bootstrap=trace,COMPILER=trace,COMPILER_FOR=trace ./x build library ``` ![Screenshot 2025-02-15 233859](https://github.com/user-attachments/assets/842e4ece-4c26-4191-acbb-5f93e42de4dc) r? ``@onur-ozkan`` (or reroll)
2025-02-17Rollup merge of #136844 - thaliaarchi:const-io-error, r=ChrisDentonMatthias Krüger-106/+90
Use `const_error!` when possible Replace usages of `io::Error::new(io::ErrorKind::Variant, "constant string")` with `io::const_error!(io::ErrorKind::Variant, "constant string")` to avoid allocations when possible. Additionally, fix `&&str` error messages in SGX and missing/misplaced trailing commas in `const_error!`.
2025-02-17Rollup merge of #136817 - dianne:clean-and-comment-pat-migration, r=NadrierilMatthias Krüger-114/+205
Pattern Migration 2024: clean up and comment This follows up on #136577 by moving the pattern migration logic to its own module, removing a bit of unnecessary complexity, and adding comments. Since there's quite a bit of pattern migration logic now (and potentially more in #136496), I think it makes sense to keep it separate from THIR construction, at least as much as is convenient. r? ``@Nadrieril``