8

Associated functions that contain extern indicator or have `#[rustc_std_internal...

 3 years ago
source link: https://github.com/rust-lang/rust/pull/86492
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Copy link

Contributor

hyd-dev commented on Jun 20

edited

Previously these fails to link with undefined reference to `foo':

Example 1Example 2

But I believe they should link successfully, because this works:

This PR fixes the problem, by adding associated functions that have "custom linkage" to reachable_set, just like normal functions.

I haven't tested whether #76211 and Miri are fixed by this PR yet, but I'm submitting this anyway since this fixes the examples above.

I added a run-pass test that combines my two examples above, but I'm not sure if that's the right way to test this. Maybe I should add / modify an existing codegen test (src/test/codegen/export-no-mangle.rs?) instead?


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK