Skip to content

A bug from drop #166

@lengyijun

Description

@lengyijun
struct S;
impl S{
    fn foo(&mut self){}
}

struct T<'a>(&'a S);

impl<'a> Drop for T<'a>{
    fn drop(&mut self){}
}

fn main() {
    let mut s=S;
    let t=T(&s);
    s.foo();
}

Inspired by rust-lang/rust#70797
The Drop of T makes polonius failed.
It's related to eager drop: rust-lang/lang-team#86
Is it a bug?

Metadata

Metadata

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions