Skip to content

Commit a674591

Browse files
committed
---
yaml --- r: 185799 b: refs/heads/auto c: 717a91d h: refs/heads/master i: 185797: 5ce52f9 185795: 30cf60f 185791: 31753b2 v: v3
1 parent 486c3c7 commit a674591

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
@@ -10,7 +10,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
1010
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1111
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1212
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
13-
refs/heads/auto: dab394c2db5d62dce64ac13af35bb2f18357c9d8
13+
refs/heads/auto: 717a91d6651598994834d056c69e6c4bf2b74b9f
1414
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1515
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1616
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

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