Skip to content

Commit 7d2d4ac

Browse files
committed
remove now unnecessary lang items
1 parent b9ecec0 commit 7d2d4ac

File tree

15 files changed

+33
-33
lines changed

15 files changed

+33
-33
lines changed

alloc/src/slice.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ mod hack {
237237
}
238238
}
239239

240-
#[lang = "slice_alloc"]
240+
#[cfg_attr(bootstrap, lang = "slice_alloc")]
241241
#[cfg(not(test))]
242242
impl<T> [T] {
243243
/// Sorts the slice.
@@ -667,7 +667,7 @@ impl<T> [T] {
667667
}
668668
}
669669

670-
#[lang = "slice_u8_alloc"]
670+
#[cfg_attr(bootstrap, lang = "slice_u8_alloc")]
671671
#[cfg(not(test))]
672672
impl [u8] {
673673
/// Returns a vector containing a copy of this slice where each byte

alloc/src/str.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ impl ToOwned for str {
235235
}
236236

237237
/// Methods for string slices.
238-
#[lang = "str_alloc"]
238+
#[cfg_attr(bootstrap, lang = "str_alloc")]
239239
#[cfg(not(test))]
240240
impl str {
241241
/// Converts a `Box<str>` into a `Box<[u8]>` without copying or allocating.

core/src/array/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -395,7 +395,7 @@ macro_rules! array_impl_default {
395395

396396
array_impl_default! {32, T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T T}
397397

398-
#[lang = "array"]
398+
#[cfg_attr(bootstrap, lang = "array")]
399399
impl<T, const N: usize> [T; N] {
400400
/// Returns an array of the same size as `self`, with function `f` applied to each element
401401
/// in order.

core/src/bool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use crate::marker::Destruct;
44

5-
#[lang = "bool"]
5+
#[cfg_attr(bootstrap, lang = "bool")]
66
impl bool {
77
/// Returns `Some(t)` if the `bool` is [`true`](../std/keyword.true.html),
88
/// or `None` otherwise.

core/src/char/methods.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use crate::unicode::{self, conversions};
77

88
use super::*;
99

10-
#[lang = "char"]
10+
#[cfg_attr(bootstrap, lang = "char")]
1111
impl char {
1212
/// The highest valid code point a `char` can have, `'\u{10FFFF}'`.
1313
///

core/src/num/f32.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ pub mod consts {
370370
pub const LN_10: f32 = 2.30258509299404568401799145468436421_f32;
371371
}
372372

373-
#[lang = "f32"]
373+
#[cfg_attr(bootstrap, lang = "f32")]
374374
#[cfg(not(test))]
375375
impl f32 {
376376
/// The radix or base of the internal representation of `f32`.

core/src/num/f64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ pub mod consts {
370370
pub const LN_10: f64 = 2.30258509299404568401799145468436421_f64;
371371
}
372372

373-
#[lang = "f64"]
373+
#[cfg_attr(bootstrap, lang = "f64")]
374374
#[cfg(not(test))]
375375
impl f64 {
376376
/// The radix or base of the internal representation of `f64`.

core/src/num/mod.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -193,34 +193,34 @@ macro_rules! widening_impl {
193193
};
194194
}
195195

196-
#[lang = "i8"]
196+
#[cfg_attr(bootstrap, lang = "i8")]
197197
impl i8 {
198198
int_impl! { i8, i8, u8, 8, 7, -128, 127, 2, "-0x7e", "0xa", "0x12", "0x12", "0x48",
199199
"[0x12]", "[0x12]", "", "" }
200200
}
201201

202-
#[lang = "i16"]
202+
#[cfg_attr(bootstrap, lang = "i16")]
203203
impl i16 {
204204
int_impl! { i16, i16, u16, 16, 15, -32768, 32767, 4, "-0x5ffd", "0x3a", "0x1234", "0x3412",
205205
"0x2c48", "[0x34, 0x12]", "[0x12, 0x34]", "", "" }
206206
}
207207

208-
#[lang = "i32"]
208+
#[cfg_attr(bootstrap, lang = "i32")]
209209
impl i32 {
210210
int_impl! { i32, i32, u32, 32, 31, -2147483648, 2147483647, 8, "0x10000b3", "0xb301",
211211
"0x12345678", "0x78563412", "0x1e6a2c48", "[0x78, 0x56, 0x34, 0x12]",
212212
"[0x12, 0x34, 0x56, 0x78]", "", "" }
213213
}
214214

215-
#[lang = "i64"]
215+
#[cfg_attr(bootstrap, lang = "i64")]
216216
impl i64 {
217217
int_impl! { i64, i64, u64, 64, 63, -9223372036854775808, 9223372036854775807, 12,
218218
"0xaa00000000006e1", "0x6e10aa", "0x1234567890123456", "0x5634129078563412",
219219
"0x6a2c48091e6a2c48", "[0x56, 0x34, 0x12, 0x90, 0x78, 0x56, 0x34, 0x12]",
220220
"[0x12, 0x34, 0x56, 0x78, 0x90, 0x12, 0x34, 0x56]", "", "" }
221221
}
222222

223-
#[lang = "i128"]
223+
#[cfg_attr(bootstrap, lang = "i128")]
224224
impl i128 {
225225
int_impl! { i128, i128, u128, 128, 127, -170141183460469231731687303715884105728,
226226
170141183460469231731687303715884105727, 16,
@@ -233,15 +233,15 @@ impl i128 {
233233
}
234234

235235
#[cfg(target_pointer_width = "16")]
236-
#[lang = "isize"]
236+
#[cfg_attr(bootstrap, lang = "isize")]
237237
impl isize {
238238
int_impl! { isize, i16, usize, 16, 15, -32768, 32767, 4, "-0x5ffd", "0x3a", "0x1234",
239239
"0x3412", "0x2c48", "[0x34, 0x12]", "[0x12, 0x34]",
240240
usize_isize_to_xe_bytes_doc!(), usize_isize_from_xe_bytes_doc!() }
241241
}
242242

243243
#[cfg(target_pointer_width = "32")]
244-
#[lang = "isize"]
244+
#[cfg_attr(bootstrap, lang = "isize")]
245245
impl isize {
246246
int_impl! { isize, i32, usize, 32, 31, -2147483648, 2147483647, 8, "0x10000b3", "0xb301",
247247
"0x12345678", "0x78563412", "0x1e6a2c48", "[0x78, 0x56, 0x34, 0x12]",
@@ -250,7 +250,7 @@ impl isize {
250250
}
251251

252252
#[cfg(target_pointer_width = "64")]
253-
#[lang = "isize"]
253+
#[cfg_attr(bootstrap, lang = "isize")]
254254
impl isize {
255255
int_impl! { isize, i64, usize, 64, 63, -9223372036854775808, 9223372036854775807,
256256
12, "0xaa00000000006e1", "0x6e10aa", "0x1234567890123456", "0x5634129078563412",
@@ -262,7 +262,7 @@ impl isize {
262262
/// If 6th bit set ascii is upper case.
263263
const ASCII_CASE_MASK: u8 = 0b0010_0000;
264264

265-
#[lang = "u8"]
265+
#[cfg_attr(bootstrap, lang = "u8")]
266266
impl u8 {
267267
uint_impl! { u8, u8, i8, NonZeroU8, 8, 255, 2, "0x82", "0xa", "0x12", "0x12", "0x48", "[0x12]",
268268
"[0x12]", "", "" }
@@ -816,7 +816,7 @@ impl u8 {
816816
}
817817
}
818818

819-
#[lang = "u16"]
819+
#[cfg_attr(bootstrap, lang = "u16")]
820820
impl u16 {
821821
uint_impl! { u16, u16, i16, NonZeroU16, 16, 65535, 4, "0xa003", "0x3a", "0x1234", "0x3412", "0x2c48",
822822
"[0x34, 0x12]", "[0x12, 0x34]", "", "" }
@@ -848,14 +848,14 @@ impl u16 {
848848
}
849849
}
850850

851-
#[lang = "u32"]
851+
#[cfg_attr(bootstrap, lang = "u32")]
852852
impl u32 {
853853
uint_impl! { u32, u32, i32, NonZeroU32, 32, 4294967295, 8, "0x10000b3", "0xb301", "0x12345678",
854854
"0x78563412", "0x1e6a2c48", "[0x78, 0x56, 0x34, 0x12]", "[0x12, 0x34, 0x56, 0x78]", "", "" }
855855
widening_impl! { u32, u64, 32, unsigned }
856856
}
857857

858-
#[lang = "u64"]
858+
#[cfg_attr(bootstrap, lang = "u64")]
859859
impl u64 {
860860
uint_impl! { u64, u64, i64, NonZeroU64, 64, 18446744073709551615, 12, "0xaa00000000006e1", "0x6e10aa",
861861
"0x1234567890123456", "0x5634129078563412", "0x6a2c48091e6a2c48",
@@ -865,7 +865,7 @@ impl u64 {
865865
widening_impl! { u64, u128, 64, unsigned }
866866
}
867867

868-
#[lang = "u128"]
868+
#[cfg_attr(bootstrap, lang = "u128")]
869869
impl u128 {
870870
uint_impl! { u128, u128, i128, NonZeroU128, 128, 340282366920938463463374607431768211455, 16,
871871
"0x13f40000000000000000000000004f76", "0x4f7613f4", "0x12345678901234567890123456789012",
@@ -878,15 +878,15 @@ impl u128 {
878878
}
879879

880880
#[cfg(target_pointer_width = "16")]
881-
#[lang = "usize"]
881+
#[cfg_attr(bootstrap, lang = "usize")]
882882
impl usize {
883883
uint_impl! { usize, u16, isize, NonZeroUsize, 16, 65535, 4, "0xa003", "0x3a", "0x1234", "0x3412", "0x2c48",
884884
"[0x34, 0x12]", "[0x12, 0x34]",
885885
usize_isize_to_xe_bytes_doc!(), usize_isize_from_xe_bytes_doc!() }
886886
widening_impl! { usize, u32, 16, unsigned }
887887
}
888888
#[cfg(target_pointer_width = "32")]
889-
#[lang = "usize"]
889+
#[cfg_attr(bootstrap, lang = "usize")]
890890
impl usize {
891891
uint_impl! { usize, u32, isize, NonZeroUsize, 32, 4294967295, 8, "0x10000b3", "0xb301", "0x12345678",
892892
"0x78563412", "0x1e6a2c48", "[0x78, 0x56, 0x34, 0x12]", "[0x12, 0x34, 0x56, 0x78]",
@@ -895,7 +895,7 @@ impl usize {
895895
}
896896

897897
#[cfg(target_pointer_width = "64")]
898-
#[lang = "usize"]
898+
#[cfg_attr(bootstrap, lang = "usize")]
899899
impl usize {
900900
uint_impl! { usize, u64, isize, NonZeroUsize, 64, 18446744073709551615, 12, "0xaa00000000006e1", "0x6e10aa",
901901
"0x1234567890123456", "0x5634129078563412", "0x6a2c48091e6a2c48",

core/src/ptr/const_ptr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use crate::intrinsics;
44
use crate::mem;
55
use crate::slice::{self, SliceIndex};
66

7-
#[lang = "const_ptr"]
7+
#[cfg_attr(bootstrap, lang = "const_ptr")]
88
impl<T: ?Sized> *const T {
99
/// Returns `true` if the pointer is null.
1010
///
@@ -969,7 +969,7 @@ impl<T: ?Sized> *const T {
969969
}
970970
}
971971

972-
#[lang = "const_slice_ptr"]
972+
#[cfg_attr(bootstrap, lang = "const_slice_ptr")]
973973
impl<T> *const [T] {
974974
/// Returns the length of a raw slice.
975975
///

core/src/ptr/mut_ptr.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use crate::cmp::Ordering::{self, Equal, Greater, Less};
33
use crate::intrinsics;
44
use crate::slice::{self, SliceIndex};
55

6-
#[lang = "mut_ptr"]
6+
#[cfg_attr(bootstrap, lang = "mut_ptr")]
77
impl<T: ?Sized> *mut T {
88
/// Returns `true` if the pointer is null.
99
///
@@ -1240,7 +1240,7 @@ impl<T: ?Sized> *mut T {
12401240
}
12411241
}
12421242

1243-
#[lang = "mut_slice_ptr"]
1243+
#[cfg_attr(bootstrap, lang = "mut_slice_ptr")]
12441244
impl<T> *mut [T] {
12451245
/// Returns the length of a raw slice.
12461246
///

0 commit comments

Comments
 (0)