aboutsummaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2021-11-25 13:04:38 +0100
committerMartin Fischer <martin@push-f.com>2021-11-25 13:40:30 +0100
commit88f33dee26815c3382bfb18c800f3f54b6397e20 (patch)
tree9f8a36a62ff0b6d64ffebe3fed04c8e1d37947a9 /src/lib.rs
parentdc568083381d2073f0cfcfad8fa58158bd5bf811 (diff)
also detect <Self as Foo>::X in generic type args
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 1c7220f..4c1675c 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -373,7 +373,17 @@ fn generate_blanket_impl(
}
fn path_is_assoc_type(path: &TypePath) -> bool {
- path.path.segments[0].ident == "Self"
+ if path.path.segments[0].ident == "Self" {
+ return true;
+ }
+ if let Some(qself) = &path.qself {
+ if let Type::Path(path) = qself.ty.as_ref() {
+ if path.path.segments[0].ident == "Self" {
+ return true;
+ }
+ }
+ }
+ false
}
fn match_assoc_type(item: &Type) -> bool {