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

Segfault on Option<T> inside struct if T is non-pointer type and it's name equals to a struct name #9210

Closed
bohdan-shulha opened this issue Sep 15, 2013 · 1 comment

Comments

@bohdan-shulha
Copy link

Following code will result into segfault if you would try to run it;

struct Test {
    parent: Option<Test>
}

fn main() {
    let v = Test{ parent: None };
}
$ rust -v
rust 0.8-pre (4ecb0a3 2013-09-15 01:50:50 -0700)
@sfackler
Copy link
Member

Dup of #3779

flip1995 pushed a commit to flip1995/rust that referenced this issue Jul 28, 2022
Fix suggestion causing error for [`needless_borrow`] function in field

Fixes rust-lang#9160

changelog: [`needless_borrow`]: Fix suggestion removing parens from calling a field
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

3 participants