Skip to content

Commit 006fb28

Browse files
committed
---
yaml --- r: 89973 b: refs/heads/master c: bf61641 h: refs/heads/master i: 89971: 1f74720 v: v3
1 parent f96e506 commit 006fb28

File tree

9 files changed

+21
-86
lines changed

9 files changed

+21
-86
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: cad1f89bb5f2b5bdbaa740f7b36d319374fc0b1a
2+
refs/heads/master: bf61641e9f30927d751d98b52f00a6685c79c347
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
55
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8

trunk/doc/tutorial.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1320,8 +1320,7 @@ 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-
// 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]);
1323+
let mut a = Rc::new([10, 9, 8, 7, 6, 5, 4, 3, 2, 1]); // the variable is mutable, but not the box
13251324
a = z;
13261325
~~~
13271326

trunk/src/librustc/front/feature_gate.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,9 +141,11 @@ impl Visitor<()> for Context {
141141
},
142142
ast::ty_box(_) => {
143143
self.gate_feature("managed_boxes", t.span,
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.");
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.");
147149
}
148150
_ => {}
149151
}

trunk/src/librustc/middle/trans/base.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2759,6 +2759,7 @@ pub fn declare_intrinsics(llmod: ModuleRef) -> HashMap<&'static str, ValueRef> {
27592759
[i8p, Type::i8(), Type::i64(), Type::i32(), Type::i1()], Type::void());
27602760

27612761
ifn!(intrinsics, "llvm.trap", [], Type::void());
2762+
ifn!(intrinsics, "llvm.debugtrap", [], Type::void());
27622763
ifn!(intrinsics, "llvm.frameaddress", [Type::i32()], i8p);
27632764

27642765
ifn!(intrinsics, "llvm.powi.f32", [Type::f32(), Type::i32()], Type::f32());

trunk/src/librustc/middle/trans/intrinsic.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,11 @@ pub fn trans_intrinsic(ccx: @mut CrateContext,
228228
Call(bcx, llfn, [], []);
229229
Unreachable(bcx);
230230
}
231+
"breakpoint" => {
232+
let llfn = bcx.ccx().intrinsics.get_copy(&("llvm.debugtrap"));
233+
Call(bcx, llfn, [], []);
234+
RetVoid(bcx);
235+
}
231236
"size_of" => {
232237
let tp_ty = substs.tys[0];
233238
let lltp_ty = type_of::type_of(ccx, tp_ty);

trunk/src/librustc/middle/typeck/check/mod.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3968,7 +3968,8 @@ pub fn check_intrinsic_type(ccx: @mut CrateCtxt, it: @ast::foreign_item) {
39683968

39693969
} else {
39703970
match name {
3971-
"abort" => (0, ~[], ty::mk_bot()),
3971+
"abort" => (0, ~[], ty::mk_bot()),
3972+
"breakpoint" => (0, ~[], ty::mk_nil()),
39723973
"size_of" |
39733974
"pref_align_of" | "min_align_of" => (1u, ~[], ty::mk_uint()),
39743975
"init" => (1u, ~[], param(ccx, 0u)),

trunk/src/libstd/unstable/intrinsics.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,10 @@ extern "rust-intrinsic" {
176176
/// Abort the execution of the process.
177177
pub fn abort() -> !;
178178

179+
/// Execute a breakpoint trap, for inspection by a debugger.
180+
#[cfg(not(stage0))]
181+
pub fn breakpoint();
182+
179183
/// Atomic compare and exchange, sequentially consistent.
180184
pub fn atomic_cxchg(dst: &mut int, old: int, src: int) -> int;
181185
/// Atomic compare and exchange, acquire ordering.

trunk/src/libstd/vec.rs

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

38643864
#[bench]
3865-
fn add(bh: &mut BenchHarness) {
3865+
fn add(b: &mut BenchHarness) {
38663866
let xs: &[int] = [5, ..10];
38673867
let ys: &[int] = [5, ..10];
3868-
do bh.iter() {
3868+
do b.iter() {
38693869
xs + ys;
38703870
}
38713871
}
@@ -3885,72 +3885,4 @@ 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-
}
39563888
}

trunk/src/test/compile-fail/lint-unsafe-block.rs

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

1111
#[allow(unused_unsafe)];
1212
#[deny(unsafe_block)];
13-
#[feature(macro_rules)];
1413

1514
unsafe fn allowed() {}
1615

1716
#[allow(unsafe_block)] fn also_allowed() { unsafe {} }
1817

19-
macro_rules! unsafe_in_macro {
20-
() => {
21-
unsafe {} //~ ERROR: usage of an `unsafe` block
22-
}
23-
}
24-
2518
fn main() {
2619
unsafe {} //~ ERROR: usage of an `unsafe` block
27-
28-
unsafe_in_macro!()
2920
}

0 commit comments

Comments
 (0)