diff options
| author | Caio <c410.f3r@gmail.com> | 2024-08-01 21:32:12 -0300 |
|---|---|---|
| committer | Caio <c410.f3r@gmail.com> | 2024-08-01 21:32:12 -0300 |
| commit | b2f7e71f0b38bbd0c43177802810ed90af58b93f (patch) | |
| tree | 798f77ac1b9ac3bd6dacdf86ab761718101e19d4 /library/std/src | |
| parent | 97ac52f579fe1003a162324d448dad43a942b5f5 (diff) | |
| download | rust-b2f7e71f0b38bbd0c43177802810ed90af58b93f.tar.gz rust-b2f7e71f0b38bbd0c43177802810ed90af58b93f.zip | |
Dogfood
Diffstat (limited to 'library/std/src')
| -rw-r--r-- | library/std/src/lib.rs | 1 | ||||
| -rw-r--r-- | library/std/src/sys/pal/unix/weak.rs | 18 |
2 files changed, 3 insertions, 16 deletions
diff --git a/library/std/src/lib.rs b/library/std/src/lib.rs index 6bd9c59a949..37ba7e7065d 100644 --- a/library/std/src/lib.rs +++ b/library/std/src/lib.rs @@ -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)] diff --git a/library/std/src/sys/pal/unix/weak.rs b/library/std/src/sys/pal/unix/weak.rs index b1b6aae757c..35762f5a53b 100644 --- a/library/std/src/sys/pal/unix/weak.rs +++ b/library/std/src/sys/pal/unix/weak.rs @@ -168,14 +168,7 @@ pub(crate) macro syscall { 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 @@ pub(crate) macro syscall { 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 } ) } |
