mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Add config to unconditionally prefer core imports over std
Fixes https://github.com/rust-lang/rust-analyzer/issues/12979
This commit is contained in:
parent
6909556435
commit
7d19971666
33 changed files with 156 additions and 43 deletions
|
@ -137,6 +137,7 @@ pub(crate) fn json_in_items(
|
|||
sema.db,
|
||||
it,
|
||||
config.insert_use.prefix_kind,
|
||||
config.prefer_core,
|
||||
) {
|
||||
insert_use(
|
||||
&scope,
|
||||
|
@ -152,6 +153,7 @@ pub(crate) fn json_in_items(
|
|||
sema.db,
|
||||
it,
|
||||
config.insert_use.prefix_kind,
|
||||
config.prefer_core,
|
||||
) {
|
||||
insert_use(
|
||||
&scope,
|
||||
|
|
|
@ -124,6 +124,7 @@ fn fixes(ctx: &DiagnosticsContext<'_>, d: &hir::MissingFields) -> Option<Vec<Ass
|
|||
let type_path = current_module?.find_use_path(
|
||||
ctx.sema.db,
|
||||
item_for_path_search(ctx.sema.db, item_in_ns)?,
|
||||
ctx.config.prefer_core,
|
||||
)?;
|
||||
|
||||
use_trivial_constructor(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue