Skip to content

Commit 0ca34f2

Browse files
committed
update UB list for safe target_feature
1 parent 105a943 commit 0ca34f2

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/attributes/codegen.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ The following is a list of the available feature names.
7575

7676
#### `x86` or `x86_64`
7777

78-
This platform requires that `#[target_feature]` is only applied to [`unsafe`
78+
Executing code with unsupported features is UB on this platform.
79+
Hence this platform requires that `#[target_feature]` is only applied to [`unsafe`
7980
functions][unsafe function].
8081

8182
Feature | Implicitly Enables | Description
@@ -133,7 +134,8 @@ Feature | Implicitly Enables | Description
133134

134135
#### `wasm32` or `wasm64`
135136

136-
This platform allows `#[target_feature]` to be applied to both safe and
137+
Executing code with unsupported features is allowed (i.e., is not UB) on this platform.
138+
Hence this platform allows `#[target_feature]` to be applied to both safe and
137139
[`unsafe` functions][unsafe function].
138140

139141
Feature | Description

src/behavior-considered-undefined.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ code.
3333
is immutable, unless that data is contained within an [`UnsafeCell<U>`].
3434
* Invoking undefined behavior via compiler intrinsics.
3535
* Executing code compiled with platform features that the current platform
36-
does not support (see [`target_feature`]).
36+
does not support (see [`target_feature`]), *except* if the platform explicitly documents this to be safe.
3737
* Calling a function with the wrong call ABI or unwinding from a function with the wrong unwind ABI.
3838
* Producing an invalid value, even in private fields and locals. "Producing" a
3939
value happens any time a value is assigned to or read from a place, passed to

0 commit comments

Comments
 (0)