Skip to content

Commit c8ecb41

Browse files
committed
---
yaml --- r: 96221 b: refs/heads/dist-snap c: d3cb24b h: refs/heads/master i: 96219: 90eb255 v: v3
1 parent 8855423 commit c8ecb41

File tree

5 files changed

+85
-9
lines changed

5 files changed

+85
-9
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ refs/heads/try: c274a6888410ce3e357e014568b43310ed787d36
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c
9-
refs/heads/dist-snap: bf61641e9f30927d751d98b52f00a6685c79c347
9+
refs/heads/dist-snap: d3cb24b1fe3fd0e31cccf8ca3c53470f747bae0c
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1212
refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0

branches/dist-snap/doc/tutorial.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1320,7 +1320,8 @@ let z = x; // this moves `x` into `z`, rather than creating a new owner
13201320

13211321
assert_eq!(*z.borrow(), [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]);
13221322

1323-
let mut a = Rc::new([10, 9, 8, 7, 6, 5, 4, 3, 2, 1]); // the variable is mutable, but not the box
1323+
// the variable is mutable, but not the contents of the box
1324+
let mut a = Rc::new([10, 9, 8, 7, 6, 5, 4, 3, 2, 1]);
13241325
a = z;
13251326
~~~
13261327

branches/dist-snap/src/librustc/front/feature_gate.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,11 +141,9 @@ impl Visitor<()> for Context {
141141
},
142142
ast::ty_box(_) => {
143143
self.gate_feature("managed_boxes", t.span,
144-
"The managed box syntax will be replaced \
145-
by a library type, and a garbage \
146-
collector is not yet implemented. \
147-
Consider using the `std::rc::Rc` type \
148-
for reference counted pointers.");
144+
"The managed box syntax is being replaced by the `std::gc::Gc`
145+
and `std::rc::Rc` types. Equivalent functionality to managed
146+
trait objects will be implemented but is currently missing.");
149147
}
150148
_ => {}
151149
}

branches/dist-snap/src/libstd/vec.rs

Lines changed: 70 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3862,10 +3862,10 @@ mod bench {
38623862
}
38633863

38643864
#[bench]
3865-
fn add(b: &mut BenchHarness) {
3865+
fn add(bh: &mut BenchHarness) {
38663866
let xs: &[int] = [5, ..10];
38673867
let ys: &[int] = [5, ..10];
3868-
do b.iter() {
3868+
do bh.iter() {
38693869
xs + ys;
38703870
}
38713871
}
@@ -3885,4 +3885,72 @@ mod bench {
38853885
xss.connect_vec(&0);
38863886
}
38873887
}
3888+
3889+
#[bench]
3890+
fn push(bh: &mut BenchHarness) {
3891+
let mut vec: ~[uint] = ~[0u];
3892+
do bh.iter() {
3893+
vec.push(0);
3894+
}
3895+
}
3896+
3897+
#[bench]
3898+
fn starts_with_same_vector(bh: &mut BenchHarness) {
3899+
let vec: ~[uint] = vec::from_fn(100, |i| i);
3900+
do bh.iter() {
3901+
vec.starts_with(vec);
3902+
}
3903+
}
3904+
3905+
#[bench]
3906+
fn starts_with_single_element(bh: &mut BenchHarness) {
3907+
let vec: ~[uint] = ~[0u];
3908+
do bh.iter() {
3909+
vec.starts_with(vec);
3910+
}
3911+
}
3912+
3913+
#[bench]
3914+
fn starts_with_diff_one_element_at_end(bh: &mut BenchHarness) {
3915+
let vec: ~[uint] = vec::from_fn(100, |i| i);
3916+
let mut match_vec: ~[uint] = vec::from_fn(99, |i| i);
3917+
match_vec.push(0);
3918+
do bh.iter() {
3919+
vec.starts_with(match_vec);
3920+
}
3921+
}
3922+
3923+
#[bench]
3924+
fn ends_with_same_vector(bh: &mut BenchHarness) {
3925+
let vec: ~[uint] = vec::from_fn(100, |i| i);
3926+
do bh.iter() {
3927+
vec.ends_with(vec);
3928+
}
3929+
}
3930+
3931+
#[bench]
3932+
fn ends_with_single_element(bh: &mut BenchHarness) {
3933+
let vec: ~[uint] = ~[0u];
3934+
do bh.iter() {
3935+
vec.ends_with(vec);
3936+
}
3937+
}
3938+
3939+
#[bench]
3940+
fn ends_with_diff_one_element_at_beginning(bh: &mut BenchHarness) {
3941+
let vec: ~[uint] = vec::from_fn(100, |i| i);
3942+
let mut match_vec: ~[uint] = vec::from_fn(100, |i| i);
3943+
match_vec[0] = 200;
3944+
do bh.iter() {
3945+
vec.starts_with(match_vec);
3946+
}
3947+
}
3948+
3949+
#[bench]
3950+
fn contains_last_element(bh: &mut BenchHarness) {
3951+
let vec: ~[uint] = vec::from_fn(100, |i| i);
3952+
do bh.iter() {
3953+
vec.contains(&99u);
3954+
}
3955+
}
38883956
}

branches/dist-snap/src/test/compile-fail/lint-unsafe-block.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,20 @@
1010

1111
#[allow(unused_unsafe)];
1212
#[deny(unsafe_block)];
13+
#[feature(macro_rules)];
1314

1415
unsafe fn allowed() {}
1516

1617
#[allow(unsafe_block)] fn also_allowed() { unsafe {} }
1718

19+
macro_rules! unsafe_in_macro {
20+
() => {
21+
unsafe {} //~ ERROR: usage of an `unsafe` block
22+
}
23+
}
24+
1825
fn main() {
1926
unsafe {} //~ ERROR: usage of an `unsafe` block
27+
28+
unsafe_in_macro!()
2029
}

0 commit comments

Comments
 (0)