<feed xmlns='http://www.w3.org/2005/Atom'>
<title>rust/tests/ui/panic-handler, branch master</title>
<subtitle>https://github.com/rust-lang/rust
</subtitle>
<id>http://git.dreamy.place/mirrors/rust/atom?h=master</id>
<link rel='self' href='http://git.dreamy.place/mirrors/rust/atom?h=master'/>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/'/>
<updated>2025-08-14T16:18:42+00:00</updated>
<entry>
<title>Update uitests</title>
<updated>2025-08-14T16:18:42+00:00</updated>
<author>
<name>Jonathan Brouwer</name>
<email>jonathantbrouwer@gmail.com</email>
</author>
<published>2025-08-09T18:41:01+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4bb7bf64e07fee97439ee6e647aa2b58cbaac54d'/>
<id>urn:sha1:4bb7bf64e07fee97439ee6e647aa2b58cbaac54d</id>
<content type='text'>
Signed-off-by: Jonathan Brouwer &lt;jonathantbrouwer@gmail.com&gt;
</content>
</entry>
<entry>
<title>tests: `{Meta,Pointee}Sized` in non-minicore tests</title>
<updated>2025-06-16T23:04:33+00:00</updated>
<author>
<name>David Wood</name>
<email>david.wood2@arm.com</email>
</author>
<published>2025-01-23T11:25:12+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=322cc315040da14c12f84d74fd5761c5d064e50e'/>
<id>urn:sha1:322cc315040da14c12f84d74fd5761c5d064e50e</id>
<content type='text'>
As before, add `MetaSized` and `PointeeSized` traits to all of the
non-minicore `no_core` tests so that they don't fail for lack of
language items.
</content>
</entry>
<entry>
<title>error when using no_mangle on language items</title>
<updated>2025-04-30T11:54:10+00:00</updated>
<author>
<name>Alexandru RADOVICI</name>
<email>alexandru.radovici@wyliodrin.com</email>
</author>
<published>2025-04-30T11:52:15+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=07c7e5ffb3c096f80ffede421fb20089fbe7fe3f'/>
<id>urn:sha1:07c7e5ffb3c096f80ffede421fb20089fbe7fe3f</id>
<content type='text'>
add suggestion on how to add a panic breakpoint

Co-authored-by: Pat Pannuto &lt;pat.pannuto@gmail.com&gt;
delete no_mangle from ui/panic-handler/panic-handler-wrong-location test

issue an error for the usage of #[no_mangle] on internal language items

delete the comments

add newline

rephrase note

Co-authored-by: bjorn3 &lt;17426603+bjorn3@users.noreply.github.com&gt;
update error not to leak implementation details

delete no_mangle_span

Co-authored-by: bjorn3 &lt;17426603+bjorn3@users.noreply.github.com&gt;
delete commented code
</content>
</entry>
<entry>
<title>UI tests: add missing diagnostic kinds where possible</title>
<updated>2025-04-08T20:06:31+00:00</updated>
<author>
<name>Vadim Petrochenkov</name>
<email>vadim.petrochenkov@gmail.com</email>
</author>
<published>2025-04-05T16:19:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=b3f75353a237f3623483c1e237be480140a8c3e1'/>
<id>urn:sha1:b3f75353a237f3623483c1e237be480140a8c3e1</id>
<content type='text'>
</content>
</entry>
<entry>
<title>compiletest: Require `//~` annotations even if `error-pattern` is specified</title>
<updated>2025-04-03T08:08:55+00:00</updated>
<author>
<name>Vadim Petrochenkov</name>
<email>vadim.petrochenkov@gmail.com</email>
</author>
<published>2025-03-28T23:41:32+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=4d649906900cd833b0680f53b8c197b087711a4a'/>
<id>urn:sha1:4d649906900cd833b0680f53b8c197b087711a4a</id>
<content type='text'>
</content>
</entry>
<entry>
<title>compiletest: Support matching on diagnostics without a span</title>
<updated>2025-03-25T14:33:09+00:00</updated>
<author>
<name>Vadim Petrochenkov</name>
<email>vadim.petrochenkov@gmail.com</email>
</author>
<published>2025-03-23T12:50:51+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=8d5109aa6ea1b54a560774eb95ba7c1b8d404faa'/>
<id>urn:sha1:8d5109aa6ea1b54a560774eb95ba7c1b8d404faa</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Trim suggestion part before generating highlights</title>
<updated>2025-02-21T00:54:01+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2025-02-21T00:29:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=160905b6253f42967ed4aef4b98002944c7df24c'/>
<id>urn:sha1:160905b6253f42967ed4aef4b98002944c7df24c</id>
<content type='text'>
</content>
</entry>
<entry>
<title>More sophisticated span trimming</title>
<updated>2025-02-21T00:41:17+00:00</updated>
<author>
<name>Michael Goulet</name>
<email>michael@errs.io</email>
</author>
<published>2025-02-20T23:05:38+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=0a7ab1d6df4a2cfac819b0bada85b9142ac8ba26'/>
<id>urn:sha1:0a7ab1d6df4a2cfac819b0bada85b9142ac8ba26</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Rollup merge of #134090 - veluca93:stable-tf11, r=oli-obk</title>
<updated>2025-02-13T01:09:56+00:00</updated>
<author>
<name>Jacob Pratt</name>
<email>jacob@jhpratt.dev</email>
</author>
<published>2025-02-13T01:09:56+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=575405161fa3108b4076875e8275e2e9ba3a063a'/>
<id>urn:sha1:575405161fa3108b4076875e8275e2e9ba3a063a</id>
<content type='text'>
Stabilize target_feature_11

# Stabilization report

This is an updated version of https://github.com/rust-lang/rust/pull/116114, which is itself a redo of https://github.com/rust-lang/rust/pull/99767. Most of this commit and report were copied from those PRs. Thanks ```@LeSeulArtichaut``` and ```@calebzulawski!```

## Summary
Allows for safe functions to be marked with `#[target_feature]` attributes.

Functions marked with `#[target_feature]` are generally considered as unsafe functions: they are unsafe to call, cannot *generally* be assigned to safe function pointers, and don't implement the `Fn*` traits.

However, calling them from other `#[target_feature]` functions with a superset of features is safe.

```rust
// Demonstration function
#[target_feature(enable = "avx2")]
fn avx2() {}

fn foo() {
    // Calling `avx2` here is unsafe, as we must ensure
    // that AVX is available first.
    unsafe {
        avx2();
    }
}

#[target_feature(enable = "avx2")]
fn bar() {
    // Calling `avx2` here is safe.
    avx2();
}
```

Moreover, once https://github.com/rust-lang/rust/pull/135504 is merged, they can be converted to safe function pointers in a context in which calling them is safe:

```rust
// Demonstration function
#[target_feature(enable = "avx2")]
fn avx2() {}

fn foo() -&gt; fn() {
    // Converting `avx2` to fn() is a compilation error here.
    avx2
}

#[target_feature(enable = "avx2")]
fn bar() -&gt; fn() {
    // `avx2` coerces to fn() here
    avx2
}
```

See the section "Closures" below for justification of this behaviour.

## Test cases
Tests for this feature can be found in [`tests/ui/target_feature/`](https://github.com/rust-lang/rust/tree/f6cb952dc115fd1311b02b694933e31d8dc8b002/tests/ui/target-feature).

## Edge cases
### Closures
 * [target-feature 1.1: should closures inherit target-feature annotations? #73631](https://github.com/rust-lang/rust/issues/73631)

Closures defined inside functions marked with #[target_feature] inherit the target features of their parent function. They can still be assigned to safe function pointers and implement the appropriate `Fn*` traits.

```rust
#[target_feature(enable = "avx2")]
fn qux() {
    let my_closure = || avx2(); // this call to `avx2` is safe
    let f: fn() = my_closure;
}
```
This means that in order to call a function with #[target_feature], you must guarantee that the target-feature is available while the function, any closures defined inside it, as well as any safe function pointers obtained from target-feature functions inside it, execute.

This is usually ensured because target features are assumed to never disappear, and:
- on any unsafe call to a `#[target_feature]` function, presence of the target feature is guaranteed by the programmer through the safety requirements of the unsafe call.
- on any safe call, this is guaranteed recursively by the caller.

If you work in an environment where target features can be disabled, it is your responsibility to ensure that no code inside a target feature function (including inside a closure) runs after this (until the feature is enabled again).

**Note:** this has an effect on existing code, as nowadays closures do not inherit features from the enclosing function, and thus this strengthens a safety requirement. It was originally proposed in #73631 to solve this by adding a new type of UB: “taking a target feature away from your process after having run code that uses that target feature is UB” .
This was motivated by userspace code already assuming in a few places that CPU features never disappear from a program during execution (see i.e. https://github.com/rust-lang/stdarch/blob/2e29bdf90832931ea499755bb4ad7a6b0809295a/crates/std_detect/src/detect/arch/x86.rs); however, concerns were raised in the context of the Linux kernel; thus, we propose to relax that requirement to "causing the set of usable features to be reduced is unsafe; when doing so, the programmer is required to ensure that no closures or safe fn pointers that use removed features are still in scope".

* [Fix #[inline(always)] on closures with target feature 1.1 #111836](https://github.com/rust-lang/rust/pull/111836)

Closures accept `#[inline(always)]`, even within functions marked with `#[target_feature]`. Since these attributes conflict, `#[inline(always)]` wins out to maintain compatibility.

### ABI concerns
* [The extern "C" ABI of SIMD vector types depends on target features #116558](https://github.com/rust-lang/rust/issues/116558)

The ABI of some types can change when compiling a function with different target features. This could have introduced unsoundness with target_feature_11, but recent fixes (#133102, #132173) either make those situations invalid or make the ABI no longer dependent on features. Thus, those issues should no longer occur.

### Special functions
The `#[target_feature]` attribute is forbidden from a variety of special functions, such as main, current and future lang items (e.g. `#[start]`, `#[panic_handler]`), safe default trait implementations and safe trait methods.

This was not disallowed at the time of the first stabilization PR for target_features_11, and resulted in the following issues/PRs:
* [`#[target_feature]` is allowed on `main` #108645](https://github.com/rust-lang/rust/issues/108645)
* [`#[target_feature]` is allowed on default implementations #108646](https://github.com/rust-lang/rust/issues/108646)
* [#[target_feature] is allowed on #[panic_handler] with target_feature 1.1 #109411](https://github.com/rust-lang/rust/issues/109411)
* [Prevent using `#[target_feature]` on lang item functions #115910](https://github.com/rust-lang/rust/pull/115910)

## Documentation
 * Reference: [Document the `target_feature_11` feature reference#1181](https://github.com/rust-lang/reference/pull/1181)
---

cc tracking issue https://github.com/rust-lang/rust/issues/69098
cc ```@workingjubilee```
cc ```@RalfJung```
r? ```@rust-lang/lang```
</content>
</entry>
<entry>
<title>Show diff suggestion format on verbose replacement</title>
<updated>2025-02-10T20:21:39+00:00</updated>
<author>
<name>Esteban Küber</name>
<email>esteban@kuber.com.ar</email>
</author>
<published>2024-07-09T22:30:26+00:00</published>
<link rel='alternate' type='text/html' href='http://git.dreamy.place/mirrors/rust/commit/?id=f0845adb0c1b7a7fa1bef73e749b2d7e1d7f374d'/>
<id>urn:sha1:f0845adb0c1b7a7fa1bef73e749b2d7e1d7f374d</id>
<content type='text'>
```
error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields
  --&gt; $DIR/attempted-access-non-fatal.rs:7:15
   |
LL |     let _ = 2.l;
   |               ^
   |
help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix
   |
LL -     let _ = 2.l;
LL +     let _ = 2.0f64;
   |
```
</content>
</entry>
</feed>
