-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
#[linkage] does not propagate through generic functions #18804
Labels
A-attributes
Area: Attributes (`#[…]`, `#![…]`)
A-codegen
Area: Code generation
C-bug
Category: This is a bug.
P-medium
Medium priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
Comments
Triage: this is still true today, though |
@Mark-Simulacrum claims it repros still. |
brson
added
the
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
label
Jun 1, 2017
Mark-Simulacrum
added
C-bug
Category: This is a bug.
and removed
C-enhancement
Category: An issue proposing an enhancement or a PR with one.
I-wrong
labels
Jul 22, 2017
Updated test code: // lib.rs
#![feature(linkage)]
pub fn foo<T>() -> *const() {
extern {
#[linkage = "extern_weak"]
static FOO: *const();
}
unsafe { FOO }
} // main.rs
extern crate lib;
fn main() {
lib::foo::<i32>();
} Still fails to compile with the same errors mentioned in the top post along with the irrelevant invalid foreign type warning mentioned by @steveklabnik. |
yodaldevoid
added a commit
to yodaldevoid/rust
that referenced
this issue
Jul 25, 2018
Signed-off-by: Gabriel Smith <[email protected]>
yodaldevoid
added a commit
to yodaldevoid/rust
that referenced
this issue
Jul 25, 2018
Fixes issue rust-lang#18804 Signed-off-by: Gabriel Smith <[email protected]>
yodaldevoid
added a commit
to yodaldevoid/rust
that referenced
this issue
Jul 25, 2018
…smjs The Emscripten compiler does not support weak symbols at the moment. Signed-off-by: Gabriel Smith <[email protected]>
Mark-Simulacrum
added a commit
to Mark-Simulacrum/rust
that referenced
this issue
Jul 26, 2018
Fix #[linkage] propagation though generic functions Fixes rust-lang#18804 In the non-local branch of `get_static` (where the fix was implemented) `span_fatal` had to be replaced with `bug!` as we have no span in that case.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-attributes
Area: Attributes (`#[…]`, `#![…]`)
A-codegen
Area: Code generation
C-bug
Category: This is a bug.
P-medium
Medium priority
T-compiler
Relevant to the compiler team, which will review and decide on the PR/issue.
For example:
This can be a little more clearly seen with the IR generated for main:
Note the lack of
extern_weak
anywhere onFOO
.The text was updated successfully, but these errors were encountered: