-
-
Notifications
You must be signed in to change notification settings - Fork 43
Closed
Description
Currently linkme generates an extern static of Element type for the “stop section” symbol:
linkme/impl/src/declaration.rs
Lines 139 to 143 in 0e5e28b
| #[cfg_attr(any(target_os = "none", target_os = "linux", target_os = "android", target_os = "fuchsia", target_os = "psp"), link_name = #linux_section_stop)] | |
| #[cfg_attr(any(target_os = "macos", target_os = "ios", target_os = "tvos"), link_name = #macho_section_stop)] | |
| #[cfg_attr(target_os = "illumos", link_name = #illumos_section_stop)] | |
| #[cfg_attr(any(target_os = "freebsd", target_os = "openbsd"), link_name = #bsd_section_stop)] | |
| static LINKME_STOP: <#ty as #linkme_path::__private::Slice>::Element; |
As pointed out in rust-lang/rust#46188 (comment), statics are considered always-dereferenceable, so it’s probably unsound. As the stop static is never actually read from, I think it could be made zero-sized to remove the unsoundness?
loyd
Metadata
Metadata
Assignees
Labels
No labels