提交 704ed4c7 编写于 作者: N Niko Matsakis

Address nits.

上级 a535f2aa
......@@ -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,15 +1045,10 @@ fn assemble_candidates_from_object_ty(&mut self,
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(()) => {
debug!("assemble_candidates_from_object_ty: matched, pushing candidate");
candidates.vec.push(ObjectCandidate);
}
Err(()) => { }
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);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册