Skip to content

Commit 60ef9da

Browse files
steffahnjyn514
authored andcommitted
Suggests --edition=2018 argument when using stage0/bin/rustfmt directly
1 parent 09bf2bd commit 60ef9da

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/building/suggested.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ You can also install the hook as a step of running `x.py setup`!
2222
a file. By default, `rust-analyzer` runs the `cargo check` and `rustfmt`
2323
commands, but you can override these commands to use more adapted versions
2424
of 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,

src/getting-started.md

+2
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,8 @@ format-on-save turned on. It's a good habit to run `./x.py fmt` before every
293293
commit, 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
295295
single 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

297299
One last thing: you can use `RUSTC_LOG=XXX` to get debug logging. [Read more
298300
here][logging]. Notice the `C` in `RUSTC_LOG`. Other than that, it uses normal

0 commit comments

Comments
 (0)