Skip to content

Type mismatch with deref and reseating references #9968

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

Closed
lnicola opened this issue Aug 21, 2021 · 0 comments · Fixed by #9973
Closed

Type mismatch with deref and reseating references #9968

lnicola opened this issue Aug 21, 2021 · 0 comments · Fixed by #9973
Labels
A-ty type system / type inference / traits / method resolution S-actionable Someone could pick this issue up and work on it right now

Comments

@lnicola
Copy link
Member

lnicola commented Aug 21, 2021

CC #8961

fn g(_text: &str) {}
fn f(text: &str) {
    let mut text = text;
    let tmp = String::new();
    text = &tmp; // Expected &str, got &String
    g(text);
}
@lnicola lnicola added A-ty type system / type inference / traits / method resolution S-actionable Someone could pick this issue up and work on it right now labels Aug 21, 2021
@lnicola lnicola changed the title Type mismatch with deref Type mismatch with deref and reseating references Aug 21, 2021
@bors bors bot closed this as completed in 337ccc7 Aug 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-ty type system / type inference / traits / method resolution S-actionable Someone could pick this issue up and work on it right now
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant