Skip to content

Specifying --profile and --release when running cargo rustc doesn't work anymore #7488

@koute

Description

@koute

Problem
This used to work:

cargo rustc --lib --profile test --release

Now it doesn't:

$ cargo rustc --lib --profile test --release
error: Conflicting usage of --profile and --release

How am I supposed to compile unit tests in release mode through cargo rustc now? I can use --tests, but that will also compile integration tests (which I don't want), and --test $crate_name doesn't work.

Steps

  1. cargo new --lib foobar
  2. cd foobar
  3. cargo rustc --lib --profile test --release

Notes

Version which worked: cargo 1.39.0-nightly (3596cb86b 2019-09-19) (and all of the previous versions)
Version which doesn't work: cargo 1.40.0-nightly (8b0561d68 2019-09-30)

This is a regression from stable to nightly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions