Skip to content

Commit 50ab1a6

Browse files
brsonthestinger
authored andcommitted
---
yaml --- r: 66431 b: refs/heads/master c: 4af7ebc h: refs/heads/master i: 66429: 1231e69 66427: 2a94f65 66423: e7aa13d 66415: 0ea0b32 66399: ec7c568 66367: 376e427 66303: 19f2cca v: v3
1 parent 545752c commit 50ab1a6

File tree

23 files changed

+184
-432
lines changed

23 files changed

+184
-432
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: d681bccb6a2141012a747cc272991a7440cb2408
2+
refs/heads/master: 4af7ebcd8f72356880abccc411a1632e8f07e1c1
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/src/libextra/rc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct RcBox<T> {
3636

3737
/// Immutable reference counted pointer type
3838
#[unsafe_no_drop_flag]
39-
#[non_sendable]
39+
#[no_send]
4040
pub struct Rc<T> {
4141
priv ptr: *mut RcBox<T>,
4242
}
@@ -168,7 +168,7 @@ struct RcMutBox<T> {
168168

169169
/// Mutable reference counted pointer type
170170
#[non_owned]
171-
#[non_sendable]
171+
#[no_send]
172172
#[mutable]
173173
#[unsafe_no_drop_flag]
174174
pub struct RcMut<T> {

trunk/src/librustc/lib/llvm.rs

Lines changed: 6 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2149,24 +2149,18 @@ impl TypeNames {
21492149
self.named_types.find_equiv(&s).map_consume(|x| Type::from_ref(*x))
21502150
}
21512151

2152-
// We have a depth count, because we seem to make infinite types.
2153-
pub fn type_to_str_depth(&self, ty: Type, depth: int) -> ~str {
2152+
pub fn type_to_str(&self, ty: Type) -> ~str {
21542153
match self.find_name(&ty) {
21552154
option::Some(name) => return name.to_owned(),
21562155
None => ()
21572156
}
21582157

2159-
if depth == 0 {
2160-
return ~"###";
2161-
}
2162-
21632158
unsafe {
21642159
let kind = ty.kind();
21652160

21662161
match kind {
21672162
Void => ~"Void",
21682163
Half => ~"Half",
2169-
Float => ~"Float",
21702164
Double => ~"Double",
21712165
X86_FP80 => ~"X86_FP80",
21722166
FP128 => ~"FP128",
@@ -2181,36 +2175,31 @@ impl TypeNames {
21812175
Function => {
21822176
let out_ty = ty.return_type();
21832177
let args = ty.func_params();
2184-
let args =
2185-
args.map(|&ty| self.type_to_str_depth(ty, depth-1)).connect(", ");
2186-
let out_ty = self.type_to_str_depth(out_ty, depth-1);
2178+
let args = args.map(|&ty| self.type_to_str(ty)).connect(", ");
2179+
let out_ty = self.type_to_str(out_ty);
21872180
fmt!("fn(%s) -> %s", args, out_ty)
21882181
}
21892182
Struct => {
21902183
let tys = ty.field_types();
2191-
let tys = tys.map(|&ty| self.type_to_str_depth(ty, depth-1)).connect(", ");
2184+
let tys = tys.map(|&ty| self.type_to_str(ty)).connect(", ");
21922185
fmt!("{%s}", tys)
21932186
}
21942187
Array => {
21952188
let el_ty = ty.element_type();
2196-
let el_ty = self.type_to_str_depth(el_ty, depth-1);
2189+
let el_ty = self.type_to_str(el_ty);
21972190
let len = ty.array_length();
21982191
fmt!("[%s x %u]", el_ty, len)
21992192
}
22002193
Pointer => {
22012194
let el_ty = ty.element_type();
2202-
let el_ty = self.type_to_str_depth(el_ty, depth-1);
2195+
let el_ty = self.type_to_str(el_ty);
22032196
fmt!("*%s", el_ty)
22042197
}
22052198
_ => fail!("Unknown Type Kind (%u)", kind as uint)
22062199
}
22072200
}
22082201
}
22092202

2210-
pub fn type_to_str(&self, ty: Type) -> ~str {
2211-
self.type_to_str_depth(ty, 30)
2212-
}
2213-
22142203
pub fn val_to_str(&self, val: ValueRef) -> ~str {
22152204
unsafe {
22162205
let ty = Type::from_ref(llvm::LLVMTypeOf(val));

trunk/src/librustc/middle/astencode.rs

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -599,10 +599,8 @@ fn encode_vtable_res(ecx: &e::EncodeContext,
599599
// ty::t doesn't work, and there is no way (atm) to have
600600
// hand-written encoding routines combine with auto-generated
601601
// ones. perhaps we should fix this.
602-
do ebml_w.emit_from_vec(*dr) |ebml_w, param_tables| {
603-
do ebml_w.emit_from_vec(**param_tables) |ebml_w, vtable_origin| {
604-
encode_vtable_origin(ecx, ebml_w, vtable_origin)
605-
}
602+
do ebml_w.emit_from_vec(*dr) |ebml_w, vtable_origin| {
603+
encode_vtable_origin(ecx, ebml_w, vtable_origin)
606604
}
607605
}
608606

@@ -634,13 +632,6 @@ fn encode_vtable_origin(ecx: &e::EncodeContext,
634632
}
635633
}
636634
}
637-
typeck::vtable_self(def_id) => {
638-
do ebml_w.emit_enum_variant("vtable_self", 2u, 1u) |ebml_w| {
639-
do ebml_w.emit_enum_variant_arg(0u) |ebml_w| {
640-
ebml_w.emit_def_id(def_id)
641-
}
642-
}
643-
}
644635
}
645636
}
646637
}
@@ -655,17 +646,13 @@ trait vtable_decoder_helpers {
655646
impl vtable_decoder_helpers for reader::Decoder {
656647
fn read_vtable_res(&mut self, xcx: @ExtendedDecodeContext)
657648
-> typeck::vtable_res {
658-
@self.read_to_vec(|this|
659-
@this.read_to_vec(|this|
660-
this.read_vtable_origin(xcx)))
649+
@self.read_to_vec(|this| this.read_vtable_origin(xcx))
661650
}
662651

663652
fn read_vtable_origin(&mut self, xcx: @ExtendedDecodeContext)
664653
-> typeck::vtable_origin {
665654
do self.read_enum("vtable_origin") |this| {
666-
do this.read_enum_variant(["vtable_static",
667-
"vtable_param",
668-
"vtable_self"])
655+
do this.read_enum_variant(["vtable_static", "vtable_param"])
669656
|this, i| {
670657
match i {
671658
0 => {
@@ -691,13 +678,6 @@ impl vtable_decoder_helpers for reader::Decoder {
691678
}
692679
)
693680
}
694-
2 => {
695-
typeck::vtable_self(
696-
do this.read_enum_variant_arg(0u) |this| {
697-
this.read_def_id(xcx)
698-
}
699-
)
700-
}
701681
// hard to avoid - user input
702682
_ => fail!("bad enum variant")
703683
}

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -461,7 +461,6 @@ pub fn get_res_dtor(ccx: @mut CrateContext,
461461
&tsubsts,
462462
None,
463463
None,
464-
None,
465464
None);
466465

467466
val
@@ -1545,15 +1544,17 @@ pub fn new_fn_ctxt_w_id(ccx: @mut CrateContext,
15451544
llfndecl: ValueRef,
15461545
id: ast::node_id,
15471546
output_type: ty::t,
1547+
impl_id: Option<ast::def_id>,
15481548
param_substs: Option<@param_substs>,
15491549
sp: Option<span>)
15501550
-> fn_ctxt {
15511551
for param_substs.iter().advance |p| { p.validate(); }
15521552

1553-
debug!("new_fn_ctxt_w_id(path=%s, id=%?, \
1553+
debug!("new_fn_ctxt_w_id(path=%s, id=%?, impl_id=%?, \
15541554
param_substs=%s)",
15551555
path_str(ccx.sess, path),
15561556
id,
1557+
impl_id,
15571558
param_substs.repr(ccx.tcx));
15581559

15591560
let llbbs = mk_standard_basic_blocks(llfndecl);
@@ -1582,6 +1583,7 @@ pub fn new_fn_ctxt_w_id(ccx: @mut CrateContext,
15821583
lllocals: @mut HashMap::new(),
15831584
llupvars: @mut HashMap::new(),
15841585
id: id,
1586+
impl_id: impl_id,
15851587
param_substs: param_substs,
15861588
span: sp,
15871589
path: path,
@@ -1602,7 +1604,7 @@ pub fn new_fn_ctxt(ccx: @mut CrateContext,
16021604
output_type: ty::t,
16031605
sp: Option<span>)
16041606
-> fn_ctxt {
1605-
new_fn_ctxt_w_id(ccx, path, llfndecl, -1, output_type, None, sp)
1607+
new_fn_ctxt_w_id(ccx, path, llfndecl, -1, output_type, None, None, sp)
16061608
}
16071609

16081610
// NB: must keep 4 fns in sync:
@@ -1771,6 +1773,7 @@ pub fn trans_closure(ccx: @mut CrateContext,
17711773
self_arg: self_arg,
17721774
param_substs: Option<@param_substs>,
17731775
id: ast::node_id,
1776+
impl_id: Option<ast::def_id>,
17741777
attributes: &[ast::attribute],
17751778
output_type: ty::t,
17761779
maybe_load_env: &fn(fn_ctxt),
@@ -1788,6 +1791,7 @@ pub fn trans_closure(ccx: @mut CrateContext,
17881791
llfndecl,
17891792
id,
17901793
output_type,
1794+
impl_id,
17911795
param_substs,
17921796
Some(body.span));
17931797
let raw_llargs = create_llargs_for_fn_args(fcx, self_arg, decl.inputs);
@@ -1846,6 +1850,7 @@ pub fn trans_fn(ccx: @mut CrateContext,
18461850
self_arg: self_arg,
18471851
param_substs: Option<@param_substs>,
18481852
id: ast::node_id,
1853+
impl_id: Option<ast::def_id>,
18491854
attrs: &[ast::attribute]) {
18501855
let do_time = ccx.sess.trans_stats();
18511856
let start = if do_time { time::get_time() }
@@ -1865,6 +1870,7 @@ pub fn trans_fn(ccx: @mut CrateContext,
18651870
self_arg,
18661871
param_substs,
18671872
id,
1873+
impl_id,
18681874
attrs,
18691875
output_type,
18701876
|fcx| {
@@ -1914,6 +1920,7 @@ pub fn trans_enum_variant(ccx: @mut CrateContext,
19141920
llfndecl,
19151921
variant.node.id,
19161922
enum_ty,
1923+
None,
19171924
param_substs,
19181925
None);
19191926

@@ -1993,6 +2000,7 @@ pub fn trans_tuple_struct(ccx: @mut CrateContext,
19932000
llfndecl,
19942001
ctor_id,
19952002
tup_ty,
2003+
None,
19962004
param_substs,
19972005
None);
19982006
@@ -2072,6 +2080,7 @@ pub fn trans_item(ccx: @mut CrateContext, item: &ast::item) {
20722080
no_self,
20732081
None,
20742082
item.id,
2083+
None,
20752084
item.attrs);
20762085
} else {
20772086
for body.node.stmts.iter().advance |stmt| {

0 commit comments

Comments
 (0)