diff options
| author | George Bateman <george.bateman16@gmail.com> | 2022-02-01 21:44:53 +0000 |
|---|---|---|
| committer | George Bateman <george.bateman16@gmail.com> | 2022-02-01 21:44:53 +0000 |
| commit | d372baf3f9a6401fdd4f74e3385ba553667b287d (patch) | |
| tree | 5362afbab16d62cf3440a1d119d952fd68b62261 | |
| parent | 5357ec1473c8a44dd8e324b2c664951bf4306b5a (diff) | |
| download | rust-d372baf3f9a6401fdd4f74e3385ba553667b287d.tar.gz rust-d372baf3f9a6401fdd4f74e3385ba553667b287d.zip | |
Fix annotation of code blocks
| -rw-r--r-- | library/core/src/primitive_docs.rs | 5 | ||||
| -rw-r--r-- | library/std/src/primitive_docs.rs | 5 |
2 files changed, 6 insertions, 4 deletions
diff --git a/library/core/src/primitive_docs.rs b/library/core/src/primitive_docs.rs index b9d71178921..ebb1d8971b9 100644 --- a/library/core/src/primitive_docs.rs +++ b/library/core/src/primitive_docs.rs @@ -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 @@ -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}']; /// ``` @@ -305,7 +306,7 @@ mod prim_never {} /// char::from_u32(0xDE01).unwrap(); /// ``` /// -/// ``` +/// ```no_run /// // Undefined behaviour /// unsafe { char::from_u32_unchecked(0x110000) }; /// ``` diff --git a/library/std/src/primitive_docs.rs b/library/std/src/primitive_docs.rs index b9d71178921..ebb1d8971b9 100644 --- a/library/std/src/primitive_docs.rs +++ b/library/std/src/primitive_docs.rs @@ -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 @@ -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}']; /// ``` @@ -305,7 +306,7 @@ mod prim_never {} /// char::from_u32(0xDE01).unwrap(); /// ``` /// -/// ``` +/// ```no_run /// // Undefined behaviour /// unsafe { char::from_u32_unchecked(0x110000) }; /// ``` |
