1
Fork 0
Commit graph

281739 commits

Author SHA1 Message Date
Nicholas Nethercote
627e08c909 Remove BasicBlockData::expand_statements.
The previous commit removed its single use. `MirPatch` is a more
flexible alternative.
2025-02-18 13:13:32 +11:00
Nicholas Nethercote
e3316ae453 Improve MirPatch documentation and naming.
It's currently lacking comments. This commit adds some, which is useful
because there are some methods with non-obvious behaviour.

The commit also renames two things:
- `patch_map` becomes `term_patch_map`, because it's only about
  terminators.
- `is_patched` becomes `is_term_patched`, for the same reason.

(I would guess that originally `MirPatch` only handled terminators, and
then over time it expanded to allow other modifications, but these names
weren't updated.)
2025-02-18 13:12:50 +11:00
Nicholas Nethercote
a1daa34ad0 Use MirPatch in EnumSizeOpt.
Instead of `expand_statements`. This makes the code shorter and
consistent with other MIR transform passes.

The tests require updating because there is a slight change in
MIR output:
- the old code replaced the original statement with twelve new
  statements.
- the new code inserts converts the original statement to a `nop` and
  then insert twelve new statements in front of it.

I.e. we now end up with an extra `nop`, which doesn't matter at all.
2025-02-18 12:52:56 +11:00
bors
de91711756 Auto merge of #137176 - matthiaskrgr:rollup-eht05gr, r=matthiaskrgr
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-18 00:05:30 +00:00
Nicholas Nethercote
fd7b4bf4e1 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.
2025-02-18 10:17:44 +11:00
Jubilee Young
59e9eb9b2b cg_clif: use exclusively ABI alignment 2025-02-17 15:10:51 -08:00
Yotam Ofek
c0b1c6eed5 librustdoc: more usages of Joined::joined 2025-02-17 22:53:52 +00:00
Eric Huss
123217b3b8 Fix what looks like an inverted message
I believe this is trying to say there is something that is in the file,
but shouldn't be.
2025-02-17 10:58:57 -08:00
Eric Huss
2773456f5f Move error_index_generator to the rustbook workspace
I had forgotten that error_index_generator is using mdbook. This moves
it to be part of the rustbook workspace so that it can share the
dependency with rustbook.
2025-02-17 10:58:15 -08:00
Eric Huss
32b1bffa11 Update mdbook to 0.4.45
Changelog: https://github.com/rust-lang/mdBook/blob/master/CHANGELOG.md#mdbook-0445
2025-02-17 10:47:48 -08:00
Yotam Ofek
4a76615054 coalesce match patterns with identical bodies 2025-02-17 18:38:13 +00:00
Yotam Ofek
a7a43cd373 use Iterator::zip instead of enumerating+indexing 2025-02-17 18:38:13 +00:00
Urgau
a0a8e02e66 Install more signal stack trace handlers 2025-02-17 18:58:31 +01:00
Michael Goulet
b002b5cc82 Deeply normalize associated type bounds before proving them 2025-02-17 17:21:24 +00:00
Michael Goulet
2cdb7fac95 Prefer param-env candidates even when alias's trait bound isn't proven via param-env 2025-02-17 16:59:17 +00:00
Matthias Krüger
fc829035c1
Rollup merge of #137173 - lnicola:sync-from-ra, r=lnicola
Subtree update of `rust-analyzer`

r? `@ghost`
2025-02-17 17:06:14 +01:00
Matthias Krüger
10cc816cef
Rollup merge of #137170 - ferrocene:pa-target-jemalloc, r=Kobzol
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-17 17:06:13 +01:00
Matthias Krüger
8d72b7cb42
Rollup merge of #137169 - ojeda:rfl, r=lqd
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-17 17:06:13 +01:00
Matthias Krüger
7808784f01
Rollup merge of #137168 - klensy:rc--, r=lcnr
correct comment

Rc was removed in #113573, so
r? `@lcnr`
2025-02-17 17:06:12 +01:00
Matthias Krüger
652c8b6866
Rollup merge of #137166 - nikic:loongarch-code-model, r=workingjubilee
Update default loongarch code model in docs

Since https://github.com/rust-lang/rust/pull/130266 loongarch defaults to medium code model.
2025-02-17 17:06:11 +01:00
Matthias Krüger
10018d8e10
Rollup merge of #137165 - thaliaarchi:file-tell, r=ChrisDenton
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-17 17:06:10 +01:00
Matthias Krüger
97962d7643
Rollup merge of #137073 - niklaskorz:bootstrap-doc-fix-empty-no-std, r=clubby789
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-17 17:06:10 +01:00
Matthias Krüger
48543dd66d
Rollup merge of #137020 - ferrocene:pa-vendor-sources, r=Kobzol
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-17 17:06:09 +01:00
Matthias Krüger
005de3877d
Rollup merge of #136959 - nnethercote:simplify-SwitchSources, r=tmiasko
Simplify switch sources

`SwitchSources` and the code around it can be simplified.

r? `@tmiasko`
2025-02-17 17:06:08 +01:00
bors
ce36a966c7 Auto merge of #135763 - nikic:llvm-20, r=cuviper
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-17 14:19:33 +00:00
Pietro Albini
92f31b95c9
use the shared vendor impl for plan source tarballs 2025-02-17 14:52:02 +01:00
Thalia Archibald
7112474134 Use tell for <File as Seek>::stream_position 2025-02-17 05:25:14 -08:00
Laurențiu Nicola
e08736d70d
Merge pull request #19170 from lnicola/update-lockfile
minor: Update lockfile
2025-02-17 13:06:12 +00:00
Laurențiu Nicola
bce3d0ff1c Update lockfile 2025-02-17 14:50:39 +02:00
Laurențiu Nicola
0c9c489355
Merge pull request #19169 from lnicola/sync-from-rust
minor: Sync from downstream
2025-02-17 12:30:13 +00:00
Laurențiu Nicola
952bfae057 Bump rustc crates 2025-02-17 14:11:12 +02:00
WANG Rui
1873bd3720 Default to the medium code model for the loongarch64-linux toolchains
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-17 12:42:00 +01:00
Lukas Wirth
2a0d16f3c4
Merge pull request #19167 from ChayimFriedman2/fix-ref-pat
fix: Fix detection of ref patterns for path patterns
2025-02-17 11:23:18 +00:00
Laurențiu Nicola
b571e8a8ac Merge from rust-lang/rust 2025-02-17 13:20:12 +02:00
Laurențiu Nicola
19fa3deab3 Preparing for merge from rust-lang/rust 2025-02-17 13:20:07 +02:00
bors
2162e9d4b1 Auto merge of #137164 - matthiaskrgr:rollup-dj5826k, r=matthiaskrgr
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-17 11:18:33 +00:00
Martin Nordholts
f6485ff617 tests: Also gate f16::erfc() doctest with reliable_f16_math cfg
In 136324 the doctest for `f16::erf()` was gated with
`reliable_f16_math`. Add the same gate on `f16::erfc()` to
avoid:

    rust_out.71e2e529d20ea47d-cgu.0:\
    (.text._ZN8rust_out4main43_doctest_main_library_std_src_f16_rs_1321_017h485f3ffe6bf2a981E+0x38): \
    undefined reference to `__gnu_h2f_ieee'

on MIPS (and maybe other architectures).
2025-02-17 11:59:09 +01:00
Pietro Albini
a71de77ae9
allow configuring jemalloc per target 2025-02-17 11:43:49 +01:00
Pietro Albini
33e7f9bc66
generate-copyright: pass the vendored sources from bootstrap 2025-02-17 11:00:21 +01:00
Chayim Refael Friedman
b7a9a32126 Fix detection of ref patterns for path patterns
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-17 11:51:29 +02:00
Lukas Wirth
c7a2986c20
Merge pull request #19158 from PoignardAzur/expaned_pub_glob_imports
Implement expand_glob_reexport assist
2025-02-17 09:46:29 +00:00
Miguel Ojeda
f46c7652d5 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.

Signed-off-by: Miguel Ojeda <ojeda@kernel.org>
2025-02-17 10:46:01 +01:00
Lukas Wirth
d7fb8f15c7
Merge pull request #19122 from Austaras/master
pass struct fields to chalk
2025-02-17 09:37:55 +00:00
klensy
6fa3ad1e5e correct comment 2025-02-17 12:32:26 +03:00
Nikita Popov
9cbc310314 Update default loongarch code model in docs
Since https://github.com/rust-lang/rust/pull/130266 loongarch
defaults to medium code model.
2025-02-17 09:57:13 +01:00
Lukas Wirth
123f17c57b
Merge pull request #19127 from ChayimFriedman2/different-generic-args
feat: Refactor path lowering and serve a new path diagnostic
2025-02-17 08:30:10 +00:00
bors
273465e1f2 Auto merge of #137163 - matthiaskrgr:rollup-ovgfkns, r=matthiaskrgr
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-17 08:10:13 +00:00
Laurențiu Nicola
6b46937305
Merge pull request #19166 from ChayimFriedman2/runnables-order
fix: Fix sorting of runnables
2025-02-17 05:58:35 +00:00
Jiri Bobek
7bb5f4dd78 improve cold_path() 2025-02-17 06:39:58 +01:00
Matthias Krüger
183fc30867
Rollup merge of #137149 - Noratrieb:wtf-is-this-target, r=RalfJung
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-17 06:38:17 +01:00