Skip to content

commenting out feature flag does not affect recompilation #47003

Closed
@tspiteri

Description

@tspiteri

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.

Metadata

Metadata

Labels

A-incr-compArea: Incremental compilationC-bugCategory: This is a bug.P-highHigh priority

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions