Skip to content

Commit 4dad907

Browse files
committed
Qualify uses of MethodContext variants.
1 parent 48aeaba commit 4dad907

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

src/librustc_lint/builtin.rs

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,6 @@
2828
//! Use the former for unit-like structs and the latter for structs with
2929
//! a `pub fn new()`.
3030
31-
use self::MethodContext::*;
32-
3331
use metadata::{csearch, decoder};
3432
use middle::def::*;
3533
use middle::subst::Substs;
@@ -870,22 +868,22 @@ fn method_context(cx: &Context, m: &ast::Method) -> MethodContext {
870868
match md {
871869
ty::MethodTraitItem(md) => {
872870
match md.container {
873-
ty::TraitContainer(..) => TraitDefaultImpl,
871+
ty::TraitContainer(..) => MethodContext::TraitDefaultImpl,
874872
ty::ImplContainer(cid) => {
875873
match ty::impl_trait_ref(cx.tcx, cid) {
876-
Some(..) => TraitImpl,
877-
None => PlainImpl
874+
Some(..) => MethodContext::TraitImpl,
875+
None => MethodContext::PlainImpl
878876
}
879877
}
880878
}
881879
}
882880
ty::TypeTraitItem(typedef) => {
883881
match typedef.container {
884-
ty::TraitContainer(..) => TraitDefaultImpl,
882+
ty::TraitContainer(..) => MethodContext::TraitDefaultImpl,
885883
ty::ImplContainer(cid) => {
886884
match ty::impl_trait_ref(cx.tcx, cid) {
887-
Some(..) => TraitImpl,
888-
None => PlainImpl
885+
Some(..) => MethodContext::TraitImpl,
886+
None => MethodContext::PlainImpl
889887
}
890888
}
891889
}
@@ -979,9 +977,9 @@ impl LintPass for NonSnakeCase {
979977
_: &ast::Block, span: Span, _: ast::NodeId) {
980978
match fk {
981979
visit::FkMethod(ident, _, m) => match method_context(cx, m) {
982-
PlainImpl
980+
MethodContext::PlainImpl
983981
=> self.check_snake_case(cx, "method", ident, span),
984-
TraitDefaultImpl
982+
MethodContext::TraitDefaultImpl
985983
=> self.check_snake_case(cx, "trait method", ident, span),
986984
_ => (),
987985
},
@@ -1563,7 +1561,7 @@ impl LintPass for MissingDoc {
15631561
_: &ast::Block, _: Span, _: ast::NodeId) {
15641562
if let visit::FkMethod(_, _, m) = fk {
15651563
// If the method is an impl for a trait, don't doc.
1566-
if method_context(cx, m) == TraitImpl { return; }
1564+
if method_context(cx, m) == MethodContext::TraitImpl { return; }
15671565

15681566
// Otherwise, doc according to privacy. This will also check
15691567
// doc for default methods defined on traits.

0 commit comments

Comments
 (0)