Skip to content

Commit

Permalink
Fix annotation of code blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
GKFX committed Feb 1, 2022
1 parent 5357ec1 commit d372baf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 3 additions & 2 deletions library/core/src/primitive_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ mod prim_bool {}
mod prim_never {}

#[doc(primitive = "char")]
#[allow(rustdoc::invalid_rust_codeblocks)]
/// A character type.
///
/// The `char` type represents a single character. More specifically, since
Expand All @@ -295,7 +296,7 @@ mod prim_never {}
/// No `char` may be constructed, whether as a literal or at runtime, that is not a
/// Unicode scalar value:
///
/// ```text
/// ```compile_fail
/// // Each of these is a compiler error
/// ['\u{D800}', '\u{DFFF}', '\u{110000}'];
/// ```
Expand All @@ -305,7 +306,7 @@ mod prim_never {}
/// char::from_u32(0xDE01).unwrap();
/// ```
///
/// ```
/// ```no_run
/// // Undefined behaviour
/// unsafe { char::from_u32_unchecked(0x110000) };
/// ```
Expand Down
5 changes: 3 additions & 2 deletions library/std/src/primitive_docs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ mod prim_bool {}
mod prim_never {}

#[doc(primitive = "char")]
#[allow(rustdoc::invalid_rust_codeblocks)]
/// A character type.
///
/// The `char` type represents a single character. More specifically, since
Expand All @@ -295,7 +296,7 @@ mod prim_never {}
/// No `char` may be constructed, whether as a literal or at runtime, that is not a
/// Unicode scalar value:
///
/// ```text
/// ```compile_fail
/// // Each of these is a compiler error
/// ['\u{D800}', '\u{DFFF}', '\u{110000}'];
/// ```
Expand All @@ -305,7 +306,7 @@ mod prim_never {}
/// char::from_u32(0xDE01).unwrap();
/// ```
///
/// ```
/// ```no_run
/// // Undefined behaviour
/// unsafe { char::from_u32_unchecked(0x110000) };
/// ```
Expand Down

0 comments on commit d372baf

Please sign in to comment.