mbe: fix token conversion for doc comments

This commit is contained in:
Jake Heinz 2023-04-22 02:49:13 +00:00
parent af3b6a0893
commit a497e9a05e
2 changed files with 64 additions and 36 deletions

View file

@ -850,6 +850,32 @@ fn foo() {}
);
}
#[test]
fn goto_through_included_file_struct_with_doc_comment() {
check(
r#"
//- /main.rs
#[rustc_builtin_macro]
macro_rules! include {}
include!("foo.rs");
fn f() {
let x = Foo$0;
}
mod confuse_index {
pub struct Foo;
}
//- /foo.rs
/// This is a doc comment
pub struct Foo;
//^^^
"#,
);
}
#[test]
fn goto_for_type_param() {
check(