| Age | Commit message (Collapse) | Author | Lines |
|
print raw lifetime idents with r#
This replaces rust-lang/rust#143185 and fixes rust-lang/rust#143150
cc ``@fmease``
|
|
Implementation: `#[feature(nonpoison_rwlock)]`
Tracking Issue: https://github.com/rust-lang/rust/issues/134645
This PR continues the effort made in https://github.com/rust-lang/rust/pull/144022 by adding the implementation of `nonpoison::rwlock`.
Many of the changes here are similar to the changes made to implement `nonpoison::mutex`. The only real difference is that this PR includes a reorganizing of the existing `poison::rwlock` file that hopefully makes both variants more readable.
### Related PRs
- `nonpoison_condvar` implementation: https://github.com/rust-lang/rust/pull/144651
- `nonpoison_once` implementation: https://github.com/rust-lang/rust/pull/144653
|
|
Convert moves of references to copies in ReferencePropagation
This is a fix for https://github.com/rust-lang/rust/issues/141101.
The root cause of this miscompile is that the SsaLocals analysis that MIR transforms use is supposed to detect locals that are only written to once, in their single assignment. But that analysis is subtly wrong; it does not consider `Operand::Move` to be a write even though the meaning ascribed to `Operand::Move` (at least as a function parameter) by Miri is that the callee may have done arbitrary writes to the caller's Local that the Operand wraps (because `Move` is pass-by-pointer). So Miri conwiders `Operand::Move` to be a write but both the MIR visitor system considers it a read, and so does SsaLocals.
I have tried fixing this by changing the `PlaceContext` that is ascribed to an `Operand::Move` to a `MutatingUseContext` but that seems to have borrow checker implications, and changing SsaLocals seems to have wide-ranging regressions in MIR optimizations.
So instead of doing those, this PR adds a new kludge to ReferencePropagation, which follows the same line of thinking as the kludge in CopyProp that solves this same problem inside that pass: https://github.com/rust-lang/rust/blob/a5584a8fe16037dc01782064fa41424a6dbe9987/compiler/rustc_mir_transform/src/copy_prop.rs#L65-L98
|
|
Fix host code appearing in Wasm binaries
This is a direct fix for issue [132802](https://github.com/rust-lang/rust/issues/132802).
Followed the outline as follows:
> * give a hard error in bootstrap when using gcc to compile for wasm
> * change our CI to use clang instead of gcc
> * add a test that compiling a sample program for wasm32-unknown doesn't give any linker warnings
The `test-various` ci job was also changed.
try-job: test-various
try-job: dist-various-1
try-job: dist-various-2
try-job: x86_64-msvc-1
|
|
Recover `param: Ty = EXPR`
Fixes #137310
Pretty basic recovery here, but better than giving an unexpected token error.
|
|
Fix overly restrictive lifetime in `core::panic::Location::file` return type
Fixes #131770 by relaxing the lifetime to match what's stored in the struct. See that issue for more details and discussion.
Since this is a breaking change, I think a crater run is in order. Since this change should only have an effect at compile-time, I think just a check run is sufficient.
|
|
Only unpack span data once to compute end_point and next_point.
Split from https://github.com/rust-lang/rust/pull/144930
|
|
|
|
Remove default config from bootstrap
This PR removes the default config initialization from parse_inner, as it introduced many assumptions during config setup. Instead, each variable is now manually initialized to eliminate certain invariants in parse_inner and streamline the process.
r? `@Kobzol`
|
|
Clippy subtree update
r? `@Manishearth`
|
|
clippy-subtree-update
|
|
Letting rustbot assign a reviewer, so that someone can double check
9de86f40d7e1a2cbcc308e39fdbc7447d691c527.
changelog: none
|
|
|
|
|
|
|
|
|
|
Rewrite the new attribute argument parser
Fixes https://github.com/rust-lang/rust/issues/143940
This rewrites the parser, should improve performance and maintainability.
This can be reviewed commit by commit
|
|
|
|
Closes rust-lang/rust-clippy#14553
Closes rust-lang/rust-clippy#14554
changelog: [`unnecessary_safety_comment`] fix FN for the first line in
file
|
|
Sort mono items by symbol name
Trying to claw back cycles/branch/cache miss losses from https://github.com/rust-lang/rust/pull/144722.
|
|
|
|
|
|
remove redundant word in comment
changelog: none
|
|
|
|
Signed-off-by: xihuwenhua <xihuwenhua@outlook.com>
|
|
|
|
|
|
|
|
|
|
rustc_expand: ensure stack in `InvocationCollector::visit_expr`
In Fedora, when we built rustc with PGO on ppc64le, we started failing
the test `issue-74564-if-expr-stack-overflow.rs`. This could also be
reproduced on other arches by setting a smaller `RUST_MIN_STACK`, so
it's probably just unlucky that ppc64le PGO created a large stack frame
somewhere in this recursion path. Adding an `ensure_sufficient_stack`
solves the stack overflow.
Historically, that test and its fix were added in rust-lang/rust#74708,
which was also an `ensure_sufficient_stack` in this area of code at the
time. However, the refactor in rust-lang/rust#92573 basically left that
to the general `MutVisitor`, and then rust-lang/rust#142240 removed even
that ensure call. It may be luck that our tier-1 tested targets did not
regress the original issue across those refactors.
|
|
Rollup of 16 pull requests
Successful merges:
- rust-lang/rust#137494 (libstd: init(): dup() subsequent /dev/nulls instead of opening them again)
- rust-lang/rust#144541 (c-variadic: multiple ABIs in the same program for arm)
- rust-lang/rust#144613 (aarch64-nintendo-switch-freestanding - Enable CPU features that are always available in a live system (crypto instructions, plus explicit NEON).)
- rust-lang/rust#144780 (Add a method to dump MIR in the middle of MIR building)
- rust-lang/rust#145137 (Consolidate panicking functions in `slice/index.rs`)
- rust-lang/rust#145507 (Refactor attribute parsing to improve ergonomics and some diagnostics)
- rust-lang/rust#145604 (Gate static closures behind a parser feature)
- rust-lang/rust#145648 (Add two tidy dependency checks)
- rust-lang/rust#145661 (update some s390x codegen tests)
- rust-lang/rust#145672 (Instantiate higher-ranked binder with erased when checking `IntoIterator` predicate for query instability)
- rust-lang/rust#145689 (Migrate `panic_unwind` to use `cfg_select!`)
- rust-lang/rust#145700 (Handle `ReEarlyParam` in `type_name`.)
- rust-lang/rust#145703 (Remove MIPS targets from CI LLVM platforms)
- rust-lang/rust#145704 (ci: don't cleanup windows disk)
- rust-lang/rust#145705 (remove an `as` cast in prefetch codegen)
- rust-lang/rust#145712 (Update outdated link in bound region comments)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
changelog: none
|
|
use `iter::zip`
use `Option::filter`
use `Option::is_some_and`
match in two steps
|
|
Update outdated link in bound region comments
While reading the implementation code for bound regions, I found that a link in the comments was outdated. I've updated it with a link to the corresponding documentation in the rustc dev guide that covers the same content.
prev link: https://rustc-dev-guide.rust-lang.org/early-late-bound-params/early-late-bound-summary.html (404 error)
updated: https://rustc-dev-guide.rust-lang.org/early_late_parameters.html
|
|
remove an `as` cast in prefetch codegen
r? `@RalfJung`
|
|
ci: don't cleanup windows disk
|
|
Remove MIPS targets from CI LLVM platforms
All of these were demoted to tier 3 a while ago and we aren't building LLVM for them anymore.
|
|
Handle `ReEarlyParam` in `type_name`.
Fixes rust-lang/rust#145696.
r? `@lcnr`
|
|
Migrate `panic_unwind` to use `cfg_select!`
This follows rust-lang/rust#145489 with an additional place we can drop the `cfg-if` dependency.
|
|
Instantiate higher-ranked binder with erased when checking `IntoIterator` predicate for query instability
Fixes https://github.com/rust-lang/rust/issues/145652 which was introduced by https://github.com/rust-lang/rust/pull/139345 because we were skipping a binder before calling `Instance::try_resolve`.
r? lcnr
|
|
update some s390x codegen tests
By using `minicore`, `&raw` and removing use of `link_llvm_intrinsics`
|
|
Add two tidy dependency checks
Deny duplicate dependencies for the standard library as it would almost certainly bloat executables. And deny proc-macro dependencies for the standard library as they would break cross-compilation.
|
|
Gate static closures behind a parser feature
I'd like to gate `static ||` closures behind a feature gate, since we shouldn't allow people to take advantage of this syntax if it's currently unstable. Right now, since it's only rejected after ast lowering, it's accessible to macros.
Let's crater this to see if we can claw it back without breaking anyone's code.
|
|
Refactor attribute parsing to improve ergonomics and some diagnostics
|
|
Consolidate panicking functions in `slice/index.rs`
Consolidate all the panicking functions in `slice/index.rs` to use a single `slice_index_fail` function, similar to how it is done in `str/traits.rs`.
Split off from https://github.com/rust-lang/rust/pull/145024
|
|
Add a method to dump MIR in the middle of MIR building
This makes it easier to debug issues with MIR building by inserting dump_for_debugging calls around the suspected code responsible for the bad MIR.
|
|
aarch64-nintendo-switch-freestanding - Enable CPU features that are always available in a live system (crypto instructions, plus explicit NEON).
~~While some NEON and crypto features may not be supported on the Nintendo Switch at boot (e.g. on the a53 cores) and this has not been tested, the features will _always_ be available if running as a sysmodule or homebrew application under Horizon/Atmosphere.~~ EDIT: the a53 cores are fused out, these features are always available.
This has been tested with local tools personally, as well as building [emuiibo](https://github.com/XorTroll/emuiibo) as it uses both `sha` and `aes` primitives. This was tested using inline assembly in previous versions, and in current versions by using the `aes`, `ctr`, `hmac`, and `sha2` crates.
r? `@jam1garner`
This ended up being much delayed from our discussions about updating this. I tested a number of individual features such as the `aes` and `sha2` target-features directly to avoid a warning message with the `crypto` feature, but that appears to be caused by https://github.com/rust-lang/rust/issues/96472 and is not actually an issue.
There is also a decision to make here about explicitly enabling the `neon` feature. I am in favor of it to be explicit, but it is not necessary as it is already enabled by the `v8a` and `crypto` features. I will defer to your decision as it does not change the actual instructions available for codegen.
|
|
folkertdev:c-variadic-same-program-multiple-abis-arm, r=RalfJung,davidtwco
c-variadic: multiple ABIs in the same program for arm
similar to https://github.com/rust-lang/rust/pull/144379, but for arm, requested in https://github.com/rust-lang/rust/pull/144066.
Quoting https://github.com/rust-lang/reference/issues/1946#issuecomment-3124555690
> `"aapcs"` specifically refers to the soft-float ABI where floating-point values are passed in integer registers.
However for c-variadic functions, `aapcs` behaves the same as `C`:
https://github.com/ARM-software/abi-aa/blob/main/aapcs32/aapcs32.rst#65parameter-passing
> A variadic function is always marshaled as for the base standard.
https://github.com/ARM-software/abi-aa/blob/main/aapcs32/aapcs32.rst#7the-standard-variants
> This section applies only to non-variadic functions. For a variadic function the base standard is always used both for argument passing and result return.
---
I also noticed that rustc currently emit more instructions than clang for c-variadic functions on arm, see https://godbolt.org/z/hMce9rnTh. I'll fix that separately. (edit: https://github.com/rust-lang/rust/pull/144549)
try-job: armhf-gnu
r? `@RalfJung`
|
|
libstd: init(): dup() subsequent /dev/nulls instead of opening them again
This will be faster, and also it deduplicates the code so win/win
The dup() is actually infallible here. But whatever.
Before:
```
poll([{fd=0, events=0}, {fd=1, events=0}, {fd=2, events=0}], 3, 0) = 1 ([{fd=2, revents=POLLNVAL}])
openat(AT_FDCWD, "/dev/null", O_RDWR) = 2
rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f5749313050}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
poll([{fd=0, events=0}, {fd=1, events=0}, {fd=2, events=0}], 3, 0) = 2 ([{fd=0, revents=POLLNVAL}, {fd=2, revents=POLLNVAL}])
openat(AT_FDCWD, "/dev/null", O_RDWR) = 0
openat(AT_FDCWD, "/dev/null", O_RDWR) = 2
rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7efe12006050}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
poll([{fd=0, events=0}, {fd=1, events=0}, {fd=2, events=0}], 3, 0) = 3 ([{fd=0, revents=POLLNVAL}, {fd=1, revents=POLLNVAL}, {fd=2, revents=POLLNVAL}])
openat(AT_FDCWD, "/dev/null", O_RDWR) = 0
openat(AT_FDCWD, "/dev/null", O_RDWR) = 1
openat(AT_FDCWD, "/dev/null", O_RDWR) = 2
rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7fc2dc7ca050}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
```
After:
```
poll([{fd=0, events=0}, {fd=1, events=0}, {fd=2, events=0}], 3, 0) = 1 ([{fd=1, revents=POLLNVAL}])
openat(AT_FDCWD, "/dev/null", O_RDWR) = 1
rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f488a3fb050}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
poll([{fd=0, events=0}, {fd=1, events=0}, {fd=2, events=0}], 3, 0) = 2 ([{fd=1, revents=POLLNVAL}, {fd=2, revents=POLLNVAL}])
openat(AT_FDCWD, "/dev/null", O_RDWR) = 1
dup(1) = 2
rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f1a8943c050}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
poll([{fd=0, events=0}, {fd=1, events=0}, {fd=2, events=0}], 3, 0) = 3 ([{fd=0, revents=POLLNVAL}, {fd=1, revents=POLLNVAL}, {fd=2, revents=POLLNVAL}])
openat(AT_FDCWD, "/dev/null", O_RDWR) = 0
dup(0) = 1
dup(0) = 2
rt_sigaction(SIGPIPE, {sa_handler=SIG_IGN, sa_mask=[PIPE], sa_flags=SA_RESTORER|SA_RESTART, sa_restorer=0x7f4e3a4c7050}, {sa_handler=SIG_DFL, sa_mask=[], sa_flags=0}, 8) = 0
```
|
|
changelog: none
r? ghost
|