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`
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`).
`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)`.
`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
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.
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
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`
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.
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
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.
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.
`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.
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
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>
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.
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
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
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.