Skip to content

Commit 6429171

Browse files
committed
---
yaml --- r: 138412 b: refs/heads/master c: c29a752 h: refs/heads/master v: v3
1 parent 9e2f3e7 commit 6429171

40 files changed

+1466
-874
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: c245c5bbad10923b47c9f66d5f0da2913ef11a38
2+
refs/heads/master: c29a7520e7fb4a5b4d4eccfc594e05793ef6688d
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5

trunk/src/libcore/num/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1374,7 +1374,7 @@ macro_rules! checkeddiv_int_impl(
13741374
if *v == 0 || (*self == $min && *v == -1) {
13751375
None
13761376
} else {
1377-
Some(self / *v)
1377+
Some(*self / *v)
13781378
}
13791379
}
13801380
}
@@ -1395,7 +1395,7 @@ macro_rules! checkeddiv_uint_impl(
13951395
if *v == 0 {
13961396
None
13971397
} else {
1398-
Some(self / *v)
1398+
Some(*self / *v)
13991399
}
14001400
}
14011401
}

trunk/src/libcore/ops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -638,7 +638,7 @@ shr_impl!(uint u8 u16 u32 u64 int i8 i16 i32 i64)
638638
* ```
639639
*/
640640
#[lang="index"]
641-
pub trait Index<Index, Result> {
641+
pub trait Index<Index, Sized? Result> {
642642
/// The method for the indexing (`Foo[Bar]`) operation
643643
fn index<'a>(&'a self, index: &Index) -> &'a Result;
644644
}

trunk/src/librustc/middle/borrowck/graphviz.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -142,8 +142,8 @@ impl<'a, 'tcx> dot::Labeller<'a, Node<'a>, Edge<'a>> for DataflowLabeller<'a, 't
142142
}
143143

144144
impl<'a, 'tcx> dot::GraphWalk<'a, Node<'a>, Edge<'a>> for DataflowLabeller<'a, 'tcx> {
145-
fn nodes(&self) -> dot::Nodes<'a, Node<'a>> { self.inner.nodes() }
146-
fn edges(&self) -> dot::Edges<'a, Edge<'a>> { self.inner.edges() }
147-
fn source(&self, edge: &Edge<'a>) -> Node<'a> { self.inner.source(edge) }
148-
fn target(&self, edge: &Edge<'a>) -> Node<'a> { self.inner.target(edge) }
145+
fn nodes(&'a self) -> dot::Nodes<'a, Node<'a>> { self.inner.nodes() }
146+
fn edges(&'a self) -> dot::Edges<'a, Edge<'a>> { self.inner.edges() }
147+
fn source(&'a self, edge: &Edge<'a>) -> Node<'a> { self.inner.source(edge) }
148+
fn target(&'a self, edge: &Edge<'a>) -> Node<'a> { self.inner.target(edge) }
149149
}

trunk/src/librustc/middle/cfg/graphviz.rs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,29 +91,29 @@ impl<'a, 'ast> dot::Labeller<'a, Node<'a>, Edge<'a>> for LabelledCFG<'a, 'ast> {
9191
}
9292

9393
impl<'a> dot::GraphWalk<'a, Node<'a>, Edge<'a>> for &'a cfg::CFG {
94-
fn nodes(&self) -> dot::Nodes<'a, Node<'a>> {
94+
fn nodes(&'a self) -> dot::Nodes<'a, Node<'a>> {
9595
let mut v = Vec::new();
9696
self.graph.each_node(|i, nd| { v.push((i, nd)); true });
9797
dot::maybe_owned_vec::Growable(v)
9898
}
99-
fn edges(&self) -> dot::Edges<'a, Edge<'a>> {
99+
fn edges(&'a self) -> dot::Edges<'a, Edge<'a>> {
100100
self.graph.all_edges().iter().collect()
101101
}
102-
fn source(&self, edge: &Edge<'a>) -> Node<'a> {
102+
fn source(&'a self, edge: &Edge<'a>) -> Node<'a> {
103103
let i = edge.source();
104104
(i, self.graph.node(i))
105105
}
106-
fn target(&self, edge: &Edge<'a>) -> Node<'a> {
106+
fn target(&'a self, edge: &Edge<'a>) -> Node<'a> {
107107
let i = edge.target();
108108
(i, self.graph.node(i))
109109
}
110110
}
111111

112112
impl<'a, 'ast> dot::GraphWalk<'a, Node<'a>, Edge<'a>> for LabelledCFG<'a, 'ast>
113113
{
114-
fn nodes(&self) -> dot::Nodes<'a, Node<'a>> { self.cfg.nodes() }
115-
fn edges(&self) -> dot::Edges<'a, Edge<'a>> { self.cfg.edges() }
116-
fn source(&self, edge: &Edge<'a>) -> Node<'a> { self.cfg.source(edge) }
117-
fn target(&self, edge: &Edge<'a>) -> Node<'a> { self.cfg.target(edge) }
114+
fn nodes(&'a self) -> dot::Nodes<'a, Node<'a>> { self.cfg.nodes() }
115+
fn edges(&'a self) -> dot::Edges<'a, Edge<'a>> { self.cfg.edges() }
116+
fn source(&'a self, edge: &Edge<'a>) -> Node<'a> { self.cfg.source(edge) }
117+
fn target(&'a self, edge: &Edge<'a>) -> Node<'a> { self.cfg.target(edge) }
118118
}
119119

trunk/src/librustc/middle/traits/doc.rs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,4 +272,11 @@ nested obligation `int : Bar<U>` to find out that `U=uint`.
272272
It would be good to only do *just as much* nested resolution as
273273
necessary. Currently, though, we just do a full resolution.
274274
275+
## Method matching
276+
277+
Method dispach follows a slightly different path than normal trait
278+
selection. This is because it must account for the transformed self
279+
type of the receiver and various other complications. The procedure is
280+
described in `select.rs` in the "METHOD MATCHING" section.
281+
275282
*/

trunk/src/librustc/middle/traits/mod.rs

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ use syntax::codemap::{Span, DUMMY_SP};
2424
pub use self::fulfill::FulfillmentContext;
2525
pub use self::select::SelectionContext;
2626
pub use self::select::SelectionCache;
27+
pub use self::select::{MethodMatchResult, MethodMatched, MethodAmbiguous, MethodDidNotMatch};
28+
pub use self::select::{MethodMatchedData}; // intentionally don't export variants
2729
pub use self::util::supertraits;
2830
pub use self::util::transitive_bounds;
2931
pub use self::util::Supertraits;
@@ -219,22 +221,6 @@ pub struct VtableParamData {
219221
pub bound: Rc<ty::TraitRef>,
220222
}
221223

222-
pub fn evaluate_obligation<'a,'tcx>(infcx: &InferCtxt<'a,'tcx>,
223-
param_env: &ty::ParameterEnvironment,
224-
obligation: &Obligation,
225-
typer: &Typer<'tcx>)
226-
-> bool
227-
{
228-
/*!
229-
* Attempts to resolve the obligation given. Returns `None` if
230-
* we are unable to resolve, either because of ambiguity or
231-
* due to insufficient inference.
232-
*/
233-
234-
let mut selcx = select::SelectionContext::new(infcx, param_env, typer);
235-
selcx.evaluate_obligation(obligation)
236-
}
237-
238224
pub fn select_inherent_impl<'a,'tcx>(infcx: &InferCtxt<'a,'tcx>,
239225
param_env: &ty::ParameterEnvironment,
240226
typer: &Typer<'tcx>,

0 commit comments

Comments
 (0)