| Age | Commit message (Collapse) | Author | Lines |
|
|
|
Revert "Auto merge of #129827 - bvanjoi:less-decoding, r=petrochenkov"
Reverting https://github.com/rust-lang/rust/pull/129827 because of a performance regression.
This reverts commit d4812c8638173ec163825d56a72a33589483ec4c, reversing changes made to 5cc60728e7ee10eb2ae5f61f7d412d9805b22f0c.
r? `@petrochenkov`
|
|
Reverting because of a performance regression.
This reverts commit d4812c8638173ec163825d56a72a33589483ec4c, reversing
changes made to 5cc60728e7ee10eb2ae5f61f7d412d9805b22f0c.
|
|
Set `target_vendor = "openwrt"` on `mips64-openwrt-linux-musl`
OpenWRT is a Linux distribution for embedded network devices. The target name contains `openwrt`, so we should set `cfg(target_vendor = "openwrt")`.
This is similar to what other Linux distributions do (the only one in-tree is `x86_64-unikraft-linux-musl`, but that sets `target_vendor = "unikraft"`).
Motivation: To make correctly [parsing target names](https://github.com/rust-lang/cc-rs/pull/1413) simpler.
Fixes https://github.com/rust-lang/rust/issues/131165.
CC target maintainer `@Itus-Shield`
|
|
rustc_target: Add more RISC-V vector-related features and use zvl*b target features in vector ABI check
Currently, we have only unstable `v` target feature, but RISC-V have more vector-related extensions. The first commit of this PR adds them to unstable `riscv_target_feature`.
- `unaligned-vector-mem`: Has reasonably performant unaligned vector
- [LLVM definition](https://github.com/llvm/llvm-project/blob/llvmorg-20.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L1379)
- Similar to currently unstable `unaligned-scalar-mem` target feature, but for vector instructions.
- `zvfh`: Vector Extension for Half-Precision Floating-Point
- [ISA Manual](https://github.com/riscv/riscv-isa-manual/blob/riscv-isa-release-2336fdc-2025-03-19/src/v-st-ext.adoc#zvfh-vector-extension-for-half-precision-floating-point)
- [LLVM definition](https://github.com/llvm/llvm-project/blob/llvmorg-20.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L668)
- This implies `zvfhmin` and `zfhmin`
- `zvfhmin`: Vector Extension for Minimal Half-Precision Floating-Point
- [ISA Manual](https://github.com/riscv/riscv-isa-manual/blob/riscv-isa-release-2336fdc-2025-03-19/src/v-st-ext.adoc#zvfhmin-vector-extension-for-minimal-half-precision-floating-point)
- [LLVM definition](https://github.com/llvm/llvm-project/blob/llvmorg-20.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L662)
- This implies `zve32f`
- `zve32x`, `zve32f`, `zve64x`, `zve64f`, `zve64d`: Vector Extensions for Embedded Processors
- [ISA Manual](https://github.com/riscv/riscv-isa-manual/blob/riscv-isa-release-2336fdc-2025-03-19/src/v-st-ext.adoc#zve-vector-extensions-for-embedded-processors)
- [LLVM definitions](https://github.com/llvm/llvm-project/blob/llvmorg-20.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L612-L641)
- `zve32x` implies `zvl32b`
- `zve32f` implies `zve32x` and `f`
- `zve64x` implies `zve32x` and `zvl64b`
- `zve64f` implies `zve32f` and `zve64x`
- `zve64d` implies `zve64f` and `d`
- `v` implies `zve64d`
- `zvl*b`: Minimum Vector Length Standard Extensions
- [ISA Manual](https://github.com/riscv/riscv-isa-manual/blob/riscv-isa-release-2336fdc-2025-03-19/src/v-st-ext.adoc#zvl-minimum-vector-length-standard-extensions)
- [LLVM definitions](https://github.com/llvm/llvm-project/blob/llvmorg-20.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L600-L610)
- `zvl{N}b` implies `zvl{N>>1}b`
- `v` implies `zvl128b`
- Vector Cryptography and Bit-manipulation Extensions
- [ISA Manual](https://github.com/riscv/riscv-isa-manual/blob/riscv-isa-release-2336fdc-2025-03-19/src/vector-crypto.adoc)
- [LLVM definitions](https://github.com/llvm/llvm-project/blob/llvmorg-20.1.0/llvm/lib/Target/RISCV/RISCVFeatures.td#L679-L807)
- `zvkb`: Vector Bit-manipulation used in Cryptography
- This implies `zve32x`
- `zvbb`: Vector basic bit-manipulation instructions
- This implies `zvkb`
- `zvbc`: Vector Carryless Multiplication
- This implies `zve64x`
- `zvkg`: Vector GCM instructions for Cryptography
- This implies `zve32x`
- `zvkned`: Vector AES Encryption & Decryption (Single Round)
- This implies `zve32x`
- `zvknha`: Vector SHA-2 (SHA-256 only))
- This implies `zve32x`
- `zvknhb`: Vector SHA-2 (SHA-256 and SHA-512)
- This implies `zve64x`
- This is superset of `zvknha`, but doesn't imply that feature at least in LLVM
- `zvksed`: SM4 Block Cipher Instructions
- This implies `zve32x`
- `zvksh`: SM3 Hash Function Instructions
- This implies `zve32x`
- `zvkt`: Vector Data-Independent Execution Latency
- Similar to already stabilized scalar cryptography extension `zkt`.
- `zvkn`: Shorthand for 'Zvkned', 'Zvknhb', 'Zvkb', and 'Zvkt'
- Similar to already stabilized scalar cryptography extension `zkn`.
- `zvknc`: Shorthand for 'Zvkn' and 'Zvbc'
- `zvkng`: shorthand for 'Zvkn' and 'Zvkg'
- `zvks`: shorthand for 'Zvksed', 'Zvksh', 'Zvkb', and 'Zvkt'
- Similar to already stabilized scalar cryptography extension `zks`.
- `zvksc`: shorthand for 'Zvks' and 'Zvbc'
- `zvksg`: shorthand for 'Zvks' and 'Zvkg'
Also, our vector ABI check wants `zvl*b` target features, the second commit of this PR updates vector ABI check to use them.
https://github.com/rust-lang/rust/blob/4e2b096ed6c8a1400624a54f6c4fd0c0ce48a579/compiler/rustc_target/src/target_features.rs#L707-L708
---
r? `@Amanieu`
`@rustbot` label +O-riscv +A-target-feature
|
|
Rollup of 7 pull requests
Successful merges:
- #137928 (stabilize const_cell)
- #138431 (Fix `uclibc` LLVM target triples)
- #138832 (Start using `with_native_path` in `std::sys::fs`)
- #139081 (std: deduplicate `errno` accesses)
- #139100 (compiletest: Support matching diagnostics on lines below)
- #139105 (`BackendRepr::is_signed`: comment why this may panics)
- #139106 (Mark .pp files as Rust)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Mark .pp files as Rust
Pretty-printing tests generate `.pp` files, but GitHub classify and highlight them as Pascal:
[https://github.com/search?q=repo:rust-lang/rust+path:*.pp&type=code](https://github.com/search?q=repo%3Arust-lang%2Frust+path%3A*.pp&type=code)
``@rustbot`` label +A-meta +A-testsuite
|
|
`BackendRepr::is_signed`: comment why this may panics
Was wondering why this method could panics while the others couldn't, so quote PR #70189.
|
|
compiletest: Support matching diagnostics on lines below
Using `//~vvv ERROR`.
This is not needed often, but it's easy to support, and it allows to eliminate a class of `error-pattern`s that cannot be eliminated in any other way.
See the diff for the examples of such patterns coming from parser.
Some of them can be matched by `//~ ERROR` or `//~^ ERROR` as well (when the final newline is allowed), but it changes the shape of reported spans, so I chose to keep the spans by using `//~v ERROR`.
|
|
std: deduplicate `errno` accesses
By marking `__errno_location` as `#[ffi_const]` and `std::sys::os::errno` as `#[inline]`, this PR allows merging multiple calls to `io::Error::last_os_error()` into one.
|
|
Start using `with_native_path` in `std::sys::fs`
Ideally, each platform should use their own native path type internally. This will, for example, allow passing a `CStr` directly to `std::fs::File::open` and therefore avoid the need for allocating a new null-terminated C string.
However, doing that for every function and platform all at once makes for a large PR that is way too prone to breaking. So this PR does some minimal refactoring which should help progress towards that goal. The changes are Unix-only and even then I avoided functions that require more changes so that this PR is just moving things around.
r? joboet
|
|
Fix `uclibc` LLVM target triples
`uclibc` is not an environment understood by LLVM, it is only a concept in Clang that can be selected with `-muclibc` (it affects which dynamic linker is passed to the static linker's `-dynamic-linker` flag).
In fact, using `uclibcgnueabi`/`uclibc` is actively harmful, as it prevents LLVM from seeing that the target is gnu-like; we should use `gnueabi`/`gnu` directly instead.
Motivation: To make it easier to verify that [`cc-rs`' conversion from `rustc` to Clang/LLVM triples](https://github.com/rust-lang/cc-rs/issues/1431) is correct.
**There are no target maintainers for these targets.** So I'll CC ``@lancethepants`` and ``@skrap`` who maintain the related `armv7-unknown-linux-uclibceabi` and `armv7-unknown-linux-uclibceabihf` (both of which already pass `-gnu` instead of `-uclibc`) in case they have any insights.
r? jieyouxu
|
|
stabilize const_cell
``@rust-lang/libs-api`` ``@rust-lang/wg-const-eval`` I see no reason to wait any longer, so I propose we stabilize the use of `Cell` in `const fn` -- specifically the APIs listed here:
```rust
// core::cell
impl<T> Cell<T> {
pub const fn replace(&self, val: T) -> T;
}
impl<T: Copy> Cell<T> {
pub const fn get(&self) -> T;
}
impl<T: ?Sized> Cell<T> {
pub const fn get_mut(&mut self) -> &mut T;
pub const fn from_mut(t: &mut T) -> &Cell<T>;
}
impl<T> Cell<[T]> {
pub const fn as_slice_of_cells(&self) -> &[Cell<T>];
}
```
Unfortunately, `set` cannot be made `const fn` yet as it drops the old contents.
Fixes https://github.com/rust-lang/rust/issues/131283
|
|
Implement `alloc::sync::UniqueArc`
This implements the `alloc::sync::UniqueArc` part of #112566.
|
|
perform less decoding if it has the same syntax context
Following this [comment](https://github.com/rust-lang/rust/pull/127279#issuecomment-2210376603)
r? `@petrochenkov`
|
|
|
|
Rollup of 7 pull requests
Successful merges:
- #138692 (Reject `{true,false}` as revision names)
- #138757 (wasm: increase default thread stack size to 1 MB)
- #138988 (Change the syntax of the internal `weak!` macro)
- #139056 (use `try_fold` instead of `fold`)
- #139057 (use `slice::contains` where applicable)
- #139086 (Various cleanup in ExprUseVisitor)
- #139097 (Add more tests for pin!().)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|
|
|
|
Add more tests for pin!().
This adds the tests suggested by `@danielhenrymantilla` in this comment: https://github.com/rust-lang/rust/pull/138717#discussion_r2005433640 by
|
|
r=compiler-errors
Various cleanup in ExprUseVisitor
These are the non-behavior-changing commits from #138961.
|
|
use `slice::contains` where applicable
Applies the [`manual_contains`](https://rust-lang.github.io/rust-clippy/master/index.html#manual_contains) clippy lint, plus some small drive-bys.
|
|
use `try_fold` instead of `fold`
Small cleanup, applies the [`manual_try_fold`](https://rust-lang.github.io/rust-clippy/master/index.html#manual_try_fold) clippy lint.
|
|
Change the syntax of the internal `weak!` macro
Change the syntax to include parameter names and a trailing semicolon.
Motivation:
- Mirror the `syscall!` macro.
- Allow rustfmt to format it (when wrapped in parentheses, and when not inside `cfg_if!`).
- For better documentation (having the parameter names available in the source code is a bit nicer).
- Allow a future improvement to this macro where we can sometimes use the symbol directly when it's statically known to be available (and thus need the parameter names to be available), see https://github.com/rust-lang/rust/pull/136868.
r? libs
|
|
wasm: increase default thread stack size to 1 MB
The default stack size for the [main thread is 1 MB as specified by linker options](https://github.com/rust-lang/rust/blob/38cf49dde8a5b0b284bb6dffd423d223c9f8f7a3/compiler/rustc_target/src/spec/base/wasm.rs#L14).
However, the default stack size for threads was only 64 kB.
This is surprisingly small and thus we increase it to 1 MB to match the main thread.
|
|
Reject `{true,false}` as revision names
Because they would imply `--cfg={true,false}` otherwise, and the test writer has to use `cfg(r#true)` and `cfg(r#false)` in the test.
Closes #138663.
|
|
Remove `terminating_scopes` hash set.
Instead of inserting and checking ids in a hashset, we can just pass a boolean as argument.
For example:
```diff
- visitor.terminating_scopes.insert(arm.hir_id.local_id);
- visitor.enter_node_scope_with_dtor(arm.hir_id.local_id);
+ visitor.enter_node_scope_with_dtor(arm.hir_id.local_id, true);
```
|
|
|
|
|
|
Co-authored-by: Daniel Henry-Mantilla <daniel.henry.mantilla@gmail.com>
|
|
Bump to 1.88
https://forge.rust-lang.org/release/process.html#bump-the-stable-version-number-friday-the-week-before
r? ghost
|
|
|
|
Bump boostrap `cc` to 1.2.17 and `cmake` to 0.1.54
The `cc` version in `bootstrap` was reverted down to 1.1.22 in https://github.com/rust-lang/rust/pull/137460 (previously at 1.2.0). The offending issue has since then been resolved in https://github.com/rust-lang/cc-rs/pull/1413, and a new version of `cc` has been released in https://github.com/rust-lang/cc-rs/pull/1435, so let's try to update the version again.
See [the `cc-rs` changelog](https://github.com/rust-lang/cc-rs/blob/d9dd20e376368c7535f6ef89b809098f5f203c1a/CHANGELOG.md) and [the `cmake-rs` changelog](https://github.com/rust-lang/cmake-rs/blob/fd56c5a6b4ecda8815c863eb5b12d7b3f0391197/CHANGELOG.md) for details on what has changed here.
r? jieyouxu who tried this last in https://github.com/rust-lang/rust/pull/137022.
`@rustbot` label T-bootstrap
try-job: *apple*
|
|
|
|
Rollup of 8 pull requests
Successful merges:
- #138976 (Explain one-past-the-end pointer in std library)
- #139052 (Put pin!() tests in the right file.)
- #139058 (Fix formatting nit in process.rs)
- #139063 (Fix TAIT & ATPIT feature gating in the presence of anon consts)
- #139065 (Miri subtree update)
- #139069 (`io::Take`: avoid new `BorrowedBuf` creation in some case)
- #139075 (Do not treat lifetimes from parent items as influencing child items)
- #139079 (tracking autodiff files via triagebot.toml)
Failed merges:
- #139044 (bootstrap: Avoid cloning `change-id` list)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
tracking autodiff files via triagebot.toml
r? `@oli-obk`
Tracking:
- https://github.com/rust-lang/rust/issues/124509
|
|
Do not treat lifetimes from parent items as influencing child items
```rust
struct A;
impl Bar<'static> for A {
const STATIC: &str = "";
// ^ no future incompat warning
}
```
has no future incompat warning, because there is no ambiguity. But
```rust
struct C;
impl Bar<'_> for C {
// ^^ this lifeimte
const STATIC: &'static str = {
struct B;
impl Bar<'static> for B {
const STATIC: &str = "";
// causes ^ to emit a future incompat warning
}
""
};
}
```
had one before this PR, because the impl for `B` (which is just a copy of `A`) thought it was influenced by a lifetime on the impl for `C`.
I double checked all other `lifetime_ribs` iterations and all of them do check for `Item` boundaries. This feels very fragile tho, and ~~I think we should do not even be able to see ribs from parent items, but that's a different refactoring that I'd rather not do at the same time as a bugfix~~. EDIT: ah nevermind, this is needed for improving diagnostics like "use of undeclared lifetime" being "can't use generic parameters from outer item" instead.
r? `@compiler-errors`
|
|
`io::Take`: avoid new `BorrowedBuf` creation in some case
If `self.limit == buf.capacity()`, doing the whole `BorrowedBuf` dance is not necessary.
|
|
Miri subtree update
r? `@ghost`
|
|
Fix TAIT & ATPIT feature gating in the presence of anon consts
Fixes #139055 (https://github.com/rust-lang/rust/issues/119924#issuecomment-1928659690).
r? oli-obk or anybody else
|
|
Fix formatting nit in process.rs
Minor formatting issue in `process.rs`.
|
|
Put pin!() tests in the right file.
In #138717, these tests were put in `tests/pin.rs`, but they should go in `tests/pin_macro.rs`.
r? `@jdonszelmann`
|
|
Explain one-past-the-end pointer in std library
Closing #138969
r? libs
|
|
By marking `__errno_location` as `#[ffi_const]` and `std::sys::os::errno` as `#[inline]`, this PR allows merging multiple calls to `io::Error::last_os_error()` into one.
|
|
|
|
|
|
|
|
|
|
Rollup of 7 pull requests
Successful merges:
- #137889 (update outdated doc with new example)
- #138104 (Greatly simplify doctest parsing and information extraction)
- #138678 (rustc_resolve: fix instability in lib.rmeta contents)
- #138986 (feat(config): Add ChangeId enum for suppressing warnings)
- #139038 (Update target maintainers for thumb targets to reflect new REWG Arm team name)
- #139045 (bootstrap: update `test_find` test)
- #139047 (Remove ScopeDepth)
Failed merges:
- #139044 (bootstrap: Avoid cloning `change-id` list)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
|