Skip to content

Commit 5d20ff4

Browse files
committed
Auto merge of #58702 - taiki-e:libcore-2018, r=Centril
libcore => 2018 Transitions `libcore` to Rust 2018; cc #58099 r? @Centril
2 parents d6f513e + e28bce7 commit 5d20ff4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

80 files changed

+343
-333
lines changed

src/libcore/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ name = "core"
44
version = "0.0.0"
55
autotests = false
66
autobenches = false
7+
edition = "2018"
78

89
[lib]
910
name = "core"

src/libcore/alloc.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@
22
33
#![stable(feature = "alloc_module", since = "1.28.0")]
44

5-
use cmp;
6-
use fmt;
7-
use mem;
8-
use usize;
9-
use ptr::{self, NonNull};
10-
use num::NonZeroUsize;
5+
use crate::cmp;
6+
use crate::fmt;
7+
use crate::mem;
8+
use crate::usize;
9+
use crate::ptr::{self, NonNull};
10+
use crate::num::NonZeroUsize;
1111

1212
/// Represents the combination of a starting address and
1313
/// a total capacity of the returned block.

src/libcore/any.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,8 @@
6161
6262
#![stable(feature = "rust1", since = "1.0.0")]
6363

64-
use fmt;
65-
use intrinsics;
64+
use crate::fmt;
65+
use crate::intrinsics;
6666

6767
///////////////////////////////////////////////////////////////////////////////
6868
// Any trait

src/libcore/array.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@
99
integer constants",
1010
issue = "27778")]
1111

12-
use borrow::{Borrow, BorrowMut};
13-
use cmp::Ordering;
14-
use convert::TryFrom;
15-
use fmt;
16-
use hash::{Hash, self};
17-
use marker::Unsize;
18-
use slice::{Iter, IterMut};
12+
use crate::borrow::{Borrow, BorrowMut};
13+
use crate::cmp::Ordering;
14+
use crate::convert::TryFrom;
15+
use crate::fmt;
16+
use crate::hash::{Hash, self};
17+
use crate::marker::Unsize;
18+
use crate::slice::{Iter, IterMut};
1919

2020
/// Utility trait implemented only on arrays of fixed size
2121
///

src/libcore/ascii.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
1212
#![stable(feature = "core_ascii", since = "1.26.0")]
1313

14-
use fmt;
15-
use ops::Range;
16-
use iter::FusedIterator;
14+
use crate::fmt;
15+
use crate::ops::Range;
16+
use crate::iter::FusedIterator;
1717

1818
/// An iterator over the escaped version of a byte.
1919
///

src/libcore/benches/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#![feature(flt2dec)]
22
#![feature(test)]
33

4-
extern crate core;
54
extern crate test;
65

76
mod any;

src/libcore/cell.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,12 @@
186186
187187
#![stable(feature = "rust1", since = "1.0.0")]
188188

189-
use cmp::Ordering;
190-
use fmt::{self, Debug, Display};
191-
use marker::Unsize;
192-
use mem;
193-
use ops::{Deref, DerefMut, CoerceUnsized};
194-
use ptr;
189+
use crate::cmp::Ordering;
190+
use crate::fmt::{self, Debug, Display};
191+
use crate::marker::Unsize;
192+
use crate::mem;
193+
use crate::ops::{Deref, DerefMut, CoerceUnsized};
194+
use crate::ptr;
195195

196196
/// A mutable memory location.
197197
///

src/libcore/char/convert.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
//! Character conversions.
22
3-
use convert::TryFrom;
4-
use fmt;
5-
use mem::transmute;
6-
use str::FromStr;
3+
use crate::convert::TryFrom;
4+
use crate::fmt;
5+
use crate::mem::transmute;
6+
use crate::str::FromStr;
7+
78
use super::MAX;
89

910
/// Converts a `u32` to a `char`.

src/libcore/char/decode.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
//! UTF-8 and UTF-16 decoding iterators
22
3-
use fmt;
3+
use crate::fmt;
4+
45
use super::from_u32_unchecked;
56

67
/// An iterator that decodes UTF-16 encoded code points from an iterator of `u16`s.

src/libcore/char/methods.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
//! impl char {}
22
3-
use slice;
4-
use str::from_utf8_unchecked_mut;
3+
use crate::slice;
4+
use crate::str::from_utf8_unchecked_mut;
5+
use crate::unicode::printable::is_printable;
6+
use crate::unicode::tables::{conversions, derived_property, general_category, property};
7+
58
use super::*;
6-
use unicode::printable::is_printable;
7-
use unicode::tables::{conversions, derived_property, general_category, property};
89

910
#[lang = "char"]
1011
impl char {

0 commit comments

Comments
 (0)