diff options
| author | Reuben Cruise <reuben.cruise@arm.com> | 2025-09-25 16:11:34 +0100 |
|---|---|---|
| committer | Reuben Cruise <reuben.cruise@arm.com> | 2025-10-02 11:30:11 +0100 |
| commit | 5bf5e7116099d85a99d047cfa43db155074e594a (patch) | |
| tree | a486a482df041b66dafc4d44b40b77dd43830e1a /tests/ui/force-inlining/inherent.rs | |
| parent | caccb4d0368bd918ef6668af8e13834d07040417 (diff) | |
| download | rust-5bf5e7116099d85a99d047cfa43db155074e594a.tar.gz rust-5bf5e7116099d85a99d047cfa43db155074e594a.zip | |
Extends `rustc_force_inline` to inherent methods
- Changes parser to allow application to inherent methods. - Adds tests to confirm extended functionality works just as the existing.
Diffstat (limited to 'tests/ui/force-inlining/inherent.rs')
| -rw-r--r-- | tests/ui/force-inlining/inherent.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/ui/force-inlining/inherent.rs b/tests/ui/force-inlining/inherent.rs new file mode 100644 index 00000000000..25c76eaf37a --- /dev/null +++ b/tests/ui/force-inlining/inherent.rs @@ -0,0 +1,21 @@ +//@ check-fail +#![feature(rustc_attrs)] + +struct Foo; + +impl Foo { + #[rustc_force_inline] + //~^ ERROR: `Foo::bar` is incompatible with `#[rustc_force_inline]` + #[rustc_no_mir_inline] + fn bar() {} +} + +fn bar_caller() { + unsafe { + Foo::bar(); + } +} + +fn main() { + bar_caller(); +} |
