-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
#[linkage = "weak"] const fn accepted without warning #134451
Copy link
Copy link
Open
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.F-linkage#![feature(linkage)]`#![feature(linkage)]`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.
Metadata
Metadata
Assignees
Labels
A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesC-discussionCategory: Discussion or questions that doesn't represent real issues.Category: Discussion or questions that doesn't represent real issues.F-linkage#![feature(linkage)]`#![feature(linkage)]`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.
Type
Fields
Give feedbackNo fields configured for issues without a type.
I'm trying to define a "weak" const in a library, which allows users to redefine their const. On stable Rust, there's no way to do it. On nightly,
linkagefeature seems the solution, but I found that it doesn't work as well. The following is the repro code:I uploaded a repo that could repro it: https://github.com/HaoboGu/linkage_weak_bug