Skip to content

Assertion reports wrong line number #3062

Closed
@bstrie

Description

@bstrie

Test case:

fn dummy() {
    // padding
    // padding
    // padding
    // padding
    // padding
    // padding
    // padding
    // padding
    // padding
    // padding
    // padding
    // padding
    // padding
    // padding
}

fn main() {
                          // oopsie
    for [1,2,3,4,5].slice(3,1).each |x| { log(error, x); }  // Line 20, not line 1!
    assert true == false;  // This reports line 21 if you comment out the above line
}

Output (with incorrect line number):

rust: task failed at 'Assertion start <= end failed', fail.rs:1

Expected output:

rust: task failed at 'Assertion start <= end failed', fail.rs:20

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-frontendArea: Compiler frontend (errors, parsing and HIR)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions