taiki-e / pin-project-lite

A lightweight version of pin-project written with declarative macros.
https://docs.rs/pin-project-lite
Apache License 2.0
216 stars 15 forks source link

Rust 2018 idioms break `duplexify` crate #34

Closed geigerzaehler closed 3 years ago

geigerzaehler commented 3 years ago

With the release of v0.1.9 the generated code uses Rust 2018 idioms. However, duplexify sets #[forbid(rust_2018_idioms)]. This results in duplexify failing to build with

error[E0453]: allow(explicit_outlives_requirements) overruled by outer forbid(rust_2018_idioms)
  --> /home/.cargo/registry/src/github.com-1ecc6299db9ec823/duplexify-1.2.1/src/lib.rs:42:1
   |
34 |   #![forbid(unsafe_code, rust_2018_idioms)]
   |                          ---------------- `forbid` level set here
...
42 | / pin_project_lite::pin_project! {
43 | |     /// Combine a reader + writer into a duplex of `Read` + `Write`.
44 | |     #[derive(Debug)]
45 | |     pub struct Duplex<R, W> {
...  |
50 | |     }
51 | | }
   | |_^ overruled by previous forbid
   |
   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)

error: aborting due to previous error

For more information about this error, try `rustc --explain E0453`.
error: could not compile `duplexify`.

See https://github.com/async-rs/duplexify/issues/5

I’m not sure where to best address this—here or in duplexify. Since there’s a chance that this breaks other packages, too, it might preferable to fix this here.

taiki-e commented 3 years ago

As said in #33, I believe this is a problem on the part of the user using forbid.

taiki-e commented 3 years ago

This will be fixed in https://github.com/async-rs/duplexify/pull/6.