Skip to content

Commit 2facaf2

Browse files
committed
---
yaml --- r: 155433 b: refs/heads/try2 c: 21df9c8 h: refs/heads/master i: 155431: 9a2e9f9 v: v3
1 parent 344de21 commit 2facaf2

File tree

8 files changed

+51
-20
lines changed

8 files changed

+51
-20
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: 5d653c17a656e8fe1572c7a695e33b188eda0597
8+
refs/heads/try2: 21df9c805f6e0101cff7a04391c6c5fcff8056df
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/src/librustc/middle/typeck/check/method.rs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,7 @@ pub fn lookup<'a, 'tcx>(
158158

159159
debug!("searching inherent candidates");
160160
lcx.push_inherent_candidates(self_ty);
161-
let mme = lcx.search(self_ty);
162-
if mme.is_some() {
163-
return mme;
164-
}
165-
166161
debug!("searching extension candidates");
167-
lcx.reset_candidates();
168162
lcx.push_bound_candidates(self_ty, None);
169163
lcx.push_extension_candidates(expr.id);
170164
lcx.search(self_ty)
@@ -425,11 +419,6 @@ impl<'a, 'tcx> LookupContext<'a, 'tcx> {
425419
// ______________________________________________________________________
426420
// Candidate collection (see comment at start of file)
427421

428-
fn reset_candidates(&mut self) {
429-
self.inherent_candidates = Vec::new();
430-
self.extension_candidates = Vec::new();
431-
}
432-
433422
fn push_inherent_candidates(&mut self, self_ty: ty::t) {
434423
/*!
435424
* Collect all inherent candidates into

branches/try2/src/librustc/util/ppaux.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -881,7 +881,8 @@ impl Repr for ty::Variance {
881881
// The first `.to_string()` returns a &'static str (it is not an implementation
882882
// of the ToString trait). Because of that, we need to call `.to_string()` again
883883
// if we want to have a `String`.
884-
self.to_string().to_string()
884+
let result: &'static str = (*self).to_string();
885+
result.to_string()
885886
}
886887
}
887888

branches/try2/src/libstd/io/mod.rs

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -946,11 +946,14 @@ pub trait Reader {
946946
}
947947

948948
impl<'a> Reader for Box<Reader+'a> {
949-
fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> { self.read(buf) }
949+
fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> {
950+
let reader: &mut Reader = &mut **self;
951+
reader.read(buf)
952+
}
950953
}
951954

952955
impl<'a> Reader for &'a mut Reader+'a {
953-
fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> { self.read(buf) }
956+
fn read(&mut self, buf: &mut [u8]) -> IoResult<uint> { (*self).read(buf) }
954957
}
955958

956959
/// Returns a slice of `v` between `start` and `end`.
@@ -1281,10 +1284,14 @@ pub trait Writer {
12811284

12821285
impl<'a> Writer for Box<Writer+'a> {
12831286
#[inline]
1284-
fn write(&mut self, buf: &[u8]) -> IoResult<()> { self.write(buf) }
1287+
fn write(&mut self, buf: &[u8]) -> IoResult<()> {
1288+
(&mut **self).write(buf)
1289+
}
12851290

12861291
#[inline]
1287-
fn flush(&mut self) -> IoResult<()> { self.flush() }
1292+
fn flush(&mut self) -> IoResult<()> {
1293+
(&mut **self).flush()
1294+
}
12881295
}
12891296

12901297
impl<'a> Writer for &'a mut Writer+'a {

branches/try2/src/test/run-pass/class-cast-to-trait-cross-crate-2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use std::to_string::ToString;
1515
use cci_class_cast::kitty::cat;
1616

1717
fn print_out(thing: Box<ToString>, expected: String) {
18-
let actual = thing.to_string();
18+
let actual = (*thing).to_string();
1919
println!("{}", actual);
2020
assert_eq!(actual.to_string(), expected);
2121
}

branches/try2/src/test/run-pass/class-separate-impl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ impl fmt::Show for cat {
5858
}
5959

6060
fn print_out(thing: Box<ToString>, expected: String) {
61-
let actual = thing.to_string();
61+
let actual = (*thing).to_string();
6262
println!("{}", actual);
6363
assert_eq!(actual.to_string(), expected);
6464
}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
// Copyright 2014 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+
struct Foo;
12+
13+
impl Foo {
14+
#[allow(dead_code)]
15+
fn foo(self) {
16+
fail!("wrong method!")
17+
}
18+
}
19+
20+
trait Trait {
21+
fn foo(self);
22+
}
23+
24+
impl<'a,'b,'c> Trait for &'a &'b &'c Foo {
25+
fn foo(self) {
26+
// ok
27+
}
28+
}
29+
30+
fn main() {
31+
let x = &(&(&Foo));
32+
x.foo();
33+
}
34+

branches/try2/src/test/run-pass/issue-3702.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ pub fn main() {
1515
}
1616

1717
fn to_string(t: Box<Text>) {
18-
println!("{}", t.to_string());
18+
println!("{}", (*t).to_string());
1919
}
2020

2121
}

0 commit comments

Comments
 (0)