Skip to content

Commit f83029f

Browse files
committed
---
yaml --- r: 63873 b: refs/heads/snap-stage3 c: 8883099 h: refs/heads/master i: 63871: 2ae6147 v: v3
1 parent 7473082 commit f83029f

File tree

11 files changed

+192
-12
lines changed

11 files changed

+192
-12
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: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 2a40c5db469b5065f64c69ae7874f162ff2669a8
4+
refs/heads/snap-stage3: 88830996d811be3ff833ba590c98f28daaf31f43
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/Makefile.in

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,10 +540,19 @@ ALL_TARGET_RULES = $(foreach target,$(CFG_TARGET_TRIPLES), \
540540
$(foreach host,$(CFG_HOST_TRIPLES), \
541541
all-target-$(target)-host-$(host)))
542542

543-
all: $(ALL_TARGET_RULES) $(GENERATED) docs
543+
all: rustllvm/llvm-auto-clean-stamp \
544+
$(ALL_TARGET_RULES) $(GENERATED) docs
544545

545546
endif
546547

548+
# This is used to independently force an LLVM clean rebuild
549+
# when we changed something not otherwise captured by builtin
550+
# dependencies. In these cases, commit a change that touches
551+
# the stamp in the source dir.
552+
rustllvm/llvm-auto-clean-stamp: $(S)src/rustllvm/llvm-auto-clean-trigger
553+
$(Q)$(MAKE) clean-llvm
554+
touch $@
555+
547556

548557
######################################################################
549558
# Re-configuration

branches/snap-stage3/mk/clean.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ CLEAN_LLVM_RULES = \
2323
$(foreach target, $(CFG_TARGET_TRIPLES), \
2424
clean-llvm$(target))
2525

26-
.PHONY: clean clean-all clean-misc
26+
.PHONY: clean clean-all clean-misc clean-llvm
2727

2828
clean-all: clean clean-llvm
2929

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

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,7 +615,10 @@ pub fn trans_call_inner(in_cx: block,
615615
}
616616
Method(d) => {
617617
// Weird but true: we pass self in the *environment* slot!
618-
(d.llfn, d.llself)
618+
let llself = PointerCast(bcx,
619+
d.llself,
620+
Type::opaque_box(ccx).ptr_to());
621+
(d.llfn, llself)
619622
}
620623
Closure(d) => {
621624
// Closures are represented as (llfn, llclosure) pair:
@@ -927,7 +930,7 @@ pub fn trans_arg_expr(bcx: block,
927930
ByRef(_) => val = scratch.val,
928931
}
929932
} else {
930-
debug!("by copy arg with type %s", bcx.ty_to_str(arg_datum.ty));
933+
debug!("by copy arg with type %s");
931934
match arg_datum.mode {
932935
ByRef(_) => val = Load(bcx, arg_datum.val),
933936
ByValue => val = arg_datum.val,
@@ -941,6 +944,10 @@ pub fn trans_arg_expr(bcx: block,
941944
if formal_arg_ty != arg_datum.ty {
942945
// this could happen due to e.g. subtyping
943946
let llformal_arg_ty = type_of::type_of_explicit_arg(ccx, &formal_arg_ty);
947+
let llformal_arg_ty = match self_mode {
948+
ty::ByRef => llformal_arg_ty.ptr_to(),
949+
ty::ByCopy => llformal_arg_ty,
950+
};
944951
debug!("casting actual type (%s) to match formal (%s)",
945952
bcx.val_to_str(val), bcx.llty_str(llformal_arg_ty));
946953
val = PointerCast(bcx, val, llformal_arg_ty);

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

Lines changed: 22 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ pub fn trans_self_arg(bcx: block,
133133
let _icx = push_ctxt("impl::trans_self_arg");
134134
let mut temp_cleanups = ~[];
135135

136-
// self is passed as an opaque box in the environment slot
137-
let self_ty = ty::mk_opaque_box(bcx.tcx());
136+
// Compute the type of self.
137+
let self_ty = monomorphize_type(bcx, mentry.self_ty);
138138
let result = trans_arg_expr(bcx,
139139
self_ty,
140140
mentry.self_mode,
@@ -576,6 +576,7 @@ pub fn trans_trait_callee_from_llval(bcx: block,
576576
let llbox = Load(bcx, GEPi(bcx, llpair, [0u, abi::trt_field_box]));
577577

578578
// Munge `llself` appropriately for the type of `self` in the method.
579+
let self_mode;
579580
match explicit_self {
580581
ast::sty_static => {
581582
bcx.tcx().sess.bug("shouldn't see static method here");
@@ -596,6 +597,12 @@ pub fn trans_trait_callee_from_llval(bcx: block,
596597
llself = llbox;
597598
}
598599
}
600+
601+
let llscratch = alloca(bcx, val_ty(llself));
602+
Store(bcx, llself, llscratch);
603+
llself = llscratch;
604+
605+
self_mode = ty::ByRef;
599606
}
600607
ast::sty_box(_) => {
601608
// Bump the reference count on the box.
@@ -608,20 +615,28 @@ pub fn trans_trait_callee_from_llval(bcx: block,
608615
ty::BoxTraitStore => llself = llbox,
609616
_ => bcx.tcx().sess.bug("@self receiver with non-@Trait")
610617
}
618+
619+
let llscratch = alloca(bcx, val_ty(llself));
620+
Store(bcx, llself, llscratch);
621+
llself = llscratch;
622+
623+
self_mode = ty::ByRef;
611624
}
612625
ast::sty_uniq(_) => {
613626
// Pass the unique pointer.
614627
match store {
615628
ty::UniqTraitStore => llself = llbox,
616629
_ => bcx.tcx().sess.bug("~self receiver with non-~Trait")
617630
}
631+
632+
let llscratch = alloca(bcx, val_ty(llself));
633+
Store(bcx, llself, llscratch);
634+
llself = llscratch;
635+
636+
self_mode = ty::ByRef;
618637
}
619638
}
620639

621-
let llscratch = alloca(bcx, val_ty(llself));
622-
Store(bcx, llself, llscratch);
623-
llself = PointerCast(bcx, llscratch, Type::opaque_box(ccx).ptr_to());
624-
625640
// Load the function from the vtable and cast it to the expected type.
626641
debug!("(translating trait callee) loading method");
627642
let llcallee_ty = type_of_fn_from_ty(ccx, callee_ty);
@@ -637,7 +652,7 @@ pub fn trans_trait_callee_from_llval(bcx: block,
637652
llfn: mptr,
638653
llself: llself,
639654
self_ty: ty::mk_opaque_box(bcx.tcx()),
640-
self_mode: ty::ByRef,
655+
self_mode: self_mode,
641656
explicit_self: explicit_self
642657
/* XXX: Some(llbox) */
643658
})

branches/snap-stage3/src/rustllvm/llvm-auto-clean-trigger

Whitespace-only changes.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
12+
use std::io;
13+
14+
macro_rules! print_hd_tl (
15+
($field_hd:ident, $($field_tl:ident),+) => ({
16+
io::print(stringify!($field)); //~ ERROR unknown macro variable
17+
io::print("::[");
18+
$(
19+
io::print(stringify!($field_tl));
20+
io::print(", ");
21+
)+
22+
io::print("]\n");
23+
})
24+
)
25+
26+
fn main() {
27+
print_hd_tl!(x, y, z, w)
28+
}
29+
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
use std::{pipes, io, task, comm};
12+
13+
fn main() {
14+
let (port, chan) = comm::stream();
15+
16+
do task::spawn {
17+
io::println(port.recv());
18+
}
19+
20+
chan.send("hello, world");
21+
}
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
use std::io;
12+
13+
macro_rules! print_hd_tl (
14+
($field_hd:ident, $($field_tl:ident),+) => ({
15+
io::print(stringify!($field_hd));
16+
io::print("::[");
17+
$(
18+
io::print(stringify!($field_tl));
19+
io::print(", ");
20+
)+
21+
io::print("]\n");
22+
})
23+
)
24+
25+
fn main() {
26+
print_hd_tl!(x, y, z, w)
27+
}
28+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
pub trait EventLoop {
12+
}
13+
14+
pub struct UvEventLoop {
15+
uvio: int
16+
}
17+
18+
impl UvEventLoop {
19+
pub fn new() -> UvEventLoop {
20+
UvEventLoop {
21+
uvio: 0
22+
}
23+
}
24+
}
25+
26+
impl EventLoop for UvEventLoop {
27+
}
28+
29+
pub struct Scheduler {
30+
event_loop: ~EventLoop,
31+
}
32+
33+
impl Scheduler {
34+
35+
pub fn new(event_loop: ~EventLoop) -> Scheduler {
36+
Scheduler {
37+
event_loop: event_loop,
38+
}
39+
}
40+
}
41+
42+
fn main() {
43+
let mut sched = Scheduler::new(~UvEventLoop::new() as ~EventLoop);
44+
}
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
2+
// file at the top-level directory of this distribution and at
3+
// http://rust-lang.org/COPYRIGHT.
4+
//
5+
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
6+
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
7+
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
8+
// option. This file may not be copied, modified, or distributed
9+
// except according to those terms.
10+
11+
// xfail-test
12+
13+
type FontTableTag = u32;
14+
15+
trait FontTableTagConversions {
16+
fn tag_to_str(self);
17+
}
18+
19+
impl FontTableTagConversions for FontTableTag {
20+
fn tag_to_str(self) {
21+
&self;
22+
}
23+
}
24+
25+
fn main() {
26+
5.tag_to_str();
27+
}

0 commit comments

Comments
 (0)