Skip to content

Commit 4007d52

Browse files
committed
Import fixes.
1 parent bcc7cf3 commit 4007d52

File tree

10 files changed

+30
-32
lines changed

10 files changed

+30
-32
lines changed

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
use crate::cmp;
1+
use core::cmp;
22
use crate::fmt;
33
use crate::io::{self, BufRead, Initializer, IoSliceMut, Read, Seek, SeekFrom, DEFAULT_BUF_SIZE};
4+
use crate::{boxed::Box, vec::Vec};
45

56
/// The `BufReader<R>` struct adds buffering to any reader.
67
///

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use crate::fmt;
22
use crate::io::{
33
self, Error, ErrorKind, IntoInnerError, IoSlice, Seek, SeekFrom, Write, DEFAULT_BUF_SIZE,
44
};
5+
use crate::vec::Vec;
56

67
/// Wraps a writer and buffers its output.
78
///

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use crate::io::{self, BufWriter, IoSlice, Write};
2-
use crate::memchr;
2+
use core::slice::memchr;
33

44
/// Private helper struct for implementing the line-buffered writing logic.
55
/// This shim temporarily wraps a BufWriter, and uses its internals to

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ mod linewritershim;
88
#[cfg(test)]
99
mod tests;
1010

11-
use crate::error;
1211
use crate::fmt;
1312
use crate::io::Error;
1413

library/alloc/src/io/cursor.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ mod tests;
33

44
use crate::io::prelude::*;
55

6-
use crate::cmp;
6+
use core::cmp;
77
use crate::io::{self, Error, ErrorKind, Initializer, IoSlice, IoSliceMut, SeekFrom};
88

99
use core::convert::TryInto;
10+
use crate::{vec::Vec, boxed::Box};
1011

1112
/// A `Cursor` wraps an in-memory buffer and provides it with a
1213
/// [`Seek`] implementation.

library/alloc/src/io/error.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
#[cfg(test)]
22
mod tests;
33

4-
use crate::convert::From;
5-
use crate::error;
6-
use crate::fmt;
7-
use crate::result;
8-
use crate::sys;
4+
use core::convert::From;
5+
use core::fmt;
6+
use core::result;
7+
use crate::{boxed::Box, string::String};
98

109
/// A specialized [`Result`] type for I/O operations.
1110
///

library/alloc/src/io/impls.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
#[cfg(test)]
22
mod tests;
33

4-
use crate::cmp;
5-
use crate::fmt;
4+
use core::cmp;
5+
use core::fmt;
66
use crate::io::{
77
self, BufRead, Error, ErrorKind, Initializer, IoSlice, IoSliceMut, Read, Seek, SeekFrom, Write,
88
};
9-
use crate::mem;
9+
use core::mem;
10+
use crate::{vec::Vec, boxed::Box, string::String};
1011

1112
// =============================================================================
1213
// Forwarding implementations

library/alloc/src/io/mod.rs

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -249,17 +249,19 @@
249249
250250
#![stable(feature = "rust1", since = "1.0.0")]
251251

252+
use core::{marker::PhantomData};
253+
use core::ctypes::{c_void, iovec, iov_len_t};
254+
252255
#[cfg(test)]
253256
mod tests;
254257

255-
use crate::cmp;
256-
use crate::fmt;
257-
use crate::memchr;
258-
use crate::ops::{Deref, DerefMut};
259-
use crate::ptr;
260-
use crate::slice;
261-
use crate::str;
262-
use crate::sys;
258+
use core::cmp;
259+
use core::fmt;
260+
use core::slice::memchr;
261+
use core::ops::{Deref, DerefMut};
262+
use core::ptr;
263+
use core::slice;
264+
use core::str;
263265

264266
#[stable(feature = "rust1", since = "1.0.0")]
265267
pub use self::buffered::IntoInnerError;
@@ -270,24 +272,15 @@ pub use self::cursor::Cursor;
270272
#[stable(feature = "rust1", since = "1.0.0")]
271273
pub use self::error::{Error, ErrorKind, Result};
272274
#[stable(feature = "rust1", since = "1.0.0")]
273-
pub use self::stdio::{stderr, stdin, stdout, Stderr, Stdin, Stdout};
274-
#[stable(feature = "rust1", since = "1.0.0")]
275-
pub use self::stdio::{StderrLock, StdinLock, StdoutLock};
276-
#[unstable(feature = "print_internals", issue = "none")]
277-
pub use self::stdio::{_eprint, _print};
278-
#[unstable(feature = "libstd_io_internals", issue = "42788")]
279-
#[doc(no_inline, hidden)]
280-
pub use self::stdio::{set_panic, set_print};
281-
#[stable(feature = "rust1", since = "1.0.0")]
282275
pub use self::util::{copy, empty, repeat, sink, Empty, Repeat, Sink};
283276

284277
mod buffered;
285278
mod cursor;
286279
mod error;
287280
mod impls;
288281
pub mod prelude;
289-
mod stdio;
290282
mod util;
283+
use crate::{vec::Vec, string::String};
291284

292285
const DEFAULT_BUF_SIZE: usize = crate::sys_common::io::DEFAULT_BUF_SIZE;
293286

library/alloc/src/io/util.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
#[cfg(test)]
44
mod tests;
55

6-
use crate::fmt;
6+
use core::fmt;
77
use crate::io::{self, BufRead, ErrorKind, Initializer, IoSlice, IoSliceMut, Read, Write};
8-
use crate::mem::MaybeUninit;
8+
use core::mem::MaybeUninit;
99

1010
/// Copies the entire contents of a reader into a writer.
1111
///

library/alloc/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,8 @@
114114
#![feature(or_patterns)]
115115
#![feature(pattern)]
116116
#![feature(ptr_internals)]
117+
#![feature(slice_internals)]
118+
#![feature(doc_spotlight)]
117119
#![feature(raw_ref_op)]
118120
#![feature(rustc_attrs)]
119121
#![feature(receiver_trait)]
@@ -180,6 +182,7 @@ pub mod task;
180182
#[cfg(test)]
181183
mod tests;
182184
pub mod vec;
185+
pub mod io;
183186

184187
#[cfg(not(test))]
185188
mod std {

0 commit comments

Comments
 (0)