Skip to content

Commit fcce0b9

Browse files
authored
Merge pull request #2529 from dlukes/feat/enable-doctests
Enable doctests
2 parents e68bd9e + a41947c commit fcce0b9

File tree

3 files changed

+16
-10
lines changed

3 files changed

+16
-10
lines changed

Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@ license = "Apache-2.0/MIT"
1010
build = "build.rs"
1111
categories = ["development-tools"]
1212

13-
[lib]
14-
doctest = false
15-
1613
[[bin]]
1714
name = "rustfmt"
1815
path = "src/bin/main.rs"

src/chains.rs

+10-4
Original file line numberDiff line numberDiff line change
@@ -25,16 +25,19 @@
2525
//! E.g., `let foo = { aaaa; bbb; ccc }.bar.baz();`, we would layout for the
2626
//! following values of `chain_indent`:
2727
//! Block:
28-
//! ```
28+
//!
29+
//! ```ignore
2930
//! let foo = {
3031
//! aaaa;
3132
//! bbb;
3233
//! ccc
3334
//! }.bar
3435
//! .baz();
3536
//! ```
37+
//!
3638
//! Visual:
37-
//! ```
39+
//!
40+
//! ```ignore
3841
//! let foo = {
3942
//! aaaa;
4043
//! bbb;
@@ -47,13 +50,16 @@
4750
//! If the first item in the chain is a block expression, we align the dots with
4851
//! the braces.
4952
//! Block:
50-
//! ```
53+
//!
54+
//! ```ignore
5155
//! let a = foo.bar
5256
//! .baz()
5357
//! .qux
5458
//! ```
59+
//!
5560
//! Visual:
56-
//! ```
61+
//!
62+
//! ```ignore
5763
//! let a = foo.bar
5864
//! .baz()
5965
//! .qux

src/macros.rs

+6-3
Original file line numberDiff line numberDiff line change
@@ -621,7 +621,8 @@ fn macro_style(mac: &ast::Mac, context: &RewriteContext) -> MacroStyle {
621621

622622
/// Indent each line according to the specified `indent`.
623623
/// e.g.
624-
/// ```rust
624+
///
625+
/// ```rust,ignore
625626
/// foo!{
626627
/// x,
627628
/// y,
@@ -632,8 +633,10 @@ fn macro_style(mac: &ast::Mac, context: &RewriteContext) -> MacroStyle {
632633
/// ),
633634
/// }
634635
/// ```
636+
///
635637
/// will become
636-
/// ```rust
638+
///
639+
/// ```rust,ignore
637640
/// foo!{
638641
/// x,
639642
/// y,
@@ -864,7 +867,7 @@ impl MacroBranch {
864867
///
865868
/// # Expected syntax
866869
///
867-
/// ```
870+
/// ```ignore
868871
/// lazy_static! {
869872
/// [pub] static ref NAME_1: TYPE_1 = EXPR_1;
870873
/// [pub] static ref NAME_2: TYPE_2 = EXPR_2;

0 commit comments

Comments
 (0)