| Age | Commit message (Collapse) | Author | Lines |
|
|
|
|
|
Fix #53466.
|
|
Instead of
```
LL | fn oom(
| __^
| | _|
| ||
LL | || ) {
| ||_-
LL | | }
| |__^
```
emit
```
LL | // fn oom(
LL | || ) {
| ||_-
LL | | }
| |__^
```
|
|
|
|
|
|
Stabilize the `instruction_set` feature
Closes https://github.com/rust-lang/rust/issues/74727
FCP is complete on https://github.com/rust-lang/rust/issues/74727#issuecomment-1242773253
r? `@pnkfelix` and/or `@nikomatsakis`
cc `@xd009642`
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
|
|
Upstream issue: https://github.com/llvm/llvm-project/issues/58384
LLVM gets confused if we assign a 32-bit value to a 64-bit register, so
pass the 32-bit register name to LLVM in that case.
|
|
|
|
|
|
|
|
Signed-off-by: Yuki Okushi <jtitor@2k36.org>
|
|
|
|
Adding needs-unwind arg to applicable compiler ui tests
Adding `needs-unwind` arg to applicable compiler ui tests
|
|
|
|
fix the suggestion of format for asm_sub_register
modified: compiler/rustc_typeck/src/check/intrinsicck.rs
modified: src/test/ui/asm/bad-template.aarch64_mirunsafeck.stderr
modified: src/test/ui/asm/bad-template.aarch64_thirunsafeck.stderr
modified: src/test/ui/asm/bad-template.x86_64_mirunsafeck.stderr
modified: src/test/ui/asm/bad-template.x86_64_thirunsafeck.stderr
modified: src/test/ui/asm/type-check-1.rs
modified: src/test/ui/asm/type-check-1.stderr
modified: src/test/ui/asm/x86_64/type-check-3.stderr
|
|
modified: compiler/rustc_typeck/src/check/intrinsicck.rs
modified: src/test/ui/asm/bad-template.aarch64_mirunsafeck.stderr
modified: src/test/ui/asm/bad-template.aarch64_thirunsafeck.stderr
modified: src/test/ui/asm/bad-template.x86_64_mirunsafeck.stderr
modified: src/test/ui/asm/bad-template.x86_64_thirunsafeck.stderr
modified: src/test/ui/asm/type-check-1.rs
modified: src/test/ui/asm/type-check-1.stderr
modified: src/test/ui/asm/x86_64/type-check-3.stderr
|
|
|
|
The `*-ptr` is rather confusing, and we have the full information for
properly displaying the information.
|
|
|
|
Only fetch HIR for naked functions that have the attribute.
|
|
|
|
This was accidentally accepted even though it had no effect in
`global_asm!`. The option only makes sense for `asm!` which runs within
a function.
|
|
Add test for #96797
This was fixed in LLVM which was updated in #98285.
https://reviews.llvm.org/D127751
Fixes #96797
|
|
This was fixed in LLVM which was updated in #98285.
https://reviews.llvm.org/D127751
Fixes #96797
|
|
r=cjgillot
gather body owners
Issue #96341
|
|
Fix spans for asm diagnostics
Line spans were incorrect if the first line of an asm statement was an
empty string.
|
|
Line spans were incorrect if the first line of an asm statement was an
empty string.
|
|
Signed-off-by: Miguel Guarniz <mi9uel9@gmail.com>
|
|
Keep unstable target features for asm feature checking
Inline assembly uses the target features to determine which registers
are available on the current target. However it needs to be able to
access unstable target features for this.
Fixes #99071
|
|
|
|
|
|
Shorten def_span of closures to just their header
Continuation of https://github.com/rust-lang/rust/pull/93967.
|
|
|
|
|
|
When a binding is declared without a value, borrowck verifies that all
codepaths have *one* assignment to them to initialize them fully. If
there are any cases where a condition can be met that leaves the binding
uninitialized or we attempt to initialize a field of an unitialized
binding, we emit E0381.
We now look at all the statements that initialize the binding, and use
them to explore branching code paths that *don't* and point at them. If
we find *no* potential places where an assignment to the binding might
be missing, we display the spans of all the existing initializers to
provide some context.
|
|
|
|
|
|
|
|
These are necessary for running the rustc test suite with cg_clif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
asm: Add a kreg0 register class on x86 which includes k0
Previously we only exposed a kreg register class which excludes the k0
register since it can't be used in many instructions. However k0 is a
valid register and we need to have a way of marking it as clobbered for
clobber_abi.
Fixes #94977
|
|
Previously we only exposed a kreg register class which excludes the k0
register since it can't be used in many instructions. However k0 is a
valid register and we need to have a way of marking it as clobbered for
clobber_abi.
Fixes #94977
|
|
|
|
Don't emit non-asm contents error for naked function composed of errors
## Motivation
For naked functions an error is emitted when they are composed of anything other than a single asm!() block. However, this error triggers in a couple situations in which it adds no additional information or is actively misleading.
One example is if you do have an asm!() block but simply one with a syntax error:
```rust
#[naked]
unsafe extern "C" fn compiler_errors() {
asm!(invalid_syntax)
}
```
This results in two errors, one for the syntax error itself and another telling you that you need an asm block in your function:
```rust
error[E0787]: naked functions must contain a single asm block
--> src/main.rs:6:1
|
6 | / unsafe extern "C" fn naked_compile_error() {
7 | | asm!(blah)
8 | | }
| |_^
```
This issue also comes up when [utilizing `compile_error!()` for improving your diagnostics](https://twitter.com/steveklabnik/status/1509538243020218372), such as raising a compiler error when compiling for an unsupported target.
## Implementation
The rules this PR implements are as follows:
1. If any non-erroneous non-asm statement is included, an error will still occur
2. If multiple asm statements are included, an error will still occur
3. If 0 or 1 asm statements are present, as well as any non-zero number of erroneous statements, then this error will *not* be raised as it is likely either redundant or incorrect
The rule of thumb is effectively "if an error is present and its correction could change things, don't raise an error".
|