Skip to content

Commit b5587f7

Browse files
committed
---
yaml --- r: 62750 b: refs/heads/snap-stage3 c: 32c6199 h: refs/heads/master v: v3
1 parent 2403415 commit b5587f7

File tree

67 files changed

+1
-83
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1
-83
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 5d04ee805b96d34e7c5b316270a730fd9a0c537f
4+
refs/heads/snap-stage3: 32c619916179ff373a145b3006c5c19362af9b15
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/lint.rs

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,6 @@ pub enum lint {
8282
dead_assignment,
8383
unused_mut,
8484
unnecessary_allocation,
85-
86-
missing_struct_doc,
87-
missing_trait_doc,
8885
}
8986

9087
pub fn level_to_str(lv: level) -> &'static str {
@@ -255,20 +252,6 @@ static lint_table: &'static [(&'static str, LintSpec)] = &[
255252
desc: "detects unnecessary allocations that can be eliminated",
256253
default: warn
257254
}),
258-
259-
("missing_struct_doc",
260-
LintSpec {
261-
lint: missing_struct_doc,
262-
desc: "detects missing documentation for structs",
263-
default: allow
264-
}),
265-
266-
("missing_trait_doc",
267-
LintSpec {
268-
lint: missing_trait_doc,
269-
desc: "detects missing documentation for traits",
270-
default: allow
271-
}),
272255
];
273256

274257
/*
@@ -948,69 +931,6 @@ fn lint_unnecessary_allocations(cx: @mut Context) -> visit::vt<()> {
948931
})
949932
}
950933

951-
fn lint_missing_struct_doc(cx: @mut Context) -> visit::vt<()> {
952-
visit::mk_simple_visitor(@visit::SimpleVisitor {
953-
visit_struct_field: |field| {
954-
let relevant = match field.node.kind {
955-
ast::named_field(_, vis) => vis != ast::private,
956-
ast::unnamed_field => false,
957-
};
958-
959-
if relevant {
960-
let mut has_doc = false;
961-
for field.node.attrs.each |attr| {
962-
if attr.node.is_sugared_doc {
963-
has_doc = true;
964-
break;
965-
}
966-
}
967-
if !has_doc {
968-
cx.span_lint(missing_struct_doc, field.span, "missing documentation \
969-
for a field.");
970-
}
971-
}
972-
},
973-
.. *visit::default_simple_visitor()
974-
})
975-
}
976-
977-
fn lint_missing_trait_doc(cx: @mut Context) -> visit::vt<()> {
978-
visit::mk_simple_visitor(@visit::SimpleVisitor {
979-
visit_trait_method: |method| {
980-
let mut has_doc = false;
981-
let span = match copy *method {
982-
ast::required(m) => {
983-
for m.attrs.each |attr| {
984-
if attr.node.is_sugared_doc {
985-
has_doc = true;
986-
break;
987-
}
988-
}
989-
m.span
990-
},
991-
ast::provided(m) => {
992-
if m.vis == ast::private {
993-
has_doc = true;
994-
} else {
995-
for m.attrs.each |attr| {
996-
if attr.node.is_sugared_doc {
997-
has_doc = true;
998-
break;
999-
}
1000-
}
1001-
}
1002-
m.span
1003-
}
1004-
};
1005-
if !has_doc {
1006-
cx.span_lint(missing_trait_doc, span, "missing documentation \
1007-
for a method.");
1008-
}
1009-
},
1010-
.. *visit::default_simple_visitor()
1011-
})
1012-
}
1013-
1014934
pub fn check_crate(tcx: ty::ctxt, crate: @ast::crate) {
1015935
let cx = @mut Context {
1016936
dict: @get_lint_dict(),
@@ -1039,8 +959,6 @@ pub fn check_crate(tcx: ty::ctxt, crate: @ast::crate) {
1039959
cx.add_lint(lint_unused_mut(cx));
1040960
cx.add_lint(lint_session(cx));
1041961
cx.add_lint(lint_unnecessary_allocations(cx));
1042-
cx.add_lint(lint_missing_struct_doc(cx));
1043-
cx.add_lint(lint_missing_trait_doc(cx));
1044962

1045963
// type inference doesn't like this being declared below, we need to tell it
1046964
// what the type of this first function is...

0 commit comments

Comments
 (0)