Skip to content

Using both no_mangle and export_name attributes should cause a warning #47446

Closed
@gamozolabs

Description

In a simple example like:

#[no_mangle]
#[export_name = "asdf"]
pub extern fn foobar() {}

The actual exported name will be asdf. It seems export_name wins over no_mangle however there is no warning letting you know this occurred. It seems there is no valid use for having both of these so it's probably worth warning about.

-B

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Labels

A-attributesArea: Attributes (`#[…]`, `#![…]`)A-linkageArea: linking into static, shared libraries and binariesA-lintsArea: Lints (warnings about flaws in source code) such as unused_mut.C-enhancementCategory: An issue proposing an enhancement or a PR with one.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions