Skip to content

Commit fae1e32

Browse files
committed
Drop syn/extra-traits dependency from PR 170
1 parent 4635d0f commit fae1e32

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ proc-macro = true
1616
[dependencies]
1717
proc-macro2 = "1.0"
1818
quote = "1.0"
19-
syn = { version = "1.0.61", features = ["full", "visit-mut", "extra-traits"] }
19+
syn = { version = "1.0.61", features = ["full", "visit-mut"] }
2020

2121
[dev-dependencies]
2222
futures = "0.3"

src/expand.rs

+6-1
Original file line numberDiff line numberDiff line change
@@ -396,7 +396,12 @@ fn positional_arg(i: usize, pat: &Pat) -> Ident {
396396
fn has_bound(supertraits: &Supertraits, marker: &Ident) -> bool {
397397
for bound in supertraits {
398398
if let TypeParamBound::Trait(bound) = bound {
399-
if bound.path.is_ident(marker) || bound.path == parse_quote!(::core::marker::#marker) {
399+
if bound.path.is_ident(marker)
400+
|| bound.path.segments.len() == 3
401+
&& bound.path.segments[0].ident == "core"
402+
&& bound.path.segments[1].ident == "marker"
403+
&& bound.path.segments[2].ident == *marker
404+
{
400405
return true;
401406
}
402407
}

0 commit comments

Comments
 (0)