Skip to content

Commit

Permalink
Merge pull request #171 from dtolnay/hasbound
Browse files Browse the repository at this point in the history
Drop syn/extra-traits dependency from PR 170
  • Loading branch information
dtolnay committed Jul 29, 2021
2 parents 4635d0f + fae1e32 commit e2cd044
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Expand Up @@ -16,7 +16,7 @@ proc-macro = true
[dependencies]
proc-macro2 = "1.0"
quote = "1.0"
syn = { version = "1.0.61", features = ["full", "visit-mut", "extra-traits"] }
syn = { version = "1.0.61", features = ["full", "visit-mut"] }

[dev-dependencies]
futures = "0.3"
Expand Down
7 changes: 6 additions & 1 deletion src/expand.rs
Expand Up @@ -396,7 +396,12 @@ fn positional_arg(i: usize, pat: &Pat) -> Ident {
fn has_bound(supertraits: &Supertraits, marker: &Ident) -> bool {
for bound in supertraits {
if let TypeParamBound::Trait(bound) = bound {
if bound.path.is_ident(marker) || bound.path == parse_quote!(::core::marker::#marker) {
if bound.path.is_ident(marker)
|| bound.path.segments.len() == 3
&& bound.path.segments[0].ident == "core"
&& bound.path.segments[1].ident == "marker"
&& bound.path.segments[2].ident == *marker
{
return true;
}
}
Expand Down

0 comments on commit e2cd044

Please sign in to comment.