Skip to content

Strange E0505 error ... is this a bug? #63719

Closed
@DavePearce

Description

@DavePearce

Hey Folks,

So, I've been fuzz testing rustc nightly using a range of generated programs and am digesting the findings. This one stood out to me:

 fn main() { 
        let mut x = 1; 
        { 
            let mut y = &mut x; 
            y = y; 
            y; 
        } 
        x; 
    }

This currently reports an E0505 on the playground and Rust nightly. However, removing the nop y=y; and its fine. This feels like a bug to me ... thoughts?

Metadata

Metadata

Assignees

Labels

T-langRelevant to the language 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