about summary refs log tree commit diff
path: root/tests/ui/force-inlining
AgeCommit message (Collapse)AuthorLines
2025-10-02Extends `rustc_force_inline` to inherent methodsReuben Cruise-24/+49
- Changes parser to allow application to inherent methods. - Adds tests to confirm extended functionality works just as the existing.
2025-08-14Update uitestsJonathan Brouwer-241/+191
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
2025-06-17make error codes reflect reality betterJana Dönszelmann-20/+12
2025-06-17use consistent attr errors in all attribute parsersJana Dönszelmann-3/+3
2025-06-17fix bugs in inline/force_inline and diagnostics of all attr parsersJana Dönszelmann-63/+72
2025-06-09refactor `AttributeGate` and `rustc_attr!` to emit notes during feature ↵mejrs-7/+13
checking
2025-02-28Rollup merge of #137599 - davidtwco:use-minicore-more, r=jieyouxu许杰友 Jieyou Xu (Joe)-15/+7
tests: use minicore more minicore makes it much easier to add new language items to all of the existing `no_core` tests. Most of the remaining tests that *could* use minicore either fail because.. 1. LLVM IR output changes and doesn't pass the test as written. I didn't look into these further. 2. The test has revisions w/ different compilation flags, expecting some to fail, and when using minicore, minicore is compiled with those flags and fails in the expected way because of the flags rather than the test, and that's considered a failure. But these tests can be changed and make adding new language items a lot easier. r? ```@jieyouxu```
2025-02-24tests: use minicore moreDavid Wood-15/+7
minicore makes it much easier to add new language items to all of the existing `no_core` tests.
2025-02-24feature: fix typo in attribute descriptionDavid Wood-4/+4
The force inlining attribute isn't is never used with `#![..]` attribute syntax, only `#[..]` syntax.
2025-02-10Show diff suggestion format on verbose replacementEsteban Küber-8/+16
``` error[E0610]: `{integer}` is a primitive type and therefore doesn't have fields --> $DIR/attempted-access-non-fatal.rs:7:15 | LL | let _ = 2.l; | ^ | help: if intended to be a floating point literal, consider adding a `0` after the period and a `f64` suffix | LL - let _ = 2.l; LL + let _ = 2.0f64; | ```
2025-02-05Eagerly detect coroutine recursion pre-mono when possibleMichael Goulet-2/+21
2025-02-02Tweak fn pointer suggestion spanEsteban Küber-2/+2
Use a more targeted span when suggesting casting an `fn` item to an `fn` pointer. ``` error[E0308]: cannot coerce functions which must be inlined to function pointers --> $DIR/cast.rs:10:33 | LL | let _: fn(isize) -> usize = callee; | ------------------ ^^^^^^ cannot coerce functions which must be inlined to function pointers | | | expected due to this | = note: expected fn pointer `fn(_) -> _` found fn item `fn(_) -> _ {callee}` = note: fn items are distinct from fn pointers help: consider casting to a fn pointer | LL | let _: fn(isize) -> usize = callee as fn(isize) -> usize; | +++++++++++++++++++++ ``` ``` error[E0308]: mismatched types --> $DIR/fn-pointer-mismatch.rs:42:30 | LL | let d: &fn(u32) -> u32 = foo; | --------------- ^^^ expected `&fn(u32) -> u32`, found fn item | | | expected due to this | = note: expected reference `&fn(_) -> _` found fn item `fn(_) -> _ {foo}` help: consider using a reference | LL | let d: &fn(u32) -> u32 = &foo; | + ``` Previously we'd point at the whole expression for replacement, instead of marking what was being added. We could also modify the suggestions for `&(name as fn())`, but for that we require storing more accurate spans than we have now.
2025-01-10mir_build: check annotated functions w/out callersDavid Wood-53/+112
2025-01-10inline: re-introduce some callee body checksDavid Wood-0/+102
2025-01-10inline: force inlining shimsDavid Wood-0/+9
2025-01-10mir_transform: implement forced inliningDavid Wood-0/+803
Adds `#[rustc_force_inline]` which is similar to always inlining but reports an error if the inlining was not possible, and which always attempts to inline annotated items, regardless of optimisation levels. It can only be applied to free functions to guarantee that the MIR inliner will be able to resolve calls.