Skip to content
New issue

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

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

Already on GitHub? # to your account

commenting out feature flag does not affect recompilation #47003

Closed
tspiteri opened this issue Dec 25, 2017 · 1 comment
Closed

commenting out feature flag does not affect recompilation #47003

tspiteri opened this issue Dec 25, 2017 · 1 comment
Assignees
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. P-high High priority

Comments

@tspiteri
Copy link
Contributor

First I compile this code with cargo +nightly build:

#![feature(nll)]
pub fn foo() {
    let mut v = vec![1];
    v.push(v[0]);
}

Then I comment out the feature flag:

//#![feature(nll)]
pub fn foo() {
    let mut v = vec![1];
    v.push(v[0]);
}

Then I recompile and it does not fail, even though the code currently requires the feature flag to compile. I guess incremental recompilation is not detecting the change.

If I cargo clean before recompiling, or if I completely delete the line (thus changing line numbers for the following lines), the recompilation fails as it should.

@sfackler sfackler added the A-incr-comp Area: Incremental compilation label Dec 26, 2017
@estebank estebank added the C-bug Category: This is a bug. label Dec 26, 2017
@michaelwoerister
Copy link
Member

Interesting. Thanks for the bug report, @tspiteri!

@michaelwoerister michaelwoerister added the P-high High priority label Feb 13, 2018
@michaelwoerister michaelwoerister self-assigned this Feb 14, 2018
Manishearth added a commit to Manishearth/rust that referenced this issue Feb 19, 2018
…petrochenkov

Turn feature-gate table into a query so it is covered by dependency tracking.

Turn access to feature gates into a query so we handle them correctly during incremental compilation.

Features are still available via `Session` through `features_untracked()`. I wish we had a better way of hiding untracked information. It would be great if we could remove the `sess` field from `TyCtxt`.

Fixes rust-lang#47003.
Manishearth added a commit to Manishearth/rust that referenced this issue Feb 24, 2018
…petrochenkov

Turn feature-gate table into a query so it is covered by dependency tracking.

Turn access to feature gates into a query so we handle them correctly during incremental compilation.

Features are still available via `Session` through `features_untracked()`. I wish we had a better way of hiding untracked information. It would be great if we could remove the `sess` field from `TyCtxt`.

Fixes rust-lang#47003.
bors added a commit that referenced this issue Mar 5, 2018
Turn feature-gate table into a query so it is covered by dependency tracking.

Turn access to feature gates into a query so we handle them correctly during incremental compilation.

Features are still available via `Session` through `features_untracked()`. I wish we had a better way of hiding untracked information. It would be great if we could remove the `sess` field from `TyCtxt`.

Fixes #47003.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-incr-comp Area: Incremental compilation C-bug Category: This is a bug. P-high High priority
Projects
None yet
Development

No branches or pull requests

4 participants