]> git.lizzy.rs Git - rust.git/blobdiff - Configurations.md
Fix condition typo
[rust.git] / Configurations.md
index 659784bfd78c11fc417143924c2556f9476f3450..7557b3637f13e8dffba6bbcd645f9409405ed0c1 100644 (file)
@@ -1,17 +1,17 @@
 # Configuring Rustfmt
 
-Rustfmt is designed to be very configurable. You can create a TOML file called `rustfmt.toml` or `.rustfmt.toml`, place it in the project or any other parent directory and it will apply the options in that file.
+Rustfmt is designed to be very configurable. You can create a TOML file called `rustfmt.toml` or `.rustfmt.toml`, place it in the project or any other parent directory and it will apply the options in that file. If none of these directories contain such a file, both your home directory and a directory called `rustfmt` in your [global config directory](https://docs.rs/dirs/1.0.4/dirs/fn.config_dir.html) (e.g. `.config/rustfmt/`) are checked as well.
 
 A possible content of `rustfmt.toml` or `.rustfmt.toml` might look like this:
 
 ```toml
 indent_style = "Block"
-reorder_imported_names = true
+reorder_imports = false
 ```
 
 Each configuration option is either stable or unstable.
 Stable options can be used directly, while unstable options are opt-in.
-To enable unstable options, set `unstable_features = true` in `rustfmt.toml` or pass `--unstable-options` to rustfmt.
+To enable unstable options, set `unstable_features = true` in `rustfmt.toml` or pass `--unstable-features` to rustfmt.
 
 # Configuration Options
 
@@ -24,34 +24,38 @@ Indent on expressions or items.
 
 - **Default value**: `"Block"`
 - **Possible values**: `"Block"`, `"Visual"`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3346)
 
 ### Array
 
 #### `"Block"` (default):
 
 ```rust
-let lorem = vec![
-    "ipsum",
-    "dolor",
-    "sit",
-    "amet",
-    "consectetur",
-    "adipiscing",
-    "elit",
-];
+fn main() {
+    let lorem = vec![
+        "ipsum",
+        "dolor",
+        "sit",
+        "amet",
+        "consectetur",
+        "adipiscing",
+        "elit",
+    ];
+}
 ```
 
 #### `"Visual"`:
 
 ```rust
-let lorem = vec!["ipsum",
-                 "dolor",
-                 "sit",
-                 "amet",
-                 "consectetur",
-                 "adipiscing",
-                 "elit"];
+fn main() {
+    let lorem = vec!["ipsum",
+                     "dolor",
+                     "sit",
+                     "amet",
+                     "consectetur",
+                     "adipiscing",
+                     "elit"];
+}
 ```
 
 ### Control flow
@@ -59,21 +63,34 @@ let lorem = vec!["ipsum",
 #### `"Block"` (default):
 
 ```rust
-if lorem_ipsum &&
-    dolor_sit &&
-    amet_consectetur
-{
-    // ...
+fn main() {
+    if lorem_ipsum
+        && dolor_sit
+        && amet_consectetur
+        && lorem_sit
+        && dolor_consectetur
+        && amet_ipsum
+        && lorem_consectetur
+    {
+        // ...
+    }
 }
 ```
 
 #### `"Visual"`:
 
 ```rust
-if lorem_ipsum &&
-   dolor_sit &&
-   amet_consectetur {
-    // ...
+fn main() {
+    if lorem_ipsum
+       && dolor_sit
+       && amet_consectetur
+       && lorem_sit
+       && dolor_consectetur
+       && amet_ipsum
+       && lorem_consectetur
+    {
+        // ...
+    }
 }
 ```
 
@@ -124,29 +141,33 @@ fn lorem(ipsum: usize,
 #### `"Block"` (default):
 
 ```rust
-lorem(
-    "lorem",
-    "ipsum",
-    "dolor",
-    "sit",
-    "amet",
-    "consectetur",
-    "adipiscing",
-    "elit",
-);
+fn main() {
+    lorem(
+        "lorem",
+        "ipsum",
+        "dolor",
+        "sit",
+        "amet",
+        "consectetur",
+        "adipiscing",
+        "elit",
+    );
+}
 ```
 
 #### `"Visual"`:
 
 ```rust
-lorem("lorem",
-      "ipsum",
-      "dolor",
-      "sit",
-      "amet",
-      "consectetur",
-      "adipiscing",
-      "elit");
+fn main() {
+    lorem("lorem",
+          "ipsum",
+          "dolor",
+          "sit",
+          "amet",
+          "consectetur",
+          "adipiscing",
+          "elit");
+}
 ```
 
 ### Generics
@@ -161,7 +182,7 @@ fn lorem<
     Amet: Eq = usize,
     Adipiscing: Eq = usize,
     Consectetur: Eq = usize,
-    Elit: Eq = usize
+    Elit: Eq = usize,
 >(
     ipsum: Ipsum,
     dolor: Dolor,
@@ -184,15 +205,15 @@ fn lorem<Ipsum: Eq = usize,
          Amet: Eq = usize,
          Adipiscing: Eq = usize,
          Consectetur: Eq = usize,
-         Elit: Eq = usize>
-    (ipsum: Ipsum,
-     dolor: Dolor,
-     sit: Sit,
-     amet: Amet,
-     adipiscing: Adipiscing,
-     consectetur: Consectetur,
-     elit: Elit)
-     -> T {
+         Elit: Eq = usize>(
+    ipsum: Ipsum,
+    dolor: Dolor,
+    sit: Sit,
+    amet: Amet,
+    adipiscing: Adipiscing,
+    consectetur: Consectetur,
+    elit: Elit)
+    -> T {
     // body
 }
 ```
@@ -202,17 +223,21 @@ fn lorem<Ipsum: Eq = usize,
 #### `"Block"` (default):
 
 ```rust
-let lorem = Lorem {
-    ipsum: dolor,
-    sit: amet,
-};
+fn main() {
+    let lorem = Lorem {
+        ipsum: dolor,
+        sit: amet,
+    };
+}
 ```
 
 #### `"Visual"`:
 
 ```rust
-let lorem = Lorem { ipsum: dolor,
-                    sit: amet, };
+fn main() {
+    let lorem = Lorem { ipsum: dolor,
+                        sit: amet };
+}
 ```
 
 See also: [`struct_lit_single_line`](#struct_lit_single_line), [`indent_style`](#indent_style).
@@ -227,7 +252,7 @@ where
     Ipsum: Eq,
     Dolor: Eq,
     Sit: Eq,
-    Amet: Eq
+    Amet: Eq,
 {
     // body
 }
@@ -250,11 +275,11 @@ fn lorem<Ipsum, Dolor, Sit, Amet>() -> T
 
 Whether to use different formatting for items and expressions if they satisfy a heuristic notion of 'small'.
 
-- **Default value**: `true`
-- **Possible values**: `true`, `false`
-- **Stable**: No
+- **Default value**: `"Default"`
+- **Possible values**: `"Default"`, `"Off"`, `"Max"`
+- **Stable**: Yes
 
-#### `true` (default):
+#### `Default` (default):
 
 ```rust
 enum Lorem {
@@ -274,13 +299,17 @@ fn main() {
         "adipiscing",
     );
 
-    let lorem = Lorem { ipsum: dolor, sit: amet };
+    let lorem = Lorem {
+        ipsum: dolor,
+        sit: amet,
+    };
+    let lorem = Lorem { ipsum: dolor };
 
     let lorem = if ipsum { dolor } else { sit };
 }
 ```
 
-#### `false`:
+#### `Off`:
 
 ```rust
 enum Lorem {
@@ -308,27 +337,46 @@ fn main() {
 }
 ```
 
+#### `Max`:
+
+```rust
+enum Lorem {
+    Ipsum,
+    Dolor(bool),
+    Sit { amet: Consectetur, adipiscing: Elit },
+}
+
+fn main() {
+    lorem("lorem", "ipsum", "dolor", "sit", "amet", "consectetur", "adipiscing");
+
+    let lorem = Lorem { ipsum: dolor, sit: amet };
+
+    let lorem = if ipsum { dolor } else { sit };
+}
+```
+
 ## `binop_separator`
 
 Where to put a binary operator when a binary expression goes multiline.
 
 - **Default value**: `"Front"`
 - **Possible values**: `"Front"`, `"Back"`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3368)
 
 #### `"Front"` (default):
 
 ```rust
-let or = foo
-    || bar
-    || foobar;
+fn main() {
+    let or = foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoo
+        || barbarbarbarbarbarbarbarbarbarbarbarbarbarbarbar;
 
-let sum = 1234
-    + 5678
-    + 910;
+    let sum = 123456789012345678901234567890
+        + 123456789012345678901234567890
+        + 123456789012345678901234567890;
 
-let range = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
-    ..bbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
+    let range = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
+        ..bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb;
+}
 ```
 
 #### `"Back"`:
@@ -338,7 +386,8 @@ fn main() {
     let or = foofoofoofoofoofoofoofoofoofoofoofoofoofoofoofoo ||
         barbarbarbarbarbarbarbarbarbarbarbarbarbarbarbar;
 
-    let sum = 123456789012345678901234567890 + 123456789012345678901234567890 +
+    let sum = 123456789012345678901234567890 +
+        123456789012345678901234567890 +
         123456789012345678901234567890;
 
     let range = aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa..
@@ -352,7 +401,7 @@ Combine control expressions with function calls.
 
 - **Default value**: `true`
 - **Possible values**: `true`, `false`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3369)
 
 #### `true` (default):
 
@@ -460,7 +509,7 @@ Maximum length of comments. No effect unless`wrap_comments = true`.
 
 - **Default value**: `80`
 - **Possible values**: any positive integer
-- **Stable**: No
+- **Stable**: No (tracking issue: #3349)
 
 **Note:** A value of `0` results in [`wrap_comments`](#wrap_comments) being applied regardless of a line's width.
 
@@ -483,18 +532,23 @@ Replace strings of _ wildcards by a single .. in tuple patterns
 
 - **Default value**: `false`
 - **Possible values**: `true`, `false`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3384)
 
 #### `false` (default):
 
 ```rust
-let (lorem, ipsum, _, _) = (1, 2, 3, 4);
+fn main() {
+    let (lorem, ipsum, _, _) = (1, 2, 3, 4);
+    let (lorem, ipsum, ..) = (1, 2, 3, 4);
+}
 ```
 
 #### `true`:
 
 ```rust
-let (lorem, ipsum, ..) = (1, 2, 3, 4);
+fn main() {
+    let (lorem, ipsum, ..) = (1, 2, 3, 4);
+}
 ```
 
 ## `control_brace_style`
@@ -503,39 +557,45 @@ Brace style for control flow constructs
 
 - **Default value**: `"AlwaysSameLine"`
 - **Possible values**: `"AlwaysNextLine"`, `"AlwaysSameLine"`, `"ClosingNextLine"`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3377)
 
 #### `"AlwaysSameLine"` (default):
 
 ```rust
-if lorem {
-    println!("ipsum!");
-} else {
-    println!("dolor!");
+fn main() {
+    if lorem {
+        println!("ipsum!");
+    } else {
+        println!("dolor!");
+    }
 }
 ```
 
 #### `"AlwaysNextLine"`:
 
 ```rust
-if lorem
-{
-    println!("ipsum!");
-}
-else
-{
-    println!("dolor!");
+fn main() {
+    if lorem
+    {
+        println!("ipsum!");
+    }
+    else
+    {
+        println!("dolor!");
+    }
 }
 ```
 
 #### `"ClosingNextLine"`:
 
 ```rust
-if lorem {
-    println!("ipsum!");
-}
-else {
-    println!("dolor!");
+fn main() {
+    if lorem {
+        println!("ipsum!");
+    }
+    else {
+        println!("dolor!");
+    }
 }
 ```
 
@@ -545,27 +605,29 @@ Don't reformat anything
 
 - **Default value**: `false`
 - **Possible values**: `true`, `false`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3388)
 
 ## `error_on_line_overflow`
 
-Error if unable to get all lines within `max_width`
+Error if Rustfmt is unable to get all lines within `max_width`, except for comments and string
+literals. If this happens, then it is a bug in Rustfmt. You might be able to work around the bug by
+refactoring your code to avoid long/complex expressions, usually by extracting a local variable or
+using a shorter name.
 
-- **Default value**: `true`
+- **Default value**: `false`
 - **Possible values**: `true`, `false`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3391)
 
 See also [`max_width`](#max_width).
 
-## `error_on_line_overflow_comments`
+## `error_on_unformatted`
 
-Error if unable to get all comment lines within `comment_width`.
+Error if unable to get comments or string literals within `max_width`, or they are left with
+trailing whitespaces.
 
-- **Default value**: `true`
+- **Default value**: `false`
 - **Possible values**: `true`, `false`
-- **Stable**: No
-
-See also [`comment_width`](#comment_width).
+- **Stable**: No (tracking issue: #3392)
 
 ## `fn_args_density`
 
@@ -573,7 +635,7 @@ Argument density in functions
 
 - **Default value**: `"Tall"`
 - **Possible values**: `"Compressed"`, `"Tall"`, `"Vertical"`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3375)
 
 #### `"Tall"` (default):
 
@@ -637,33 +699,41 @@ trait Lorem {
 
 ```rust
 trait Lorem {
-    fn lorem(ipsum: Ipsum,
-             dolor: Dolor,
-             sit: Sit,
-             amet: Amet);
-
-    fn lorem(ipsum: Ipsum,
-             dolor: Dolor,
-             sit: Sit,
-             amet: Amet) {
+    fn lorem(
+        ipsum: Ipsum,
+        dolor: Dolor,
+        sit: Sit,
+        amet: Amet,
+    );
+
+    fn lorem(
+        ipsum: Ipsum,
+        dolor: Dolor,
+        sit: Sit,
+        amet: Amet,
+    ) {
         // body
     }
 
-    fn lorem(ipsum: Ipsum,
-             dolor: Dolor,
-             sit: Sit,
-             amet: Amet,
-             consectetur: Consectetur,
-             adipiscing: Adipiscing,
-             elit: Elit);
-
-    fn lorem(ipsum: Ipsum,
-             dolor: Dolor,
-             sit: Sit,
-             amet: Amet,
-             consectetur: Consectetur,
-             adipiscing: Adipiscing,
-             elit: Elit) {
+    fn lorem(
+        ipsum: Ipsum,
+        dolor: Dolor,
+        sit: Sit,
+        amet: Amet,
+        consectetur: Consectetur,
+        adipiscing: Adipiscing,
+        elit: Elit,
+    );
+
+    fn lorem(
+        ipsum: Ipsum,
+        dolor: Dolor,
+        sit: Sit,
+        amet: Amet,
+        consectetur: Consectetur,
+        adipiscing: Adipiscing,
+        elit: Elit,
+    ) {
         // body
     }
 }
@@ -676,7 +746,7 @@ Brace style for items
 
 - **Default value**: `"SameLineWhere"`
 - **Possible values**: `"AlwaysNextLine"`, `"PreferSameLine"`, `"SameLineWhere"`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3376)
 
 ### Functions
 
@@ -748,7 +818,8 @@ struct Lorem {
 }
 
 struct Dolor<T>
-    where T: Eq
+where
+    T: Eq,
 {
     sit: T,
 }
@@ -763,7 +834,8 @@ struct Lorem
 }
 
 struct Dolor<T>
-    where T: Eq
+where
+    T: Eq,
 {
     sit: T,
 }
@@ -777,7 +849,8 @@ struct Lorem {
 }
 
 struct Dolor<T>
-    where T: Eq {
+where
+    T: Eq, {
     sit: T,
 }
 ```
@@ -789,7 +862,7 @@ Put empty-body functions and impls on a single line
 
 - **Default value**: `true`
 - **Possible values**: `true`, `false`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3356)
 
 #### `true` (default):
 
@@ -812,13 +885,60 @@ impl Lorem {
 See also [`brace_style`](#brace_style), [`control_brace_style`](#control_brace_style).
 
 
+## `enum_discrim_align_threshold`
+
+The maximum length of enum variant having discriminant, that gets vertically aligned with others.
+Variants without discriminants would be ignored for the purpose of alignment.
+
+Note that this is not how much whitespace is inserted, but instead the longest variant name that
+doesn't get ignored when aligning.
+
+- **Default value** : 0
+- **Possible values**: any positive integer
+- **Stable**: No (tracking issue: #3372)
+
+#### `0` (default):
+
+```rust
+enum Bar {
+    A = 0,
+    Bb = 1,
+    RandomLongVariantGoesHere = 10,
+    Ccc = 71,
+}
+
+enum Bar {
+    VeryLongVariantNameHereA = 0,
+    VeryLongVariantNameHereBb = 1,
+    VeryLongVariantNameHereCcc = 2,
+}
+```
+
+#### `20`:
+
+```rust
+enum Foo {
+    A   = 0,
+    Bb  = 1,
+    RandomLongVariantGoesHere = 10,
+    Ccc = 2,
+}
+
+enum Bar {
+    VeryLongVariantNameHereA = 0,
+    VeryLongVariantNameHereBb = 1,
+    VeryLongVariantNameHereCcc = 2,
+}
+```
+
+
 ## `fn_single_line`
 
 Put single-expression functions on a single line
 
 - **Default value**: `false`
 - **Possible values**: `true`, `false`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3358)
 
 #### `false` (default):
 
@@ -849,11 +969,11 @@ See also [`control_brace_style`](#control_brace_style).
 
 ## `where_single_line`
 
-To force single line where layout
+Forces the `where` clause to be laid out on a single line.
 
 - **Default value**: `false`
 - **Possible values**: `true`, `false`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3359)
 
 #### `false` (default):
 
@@ -862,7 +982,7 @@ impl<T> Lorem for T
 where
     Option<T>: Ipsum,
 {
-    ...
+    // body
 }
 ```
 
@@ -870,8 +990,9 @@ where
 
 ```rust
 impl<T> Lorem for T
-where Option<T>: Ipsum {
-    ...
+where Option<T>: Ipsum
+{
+    // body
 }
 ```
 
@@ -910,24 +1031,97 @@ Format string literals where necessary
 
 - **Default value**: `false`
 - **Possible values**: `true`, `false`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3353)
 
 #### `false` (default):
 
 ```rust
-let lorem = "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit";
+fn main() {
+    let lorem = "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet consectetur adipiscing";
+}
 ```
 
 #### `true`:
 
 ```rust
-let lorem =
-    "ipsum dolor sit amet consectetur \
-     adipiscing elit lorem ipsum dolor sit";
+fn main() {
+    let lorem = "ipsum dolor sit amet consectetur adipiscing elit lorem ipsum dolor sit amet \
+                 consectetur adipiscing";
+}
 ```
 
 See also [`max_width`](#max_width).
 
+## `format_macro_matchers`
+
+Format the metavariable matching patterns in macros.
+
+- **Default value**: `false`
+- **Possible values**: `true`, `false`
+- **Stable**: No (tracking issue: #3354)
+
+#### `false` (default):
+
+```rust
+macro_rules! foo {
+    ($a: ident : $b: ty) => {
+        $a(42): $b;
+    };
+    ($a: ident $b: ident $c: ident) => {
+        $a = $b + $c;
+    };
+}
+```
+
+#### `true`:
+
+```rust
+macro_rules! foo {
+    ($a:ident : $b:ty) => {
+        $a(42): $b;
+    };
+    ($a:ident $b:ident $c:ident) => {
+        $a = $b + $c;
+    };
+}
+```
+
+See also [`format_macro_bodies`](#format_macro_bodies).
+
+
+## `format_macro_bodies`
+
+Format the bodies of macros.
+
+- **Default value**: `true`
+- **Possible values**: `true`, `false`
+- **Stable**: No (tracking issue: #3355)
+
+#### `true` (default):
+
+```rust
+macro_rules! foo {
+    ($a: ident : $b: ty) => {
+        $a(42): $b;
+    };
+    ($a: ident $b: ident $c: ident) => {
+        $a = $b + $c;
+    };
+}
+```
+
+#### `false`:
+
+```rust
+macro_rules! foo {
+    ($a: ident : $b: ty) => { $a(42): $b; };
+    ($a: ident $b: ident $c: ident) => { $a=$b+$c; };
+}
+```
+
+See also [`format_macro_matchers`](#format_macro_matchers).
+
+
 ## `hard_tabs`
 
 Use tab characters for indentation, spaces for alignment
@@ -959,26 +1153,24 @@ See also: [`tab_spaces`](#tab_spaces).
 
 Indent style of imports
 
-- **Default Value**: `"Visual"`
+- **Default Value**: `"Block"`
 - **Possible values**: `"Block"`, `"Visual"`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3360)
 
-#### `"Visual"` (default):
+#### `"Block"` (default):
 
 ```rust
-use foo::{xxx,
-          yyy,
-          zzz};
+use foo::{
+    xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy,
+    zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz,
+};
 ```
 
-#### `"Block"`:
+#### `"Visual"`:
 
 ```rust
-use foo::{
-    xxx,
-    yyy,
-    zzz,
-};
+use foo::{xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy,
+          zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz};
 ```
 
 See also: [`imports_layout`](#imports_layout).
@@ -989,15 +1181,17 @@ Item layout inside a imports block
 
 - **Default value**: "Mixed"
 - **Possible values**: "Horizontal", "HorizontalVertical", "Mixed", "Vertical"
-- **Stable**: No
+- **Stable**: No (tracking issue: #3361)
 
 #### `"Mixed"` (default):
 
 ```rust
-use foo::{xxx, yyy, zzz};
+use foo::{xxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyy, zzzzzzzzzzzzzzzzzz};
 
-use foo::{aaa, bbb, ccc,
-          ddd, eee, fff};
+use foo::{
+    aaaaaaaaaaaaaaaaaa, bbbbbbbbbbbbbbbbbb, cccccccccccccccccc, dddddddddddddddddd,
+    eeeeeeeeeeeeeeeeee, ffffffffffffffffff,
+};
 ```
 
 #### `"Horizontal"`:
@@ -1013,29 +1207,57 @@ use foo::{aaa, bbb, ccc, ddd, eee, fff};
 #### `"HorizontalVertical"`:
 
 ```rust
-use foo::{xxx, yyy, zzz};
+use foo::{xxxxxxxxxxxxxxxxxx, yyyyyyyyyyyyyyyyyy, zzzzzzzzzzzzzzzzzz};
 
-use foo::{aaa,
-          bbb,
-          ccc,
-          ddd,
-          eee,
-          fff};
+use foo::{
+    aaaaaaaaaaaaaaaaaa,
+    bbbbbbbbbbbbbbbbbb,
+    cccccccccccccccccc,
+    dddddddddddddddddd,
+    eeeeeeeeeeeeeeeeee,
+    ffffffffffffffffff,
+};
 ```
 
 #### `"Vertical"`:
 
 ```rust
-use foo::{xxx,
-          yyy,
-          zzz};
+use foo::{
+    xxx,
+    yyy,
+    zzz,
+};
+
+use foo::{
+    aaa,
+    bbb,
+    ccc,
+    ddd,
+    eee,
+    fff,
+};
+```
+
+## `merge_imports`
+
+Merge multiple imports into a single nested import.
+
+- **Default value**: `false`
+- **Possible values**: `true`, `false`
+- **Stable**: No (tracking issue: #3362)
+
+#### `false` (default):
+
+```rust
+use foo::{a, c, d};
+use foo::{b, g};
+use foo::{e, f};
+```
+
+#### `true`:
 
-use foo::{aaa,
-          bbb,
-          ccc,
-          ddd,
-          eee,
-          fff};
+```rust
+use foo::{a, b, c, d, e, f, g};
 ```
 
 
@@ -1045,27 +1267,31 @@ Put a trailing comma after a block based match arm (non-block arms are not affec
 
 - **Default value**: `false`
 - **Possible values**: `true`, `false`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3380)
 
 #### `false` (default):
 
 ```rust
-match lorem {
-    Lorem::Ipsum => {
-        println!("ipsum");
+fn main() {
+    match lorem {
+        Lorem::Ipsum => {
+            println!("ipsum");
+        }
+        Lorem::Dolor => println!("dolor"),
     }
-    Lorem::Dolor => println!("dolor"),
 }
 ```
 
 #### `true`:
 
 ```rust
-match lorem {
-    Lorem::Ipsum => {
-        println!("ipsum");
-    },
-    Lorem::Dolor => println!("dolor"),
+fn main() {
+    match lorem {
+        Lorem::Ipsum => {
+            println!("ipsum");
+        },
+        Lorem::Dolor => println!("dolor"),
+    }
 }
 ```
 
@@ -1111,42 +1337,45 @@ Force multiline closure and match arm bodies to be wrapped in a block
 
 - **Default value**: `false`
 - **Possible values**: `false`, `true`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3374)
 
 #### `false` (default):
 
 ```rust
-result.and_then(|maybe_value| match maybe_value {
-    None => ...,
-    Some(value) => ...,
-})
+fn main() {
+    result.and_then(|maybe_value| match maybe_value {
+        None => foo(),
+        Some(value) => bar(),
+    });
 
-match lorem {
-    None => if ipsum {
-        println!("Hello World");
-    },
-    Some(dolor) => ...,
+    match lorem {
+        None => |ipsum| {
+            println!("Hello World");
+        },
+        Some(dolor) => foo(),
+    }
 }
 ```
 
 #### `true`:
 
 ```rust
+fn main() {
+    result.and_then(|maybe_value| {
+        match maybe_value {
+            None => foo(),
+            Some(value) => bar(),
+        }
+    });
 
-result.and_then(|maybe_value| {
-    match maybe_value {
-        None => ...,
-        Some(value) => ...,
-    }
-})
-
-match lorem {
-    None => {
-        if ipsum {
-            println!("Hello World");
+    match lorem {
+        None => {
+            |ipsum| {
+                println!("Hello World");
+            }
         }
+        Some(dolor) => foo(),
     }
-    Some(dolor) => ...,
 }
 ```
 
@@ -1155,17 +1384,36 @@ match lorem {
 
 Unix or Windows line endings
 
-- **Default value**: `"Unix"`
-- **Possible values**: `"Native"`, `"Unix"`, `"Windows"`
+- **Default value**: `"Auto"`
+- **Possible values**: `"Auto"`, `"Native"`, `"Unix"`, `"Windows"`
 - **Stable**: Yes
 
+#### `Auto` (default):
+
+The newline style is detected automatically on a per-file basis. Files
+with mixed line endings will be converted to the first detected line
+ending style.
+
+#### `Native`
+
+Line endings will be converted to `\r\n` on Windows and `\n` on all
+other platforms.
+
+#### `Unix`
+
+Line endings will be converted to `\n`.
+
+#### `Windows`
+
+Line endings will be converted to `\r\n`.
+
 ## `normalize_comments`
 
 Convert /* */ comments to // comments where possible
 
 - **Default value**: `false`
 - **Possible values**: `true`, `false`
-- **Stable**: Yes
+- **Stable**: No (tracking issue: #3350)
 
 #### `false` (default):
 
@@ -1187,46 +1435,40 @@ fn dolor() -> usize {}
 fn adipiscing() -> usize {}
 ```
 
-## `reorder_imported_names`
+## `remove_nested_parens`
 
-Reorder lists of names in import statements alphabetically
+Remove nested parens.
 
-- **Default value**: `false`
+- **Default value**: `true`,
 - **Possible values**: `true`, `false`
-- **Stable**: No
+- **Stable**: Yes
 
-#### `false` (default):
 
+#### `true` (default):
 ```rust
-use super::{lorem, ipsum, dolor, sit};
+fn main() {
+    (foo());
+}
 ```
 
-#### `true`:
-
+#### `false`:
 ```rust
-use super::{dolor, ipsum, lorem, sit};
+fn main() {
+    ((((foo()))));
+}
 ```
 
-See also [`reorder_imports`](#reorder_imports).
 
 ## `reorder_imports`
 
-Reorder import statements alphabetically
+Reorder import and extern crate statements alphabetically in groups (a group is
+separated by a newline).
 
-- **Default value**: `false`
+- **Default value**: `true`
 - **Possible values**: `true`, `false`
-- **Stable**: No
-
-#### `false` (default):
-
-```rust
-use lorem;
-use ipsum;
-use dolor;
-use sit;
-```
+- **Stable**: Yes
 
-#### `true`:
+#### `true` (default):
 
 ```rust
 use dolor;
@@ -1235,107 +1477,86 @@ use lorem;
 use sit;
 ```
 
-See also [`reorder_imported_names`](#reorder_imported_names), [`reorder_imports_in_group`](#reorder_imports_in_group).
-
-## `reorder_imports_in_group`
-
-Reorder import statements in group
-
-- **Default value**: `false`
-- **Possible values**: `true`, `false`
-- **Stable**: No
-
-**Note:** This option takes effect only when [`reorder_imports`](#reorder_imports) is set to `true`.
-
-#### `false` (default):
+#### `false`:
 
 ```rust
-use std::mem;
-use std::io;
-
 use lorem;
 use ipsum;
 use dolor;
 use sit;
 ```
 
-#### `true`:
 
-```rust
-use std::io;
-use std::mem;
+## `reorder_modules`
 
-use dolor;
-use ipsum;
-use lorem;
-use sit;
-```
-
-See also [`reorder_imports`](#reorder_imports).
-
-## `reorder_extern_crates`
-
-Reorder `extern crate` statements alphabetically
+Reorder `mod` declarations alphabetically in group.
 
 - **Default value**: `true`
 - **Possible values**: `true`, `false`
-- **Stable**: No
+- **Stable**: Yes
 
-#### `true` (default):
+#### `true` (default)
 
 ```rust
-extern crate dolor;
-extern crate ipsum;
-extern crate lorem;
-extern crate sit;
+mod a;
+mod b;
+
+mod dolor;
+mod ipsum;
+mod lorem;
+mod sit;
 ```
 
-#### `false`:
+#### `false`
 
 ```rust
-extern crate lorem;
-extern crate ipsum;
-extern crate dolor;
-extern crate sit;
+mod b;
+mod a;
+
+mod lorem;
+mod ipsum;
+mod dolor;
+mod sit;
 ```
 
-See also [`reorder_extern_crates_in_group`](#reorder_extern_crates_in_group).
+**Note** `mod` with `#[macro_export]` will not be reordered since that could change the semantics
+of the original source code.
 
-## `reorder_extern_crates_in_group`
+## `reorder_impl_items`
 
-Reorder `extern crate` statements in group
+Reorder impl items. `type` and `const` are put first, then macros and methods.
 
-- **Default value**: `true`
+- **Default value**: `false`
 - **Possible values**: `true`, `false`
-- **Stable**: No
-
-**Note:** This option takes effect only when [`reorder_imports`](#reorder_imports) is set to `true`.
+- **Stable**: No (tracking issue: #3363)
 
-#### `true` (default):
+#### `false` (default)
 
 ```rust
-extern crate a;
-extern crate b;
+struct Dummy;
+
+impl Iterator for Dummy {
+    fn next(&mut self) -> Option<Self::Item> {
+        None
+    }
 
-extern crate dolor;
-extern crate ipsum;
-extern crate lorem;
-extern crate sit;
+    type Item = i32;
+}
 ```
 
-#### `false`:
+#### `true`
 
 ```rust
-extern crate b;
-extern crate a;
+struct Dummy;
 
-extern crate lorem;
-extern crate ipsum;
-extern crate dolor;
-extern crate sit;
-```
+impl Iterator for Dummy {
+    type Item = i32;
 
-See also [`reorder_extern_crates`](#reorder_extern_crates).
+    fn next(&mut self) -> Option<Self::Item> {
+        None
+    }
+}
+```
 
 ## `report_todo`
 
@@ -1343,7 +1564,7 @@ Report `TODO` items in comments.
 
 - **Default value**: `"Never"`
 - **Possible values**: `"Always"`, `"Unnumbered"`, `"Never"`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3393)
 
 Warns about any comments containing `TODO` in them when set to `"Always"`. If
 it contains a `#X` (with `X` being a number) in parentheses following the
@@ -1357,7 +1578,7 @@ Report `FIXME` items in comments.
 
 - **Default value**: `"Never"`
 - **Possible values**: `"Always"`, `"Unnumbered"`, `"Never"`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3394)
 
 Warns about any comments containing `FIXME` in them when set to `"Always"`. If
 it contains a `#X` (with `X` being a number) in parentheses following the
@@ -1372,7 +1593,7 @@ Don't reformat out of line modules
 
 - **Default value**: `false`
 - **Possible values**: `true`, `false`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3389)
 
 ## `space_after_colon`
 
@@ -1380,7 +1601,7 @@ Leave a space after the colon.
 
 - **Default value**: `true`
 - **Possible values**: `true`, `false`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3366)
 
 #### `true` (default):
 
@@ -1412,7 +1633,7 @@ Leave a space before the colon.
 
 - **Default value**: `false`
 - **Possible values**: `true`, `false`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3365)
 
 #### `false` (default):
 
@@ -1443,8 +1664,8 @@ See also: [`space_after_colon`](#space_after_colon).
 The maximum diff of width between struct fields to be aligned with each other.
 
 - **Default value** : 0
-- **Possible values**: any positive integer
-- **Stable**: No
+- **Possible values**: any non-negative integer
+- **Stable**: No (tracking issue: #3371)
 
 #### `0` (default):
 
@@ -1472,7 +1693,7 @@ Put spaces around the .., ..=, and ... range operators
 
 - **Default value**: `false`
 - **Possible values**: `true`, `false`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3367)
 
 #### `false` (default):
 
@@ -1522,69 +1743,31 @@ fn main() {
 }
 ```
 
-## `spaces_within_parens_and_brackets`
-
-Put spaces within non-empty generic arguments, parentheses, and square brackets
-
-- **Default value**: `false`
-- **Possible values**: `true`, `false`
-- **Stable**: No
-
-#### `false` (default):
-
-```rust
-// generic arguments
-fn lorem<T: Eq>(t: T) {
-    // body
-}
-
-// non-empty parentheses
-fn lorem<T: Eq>(t: T) {
-    let lorem = (ipsum, dolor);
-}
-
-// non-empty square brackets
-let lorem: [usize; 2] = [ipsum, dolor];
-```
-
-#### `true`:
-
-```rust
-// generic arguments
-fn lorem< T: Eq >(t: T) {
-    // body
-}
-
-// non-empty parentheses
-fn lorem<T: Eq>( t: T ) {
-    let lorem = ( ipsum, dolor );
-}
-
-// non-empty square brackets
-let lorem: [ usize; 2 ] = [ ipsum, dolor ];
-```
-
 ## `struct_lit_single_line`
 
 Put small struct literals on a single line
 
 - **Default value**: `true`
 - **Possible values**: `true`, `false`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3357)
 
 #### `true` (default):
 
 ```rust
-let lorem = Lorem { ipsum: dolor, sit: amet };
+fn main() {
+    let lorem = Lorem { foo: bar, baz: ofo };
+}
 ```
 
 #### `false`:
 
 ```rust
-let lorem = Lorem {
-    ipsum: dolor,
-    sit: amet,
-};
+fn main() {
+    let lorem = Lorem {
+        foo: bar,
+        baz: ofo,
+    };
+}
 ```
 
 See also: [`indent_style`](#indent_style).
@@ -1604,7 +1787,8 @@ Number of spaces per tab
 fn lorem() {
     let ipsum = dolor();
     let sit = vec![
-        "amet consectetur adipiscing elit."
+        "amet consectetur adipiscing elit amet",
+        "consectetur adipiscing elit amet consectetur.",
     ];
 }
 ```
@@ -1615,7 +1799,8 @@ fn lorem() {
 fn lorem() {
   let ipsum = dolor();
   let sit = vec![
-    "amet consectetur adipiscing elit."
+    "amet consectetur adipiscing elit amet",
+    "consectetur adipiscing elit amet consectetur.",
   ];
 }
 ```
@@ -1629,48 +1814,54 @@ How to handle trailing commas for lists
 
 - **Default value**: `"Vertical"`
 - **Possible values**: `"Always"`, `"Never"`, `"Vertical"`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3379)
 
 #### `"Vertical"` (default):
 
 ```rust
-let Lorem { ipsum, dolor, sit } = amet;
-let Lorem {
-    ipsum,
-    dolor,
-    sit,
-    amet,
-    consectetur,
-    adipiscing,
-} = elit;
+fn main() {
+    let Lorem { ipsum, dolor, sit } = amet;
+    let Lorem {
+        ipsum,
+        dolor,
+        sit,
+        amet,
+        consectetur,
+        adipiscing,
+    } = elit;
+}
 ```
 
 #### `"Always"`:
 
 ```rust
-let Lorem { ipsum, dolor, sit, } = amet;
-let Lorem {
-    ipsum,
-    dolor,
-    sit,
-    amet,
-    consectetur,
-    adipiscing,
-} = elit;
+fn main() {
+    let Lorem { ipsum, dolor, sit, } = amet;
+    let Lorem {
+        ipsum,
+        dolor,
+        sit,
+        amet,
+        consectetur,
+        adipiscing,
+    } = elit;
+}
 ```
 
 #### `"Never"`:
 
 ```rust
-let Lorem { ipsum, dolor, sit } = amet;
-let Lorem {
-    ipsum,
-    dolor,
-    sit,
-    amet,
-    consectetur,
-    adipiscing
-} = elit;
+fn main() {
+    let Lorem { ipsum, dolor, sit } = amet;
+    let Lorem {
+        ipsum,
+        dolor,
+        sit,
+        amet,
+        consectetur,
+        adipiscing
+    } = elit;
+}
 ```
 
 See also: [`match_block_trailing_comma`](#match_block_trailing_comma).
@@ -1681,7 +1872,7 @@ Add trailing semicolon after break, continue and return
 
 - **Default value**: `true`
 - **Possible values**: `true`, `false`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3378)
 
 #### `true` (default):
 ```rust
@@ -1703,13 +1894,13 @@ Determines if `+` or `=` are wrapped in spaces in the punctuation of types
 
 - **Default value**: `"Wide"`
 - **Possible values**: `"Compressed"`, `"Wide"`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3364)
 
 #### `"Wide"` (default):
 
 ```rust
 fn lorem<Ipsum: Dolor + Sit = Amet>() {
-       // body
+    // body
 }
 ```
 
@@ -1717,7 +1908,49 @@ fn lorem<Ipsum: Dolor + Sit = Amet>() {
 
 ```rust
 fn lorem<Ipsum: Dolor+Sit=Amet>() {
-       // body
+    // body
+}
+```
+
+## `use_field_init_shorthand`
+
+Use field initialize shorthand if possible.
+
+- **Default value**: `false`
+- **Possible values**: `true`, `false`
+- **Stable**: Yes
+
+#### `false` (default):
+
+```rust
+struct Foo {
+    x: u32,
+    y: u32,
+    z: u32,
+}
+
+fn main() {
+    let x = 1;
+    let y = 2;
+    let z = 3;
+    let a = Foo { x: x, y: y, z: z };
+}
+```
+
+#### `true`:
+
+```rust
+struct Foo {
+    x: u32,
+    y: u32,
+    z: u32,
+}
+
+fn main() {
+    let x = 1;
+    let y = 2;
+    let z = 3;
+    let a = Foo { x, y, z };
 }
 ```
 
@@ -1727,20 +1960,74 @@ Replace uses of the try! macro by the ? shorthand
 
 - **Default value**: `false`
 - **Possible values**: `true`, `false`
-- **Stable**: No
+- **Stable**: Yes
 
 #### `false` (default):
 
 ```rust
-let lorem = try!(ipsum.map(|dolor|dolor.sit()));
+fn main() {
+    let lorem = try!(ipsum.map(|dolor| dolor.sit()));
+}
 ```
 
 #### `true`:
 
 ```rust
-let lorem = ipsum.map(|dolor| dolor.sit())?;
+fn main() {
+    let lorem = ipsum.map(|dolor| dolor.sit())?;
+}
 ```
 
+## `format_doc_comments`
+
+Format doc comments.
+
+- **Default value**: `false`
+- **Possible values**: `true`, `false`
+- **Stable**: No (tracking issue: #3348)
+
+#### `false` (default):
+
+```rust
+/// Adds one to the number given.
+///
+/// # Examples
+///
+/// ```rust
+/// let five=5;
+///
+/// assert_eq!(
+///     6,
+///     add_one(5)
+/// );
+/// # fn add_one(x: i32) -> i32 {
+/// #     x + 1
+/// # }
+/// ```
+fn add_one(x: i32) -> i32 {
+    x + 1
+}
+```
+
+#### `true`
+
+```rust
+/// Adds one to the number given.
+///
+/// # Examples
+///
+/// ```rust
+/// let five = 5;
+///
+/// assert_eq!(6, add_one(5));
+/// # fn add_one(x: i32) -> i32 {
+/// #     x + 1
+/// # }
+/// ```
+fn add_one(x: i32) -> i32 {
+    x + 1
+}
+```
 
 ## `wrap_comments`
 
@@ -1748,7 +2035,7 @@ Break comments to fit on the line
 
 - **Default value**: `false`
 - **Possible values**: `true`, `false`
-- **Stable**: Yes
+- **Stable**: No (tracking issue: #3347)
 
 #### `false` (default):
 
@@ -1772,38 +2059,117 @@ Wrap the body of arms in blocks when it does not fit on the same line with the p
 
 - **Default value**: `true`
 - **Possible values**: `true`, `false`
-- **Stable**: No
+- **Stable**: No (tracking issue: #3373)
 
 #### `true` (default):
 
 ```rust
-match lorem {
-    true => {
-        foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x)
+fn main() {
+    match lorem {
+        true => {
+            foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x)
+        }
+        false => println!("{}", sit),
     }
-    false => println!("{}", sit),
 }
 ```
 
 #### `false`:
 
 ```rust
-match lorem {
-    true =>
-        foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
-    false => println!("{}", sit),
+fn main() {
+    match lorem {
+        true =>
+            foooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooooo(x),
+        false => println!("{}", sit),
+    }
 }
 ```
 
 See also: [`match_block_trailing_comma`](#match_block_trailing_comma).
 
-## `write_mode`
+## `overflow_delimited_expr`
+
+When structs, slices, arrays, and block/array-like macros are used as the last
+argument in an expression list, allow them to overflow (like blocks/closures)
+instead of being indented on a new line.
+
+- **Default value**: `false`
+- **Possible values**: `true`, `false`
+- **Stable**: No (tracking issue: #3370)
+
+#### `false` (default):
+
+```rust
+fn example() {
+    foo(ctx, |param| {
+        action();
+        foo(param)
+    });
+
+    foo(
+        ctx,
+        Bar {
+            x: value,
+            y: value2,
+        },
+    );
+
+    foo(
+        ctx,
+        &[
+            MAROON_TOMATOES,
+            PURPLE_POTATOES,
+            ORGANE_ORANGES,
+            GREEN_PEARS,
+            RED_APPLES,
+        ],
+    );
 
-What Write Mode to use when none is supplied: Replace, Overwrite, Display, Diff, Coverage
+    foo(
+        ctx,
+        vec![
+            MAROON_TOMATOES,
+            PURPLE_POTATOES,
+            ORGANE_ORANGES,
+            GREEN_PEARS,
+            RED_APPLES,
+        ],
+    );
+}
+```
 
-- **Default value**: `"Overwrite"`
-- **Possible values**: `"Checkstyle"`, `"Coverage"`, `"Diff"`, `"Display"`, `"Overwrite"`, `"Plain"`, `"Replace"`
-- **Stable**: No
+#### `true`:
+
+```rust
+fn example() {
+    foo(ctx, |param| {
+        action();
+        foo(param)
+    });
+
+    foo(ctx, Bar {
+        x: value,
+        y: value2,
+    });
+
+    foo(ctx, &[
+        MAROON_TOMATOES,
+        PURPLE_POTATOES,
+        ORGANE_ORANGES,
+        GREEN_PEARS,
+        RED_APPLES,
+    ]);
+
+    foo(ctx, vec![
+        MAROON_TOMATOES,
+        PURPLE_POTATOES,
+        ORGANE_ORANGES,
+        GREEN_PEARS,
+        RED_APPLES,
+    ]);
+}
+```
 
 ## `blank_lines_upper_bound`
 
@@ -1811,13 +2177,15 @@ Maximum number of blank lines which can be put between items. If more than this
 lines are found, they are trimmed down to match this integer.
 
 - **Default value**: `1`
-- **Possible values**: *unsigned integer*
-- **Stable**: No
+- **Possible values**: any non-negative integer
+- **Stable**: No (tracking issue: #3381)
 
 ### Example
 Original Code:
 
 ```rust
+#![rustfmt::skip]
+
 fn foo() {
     println!("a");
 }
@@ -1845,7 +2213,7 @@ fn bar() {
 }
 ```
 
-#### `2` (default):
+#### `2`:
 ```rust
 fn foo() {
     println!("a");
@@ -1869,12 +2237,14 @@ them, additional blank lines are inserted.
 
 - **Default value**: `0`
 - **Possible values**: *unsigned integer*
-- **Stable**: No
+- **Stable**: No (tracking issue: #3382)
 
 ### Example
 Original Code (rustfmt will not change it with the default value of `0`):
 
 ```rust
+#![rustfmt::skip]
+
 fn foo() {
     println!("a");
 }
@@ -1898,3 +2268,171 @@ fn bar() {
     println!("c");
 }
 ```
+
+
+## `required_version`
+
+Require a specific version of rustfmt. If you want to make sure that the
+specific version of rustfmt is used in your CI, use this option.
+
+- **Default value**: `CARGO_PKG_VERSION`
+- **Possible values**: any published version (e.g. `"0.3.8"`)
+- **Stable**: No (tracking issue: #3386)
+
+## `hide_parse_errors`
+
+Do not show parse errors if the parser failed to parse files.
+
+- **Default value**: `false`
+- **Possible values**: `true`, `false`
+- **Stable**: No (tracking issue: #3390)
+
+## `color`
+
+Whether to use colored output or not.
+
+- **Default value**: `"Auto"`
+- **Possible values**: "Auto", "Always", "Never"
+- **Stable**: No (tracking issue: #3385)
+
+## `unstable_features`
+
+Enable unstable features on the unstable channel.
+
+- **Default value**: `false`
+- **Possible values**: `true`, `false`
+- **Stable**: No (tracking issue: #3387)
+
+## `license_template_path`
+
+Check whether beginnings of files match a license template.
+
+- **Default value**: `""`
+- **Possible values**: path to a license template file
+- **Stable**: No (tracking issue: #3352)
+
+A license template is a plain text file which is matched literally against the
+beginning of each source file, except for `{}`-delimited blocks, which are
+matched as regular expressions. The following license template therefore
+matches strings like `// Copyright 2017 The Rust Project Developers.`, `//
+Copyright 2018 The Rust Project Developers.`, etc.:
+
+```
+// Copyright {\d+} The Rust Project Developers.
+```
+
+`\{`, `\}` and `\\` match literal braces / backslashes.
+
+## `ignore`
+
+Skip formatting the specified files and directories.
+
+- **Default value**: format every file
+- **Possible values**: See an example below
+- **Stable**: No (tracking issue: #3395)
+
+### Example
+
+If you want to ignore specific files, put the following to your config file:
+
+```toml
+ignore = [
+    "src/types.rs",
+    "src/foo/bar.rs",
+]
+```
+
+If you want to ignore every file under `examples/`, put the following to your config file:
+
+```toml
+ignore = [
+    "examples",
+]
+```
+
+## `edition`
+
+Specifies which edition is used by the parser.
+
+- **Default value**: `2015`
+- **Possible values**: `2015`, `2018`
+- **Stable**: Yes
+
+Rustfmt is able to pick up the edition used by reading the `Cargo.toml` file if executed
+through the Cargo's formatting tool `cargo fmt`. Otherwise, the edition needs to be specified
+in your config file:
+
+```toml
+edition = "2018"
+```
+
+## `version`
+
+Which version of the formatting rules to use. `Version::One` is backwards-compatible
+with Rustfmt 1.0. Other versions are only backwards compatible within a major
+version number.
+
+- **Default value**: `One`
+- **Possible values**: `One`, `Two`
+- **Stable**: No (tracking issue: #3383)
+
+### Example
+
+```toml
+version = "Two"
+```
+
+## `normalize_doc_attributes`
+
+Convert `#![doc]` and `#[doc]` attributes to `//!` and `///` doc comments.
+
+- **Default value**: `false`
+- **Possible values**: `true`, `false`
+- **Stable**: No (tracking issue: #3351)
+
+#### `false` (default):
+
+```rust
+#![doc = "Example documentation"]
+
+#[doc = "Example item documentation"]
+pub enum Foo {}
+```
+
+#### `true`:
+
+```rust
+//! Example documentation
+
+/// Example item documentation
+pub enum Foo {}
+```
+
+## `inline_attribute_width`
+
+Write an item and its attribute on the same line if their combined width is below a threshold
+
+- **Default value**: 0
+- **Possible values**: any positive integer
+- **Stable**: No (tracking issue: #3343)
+
+### Example
+
+#### `0` (default):
+```rust
+#[cfg(feature = "alloc")]
+use core::slice;
+```
+
+#### `50`:
+```rust
+#[cfg(feature = "alloc")] use core::slice;
+```
+
+## `emit_mode`
+
+Internal option
+
+## `make_backup`
+
+Internal option, use `--backup`