2024-09-23 17:46:23 +00:00
|
|
|
//@ compile-flags: --crate-type=lib
|
|
|
|
//@ edition: 2021
|
2025-01-27 19:15:37 +00:00
|
|
|
|
2024-09-23 17:46:23 +00:00
|
|
|
#![allow(internal_features)]
|
|
|
|
#![feature(rustc_attrs)]
|
|
|
|
|
|
|
|
// Test that forced inlining into async functions w/ errors works as expected.
|
|
|
|
|
|
|
|
#[rustc_no_mir_inline]
|
|
|
|
#[rustc_force_inline]
|
2025-01-07 11:27:04 +00:00
|
|
|
//~^ ERROR `callee` is incompatible with `#[rustc_force_inline]`
|
2024-09-23 17:46:23 +00:00
|
|
|
pub fn callee() {
|
|
|
|
}
|
|
|
|
|
|
|
|
#[rustc_no_mir_inline]
|
|
|
|
#[rustc_force_inline = "the test requires it"]
|
2025-01-07 11:27:04 +00:00
|
|
|
//~^ ERROR `callee_justified` is incompatible with `#[rustc_force_inline]`
|
2024-09-23 17:46:23 +00:00
|
|
|
pub fn callee_justified() {
|
|
|
|
}
|
|
|
|
|
|
|
|
async fn async_caller() {
|
|
|
|
callee();
|
2025-01-27 19:15:37 +00:00
|
|
|
//~^ ERROR `callee` could not be inlined
|
2024-09-23 17:46:23 +00:00
|
|
|
callee_justified();
|
2025-01-27 19:15:37 +00:00
|
|
|
//~^ ERROR `callee_justified` could not be inlined
|
2024-09-23 17:46:23 +00:00
|
|
|
}
|