Skip to content

hangs on string.repeat() ? #2235

@matthiaskrgr

Description

@matthiaskrgr

I tried this code:

#[kani::proof]  fn main() {
	
	let x = String::new().repeat(1);
	let z = x.chars().nth(1).unwrap();
}

using the following command line invocation:

RUSTC_WRAPPER="" cargo kani --harness  main --tests

with Kani version: 0.22.0

I expected to see this happen: explanation
It looks like there was some kind of hang..? kani/cmbc was crunching on that for more than 5 minutes until I cancelled it.
If I remove the repeat(1) , it finishes within a second 🤔

Metadata

Metadata

Labels

T-CBMCIssue related to an existing CBMC issueT-UserTag user issues / requests[C] BugThis is a bug. Something isn't working.[E] PerformanceTrack performance improvement (Time / Memory / CPU)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions