mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 21:05:02 +00:00
Simplify
This commit is contained in:
parent
6a852d7627
commit
13890697eb
12 changed files with 121 additions and 136 deletions
|
@ -1040,18 +1040,12 @@ impl InferenceContext<'_> {
|
|||
|
||||
(
|
||||
elem_ty,
|
||||
if let Some(g_def) = self.owner.as_generic_def_id() {
|
||||
let generics = generics(self.db.upcast(), g_def);
|
||||
consteval::eval_to_const(
|
||||
repeat,
|
||||
ParamLoweringMode::Placeholder,
|
||||
self,
|
||||
|| generics,
|
||||
DebruijnIndex::INNERMOST,
|
||||
)
|
||||
} else {
|
||||
consteval::usize_const(self.db, None, krate)
|
||||
},
|
||||
consteval::eval_to_const(
|
||||
repeat,
|
||||
ParamLoweringMode::Placeholder,
|
||||
self,
|
||||
DebruijnIndex::INNERMOST,
|
||||
),
|
||||
)
|
||||
}
|
||||
};
|
||||
|
@ -1852,7 +1846,7 @@ impl InferenceContext<'_> {
|
|||
ty,
|
||||
c,
|
||||
ParamLoweringMode::Placeholder,
|
||||
|| generics(this.db.upcast(), this.resolver.generic_def().unwrap()),
|
||||
|| this.generics(),
|
||||
DebruijnIndex::INNERMOST,
|
||||
)
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue