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.
|
||||
#[deriving(Copy,Clone,Show)]
|
||||
pub enum MethodViolationCode {
|
||||
/// fn(self),
|
||||
/// e.g., `fn(self)`
|
||||
ByValueSelf,
|
||||
|
||||
// fn foo()
|
||||
/// e.g., `fn foo()`
|
||||
StaticMethod,
|
||||
|
||||
// fn foo(&self, x: Self)
|
||||
// fn foo(&self) -> Self
|
||||
/// e.g., `fn foo(&self, x: Self)` or `fn foo(&self) -> Self`
|
||||
ReferencesSelf,
|
||||
|
||||
// fn foo<A>(),
|
||||
/// e.g., `fn foo<A>()`
|
||||
Generic,
|
||||
}
|
||||
|
||||
|
|
|
@ -1045,16 +1045,11 @@ impl<'cx, 'tcx> SelectionContext<'cx, 'tcx> {
|
|||
upcast_trait_ref.repr(self.tcx()));
|
||||
|
||||
// check whether the upcast version of the trait-ref matches what we are looking for
|
||||
match
|
||||
self.infcx.probe(
|
||||
|_| self.match_poly_trait_ref(obligation, upcast_trait_ref.clone()))
|
||||
{
|
||||
Ok(()) => {
|
||||
if let Ok(()) = self.infcx.probe(|_| self.match_poly_trait_ref(obligation,
|
||||
upcast_trait_ref.clone())) {
|
||||
debug!("assemble_candidates_from_object_ty: matched, pushing candidate");
|
||||
candidates.vec.push(ObjectCandidate);
|
||||
}
|
||||
Err(()) => { }
|
||||
}
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////
|
||||
|
|
Loading…
Add table
Reference in a new issue