● Rust committer (member of
compiler contributors team
and diagnostic working group)
● Rust Foundation 2023 Fellow
Takayuki Maeda /
TaKO8Ki
@TaKO8Ki
@TaKOBKi
また、Rustではloggingにtracingというtokio organizationで開発されて
いるcrateを使っている。
ref: Using tracing to debug the compiler
$ RUSTC_LOG=rustc_parse=debug cargo +stage1
build
コードを読んでみる
UIテストとは何か?
> tests that check the stdout/stderr from the compilation and/or running the resulting
executable
コンパイルによるstdout/stderrと
実行可能ファイルを実行した結果をチェックするためのテスト
ref: https://rustc-dev-guide.rust-lang.org/tests/compiletest.html#test-suites
Slide 41
Slide 41 text
では適当なdebug用のcrateを作ってmain.rsに下記をコピペしてみる。
Slide 42
Slide 42 text
試しにstage1コンパイラでbuildしてみると、
$ cargo +stage1 build
Slide 43
Slide 43 text
こういうエラーが得られる。
Slide 44
Slide 44 text
こういうエラーが得られる。
さっきparse_item_enumで見つけたエ
ラーがある
Slide 45
Slide 45 text
試しにエラーメッセージを変更してみる。
perhaps you meant to use
`struct` here foobar
実際にissueに取り組んでみる
今回は自分が過去に取り組んだ比較的シンプルなissueを参考に見てみます。
“consider dereferencing here” help doesn’t account for operator precedence
of the deref operator · Issue #105429 · rust-lang/rust