mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-03 15:15:24 +00:00
implement creating generics for impl traits in associated types
This commit is contained in:
parent
f216be4a07
commit
40a677ddf0
6 changed files with 102 additions and 17 deletions
|
@ -208,6 +208,13 @@ pub(super) fn lower_generic_args(
|
|||
.and_then(|args| lower_generic_args(lower_ctx, args))
|
||||
.map(Interned::new);
|
||||
let type_ref = assoc_type_arg.ty().map(|it| TypeRef::from_ast(lower_ctx, it));
|
||||
let type_ref = type_ref.inspect(|tr| {
|
||||
tr.walk(&mut |tr| {
|
||||
if let TypeRef::ImplTrait(bounds) = tr {
|
||||
lower_ctx.update_impl_traits_bounds(bounds.clone());
|
||||
}
|
||||
});
|
||||
});
|
||||
let bounds = if let Some(l) = assoc_type_arg.type_bound_list() {
|
||||
l.bounds()
|
||||
.map(|it| Interned::new(TypeBound::from_ast(lower_ctx, it)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue