zlacker

[parent] [thread] 3 comments
1. jynels+(OP)[view] [source] 2024-01-17 13:28:04
rust's CI is quite extensive actually; there's a talk on it here: https://www.pietroalbini.org/blog/shipping-a-compiler-every-...

CI is good. more tests are good. but there's a limit to how much they can catch.

here is an example: there is an internal type checking API called [`resolve_vars_if_possible`](https://doc.rust-lang.org/nightly/nightly-rustc/rustc_infer/...). this needs to be called on the output of almost any call to `.normalize()`, or you will get an internal compiler error. the conditions under which you get an ICE are quite complicated; sometimes you need 6 or more items in the crate with `impl Trait` or type_alias_impl_trait or const generics involved. but it's very easy to see there's a bug just by looking at the code and seeing the missing `resolve_vars()` call.

how can we automate this? well, rustc has a mechanism for "internal lints", but they're somewhat annoying to write - you're basically writing a new compiler pass, and it needs to not have false positives. it's much easier to just catch this one instance. so the reviewer, who's already burned out, does this quick manual review instead.

replies(2): >>symlin+Kv >>pas+122
2. symlin+Kv[view] [source] 2024-01-17 15:47:12
>>jynels+(OP)
Just tell that verbatim to ChatGPT and it will catch it for you.
3. pas+122[view] [source] 2024-01-17 23:30:28
>>jynels+(OP)
hm, is it possible to ... add these trivial-by-look-but-hard-to-script things to a checklist as an auto-comment to PRs? is there a list of these?

anyway, thanks for writing this post, and for featuring that awesome message/art/logo/thing at the end \m/

replies(1): >>jynels+il2
◧◩
4. jynels+il2[view] [source] [discussion] 2024-01-18 01:34:34
>>pas+122
yes, it's possible! that list doesn't exist today but i would love to create it. i wrote a draft a few years ago before shifting to other work; someone recently expressed interest in reviving that project: https://github.com/rust-lang/rustc-dev-guide/pull/1463

<3 i'm glad you enjoyed it

[go to top]