Skip to content

Commit 677df6d

Browse files
committed
---
yaml --- r: 63327 b: refs/heads/snap-stage3 c: a710e61 h: refs/heads/master i: 63325: aaa6b20 63323: da49381 63319: d2cdfe9 63311: e372c2b 63295: 7a59a88 v: v3
1 parent f3a2796 commit 677df6d

31 files changed

+84
-55
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: 104e6120b1161e6d242644c987b65525daa5ad5a
4+
refs/heads/snap-stage3: a710e619038c9ff96c332eedb72a8c77a3a370be
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/RELEASES.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Version 0.7 (July 2013)
44
* ??? changes, numerous bugfixes
55

66
* Syntax changes
7-
* `#[deriving(Encodable)]`, `#[deriving(Decodable)]`
7+
* `#[deriving(Encodable)]`, `#[deriving(Decodable)]`
88

99
* Semantic changes
1010
* The `self` parameter no longer implicitly means `&'self self`,

branches/snap-stage3/src/etc/adb_run_wrapper.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# usage : adb_run_wrapper [test dir - where test executables exist] [test executable]
33
#
44

5-
# Sometimes android shell produce exitcode "1 : Text File Busy"
5+
# Sometimes android shell produce exitcode "1 : Text File Busy"
66
# Retry after $WAIT seconds, expecting resource cleaned-up
77
WAIT=10
88
PATH=$1
@@ -20,15 +20,15 @@ then
2020
while [ $L_RET -eq 1 ]
2121
do
2222
LD_LIBRARY_PATH=$PATH $PATH/$RUN $@ 1>$PATH/$RUN.stdout 2>$PATH/$RUN.stderr
23-
L_RET=$?
23+
L_RET=$?
2424
if [ $L_COUNT -gt 0 ]
2525
then
2626
/system/bin/sleep $WAIT
2727
/system/bin/sync
2828
fi
2929
L_COUNT=`expr $L_COUNT+1`
3030
done
31-
31+
3232
echo $L_RET > $PATH/$RUN.exitcode
3333

3434
fi

branches/snap-stage3/src/librustc/middle/borrowck/gather_loans/gather_moves.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,3 +161,4 @@ fn check_is_legal_to_move_from(bccx: @BorrowckCtxt,
161161
}
162162
}
163163
}
164+

branches/snap-stage3/src/librustc/middle/effect.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,3 +154,4 @@ pub fn check_crate(tcx: ty::ctxt,
154154

155155
visit::visit_crate(crate, ((), visitor))
156156
}
157+

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3094,6 +3094,7 @@ pub fn trans_crate(sess: session::Session,
30943094
const_globals: @mut HashMap::new(),
30953095
const_values: @mut HashMap::new(),
30963096
extern_const_values: @mut HashMap::new(),
3097+
impl_method_cache: @mut HashMap::new(),
30973098
module_data: @mut HashMap::new(),
30983099
lltypes: @mut HashMap::new(),
30993100
llsizingtypes: @mut HashMap::new(),

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,8 @@ pub struct CrateContext {
205205
// Cache of external const values
206206
extern_const_values: @mut HashMap<ast::def_id, ValueRef>,
207207

208+
impl_method_cache: @mut HashMap<(ast::def_id, ast::ident), ast::def_id>,
209+
208210
module_data: @mut HashMap<~str, ValueRef>,
209211
lltypes: @mut HashMap<ty::t, TypeRef>,
210212
llsizingtypes: @mut HashMap<ty::t, TypeRef>,

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

Lines changed: 30 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -381,35 +381,37 @@ pub fn method_from_methods(ms: &[@ast::method], name: ast::ident)
381381
pub fn method_with_name_or_default(ccx: @CrateContext,
382382
impl_id: ast::def_id,
383383
name: ast::ident) -> ast::def_id {
384-
if impl_id.crate == ast::local_crate {
385-
match ccx.tcx.items.get_copy(&impl_id.node) {
386-
ast_map::node_item(@ast::item {
387-
node: ast::item_impl(_, _, _, ref ms), _
388-
}, _) => {
389-
let did = method_from_methods(*ms, name);
390-
if did.is_some() {
391-
return did.get();
392-
} else {
393-
// Look for a default method
394-
let pmm = ccx.tcx.provided_methods;
395-
match pmm.find(&impl_id) {
396-
Some(pmis) => {
397-
for pmis.each |pmi| {
398-
if pmi.method_info.ident == name {
399-
debug!("pmi.method_info.did = %?", pmi.method_info.did);
400-
return pmi.method_info.did;
401-
}
402-
}
403-
fail!()
404-
}
405-
None => fail!()
406-
}
407-
}
408-
}
409-
_ => fail!("method_with_name")
384+
*do ccx.impl_method_cache.find_or_insert_with((impl_id, name)) |_| {
385+
if impl_id.crate == ast::local_crate {
386+
match ccx.tcx.items.get_copy(&impl_id.node) {
387+
ast_map::node_item(@ast::item {
388+
node: ast::item_impl(_, _, _, ref ms), _
389+
}, _) => {
390+
let did = method_from_methods(*ms, name);
391+
if did.is_some() {
392+
did.get()
393+
} else {
394+
// Look for a default method
395+
let pmm = ccx.tcx.provided_methods;
396+
match pmm.find(&impl_id) {
397+
Some(pmis) => {
398+
for pmis.each |pmi| {
399+
if pmi.method_info.ident == name {
400+
debug!("pmi.method_info.did = %?", pmi.method_info.did);
401+
return pmi.method_info.did;
402+
}
403+
}
404+
fail!()
405+
}
406+
None => fail!()
407+
}
408+
}
409+
}
410+
_ => fail!("method_with_name")
411+
}
412+
} else {
413+
csearch::get_impl_method(ccx.sess.cstore, impl_id, name)
410414
}
411-
} else {
412-
csearch::get_impl_method(ccx.sess.cstore, impl_id, name)
413415
}
414416
}
415417

branches/snap-stage3/src/librustc/middle/ty.rs

Lines changed: 20 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,8 @@ struct ctxt_ {
271271
// A cache for the trait_methods() routine
272272
trait_methods_cache: @mut HashMap<def_id, @~[@Method]>,
273273

274+
impl_trait_cache: @mut HashMap<ast::def_id, Option<@ty::TraitRef>>,
275+
274276
trait_refs: @mut HashMap<node_id, @TraitRef>,
275277
trait_defs: @mut HashMap<def_id, @TraitDef>,
276278

@@ -967,6 +969,7 @@ pub fn mk_ctxt(s: session::Session,
967969
methods: @mut HashMap::new(),
968970
trait_method_def_ids: @mut HashMap::new(),
969971
trait_methods_cache: @mut HashMap::new(),
972+
impl_trait_cache: @mut HashMap::new(),
970973
ty_param_defs: @mut HashMap::new(),
971974
adjustments: @mut HashMap::new(),
972975
normalized_cache: new_ty_hash(),
@@ -3749,22 +3752,24 @@ pub fn trait_method_def_ids(cx: ctxt, id: ast::def_id) -> @~[def_id] {
37493752
}
37503753

37513754
pub fn impl_trait_ref(cx: ctxt, id: ast::def_id) -> Option<@TraitRef> {
3752-
if id.crate == ast::local_crate {
3753-
debug!("(impl_trait_ref) searching for trait impl %?", id);
3754-
match cx.items.find(&id.node) {
3755-
Some(&ast_map::node_item(@ast::item {
3756-
node: ast::item_impl(_, opt_trait, _, _),
3757-
_},
3758-
_)) => {
3759-
match opt_trait {
3760-
Some(t) => Some(ty::node_id_to_trait_ref(cx, t.ref_id)),
3761-
None => None
3762-
}
3763-
}
3764-
_ => None
3755+
*do cx.impl_trait_cache.find_or_insert_with(id) |_| {
3756+
if id.crate == ast::local_crate {
3757+
debug!("(impl_trait_ref) searching for trait impl %?", id);
3758+
match cx.items.find(&id.node) {
3759+
Some(&ast_map::node_item(@ast::item {
3760+
node: ast::item_impl(_, opt_trait, _, _),
3761+
_},
3762+
_)) => {
3763+
match opt_trait {
3764+
Some(t) => Some(ty::node_id_to_trait_ref(cx, t.ref_id)),
3765+
None => None
3766+
}
3767+
}
3768+
_ => None
3769+
}
3770+
} else {
3771+
csearch::get_impl_trait(cx, id)
37653772
}
3766-
} else {
3767-
csearch::get_impl_trait(cx, id)
37683773
}
37693774
}
37703775

branches/snap-stage3/src/libstd/core.rc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -232,3 +232,4 @@ mod std {
232232
pub use str;
233233
pub use os;
234234
}
235+

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -947,7 +947,6 @@ pub mod windows {
947947
mod tests {
948948
use option::{None, Some};
949949
use path::{PosixPath, WindowsPath, windows};
950-
use str;
951950

952951
#[test]
953952
fn test_double_slash_collapsing() {

branches/snap-stage3/src/libstd/rt/comm.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -615,3 +615,4 @@ mod test {
615615
}
616616
}
617617
}
618+

branches/snap-stage3/src/libstd/rt/io/stdio.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,3 +50,4 @@ impl Writer for StdWriter {
5050

5151
fn flush(&mut self) { fail!() }
5252
}
53+

branches/snap-stage3/src/libstd/rt/task.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,3 +228,4 @@ mod test {
228228
}
229229
}
230230
}
231+

branches/snap-stage3/src/libstd/rt/test.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,3 +189,4 @@ pub fn stress_factor() -> uint {
189189
None => 1
190190
}
191191
}
192+

branches/snap-stage3/src/libsyntax/ext/pipes/ast_builder.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,4 @@ impl append_types for @ast::Path {
6363
}
6464
}
6565
}
66+

branches/snap-stage3/src/rt/rust_env.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,3 +156,4 @@ free_env(rust_env *env) {
156156
free(env->rust_seed);
157157
free(env);
158158
}
159+

branches/snap-stage3/src/rustllvm/rustllvm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,3 +54,4 @@
5454
#include <fcntl.h>
5555
#include <unistd.h>
5656
#endif
57+

branches/snap-stage3/src/test/auxiliary/anon-extern-mod-cross-crate-1.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,4 @@ use std::libc;
2020
extern {
2121
pub fn rust_get_argc() -> libc::c_int;
2222
}
23+

branches/snap-stage3/src/test/auxiliary/private_variant_xc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@ pub enum Foo {
22
pub Bar,
33
priv Baz,
44
}
5+

branches/snap-stage3/src/test/auxiliary/use_from_trait_xc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@ struct Foo;
77
impl Foo {
88
pub fn new() {}
99
}
10+

branches/snap-stage3/src/test/compile-fail/lint-unused-import-tricky-names.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,4 @@ mod issue6935 {
4444
}
4545

4646
fn main(){}
47+

branches/snap-stage3/src/test/compile-fail/private-variant-xc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ pub fn main() {
66
let _ = private_variant_xc::Bar;
77
let _ = private_variant_xc::Baz; //~ ERROR unresolved name
88
}
9+

branches/snap-stage3/src/test/compile-fail/use-from-trait-xc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ use use_from_trait_xc::Foo::new; //~ ERROR cannot import from a trait or type
99

1010
fn main() {
1111
}
12+

branches/snap-stage3/src/test/compile-fail/use-from-trait.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@ impl Foo {
1414
}
1515

1616
fn main() {}
17+

branches/snap-stage3/src/test/run-pass/auto-encode.rs

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

13-
// xfail-test #6122
14-
1513
#[forbid(deprecated_pattern)];
1614

1715
extern mod extra;

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ struct Bar {
1111
static bar: Bar = Bar { i: 0, v: IntVal(0) };
1212

1313
fn main() {}
14+

branches/snap-stage3/src/test/run-pass/issue-4735.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,5 @@ fn main() {
2626
let p = unsafe { transmute::<~int, *c_void>(t) };
2727
let z = NonCopyable(p);
2828
}
29+
30+

branches/snap-stage3/src/test/run-pass/monomorphize-abi-alignment.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ struct A((u32, u32));
2424
struct B(u64);
2525

2626
pub fn main() {
27-
static Ca: S<A> = S { i: 0, t: A((13, 104)) };
28-
static Cb: S<B> = S { i: 0, t: B(31337) };
29-
assert_eq!(*(Ca.unwrap()), (13, 104));
30-
assert_eq!(*(Cb.unwrap()), 31337);
27+
static Ca: S<A> = S { i: 0, t: A((13, 104)) };
28+
static Cb: S<B> = S { i: 0, t: B(31337) };
29+
assert_eq!(*(Ca.unwrap()), (13, 104));
30+
assert_eq!(*(Cb.unwrap()), 31337);
3131
}

branches/snap-stage3/src/test/run-pass/multi-let.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,4 @@ pub fn main() {
1313
let y = x;
1414
assert!((y == 10));
1515
}
16+

branches/snap-stage3/src/test/run-pass/pub-extern-privacy.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ fn main() {
1111
a::free(transmute(0));
1212
}
1313
}
14+

0 commit comments

Comments
 (0)