Skip to content

Commit af9a88c

Browse files
committed
---
yaml --- r: 93812 b: refs/heads/try c: 861e6f5 h: refs/heads/master v: v3
1 parent cbab89d commit af9a88c

File tree

16 files changed

+405
-548
lines changed

16 files changed

+405
-548
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 0da105a8b7b6b1e0568e8ff20f6ff4b13cc7ecc2
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
5-
refs/heads/try: cd9069ca734fe89fe446c16dc821e54b973506f5
5+
refs/heads/try: 861e6f5cd26b4a568d64d78ec85f3e67ab2eea7b
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/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

branches/try/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
}

branches/try/src/librustc/middle/privacy.rs

Lines changed: 356 additions & 397 deletions
Large diffs are not rendered by default.

branches/try/src/librustc/middle/reachable.rs

Lines changed: 39 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ use middle::privacy;
2222
use std::hashmap::HashSet;
2323
use syntax::ast;
2424
use syntax::ast_map;
25-
use syntax::ast_util::{def_id_of_def, is_local};
25+
use syntax::ast_util::{def_id_of_def, is_local, local_def};
2626
use syntax::attr;
2727
use syntax::parse::token;
2828
use syntax::visit::Visitor;
@@ -310,13 +310,47 @@ impl ReachableContext {
310310
}
311311
}
312312

313+
// Implementations of exported structs/enums need to get
314+
// added to the worklist (as all their methods should be
315+
// accessible)
316+
ast::item_struct(*) | ast::item_enum(*) => {
317+
let def = local_def(item.id);
318+
let impls = match self.tcx.inherent_impls.find(&def) {
319+
Some(&impls) => impls,
320+
None => return
321+
};
322+
for imp in impls.iter() {
323+
if is_local(imp.did) {
324+
self.worklist.push(imp.did.node);
325+
}
326+
}
327+
}
328+
329+
// Propagate through this impl
330+
ast::item_impl(_, _, _, ref methods) => {
331+
for method in methods.iter() {
332+
self.worklist.push(method.id);
333+
}
334+
}
335+
336+
// Default methods of exported traits need to all be
337+
// accessible.
338+
ast::item_trait(_, _, ref methods) => {
339+
for method in methods.iter() {
340+
match *method {
341+
ast::required(*) => {}
342+
ast::provided(ref method) => {
343+
self.worklist.push(method.id);
344+
}
345+
}
346+
}
347+
}
348+
313349
// These are normal, nothing reachable about these
314350
// inherently and their children are already in the
315-
// worklist, as determined by the privacy pass
351+
// worklist
316352
ast::item_static(*) | ast::item_ty(*) |
317-
ast::item_mod(*) | ast::item_foreign_mod(*) |
318-
ast::item_impl(*) | ast::item_trait(*) |
319-
ast::item_struct(*) | ast::item_enum(*) => {}
353+
ast::item_mod(*) | ast::item_foreign_mod(*) => {}
320354

321355
_ => {
322356
self.tcx.sess.span_bug(item.span,

branches/try/src/librustc/middle/trans/base.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2759,7 +2759,6 @@ 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());
27632762
ifn!(intrinsics, "llvm.frameaddress", [Type::i32()], i8p);
27642763

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

branches/try/src/librustc/middle/trans/intrinsic.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -228,11 +228,6 @@ 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-
}
236231
"size_of" => {
237232
let tp_ty = substs.tys[0];
238233
let lltp_ty = type_of::type_of(ccx, tp_ty);

branches/try/src/librustc/middle/typeck/check/mod.rs

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

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

branches/try/src/libstd/rt/global_heap.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ extern {
2020
#[inline]
2121
pub fn get_box_size(body_size: uint, body_align: uint) -> uint {
2222
let header_size = size_of::<raw::Box<()>>();
23-
// FIXME (#2699): This alignment calculation is suspicious. Is it right?
2423
let total_size = align_to(header_size, body_align) + body_size;
2524
total_size
2625
}

branches/try/src/libstd/unstable/intrinsics.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,6 @@ 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-
183179
/// Atomic compare and exchange, sequentially consistent.
184180
pub fn atomic_cxchg(dst: &mut int, old: int, src: int) -> int;
185181
/// Atomic compare and exchange, acquire ordering.

branches/try/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
}

branches/try/src/test/auxiliary/privacy_reexport.rs

Lines changed: 0 additions & 15 deletions
This file was deleted.

branches/try/src/test/compile-fail/lint-missing-doc.rs

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -57,11 +57,6 @@ pub trait C { //~ ERROR: missing documentation
5757
#[allow(missing_doc)] pub trait D {}
5858

5959
impl Foo {
60-
pub fn foo() {}
61-
fn bar() {}
62-
}
63-
64-
impl PubFoo {
6560
pub fn foo() {} //~ ERROR: missing documentation
6661
/// dox
6762
pub fn foo1() {}

branches/try/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
}

branches/try/src/test/compile-fail/privacy1.rs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,6 @@ mod bar {
3131
fn bar2(&self) {}
3232
}
3333

34-
trait B {
35-
fn foo() -> Self;
36-
}
37-
38-
impl B for int { fn foo() -> int { 3 } }
39-
4034
pub enum Enum {
4135
priv Priv,
4236
Pub
@@ -114,10 +108,6 @@ mod foo {
114108
::bar::baz::A.bar2(); //~ ERROR: struct `A` is inaccessible
115109
//~^ ERROR: method `bar2` is private
116110
//~^^ NOTE: module `baz` is private
117-
118-
let _: int =
119-
::bar::B::foo(); //~ ERROR: method `foo` is inaccessible
120-
//~^ NOTE: trait `B` is private
121111
::lol();
122112

123113
::bar::Priv; //~ ERROR: variant `Priv` is private

branches/try/src/test/run-pass/privacy-reexport.rs

Lines changed: 0 additions & 18 deletions
This file was deleted.

0 commit comments

Comments
 (0)