Commit graph

283107 commits

Author SHA1 Message Date
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
Peter Jaszkowiak
596c14ade4 fix RangeBounds::is_empty documentation
One-sided ranges are never empty
2025-03-01 14:38:07 -07:00
Michael Toner
6f505ba767 ensure we always print all --print options in help 2025-03-01 12:05:51 -06:00
Taiki Endo
6f7fd11474 rustc_target: Add msync target feature and enable it on powerpcspe targets 2025-03-02 03:03:52 +09:00
Lukas Wirth
e6a0fc58ec
Merge pull request #19251 from Veykril/push-tkmpqtzxynxk
Remove syntax editing from parenthesis computation
2025-03-01 17:46:07 +00:00
Lukas Wirth
a565f7f9c6
Merge pull request #19257 from Veykril/push-myvwxskworsn
internal: Cleanup some syntax highlighting things
2025-03-01 17:43:31 +00:00
Lukas Wirth
629baf217c Remove syntax editing from parenthesis computation 2025-03-01 18:32:04 +01:00
Lukas Wirth
28a5eeb157 Fix test_keyword_highlighting test 2025-03-01 18:29:47 +01:00
Lukas Wirth
497f14013c Cleanup string handling in syntax highlighting 2025-03-01 17:44:29 +01:00
Lukas Wirth
b0e3526f32 More precise macro modifiers for syntax highlighting 2025-03-01 17:23:51 +01:00
Lukas Wirth
08eeb8f3b2 Cleanup highlighting macro-def handling 2025-03-01 16:54:40 +01:00
Matthias Krüger
5bdde89544
Rollup merge of #137840 - fee1-dead-contrib:push-uwkzouvnrnvs, r=oli-obk
triagebot: only ping me for constck

Per the [Zulip thread](https://rust-lang.zulipchat.com/#narrow/channel/146212-t-compiler.2Fconst-eval/topic/rustbot.20pings).

cc `@rust-lang/wg-const-eval.`
2025-03-01 16:03:21 +01:00