Closed
Description
I tried this code:
/// You are supposed to call it like this
///
/// # Example
///
/// ```
/// let example = Example::new()
/// .first("hello")
#[cfg_attr(not(feature = "one"), doc = " .second(\"hello\")\n")]
/// .third("hello")
/// .build();
/// ```
pub struct Example {}
fn main() {}
with cargo doc --open
I expected to see this:
Instead, this happened:
Meta
rustc --version --verbose
:
rustc 1.43.0-nightly (564758c4c 2020-03-08)
binary: rustc
commit-hash: 564758c4c329e89722454dd2fbb35f1ac0b8b47c
commit-date: 2020-03-08
host: x86_64-unknown-linux-gnu
release: 1.43.0-nightly
LLVM version: 9.0
running cargo expand
over the code gives me
#![feature(prelude_import)]
#[prelude_import]
use std::prelude::v1::*;
#[macro_use]
extern crate std;
/// You are supposed to call it like this
///
/// # Example
///
/// ```
/// let example = Example::new()
/// .first("hello")
/// .second("hello")
/// .third("hello")
/// .build();
/// ```
pub struct Example {}