File tree Expand file tree Collapse file tree 2 files changed +25
-5
lines changed
Expand file tree Collapse file tree 2 files changed +25
-5
lines changed Original file line number Diff line number Diff line change @@ -25,11 +25,12 @@ impl<'a> ParamsInScope<'a> {
2525
2626fn crawl ( in_scope : & ParamsInScope , ty : & Type , found : & mut bool ) {
2727 if let Type :: Path ( ty) = ty {
28- if ty. qself . is_none ( ) {
29- if let Some ( ident) = ty. path . get_ident ( ) {
30- if in_scope. names . contains ( ident) {
31- * found = true ;
32- }
28+ if let Some ( qself) = & ty. qself {
29+ crawl ( in_scope, & qself. ty , found) ;
30+ } else {
31+ let front = ty. path . segments . first ( ) . unwrap ( ) ;
32+ if front. arguments . is_none ( ) && in_scope. names . contains ( & front. ident ) {
33+ * found = true ;
3334 }
3435 }
3536 for segment in & ty. path . segments {
Original file line number Diff line number Diff line change 11#![ allow( clippy:: needless_late_init, clippy:: uninlined_format_args) ]
22
33use core:: fmt:: { self , Debug , Display } ;
4+ use core:: str:: FromStr ;
45use thiserror:: Error ;
56
67pub struct NoFormat ;
@@ -160,6 +161,24 @@ pub struct StructFromGeneric<E> {
160161#[ error( transparent) ]
161162pub struct StructTransparentGeneric < E > ( pub E ) ;
162163
164+ // Should expand to:
165+ //
166+ // impl<T: FromStr> Display for AssociatedTypeError<T>
167+ // where
168+ // T::Err: Display;
169+ //
170+ // impl<T: FromStr> Error for AssociatedTypeError<T>
171+ // where
172+ // Self: Debug + Display;
173+ //
174+ #[ derive( Error , Debug ) ]
175+ pub enum AssociatedTypeError < T : FromStr > {
176+ #[ error( "couldn't parse matrix" ) ]
177+ Other ,
178+ #[ error( "couldn't parse entry: {0}" ) ]
179+ EntryParseError ( T :: Err ) ,
180+ }
181+
163182// Regression test for https://github.com/dtolnay/thiserror/issues/345
164183#[ test]
165184fn test_no_bound_on_named_fmt ( ) {
You can’t perform that action at this time.
0 commit comments