Commit graph

250 commits

Author SHA1 Message Date
bors
9b81629631 Auto merge of #139493 - Voultapher:explicitly-export-core-and-std-macros, r=petrochenkov
Explicitly export core and std macros

Currently all core and std macros are automatically added to the prelude via #[macro_use]. However a situation arose where we want to add a new macro `assert_matches` but don't want to pull it into the standard prelude for compatibility reasons. By explicitly exporting the macros found in the core and std crates we get to decide on a per macro basis and can later add them via the rust_20xx preludes.

Closes https://github.com/rust-lang/rust/issues/53977
Unlocks https://github.com/rust-lang/rust/pull/137487

Reference PR:

- https://github.com/rust-lang/reference/pull/2077

# Stabilization report lib

Everything N/A or already covered by lang report except, breaking changes: The unstable and never intended for public use `format_args_nl` macro is no longer publicly accessible as requested by @petrochenkov. Affects <10 crates including dependencies.

# Stabilization report lang

## Summary

Explicitly export core and std macros.

This change if merged would change the code injected into user crates to no longer include #[macro_use] on extern crate core and extern crate std. This change is motivated by a near term goal and a longer term goal. The near term goal is to allow a macro to be defined at the std or core crate root but not have it be part of the implicit prelude. Such macros can then be separately promoted to the prelude in a new edition. Specifically this is blocking the stabilization of assert_matches rust-lang/rust#137487. The longer term goal is to gradually deprecate #[macro_use]. By no longer requiring it for standard library usage, this serves as a step towards that goal. For more information see rust-lang/rust#53977.

PR link: https://github.com/rust-lang/rust/pull/139493

Tracking:

- https://github.com/rust-lang/rust/issues/147319

Reference PRs:

- https://github.com/rust-lang/rust/pull/139493

cc @rust-lang/lang @rust-lang/lang-advisors

### What is stabilized

Stabilization:
    
* `#[macro_use]` is no longer automatically included in the crate root module. This allows the explicit import of macros in the `core` and `std` prelude e.g. `pub use crate::dbg;`.

* `ambiguous_panic_imports` lint. Code that previously passed without warnings, but included the following or equivalent - only pertaining to core vs std panic - will now receive a warning:

  ```rust
  #![no_std]
  extern crate std;
  use std::prelude::v1::*;
  fn xx() {
      panic!(); // resolves to core::panic
      //~^ WARNING `panic` is ambiguous
      //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
  }
  ```

  This lint is tied to a new exception to the name resolution logic in [compiler/rustc_resolve/src/ident.rs](https://github.com/rust-lang/rust/pull/139493/files#diff-c046507afdba3b0705638f53fffa156cbad72ed17aa01d96d7bd1cc10b8d9bce) similar to an exception added for https://github.com/rust-lang/rust/issues/145575. Specifically this only happens if the import of two builtin macros is ambiguous and they are named `sym::panic`. I.e. this can only happen for `core::panic` and `std::panic`. While there are some tiny differences in what syntax is allowed in `std::panic` vs `core::panic` in editions 2015 and 2018, [see](https://github.com/rust-lang/rust/pull/139493#issuecomment-2796481622). The behavior at runtime will always be the same if it compiles, implying minimal risk in what specific macro is resolved. At worst some closed source project not captured by crater will stop compiling because a different panic is resolved than previously and they were using obscure syntax like `panic!(&String::new())`.

## Design

N/A

### Reference

> What updates are needed to the Reference? Link to each PR. If the Reference is missing content needed for describing this feature, discuss that.

- https://github.com/rust-lang/reference/pull/2077

### RFC history

> What RFCs have been accepted for this feature?

N/A

### Answers to unresolved questions

N/A

### Post-RFC changes

> What other user-visible changes have occurred since the RFC was accepted? Describe both changes that the lang team accepted (and link to those decisions) as well as changes that are being presented to the team for the first time in this stabilization report.

N/A

### Key points

> What decisions have been most difficult and what behaviors to be stabilized have proved most contentious? Summarize the major arguments on all sides and link to earlier documents and discussions.

- Nothing was really contentious.

### Nightly extensions

> Are there extensions to this feature that remain unstable? How do we know that we are not accidentally committing to those?

N/A

### Doors closed

> What doors does this stabilization close for later changes to the language? E.g., does this stabilization make any other RFCs, lang experiments, or known in-flight proposals more difficult or impossible to do later?

No known doors are closed.

## Feedback

### Call for testing

> Has a "call for testing" been done? If so, what feedback was received?

No.

### Nightly use

> Do any known nightly users use this feature? Counting instances of `#![feature(FEATURE_NAME)]` on GitHub with grep might be informative.

N/A

## Implementation

### Major parts

> Summarize the major parts of the implementation and provide links into the code and to relevant PRs.
>
> See, e.g., this breakdown of the major parts of async closures:
>
> - <https://rustc-dev-guide.rust-lang.org/coroutine-closures.html>

The key change is [compiler/rustc_builtin_macros/src/standard_library_imports.rs](https://github.com/rust-lang/rust/pull/139493/files#diff-be08752823b8f862bb0c7044ef049b0f4724dbde39306b98dea2adb82ec452b0) removing the macro_use inject and the `v1.rs` preludes now explicitly `pub use`ing the macros https://github.com/rust-lang/rust/pull/139493/files#diff-a6f9f476d41575b19b399c6d236197355556958218fd035549db6d584dbdea1d + https://github.com/rust-lang/rust/pull/139493/files#diff-49849ff961ebc978f98448c8990cf7aae8e94cb03db44f016011aa8400170587.

### Coverage

> Summarize the test coverage of this feature.
>
> Consider what the "edges" of this feature are. We're particularly interested in seeing tests that assure us about exactly what nearby things we're not stabilizing. Tests should of course comprehensively demonstrate that the feature works. Think too about demonstrating the diagnostics seen when common mistakes are made and the feature is used incorrectly.
>
> Within each test, include a comment at the top describing the purpose of the test and what set of invariants it intends to demonstrate. This is a great help to our review.
>
> Describe any known or intentional gaps in test coverage.
>
> Contextualize and link to test folders and individual tests.

A variety of UI tests including edge cases have been added.

### Outstanding bugs

> What outstanding bugs involve this feature? List them. Should any block the stabilization? Discuss why or why not.

An old bug is made more noticeable by this change https://github.com/rust-lang/rust/issues/145577 but it was recommended to not block on it https://github.com/rust-lang/rust/pull/139493#issuecomment-3288311495.

### Outstanding FIXMEs

> What FIXMEs are still in the code for that feature and why is it OK to leave them there?

```
// Turn ambiguity errors for core vs std panic into warnings.
// FIXME: Remove with lang team approval.
```

https://github.com/rust-lang/rust/pull/139493/files#diff-c046507afdba3b0705638f53fffa156cbad72ed17aa01d96d7bd1cc10b8d9bce

### Tool changes

> What changes must be made to our other tools to support this feature. Has this work been done? Link to any relevant PRs and issues.

- ~~rustfmt~~
- ~~rust-analyzer~~
- ~~rustdoc (both JSON and HTML)~~
- ~~cargo~~
- ~~clippy~~
- ~~rustup~~
- ~~docs.rs~~

No known changes needed or expected.

### Breaking changes

> If this stabilization represents a known breaking change, link to the crater report, the analysis of the crater report, and to all PRs we've made to ecosystem projects affected by this breakage. Discuss any limitations of what we're able to know about or to fix.

Breaking changes:

* It's possible for user code to invoke an ambiguity by defining their own macros with standard library names and glob importing them, e.g. `use nom::*` importing `nom::dbg`. In practice this happens rarely based on crater data. The 3 public crates where this was an issue, have been fixed. The ambiguous panic import is more common and affects a non-trivial amount of the public - and likely private - crate ecosystem. To avoid a breaking change, a new future incompatible lint was added ambiguous_panic_imports see https://github.com/rust-lang/rust/issues/147319. This allows current code to continue compiling, albeit with a new warning. Future editions of Rust make this an error and future versions of Rust can choose to make this error. Technically this is a breaking change, but crater gives us the confidence that the impact will be at worst a new warning for 99+% of public and private crates.

  ```rust
  #![no_std]
  extern crate std;
  use std::prelude::v1::*;
  fn xx() {
      panic!(); // resolves to core::panic
      //~^ WARNING `panic` is ambiguous
      //~| WARNING this was previously accepted by the compiler but is being phased out; it will become a hard error in a future release!
  }
  ```

* Code using `#![no_implicit_prelude]` *and* Rust edition 2015 will no longer automatically have access to the prelude macros. The following works on nightly but would stop working with this change:

  ```rust
  #![no_implicit_prelude]
  // Uncomment to fix error.
  // use std::vec;
  fn main() {
      let _ = vec![3, 6];
  }
  ```

  Inversely with this change the `panic` and `unreachable` macro will always be in the prelude even if `#![no_implicit_prelude]` is specified.

  Error matrix when using `#![no_implicit_prelude]`,  means compiler passes 🚫 means compiler error:
  
  Configuration | Rust 2015 | Rust 2018+
  --------------|-----------|-----------
  Nightly (panic\|unreachable) macro |  | 🚫
  PR (panic\|unreachable) macro |  | 
  Nightly (column\|concat\|file\|line\|module_path\|stringify) macro |  | 
  PR (column\|concat\|file\|line\|module_path\|stringify) macro |  | 
  Nightly remaining macros |  | 🚫
  PR remaining macros | 🚫 | 🚫

  Addressing this issue is deemed expensive.

Crater found no instance of this pattern in use. Affected code can fix the issue by directly importing the macros. The new behavior matches the behavior of `#![no_implicit_prelude]` in Rust editions 2018 and beyond and it's intuitive meaning.

Crater report:

- https://crater-reports.s3.amazonaws.com/pr-139493-2/index.html (latest run, but partial run)
- https://crater-reports.s3.amazonaws.com/pr-139493-1/index.html (previous full run, one fix missing)

Crater analysis:

- Discussed in breaking changes.

PRs to affected crates:

- https://github.com/Michael-F-Bryan/gcode-rs/pull/57
- https://github.com/stbuehler/rust-ipcrypt/pull/1
- https://github.com/jcreekmore/dmidecode/pull/55

## Type system, opsem

### Compile-time checks

> What compilation-time checks are done that are needed to prevent undefined behavior?
>
> Link to tests demonstrating that these checks are being done.

N/A

### Type system rules

> What type system rules are enforced for this feature and what is the purpose of each?

N/A

### Sound by default?

> Does the feature's implementation need specific checks to prevent UB, or is it sound by default and need specific opt-in to perform the dangerous/unsafe operations? If it is not sound by default, what is the rationale?

N/A

### Breaks the AM?

> Can users use this feature to introduce undefined behavior, or use this feature to break the abstraction of Rust and expose the underlying assembly-level implementation? Describe this if so.

N/A

## Common interactions

### Temporaries

> Does this feature introduce new expressions that can produce temporaries? What are the scopes of those temporaries?

N/A

### Drop order

> Does this feature raise questions about the order in which we should drop values? Talk about the decisions made here and how they're consistent with our earlier decisions.

N/A

### Pre-expansion / post-expansion

> Does this feature raise questions about what should be accepted pre-expansion (e.g. in code covered by `#[cfg(false)]`) versus what should be accepted post-expansion? What decisions were made about this?

N/A

### Edition hygiene

> If this feature is gated on an edition, how do we decide, in the context of the edition hygiene of tokens, whether to accept or reject code. E.g., what token do we use to decide?

N/A

### SemVer implications

> Does this feature create any new ways in which library authors must take care to prevent breaking downstreams when making minor-version releases? Describe these. Are these new hazards "major" or "minor" according to [RFC 1105](https://rust-lang.github.io/rfcs/1105-api-evolution.html)?

No.

### Exposing other features

> Are there any other unstable features whose behavior may be exposed by this feature in any way? What features present the highest risk of that?

No.

## History

> List issues and PRs that are important for understanding how we got here.

- This change was asked for here https://github.com/rust-lang/rust/pull/137487#issuecomment-2770801974

## Acknowledgments

> Summarize contributors to the feature by name for recognition and so that those people are notified about the stabilization. Does anyone who worked on this *not* think it should be stabilized right now? We'd like to hear about that if so.

More or less solo developed by @Voultapher with some help from @petrochenkov.

## Open items

> List any known items that have not yet been completed and that should be before this is stabilized.

None.
2026-01-13 14:20:26 +00:00
Lukas Bergdoll
506762f3ff Explicitly export core and std macros
Currently all core and std macros are automatically added to the prelude
via #[macro_use]. However a situation arose where we want to add a new macro
`assert_matches` but don't want to pull it into the standard prelude for
compatibility reasons. By explicitly exporting the macros found in the core and
std crates we get to decide on a per macro basis and can later add them via
the rust_20xx preludes.
2026-01-13 08:47:48 +01:00
Folkert de Vries
6f12b86e9c
s390x: support f16 and f16x8 in inline assembly 2026-01-09 18:42:46 +01:00
Matthias Krüger
b826d06771
Rollup merge of #149791 - clubby789:cfg-bool-lints, r=jdonszelmann
Remove uses of `cfg({any()/all()})`

~~This implements the followup warning suggested in https://github.com/rust-lang/rfcs/pull/3695~~
~~Lint against an empty `cfg(any/all)`, suggest the boolean literal equivalents.~~
https://github.com/rust-lang/rust/pull/149791#issuecomment-3638624348

Tracking issue: https://github.com/rust-lang/rust/issues/131204
2025-12-12 12:19:09 +01:00
Jamie Hill-Daniel
c96ff2d429 Remove uses of cfg(any()/all()) 2025-12-10 23:41:19 +00:00
Paul Murphy
a1f4caf467 Restrict spe_acc to PowerPC SPE targets
Update the tests, add powerpc-*-gnuspe testing, and create a distinct
clobber_abi list for PowerPC SPE targets.

Note, the SPE target does not have vector, vector-scalar, or
floating-point specific registers.
2025-12-05 08:37:22 -06:00
Matthias Krüger
05b2958024
Rollup merge of #149549 - Jamesbarford:chore/regression-test-ttbr0_el2, r=WaffleLapkin
Regression test for system register `ttbr0_el2`

Regression test for recognising the `ttbr0_el2` register.

closes rust-lang/rust#97724
2025-12-04 08:46:22 +01:00
xonx4l
4b000cfacd Merge E0412 into E0425 2025-12-02 18:25:13 +00:00
James Barford-Evans
79224797fb Regression tests for system register ttbr0_el2 2025-12-02 15:58:06 +00:00
Christian Poveda
b2ab7cf980
Gate 2015 UI tests 2025-11-27 11:19:00 -05:00
Stuart Cook
a57d7539cb
Rollup merge of #149317 - bjorn3:has_ffi_unwind_calls_inline_asm, r=petrochenkov
Handle inline asm in has_ffi_unwind_calls

This is required for the soundness of `options(may_unwind)`.

Extracted from https://github.com/rust-lang/rust/pull/149141.
2025-11-26 23:32:10 +11:00
Matthias Krüger
04e4f95e7e
Rollup merge of #147736 - folkertdev:stabilize-asm-cfg, r=jdonszelmann
Stabilize `asm_cfg`

tracking issue: https://github.com/rust-lang/rust/issues/140364
closes https://github.com/rust-lang/rust/issues/140364

Reference PR:

- https://github.com/rust-lang/reference/pull/2063

# Request for Stabilization

## Summary

The `cfg_asm` feature allows `#[cfg(...)]` and `#[cfg_attr(...)]` on  the arguments of the assembly macros, for instance:

```rust
asm!( // or global_asm! or naked_asm!
    "nop",
    #[cfg(target_feature = "sse2")]
    "nop",
    // ...
    #[cfg(target_feature = "sse2")]
    a = const 123, // only used on sse2
);
```

## Semantics

Templates, operands, `options` and `clobber_abi` in the assembly macros (`asm!`, `naked_asm!` and `global_asm!`) can be annotated with `#[cfg(...)]` and `#[cfg_attr(...)]`. When the condition evaluates to true, the annotated argument has no effect, and is completely ignored when expanding the assembly macro.
## Documentation

reference PR: https://github.com/rust-lang/reference/pull/2063

## Tests

- [tests/ui/asm/cfg.rs](https://github.com/rust-lang/rust/blob/master/tests/ui/asm/cfg.rs) checks that `cfg`'d arguments where the condition evaluates to false have no effect
- [tests/ui/asm/cfg-parse-error.rs](https://github.com/rust-lang/rust/blob/master/tests/ui/asm/cfg.rs) checks the parsing rules (parsing effectively assumes that the cfg conditions are all true)

## History

- https://github.com/rust-lang/rust/issues/140279
- https://github.com/rust-lang/rust/pull/140367

# Resolved questions

**how are other attributes handled**

Other attributes are parsed,  but explicitly rejected.

# unresolved questions

**operand before template**

The current implementation expects at least one template string before any operands. In the example below, if the `cfg` condition evaluates to true, the assembly block is ill-formed. But even when it evaluates to `false` this block is rejected, because the parser still expects just a template (a template is parsed as an expression and then validated to ensure that it is or expands to a string literal).

Changing how this works is difficult.
```rust
// This is rejected because `a = out(reg) x` does not parse as an expresion.
asm!(
	#[cfg(false)]
	a = out(reg) x, //~ ERROR expected token: `,`
	"",
);
```

**lint on positional arguments?**

Adding a lint to warn on the definition or use of positional arguments being `cfg`'d out was discussed in https://github.com/rust-lang/rust/issues/140279#issuecomment-2832237372 and subsequent comments. Such a lint is not currently implemented, but that may not be a blocker based on the comments there.

r? `@traviscross` (I'm assuming you'll reassign as needed)
2025-11-25 17:51:13 +01:00
bjorn3
d3c580db21 Handle inline asm in has_ffi_unwind_calls
This is required for the soundness of options(may_unwind)
2025-11-25 16:01:02 +00:00
Stuart Cook
bf7d5539f7
Rollup merge of #148638 - chenyukang:yukang-fix-148634-repr-simd-enum-ice, r=Kivooeo,lcnr
Fix ICE for repr simd on non struct

Fixes rust-lang/rust#148634

The ICE happened because
995c11894f/compiler/rustc_middle/src/ty/mod.rs (L1531)

will always set `IS_SIMD` according to `get_all_attrs`, and since we already report error `attribute should be applied to a struct`, it's OK to bypass here.
2025-11-14 19:57:06 +11:00
yukang
1610851356 add Tainted for NonAsmTypeReason 2025-11-14 12:42:50 +08:00
yukang
112d833ea5 Fix ICE for repr simd on non struct 2025-11-08 09:41:23 +08:00
Folkert de Vries
7516645928
stabilize s390x_target_feature_vector 2025-11-06 12:49:48 +01:00
Brian Cain
54df8dae29 CI fixes after recent rebase changes 2025-11-05 19:43:29 -06:00
Brian Cain
71e599b91a Make named asm_labels lint not trigger on hexagon register spans 2025-11-05 16:24:30 -06:00
bors
b01cc1cf01 Auto merge of #148516 - bjorn3:target_feature_parsing_improvements, r=WaffleLapkin
Move warning reporting from flag_to_backend_features to cfg_target_feature

This way warnings are emitted even in a check build.
2025-11-05 17:56:16 +00:00
bjorn3
1d34478147 Move warning reporting from flag_to_backend_features to cfg_target_feature
This way warnings are emitted even in a check build.
2025-11-05 10:48:29 +00:00
Paul Murphy
5f6fa960c2 Relax r29 inline asm restriction on PowerPC64 targets
LLVM uses r29 to hold a base pointer for some PowerPC target
configurations. It is usable on all 64 bit targets as a callee
save register.
2025-11-04 12:08:19 -06:00
Stuart Cook
10e445c9c8
Rollup merge of #144194 - estebank:const-traits, r=davidtwco
Provide additional context to errors involving const traits

When encountering an unmet `Ty: [const] Trait` bound, if `Trait` is `#[const_trait]` and there's an `impl Trait for Ty` point at it. If local, suggest `impl const Trait for Ty`, otherwise just point at it.

```
error[E0277]: the trait bound `NonConstAdd: [const] Add` is not satisfied
  --> $DIR/assoc-type.rs:37:16
   |
LL |     type Bar = NonConstAdd;
   |                ^^^^^^^^^^^
   |
note: required by a bound in `Foo::Bar`
  --> $DIR/assoc-type.rs:33:15
   |
LL |     type Bar: [const] Add;
   |               ^^^^^^^^^^^ required by this bound in `Foo::Bar`
help: make the `impl` of trait `Add` `const`
   |
LL | impl const Add for NonConstAdd {
   |      +++++
```
```
error[E0277]: the trait bound `T: [const] PartialEq` is not satisfied
    --> tests/ui/traits/const-traits/call-generic-method-fail.rs:5:5
     |
5    |     *t == *t
     |     ^^^^^^^^
     |
note: trait `PartialEq` is implemented but not `const`
    --> /home/gh-estebank/rust/library/core/src/ptr/const_ptr.rs:1590:1
     |
1590 | impl<T: PointeeSized> PartialEq for *const T {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
note: trait `PartialEq` is implemented but not `const`
    --> /home/gh-estebank/rust/library/core/src/ptr/mut_ptr.rs:2011:1
     |
2011 | impl<T: PointeeSized> PartialEq for *mut T {
     | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
```
2025-11-03 11:52:39 +11:00
Esteban Küber
a2c3913007 review comments 2025-11-02 20:12:26 +00:00
Esteban Küber
9bc814cc8d Point at the enclosing const context
```
error[E0015]: cannot call non-const associated function `Foo::{constant#0}::Foo::<17>::value` in constants
  --> $DIR/nested-type.rs:15:5
   |
LL |   struct Foo<const N: [u8; {
   |  __________________________-
LL | |     struct Foo<const N: usize>;
LL | |
LL | |     impl<const N: usize> Foo<N> {
...  |
LL | |     Foo::<17>::value()
   | |     ^^^^^^^^^^^^^^^^^^
LL | |
LL | | }]>;
   | |_- calls in constants are limited to constant functions, tuple structs and tuple variants
```
2025-11-02 20:12:26 +00:00
Esteban Küber
a08bdffb21 Point at non-const trait when using them in const context
Point at trait and associated item when that associated item is used in a const context. Suggest making the trait `#[const_trait]`.

```
error[E0015]: cannot call non-const method `<() as Trait>::foo` in constant functions
  --> $DIR/inline-incorrect-early-bound-in-ctfe.rs:26:8
   |
LL |     ().foo();
   |        ^^^^^
   |
note: method `foo` is not const because trait `Trait` is not const
  --> $DIR/inline-incorrect-early-bound-in-ctfe.rs:13:1
   |
LL | trait Trait {
   | ^^^^^^^^^^^ this trait is not const
LL |     fn foo(self);
   |     ------------- this method is not const
   = note: calls in constant functions are limited to constant functions, tuple structs and tuple variants
help: consider making trait `Trait` const
   |
LL + #[const_trait]
LL | trait Trait {
   |
```
2025-11-02 20:12:26 +00:00
Ralf Jung
3796f7de57 compiletest: rename add-core-stubs to add-minicore 2025-11-02 16:20:06 +01:00
Jesus Checa Hidalgo
d75b2ba783 Remove needs-asm-support directive in tests with explicit targets
The `needs-asm-support` directive checks whether the host architecture
supports inline assembly, not the target architecture. For tests that
explicitly specify a target via `--target` in their compile-flags, this
directive is incorrect and unnecessary.

These tests are cross-compiling to specific targets (like x86_64, arm,
aarch64, riscv, etc.) that are already known to have stable asm support.
The directive was causing these tests to be incorrectly skipped on hosts
that don't support asm, even though the target does.

Tests with explicit targets should rely on `needs-llvm-components` to
ensure the appropriate backend is available, rather than checking host
asm support.

Improve documentation about `needs-asm-support` directive.
2025-10-16 14:05:04 +02:00
Folkert de Vries
261d7ebdc3
stabilize asm_cfg 2025-10-15 20:43:53 +02:00
Paul Murphy
3c09d4a582 Allow vector-scalar (vs) registers in ppc inline assembly
Where supported, VSX is a 64x128b register set which encompasses
both the floating point and vector registers.

In the type tests, xvsqrtdp is used as it is the only two-argument
vsx opcode supported by all targets on llvm. If you need to copy
a vsx register, the preferred way is "xxlor xt, xa, xa".
2025-10-14 09:52:56 -05:00
Guillaume Gomez
a8051a6ca3 Ignore more failing ui tests for GCC backend 2025-10-13 15:30:26 +02:00
Camille Gillot
be46a90a8b Bless x86_64 test. 2025-10-12 03:15:18 +00:00
Camille Gillot
4419d890c6 Bless ui asm. 2025-10-11 20:50:21 +00:00
Camille GILLOT
ca0379d6cd Diagnose liveness on MIR. 2025-10-11 20:50:21 +00:00
bors
bd3487101f Auto merge of #143227 - tshepang:asm-label-operand, r=Amanieu
add multi-arch asm! label operand test

Added this since the other label operand tests are only for x86
2025-10-09 02:23:38 +00:00
Jana Dönszelmann
1dbe831e47
sort attribute targets for more consistent error messages 2025-10-08 08:32:03 +02:00
Tshepang Mbambo
c7d180cd60 add multi-arch asm! label operand test 2025-10-06 05:54:53 +02:00
Guillaume Gomez
a535c7be54 Ignore more failing ui tests for GCC backend 2025-09-26 15:33:48 +02:00
Taiki Endo
f4b876867d Support ctr and lr as clobber-only registers in PowerPC inline assembly 2025-09-21 13:48:22 +09:00
Josh Stone
580b4891aa Update the minimum external LLVM to 20 2025-09-16 11:49:20 -07:00
bors
b3cfb8faf8 Auto merge of #138736 - azhogin:azhogin/sanitizers-target-modificators, r=rcvalle
Sanitizers target modificators

Depends on bool flag fix: https://github.com/rust-lang/rust/pull/138483.

Some sanitizers need to be target modifiers, and some do not. For now, we should mark all sanitizers as target modifiers except for these: AddressSanitizer, LeakSanitizer

For kCFI, the helper flag -Zsanitizer-cfi-normalize-integers should also be a target modifier.

Many test errors was with sanizer flags inconsistent with std deps. Tests are fixed with `-C unsafe-allow-abi-mismatch`.
2025-09-04 22:51:33 +00:00
Jana Dönszelmann
2158e2d4d7
refactor target checking, move out of context.rs and rename MaybeWarn to Policy 2025-08-21 13:15:30 +02:00
Andrew Zhogin
6d637dfecc -Zsanitize and -Zsanitizer-cfi-normalize-integers flags are now target modifiers with custom consistency check function 2025-08-21 16:08:00 +07:00
Jonathan Brouwer
4bb7bf64e0
Update uitests
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-08-14 18:18:42 +02:00
Stuart Cook
5955f005e5
Rollup merge of #144402 - heiher:stabilize-loong32-asm, r=Amanieu
Stabilize loongarch32 inline asm

r? ````````@Amanieu````````
2025-08-10 19:45:47 +10:00
Paul Murphy
0bba9bd55c Explicitly disable vector feature on s390x baseline of bad-reg test
If the baseline s390x cpu is changed to a newer variant, such as z13,
the vector feature may be enabled by default. When rust is packaged
on fedora 38 and newer, it is set to z13.

Explicitly disable vector support on the baseline test for consistent
results across s390x cpus.
2025-08-06 14:12:38 -05:00
Vadim Petrochenkov
c56f49dc34 expand: Micro-optimize prelude injection
Use `splice` to avoid shifting the other items twice.
Put `extern crate std;` first so it's already resolved when we resolve `::std::prelude::rust_20XX`.
2025-07-28 17:35:09 +03:00
bors
8708f3cd1f Auto merge of #144490 - tgross35:rollup-ps0utme, r=tgross35
Rollup of 9 pull requests

Successful merges:

 - rust-lang/rust#140871 (Don't lint against named labels in `naked_asm!`)
 - rust-lang/rust#141663 (rustdoc: add ways of collapsing all impl blocks)
 - rust-lang/rust#143272 (Upgrade the `fortanix-sgx-abi` dependency)
 - rust-lang/rust#143585 (`loop_match`: suggest extracting to a `const` item)
 - rust-lang/rust#143698 (Fix unused_parens false positive)
 - rust-lang/rust#143859 (Guarantee 8 bytes of alignment in Thread::into_raw)
 - rust-lang/rust#144160 (tests: debuginfo: Work around or disable broken tests on powerpc)
 - rust-lang/rust#144412 (Small cleanup: Use LocalKey<Cell> methods more)
 - rust-lang/rust#144431 (Disable has_reliable_f128_math on musl targets)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-07-26 10:12:14 +00:00
Amanieu d'Antras
1f4561b63d Don't lint against named labels in naked_asm!
Naked functions are allowed to define global labels, just like
`global_asm!`.
2025-07-26 00:42:21 +01:00
WANG Rui
a383fb0c73 asm: Stabilize loongarch32 2025-07-24 22:02:49 +08:00