Skip to content

Commit d372baf

Browse files
committed
Fix annotation of code blocks
1 parent 5357ec1 commit d372baf

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

library/core/src/primitive_docs.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ mod prim_bool {}
275275
mod prim_never {}
276276

277277
#[doc(primitive = "char")]
278+
#[allow(rustdoc::invalid_rust_codeblocks)]
278279
/// A character type.
279280
///
280281
/// The `char` type represents a single character. More specifically, since
@@ -295,7 +296,7 @@ mod prim_never {}
295296
/// No `char` may be constructed, whether as a literal or at runtime, that is not a
296297
/// Unicode scalar value:
297298
///
298-
/// ```text
299+
/// ```compile_fail
299300
/// // Each of these is a compiler error
300301
/// ['\u{D800}', '\u{DFFF}', '\u{110000}'];
301302
/// ```
@@ -305,7 +306,7 @@ mod prim_never {}
305306
/// char::from_u32(0xDE01).unwrap();
306307
/// ```
307308
///
308-
/// ```
309+
/// ```no_run
309310
/// // Undefined behaviour
310311
/// unsafe { char::from_u32_unchecked(0x110000) };
311312
/// ```

library/std/src/primitive_docs.rs

+3-2
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@ mod prim_bool {}
275275
mod prim_never {}
276276

277277
#[doc(primitive = "char")]
278+
#[allow(rustdoc::invalid_rust_codeblocks)]
278279
/// A character type.
279280
///
280281
/// The `char` type represents a single character. More specifically, since
@@ -295,7 +296,7 @@ mod prim_never {}
295296
/// No `char` may be constructed, whether as a literal or at runtime, that is not a
296297
/// Unicode scalar value:
297298
///
298-
/// ```text
299+
/// ```compile_fail
299300
/// // Each of these is a compiler error
300301
/// ['\u{D800}', '\u{DFFF}', '\u{110000}'];
301302
/// ```
@@ -305,7 +306,7 @@ mod prim_never {}
305306
/// char::from_u32(0xDE01).unwrap();
306307
/// ```
307308
///
308-
/// ```
309+
/// ```no_run
309310
/// // Undefined behaviour
310311
/// unsafe { char::from_u32_unchecked(0x110000) };
311312
/// ```

0 commit comments

Comments
 (0)