3 ms·
Correct, that's what I mean. I trust SQLite's devs to know more about this, so I trust what they wrote. There are parts of Rust code that are basically: do_t
by scott_w 8mo ago
Correct, that's what I mean. I trust SQLite's devs to know more about this, so I trust what they wrote. There are parts of Rust code that are basically:
do_thing().expect(...);
This branch is required by the code, even if it can't be reached, because the type system requires it. It's not possible to test this branch, therefore 100% coverage is impossible in those cases.
- Philpax 8mo agoThe type system does not require that. You can just discard the result: let _ = do_thing();
- scott_w 8mo agoExcept that doesn’t work if you need to use the result…
- viraptor 8mo agoYou normally count/test branches at the original language level, not the compiled one. Otherwise we'd get VERY silly results like: - counting foo().except() as 2 branches - counting a simple loop as a missed branch, because it got unrolled and you didn't test it with 7,6,5,4,3,2,1 items - failing on unused straight implementation of memcpy because your CPU supports SIMD and chose that alternative Etc. The compiled version will be full of code you'll never run regardless of language.
- scott_w 8mo agoThat’s not my requirement, that’s SQLite’s requirement. If you want to dispute their claim, I recommend you write to them, however I strongly suspect they know more about this than you do.
- viraptor 8mo agoI know it's on the sqlite side. I'm familiar with the claim and disagree with it.
- scott_w 8mo agoYou’re arguing in this context: > wouldn't the ability to automatically rewrite sqlite in Rust be a valuable asset? If you want to rewrite SQLite, you must accept their position. Otherwise you simply aren’t rewriting SQLite, you’re writing your own database.
- viraptor 8mo agoNot having bound checks does not make sqlite sqlite. If that was the case, you couldn't compile it with https://clang.llvm.org/docs/BoundsSafety.html https://clang.llvm.org/docs/BoundsSafety.html turned on and still call it sqlite for example.