mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Fix panic on eager expansion
This commit is contained in:
parent
074474fe00
commit
e04c0f4222
2 changed files with 39 additions and 2 deletions
|
@ -438,6 +438,27 @@ fn main() {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn infer_builtin_macros_concat_with_lazy() {
|
||||
assert_snapshot!(
|
||||
infer(r#"
|
||||
macro_rules! hello {() => {"hello"}}
|
||||
|
||||
#[rustc_builtin_macro]
|
||||
macro_rules! concat {() => {}}
|
||||
|
||||
fn main() {
|
||||
let x = concat!(hello!(), concat!("world", "!"));
|
||||
}
|
||||
"#),
|
||||
@r###"
|
||||
![0; 13) '"helloworld!"': &str
|
||||
[104; 161) '{ ...")); }': ()
|
||||
[114; 115) 'x': &str
|
||||
"###
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn infer_derive_clone_simple() {
|
||||
let (db, pos) = TestDB::with_position(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue