1
Fork 0
Commit graph

283180 commits

Author SHA1 Message Date
Laurențiu Nicola
dd3a5f9a64 Merge from rust-lang/rust 2025-03-03 08:38:46 +02:00
Laurențiu Nicola
969868ba30 Preparing for merge from rust-lang/rust 2025-03-03 08:38:14 +02:00
Michael Goulet
0ad48b47e6 Do not recover missing lifetime with random in-scope lifetime 2025-03-03 05:57:55 +00:00
Matthias Krüger
15e97bd45e
Rollup merge of #137826 - karolzwolak:looping_over_ne_bytes_133528, r=DianQK
test(codegen): add looping_over_ne_bytes test for #133528

Adds test for #133528.
I renamed the function to `looping_over_ne_bytes` to better reflect that it is doing.
I also set the min llvm version to 20 as this was presumably a llvm bug that was fixed in version 20.
I didn't tie the test to any specific architecture, as we are testing llvm output.
2025-03-03 06:41:36 +01:00
Matthias Krüger
d818c1da17
Rollup merge of #137801 - petrochenkov:tarmod, r=compiler-errors
tests: Unignore target modifier tests on all platforms

These tests can be `check-pass` and do not need dynamic libraries.
Also remove other unnecessary stuff from them.

Follow up to https://github.com/rust-lang/rust/pull/133138.
2025-03-03 06:41:36 +01:00
Matthias Krüger
65c34bb477
Rollup merge of #137794 - tshepang:make-qnx-pass, r=pietroalbini
make qnx pass a test

[tests/ui/attributes/used_with_archive.rs](b202430084/tests/ui/attributes/used_with_archive.rs) fails when executed for QNX targets, because its stdout does not match [this content](b202430084/tests/ui/attributes/used_with_archive.run.stdout)
2025-03-03 06:41:35 +01:00
Matthias Krüger
f726e5cb84
Rollup merge of #137684 - GuillaumeGomez:rustdoc-dep-info, r=notriddle
Add rustdoc support for `--emit=dep-info[=path]`

Fixes #91982.

This PR adds the `--emit=dep-info` command line flag support. It will be helpful for `cargo` development.

cc ````@epage````

r? ````@notriddle````
2025-03-03 06:41:34 +01:00
Matthias Krüger
962e492847
Rollup merge of #137632 - RalfJung:rustdoc-target-features, r=workingjubilee
rustdoc: when merging target features, keep the highest stability

This addresses https://github.com/rust-lang/rust/issues/137366. (Not closing since we might consider a backport.)

rustdoc wants to pretend that it runs for all targets at once and has all target features, so `tcx.rust_target_features()` will actually be all the target features. For target features that exist on multiple targets, the stability info for one of the targets will be picked (first or last in the list, I guess). All the code consuming that query has to be aware that the data is basically nonsense when running in rustdoc, but the logic checking for unstable or forbidden `#[target_feature]` attributes was not aware of that.

This PR makes the  `tcx.rust_target_features()` info in rustdoc slightly less nonsensical (and decidedly less random) by having the "most stable" target feature take precedent. That deals with #137366 (a conflict between a stable and a "forbidden" target feature of the same name for different targets), and also deals with the situation (that we did not seem to have yet) of a conflict between a stable and an unstable target feature of the same name. Note that if there are two unstable target features of the same name, rustdoc might still require the "wrong" nightly feature to be enabled -- but this can only possibly affect unstable code so I guess we can wait until that actually happens, and then someone will have to rewrite this entire thing to be less hacky.
2025-03-03 06:41:34 +01:00
Matthias Krüger
0447829803
Rollup merge of #137103 - yotamofek:pr/jsonhtmldocck-deprecated-syntax, r=aDotInTheVoid
{json|html}docck: catch and error on deprecated syntax

https://github.com/rust-lang/rust/pull/137099#pullrequestreview-2619498733
2025-03-03 06:41:33 +01:00
bors
81d8edc200 Auto merge of #137900 - matthiaskrgr:rollup-rvan5ao, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #137375 (Minor internal comments fix for `BufRead::read_line`)
 - #137641 (More precisely document `Global::deallocate()`'s safety.)
 - #137755 (doc: update Wasmtime flags)
 - #137851 (improve `simd_select` error message when used with invalid mask type)
 - #137860 (rustc_target: Add msync target feature and enable it on powerpcspe targets)
 - #137871 (fix `RangeBounds::is_empty` documentation)
 - #137873 (Disable `f16` on Aarch64 without `neon`)
 - #137876 (Adjust triagebot.toml entries for `rustc_mir_build/src/builder/`)
 - #137883 (edit mailmap)
 - #137886 (`name()` and `trimmed_name()` for `stable_mir::crate_def::DefId`)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-03 03:41:03 +00:00
Chayim Refael Friedman
c6a7251c22
Merge pull request #19226 from Shourya742/2025-02-25-fix-completion-ref-matching
completion-ref-matching
2025-03-03 02:37:00 +00:00
Michael Goulet
a05a8c80f3 Rename a bit 2025-03-03 01:34:09 +00:00
Michael Goulet
83fa2faf23 Fix pretty printing of unsafe binders 2025-03-03 01:34:09 +00:00
bors
daf59857d6 Auto merge of #137704 - nnethercote:opt-empty-prov-range-checks, r=oli-obk
Optimize empty provenance range checks.

Currently it gets the pointers in the range and checks if the result is empty, but it can be done faster if you combine those two steps.

r? `@oli-obk`
2025-03-02 22:41:17 +00:00
Nicholas Nethercote
53167c0b7f Rename ast::TokenKind::Not as ast::TokenKind::Bang.
For consistency with `rustc_lexer::TokenKind::Bang`, and because other
`ast::TokenKind` variants generally have syntactic names instead of
semantic names (e.g. `Star` and `DotDot` instead of `Mul` and `Range`).
2025-03-03 09:26:13 +11:00
Nicholas Nethercote
2a1e2e9632 Replace ast::TokenKind::BinOp{,Eq} and remove BinOpToken.
`BinOpToken` is badly named, because it only covers the assignable
binary ops and excludes comparisons and `&&`/`||`. Its use in
`ast::TokenKind` does allow a small amount of code sharing, but it's a
clumsy factoring.

This commit removes `ast::TokenKind::BinOp{,Eq}`, replacing each one
with 10 individual variants. This makes `ast::TokenKind` more similar to
`rustc_lexer::TokenKind`, which has individual variants for all
operators.

Although the number of lines of code increases, the number of chars
decreases due to the frequent use of shorter names like `token::Plus`
instead of `token::BinOp(BinOpToken::Plus)`.
2025-03-03 09:26:11 +11:00
Matthias Krüger
59fe0c77bb
Rollup merge of #137886 - NotLebedev:stable-mir-91, r=oli-obk
`name()` and `trimmed_name()` for `stable_mir::crate_def::DefId`

Resolves https://github.com/rust-lang/project-stable-mir/issues/91

* Added `stable_mir::crate_def::DefId::name()`  and  `stable_mir::crate_def::DefId::trimmed_name()`  methods
* Changed `CrateDef` and `DefId` `Debug` implementations to use new methods instead of copy-paste call to `Context::def_name`
* Updated docs to avoid duplicating description of what `name` and `trimmed_name` do
2025-03-02 22:44:28 +01:00
Matthias Krüger
0ed4856bad
Rollup merge of #137883 - jdonszelmann:edit-mailmap, r=Noratrieb
edit mailmap
2025-03-02 22:44:28 +01:00
Matthias Krüger
d031bb3375
Rollup merge of #137876 - Zalathar:triagebot-matches, r=jieyouxu
Adjust triagebot.toml entries for `rustc_mir_build/src/builder/`

I only just noticed that these paths were silently broken by the renaming of `build` to `builder` in #134365.

This is *possibly* OK to just self-approve, but I would prefer to get a second set of eyes on it just in case.
2025-03-02 22:44:27 +01:00
Matthias Krüger
8152da82b5
Rollup merge of #137873 - tgross35:disable-f16-without-neon, r=workingjubilee
Disable `f16` on Aarch64 without `neon`

LLVM has crashes at some `half` operations when built with assertions enabled if fp-armv8 is not available [1]. Things seem to usually work, but we are reaching LLVM undefined behavior so this needs to be disabled.

[1]: https://github.com/llvm/llvm-project/issues/129394
2025-03-02 22:44:26 +01:00
Matthias Krüger
c994a29392
Rollup merge of #137871 - pitaj:rangebounds-is_empty-intersect, r=scottmcm
fix `RangeBounds::is_empty` documentation

One-sided ranges are never empty

follow-up for https://github.com/rust-lang/rust/pull/137304#pullrequestreview-2646899461
2025-03-02 22:44:26 +01:00
Matthias Krüger
1762f018f7
Rollup merge of #137860 - taiki-e:powerpcspe-msync, r=workingjubilee
rustc_target: Add msync target feature and enable it on powerpcspe targets

Some older PowerPC processors do not have the `sync` (`sync 0`) and `lwsync` (`sync 1`) instructions, but instead have the `msync` instruction. (IIRC `msync` and `sync` will be assembled into the same bit-pattern, but `lwsync` will be SIGILL. See also https://gcc.gnu.org/legacy-ml/gcc-patches/2006-11/msg01238.html.)

LLVM recognizes this as the [`msync` feature](cc5d8a4b2f/llvm/lib/Target/PowerPC/PPC.td (L140)) and enables for some cpus such as [e500](cc5d8a4b2f/llvm/lib/Target/PowerPC/PPC.td (L644)).

powerpcspe is a target for CPUs such as e500 ([Debian Wiki](https://wiki.debian.org/PowerPCSPEPort)). However, the `msync` feature is currently not enabled except for vxworks, and at least since 2022-04, powerpc-unknown-linux-gnuspe was known to not work on real hardware without `-C target-cpu` (e.g., #96394, #117361).

8c392966a0/compiler/rustc_target/src/spec/targets/powerpc_wrs_vxworks_spe.rs (L28)

Fixes #117361

cc `@BKPepe` ([powerpc-unknown-linux-muslspe target maintainer](https://doc.rust-lang.org/nightly/rustc/platform-support/powerpc-unknown-linux-muslspe.html#target-maintainers))
cc `@glaubitz` (who added powerpc-unknown-linux-gnuspe in https://github.com/rust-lang/rust/pull/48484)
cc `@th0ma7` (who opened #117361)

r? workingjubilee

`@rustbot` label +O-PowerPC +A-target-feature
2025-03-02 22:44:25 +01:00
Matthias Krüger
bb089d7a92
Rollup merge of #137851 - folkertdev:simd-intrinsic-mask-signed, r=workingjubilee
improve `simd_select` error message when used with invalid mask type

followup to https://github.com/rust-lang/rust/pull/137828

This PR improves the error message for an invalid `simd_select` mask type, and adds testing for `simd_scatter` and `simd_gather` being used with invalid mask types.

the `simd_masked_load` and `simd_masked_store` intrinsics already generated a better error message:

0c72c0d11a/tests/ui/simd/masked-load-store-build-fail.rs (L24-L37)

r? `@workingjubilee`
2025-03-02 22:44:25 +01:00
Matthias Krüger
bb091f26c8
Rollup merge of #137755 - DaniPopes:wasmtime-threads-flag, r=Noratrieb
doc: update Wasmtime flags

Wasmtime's `--wasm-features` and `--wasi-modules` flags have been renamed since these docs were initially written.

Additionally, from my testing I don't believe `--wasm threads` is needed if `--wasi threads` is passed already.
2025-03-02 22:44:24 +01:00
Matthias Krüger
e8134a3380
Rollup merge of #137641 - kpreid:dealloc, r=Amanieu
More precisely document `Global::deallocate()`'s safety.

There is a subtlety which "other conditions must be upheld by the caller" does not capture: `GlobalAlloc`/`alloc::dealloc()` require that the provided layout will be *equal*, not just that it "fits", the layout used to allocate. This is always true here due to how `allocate()`, `grow()`, and `shrink()` are implemented (they never return a larger allocation than requested), but that is a non-local property of the implementation, so it should be documented explicitly.

r? libs

`@rustbot` label A-allocators
2025-03-02 22:44:24 +01:00
Matthias Krüger
f47c7e8564
Rollup merge of #137375 - steffahn:clarify-read_line-comment, r=Mark-Simulacrum
Minor internal comments fix for `BufRead::read_line`

Just a little fix that came up while I was reading through this source code, and had to search for a few minutes to find out what was actually *meant* here.
2025-03-02 22:44:23 +01:00
Michael Goulet
5f575bc4bc Add a test 2025-03-02 18:53:49 +00:00
Michael Goulet
a59a8f9e75 Revert "Auto merge of #135335 - oli-obk:push-zxwssomxxtnq, r=saethlin"
This reverts commit a7a6c64a65, reversing
changes made to ebbe63891f.
2025-03-02 18:52:48 +00:00
bors
f4a216d28e Auto merge of #137661 - nikic:llvm20-rc3, r=cuviper
Update to LLVM 20 rc 3

Fixes a compiler-builtins miscompile (see https://github.com/rust-lang/compiler-builtins/pull/760).
2025-03-02 15:52:42 +00:00
Laurențiu Nicola
a43a5f9aef
Merge pull request #19266 from the-mikedavis/lsp-pull-diagnostics-identifier
Add `identifier` to pull diagnostic LSP capabilities
2025-03-02 14:51:59 +00:00
Michael Davis
1c00d8ffd6
Add identifier to pull diagnostic LSP capabilities
This field in the server capabilities instructs the client to maintain
the diagnostics received from a `textDocument/diagnostic` pull request
as a separate set from other diagnostics: namely those sent with classic
"push" diagnostics, `textDocument/publishDiagnostic`. rust-analyzer
emits "native" diagnostics (computed by rust-analyzer itself) in pull
diagnostics and separately emits cargo-based diagnostics with push, so
push and pull diagnostics should be different sets. Setting this field
instructs the client to avoid clearing push diagnostics when new pull
diagnostics arrive and vice versa.
2025-03-02 09:27:45 -05:00
Laurențiu Nicola
5c124a3b00
Merge pull request #19264 from lnicola/theme-color
minor: Fix transparent diagnostics
2025-03-02 14:21:42 +00:00
Laurențiu Nicola
6c1e5b4edb Fix transparent diagnostics 2025-03-02 16:05:59 +02:00
bors
7c4a55c2ac Auto merge of #137425 - yotamofek:pr/rustdoc/return-impl-display-redux, r=GuillaumeGomez
`librustdoc`: return `impl fmt::Display` in more places instead of writing to strings

Continuation of #136784 , another attempt at landing the larger parts of #136748 .
I'd like to, gradually, make all of the building blocks for rendering docs in `librustdoc` return `impl fmt::Display` instead of returning `Strings`, or receiving a `&mut String` (or `&mut impl fmt::Write`). Another smaller end goal is to be able to get rid of [`write_str`](8dac72bb1d/src/librustdoc/html/format.rs (L40-L42)).
This PR is a large step in that direction.

Most of the changes are quite mechanical, and split up into separate commits for easier reviewing (hopefully). I took `print_item` and then started by converting all the functions it called (and their dependencies), and the last commit does the conversion for `print_item` itself. Ignoring whitespace should make reviewing a bit easier.

And most importantly, perf run shows pretty good results locally, hopefully CI will also show green 😁

r? `@GuillaumeGomez` , if you feel like it.
2025-03-02 12:35:48 +00:00
Moulins
cbe32a7647 Remove layouting dead code for non-array SIMD types.
These aren't supported anymore, and are already rejected in type checking.
2025-03-02 12:50:14 +01:00
onur-ozkan
cfb475c1d2 extend scope of build_all test
Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-03-02 14:41:23 +03:00
NotLebedev
a3378f5938
Remove duplication in name/trimmed_anem docs
Reference `DefId` in `CrateDef` docs to avoid duplicating long
description of `trimmed_name`
2025-03-02 13:02:20 +03:00
bors
4b696e6bf7 Auto merge of #136864 - Kobzol:citool, r=marcoieni
Rewrite the `ci.py` script in Rust

It would seem that I would learn by now that any script written in Python will become unmaintainable sooner or later, but alas..

r? `@marcoieni`

try-job: aarch64-gnu
try-job: dist-x86_64-linux-alt
try-job: x86_64-msvc-ext2

Fixes: https://github.com/rust-lang/rust/issues/137013
2025-03-02 09:18:02 +00:00
NotLebedev
141d2f3f02
Replace usages of Context.def_name
Use `DefId.name` and `DefId.trimmed_name` instead
2025-03-02 12:11:18 +03:00
NotLebedev
298fb8af65
Add name and trimmed_name methods to DefId 2025-03-02 12:11:14 +03:00
Jana Dönszelmann
4d0a1af920
edit mailmap 2025-03-02 10:03:01 +01:00
onur-ozkan
ef028d79d6 do not build additional stage on compiler paths
When calling `x build compiler (or rustc) --stage N` bootstrap builds stage N+1 compiler,
which is clearly not what we requested. This doesn't happen when running `x build --stage N`
without explicitly targeting the compiler.

The changes applied fix this issue.

Signed-off-by: onur-ozkan <work@onurozkan.dev>
2025-03-02 08:27:40 +00:00
Lukas Wirth
768749f41d
Merge pull request #19259 from Veykril/push-skmvrmtorqso
Add flip or-pattern assist
2025-03-02 07:41:42 +00:00
Lukas Wirth
7d8e95806c
Merge pull request #19253 from ShoyuVanilla/migrate-convert-bool-then
internal: Migrate `convert_bool_then` to `SyntaxEditor`
2025-03-02 07:21:04 +00:00
Lukas Wirth
1b85befbd9 Add flip or-pattern assist 2025-03-02 08:04:27 +01:00
Trevor Gross
7603e0104a Simplify parallelization in test-float-parse
Currently, test case generators are launched in parallel and their test
cases also run in parallel, all within the same pool. I originally
implemented this with the assumption that there would be an advantage in
parallelizing the generators themselves, but this turns out to not
really have any benefit.

Simplify things by running generators in series while keeping their test
cases parallelized. This makes the code easier to follow, and there is
no longer a need for MPSC or multiprogress bars. Additionally, the UI
output can be made cleaner.
2025-03-02 06:13:25 +00:00
Zalathar
60798272d6 Adjust triagebot.toml entries for rustc_mir_build/src/builder/ 2025-03-02 14:27:53 +11:00
bors
1c3b035542 Auto merge of #137855 - matthiaskrgr:rollup-uh7f3fi, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - #137804 (rename BackendRepr::Vector → SimdVector)
 - #137807 (Fully qualify `Result` in generated doctest code)
 - #137809 (Use correct error message casing for `io::const_error`s)
 - #137818 (tests: adapt for LLVM 21 changes)
 - #137822 (Update query normalizer docs to not position it as the greatest pioneer in the space of normalization)
 - #137824 (Tweak invalid RTN errors)
 - #137828 (Fix inaccurate `std::intrinsics::simd` documentation)
 - #137830 (Fix link failure on AVR (incompatible ISA error))
 - #137837 (Update `const_conditions` and `explicit_implied_const_bounds` docs)
 - #137840 (triagebot: only ping me for constck)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-03-02 01:39:49 +00:00
Trevor Gross
c51b229140 Disable f16 on Aarch64 without neon
LLVM has crashes at some `half` operations when built with assertions
enabled if fp-armv8 is not available [1]. Things seem to usually work,
but we are reaching LLVM undefined behavior so this needs to be
disabled.

[1]: https://github.com/llvm/llvm-project/issues/129394
2025-03-01 23:10:21 +00:00
bors
351686bcfd Auto merge of #137752 - flip1995:clippy-subtree-update, r=Manishearth
Clippy subtree update

? `@Manishearth`

Cargo.lock change because of Clippy version bump and rustc_tool_utils new release.

Fixes #137640

Would be nice, if we could this merged before nightly is being build, so that this ICE is fixed tomorrow.
2025-03-01 22:22:06 +00:00