mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 13:48:50 +00:00
field_reassign_with_default
This commit is contained in:
parent
dd9f27b8d3
commit
04ccef80cb
8 changed files with 18 additions and 16 deletions
|
@ -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"
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -58,12 +58,14 @@ impl flags::AnalysisStats {
|
|||
Rand32::new(seed)
|
||||
};
|
||||
|
||||
let mut cargo_config = CargoConfig::default();
|
||||
cargo_config.sysroot = match self.no_sysroot {
|
||||
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();
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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(
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in a new issue