-
Notifications
You must be signed in to change notification settings - Fork 213
Open
Description
Summary
https://doc.rust-lang.org/reference/expressions.html#r-expr.operand-order
GCCRS appears to evaluate child expressions of struct expressions in field definition order, not left to right inside the expression.
Reproducer
#![no_core]
extern "C" {
fn first_call() -> i32;
fn second_call() -> i32;
}
pub fn get_0() -> i32 {
struct S {
a: i32,
b: i32
};
let x = unsafe {
S { b: first_call (), a: second_call () }
};
x.a
}Does the code make use of any (1.49) nightly feature ?
- Nightly
Godbolt link
https://godbolt.org/z/9hEoM8YGd
Actual behavior
second_call is called first
Expected behavior
first_call is called first
GCC Version
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels