Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable doctests #2529

Merged
merged 1 commit into from
Mar 10, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ license = "Apache-2.0/MIT"
build = "build.rs"
categories = ["development-tools"]

[lib]
doctest = false

[[bin]]
name = "rustfmt"
path = "src/bin/main.rs"
Expand Down
14 changes: 10 additions & 4 deletions src/chains.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,19 @@
//! E.g., `let foo = { aaaa; bbb; ccc }.bar.baz();`, we would layout for the
//! following values of `chain_indent`:
//! Block:
//! ```
//!
//! ```ignore
//! let foo = {
//! aaaa;
//! bbb;
//! ccc
//! }.bar
//! .baz();
//! ```
//!
//! Visual:
//! ```
//!
//! ```ignore
//! let foo = {
//! aaaa;
//! bbb;
Expand All @@ -47,13 +50,16 @@
//! If the first item in the chain is a block expression, we align the dots with
//! the braces.
//! Block:
//! ```
//!
//! ```ignore
//! let a = foo.bar
//! .baz()
//! .qux
//! ```
//!
//! Visual:
//! ```
//!
//! ```ignore
//! let a = foo.bar
//! .baz()
//! .qux
Expand Down
9 changes: 6 additions & 3 deletions src/macros.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,7 +621,8 @@ fn macro_style(mac: &ast::Mac, context: &RewriteContext) -> MacroStyle {

/// Indent each line according to the specified `indent`.
/// e.g.
/// ```rust
///
/// ```rust,ignore
/// foo!{
/// x,
/// y,
Expand All @@ -632,8 +633,10 @@ fn macro_style(mac: &ast::Mac, context: &RewriteContext) -> MacroStyle {
/// ),
/// }
/// ```
///
/// will become
/// ```rust
///
/// ```rust,ignore
/// foo!{
/// x,
/// y,
Expand Down Expand Up @@ -864,7 +867,7 @@ impl MacroBranch {
///
/// # Expected syntax
///
/// ```
/// ```ignore
/// lazy_static! {
/// [pub] static ref NAME_1: TYPE_1 = EXPR_1;
/// [pub] static ref NAME_2: TYPE_2 = EXPR_2;
Expand Down