about summary refs log tree commit diff
path: root/src/doc/rustc-dev-guide
diff options
context:
space:
mode:
authorFrank Steffahn <frank.steffahn@stu.uni-kiel.de>2021-09-17 21:48:36 +0200
committerJoshua Nelson <github@jyn.dev>2021-09-17 14:53:44 -0500
commitb0220ed1f071fb2121bd2c25d26fe7a0ab6a1bba (patch)
tree08a8b4b9406ace2b060b0bf8538967858f412559 /src/doc/rustc-dev-guide
parent1325d517f555d157acfdb98a46f17f57467495c3 (diff)
downloadrust-b0220ed1f071fb2121bd2c25d26fe7a0ab6a1bba.tar.gz
rust-b0220ed1f071fb2121bd2c25d26fe7a0ab6a1bba.zip
Suggests `--edition=2018` argument when using stage0/bin/rustfmt directly
Diffstat (limited to 'src/doc/rustc-dev-guide')
-rw-r--r--src/doc/rustc-dev-guide/src/building/suggested.md5
-rw-r--r--src/doc/rustc-dev-guide/src/getting-started.md2
2 files changed, 5 insertions, 2 deletions
diff --git a/src/doc/rustc-dev-guide/src/building/suggested.md b/src/doc/rustc-dev-guide/src/building/suggested.md
index e544a68b817..eed267f9832 100644
--- a/src/doc/rustc-dev-guide/src/building/suggested.md
+++ b/src/doc/rustc-dev-guide/src/building/suggested.md
@@ -22,7 +22,7 @@ You can also install the hook as a step of running `x.py setup`!
 a file. By default, `rust-analyzer` runs the `cargo check` and `rustfmt`
 commands, but you can override these commands to use more adapted versions
 of these tools when hacking on `rustc`. For example, for Visual Studio Code,
-you can write:
+you can write: <!-- date: 2021-09 --><!-- the date comment is for the edition below -->
 
 ```JSON
 {
@@ -32,7 +32,8 @@ you can write:
         "--json-output"
     ],
     "rust-analyzer.rustfmt.overrideCommand": [
-      "./build/TARGET_TRIPLE/stage0/bin/rustfmt"
+      "./build/TARGET_TRIPLE/stage0/bin/rustfmt",
+      "--edition=2018"
     ],
     "editor.formatOnSave": true,
     "rust-analyzer.cargo.runBuildScripts": false,
diff --git a/src/doc/rustc-dev-guide/src/getting-started.md b/src/doc/rustc-dev-guide/src/getting-started.md
index 18e429e5ea4..14225c50469 100644
--- a/src/doc/rustc-dev-guide/src/getting-started.md
+++ b/src/doc/rustc-dev-guide/src/getting-started.md
@@ -293,6 +293,8 @@ format-on-save turned on. It's a good habit to run `./x.py fmt` before every
 commit, as this reduces conflicts later. The pinned version is built under
 `build/<target>/stage0/bin/rustfmt`, so if you want, you can use it for a
 single file or for format-on-save in your editor, which can be faster than `./x.py fmt`.
+You'll have to pass the <!-- date: 2021-09 --> `--edition=2018` argument
+yourself when calling `rustfmt` directly.
 
 One last thing: you can use `RUSTC_LOG=XXX` to get debug logging. [Read more
 here][logging]. Notice the `C` in `RUSTC_LOG`. Other than that, it uses normal