-
Notifications
You must be signed in to change notification settings - Fork 13k
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
pub static disappears if only used from asm #13365
Comments
Traige: still true |
Still an issue. Updated example: #![feature(asm)]
#[no_mangle]
pub static arr: [u8; 16] = [0; 16];
fn main() {
unsafe {
asm!("movups arr, %xmm0" ::: "xmm0");
}
} |
Error is different now:
|
The correct way to do this is to pass the array as a constrained variable (per @nagisa, who can provide more details) so that the compiler knows about the fact that |
Namely the code should be looking something like this:
instead. |
feat: add multiple getters mode in `generate_getter` This commit adds two modes to generate_getter action. First, the plain old working on single fields. Second, working on a selected range of fields. Should partially solve rust-lang#13246 If this gets approved will create a separate PR for setters version of the same ### Points to help in review: - `generate_getter_from_record_info` contains code which is mostly taken from assist before refactor - Same goes for `parse_record_fields` - There are changes in other assists, as one of the methods in utils named `find_struct_impl` is changed, before it used to accept a single `fn_name`, now it takes a list of function names to check against. All old impls are updated to create a small list to pass their single element. ### Assumptions: - If any of the fields have an implementation, the action will quit.
Adding an unused constraint
"r"(&arr)
fixes it, as does passing&arr
totest::black_box
(which does basically that).The text was updated successfully, but these errors were encountered: