Unnamed repository; edit this file 'description' to name the repository.
Update hover test fixture
Lukas Wirth 2024-07-07
parent 5802643 · commit 09932d9
-rw-r--r--crates/ide/src/hover/tests.rs17
1 files changed, 14 insertions, 3 deletions
diff --git a/crates/ide/src/hover/tests.rs b/crates/ide/src/hover/tests.rs
index 20d07bf991..8479374647 100644
--- a/crates/ide/src/hover/tests.rs
+++ b/crates/ide/src/hover/tests.rs
@@ -6138,7 +6138,7 @@ fn hover_feature() {
by the codegen backend, but not the MIR inliner.
```rust
- #![feature(rustc_attrs, effects)]
+ #![feature(rustc_attrs)]
#![allow(internal_features)]
#[rustc_intrinsic]
@@ -6148,7 +6148,7 @@ fn hover_feature() {
Since these are just regular functions, it is perfectly ok to create the intrinsic twice:
```rust
- #![feature(rustc_attrs, effects)]
+ #![feature(rustc_attrs)]
#![allow(internal_features)]
#[rustc_intrinsic]
@@ -6172,12 +6172,23 @@ fn hover_feature() {
Various intrinsics have native MIR operations that they correspond to. Instead of requiring
backends to implement both the intrinsic and the MIR operation, the `lower_intrinsics` pass
will convert the calls to the MIR operation. Backends do not need to know about these intrinsics
- at all.
+ at all. These intrinsics only make sense without a body, and can either be declared as a "rust-intrinsic"
+ or as a `#[rustc_intrinsic]`. The body is never used, as calls to the intrinsic do not exist
+ anymore after MIR analyses.
## Intrinsics without fallback logic
These must be implemented by all backends.
+ ### `#[rustc_intrinsic]` declarations
+
+ These are written like intrinsics with fallback bodies, but the body is irrelevant.
+ Use `loop {}` for the body or call the intrinsic recursively and add
+ `#[rustc_intrinsic_must_be_overridden]` to the function to ensure that backends don't
+ invoke the body.
+
+ ### Legacy extern ABI based intrinsics
+
These are imported as if they were FFI functions, with the special
`rust-intrinsic` ABI. For example, if one was in a freestanding
context, but wished to be able to `transmute` between types, and