Skip to content

Commit d05f6b4

Browse files
committed
---
yaml --- r: 147229 b: refs/heads/try2 c: 6747d07 h: refs/heads/master i: 147227: 0182614 v: v3
1 parent 196d1ad commit d05f6b4

19 files changed

+55
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 0f6537fed4417134d72200ab3d46b124a4f2a34c
8+
refs/heads/try2: 6747d0738a88e7a94171ec7b3f42c837352bc5be
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/lint.rs

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -770,9 +770,21 @@ fn check_heap_type(cx: &Context, span: Span, ty: ty::t) {
770770
let mut n_uniq = 0;
771771
ty::fold_ty(cx.tcx, ty, |t| {
772772
match ty::get(t).sty {
773-
ty::ty_box(_) => n_box += 1,
774-
ty::ty_uniq(_) => n_uniq += 1,
775-
_ => ()
773+
ty::ty_box(_) | ty::ty_estr(ty::vstore_box) |
774+
ty::ty_evec(_, ty::vstore_box) |
775+
ty::ty_trait(_, _, ty::BoxTraitStore, _, _) => {
776+
n_box += 1;
777+
}
778+
ty::ty_uniq(_) | ty::ty_estr(ty::vstore_uniq) |
779+
ty::ty_evec(_, ty::vstore_uniq) |
780+
ty::ty_trait(_, _, ty::UniqTraitStore, _, _) => {
781+
n_uniq += 1;
782+
}
783+
ty::ty_closure(ref c) if c.sigil == ast::OwnedSigil => {
784+
n_uniq += 1;
785+
}
786+
787+
_ => ()
776788
};
777789
t
778790
});

branches/try2/src/test/compile-fail/lint-heap-memory.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,20 @@ struct Foo {
1919
struct Bar { x: ~int } //~ ERROR type uses owned
2020

2121
fn main() {
22-
let _x : Bar = Bar {x : ~10};
22+
let _x : Bar = Bar {x : ~10}; //~ ERROR type uses owned
23+
24+
@2; //~ ERROR type uses managed
25+
@[1]; //~ ERROR type uses managed
26+
//~^ ERROR type uses managed
27+
fn f(_: @Clone) {} //~ ERROR type uses managed
28+
@""; //~ ERROR type uses managed
29+
//~^ ERROR type uses managed
30+
31+
~2; //~ ERROR type uses owned
32+
~[1]; //~ ERROR type uses owned
33+
//~^ ERROR type uses owned
34+
fn g(_: ~Clone) {} //~ ERROR type uses owned
35+
~""; //~ ERROR type uses owned
2336
//~^ ERROR type uses owned
37+
proc() {}; //~ ERROR type uses owned
2438
}

branches/try2/src/test/debug-info/borrowed-struct.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
// debugger:print *unique_val_interior_ref_2
4444
// check:$10 = 26.5
4545

46+
#[feature(managed_boxes)];
4647
#[allow(unused_variable)];
4748

4849
struct SomeStruct {

branches/try2/src/test/debug-info/box.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
// debugger:print d->val
2323
// check:$4 = false
2424

25+
#[feature(managed_boxes)];
2526
#[allow(unused_variable)];
2627

2728
fn main() {

branches/try2/src/test/debug-info/boxed-struct.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
// debugger:print managed_dtor->val
2626
// check:$4 = {x = 33, y = 333, z = 3333, w = 33333}
2727

28+
#[feature(managed_boxes)];
2829
#[allow(unused_variable)];
2930

3031
struct StructWithSomePadding {

branches/try2/src/test/debug-info/destructured-local.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
// debugger:print *nn
124124
// check:$43 = 56
125125

126+
#[feature(managed_boxes)];
126127
#[allow(unused_variable)];
127128

128129
struct Struct {

branches/try2/src/test/debug-info/generic-method-on-generic-struct.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@
9494
// check:$21 = {-16, 16.5}
9595
// debugger:continue
9696

97+
#[feature(managed_boxes)];
98+
9799
struct Struct<T> {
98100
x: T
99101
}

branches/try2/src/test/debug-info/managed-enum.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
// check:$3 = {-9747455}
2424

2525
#[allow(unused_variable)];
26-
#[feature(struct_variant)];
26+
#[feature(struct_variant, managed_boxes)];
2727

2828
// The first element is to ensure proper alignment, irrespective of the machines word size. Since
2929
// the size of the discriminant value is machine dependent, this has be taken into account when

branches/try2/src/test/debug-info/method-on-enum.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@
9494
// check:$21 = -16
9595
// debugger:continue
9696

97+
#[feature(managed_boxes)];
9798
#[feature(struct_variant)];
9899

99100
enum Enum {

branches/try2/src/test/debug-info/method-on-generic-struct.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@
9494
// check:$21 = -16
9595
// debugger:continue
9696

97+
#[feature(managed_boxes)];
98+
9799
struct Struct<T> {
98100
x: T
99101
}

branches/try2/src/test/debug-info/method-on-struct.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@
9494
// check:$21 = -16
9595
// debugger:continue
9696

97+
#[feature(managed_boxes)];
98+
9799
struct Struct {
98100
x: int
99101
}

branches/try2/src/test/debug-info/method-on-trait.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@
9494
// check:$21 = -16
9595
// debugger:continue
9696

97+
#[feature(managed_boxes)];
98+
9799
struct Struct {
98100
x: int
99101
}

branches/try2/src/test/debug-info/method-on-tuple-struct.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@
9494
// check:$21 = -16
9595
// debugger:continue
9696

97+
#[feature(managed_boxes)];
98+
9799
struct TupleStruct(int, f64);
98100

99101
impl TupleStruct {

branches/try2/src/test/debug-info/self-in-default-method.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@
9494
// check:$21 = -16
9595
// debugger:continue
9696

97+
#[feature(managed_boxes)];
98+
9799
struct Struct {
98100
x: int
99101
}

branches/try2/src/test/debug-info/self-in-generic-default-method.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,8 @@
9494
// check:$21 = {-16, 16.5}
9595
// debugger:continue
9696

97+
#[feature(managed_boxes)];
98+
9799
struct Struct {
98100
x: int
99101
}

branches/try2/src/test/debug-info/var-captured-in-nested-closure.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
// check:$14 = 8
5050
// debugger:continue
5151

52+
#[feature(managed_boxes)];
5253
#[allow(unused_variable)];
5354

5455
struct Struct {

branches/try2/src/test/debug-info/var-captured-in-stack-closure.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
// debugger:print managed->val
2929
// check:$6 = 7
3030

31+
#[feature(managed_boxes)];
3132
#[allow(unused_variable)];
3233

3334
struct Struct {

branches/try2/src/test/pretty/block-disambig.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@
1212
// previously ambiguous (e.g. 'if true { } *val;' gets parsed as a
1313
// binop)
1414

15+
#[feature(managed_boxes)];
16+
1517
fn test1() { let val = @0; { } *val; }
1618

1719
fn test2() -> int { let val = @0; { } *val }

0 commit comments

Comments
 (0)