mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Support local macro_rules
This commit is contained in:
parent
4c85e53531
commit
fe78a14bbb
6 changed files with 96 additions and 16 deletions
|
@ -362,6 +362,26 @@ fn main() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn infer_local_macro() {
|
||||
assert_snapshot!(
|
||||
infer(r#"
|
||||
fn main() {
|
||||
macro_rules! foo {
|
||||
() => { 1usize }
|
||||
}
|
||||
let _a = foo!();
|
||||
}
|
||||
"#),
|
||||
@r###"
|
||||
![0; 6) '1usize': usize
|
||||
[11; 90) '{ ...!(); }': ()
|
||||
[17; 66) 'macro_... }': {unknown}
|
||||
[75; 77) '_a': usize
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn infer_builtin_macros_line() {
|
||||
assert_snapshot!(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue