Skip to content

Commit 10c9641

Browse files
committed
---
yaml --- r: 138398 b: refs/heads/master c: e6a1936 h: refs/heads/master v: v3
1 parent eb05403 commit 10c9641

File tree

4 files changed

+423
-51
lines changed

4 files changed

+423
-51
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: 04386f4217275f3a745820af476d8af2a2b4a492
2+
refs/heads/master: e6a1936d26d03759d80f2f53411c883cc3462ef4
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5

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)