Skip to content

#[no_mangle] is silently ignored on generic fns #15844

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

Closed
rpjohnst opened this issue Jul 21, 2014 · 3 comments
Closed

#[no_mangle] is silently ignored on generic fns #15844

rpjohnst opened this issue Jul 21, 2014 · 3 comments
Labels
A-diagnostics Area: Messages for errors, warnings, and lints

Comments

@rpjohnst
Copy link
Contributor

With a definition like this:

#[no_mangle]
fn foo<T>() { /* ... */ }

the compiler does not and cannot un-mangle foo, but it does not give any indication of this. It should probably give an unused_attribute warning.

@huonw
Copy link
Member

huonw commented Jul 21, 2014

I think an explicit "generic functions must be mangled" warning/error would be better than just the unused attribute one (this should cover #[symbol_name = "..."] too).

@sfackler
Copy link
Member

Ah, this is one of the attributes that are globally whitelisted because the unused attribute lint runs before trans :(

@sfackler sfackler removed their assignment Jul 21, 2014
@steveklabnik
Copy link
Member

Triage: no change. Still doesn't warn.

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

4 participants