mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
use the included file as the source of expanded include macro
Signed-off-by: Yilin Chen <sticnarf@gmail.com>
This commit is contained in:
parent
a0ed87ff56
commit
3bb9efb6b7
5 changed files with 107 additions and 28 deletions
|
@ -606,6 +606,29 @@ fn bar() -> u32 {0}
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn infer_builtin_macros_include_child_mod() {
|
||||
check_types(
|
||||
r#"
|
||||
//- /main.rs
|
||||
#[rustc_builtin_macro]
|
||||
macro_rules! include {() => {}}
|
||||
|
||||
include!("f/foo.rs");
|
||||
|
||||
fn main() {
|
||||
bar::bar();
|
||||
} //^ u32
|
||||
|
||||
//- /f/foo.rs
|
||||
pub mod bar;
|
||||
|
||||
//- /f/bar.rs
|
||||
pub fn bar() -> u32 {0}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn infer_builtin_macros_include_str() {
|
||||
check_types(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue