Prettify AST in PathTransform if it's coming from a macro

This commit is contained in:
Chayim Refael Friedman 2025-06-26 10:03:44 +03:00
parent 317542c1e4
commit 4db8341ddb
3 changed files with 58 additions and 4 deletions

View file

@ -550,3 +550,30 @@ fn inside_extern_blocks() {
"#]],
)
}
#[test]
fn tokens_from_macro() {
check_edit(
"fn as_ref",
r#"
//- proc_macros: identity
//- minicore: as_ref
struct Foo;
#[proc_macros::identity]
impl<'a> AsRef<&'a i32> for Foo {
$0
}
"#,
r#"
struct Foo;
#[proc_macros::identity]
impl<'a> AsRef<&'a i32> for Foo {
fn as_ref(&self) -> &&'a i32 {
$0
}
}
"#,
);
}