Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A bug from drop #166

Open
lengyijun opened this issue Jul 14, 2021 · 0 comments
Open

A bug from drop #166

lengyijun opened this issue Jul 14, 2021 · 0 comments
Assignees

Comments

@lengyijun
Copy link
Contributor

lengyijun commented Jul 14, 2021

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?

@ecstatic-morse ecstatic-morse self-assigned this Aug 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants