@@ -6138,7 +6138,7 @@ fn hover_feature() {
6138
6138
by the codegen backend, but not the MIR inliner.
6139
6139
6140
6140
```rust
6141
- #![feature(rustc_attrs, effects )]
6141
+ #![feature(rustc_attrs)]
6142
6142
#![allow(internal_features)]
6143
6143
6144
6144
#[rustc_intrinsic]
@@ -6148,7 +6148,7 @@ fn hover_feature() {
6148
6148
Since these are just regular functions, it is perfectly ok to create the intrinsic twice:
6149
6149
6150
6150
```rust
6151
- #![feature(rustc_attrs, effects )]
6151
+ #![feature(rustc_attrs)]
6152
6152
#![allow(internal_features)]
6153
6153
6154
6154
#[rustc_intrinsic]
@@ -6172,12 +6172,23 @@ fn hover_feature() {
6172
6172
Various intrinsics have native MIR operations that they correspond to. Instead of requiring
6173
6173
backends to implement both the intrinsic and the MIR operation, the `lower_intrinsics` pass
6174
6174
will convert the calls to the MIR operation. Backends do not need to know about these intrinsics
6175
- at all.
6175
+ at all. These intrinsics only make sense without a body, and can either be declared as a "rust-intrinsic"
6176
+ or as a `#[rustc_intrinsic]`. The body is never used, as calls to the intrinsic do not exist
6177
+ anymore after MIR analyses.
6176
6178
6177
6179
## Intrinsics without fallback logic
6178
6180
6179
6181
These must be implemented by all backends.
6180
6182
6183
+ ### `#[rustc_intrinsic]` declarations
6184
+
6185
+ These are written like intrinsics with fallback bodies, but the body is irrelevant.
6186
+ Use `loop {}` for the body or call the intrinsic recursively and add
6187
+ `#[rustc_intrinsic_must_be_overridden]` to the function to ensure that backends don't
6188
+ invoke the body.
6189
+
6190
+ ### Legacy extern ABI based intrinsics
6191
+
6181
6192
These are imported as if they were FFI functions, with the special
6182
6193
`rust-intrinsic` ABI. For example, if one was in a freestanding
6183
6194
context, but wished to be able to `transmute` between types, and
0 commit comments