-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Open
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesA-name-manglingArea: name mangling / decorationArea: name mangling / decorationA-panicArea: Panicking machineryArea: Panicking machineryC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language team
Description
I tried this code:
#[unsafe(no_mangle)]
#[track_caller]
pub fn foo() {}
fn main() {
let _a = foo as fn();
}
I expected to see this happen: I’m not sure, but not what actually happened
Instead, this happened:
error: symbol `foo` is already defined
--> src/main.rs:3:1
|
3 | pub fn foo() {}
| ^^^^^^^^^^^^
Meta
rustc --version
:
1.88.0
@rustbot label A-name-mangling A-linkage
Metadata
Metadata
Assignees
Labels
A-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesA-name-manglingArea: name mangling / decorationArea: name mangling / decorationA-panicArea: Panicking machineryArea: Panicking machineryC-bugCategory: This is a bug.Category: This is a bug.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.T-langRelevant to the language teamRelevant to the language team