Skip to content

Commit cf7bcbe

Browse files
committed
---
yaml --- r: 44159 b: refs/heads/snap-stage3 c: d0b5016 h: refs/heads/master i: 44157: 0997eea 44155: e14fcc4 44151: 823c949 44143: 4f6acf8 44127: 1ba4a69 44095: a706eab 44031: 3037b5c v: v3
1 parent 44b574d commit cf7bcbe

31 files changed

+56
-57
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 19dfec2aaf746535de1521f68421f9980dbf25de
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 43dc67b74a9b2599a38a59cc572e74f91213672f
4+
refs/heads/snap-stage3: d0b5016af2647446a61100f373471ef749e7b704
55
refs/heads/try: ef355f6332f83371e4acf04fc4eb940ab41d78d3
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/libcore/vec.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1865,6 +1865,7 @@ pub trait OwnedVector<T> {
18651865
fn consume(self, f: fn(uint, v: T));
18661866
fn filter(self, f: fn(t: &T) -> bool) -> ~[T];
18671867
fn partition(self, f: pure fn(&T) -> bool) -> (~[T], ~[T]);
1868+
fn grow_fn(&mut self, n: uint, op: iter::InitOp<T>);
18681869
}
18691870

18701871
impl<T> OwnedVector<T> for ~[T] {
@@ -1936,6 +1937,11 @@ impl<T> OwnedVector<T> for ~[T] {
19361937
fn partition(self, f: fn(&T) -> bool) -> (~[T], ~[T]) {
19371938
partition(self, f)
19381939
}
1940+
1941+
#[inline]
1942+
fn grow_fn(&mut self, n: uint, op: iter::InitOp<T>) {
1943+
grow_fn(self, n, op);
1944+
}
19391945
}
19401946

19411947
impl<T> Mutable for ~[T] {
@@ -1946,7 +1952,6 @@ impl<T> Mutable for ~[T] {
19461952
pub trait OwnedCopyableVector<T: Copy> {
19471953
fn push_all(&mut self, rhs: &[const T]);
19481954
fn grow(&mut self, n: uint, initval: &T);
1949-
fn grow_fn(&mut self, n: uint, op: iter::InitOp<T>);
19501955
fn grow_set(&mut self, index: uint, initval: &T, val: T);
19511956
}
19521957

@@ -1961,11 +1966,6 @@ impl<T: Copy> OwnedCopyableVector<T> for ~[T] {
19611966
grow(self, n, initval);
19621967
}
19631968

1964-
#[inline]
1965-
fn grow_fn(&mut self, n: uint, op: iter::InitOp<T>) {
1966-
grow_fn(self, n, op);
1967-
}
1968-
19691969
#[inline]
19701970
fn grow_set(&mut self, index: uint, initval: &T, val: T) {
19711971
grow_set(self, index, initval, val);

branches/snap-stage3/src/librustc/middle/trans/base.rs

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,7 @@ pub fn set_glue_inlining(f: ValueRef, t: ty::t) {
456456
// Double-check that we never ask LLVM to declare the same symbol twice. It
457457
// silently mangles such symbols, breaking our linkage model.
458458
pub fn note_unique_llvm_symbol(ccx: @crate_ctxt, +sym: ~str) {
459+
// XXX: Bad copy.
459460
if ccx.all_llvm_symbols.contains_key(&sym) {
460461
ccx.sess.bug(~"duplicate LLVM symbol: " + sym);
461462
}
@@ -627,10 +628,7 @@ pub fn iter_structural_ty(cx: block, av: ValueRef, t: ty::t,
627628
for vec::each(fn_ty.sig.inputs) |a| {
628629
let llfldp_a = GEP_enum(cx, a_tup, tid, v_id,
629630
/*bad*/copy tps, j);
630-
// This assumes the self type is absent (it passes
631-
// None for the self_ty_opt arg of substs_tps).
632-
// I think that's ok since you can't have an enum
633-
// inside a trait.
631+
// XXX: Is "None" right here?
634632
let ty_subst = ty::subst_tps(ccx.tcx, tps, None, a.ty);
635633
cx = f(cx, llfldp_a, ty_subst);
636634
j += 1u;
@@ -1040,7 +1038,8 @@ pub fn load_if_immediate(cx: block, v: ValueRef, t: ty::t) -> ValueRef {
10401038
pub fn trans_trace(bcx: block, sp_opt: Option<span>, +trace_str: ~str) {
10411039
if !bcx.sess().trace() { return; }
10421040
let _icx = bcx.insn_ctxt("trans_trace");
1043-
add_comment(bcx, trace_str);
1041+
// XXX: Bad copy.
1042+
add_comment(bcx, copy trace_str);
10441043
let V_trace_str = C_cstr(bcx.ccx(), trace_str);
10451044
let {V_filename, V_line} = match sp_opt {
10461045
Some(sp) => {
@@ -1552,7 +1551,7 @@ pub fn new_fn_ctxt_w_id(ccx: @crate_ctxt,
15521551
llfndecl: ValueRef,
15531552
id: ast::node_id,
15541553
impl_id: Option<ast::def_id>,
1555-
param_substs: Option<@param_substs>,
1554+
+param_substs: Option<param_substs>,
15561555
sp: Option<span>) -> fn_ctxt {
15571556
let llbbs = mk_standard_basic_blocks(llfndecl);
15581557
return @fn_ctxt_ {
@@ -1741,7 +1740,7 @@ pub fn trans_closure(ccx: @crate_ctxt,
17411740
body: &ast::blk,
17421741
llfndecl: ValueRef,
17431742
ty_self: self_arg,
1744-
param_substs: Option<@param_substs>,
1743+
+param_substs: Option<param_substs>,
17451744
id: ast::node_id,
17461745
impl_id: Option<ast::def_id>,
17471746
maybe_load_env: fn(fn_ctxt),
@@ -1805,7 +1804,7 @@ pub fn trans_fn(ccx: @crate_ctxt,
18051804
body: &ast::blk,
18061805
llfndecl: ValueRef,
18071806
ty_self: self_arg,
1808-
param_substs: Option<@param_substs>,
1807+
+param_substs: Option<param_substs>,
18091808
id: ast::node_id,
18101809
impl_id: Option<ast::def_id>) {
18111810
let do_time = ccx.sess.trans_stats();
@@ -1814,8 +1813,8 @@ pub fn trans_fn(ccx: @crate_ctxt,
18141813
debug!("trans_fn(ty_self=%?)", ty_self);
18151814
let _icx = ccx.insn_ctxt("trans_fn");
18161815
ccx.stats.n_fns += 1;
1817-
let the_path_str = path_str(ccx.sess, path);
1818-
trans_closure(ccx, path, decl, body, llfndecl, ty_self,
1816+
// XXX: Bad copy of `path`.
1817+
trans_closure(ccx, copy path, decl, body, llfndecl, ty_self,
18191818
param_substs, id, impl_id,
18201819
|fcx| {
18211820
if ccx.sess.opts.extra_debuginfo {
@@ -1825,7 +1824,7 @@ pub fn trans_fn(ccx: @crate_ctxt,
18251824
|_bcx| { });
18261825
if do_time {
18271826
let end = time::get_time();
1828-
log_fn_time(ccx, the_path_str, start, end);
1827+
log_fn_time(ccx, path_str(ccx.sess, path), start, end);
18291828
}
18301829
}
18311830

@@ -1835,7 +1834,7 @@ pub fn trans_enum_variant(ccx: @crate_ctxt,
18351834
args: ~[ast::variant_arg],
18361835
disr: int,
18371836
is_degen: bool,
1838-
param_substs: Option<@param_substs>,
1837+
+param_substs: Option<param_substs>,
18391838
llfndecl: ValueRef) {
18401839
let _icx = ccx.insn_ctxt("trans_enum_variant");
18411840
// Translate variant arguments to function arguments.
@@ -1851,8 +1850,9 @@ pub fn trans_enum_variant(ccx: @crate_ctxt,
18511850
id: varg.id,
18521851
}
18531852
};
1853+
// XXX: Bad copy of `param_substs`.
18541854
let fcx = new_fn_ctxt_w_id(ccx, ~[], llfndecl, variant.node.id, None,
1855-
param_substs, None);
1855+
copy param_substs, None);
18561856
// XXX: Bad copy.
18571857
let raw_llargs = create_llargs_for_fn_args(fcx, no_self, copy fn_args);
18581858
let ty_param_substs = match param_substs {
@@ -1897,7 +1897,7 @@ pub fn trans_enum_variant(ccx: @crate_ctxt,
18971897
pub fn trans_tuple_struct(ccx: @crate_ctxt,
18981898
fields: ~[@ast::struct_field],
18991899
ctor_id: ast::node_id,
1900-
param_substs: Option<@param_substs>,
1900+
+param_substs: Option<param_substs>,
19011901
llfndecl: ValueRef) {
19021902
let _icx = ccx.insn_ctxt("trans_tuple_struct");
19031903
@@ -1951,7 +1951,7 @@ pub fn trans_struct_dtor(ccx: @crate_ctxt,
19511951
+path: path,
19521952
body: &ast::blk,
19531953
dtor_id: ast::node_id,
1954-
psubsts: Option<@param_substs>,
1954+
+psubsts: Option<param_substs>,
19551955
hash_id: Option<mono_id>,
19561956
parent_id: ast::def_id)
19571957
-> ValueRef {
@@ -1968,7 +1968,7 @@ pub fn trans_struct_dtor(ccx: @crate_ctxt,
19681968
let lldty = type_of_dtor(ccx, class_ty);
19691969
19701970
// XXX: Bad copies.
1971-
let s = get_dtor_symbol(ccx, copy path, dtor_id, psubsts);
1971+
let s = get_dtor_symbol(ccx, copy path, dtor_id, copy psubsts);
19721972
19731973
/* Register the dtor as a function. It has external linkage */
19741974
let lldecl = decl_internal_cdecl_fn(ccx.llmod, s, lldty);
@@ -2296,7 +2296,7 @@ pub fn item_path(ccx: @crate_ctxt, i: @ast::item) -> path {
22962296
pub fn get_dtor_symbol(ccx: @crate_ctxt,
22972297
+path: path,
22982298
id: ast::node_id,
2299-
substs: Option<@param_substs>)
2299+
+substs: Option<param_substs>)
23002300
-> ~str {
23012301
let t = ty::node_id_to_type(ccx.tcx, id);
23022302
match ccx.item_symbols.find(&id) {

branches/snap-stage3/src/librustc/middle/trans/build.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -834,7 +834,7 @@ pub fn add_span_comment(bcx: block, sp: span, text: ~str) {
834834
}
835835
}
836836
837-
pub fn add_comment(bcx: block, text: &str) {
837+
pub fn add_comment(bcx: block, text: ~str) {
838838
unsafe {
839839
let ccx = bcx.ccx();
840840
if !ccx.sess.no_asm_comments() {

branches/snap-stage3/src/librustc/middle/trans/common.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ pub struct fn_ctxt_ {
311311

312312
// If this function is being monomorphized, this contains the type
313313
// substitutions used.
314-
param_substs: Option<@param_substs>,
314+
param_substs: Option<param_substs>,
315315

316316
// The source span and nesting context where this function comes from, for
317317
// error reporting and symbol generation.
@@ -1395,7 +1395,7 @@ pub fn resolve_vtable_in_fn_ctxt(fcx: fn_ctxt, +vt: typeck::vtable_origin)
13951395
}
13961396
typeck::vtable_param(n_param, n_bound) => {
13971397
match fcx.param_substs {
1398-
Some(substs) => {
1398+
Some(ref substs) => {
13991399
find_vtable(tcx, substs, n_param, n_bound)
14001400
}
14011401
_ => {

branches/snap-stage3/src/librustc/middle/trans/datum.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -524,8 +524,7 @@ pub impl Datum {
524524
if bcx.sess().trace() {
525525
trans_trace(
526526
bcx, None,
527-
fmt!("preserving until end of scope %d",
528-
root_info.scope));
527+
fmt!("preserving until end of scope %d", root_info.scope));
529528
}
530529

531530
let scratch = scratch_datum(bcx, self.ty, true);

branches/snap-stage3/src/librustc/middle/trans/foreign.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ pub fn trans_intrinsic(ccx: @crate_ctxt,
332332
decl: ValueRef,
333333
item: @ast::foreign_item,
334334
+path: ast_map::path,
335-
substs: @param_substs,
335+
+substs: param_substs,
336336
ref_id: Option<ast::node_id>) {
337337
debug!("trans_intrinsic(item.ident=%s)", ccx.sess.str_of(item.ident));
338338

branches/snap-stage3/src/librustc/middle/trans/meth.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ pub fn trans_impl(ccx: @crate_ctxt, +path: path, name: ast::ident,
6666
match self_ty {
6767
None => param_substs_opt = None,
6868
Some(self_ty) => {
69-
param_substs_opt = Some(@param_substs {
69+
param_substs_opt = Some(param_substs {
7070
tys: ~[],
7171
vtables: None,
7272
bounds: @~[],
@@ -99,7 +99,7 @@ Translates a (possibly monomorphized) method body.
9999
pub fn trans_method(ccx: @crate_ctxt,
100100
+path: path,
101101
method: &ast::method,
102-
param_substs: Option<@param_substs>,
102+
+param_substs: Option<param_substs>,
103103
base_self_ty: Option<ty::t>,
104104
llfn: ValueRef,
105105
impl_id: ast::def_id) {
@@ -118,7 +118,7 @@ pub fn trans_method(ccx: @crate_ctxt,
118118
}
119119
let self_ty = match param_substs {
120120
None => self_ty,
121-
Some(@param_substs {tys: ref tys, _}) => {
121+
Some(param_substs {tys: ref tys, _}) => {
122122
ty::subst_tps(ccx.tcx, *tys, None, self_ty)
123123
}
124124
};
@@ -247,7 +247,7 @@ pub fn trans_method_callee(bcx: block,
247247
bound_num: b
248248
}) => {
249249
match bcx.fcx.param_substs {
250-
Some(substs) => {
250+
Some(ref substs) => {
251251
let vtbl = find_vtable(bcx.tcx(), substs, p, b);
252252
trans_monomorphized_callee(bcx, callee_id, self, mentry,
253253
trait_id, off, vtbl)

branches/snap-stage3/src/librustc/middle/trans/monomorphize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ pub fn monomorphic_fn(ccx: @crate_ctxt,
156156
lldecl
157157
};
158158

159-
let psubsts = Some(@param_substs {
159+
let psubsts = Some(param_substs {
160160
tys: substs,
161161
vtables: vtables,
162162
bounds: tpt.bounds,

branches/snap-stage3/src/libstd/deque.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ fn grow<T>(nelts: uint, lo: uint, elts: &mut [Option<T>]) -> ~[Option<T>] {
100100
assert nelts == elts.len();
101101
let mut rv = ~[];
102102

103-
do vec::grow_fn(&mut rv, nelts + 1) |i| {
103+
do rv.grow_fn(nelts + 1) |i| {
104104
let mut element = None;
105105
element <-> elts[(lo + i) % nelts];
106106
element

branches/snap-stage3/src/test/run-pass/class-impl-very-parameterized-trait.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ priv impl<T> cat<T> {
127127
}
128128
}
129129
130-
fn main() {
130+
pub fn main() {
131131
let mut nyan: cat<~str> = cat::new(0, 2, ~"nyan");
132132
for uint::range(1, 5) |_| { nyan.speak(); }
133133
assert(*nyan.find(&1).unwrap() == ~"nyan");

branches/snap-stage3/src/test/run-pass/const-enum-ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
enum E { V0, V1(int) }
1212
const C: &static/E = &V0;
1313

14-
fn main() {
14+
pub fn main() {
1515
match *C {
1616
V0 => (),
1717
_ => fail!()

branches/snap-stage3/src/test/run-pass/const-enum-struct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ enum E { V16(u16), V32(u32) }
1212
struct S { a: E, b: u16, c: u16 }
1313
const C: S = S { a: V16(0xDEAD), b: 0x600D, c: 0xBAD };
1414

15-
fn main() {
15+
pub fn main() {
1616
let n = C.b;
1717
assert n != 0xBAD;
1818
assert n == 0x600D;

branches/snap-stage3/src/test/run-pass/const-enum-struct2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ enum E { V0, V16(u16) }
1212
struct S { a: E, b: u16, c: u16 }
1313
const C: S = S { a: V0, b: 0x600D, c: 0xBAD };
1414

15-
fn main() {
15+
pub fn main() {
1616
let n = C.b;
1717
assert n != 0xBAD;
1818
assert n == 0x600D;

branches/snap-stage3/src/test/run-pass/const-enum-tuple.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
enum E { V16(u16), V32(u32) }
1212
const C: (E, u16, u16) = (V16(0xDEAD), 0x600D, 0xBAD);
1313

14-
fn main() {
14+
pub fn main() {
1515
let (_, n, _) = C;
1616
assert n != 0xBAD;
1717
assert n == 0x600D;

branches/snap-stage3/src/test/run-pass/const-enum-tuple2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
enum E { V0, V16(u16) }
1212
const C: (E, u16, u16) = (V0, 0x600D, 0xBAD);
1313

14-
fn main() {
14+
pub fn main() {
1515
let (_, n, _) = C;
1616
assert n != 0xBAD;
1717
assert n == 0x600D;

branches/snap-stage3/src/test/run-pass/const-enum-tuplestruct.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ enum E { V16(u16), V32(u32) }
1212
struct S(E, u16, u16);
1313
const C: S = S(V16(0xDEAD), 0x600D, 0xBAD);
1414

15-
fn main() {
15+
pub fn main() {
1616
let S(_, n, _) = C;
1717
assert n != 0xBAD;
1818
assert n == 0x600D;

branches/snap-stage3/src/test/run-pass/const-enum-tuplestruct2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ enum E { V0, V16(u16) }
1212
struct S(E, u16, u16);
1313
const C: S = S(V0, 0x600D, 0xBAD);
1414

15-
fn main() {
15+
pub fn main() {
1616
let S(_, n, _) = C;
1717
assert n != 0xBAD;
1818
assert n == 0x600D;

branches/snap-stage3/src/test/run-pass/const-enum-vec-index.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const C: &[E] = &[V0, V1(0xDEADBEE)];
1313
const C0: E = C[0];
1414
const C1: E = C[1];
1515

16-
fn main() {
16+
pub fn main() {
1717
match C0 {
1818
V0 => (),
1919
_ => fail!()

branches/snap-stage3/src/test/run-pass/const-enum-vec-ptr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
enum E { V1(int), V0 }
1212
const C: &static/[E] = &[V0, V1(0xDEADBEE), V0];
1313

14-
fn main() {
14+
pub fn main() {
1515
match C[1] {
1616
V1(n) => assert(n == 0xDEADBEE),
1717
_ => fail!()

branches/snap-stage3/src/test/run-pass/const-enum-vector.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
enum E { V1(int), V0 }
1212
const C: [E * 3] = [V0, V1(0xDEADBEE), V0];
1313

14-
fn main() {
14+
pub fn main() {
1515
match C[1] {
1616
V1(n) => assert(n == 0xDEADBEE),
1717
_ => fail!()

branches/snap-stage3/src/test/run-pass/impl-privacy-xc-1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
extern mod impl_privacy_xc_1;
55

6-
fn main() {
6+
pub fn main() {
77
let fish = impl_privacy_xc_1::Fish { x: 1 };
88
fish.swim();
99
}

branches/snap-stage3/src/test/run-pass/impl-privacy-xc-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
extern mod impl_privacy_xc_2;
55

6-
fn main() {
6+
pub fn main() {
77
let fish1 = impl_privacy_xc_2::Fish { x: 1 };
88
let fish2 = impl_privacy_xc_2::Fish { x: 2 };
99
io::println(if fish1.eq(&fish2) { "yes" } else { "no " });

0 commit comments

Comments
 (0)