field_reassign_with_default

This commit is contained in:
Johann Hemmann 2024-01-22 02:15:29 +01:00
parent dd9f27b8d3
commit 04ccef80cb
8 changed files with 18 additions and 16 deletions

View file

@ -168,7 +168,6 @@ new_ret_no_self = "allow"
## Following lints should be tackled at some point
borrowed_box = "allow"
derived_hash_with_manual_eq = "allow"
field_reassign_with_default = "allow"
forget_non_drop = "allow"
format_collect = "allow"
large_enum_variant = "allow"

View file

@ -120,6 +120,7 @@ pub(crate) fn hover(
Some(res)
}
#[allow(clippy::field_reassign_with_default)]
fn hover_simple(
sema: &Semantics<'_, RootDatabase>,
FilePosition { file_id, offset }: FilePosition,

View file

@ -58,12 +58,14 @@ impl flags::AnalysisStats {
Rand32::new(seed)
};
let mut cargo_config = CargoConfig::default();
cargo_config.sysroot = match self.no_sysroot {
true => None,
false => Some(RustLibSource::Discover),
let cargo_config = CargoConfig {
sysroot: match self.no_sysroot {
true => None,
false => Some(RustLibSource::Discover),
},
sysroot_query_metadata: self.query_sysroot_metadata,
..Default::default()
};
cargo_config.sysroot_query_metadata = self.query_sysroot_metadata;
let no_progress = &|_| ();
let mut db_load_sw = self.stop_watch();

View file

@ -13,8 +13,8 @@ use crate::cli::flags;
impl flags::Diagnostics {
pub fn run(self) -> anyhow::Result<()> {
let mut cargo_config = CargoConfig::default();
cargo_config.sysroot = Some(RustLibSource::Discover);
let cargo_config =
CargoConfig { sysroot: Some(RustLibSource::Discover), ..Default::default() };
let with_proc_macro_server = if let Some(p) = &self.proc_macro_srv {
let path = vfs::AbsPathBuf::assert(std::env::current_dir()?.join(p));
ProcMacroServerChoice::Explicit(path)

View file

@ -287,8 +287,8 @@ impl flags::Lsif {
pub fn run(self) -> anyhow::Result<()> {
eprintln!("Generating LSIF started...");
let now = Instant::now();
let mut cargo_config = CargoConfig::default();
cargo_config.sysroot = Some(RustLibSource::Discover);
let cargo_config =
CargoConfig { sysroot: Some(RustLibSource::Discover), ..Default::default() };
let no_progress = &|_| ();
let load_cargo_config = LoadCargoConfig {
load_out_dirs_from_check: true,

View file

@ -13,8 +13,8 @@ use crate::cli::{flags, full_name_of_item, Result};
impl flags::RunTests {
pub fn run(self) -> Result<()> {
let mut cargo_config = CargoConfig::default();
cargo_config.sysroot = Some(RustLibSource::Discover);
let cargo_config =
CargoConfig { sysroot: Some(RustLibSource::Discover), ..Default::default() };
let load_cargo_config = LoadCargoConfig {
load_out_dirs_from_check: true,
with_proc_macro_server: ProcMacroServerChoice::Sysroot,

View file

@ -59,8 +59,8 @@ impl Tester {
path.push("ra-rustc-test.rs");
let tmp_file = AbsPathBuf::try_from(path).unwrap();
std::fs::write(&tmp_file, "")?;
let mut cargo_config = CargoConfig::default();
cargo_config.sysroot = Some(RustLibSource::Discover);
let cargo_config =
CargoConfig { sysroot: Some(RustLibSource::Discover), ..Default::default() };
let workspace = ProjectWorkspace::DetachedFiles {
files: vec![tmp_file.clone()],
sysroot: Ok(Sysroot::discover(

View file

@ -10,8 +10,8 @@ use crate::cli::flags;
impl flags::Ssr {
pub fn run(self) -> anyhow::Result<()> {
use ide_db::base_db::SourceDatabaseExt;
let mut cargo_config = CargoConfig::default();
cargo_config.sysroot = Some(RustLibSource::Discover);
let cargo_config =
CargoConfig { sysroot: Some(RustLibSource::Discover), ..Default::default() };
let load_cargo_config = LoadCargoConfig {
load_out_dirs_from_check: true,
with_proc_macro_server: ProcMacroServerChoice::Sysroot,