rust-lang / rust-lang/cargo

Compile_fail for regular tests

Open
#11,468 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

C-feature-request Command-test S-triage
Dominant language
Rust
Stars
15.5k
Forks
3k
Avg merge
23h 30m
Merged PRs (30d)
51

Description

Would be great to be able to annotate regular tests as failing to compile.

 Is it going to come for regular tests? Such that I can write `#[compile_fail]` above my test functions?

Originally posted by @faulesocke in https://github.com/rust-lang/rust/issues/12335#issuecomment-427586954

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by tracing how Cargo handles regular tests and compile-fail tests; done means regular test functions can be annotated with #[compile_fail] and the behavior is covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
testing
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.