rollup merge of #18527 : bkoropoff/issue-18490

This commit is contained in:
Alex Crichton 2014-11-02 18:45:27 -08:00
commit bb7805f58f
2 changed files with 32 additions and 1 deletions

View file

@ -187,7 +187,11 @@ pub fn check_object_safety(tcx: &ty::ctxt, object_trait: &ty::TyTrait, span: Spa
receiver through a trait object", method_name))
}
ty::StaticExplicitSelfCategory |
ty::StaticExplicitSelfCategory => {
// Static methods are always object-safe since they
// can't be called through a trait object
return msgs
}
ty::ByReferenceExplicitSelfCategory(..) |
ty::ByBoxExplicitSelfCategory => {}
}