dtolnay / quote

Rust quasi-quoting
Apache License 2.0
1.32k stars 90 forks source link

Release 1.0.24 breaks diesel #245

Closed msrd0 closed 1 year ago

msrd0 commented 1 year ago

First of all, thank you for maintaining this crate! Unfortunately, since release 1.0.24 diesel fails to compile:

   Compiling diesel_derives v2.0.1
error[E0277]: the trait bound `FieldAttr: ToTokens` is not satisfied
   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/diesel_derives-2.0.1/src/attrs.rs:143:6
    |
143 | impl Spanned for FieldAttr {
    |      ^^^^^^^ the trait `ToTokens` is not implemented for `FieldAttr`
    |
    = help: the following other types implement trait `ToTokens`:
              &'a T
              &'a mut T
              Abi
              Abstract
              AndAnd
              AndEq
              AngleBracketedGenericArguments
              Arm
            and 313 others
    = note: required because of the requirements on the impl of `quote::spanned::private::Sealed` for `FieldAttr`
note: required by a bound in `quote::spanned::Spanned`
   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/quote-1.0.25/src/spanned.rs:6:20
    |
6   | pub trait Spanned: private::Sealed {
    |                    ^^^^^^^^^^^^^^^ required by this bound in `quote::spanned::Spanned`

error[E0277]: the trait bound `StructAttr: ToTokens` is not satisfied
   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/diesel_derives-2.0.1/src/attrs.rs:242:6
    |
242 | impl Spanned for StructAttr {
    |      ^^^^^^^ the trait `ToTokens` is not implemented for `StructAttr`
    |
    = help: the following other types implement trait `ToTokens`:
              &'a T
              &'a mut T
              Abi
              Abstract
              AndAnd
              AndEq
              AngleBracketedGenericArguments
              Arm
            and 313 others
    = note: required because of the requirements on the impl of `quote::spanned::private::Sealed` for `StructAttr`
note: required by a bound in `quote::spanned::Spanned`
   --> /home/runner/.cargo/registry/src/github.com-1ecc6299db9ec823/quote-1.0.25/src/spanned.rs:6:20
    |
6   | pub trait Spanned: private::Sealed {
    |                    ^^^^^^^^^^^^^^^ required by this bound in `quote::spanned::Spanned`

For more information about this error, try `rustc --explain E0277`.
error: could not compile `diesel_derives` due to 2 previous errors

I believe making a trait that was publicly implementable requiring a private seal is a breaking change and should not happen in a patch release.

weiznich commented 1 year ago

Duplicate of https://github.com/dtolnay/quote/issues/241

msrd0 commented 1 year ago

Sorry didn't see the other issue