Skip to content

cargo test panics when given specific <spec> with -p #9041

@barafael

Description

@barafael

Problem

cargo test panics when the -p spec is malformed.

Steps

  1. clone https://github.com/barafael/smbus-slave-state-machine
  2. run cargo test -p /home/ra/smbus-slave-state-machine-rs#smbus-slave-state-machine:0.1.0
  3. run cargo test -p file:///home/ra/smbus-slave-state-machine-rs#smbus-slave-state-machine:0.1.0

Possible Solution(s)

This is the line that panics:
https://docs.rs/vkcargo/0.45.1/src/cargo/core/package_id_spec.rs.html#234

Notes
I am not sure this is a problem, but decided to report anyway because I think unwrap on a None value shouldn't happen.

Output of cargo version:
cargo 1.50.0-nightly (75d5d8c 2020-12-22)
cargo 1.48.0 (65cbdd2 2020-10-14)
nightly-x86_64-unknown-linux-gnu

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-cliArea: Command-line interface, option parsing, etc.C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions