JustinStitt wrote:
I think there is some confusion in this thread about how to tell the compiler
about intentional data loss.
The UX I like the most is something like the following:
```c
void foo() {
int __ob_trap a = -1;
u16 b = a; // trap, semantics we just agreed upon. implicit casts are sketchy
u16 c = (u16)a; // no trap, inform compiler about our intent explicitly, Rust
equivalent 'a as u16'
u16 d = (u16 __ob_wrap)a; // no trap, inform compiler about our intent
explcitly
u16 e = (u16 __ob_trap)a; // trap, Rust equivalent: 'a.try_into().unwrap()'
}
```
https://github.com/llvm/llvm-project/pull/148914
_______________________________________________
lldb-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits