Skip to content

Commit 4c32225

Browse files
committed
---
yaml --- r: 234792 b: refs/heads/tmp c: 5120f4a h: refs/heads/master v: v3
1 parent 98acf06 commit 4c32225

File tree

6 files changed

+139
-6
lines changed

6 files changed

+139
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2626
refs/heads/beta: d2e13e822a73e0ea46ae9e21afdd3155fc997f6d
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28-
refs/heads/tmp: 78eee36e5bb74f8e969d569a3a9372e47f9e5629
28+
refs/heads/tmp: 5120f4a3f95f6695c711839b3cc8551303bee0e3
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: ab792abf1fcc28afbd315426213f6428da25c085
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828

branches/tmp/src/doc/complement-project-faq.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Existing languages at this level of abstraction and efficiency are unsatisfactor
2222

2323
# Is any part of this thing production-ready?
2424

25-
No. Feel free to play around, but don't expect completeness or stability yet. Expect incompleteness and breakage.
25+
Yes!
2626

2727
# Is this a completely Mozilla-planned and orchestrated thing?
2828

branches/tmp/src/doc/trpl/error-handling.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1223,7 +1223,7 @@ let err2: Box<Error> = From::from(parse_err);
12231223

12241224
There is a really important pattern to recognize here. Both `err1` and `err2`
12251225
have the *same type*. This is because they are existentially quantified types,
1226-
or trait objects. In particularly, their underlying type is *erased* from the
1226+
or trait objects. In particular, their underlying type is *erased* from the
12271227
compiler's knowledge, so it truly sees `err1` and `err2` as exactly the same.
12281228
Additionally, we constructed `err1` and `err2` using precisely the same
12291229
function call: `From::from`. This is because `From::from` is overloaded on both

branches/tmp/src/libcollections/vec.rs

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ use alloc::heap::EMPTY;
6565
use core::cmp::Ordering;
6666
use core::fmt;
6767
use core::hash::{self, Hash};
68-
use core::intrinsics::{arith_offset, assume, drop_in_place};
68+
use core::intrinsics::{arith_offset, assume, drop_in_place, needs_drop};
6969
use core::iter::FromIterator;
7070
use core::mem;
7171
use core::ops::{Index, IndexMut, Deref};
@@ -1322,8 +1322,14 @@ impl<T> Drop for Vec<T> {
13221322
// OK because exactly when this stops being a valid assumption, we
13231323
// don't need unsafe_no_drop_flag shenanigans anymore.
13241324
if self.buf.unsafe_no_drop_flag_needs_drop() {
1325-
for x in self.iter_mut() {
1326-
unsafe { drop_in_place(x); }
1325+
unsafe {
1326+
// The branch on needs_drop() is an -O1 performance optimization.
1327+
// Without the branch, dropping Vec<u8> takes linear time.
1328+
if needs_drop::<T>() {
1329+
for x in self.iter_mut() {
1330+
drop_in_place(x);
1331+
}
1332+
}
13271333
}
13281334
}
13291335
// RawVec handles deallocation

branches/tmp/src/libcore/ptr.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,13 @@ fnptr_impls_args! { A, B }
385385
fnptr_impls_args! { A, B, C }
386386
fnptr_impls_args! { A, B, C, D }
387387
fnptr_impls_args! { A, B, C, D, E }
388+
fnptr_impls_args! { A, B, C, D, E, F }
389+
fnptr_impls_args! { A, B, C, D, E, F, G }
390+
fnptr_impls_args! { A, B, C, D, E, F, G, H }
391+
fnptr_impls_args! { A, B, C, D, E, F, G, H, I }
392+
fnptr_impls_args! { A, B, C, D, E, F, G, H, I, J }
393+
fnptr_impls_args! { A, B, C, D, E, F, G, H, I, J, K }
394+
fnptr_impls_args! { A, B, C, D, E, F, G, H, I, J, K, L }
388395

389396
// Comparison for pointers
390397
#[stable(feature = "rust1", since = "1.0.0")]
Lines changed: 120 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
// Copyright 2015 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
#[derive(Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
12+
struct Array<T> {
13+
f00: [T; 00],
14+
f01: [T; 01],
15+
f02: [T; 02],
16+
f03: [T; 03],
17+
f04: [T; 04],
18+
f05: [T; 05],
19+
f06: [T; 06],
20+
f07: [T; 07],
21+
f08: [T; 08],
22+
f09: [T; 09],
23+
f10: [T; 10],
24+
f11: [T; 11],
25+
f12: [T; 12],
26+
f13: [T; 13],
27+
f14: [T; 14],
28+
f15: [T; 15],
29+
f16: [T; 16],
30+
f17: [T; 17],
31+
f18: [T; 18],
32+
f19: [T; 19],
33+
f20: [T; 20],
34+
f21: [T; 21],
35+
f22: [T; 22],
36+
f23: [T; 23],
37+
f24: [T; 24],
38+
f25: [T; 25],
39+
f26: [T; 26],
40+
f27: [T; 27],
41+
f28: [T; 28],
42+
f29: [T; 29],
43+
f30: [T; 30],
44+
f31: [T; 31],
45+
f32: [T; 32],
46+
}
47+
48+
// FIXME(#7622): merge with `Array` once `[T; N]: Clone` where `T: Clone`
49+
#[derive(Clone, Copy)]
50+
struct CopyArray<T: Copy> {
51+
f00: [T; 00],
52+
f01: [T; 01],
53+
f02: [T; 02],
54+
f03: [T; 03],
55+
f04: [T; 04],
56+
f05: [T; 05],
57+
f06: [T; 06],
58+
f07: [T; 07],
59+
f08: [T; 08],
60+
f09: [T; 09],
61+
f10: [T; 10],
62+
f11: [T; 11],
63+
f12: [T; 12],
64+
f13: [T; 13],
65+
f14: [T; 14],
66+
f15: [T; 15],
67+
f16: [T; 16],
68+
f17: [T; 17],
69+
f18: [T; 18],
70+
f19: [T; 19],
71+
f20: [T; 20],
72+
f21: [T; 21],
73+
f22: [T; 22],
74+
f23: [T; 23],
75+
f24: [T; 24],
76+
f25: [T; 25],
77+
f26: [T; 26],
78+
f27: [T; 27],
79+
f28: [T; 28],
80+
f29: [T; 29],
81+
f30: [T; 30],
82+
f31: [T; 31],
83+
f32: [T; 32],
84+
}
85+
86+
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
87+
struct Fn<A, B, C, D, E, F, G, H, I, J, K, L> {
88+
f00: fn(),
89+
f01: fn(A),
90+
f02: fn(A, B),
91+
f03: fn(A, B, C),
92+
f04: fn(A, B, C, D),
93+
f05: fn(A, B, C, D, E),
94+
f06: fn(A, B, C, D, E, F),
95+
f07: fn(A, B, C, D, E, F, G),
96+
f08: fn(A, B, C, D, E, F, G, H),
97+
f09: fn(A, B, C, D, E, F, G, H, I),
98+
f10: fn(A, B, C, D, E, F, G, H, I, J),
99+
f11: fn(A, B, C, D, E, F, G, H, I, J, K),
100+
f12: fn(A, B, C, D, E, F, G, H, I, J, K, L),
101+
}
102+
103+
#[derive(Clone, Copy, Debug, Default, Eq, Hash, Ord, PartialEq, PartialOrd)]
104+
struct Tuple<A, B, C, D, E, F, G, H, I, J, K, L> {
105+
f00: (),
106+
f01: (A),
107+
f02: (A, B),
108+
f03: (A, B, C),
109+
f04: (A, B, C, D),
110+
f05: (A, B, C, D, E),
111+
f06: (A, B, C, D, E, F),
112+
f07: (A, B, C, D, E, F, G),
113+
f08: (A, B, C, D, E, F, G, H),
114+
f09: (A, B, C, D, E, F, G, H, I),
115+
f10: (A, B, C, D, E, F, G, H, I, J),
116+
f11: (A, B, C, D, E, F, G, H, I, J, K),
117+
f12: (A, B, C, D, E, F, G, H, I, J, K, L),
118+
}
119+
120+
fn main() {}

0 commit comments

Comments
 (0)