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

Clap does not compile #2917

Closed
2 tasks done
ghost opened this issue Oct 20, 2021 · 4 comments
Closed
2 tasks done

Clap does not compile #2917

ghost opened this issue Oct 20, 2021 · 4 comments
Labels
C-bug Category: Updating dependencies

Comments

@ghost
Copy link

ghost commented Oct 20, 2021

Please complete the following tasks

  • I have searched the discussions
  • I have searched the existing issues

Rust Version

1.55

Clap Version

3.0-beta.5

Minimal reproducible code

use clap::*;

/// NEAR Indexer Example
/// Watches for stream of blocks from the chain
#[derive(Debug,Clap)]
#[clap(version = "0.1", author = "Near Inc. <hello@nearprotocol.com>")]
pub(crate) struct Opts {
    /// Sets a custom config dir. Defaults to ~/.near/
    #[clap(short, long)]
    pub home_dir: Option<std::path::PathBuf>,
}

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

Steps to reproduce the bug with the above code

cargo run --release

Actual Behaviour

error: cannot find derive macro `Clap` in this scope
 --> src/main.rs:5:16
  |
5 | #[derive(Debug,Clap)]
  |                ^^^^

error: cannot find attribute `clap` in this scope
 --> src/main.rs:6:3
  |
6 | #[clap(version = "0.1", author = "Near Inc. <hello@nearprotocol.com>")]
  |   ^^^^

error: cannot find attribute `clap` in this scope
 --> src/main.rs:9:7
  |
9 |     #[clap(short, long)]
  |       ^^^^

warning: unused import: `clap::*`
 --> src/main.rs:1:5
  |
1 | use clap::*;
  |     ^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

error: aborting due to 3 previous errors; 1 warning emitted

Expected Behaviour

Hello world

Additional Context

The answer here doesn't make sense #2910

3.0.0-beta.2 does not compile now
3.0.0-beta.4 does not compile now
3.0.0-beta.5 does not compile now

3.0.0-beta.2 compiled last month

Debug Output

No response

@ghost ghost added the C-bug Category: Updating dependencies label Oct 20, 2021
@pksunkara
Copy link
Member

You would need to upgrade to beta.5 and change the code accordingly since we have breaking changes.

@ghost
Copy link
Author

ghost commented Oct 20, 2021

Upgrade to what? I just showed you that the latest version does not compile

@ghost
Copy link
Author

ghost commented Oct 20, 2021

Nevermind change the code accordingly means I have to go and find what that means.

It'd be great if you can point to the place where I can see exactly what is breaking instead of looking through source code.

@pksunkara
Copy link
Member

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Updating dependencies
Projects
None yet
Development

No branches or pull requests

1 participant