-
Notifications
You must be signed in to change notification settings - Fork 46
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
Build error on stable #53
Comments
Thanks for the report. I guess that some dependency of ours used syn in full mode and now doesn't use it any more. You can run |
That is due to TeXitoi/structopt#326. Probably they had expect that it was a breaking change as it was a part of minor version release. But // error: expected `string literal` or `expression` after `=`
// --> src/main.rs:18:22
// |
// 18 | #[structopt(settings = &[AppSettings::DeriveDisplayOrder, AppSettings::UnifiedHelpMessage])]
// | ^
//! ## Cargo.toml
//!
//! ```toml
//! [package]
//! name = "a"
//! version = "0.0.0"
//! edition = "2018"
//!
//! [dependencies]
//! structopt = "0.3.9"
//! syn = { version = "1.0.16", default-features = false, features = ["clone-impls"] }
//! ```
use structopt::clap::AppSettings;
use structopt::StructOpt;
#[derive(StructOpt)]
#[structopt(settings = &[AppSettings::DeriveDisplayOrder, AppSettings::UnifiedHelpMessage])] // same as `#[structopt(settings(..))]`
struct Opt {}
fn main() {
println!("Hello, world!");
} Moreover, I found // Compiling structopt-derive v0.4.2
// error[E0277]: the trait bound `syn::expr::Expr: std::clone::Clone` is not satisfied
// --> /home/ryo/.cargo/registry/src/github.com-1ecc6299db9ec823/structopt-derive-0.4.2/src/attrs.rs:28:10
// |
// 28 | Skip(Option<Expr>),
// | ^^^^^^^^^^^^
// | |
// | expected an implementor of trait `std::clone::Clone`
// | help: consider borrowing here: `&Option<Expr>`
// |
// = note: required because of the requirements on the impl of `std::clone::Clone` for `std::option::Option<syn::expr::Expr>`
// = note: required by `std::clone::Clone::clone`
//
// error[E0277]: the trait bound `syn::ty::Type: std::clone::Clone` is not satisfied
// --> /home/ryo/.cargo/registry/src/github.com-1ecc6299db9ec823/structopt-derive-0.4.2/src/attrs.rs:81:5
// |
// 81 | ty: Option<Type>,
// | ^^^^^^^^^^^^^^^^
// | |
// | expected an implementor of trait `std::clone::Clone`
// | help: consider borrowing here: `&ty: Option<Type>`
// |
// = note: required because of the requirements on the impl of `std::clone::Clone` for `std::option::Option<syn::ty::Type>`
// = note: required by `std::clone::Clone::clone`
//
// error[E0599]: no method named `clone` found for type `syn::ty::Type` in the current scope
// --> /home/ryo/.cargo/registry/src/github.com-1ecc6299db9ec823/structopt-derive-0.4.2/src/attrs.rs:425:27
// |
// 425 | Some(field.ty.clone()),
// | ^^^^^ method not found in `syn::ty::Type`
//
// error[E0277]: the trait bound `syn::token::Eq: std::clone::Clone` is not satisfied
// --> /home/ryo/.cargo/registry/src/github.com-1ecc6299db9ec823/structopt-derive-0.4.2/src/parse.rs:198:5
// |
// 198 | pub eq_token: Option<Token![=]>,
// | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// | |
// | expected an implementor of trait `std::clone::Clone`
// | help: consider borrowing here: `&pub eq_token: Option<Token![=]>`
// |
// = note: required because of the requirements on the impl of `std::clone::Clone` for `std::option::Option<syn::token::Eq>`
// = note: required by `std::clone::Clone::clone`
//
// error[E0277]: the trait bound `syn::expr::Expr: std::clone::Clone` is not satisfied
// --> /home/ryo/.cargo/registry/src/github.com-1ecc6299db9ec823/structopt-derive-0.4.2/src/parse.rs:199:5
// |
// 199 | pub parse_func: Option<Expr>,
// | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
// | |
// | expected an implementor of trait `std::clone::Clone`
// | help: consider borrowing here: `&pub parse_func: Option<Expr>`
// |
// = note: required because of the requirements on the impl of `std::clone::Clone` for `std::option::Option<syn::expr::Expr>`
// = note: required by `std::clone::Clone::clone`
//
// error: aborting due to 5 previous errors
//
// Some errors have detailed explanations: E0277, E0599.
// For more information about an error, try `rustc --explain E0277`.
// error: could not compile `structopt-derive`.
//! ## Cargo.toml
//!
//! ```toml
//! [package]
//! name = "a"
//! version = "0.0.0"
//! edition = "2018"
//!
//! [dependencies]
//! structopt = "0.3.9" # `syn/clone-impls` is necessary!
//! ```
fn main() {} |
Yeah, cargo update removes the For some reason, when I run cargo update on master, I can't reproduce the issue... Anyways, I think we should just add the full feature to syn in Cargo.toml and call it a day. |
Yeah I can reproduce when I 1. cargo update and 2. do |
I reproduce the issue with
|
Command:
fails with error:
This also reproduces on CI: https://github.com/jjs-dev/jjs/pull/262/checks?check_run_id=476888019#step:3:398
Command to build syn looks like:
Command to build cargo-udeps looks like:
Git master version builds fine.
I'm using
rustc 1.41.0 (5e1a79984 2020-01-27)
.The text was updated successfully, but these errors were encountered: