Skip to content

Incremental compilation doesn't update static strings. #49301

@pinkisemils

Description

@pinkisemils

When changing a static string in a way that doesn't change it's length, cargo build won't rebuild the changed string.
For instance, if the binary has already been built, changing hello to xxxxx will result in a binary that still outputs hello.

static HELLO: &str = "hello";

fn main() {
    println!("{}", HELLO);
}

If built with CARGO_INCREMENTAL=0, everything works as expected. If the length of the string is changed, everything also works as expected.
Tested on rustc 1.26.0-nightly (75af15ee6 2018-03-20).

Metadata

Metadata

Assignees

Labels

A-incr-compArea: Incremental compilationC-bugCategory: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions