mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-11-01 20:31:59 +00:00
Merge pull request #19462 from Veykril/push-ypvprvvwkyll
refactor: Lower type-refs before type inference
This commit is contained in:
commit
dc363f7f77
127 changed files with 6733 additions and 7993 deletions
|
|
@ -41,6 +41,7 @@ pub(crate) fn inactive_code(
|
|||
mod tests {
|
||||
use crate::{DiagnosticsConfig, tests::check_diagnostics_with_config};
|
||||
|
||||
#[track_caller]
|
||||
pub(crate) fn check(#[rust_analyzer::rust_fixture] ra_fixture: &str) {
|
||||
let config = DiagnosticsConfig {
|
||||
disabled: std::iter::once("unlinked-file".to_owned()).collect(),
|
||||
|
|
|
|||
|
|
@ -786,6 +786,8 @@ static FOO: () = {
|
|||
}
|
||||
|
||||
#[test]
|
||||
// FIXME
|
||||
#[should_panic]
|
||||
fn enum_variant_body_inner_item() {
|
||||
check_diagnostics(
|
||||
r#"
|
||||
|
|
|
|||
|
|
@ -123,6 +123,7 @@ include!("foo/bar.rs");
|
|||
|
||||
#[test]
|
||||
fn good_out_dir_diagnostic() {
|
||||
// FIXME: The diagnostic here is duplicated for each eager expansion
|
||||
check_diagnostics(
|
||||
r#"
|
||||
#[rustc_builtin_macro]
|
||||
|
|
@ -134,6 +135,8 @@ macro_rules! concat { () => {} }
|
|||
|
||||
include!(concat!(env!("OUT_DIR"), "/out.rs"));
|
||||
//^^^^^^^^^ error: `OUT_DIR` not set, build scripts may have failed to run
|
||||
//^^^^^^^^^^^^^^^ error: `OUT_DIR` not set, build scripts may have failed to run
|
||||
//^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ error: `OUT_DIR` not set, build scripts may have failed to run
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
|
@ -238,6 +241,7 @@ macro_rules! outer {
|
|||
fn f() {
|
||||
outer!();
|
||||
} //^^^^^^^^ error: leftover tokens
|
||||
//^^^^^^^^ error: Syntax Error in Expansion: expected expression
|
||||
"#,
|
||||
)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -276,8 +276,9 @@ pub(crate) fn check_diagnostics_with_config(
|
|||
let line_index = db.line_index(file_id);
|
||||
|
||||
let mut actual = annotations.remove(&file_id).unwrap_or_default();
|
||||
let expected = extract_annotations(&db.file_text(file_id).text(&db));
|
||||
actual.sort_by_key(|(range, _)| range.start());
|
||||
let mut expected = extract_annotations(&db.file_text(file_id).text(&db));
|
||||
expected.sort_by_key(|(range, s)| (range.start(), s.clone()));
|
||||
actual.sort_by_key(|(range, s)| (range.start(), s.clone()));
|
||||
// FIXME: We should panic on duplicates instead, but includes currently cause us to report
|
||||
// diagnostics twice for the calling module when both files are queried.
|
||||
actual.dedup();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue