File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -22,7 +22,7 @@ You can also install the hook as a step of running `x.py setup`!
2222a file. By default, ` rust-analyzer ` runs the ` cargo check ` and ` rustfmt `
2323commands, but you can override these commands to use more adapted versions
2424of these tools when hacking on ` rustc ` . For example, for Visual Studio Code,
25- you can write:
25+ you can write: <!-- date: 2021-09 --> <!-- the date comment is for the edition below -->
2626
2727``` JSON
2828{
@@ -32,7 +32,8 @@ you can write:
3232 " --json-output"
3333 ],
3434 "rust-analyzer.rustfmt.overrideCommand" : [
35- " ./build/TARGET_TRIPLE/stage0/bin/rustfmt"
35+ " ./build/TARGET_TRIPLE/stage0/bin/rustfmt" ,
36+ " --edition=2018"
3637 ],
3738 "editor.formatOnSave" : true ,
3839 "rust-analyzer.cargo.runBuildScripts" : false ,
Original file line number Diff line number Diff line change @@ -293,6 +293,8 @@ format-on-save turned on. It's a good habit to run `./x.py fmt` before every
293293commit, as this reduces conflicts later. The pinned version is built under
294294` build/<target>/stage0/bin/rustfmt ` , so if you want, you can use it for a
295295single file or for format-on-save in your editor, which can be faster than ` ./x.py fmt ` .
296+ You'll have to pass the <!-- date: 2021-09 --> ` --edition=2018 ` argument
297+ yourself when calling ` rustfmt ` directly.
296298
297299One last thing: you can use ` RUSTC_LOG=XXX ` to get debug logging. [ Read more
298300here] [ logging ] . Notice the ` C ` in ` RUSTC_LOG ` . Other than that, it uses normal
You can’t perform that action at this time.
0 commit comments