mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 13:25:09 +00:00
Emit builtin#format_args in builtin format_args expander
This commit is contained in:
parent
5fdd1e36e3
commit
c0e402637e
15 changed files with 146 additions and 341 deletions
|
@ -401,19 +401,14 @@ fn test_string_highlighting() {
|
|||
// thus, we have to copy the macro definition from `std`
|
||||
check_highlighting(
|
||||
r#"
|
||||
//- minicore: fmt
|
||||
macro_rules! println {
|
||||
($($arg:tt)*) => ({
|
||||
$crate::io::_print($crate::format_args_nl!($($arg)*));
|
||||
$crate::io::_print(format_args_nl!($($arg)*));
|
||||
})
|
||||
}
|
||||
#[rustc_builtin_macro]
|
||||
#[macro_export]
|
||||
macro_rules! format_args {}
|
||||
#[rustc_builtin_macro]
|
||||
#[macro_export]
|
||||
macro_rules! const_format_args {}
|
||||
#[rustc_builtin_macro]
|
||||
#[macro_export]
|
||||
macro_rules! format_args_nl {}
|
||||
|
||||
mod panic {
|
||||
|
@ -433,7 +428,7 @@ mod panic {
|
|||
$crate::panicking::panic_display(&$arg)
|
||||
),
|
||||
($fmt:expr, $($arg:tt)+) => (
|
||||
$crate::panicking::panic_fmt($crate::const_format_args!($fmt, $($arg)+))
|
||||
$crate::panicking::panic_fmt(const_format_args!($fmt, $($arg)+))
|
||||
),
|
||||
}
|
||||
}
|
||||
|
@ -450,7 +445,7 @@ macro_rules! concat {}
|
|||
|
||||
macro_rules! toho {
|
||||
() => ($crate::panic!("not yet implemented"));
|
||||
($($arg:tt)+) => ($crate::panic!("not yet implemented: {}", $crate::format_args!($($arg)+)));
|
||||
($($arg:tt)+) => ($crate::panic!("not yet implemented: {}", format_args!($($arg)+)));
|
||||
}
|
||||
|
||||
fn main() {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue