Skip to content

RMC incorrectly reports an assertion failure on a two-dimensional vector #435

@zhassan-aws

Description

@zhassan-aws

I tried this code:

fn main() {
    let a: Vec<Vec<i32>> = vec![vec![0; 2]; 1];
    assert!(a.len() == 1);
}

using the following command line invocation:

rmc test.rs

with RMC version: main-154-2021-08-06

I expected the assertion to pass, but it didn't:

[main.assertion.1] line 3 assertion failed: a.len() == 1: FAILURE

If I compile the test and run it, the assertion is not hit:

$ rustc test.rs 
$ ./test 
$ 

Also, if I modify the first line in the function to

    let a: Vec<Vec<i32>> = vec![vec![0; 2]];

i.e. leave out the length for the outer vector, the assertion passes.

Metadata

Metadata

Assignees

No one assigned

    Labels

    [C] BugThis is a bug. Something isn't working.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions