Skip to content

Commit 315fd90

Browse files
committed
Turn off syn/clone-impls feature
1 parent 94a3165 commit 315fd90

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ proc-macro = true
1818
[dependencies]
1919
proc-macro2 = "1.0.74"
2020
quote = "1.0.35"
21-
syn = { version = "2.0.46", default-features = false, features = ["full", "visit-mut", "parsing", "printing", "proc-macro", "clone-impls"] }
21+
syn = { version = "2.0.46", default-features = false, features = ["full", "visit-mut", "parsing", "printing", "proc-macro"] }
2222

2323
[dev-dependencies]
2424
futures = "0.3.30"

src/expand.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -169,8 +169,8 @@ fn transform_sig(
169169
sig.fn_token.span = sig.asyncness.take().unwrap().span;
170170

171171
let (ret_arrow, ret) = match &sig.output {
172-
ReturnType::Default => (Token![->](Span::call_site()), quote!(())),
173-
ReturnType::Type(arrow, ret) => (*arrow, quote!(#ret)),
172+
ReturnType::Default => (quote!(->), quote!(())),
173+
ReturnType::Type(arrow, ret) => (quote!(#arrow), quote!(#ret)),
174174
};
175175

176176
let mut lifetimes = CollectLifetimes::new();

src/lifetime.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ impl CollectLifetimes {
1919
}
2020
}
2121

22-
fn visit_opt_lifetime(&mut self, reference: Token![&], lifetime: &mut Option<Lifetime>) {
22+
fn visit_opt_lifetime(&mut self, reference: &Token![&], lifetime: &mut Option<Lifetime>) {
2323
match lifetime {
2424
None => *lifetime = Some(self.next_lifetime(reference.span)),
2525
Some(lifetime) => self.visit_lifetime(lifetime),
@@ -45,14 +45,14 @@ impl CollectLifetimes {
4545
impl VisitMut for CollectLifetimes {
4646
fn visit_receiver_mut(&mut self, arg: &mut Receiver) {
4747
if let Some((reference, lifetime)) = &mut arg.reference {
48-
self.visit_opt_lifetime(*reference, lifetime);
48+
self.visit_opt_lifetime(reference, lifetime);
4949
} else {
5050
visit_mut::visit_type_mut(self, &mut arg.ty);
5151
}
5252
}
5353

5454
fn visit_type_reference_mut(&mut self, ty: &mut TypeReference) {
55-
self.visit_opt_lifetime(ty.and_token, &mut ty.lifetime);
55+
self.visit_opt_lifetime(&ty.and_token, &mut ty.lifetime);
5656
visit_mut::visit_type_reference_mut(self, ty);
5757
}
5858

src/receiver.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ struct HasMutPat(Option<Token![mut]>);
4242

4343
impl VisitMut for HasMutPat {
4444
fn visit_pat_ident_mut(&mut self, i: &mut PatIdent) {
45-
if let Some(m) = i.mutability {
46-
self.0 = Some(m);
45+
if let Some(m) = &i.mutability {
46+
self.0 = Some(Token![mut](m.span));
4747
} else {
4848
visit_mut::visit_pat_ident_mut(self, i);
4949
}

0 commit comments

Comments
 (0)