Address nits.
This commit is contained in:
parent
a535f2aab1
commit
704ed4c7d0
2 changed files with 8 additions and 14 deletions
|
@ -38,17 +38,16 @@ pub enum ObjectSafetyViolation<'tcx> {
|
||||||
/// Reasons a method might not be object-safe.
|
/// Reasons a method might not be object-safe.
|
||||||
#[deriving(Copy,Clone,Show)]
|
#[deriving(Copy,Clone,Show)]
|
||||||
pub enum MethodViolationCode {
|
pub enum MethodViolationCode {
|
||||||
/// fn(self),
|
/// e.g., `fn(self)`
|
||||||
ByValueSelf,
|
ByValueSelf,
|
||||||
|
|
||||||
// fn foo()
|
/// e.g., `fn foo()`
|
||||||
StaticMethod,
|
StaticMethod,
|
||||||
|
|
||||||
// fn foo(&self, x: Self)
|
/// e.g., `fn foo(&self, x: Self)` or `fn foo(&self) -> Self`
|
||||||
// fn foo(&self) -> Self
|
|
||||||
ReferencesSelf,
|
ReferencesSelf,
|
||||||
|
|
||||||
// fn foo<A>(),
|
/// e.g., `fn foo<A>()`
|
||||||
Generic,
|
Generic,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1045,15 +1045,10 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
||||||
upcast_trait_ref.repr(self.tcx()));
|
upcast_trait_ref.repr(self.tcx()));
|
||||||
|
|
||||||
// check whether the upcast version of the trait-ref matches what we are looking for
|
// check whether the upcast version of the trait-ref matches what we are looking for
|
||||||
match
|
if let Ok(()) = self.infcx.probe(|_| self.match_poly_trait_ref(obligation,
|
||||||
self.infcx.probe(
|
upcast_trait_ref.clone())) {
|
||||||
|_| self.match_poly_trait_ref(obligation, upcast_trait_ref.clone()))
|
debug!("assemble_candidates_from_object_ty: matched, pushing candidate");
|
||||||
{
|
candidates.vec.push(ObjectCandidate);
|
||||||
Ok(()) => {
|
|
||||||
debug!("assemble_candidates_from_object_ty: matched, pushing candidate");
|
|
||||||
candidates.vec.push(ObjectCandidate);
|
|
||||||
}
|
|
||||||
Err(()) => { }
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue