4 ms·
I am aware, my point is about how the following is dealt with: fn foo(x: i32) i32 { return x + 100; } fn bar(x: i32) i32 { @setRuntimeSafety(
by estebank 3y ago
I am aware, my point is about how the following is dealt with:
fn foo(x: i32) i32 {
return x + 100;
}
fn bar(x: i32) i32 {
@setRuntimeSafety(false);
return foo(x + 100);
}
Particularly when you have arbitrarily deep call graphs where some explicitly enable and disable runtime safety.
- throwawaymaths 3y agoYou mean overflow checking? It only applies to the `x + 100` in bar. Bar can still panic if the `x + 100` in foo overflows. Why should it be any other way?