-
Notifications
You must be signed in to change notification settings - Fork 13.3k
#[linkage] does not propagate through generic functions #18804
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
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. |
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 <ga29smith@gmail.com>
yodaldevoid
added a commit
to yodaldevoid/rust
that referenced
this issue
Jul 25, 2018
Fixes issue rust-lang#18804 Signed-off-by: Gabriel Smith <ga29smith@gmail.com>
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 <ga29smith@gmail.com>
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.
# for free
to join this conversation on GitHub.
Already have an account?
# 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: