mirror of
https://github.com/rust-lang/rust.git
synced 2025-01-19 11:12:43 +00:00
Merge pull request #2529 from dlukes/feat/enable-doctests
Enable doctests
This commit is contained in:
commit
fcce0b932a
@ -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"
|
||||
|
@ -25,7 +25,8 @@
|
||||
//! 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;
|
||||
@ -33,8 +34,10 @@
|
||||
//! }.bar
|
||||
//! .baz();
|
||||
//! ```
|
||||
//!
|
||||
//! Visual:
|
||||
//! ```
|
||||
//!
|
||||
//! ```ignore
|
||||
//! let foo = {
|
||||
//! aaaa;
|
||||
//! bbb;
|
||||
@ -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
|
||||
|
@ -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,
|
||||
@ -632,8 +633,10 @@ fn macro_style(mac: &ast::Mac, context: &RewriteContext) -> MacroStyle {
|
||||
/// ),
|
||||
/// }
|
||||
/// ```
|
||||
///
|
||||
/// will become
|
||||
/// ```rust
|
||||
///
|
||||
/// ```rust,ignore
|
||||
/// foo!{
|
||||
/// x,
|
||||
/// y,
|
||||
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user