There was an error while loading. Please reload this page.
The following code:
#[inline_never] unconstrained fn returns_true() -> bool { true } unconstrained fn f(mut a: bool, mut b: bool) -> bool { let r: &mut bool = if returns_true() { &mut a } else { &mut b }; a = true; *r } unconstrained fn main() -> pub bool { f(false, false) }
returns false. Under comptime, it's true (which seemingly should be correct). The uninlined returns_true() function is required for this behavior.
false
comptime
true
returns_true()
The following code:
returns
false. Undercomptime, it'strue(which seemingly should be correct). The uninlinedreturns_true()function is required for this behavior.