mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Fix lifetime parameters moving paramter defaults
This commit is contained in:
parent
1b283db47f
commit
1a929d6485
5 changed files with 113 additions and 68 deletions
|
@ -3602,9 +3602,9 @@ impl ConstParam {
|
|||
}
|
||||
|
||||
fn generic_arg_from_param(db: &dyn HirDatabase, id: TypeOrConstParamId) -> Option<GenericArg> {
|
||||
let params = db.generic_defaults(id.parent);
|
||||
let local_idx = hir_ty::param_idx(db, id)?;
|
||||
let ty = params.get(local_idx)?.clone();
|
||||
let defaults = db.generic_defaults(id.parent);
|
||||
let ty = defaults.get(local_idx)?.clone();
|
||||
let subst = TyBuilder::placeholder_subst(db, id.parent);
|
||||
Some(ty.substitute(Interner, &subst))
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue