Skip to content

#[ignore] is cached somewhere so commenting/uncommenting it is ignored #49595

Closed
@stepancheg

Description

@stepancheg

Sees like #[ignore] is cached somewhere between compilation. I guess it's somehow related to incremental compilation.

How to reproduce a problem.

Clone a repository: https://github.com/stepancheg/ignore-cached

Inside that repository execute following commands:

# make sure nothing is cached
% cargo clean
% cargo test
...
test foo::foo ... ignored
...
# Test is properly ignored.
# Now comment out #[ignore] on test, so result is
% git diff
diff --git a/src/foo.rs b/src/foo.rs
index 65cd697..244cd2f 100644
--- a/src/foo.rs
+++ b/src/foo.rs
@@ -1,4 +1,4 @@
-#[ignore]
+//#[ignore]
 #[test]
 fn foo() {
     panic!();

# Execute test again
% cargo test
...
test foo::foo ... ignored
...
# Test is still shown as ignored, although #[ignore] is commented out.
# Clean and test again
% cargo clean
% cargo test
...
failures:
    foo::foo
...
# So executing clean fixes the issue.
% cargo --version
cargo 1.26.0-nightly (d63299b6e 2018-03-28)
% rustc --version
rustc 1.26.0-nightly (517f24025 2018-03-31)
% uname -a
Darwin nga-mbp 17.4.0 Darwin Kernel Version 17.4.0: Sun Dec 17 09:19:54 PST 2017; root:xnu-4570.41.2~1/RELEASE_X86_64 x86_64

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-incr-compArea: Incremental compilationA-libtestArea: `#[test]` / the `test` libraryC-bugCategory: This is a bug.WG-incr-compWorking group: Incremental compilationregression-from-stable-to-betaPerformance or correctness regression from stable to beta.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions