Skip to content

clippy subcommand does not work properly when root directory is an executable #1330

Closed
@debris

Description

@debris

steps to reproduce

  1. Create new project and enter it

    cargo new foo --bin
    cd exe
    
  2. Create subproject and edit Cargo.toml

    cargo new bar
    
    [dependencies]
    bar = { path  = "bar" }
  3. Run cargo clippy for subproject

    cargo clippy -p bar --verbose
    

cargo clippy exits with misleading error message

error: no bin target named `foo`

Other observations:
Above issue does not occur if root directory is a library. It looks like the issue is caused by incorrectly prepending --bin flag instead of --lib here

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions