rust/tests/ui/intrinsics
bors fd127a3a84 Auto merge of #135031 - RalfJung:intrinsics-without-body, r=oli-obk
rustc_intrinsic: support functions without body

We synthesize a HIR body `loop {}` but such bodyless intrinsics.

Most of the diff is due to turning `ItemKind::Fn` into a brace (named-field) enum variant, because it carries a `bool`-typed field now. This is to remember whether the function has a body. MIR building panics to avoid ever translating the fake `loop {}` body, and the intrinsic logic uses the lack of a body to implicitly mark that intrinsic as must-be-overridden.

I first tried actually having no body rather than generating the fake body, but there's a *lot* of code that assumes that all function items have HIR and MIR, so this didn't work very well. Then I noticed that even `rustc_intrinsic_must_be_overridden` intrinsics have MIR generated (they are filled with an `Unreachable` terminator) so I guess I am not the first to discover this. ;)

r? `@oli-obk`
2025-01-04 12:50:38 +00:00
..
auxiliary
always-extern.rs Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
always-extern.stderr Move 100 entries from tests/ui into subdirs 2024-05-20 19:55:59 -07:00
always-gets-overridden.rs remove support for rustc_safe_intrinsic attribute; use rustc_intrinsic functions instead 2024-11-08 09:16:00 +01:00
bad-intrinsic-monomorphization.rs Fixup 2 ui tests using changed intrinsics 2024-04-16 12:39:53 +00:00
bad-intrinsic-monomorphization.stderr
const-eval-select-backtrace-std.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
const-eval-select-backtrace-std.run.stderr Try to write the panic message with a single write_all call 2025-01-01 15:58:29 +01:00
const-eval-select-backtrace.rs const_eval_select: make it safe but be careful with what we expose on stable for now 2024-03-02 16:09:31 +01:00
const-eval-select-backtrace.run.stderr Try to write the panic message with a single write_all call 2025-01-01 15:58:29 +01:00
const-eval-select-bad.rs Pretty print Fn traits in rustc_on_unimplemented 2023-11-02 20:57:05 +00:00
const-eval-select-bad.stderr core: move intrinsics.rs into intrinsics folder 2024-11-07 17:49:45 +01:00
const-eval-select-stability.rs Re-do recursive const stability checks 2024-10-25 20:31:40 +02:00
const-eval-select-stability.stderr Re-do recursive const stability checks 2024-10-25 20:31:40 +02:00
const-eval-select-x86_64.rs const_eval_select: make it safe but be careful with what we expose on stable for now 2024-03-02 16:09:31 +01:00
const-eval-select.rs const_eval_select: make it safe but be careful with what we expose on stable for now 2024-03-02 16:09:31 +01:00
incorrect-read_via_copy-defn.rs Don't even parse an intrinsic unless the feature gate is enabled 2024-04-07 13:30:12 -04:00
incorrect-read_via_copy-defn.stderr Don't even parse an intrinsic unless the feature gate is enabled 2024-04-07 13:30:12 -04:00
incorrect-transmute.rs Don't even parse an intrinsic unless the feature gate is enabled 2024-04-07 13:30:12 -04:00
incorrect-transmute.stderr Don't even parse an intrinsic unless the feature gate is enabled 2024-04-07 13:30:12 -04:00
intrinsic-alignment.rs add alignment info for test 2024-12-16 14:59:10 -05:00
intrinsic-assume.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
intrinsic-atomics-cc.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
intrinsic-atomics.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
intrinsic-fmuladd.rs intrinsics.fmuladdf{16,32,64,128}: expose llvm.fmuladd.* semantics 2024-10-11 15:32:56 -06:00
intrinsic-nearby.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
intrinsic-raw_eq-const-bad.rs most const intrinsics don't need an explicit rustc_const_unstable any more 2024-11-04 23:27:46 +01:00
intrinsic-raw_eq-const-bad.stderr most const intrinsics don't need an explicit rustc_const_unstable any more 2024-11-04 23:27:46 +01:00
intrinsic-raw_eq-const.rs most const intrinsics don't need an explicit rustc_const_unstable any more 2024-11-04 23:27:46 +01:00
intrinsic-unreachable.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
intrinsic-volatile.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
intrinsics-integer.rs remove support for rustc_safe_intrinsic attribute; use rustc_intrinsic functions instead 2024-11-08 09:16:00 +01:00
intrinsics-math.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
issue-28575.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
issue-28575.stderr Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
issue-84297-reifying-copy.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
non-integer-atomic.rs [AUTO-GENERATED] Migrate ui tests from // to //@ directives 2024-02-16 20:02:50 +00:00
non-integer-atomic.stderr
not-overridden.rs rustc_intrinsic: support functions without body; they are implicitly marked as must-be-overridden 2025-01-04 11:41:51 +01:00
not-overridden.stderr Auto merge of #135031 - RalfJung:intrinsics-without-body, r=oli-obk 2025-01-04 12:50:38 +00:00
panic-uninitialized-zeroed.rs Stabilize generic NonZero. 2024-04-22 18:48:47 +02:00
reify-intrinsic.rs Likely unlikely fix 2024-11-17 21:49:10 +01:00
reify-intrinsic.stderr changes old intrinsic declaration to new declaration 2024-11-24 14:54:36 +05:30
safe-intrinsic-mismatch.rs Yeet effects feature 2024-11-03 18:59:31 +00:00
safe-intrinsic-mismatch.stderr Yeet effects feature 2024-11-03 18:59:31 +00:00
unchecked_math_unsafe.rs Remove revisions for THIR unsafeck 2024-01-05 09:30:27 +00:00
unchecked_math_unsafe.stderr Stabilize THIR unsafeck 2024-01-05 10:00:59 +00:00
unchecked_math_unstable.rs
unchecked_math_unstable.stderr use backticks instead of single quotes when reporting "use of unstable library feature" 2024-11-03 13:55:52 -08:00