File tree Expand file tree Collapse file tree 4 files changed +16
-15
lines changed Expand file tree Collapse file tree 4 files changed +16
-15
lines changed Original file line number Diff line number Diff line change @@ -345,3 +345,17 @@ $ rustdoc src/lib.rs --sysroot /path/to/sysroot
345345
346346Similar to ` rustc --sysroot ` , this lets you change the sysroot ` rustdoc ` uses
347347when compiling your code.
348+
349+ ### ` --edition ` : control the edition of docs and doctests
350+
351+ Using this flag looks like this:
352+
353+ ``` bash
354+ $ rustdoc src/lib.rs --edition 2018
355+ $ rustdoc --test src/lib.rs --edition 2018
356+ ```
357+
358+ This flag allows rustdoc to treat your rust code as the given edition. It will compile doctests with
359+ the given edition as well. As with ` rustc ` , the default edition that ` rustdoc ` will use is ` 2015 `
360+ (the first edition).
361+
Original file line number Diff line number Diff line change @@ -346,19 +346,6 @@ details.
346346
347347[ issue-display-warnings ] : https://github.com/rust-lang/rust/issues/41574
348348
349- ### ` --edition ` : control the edition of docs and doctests
350-
351- Using this flag looks like this:
352-
353- ``` bash
354- $ rustdoc src/lib.rs -Z unstable-options --edition 2018
355- $ rustdoc --test src/lib.rs -Z unstable-options --edition 2018
356- ```
357-
358- This flag allows rustdoc to treat your rust code as the given edition. It will compile doctests with
359- the given edition as well. As with ` rustc ` , the default edition that ` rustdoc ` will use is ` 2015 `
360- (the first edition).
361-
362349### ` --extern-html-root-url ` : control how rustdoc links to non-local crates
363350
364351Using this flag looks like this:
Original file line number Diff line number Diff line change @@ -286,7 +286,7 @@ fn opts() -> Vec<RustcOptGroup> {
286286 \" light-suffix.css\" ",
287287 "PATH" )
288288 } ) ,
289- unstable ( "edition" , |o| {
289+ stable ( "edition" , |o| {
290290 o. optopt( "" , "edition" ,
291291 "edition to use when compiling rust code (default: 2015)" ,
292292 "EDITION" )
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ impl Edition {
6565 pub fn is_stable ( & self ) -> bool {
6666 match * self {
6767 Edition :: Edition2015 => true ,
68- Edition :: Edition2018 => false ,
68+ Edition :: Edition2018 => true ,
6969 }
7070 }
7171}
You can’t perform that action at this time.
0 commit comments