Skip to content

Commit 8be944f

Browse files
Rollup merge of rust-lang#160472 - bushrat011899:io_documentation_v2, r=nia-e
Minor fixes to `core::io` & `alloc::io` Documentation ACP: rust-lang/libs-team#755 Tracking issue: rust-lang#154046 Supersedes: rust-lang#160413 ## Description Minor tweaks to the documentation in `core::io` and `alloc::io` after proof-reading. In rust-lang#160413 I attempted to rewrite all example snippets to be `no_std`/`no_alloc` compatible where relevant. I've closed that in favour of smaller adjustments, as there are many examples of `std`-requiring code snippets in `core` documentation (e.g., [`core::borrow`](https://doc.rust-lang.org/stable/core/borrow/trait.Borrow.html)). --- ## Notes * No AI tooling of any kind was used during the creation of this PR.
2 parents e7e5ffb + ad73173 commit 8be944f

4 files changed

Lines changed: 7 additions & 2 deletions

File tree

library/alloc/src/io/buffered/mod.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ impl<W> IntoInnerError<W> {
132132
/// obtain ownership of the underlying error.
133133
///
134134
/// # Example
135+
///
135136
/// ```
136137
/// use std::io::{BufWriter, ErrorKind, Write};
137138
///
@@ -154,6 +155,7 @@ impl<W> IntoInnerError<W> {
154155
/// advanced error recovery.
155156
///
156157
/// # Example
158+
///
157159
/// ```
158160
/// use std::io::{BufWriter, ErrorKind, Write};
159161
///

library/alloc/src/io/prelude.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
//! by adding a glob import to the top of I/O heavy modules:
55
//!
66
//! ```
7+
//! # #![feature(alloc_io)]
78
//! # #![allow(unused_imports)]
8-
//! use std::io::prelude::*;
9+
//! use alloc::io::prelude::*;
910
//! ```
1011
1112
#[stable(feature = "rust1", since = "1.0.0")]

library/core/src/io/error.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,6 +1115,7 @@ impl fmt::Display for ErrorKind {
11151115
/// This is similar to `impl Display for Error`, but doesn't require first converting to Error.
11161116
///
11171117
/// # Examples
1118+
///
11181119
/// ```
11191120
/// use core::io::ErrorKind;
11201121
/// assert_eq!("entity not found", ErrorKind::NotFound.to_string());

library/core/src/io/prelude.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
//! by adding a glob import to the top of I/O heavy modules:
55
//!
66
//! ```
7+
//! # #![feature(core_io)]
78
//! # #![allow(unused_imports)]
8-
//! use std::io::prelude::*;
9+
//! use core::io::prelude::*;
910
//! ```
1011
1112
#[stable(feature = "rust1", since = "1.0.0")]

0 commit comments

Comments
 (0)