Skip to content

Commit e1bb86f

Browse files
committed
---
yaml --- r: 147240 b: refs/heads/try2 c: ef7969e h: refs/heads/master v: v3
1 parent 29fbae4 commit e1bb86f

File tree

112 files changed

+269
-40
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+269
-40
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: b0bcbbb154f11aeb302b45e4ba0627604af181a0
8+
refs/heads/try2: ef7969e86f0b53e4236ca627b31ac09413c07b82
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/configure

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -469,8 +469,8 @@ then
469469
PV_MINOR=${PV_MAJOR_MINOR#* }
470470
if [ "$PV_MAJOR" -lt "$MIN_PV_MAJOR" ] || [ "$PV_MINOR" -lt "$MIN_PV_MINOR" ]
471471
then
472-
step_msg "pandoc $PV_MAJOR.$PV_MINOR is too old. Need at least $MIN_PV_MAJOR.$MIN_PV_MINOR. Disabling"
473-
BAD_PANDOC=1
472+
step_msg "pandoc $PV_MAJOR.$PV_MINOR is too old. Need at least $MIN_PV_MAJOR.$MIN_PV_MINOR. Disabling"
473+
BAD_PANDOC=1
474474
fi
475475
fi
476476

@@ -544,12 +544,24 @@ then
544544
putvar CFG_ENABLE_CLANG
545545
fi
546546

547-
548547
if [ -z "$CFG_ENABLE_CLANG" -a -z "$CFG_GCC" ]
549548
then
550549
err "either clang or gcc is required"
551550
fi
552551

552+
# OS X 10.9, gcc is actually clang. This can cause some confusion in the build
553+
# system, so if we find that gcc is clang, we should just use clang directly.
554+
if [ $CFG_OSTYPE = apple-darwin -a -z "$CFG_ENABLE_CLANG" ]
555+
then
556+
CFG_OSX_GCC_VERSION=$("$CFG_GCC" --version 2>&1 | grep "Apple LLVM version")
557+
if [ $? -eq 0 ]
558+
then
559+
step_msg "on OS X 10.9, forcing use of clang"
560+
CFG_ENABLE_CLANG=1
561+
putvar CFG_ENABLE_CLANG
562+
fi
563+
fi
564+
553565
if [ ! -z "$CFG_LLVM_ROOT" -a -e "$CFG_LLVM_ROOT/bin/llvm-config" ]
554566
then
555567
step_msg "using custom LLVM at $CFG_LLVM_ROOT"
@@ -558,20 +570,20 @@ then
558570
LLVM_VERSION=$($LLVM_CONFIG --version)
559571

560572
case $LLVM_VERSION in
561-
(3.3|3.3svn|3.2|3.2svn)
562-
msg "found ok version of LLVM: $LLVM_VERSION"
563-
;;
564-
(*)
565-
err "bad LLVM version: $LLVM_VERSION, need >=3.0svn"
566-
;;
573+
(3.3|3.3svn|3.2|3.2svn)
574+
msg "found ok version of LLVM: $LLVM_VERSION"
575+
;;
576+
(*)
577+
err "bad LLVM version: $LLVM_VERSION, need >=3.0svn"
578+
;;
567579
esac
568580
fi
569581

570582
if [ ! -z "$CFG_ENABLE_CLANG" ]
571583
then
572584
if [ -z "$CFG_CLANG" ]
573585
then
574-
err "clang requested but not found"
586+
err "clang requested but not found"
575587
fi
576588
CFG_CLANG_VERSION=$("$CFG_CLANG" \
577589
--version \

branches/try2/src/librustc/front/feature_gate.rs

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,14 @@ impl Context {
7777
}
7878
}
7979

80+
fn gate_box(&self, span: Span) {
81+
self.gate_feature("managed_boxes", span,
82+
"The managed box syntax is being replaced by the \
83+
`std::gc::Gc` and `std::rc::Rc` types. Equivalent \
84+
functionality to managed trait objects will be \
85+
implemented but is currently missing.");
86+
}
87+
8088
fn has_feature(&self, feature: &str) -> bool {
8189
self.features.iter().any(|n| n.as_slice() == feature)
8290
}
@@ -172,17 +180,24 @@ impl Visitor<()> for Context {
172180
experimental and likely to be removed");
173181

174182
},
175-
ast::ty_box(_) => {
176-
self.gate_feature("managed_boxes", t.span,
177-
"The managed box syntax is being replaced by the `std::gc::Gc` \
178-
and `std::rc::Rc` types. Equivalent functionality to managed \
179-
trait objects will be implemented but is currently missing.");
180-
}
183+
ast::ty_box(_) => { self.gate_box(t.span); }
181184
_ => {}
182185
}
183186

184187
visit::walk_ty(self, t, ());
185188
}
189+
190+
fn visit_expr(&mut self, e: @ast::Expr, _: ()) {
191+
match e.node {
192+
ast::ExprUnary(_, ast::UnBox(..), _) |
193+
ast::ExprVstore(_, ast::ExprVstoreBox) |
194+
ast::ExprVstore(_, ast::ExprVstoreMutBox) => {
195+
self.gate_box(e.span);
196+
}
197+
_ => {}
198+
}
199+
visit::walk_expr(self, e, ());
200+
}
186201
}
187202

188203
pub fn check_crate(sess: Session, crate: &ast::Crate) {

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/librustdoc/clean.rs

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -73,9 +73,7 @@ pub struct Crate {
7373

7474
impl Clean<Crate> for visit_ast::RustdocVisitor {
7575
fn clean(&self) -> Crate {
76-
use syntax::attr::{find_linkage_metas, last_meta_item_value_str_by_name};
77-
let maybe_meta = last_meta_item_value_str_by_name(
78-
find_linkage_metas(self.attrs), "name");
76+
use syntax::attr::find_pkgid;
7977
let cx = local_data::get(super::ctxtkey, |x| *x.unwrap());
8078

8179
let mut externs = HashMap::new();
@@ -84,10 +82,9 @@ impl Clean<Crate> for visit_ast::RustdocVisitor {
8482
});
8583

8684
Crate {
87-
name: match maybe_meta {
88-
Some(x) => x.to_owned(),
89-
None => fail!("rustdoc requires a \\#[link(name=\"foo\")] \
90-
crate attribute"),
85+
name: match find_pkgid(self.attrs) {
86+
Some(n) => n.name,
87+
None => fail!("rustdoc requires a `pkgid` crate attribute"),
9188
},
9289
module: Some(self.module.clean()),
9390
externs: externs,

branches/try2/src/librustpkg/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ pub fn compile_input(context: &BuildContext,
300300
pkg_id.version.to_str()).to_managed());
301301

302302
debug!("pkgid attr: {:?}", pkgid_attr);
303-
crate.attrs = ~[attr::mk_attr(pkgid_attr)];
303+
crate.attrs.push(attr::mk_attr(pkgid_attr));
304304
}
305305

306306
debug!("calling compile_crate_from_input, workspace = {},

branches/try2/src/test/compile-fail/auto-ref-slice-plus-ref.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[feature(managed_boxes)];
12+
1113
fn main() {
1214

1315
// Testing that method lookup does not automatically borrow

branches/try2/src/test/compile-fail/borrowck-loan-rcvr-overloaded-op.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[feature(managed_boxes)];
12+
1113
struct Point {
1214
x: int,
1315
y: int,

branches/try2/src/test/compile-fail/borrowck-loan-rcvr.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[feature(managed_boxes)];
12+
1113
struct point { x: int, y: int }
1214

1315
trait methods {

branches/try2/src/test/compile-fail/borrowck-mut-boxed-vec.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[feature(managed_boxes)];
12+
1113
fn main() {
1214
let v = @mut [ 1, 2, 3 ];
1315
for _x in v.iter() {

branches/try2/src/test/compile-fail/issue-3763.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[feature(managed_boxes)];
12+
1113
mod my_mod {
1214
pub struct MyStruct {
1315
priv priv_field: int

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/compile-fail/moves-based-on-type-exprs.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Tests that references to move-by-default values trigger moves when
22
// they occur as part of various kinds of expressions.
33

4+
#[feature(managed_boxes)];
5+
46
struct Foo<A> { f: A }
57
fn guard(_s: ~str) -> bool {fail!()}
68
fn touch<A>(_a: &A) {}

branches/try2/src/test/compile-fail/non-exhaustive-match.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[feature(managed_boxes)];
12+
1113
enum t { a, b, }
1214

1315
fn main() {

branches/try2/src/test/compile-fail/occurs-check.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[feature(managed_boxes)];
12+
1113
fn main() {
1214
let f; //~ ERROR cyclic type of infinite size
1315
f = @f;

branches/try2/src/test/compile-fail/static-region-bound.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#[feature(managed_boxes)];
2+
13
fn f<T:'static>(_: T) {}
24

35
fn main() {

branches/try2/src/test/compile-fail/unique-unique-kind.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11+
#[feature(managed_boxes)];
12+
1113
fn f<T:Send>(_i: T) {
1214
}
1315

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

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

48+
#[feature(managed_boxes)];
4849
#[allow(unused_variable)];
4950

5051
struct SomeStruct {

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

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

27+
#[feature(managed_boxes)];
2728
#[allow(unused_variable)];
2829

2930
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
@@ -27,6 +27,7 @@
2727
// debugger:print managed_dtor->val
2828
// check:$4 = {x = 33, y = 333, z = 3333, w = 33333}
2929

30+
#[feature(managed_boxes)];
3031
#[allow(unused_variable)];
3132

3233
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
@@ -125,6 +125,7 @@
125125
// debugger:print *nn
126126
// check:$43 = 56
127127

128+
#[feature(managed_boxes)];
128129
#[allow(unused_variable)];
129130

130131
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
@@ -25,7 +25,7 @@
2525
// check:$3 = {-9747455}
2626

2727
#[allow(unused_variable)];
28-
#[feature(struct_variant)];
28+
#[feature(struct_variant, managed_boxes)];
2929

3030
// The first element is to ensure proper alignment, irrespective of the machines word size. Since
3131
// 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
}

0 commit comments

Comments
 (0)