Skip to content

Commit fa9899c

Browse files
committed
---
yaml --- r: 193017 b: refs/heads/beta c: 717a91d h: refs/heads/master i: 193015: 9cca949 v: v3
1 parent 3348346 commit fa9899c

File tree

3 files changed

+22
-1
lines changed

3 files changed

+22
-1
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ refs/heads/automation-fail: 1bf06495443584539b958873e04cc2f864ab10e4
3131
refs/heads/issue-18208-method-dispatch-3-quick-reject: 2009f85b9f99dedcec4404418eda9ddba90258a2
3232
refs/heads/batch: b7fd822592a4fb577552d93010c4a4e14f314346
3333
refs/heads/building: 126db549b038c84269a1e4fe46f051b2c15d6970
34-
refs/heads/beta: dab394c2db5d62dce64ac13af35bb2f18357c9d8
34+
refs/heads/beta: 717a91d6651598994834d056c69e6c4bf2b74b9f
3535
refs/heads/windistfix: 7608dbad651f02e837ed05eef3d74a6662a6e928
3636
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
3737
refs/heads/tmp: de8a23bbc3a7b9cbd7574b5b91a34af59bf030e6

branches/beta/src/librustc/lint/builtin.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1577,6 +1577,14 @@ impl LintPass for MissingDoc {
15771577
tm.span, "a type method");
15781578
}
15791579

1580+
fn check_trait_method(&mut self, cx: &Context, it: &ast::TraitItem) {
1581+
if let ast::TraitItem::TypeTraitItem(ref ty) = *it {
1582+
let assoc_ty = &ty.ty_param;
1583+
self.check_missing_docs_attrs(cx, Some(assoc_ty.id), &ty.attrs,
1584+
assoc_ty.span, "an associated type");
1585+
}
1586+
}
1587+
15801588
fn check_struct_field(&mut self, cx: &Context, sf: &ast::StructField) {
15811589
if let ast::NamedField(_, vis) = sf.node.kind {
15821590
if vis == ast::Public || self.in_variant {

branches/beta/src/test/compile-fail/lint-missing-doc.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,19 @@ pub trait D {
6868
fn dummy(&self) { }
6969
}
7070

71+
/// dox
72+
pub trait E {
73+
type AssociatedType; //~ ERROR: missing documentation
74+
type AssociatedTypeDef = Self; //~ ERROR: missing documentation
75+
76+
/// dox
77+
type DocumentedType;
78+
/// dox
79+
type DocumentedTypeDef = Self;
80+
/// dox
81+
fn dummy(&self) {}
82+
}
83+
7184
impl Foo {
7285
pub fn foo() {}
7386
fn bar() {}

0 commit comments

Comments
 (0)