mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Merge #8134
8134: Correct the paths of submodules from the include! macro r=edwin0cheng a=sticnarf This PR should fix #7846. It mostly follows the instructions from @edwin0cheng in that issue. Co-authored-by: Yilin Chen <sticnarf@gmail.com>
This commit is contained in:
commit
31ed164161
5 changed files with 108 additions and 30 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