@@ -28,13 +28,13 @@ optimizes it, and returns the improved MIR.
2828
2929## Quickstart for adding a new optimization
3030
31- 1 . Make a Rust source file in ` src/test /mir-opt` that shows the code you want to
31+ 1 . Make a Rust source file in ` tests /mir-opt` that shows the code you want to
3232 optimize. This should be kept simple, so avoid ` println! ` or other formatting
3333 code if it's not necessary for the optimization. The reason for this is that
3434 ` println! ` , ` format! ` , etc. generate a lot of MIR that can make it harder to
3535 understand what the optimization does to the test.
3636
37- 2 . Run ` ./x.py test --bless src/test /mir-opt/<your-test>.rs ` to generate a MIR
37+ 2 . Run ` ./x.py test --bless tests /mir-opt/<your-test>.rs ` to generate a MIR
3838 dump. Read [ this README] [ mir-opt-test-readme ] for instructions on how to dump
3939 things.
4040
@@ -51,10 +51,10 @@ optimizes it, and returns the improved MIR.
5151 [ ` run_optimization_passes() ` ] function,
5252 3 . and then start modifying the copied optimization.
5353
54- 5 . Rerun ` ./x.py test --bless src/test /mir-opt/<your-test>.rs ` to regenerate the
54+ 5 . Rerun ` ./x.py test --bless tests /mir-opt/<your-test>.rs ` to regenerate the
5555 MIR dumps. Look at the diffs to see if they are what you expect.
5656
57- 6 . Run ` ./x.py test src/test /ui ` to see if your optimization broke anything.
57+ 6 . Run ` ./x.py test tests /ui ` to see if your optimization broke anything.
5858
59597 . If there are issues with your optimization, experiment with it a bit and
6060 repeat steps 5 and 6.
@@ -70,7 +70,7 @@ optimizes it, and returns the improved MIR.
7070If you have any questions along the way, feel free to ask in
7171` #t-compiler/wg-mir-opt ` on Zulip.
7272
73- [ mir-opt-test-readme ] : https://github.com/rust-lang/rust/blob/master/src/test /mir-opt/README.md
73+ [ mir-opt-test-readme ] : https://github.com/rust-lang/rust/blob/master/tests /mir-opt/README.md
7474[ `compiler/rustc_mir_transform/src` ] : https://github.com/rust-lang/rust/tree/master/compiler/rustc_mir_transform/src
7575<!-- - TODO: Change NoLandingPads. [#1232](https://github.com/rust-lang/rustc-dev-guide/issues/1232) -->
7676[ `no_landing_pads` ] : https://github.com/rust-lang/rust/blob/master/compiler/rustc_mir_transform/src/no_landing_pads.rs
0 commit comments