@@ -125,7 +125,6 @@ pub fn expand(input: &mut Item, is_local: bool) {
125
125
fn lint_suppress_with_body ( ) -> Attribute {
126
126
parse_quote ! {
127
127
#[ allow(
128
- unused_qualifications,
129
128
clippy:: async_yields_async,
130
129
clippy:: diverging_sub_expression,
131
130
clippy:: let_unit_value,
@@ -141,7 +140,6 @@ fn lint_suppress_with_body() -> Attribute {
141
140
fn lint_suppress_without_body ( ) -> Attribute {
142
141
parse_quote ! {
143
142
#[ allow(
144
- unused_qualifications,
145
143
clippy:: type_complexity,
146
144
clippy:: type_repetition_in_bounds
147
145
) ]
@@ -168,11 +166,10 @@ fn transform_sig(
168
166
has_default : bool ,
169
167
is_local : bool ,
170
168
) {
171
- let default_span = sig. asyncness . take ( ) . unwrap ( ) . span ;
172
- sig. fn_token . span = default_span;
169
+ sig. fn_token . span = sig. asyncness . take ( ) . unwrap ( ) . span ;
173
170
174
171
let ( ret_arrow, ret) = match & sig. output {
175
- ReturnType :: Default => ( Token ! [ ->] ( default_span ) , quote_spanned ! ( default_span=> ( ) ) ) ,
172
+ ReturnType :: Default => ( Token ! [ ->] ( Span :: call_site ( ) ) , quote ! ( ( ) ) ) ,
176
173
ReturnType :: Type ( arrow, ret) => ( * arrow, quote ! ( #ret) ) ,
177
174
} ;
178
175
@@ -234,9 +231,7 @@ fn transform_sig(
234
231
. push ( parse_quote_spanned ! ( elided. span( ) => #elided: ' async_trait) ) ;
235
232
}
236
233
237
- sig. generics
238
- . params
239
- . push ( parse_quote_spanned ! ( default_span=> ' async_trait) ) ;
234
+ sig. generics . params . push ( parse_quote ! ( ' async_trait) ) ;
240
235
241
236
if has_self {
242
237
let bounds: & [ InferredBound ] = if is_local {
@@ -272,21 +267,17 @@ fn transform_sig(
272
267
& [ InferredBound :: Send ]
273
268
} ;
274
269
275
- let bounds = bounds. iter ( ) . filter_map ( |bound| {
270
+ let bounds = bounds. iter ( ) . filter ( |bound| {
276
271
let assume_bound = match context {
277
272
Context :: Trait { supertraits, .. } => !has_default || has_bound ( supertraits, bound) ,
278
273
Context :: Impl { .. } => true ,
279
274
} ;
280
- if assume_bound {
281
- None
282
- } else {
283
- Some ( bound. spanned_path ( default_span) )
284
- }
275
+ !assume_bound
285
276
} ) ;
286
277
287
278
where_clause_or_default ( & mut sig. generics . where_clause )
288
279
. predicates
289
- . push ( parse_quote_spanned ! { default_span=>
280
+ . push ( parse_quote ! {
290
281
Self : #( #bounds +) * ' async_trait
291
282
} ) ;
292
283
}
@@ -318,11 +309,11 @@ fn transform_sig(
318
309
}
319
310
320
311
let bounds = if is_local {
321
- quote_spanned ! ( default_span=> ' async_trait)
312
+ quote ! ( ' async_trait)
322
313
} else {
323
- quote_spanned ! ( default_span=> :: core:: marker:: Send + ' async_trait)
314
+ quote ! ( :: core:: marker:: Send + ' async_trait)
324
315
} ;
325
- sig. output = parse_quote_spanned ! { default_span=>
316
+ sig. output = parse_quote ! {
326
317
#ret_arrow :: core:: pin:: Pin <Box <
327
318
dyn :: core:: future:: Future <Output = #ret> + #bounds
328
319
>>
@@ -420,7 +411,7 @@ fn transform_block(context: Context, sig: &mut Signature, block: &mut Block) {
420
411
quote ! ( #( #decls) * { #( #stmts) * } )
421
412
}
422
413
} else {
423
- quote_spanned ! { block . brace_token . span=>
414
+ quote ! {
424
415
if let :: core:: option:: Option :: Some ( __ret) = :: core:: option:: Option :: None :: <#ret> {
425
416
return __ret;
426
417
}
0 commit comments