| Age | Commit message (Collapse) | Author | Lines |
|
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
|
|
Signed-off-by: xizheyin <xizheyin@smail.nju.edu.cn>
|
|
Port `#[path]` to the new attribute parsing infrastructure
Ports `#[path]` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197
This PR duplicates a change from https://github.com/rust-lang/rust/pull/143237
Draft until that one is merged
|
|
Align attr fixes
- Remove references to the superseded `repr(align)` syntax
- Allow the attribute on fn items in `extern` blocks
- Test attribute in combination with `async fn` and `dyn`
r? workingjubilee
Tracking issue: https://github.com/rust-lang/rust/issues/82232
`@rustbot` label A-attributes F-fn_align T-compiler
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
|
|
Do not unify borrowed locals in CopyProp.
Instead of trying yet another scheme to unify borrowed locals in CopyProp, let's just stop trying. We had already enough miscompilations because of this.
I'm convinced it's possible to have both unification of some borrowed locals and soundness, but I don't have a simple and convincing formulation yet.
Fixes https://github.com/rust-lang/rust/issues/143491
|
|
|
|
Organize macro tests a bit more
- Move some macro parsing tests from `tests/ui/parser` to `tests/ui/parser/macro`.
- Most macro tests use `macro` in the name, making it easy to find and run tests relevant to macros. However, a few use `mbe` instead. Rename those to say `macro`.
|
|
r=jdonszelmann
Rewrite empty attribute lint for new attribute parser
cc `@jdonszelmann`
|
|
|
|
distinguish the duplicate item of rpitit
Fixes rust-lang/rust#140796
r? compiler
cc `@Zoxc`
|
|
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
|
|
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
|
|
|
|
Rollup of 6 pull requests
Successful merges:
- rust-lang/rust#143238 (Port `#[ignore]` to the new attribute parsing infrastructure)
- rust-lang/rust#143441 (Stop using `Key` trait unnecessarily)
- rust-lang/rust#143478 (Miri subtree update)
- rust-lang/rust#143486 (remove armv5te-unknown-linux-gnueabi target maintainer)
- rust-lang/rust#143489 (Complete rustc_ast::mut_visit for spans.)
- rust-lang/rust#143494 (Remove yields_in_scope from the scope tree.)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Most macro tests use `macro` in the name, making it easy to find and run
tests relevant to macros. However, a few use `mbe` instead. Rename those
to say `macro`.
|
|
Update LLVM submodule
Fixes rust-lang/rust#140686, fixes rust-lang/rust#141913, fixes rust-lang/rust#142752, fixes rust-lang/rust#143399.
|
|
The `macro` directory contains most of the macro tests, but not all of
them; move the remainder into `macro`.
|
|
Stop using `Key` trait unnecessarily
Few places where the `Key` trait was being used but not really for a useful reason. This fixes those usages.
Namely, `<Ty as Key>::default_span()` is `DUMMY_SP` anyways.
|
|
Port `#[ignore]` to the new attribute parsing infrastructure
Ports `ignore` to the new attribute parsing infrastructure for https://github.com/rust-lang/rust/issues/131229#issuecomment-2971353197
This PR duplicates a change from https://github.com/rust-lang/rust/pull/143237
Draft until that one is merged
|
|
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
|
|
|
|
Rollup of 11 pull requests
Successful merges:
- rust-lang/rust#142440 (`tests/ui`: A New Order [14/N])
- rust-lang/rust#143040 (Add `const Rem`)
- rust-lang/rust#143086 (Update poison.rs to fix the typo (sys->sync))
- rust-lang/rust#143202 (`tests/ui`: A New Order [18/N])
- rust-lang/rust#143296 (`tests/ui`: A New Order [21/N])
- rust-lang/rust#143297 (`tests/ui`: A New Order [22/N])
- rust-lang/rust#143299 (`tests/ui`: A New Order [24/N])
- rust-lang/rust#143300 (`tests/ui`: A New Order [25/N])
- rust-lang/rust#143397 (test passing a `VaList` from rust to C)
- rust-lang/rust#143410 (Block SIMD in transmute_immediate; delete `OperandValueKind`)
- rust-lang/rust#143452 (Fix CLI completion check in `tidy`)
r? `@ghost`
`@rustbot` modify labels: rollup
|
|
Remove `Symbol` from `Named` variant of `BoundRegionKind`/`LateParamRegionKind`
The `Symbol` is redundant, since we already store a `DefId` in the region variant. Instead, load the name via `item_name` when needed (which is almost always on the diagnostic path).
This introduces a `BoundRegionKind::NamedAnon` which is used for giving anonymous bound regions names, but which should only be used during pretty printing and error reporting.
|
|
r=RalfJung,workingjubilee
Block SIMD in transmute_immediate; delete `OperandValueKind`
Vectors have been causing me problems for years in this code, for example https://github.com/rust-lang/rust/pull/110021#discussion_r1160975086 and https://github.com/rust-lang/rust/pull/143194
See conversation in <https://rust-lang.zulipchat.com/#narrow/channel/131828-t-compiler/topic/Is.20transmuting.20a.20.60T.60.20to.20.60Tx1.60.20.28one-element.20SIMD.20vector.29.20UB.3F/near/526262799>.
By blocking SIMD in `transmute_immediate` it can be simplified to just take the `Scalar`s involved -- the backend types can be gotten from those `Scalar`s, rather than needing to be passed. And there's an assert added to ICE it if it does get hit.
Accordingly, this changes `rvalue_creates_operand` to not send SIMD transmutes through the operand path, but to always go through memory instead, like they did back before rust-lang/rust#108442.
And thanks to those changes, I could also remove the `OperandValueKind` type that I added back then which `@RalfJung` rightly considers pretty sketchy.
cc `@folkertdev` `@workingjubilee` from the zulip conversation too
|
|
r=RalfJung
test passing a `VaList` from rust to C
Have C define various functions that take a `...` or `va_list` as an argument, and call them from rust. As far as I can see, this just wasn't actually tested before.
In particular this tests a difference between rust `VaList` and C `va_list` where C uses array-to-pointer decay, but rust cannot.
I've locally tested this for
- `x86_64-unknown-linux-gnu`
- `aarch64-unknown-linux-gnu`
- `s390x-unknown-linux-gnu`
- `powerpc64-unknown-linux-gnu`
- `powerpc64le-unknown-linux-gnu`
The latter 2 use an opaque pointer, the first 3 use a single-element array.
cc `@beetrees` if you see anything incorrect here
r? `@workingjubilee`
|
|
`tests/ui`: A New Order [25/N]
> [!NOTE]
>
> Intermediate commits are intended to help review, but will be squashed prior to merge.
Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.
r? `@tgross35`
|
|
`tests/ui`: A New Order [24/N]
> [!NOTE]
>
> Intermediate commits are intended to help review, but will be squashed prior to merge.
Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.
r? `@tgross35`
|
|
`tests/ui`: A New Order [22/N]
> [!NOTE]
>
> Intermediate commits are intended to help review, but will be squashed prior to merge.
Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.
r? `@tgross35`
|
|
`tests/ui`: A New Order [21/N]
> [!NOTE]
>
> Intermediate commits are intended to help review, but will be squashed prior to merge.
Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.
r? `@tgross35`
|
|
`tests/ui`: A New Order [18/N]
> [!NOTE]
>
> Intermediate commits are intended to help review, but will be squashed prior to merge.
Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.
r? `@tgross35`
|
|
`tests/ui`: A New Order [14/N]
> [!NOTE]
>
> Intermediate commits are intended to help review, but will be squashed prior to merge.
Some `tests/ui/` housekeeping, to trim down number of tests directly under `tests/ui/`. Part of rust-lang/rust#133895.
r? `@jieyouxu`
|
|
Allow `enum` and `union` literals to also create SSA values
Today, `Some(x)` always goes through an `alloca`, even in trivial cases where the niching means the constructor doesn't even change the value.
For example, <https://rust.godbolt.org/z/6KG6PqoYz>
```rust
pub fn demo(r: &i32) -> Option<&i32> {
Some(r)
}
```
currently emits the IR
```llvm
define align 4 ptr `@demo(ptr` align 4 %r) unnamed_addr {
start:
%_0 = alloca [8 x i8], align 8
store ptr %r, ptr %_0, align 8
%0 = load ptr, ptr %_0, align 8
ret ptr %0
}
```
but with this PR it becomes just
```llvm
define align 4 ptr `@demo(ptr` align 4 %r) unnamed_addr {
start:
ret ptr %r
}
```
(Of course the optimizer can clean that up, but it'd be nice if it didn't have to -- especially in debug where it doesn't run. This is like rust-lang/rust#123886, but that only handled non-simd `struct`s -- this PR generalizes it to all non-simd ADTs.)
Doing this means handing variants other than `FIRST_VARIANT`, handling the active field for unions, refactoring the discriminant code so the Place and Operand parts can share the calculation, etc.
Other PRs that led up to this one:
- https://github.com/rust-lang/rust/pull/142005
- https://github.com/rust-lang/rust/pull/142103
- https://github.com/rust-lang/rust/pull/142324
- https://github.com/rust-lang/rust/pull/142383
---
try-job: aarch64-gnu
|
|
clean up GVN TypeId test
addresses https://github.com/rust-lang/rust/pull/142789#discussion_r2184897992
This is an attempt to clarify what this test is actually supposed to test and make it less dependent on `TypeId` internals (it now depends on the output of `type_name` instead).
I verified that this version still miscompiles on `nightly-2025-02-11`.
r? ``@oli-obk`` ``@RalfJung``
|
|
remove special-casing of boxes from match exhaustiveness/usefulness analysis
As a first step in replacing `box_patterns` with `deref_patterns`, this treats box patterns as deref patterns in the THIR and exhaustiveness analysis. This allows a bunch of special-casing to be removed. The emitted MIR is unchanged.
Incidentally, this fixes a bug caused by box patterns being treated like structs rather than pointers, where enabling `exhaustive_patterns` (rust-lang/rust#51085) could give rise to spurious `unreachable_patterns` lints on arms required for exhaustiveness. Following the lint's advice to remove the match arm would result in an error. I'm not sure what the current state of `exhaustive_patterns` is with regard to reference/box opsem, or whether there's any intention to have `unreachable_patterns` be more granular than the whole arm, but regardless this should hopefully make them easier to handle consistently.
Tracking issue for deref patterns: rust-lang/rust#87121
r? `@Nadrieril`
|
|
mbe: Gracefully handle macro rules that end after `=>`
Add a test for various cases of invalid macro definitions.
Closes: https://github.com/rust-lang/rust/issues/143351
|
|
|
|
|
|
|
|
|
|
opeq.rs was removed as duplicating test logic in other tests
|
|
|
|
|