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

Make extern "rust-intrinsic" coerce to unsafe Rust functions #12633

Closed
brson opened this issue Feb 28, 2014 · 4 comments
Closed

Make extern "rust-intrinsic" coerce to unsafe Rust functions #12633

brson opened this issue Feb 28, 2014 · 4 comments

Comments

@brson
Copy link
Contributor

brson commented Feb 28, 2014

In addition to #10725, this is one of the things blocking replacing things like cast::transmute with intrinsics. Although they are callable like other Rust functions they cannot be assigned to normal Rust functions.

@nikomatsakis Interested in what you think.

@brson
Copy link
Contributor Author

brson commented Mar 6, 2014

@pcwalton would rather make it impossible to take the value of intrinsics, which makes them more different from rust functions.

@steveklabnik
Copy link
Member

Triage: no change

@steveklabnik
Copy link
Member

steveklabnik commented Jun 6, 2016

I was trying to come up with some code to reproduce this, and here's what I had:

pub fn main() {
    unsafe {
        let copy: unsafe extern "rust-intrinsic" fn(*const i32, *mut i32, usize) = std::intrinsics::copy;
        let assign: unsafe fn(*const i32, *mut i32, usize) = std::mem::transmute(copy);
    }
}

This currently ICEs, and I filed #34123 with a smaller reproduction.

@brson brson removed the E-easy Call for participation: Easy difficulty. Experience needed to fix: Not much. Good first issue. label Jun 28, 2016
@brson
Copy link
Contributor Author

brson commented Jun 28, 2016

Closing in favor of #34123

@brson brson closed this as completed Jun 28, 2016
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