Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
stepancheg opened this issue Apr 2, 2018 · 2 comments
Closed
Labels
A-incr-comp Area: Incremental compilation A-libtest Area: `#[test]` / the `test` library C-bug Category: This is a bug. regression-from-stable-to-beta Performance or correctness regression from stable to beta. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. WG-incr-comp Working group: Incremental compilation

Comments

@stepancheg
Copy link
Contributor

stepancheg commented Apr 2, 2018

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
@kennytm kennytm added A-incr-comp Area: Incremental compilation A-libtest Area: `#[test]` / the `test` library C-bug Category: This is a bug. WG-incr-comp Working group: Incremental compilation labels Apr 2, 2018
@ehuss
Copy link
Contributor

ehuss commented Apr 3, 2018

This probably isn't helpful, but I ran a bisect and it seems like this first shows up with 051050d (#49424). However, I don't see how it would cause this to happen.

@michaelwoerister
Copy link
Member

The #[ignore] attribute indeed seems to be translated into a boolean expression in the code:

let ignore_expr = ecx.expr_bool(span, test.ignore);

So it could interact with incremental constant evaluation.

cc @oli-obk

@oli-obk oli-obk added regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. regression-from-stable-to-beta Performance or correctness regression from stable to beta. labels Apr 7, 2018
bors added a commit that referenced this issue Apr 8, 2018
[incremental] Hash `Allocation`s

`HashSet::insert` returns `true` if the value did not exist, which is the timing we want to hash the `Allocation`.

Fixes #49595

cc @oli-obk
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-incr-comp Area: Incremental compilation A-libtest Area: `#[test]` / the `test` library C-bug Category: This is a bug. regression-from-stable-to-beta Performance or correctness regression from stable to beta. regression-from-stable-to-nightly Performance or correctness regression from stable to nightly. WG-incr-comp Working group: Incremental compilation
Projects
None yet
Development

No branches or pull requests

5 participants