mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 12:54:58 +00:00
internal: refactor prefer_no_std
/prefer_prelude
bools into a struct
This commit is contained in:
parent
6a16749eb0
commit
b75301cec8
37 changed files with 304 additions and 351 deletions
|
@ -6,7 +6,7 @@ use crate::{
|
|||
resolving::{ResolvedPattern, ResolvedRule, UfcsCallInfo},
|
||||
SsrMatches,
|
||||
};
|
||||
use hir::Semantics;
|
||||
use hir::{ImportPathConfig, Semantics};
|
||||
use ide_db::{base_db::FileRange, FxHashMap};
|
||||
use std::{cell::Cell, iter::Peekable};
|
||||
use syntax::{
|
||||
|
@ -663,10 +663,10 @@ impl Match {
|
|||
.module();
|
||||
for (path, resolved_path) in &template.resolved_paths {
|
||||
if let hir::PathResolution::Def(module_def) = resolved_path.resolution {
|
||||
let mod_path =
|
||||
module.find_path(sema.db, module_def, false, true).ok_or_else(|| {
|
||||
match_error!("Failed to render template path `{}` at match location")
|
||||
})?;
|
||||
let cfg = ImportPathConfig { prefer_no_std: false, prefer_prelude: true };
|
||||
let mod_path = module.find_path(sema.db, module_def, cfg).ok_or_else(|| {
|
||||
match_error!("Failed to render template path `{}` at match location")
|
||||
})?;
|
||||
self.rendered_template_paths.insert(path.clone(), mod_path);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue