Support local macro_rules

This commit is contained in:
Edwin Cheng 2020-03-14 14:25:30 +08:00
parent 4c85e53531
commit fe78a14bbb
6 changed files with 96 additions and 16 deletions

View file

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