dtolnay / async-trait

Type erasure for async trait methods

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Weird interaction with `single_use_lifetimes`

adrianheine opened this issue · comments

playground

warning: lifetime parameter `'impl0` only used once
 --> src/lib.rs:7:19
  |
7 | impl<T> Trait for &T {}
  |                   ^
  |                   |
  |                   this lifetime...
  |                   ...is used only here
  |
note: the lint level is defined here
 --> src/lib.rs:1:9
  |
1 | #![warn(single_use_lifetimes)]
  |         ^^^^^^^^^^^^^^^^^^^^
help: elide the single-use lifetime
  |
7 - impl<T> Trait for &T {}
7 + impl<T {}
  |

The suggestion is particularly helpful 😆

Fixed in async-trait 0.1.65.