Rollup merge of #128491 - c410-f3r:unlock-rfc-2011, r=workingjubilee

[`macro_metavar_expr_concat`] Dogfooding

cc #124225

Starts inner usage to test the robustness of the implementation.
This commit is contained in:
Matthias Krüger 2024-08-02 06:43:43 +02:00 committed by GitHub
commit 55ed05cbac
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 16 deletions

View File

@ -302,6 +302,7 @@
#![feature(let_chains)]
#![feature(link_cfg)]
#![feature(linkage)]
#![feature(macro_metavar_expr_concat)]
#![feature(min_exhaustive_patterns)]
#![feature(min_specialization)]
#![feature(must_not_suspend)]

View File

@ -168,14 +168,7 @@ unsafe fn $name($($arg_name:$t),*) -> $ret {
if let Some(fun) = $name.get() {
fun($($arg_name),*)
} else {
// This looks like a hack, but concat_idents only accepts idents
// (not paths).
use libc::*;
syscall(
concat_idents!(SYS_, $name),
$($arg_name),*
) as $ret
libc::syscall(libc::${concat(SYS_, $name)}, $($arg_name),*) as $ret
}
}
)
@ -185,14 +178,7 @@ unsafe fn $name($($arg_name:$t),*) -> $ret {
pub(crate) macro raw_syscall {
(fn $name:ident($($arg_name:ident: $t:ty),*) -> $ret:ty) => (
unsafe fn $name($($arg_name:$t),*) -> $ret {
// This looks like a hack, but concat_idents only accepts idents
// (not paths).
use libc::*;
syscall(
concat_idents!(SYS_, $name),
$($arg_name),*
) as $ret
libc::syscall(libc::${concat(SYS_, $name)}, $($arg_name),*) as $ret
}
)
}