forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
do not format a code block in documentation if it is annotated with i…
…gnore or text (rust-lang#3058)
- Loading branch information
1 parent
90692a5
commit 2bcc3a9
Showing
5 changed files
with
161 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
// rustfmt-wrap_comments: true | ||
|
||
/// Vestibulum elit nibh, rhoncus non, euismod sit amet, pretium eu, enim. Nunc commodo ultricies dui. | ||
/// | ||
/// Should not format with text attribute | ||
/// ```text | ||
/// .--------------. | ||
/// | v | ||
/// Park <- Idle -> Poll -> Probe -> Download -> Install -> Reboot | ||
/// ^ ^ ' ' ' | ||
/// ' ' ' ' ' | ||
/// ' `--------' ' ' | ||
/// `---------------' ' ' | ||
/// `--------------------------' ' | ||
/// `-------------------------------------' | ||
/// ``` | ||
/// | ||
/// Should not format with ignore attribute | ||
/// ```ignore | ||
/// .--------------. | ||
/// | v | ||
/// Park <- Idle -> Poll -> Probe -> Download -> Install -> Reboot | ||
/// ^ ^ ' ' ' | ||
/// ' ' ' ' ' | ||
/// ' `--------' ' ' | ||
/// `---------------' ' ' | ||
/// `--------------------------' ' | ||
/// `-------------------------------------' | ||
/// ``` | ||
/// | ||
/// Should format with rust attribute | ||
/// ```rust | ||
/// let x = | ||
/// 42; | ||
/// ``` | ||
/// | ||
/// Should format with no attribute as it defaults to rust | ||
/// ``` | ||
/// let x = | ||
/// 42; | ||
/// ``` | ||
fn func() {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// rustfmt-wrap_comments: true | ||
|
||
/// Simple block | ||
/// | ||
/// ```text | ||
/// ` | ||
/// ``` | ||
fn main() { | ||
println!("Hello, world!"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
// rustfmt-wrap_comments: true | ||
|
||
/// Simple block | ||
/// | ||
/// ``` | ||
/// ``` | ||
/// | ||
/// ```no_run | ||
/// ``` | ||
/// | ||
/// ```should_panic | ||
/// ``` | ||
/// | ||
/// ```compile_fail | ||
/// ``` | ||
fn main() { | ||
println!("Hello, world!"); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// rustfmt-wrap_comments: true | ||
|
||
/// Vestibulum elit nibh, rhoncus non, euismod sit amet, pretium eu, enim. Nunc | ||
/// commodo ultricies dui. | ||
/// | ||
/// Should not format with text attribute | ||
/// ```text | ||
/// .--------------. | ||
/// | v | ||
/// Park <- Idle -> Poll -> Probe -> Download -> Install -> Reboot | ||
/// ^ ^ ' ' ' | ||
/// ' ' ' ' ' | ||
/// ' `--------' ' ' | ||
/// `---------------' ' ' | ||
/// `--------------------------' ' | ||
/// `-------------------------------------' | ||
/// ``` | ||
/// | ||
/// Should not format with ignore attribute | ||
/// ```ignore | ||
/// .--------------. | ||
/// | v | ||
/// Park <- Idle -> Poll -> Probe -> Download -> Install -> Reboot | ||
/// ^ ^ ' ' ' | ||
/// ' ' ' ' ' | ||
/// ' `--------' ' ' | ||
/// `---------------' ' ' | ||
/// `--------------------------' ' | ||
/// `-------------------------------------' | ||
/// ``` | ||
/// | ||
/// Should format with rust attribute | ||
/// ```rust | ||
/// let x = 42; | ||
/// ``` | ||
/// | ||
/// Should format with no attribute as it defaults to rust | ||
/// ``` | ||
/// let x = 42; | ||
/// ``` | ||
fn func() {} |