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

Can't compare unsafe function pointers #13385

Closed
jdm opened this issue Apr 7, 2014 · 2 comments
Closed

Can't compare unsafe function pointers #13385

jdm opened this issue Apr 7, 2014 · 2 comments

Comments

@jdm
Copy link
Contributor

jdm commented Apr 7, 2014

type JSPropertyOp = extern "C" fn();
type JSPropertyOp2 = extern "C" unsafe fn();

extern fn foo() {
}

fn main() {
    let bar: JSPropertyOp = foo;
    if bar == foo {
    }

    let bar: JSPropertyOp2 = foo;
    if bar == foo {
    }
}

yields

[jdm@rosencrantz rust-mozjs]$ rustc /tmp/unsafe.rs 
/tmp/unsafe.rs:13:8: 13:18 error: binary operation `==` cannot be applied to type `extern "C" unsafe fn()`
/tmp/unsafe.rs:13     if bar == foo {
                         ^~~~~~~~~~
error: aborting due to previous error
huonw added a commit to huonw/rust that referenced this issue Jun 8, 2014
Previously `extern` functions up to arity 5 had `PartialEq`
implementations in libcore, but this doesn't handle comparing against
`unsafe` functions, or larger arity functions.

Fixes rust-lang#13385.
@huonw
Copy link
Member

huonw commented Jun 30, 2014

I wrote some code over in #14719, but @alexcrichton points out some edge cases that it would be good to properly spec. This can/should probably go through an RFC.

@steveklabnik
Copy link
Member

I'm pulling a massive triage effort to get us ready for 1.0. As part of this, I'm moving stuff that's wishlist-like to the RFCs repo, as that's where major new things should get discussed/prioritized.

This issue has been moved to the RFCs repo: rust-lang/rfcs#718

bors added a commit to rust-lang-ci/rust that referenced this issue Oct 18, 2022
Don't report build-scripts and proc-macros as metadata progress

Seems somewhat confusing to me, given `metadata` is already the step we do for workspace loading
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

Successfully merging a pull request may close this issue.

3 participants