File tree 1 file changed +8
-4
lines changed
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,8 @@ error to specify a feature for a target architecture that the crate is not
63
63
being compiled for.
64
64
65
65
It is [ undefined behavior] to call a function that is compiled with a feature
66
- that is not supported on the current platform the code is running on.
66
+ that is not supported on the current platform the code is running on, * except*
67
+ if the platform explicitly documents this to be safe.
67
68
68
69
Functions marked with ` target_feature ` are not inlined into a context that
69
70
does not support the given features. The ` #[inline(always)] ` attribute may not
@@ -134,9 +135,12 @@ Feature | Implicitly Enables | Description
134
135
135
136
#### ` wasm32 ` or ` wasm64 `
136
137
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
139
- [ ` unsafe ` functions] [ unsafe function ] .
138
+ ` #[target_feature] ` may be used with both safe and
139
+ [ ` unsafe ` functions] [ unsafe function ] on Wasm platforms. It is impossible to
140
+ cause undefined behavior via the ` #[target_feature] ` attribute because
141
+ attempting to use instructions unsupported by the Wasm engine will fail at load
142
+ time without the risk of being interpreted in a way different from what the
143
+ compiler expected.
140
144
141
145
Feature | Description
142
146
------------|-------------------
You can’t perform that action at this time.
0 commit comments