mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Lint debug prints and disallowed types with clippy
This commit is contained in:
parent
850ba2fb63
commit
9e8a0fae0c
64 changed files with 170 additions and 229 deletions
|
@ -1,8 +1,7 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
use chalk_ir::{AdtId, TyKind};
|
||||
use either::Either;
|
||||
use hir_def::db::DefDatabase;
|
||||
use rustc_hash::FxHashMap;
|
||||
use test_fixture::WithFixture;
|
||||
use triomphe::Arc;
|
||||
|
||||
|
@ -16,7 +15,7 @@ use crate::{
|
|||
mod closure;
|
||||
|
||||
fn current_machine_data_layout() -> String {
|
||||
project_model::target_data_layout::get(None, None, &HashMap::default()).unwrap()
|
||||
project_model::target_data_layout::get(None, None, &FxHashMap::default()).unwrap()
|
||||
}
|
||||
|
||||
fn eval_goal(ra_fixture: &str, minicore: &str) -> Result<Arc<Layout>, LayoutError> {
|
||||
|
|
|
@ -10,7 +10,7 @@ mod regression;
|
|||
mod simple;
|
||||
mod traits;
|
||||
|
||||
use std::{collections::HashMap, env};
|
||||
use std::env;
|
||||
|
||||
use base_db::{FileRange, SourceDatabaseExt};
|
||||
use expect_test::Expect;
|
||||
|
@ -25,6 +25,7 @@ use hir_def::{
|
|||
};
|
||||
use hir_expand::{db::ExpandDatabase, InFile};
|
||||
use once_cell::race::OnceBool;
|
||||
use rustc_hash::FxHashMap;
|
||||
use stdx::format_to;
|
||||
use syntax::{
|
||||
ast::{self, AstNode, HasName},
|
||||
|
@ -90,9 +91,9 @@ fn check_impl(ra_fixture: &str, allow_none: bool, only_types: bool, display_sour
|
|||
let (db, files) = TestDB::with_many_files(ra_fixture);
|
||||
|
||||
let mut had_annotations = false;
|
||||
let mut mismatches = HashMap::new();
|
||||
let mut types = HashMap::new();
|
||||
let mut adjustments = HashMap::<_, Vec<_>>::new();
|
||||
let mut mismatches = FxHashMap::default();
|
||||
let mut types = FxHashMap::default();
|
||||
let mut adjustments = FxHashMap::<_, Vec<_>>::default();
|
||||
for (file_id, annotations) in db.extract_annotations() {
|
||||
for (range, expected) in annotations {
|
||||
let file_range = FileRange { file_id, range };
|
||||
|
|
|
@ -187,7 +187,7 @@ struct LoggingRustIrDatabaseLoggingOnDrop<'a>(LoggingRustIrDatabase<Interner, Ch
|
|||
|
||||
impl Drop for LoggingRustIrDatabaseLoggingOnDrop<'_> {
|
||||
fn drop(&mut self) {
|
||||
eprintln!("chalk program:\n{}", self.0);
|
||||
tracing::info!("chalk program:\n{}", self.0);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue