mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
Merge #10293
10293: fix: Don't bail on parse errors in macro input for builtin expansion r=Veykril a=Veykril Fixes https://github.com/rust-analyzer/rust-analyzer/issues/8158 Co-authored-by: Lukas Wirth <lukastw97@gmail.com>
This commit is contained in:
commit
f1d7f98ed0
2 changed files with 18 additions and 4 deletions
|
@ -792,6 +792,23 @@ mod tests {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_format_args_expand_with_broken_member_access() {
|
||||
check_expansion(
|
||||
r#"
|
||||
#[rustc_builtin_macro]
|
||||
macro_rules! format_args {
|
||||
($fmt:expr) => ({ /* compiler built-in */ });
|
||||
($fmt:expr, $($args:tt)*) => ({ /* compiler built-in */ })
|
||||
}
|
||||
format_args!("{} {:?}", a.);
|
||||
"#,
|
||||
expect![[
|
||||
r#"unsafe{std::fmt::Arguments::new_v1(&[], &[std::fmt::ArgumentV1::new(&(a.),std::fmt::Display::fmt),])}"#
|
||||
]],
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_include_bytes_expand() {
|
||||
check_expansion(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue