Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using ouroboros with rust 1.62 produces clippy warnings #62

Closed
alex opened this issue Jun 30, 2022 · 0 comments
Closed

Using ouroboros with rust 1.62 produces clippy warnings #62

alex opened this issue Jun 30, 2022 · 0 comments

Comments

@alex
Copy link
Contributor

alex commented Jun 30, 2022

Minimal example:

use std::marker::PhantomData;
use std::sync::Arc;
#[ouroboros::self_referencing]
struct S {
    data: Arc<[u8]>,

    #[borrows(data)]
    #[covariant]
    value: F<'this>,
}

struct F<'a> {
    _phantom: PhantomData<&'a ()>,
}

fn main() {
    println!("Hello, world!");
}

And the clippy warnings:

warning: call to `std::mem::drop` with a value that does not implement `Drop`. Dropping such a type only extends its contained lifetimes
 --> src/main.rs:3:1
  |
3 | #[ouroboros::self_referencing]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: `#[warn(clippy::drop_non_drop)]` on by default
note: argument has type `F`
 --> src/main.rs:3:1
  |
3 | #[ouroboros::self_referencing]
  | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#drop_non_drop
  = note: this warning originates in the attribute macro `ouroboros::self_referencing` (in Nightly builds, run with -Z macro-backtrace for more info)
someguynamedjosh added a commit that referenced this issue Jul 31, 2022
fixes #62 -- resolve clippy warning from rust 1.62
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant