mirror of
https://github.com/rust-lang/rust.git
synced 2026-04-27 18:57:42 +03:00
Skip formatting for some compiler documentation code
These examples feature Rust code that's presented primarily to illustrate how its compilation would be handled, and these examples are formatted to highlight those aspects in ways that rustfmt wouldn't preserve. Turn formatting off in those examples. (Doc code isn't formatted yet, but this will make it easier to enable doc code formatting in the future.)
This commit is contained in:
@@ -417,7 +417,7 @@ pub(crate) fn new(
|
||||
/// minimum values.
|
||||
///
|
||||
/// For example:
|
||||
/// ```
|
||||
/// ```ignore (illustrative)
|
||||
/// fn foo<'a, 'b>( /* ... */ ) where 'a: 'b { /* ... */ }
|
||||
/// ```
|
||||
/// would initialize two variables like so:
|
||||
|
||||
@@ -356,7 +356,7 @@ pub fn has_codegen_attrs(self) -> bool {
|
||||
/// For example, everything prefixed with `/* Res */` in this example has
|
||||
/// an associated `Res`:
|
||||
///
|
||||
/// ```
|
||||
/// ```ignore (illustrative)
|
||||
/// fn str_to_string(s: & /* Res */ str) -> /* Res */ String {
|
||||
/// /* Res */ String::from(/* Res */ s)
|
||||
/// }
|
||||
|
||||
@@ -108,6 +108,7 @@ fn new(
|
||||
///
|
||||
/// ```rust
|
||||
/// struct S;
|
||||
/// #[rustfmt::skip]
|
||||
/// fn foo(pred: bool) { // maybe-init:
|
||||
/// // {}
|
||||
/// let a = S; let mut b = S; let c; let d; // {a, b}
|
||||
@@ -197,6 +198,7 @@ fn move_data(&self) -> &MoveData<'tcx> {
|
||||
///
|
||||
/// ```rust
|
||||
/// struct S;
|
||||
/// #[rustfmt::skip]
|
||||
/// fn foo(pred: bool) { // maybe-uninit:
|
||||
/// // {a, b, c, d}
|
||||
/// let a = S; let mut b = S; let c; let d; // { c, d}
|
||||
@@ -289,6 +291,7 @@ fn move_data(&self) -> &MoveData<'tcx> {
|
||||
///
|
||||
/// ```rust
|
||||
/// struct S;
|
||||
/// #[rustfmt::skip]
|
||||
/// fn foo(pred: bool) { // ever-init:
|
||||
/// // { }
|
||||
/// let a = S; let mut b = S; let c; let d; // {a, b }
|
||||
|
||||
Reference in New Issue
Block a user