Skip to content

Commit 4465fff

Browse files
committed
Update hover test fixture
1 parent e96601b commit 4465fff

File tree

1 file changed

+14
-3
lines changed
  • src/tools/rust-analyzer/crates/ide/src/hover

1 file changed

+14
-3
lines changed

src/tools/rust-analyzer/crates/ide/src/hover/tests.rs

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6138,7 +6138,7 @@ fn hover_feature() {
61386138
by the codegen backend, but not the MIR inliner.
61396139
61406140
```rust
6141-
#![feature(rustc_attrs, effects)]
6141+
#![feature(rustc_attrs)]
61426142
#![allow(internal_features)]
61436143
61446144
#[rustc_intrinsic]
@@ -6148,7 +6148,7 @@ fn hover_feature() {
61486148
Since these are just regular functions, it is perfectly ok to create the intrinsic twice:
61496149
61506150
```rust
6151-
#![feature(rustc_attrs, effects)]
6151+
#![feature(rustc_attrs)]
61526152
#![allow(internal_features)]
61536153
61546154
#[rustc_intrinsic]
@@ -6172,12 +6172,23 @@ fn hover_feature() {
61726172
Various intrinsics have native MIR operations that they correspond to. Instead of requiring
61736173
backends to implement both the intrinsic and the MIR operation, the `lower_intrinsics` pass
61746174
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.
61766178
61776179
## Intrinsics without fallback logic
61786180
61796181
These must be implemented by all backends.
61806182
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+
61816192
These are imported as if they were FFI functions, with the special
61826193
`rust-intrinsic` ABI. For example, if one was in a freestanding
61836194
context, but wished to be able to `transmute` between types, and

0 commit comments

Comments
 (0)