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

improper_ctypes lint triggers for functions returning () #27302

Closed
crumblingstatue opened this issue Jul 26, 2015 · 2 comments
Closed

improper_ctypes lint triggers for functions returning () #27302

crumblingstatue opened this issue Jul 26, 2015 · 2 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@crumblingstatue
Copy link
Contributor

6fa17b4 made the improper_ctypes lint trigger for tuples, but as far as I understand, returning () is equivalent to returning c_void, and therefore should be allowed.

Here is an example:

extern "C" {
    pub fn foo() -> ();
}

fn main() {
}
foo.rs:2:21: 2:23 warning: found Rust tuple type in foreign module; consider using a struct instead`, #[warn(improper_ctypes)] on by default
foo.rs:2     pub fn foo() -> ();
                             ^~
@eefriedman
Copy link
Contributor

Yes, stupid mistake; I'll fix it. (As a workaround, you can write pub fn foo();.)

eefriedman added a commit to eefriedman/rust that referenced this issue Jul 27, 2015
bors added a commit that referenced this issue Jul 27, 2015
@steveklabnik steveklabnik added the A-diagnostics Area: Messages for errors, warnings, and lints label Jul 29, 2015
@steveklabnik
Copy link
Member

since #27315 was merged i'm closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-diagnostics Area: Messages for errors, warnings, and lints
Projects
None yet
Development

No branches or pull requests

3 participants