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

Compiler crash related to static variables, pointers and const functions #29251

Closed
Nakrez opened this issue Oct 23, 2015 · 2 comments
Closed

Comments

@Nakrez
Copy link

Nakrez commented Oct 23, 2015

I managed to make the rustc compiler crash using this code: http://is.gd/ZecY5i
It is not directly related to const functions, but they allow this code to be valid.

It was on a nightly build : rustc 1.5.0-nightly (20a6938 2015-10-16)

@jonas-schievink
Copy link
Contributor

Minified version (http://is.gd/cSuM1u):

#![feature(const_fn)]

const fn f(t: *const u8) {}

extern {
    static A: *const u8;
}

static B: () = f(*&A);

fn main() {}
Segmentation fault (core dumped)
playpen: application terminated with error code 139

@arielb1
Copy link
Contributor

arielb1 commented Oct 23, 2015

duplicate of #28324.

@arielb1 arielb1 closed this as completed Oct 23, 2015
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