Merge pull request #1083 from serde-rs/ty-macro
Fix bounds for macro named the same as a type parameter
This commit is contained in:
commit
6437167930
@ -116,6 +116,14 @@ where
|
||||
}
|
||||
visit::walk_path(self, path);
|
||||
}
|
||||
|
||||
// Type parameter should not be considered used by a macro path.
|
||||
//
|
||||
// struct TypeMacro<T> {
|
||||
// mac: T!(),
|
||||
// marker: PhantomData<T>,
|
||||
// }
|
||||
fn visit_mac(&mut self, _mac: &syn::Mac) {}
|
||||
}
|
||||
|
||||
let all_ty_params: HashSet<_> = generics
|
||||
|
@ -525,6 +525,17 @@ fn test_gen() {
|
||||
other: isize,
|
||||
}
|
||||
assert::<SkippedStaticStr>();
|
||||
|
||||
macro_rules! T {
|
||||
() => { () }
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
struct TypeMacro<T> {
|
||||
mac: T!(),
|
||||
marker: PhantomData<T>,
|
||||
}
|
||||
assert::<TypeMacro<X>>();
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////
|
||||
|
Loading…
x
Reference in New Issue
Block a user