File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 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
6363being compiled for.
6464
6565It 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.
6768
6869Functions marked with ` target_feature ` are not inlined into a context that
6970does not support the given features. The ` #[inline(always)] ` attribute may not
@@ -134,9 +135,12 @@ Feature | Implicitly Enables | Description
134135
135136#### ` wasm32 ` or ` wasm64 `
136137
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.
140144
141145Feature | Description
142146------------|-------------------
You can’t perform that action at this time.
0 commit comments