We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the test:
trait Types { type Assoc; } #[derive(Encode, Decode)] struct Assoc<T: Types> { a: Vec<<T>::Assoc>, }
fails because the bound <T>::Assoc is consider as Assoc and thus the code thinks it is a recursive bound and so removes it.
<T>::Assoc
Assoc
A fix should be something like:
diff --git a/derive/src/trait_bounds.rs b/derive/src/trait_bounds.rs index c6303f4..8c9d15e 100644 --- a/derive/src/trait_bounds.rs +++ b/derive/src/trait_bounds.rs @@ -52,12 +52,14 @@ struct TypePathStartsWithIdent<'a> { impl<'a, 'ast> Visit<'ast> for TypePathStartsWithIdent<'a> { fn visit_type_path(&mut self, i: &'ast TypePath) { + if i.qself.is_none() { if let Some(segment) = i.path.segments.first() { if &segment.ident == self.ident { self.result = true; return; } } + } visit::visit_type_path(self, i); }
But we should check that other usage are not broken by this change.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
the test:
fails because the bound
<T>::Assoc
is consider asAssoc
and thus the code thinks it is a recursive bound and so removes it.A fix should be something like:
But we should check that other usage are not broken by this change.
The text was updated successfully, but these errors were encountered: