use the included file as the source of expanded include macro

Signed-off-by: Yilin Chen <sticnarf@gmail.com>
This commit is contained in:
Yilin Chen 2021-03-21 23:02:01 +08:00
parent a0ed87ff56
commit 3bb9efb6b7
No known key found for this signature in database
GPG key ID: 353E7ED34BF326E0
5 changed files with 107 additions and 28 deletions

View file

@ -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(