mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Use first early expansion error during nameres
This commit is contained in:
parent
bba474bb52
commit
c64adfe706
2 changed files with 20 additions and 1 deletions
|
@ -1469,7 +1469,9 @@ impl ModCollector<'_, '_> {
|
||||||
)
|
)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
&mut |err| error = Some(err),
|
&mut |err| {
|
||||||
|
error.get_or_insert(err);
|
||||||
|
},
|
||||||
) {
|
) {
|
||||||
Ok(Ok(macro_call_id)) => {
|
Ok(Ok(macro_call_id)) => {
|
||||||
self.def_collector.unexpanded_macros.push(MacroDirective {
|
self.def_collector.unexpanded_macros.push(MacroDirective {
|
||||||
|
|
|
@ -200,3 +200,20 @@ fn builtin_macro_fails_expansion() {
|
||||||
"#,
|
"#,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn good_out_dir_diagnostic() {
|
||||||
|
check_diagnostics(
|
||||||
|
r#"
|
||||||
|
#[rustc_builtin_macro]
|
||||||
|
macro_rules! include { () => {} }
|
||||||
|
#[rustc_builtin_macro]
|
||||||
|
macro_rules! env { () => {} }
|
||||||
|
#[rustc_builtin_macro]
|
||||||
|
macro_rules! concat { () => {} }
|
||||||
|
|
||||||
|
include!(concat!(env!("OUT_DIR"), "/out.rs"));
|
||||||
|
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ `OUT_DIR` not set, enable "load out dirs from check" to fix
|
||||||
|
"#,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue