Contributing to Rustc, episode 3: Minimizing and Testing

Contributing to Rustc, episode 3: Minimizing and Testing

403 Lượt nghe
Contributing to Rustc, episode 3: Minimizing and Testing
We talk about how to take an issue filed against rustc, minimize it into a smaller example, and then turn that minimized example into a regression test suitable for use in rustc's UI test suite. Associated Office Hours will be on: * 2023-01-25, 14h30 -- 15h30 GMT, and * 2023-02-01, 19h00 -- 20h30 GMT To learn more about how to join the office hours, or to ask questions about the video, join us on Zulip at https://rust-lang.zulipchat.com/#narrow/stream/328238-RustcContributor.3A.3Anew/topic/youtube.20video.3A.20minimizing.20and.20testing/near/321962624 And to see (many) more of my thoughts on minimizing bugs in Rust, you can see my blog entry dedicated to Rust-specific minimization patterns: http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/ 00:00 - Intro. Our plan for this session 00:39 - Today's motivating problem: a panic while panicking issue 01:32 - Synchronizing the toolchain via `rustup` 05:22 - Transcribing source from an issue (and where that can go wrong) 07:27 - A successful duplication of the issue 09:37 - How to narrow down a four-line example? 11:27 - Narrowing issue to macro-expansion via `-Zunpretty` 13:28 - The layout of the test suite for rustc 17:12 - Embedded test directives 19:20 - Making a proc-macro unit test 23:00 - A series of test failures... but not the one we wanted 32:11 - Our rustc test reproduces the issue without using a third-party crate 33:13 - `//~ ERROR` annotations, and .stdout/.stderr files 36:33 - `--bless` to generate the expected (and normalized) stdout/stderr output 38:11 - How to annotate more than one error for a given line 40:52 - Updating the bug with our MCVE