mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-29 05:15:04 +00:00
internal: check diagnostics in all files and not just the first one
This commit is contained in:
parent
7bff76d8ae
commit
a1940d8c75
6 changed files with 83 additions and 49 deletions
|
@ -14,7 +14,12 @@ pub(super) fn macro_error(ctx: &DiagnosticsContext<'_>, d: &hir::MacroError) ->
|
|||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use crate::diagnostics::tests::{check_diagnostics, check_no_diagnostics};
|
||||
use crate::{
|
||||
diagnostics::tests::{
|
||||
check_diagnostics, check_diagnostics_with_config, check_no_diagnostics,
|
||||
},
|
||||
DiagnosticsConfig,
|
||||
};
|
||||
|
||||
#[test]
|
||||
fn builtin_macro_fails_expansion() {
|
||||
|
@ -31,7 +36,14 @@ macro_rules! include { () => {} }
|
|||
|
||||
#[test]
|
||||
fn include_macro_should_allow_empty_content() {
|
||||
check_diagnostics(
|
||||
let mut config = DiagnosticsConfig::default();
|
||||
|
||||
// FIXME: This is a false-positive, the file is actually linked in via
|
||||
// `include!` macro
|
||||
config.disabled.insert("unlinked-file".to_string());
|
||||
|
||||
check_diagnostics_with_config(
|
||||
config,
|
||||
r#"
|
||||
//- /lib.rs
|
||||
#[rustc_builtin_macro]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue