Skip to content

RA fails to capture errors #6074

@prassee

Description

@prassee

The latest (stable and nightly) builds of Rust analyzer fails to capture errors. Iam expecting value moved error in the below code but RA does report any. Note I'm no way a Rust expert just picking up the language reporting this issue based on my understanding.

Editor - VSCode (latest) Hope this does not matter much
Rustc - 1.46.0

The below code is where I found the issue.
(Note :- RLS )

pub(crate) fn main() {   
    let score = Score::new(90);
    calcScore(score);
    dispScore(score); **// Expected moved value error in this line.**
}
#[derive(Debug)]
struct Score {
    runs: i32,
}

impl Score {
    fn new(runs: i32) -> Self { Self { runs } }
}


fn calcScore(score : Score) {
    println!("{:?}",score)
}

fn dispScore(score: Score) {
    println!("{:?}",score)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    S-unactionableIssue requires feedback, design decisions or is blocked on other work

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions