Skip to content

Commit 7e156ec

Browse files
committed
---
yaml --- r: 187265 b: refs/heads/try c: 717a91d h: refs/heads/master i: 187263: db4ffc2 v: v3
1 parent 2525376 commit 7e156ec

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
@@ -2,7 +2,7 @@
22
refs/heads/master: b4c965ee803a4521d8b4575f634e036f93e408f3
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 3a96d6a9818fe2affc98a187fb1065120458cee9
5-
refs/heads/try: dab394c2db5d62dce64ac13af35bb2f18357c9d8
5+
refs/heads/try: 717a91d6651598994834d056c69e6c4bf2b74b9f
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/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/try/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)