parent
88b0b511be
commit
b7fe83d573
11 changed files with 93 additions and 12 deletions
|
@ -85,6 +85,7 @@ use std::vec;
|
||||||
|
|
||||||
/// Name of an option. Either a string or a single char.
|
/// Name of an option. Either a string or a single char.
|
||||||
#[deriving(Clone, Eq)]
|
#[deriving(Clone, Eq)]
|
||||||
|
#[allow(missing_doc)]
|
||||||
pub enum Name {
|
pub enum Name {
|
||||||
Long(~str),
|
Long(~str),
|
||||||
Short(char),
|
Short(char),
|
||||||
|
@ -92,6 +93,7 @@ pub enum Name {
|
||||||
|
|
||||||
/// Describes whether an option has an argument.
|
/// Describes whether an option has an argument.
|
||||||
#[deriving(Clone, Eq)]
|
#[deriving(Clone, Eq)]
|
||||||
|
#[allow(missing_doc)]
|
||||||
pub enum HasArg {
|
pub enum HasArg {
|
||||||
Yes,
|
Yes,
|
||||||
No,
|
No,
|
||||||
|
@ -100,6 +102,7 @@ pub enum HasArg {
|
||||||
|
|
||||||
/// Describes how often an option may occur.
|
/// Describes how often an option may occur.
|
||||||
#[deriving(Clone, Eq)]
|
#[deriving(Clone, Eq)]
|
||||||
|
#[allow(missing_doc)]
|
||||||
pub enum Occur {
|
pub enum Occur {
|
||||||
Req,
|
Req,
|
||||||
Optional,
|
Optional,
|
||||||
|
@ -141,6 +144,7 @@ pub struct Matches {
|
||||||
/// The type returned when the command line does not conform to the
|
/// The type returned when the command line does not conform to the
|
||||||
/// expected format. Pass this value to <fail_str> to get an error message.
|
/// expected format. Pass this value to <fail_str> to get an error message.
|
||||||
#[deriving(Clone, Eq, ToStr)]
|
#[deriving(Clone, Eq, ToStr)]
|
||||||
|
#[allow(missing_doc)]
|
||||||
pub enum Fail_ {
|
pub enum Fail_ {
|
||||||
ArgumentMissing(~str),
|
ArgumentMissing(~str),
|
||||||
UnrecognizedOption(~str),
|
UnrecognizedOption(~str),
|
||||||
|
@ -151,6 +155,7 @@ pub enum Fail_ {
|
||||||
|
|
||||||
/// The type of failure that occured.
|
/// The type of failure that occured.
|
||||||
#[deriving(Eq)]
|
#[deriving(Eq)]
|
||||||
|
#[allow(missing_doc)]
|
||||||
pub enum FailType {
|
pub enum FailType {
|
||||||
ArgumentMissing_,
|
ArgumentMissing_,
|
||||||
UnrecognizedOption_,
|
UnrecognizedOption_,
|
||||||
|
|
|
@ -13,12 +13,14 @@
|
||||||
|
|
||||||
|
|
||||||
#[deriving(Clone, Eq)]
|
#[deriving(Clone, Eq)]
|
||||||
|
#[allow(missing_doc)]
|
||||||
pub enum List<T> {
|
pub enum List<T> {
|
||||||
Cons(T, @List<T>),
|
Cons(T, @List<T>),
|
||||||
Nil,
|
Nil,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[deriving(Eq)]
|
#[deriving(Eq)]
|
||||||
|
#[allow(missing_doc)]
|
||||||
pub enum MutList<T> {
|
pub enum MutList<T> {
|
||||||
MutCons(T, @mut MutList<T>),
|
MutCons(T, @mut MutList<T>),
|
||||||
MutNil,
|
MutNil,
|
||||||
|
|
|
@ -38,6 +38,7 @@ use std::to_str::ToStr;
|
||||||
/// An identifier in the pre-release or build metadata. If the identifier can
|
/// An identifier in the pre-release or build metadata. If the identifier can
|
||||||
/// be parsed as a decimal value, it will be represented with `Numeric`.
|
/// be parsed as a decimal value, it will be represented with `Numeric`.
|
||||||
#[deriving(Clone, Eq)]
|
#[deriving(Clone, Eq)]
|
||||||
|
#[allow(missing_doc)]
|
||||||
pub enum Identifier {
|
pub enum Identifier {
|
||||||
Numeric(uint),
|
Numeric(uint),
|
||||||
AlphaNumeric(~str)
|
AlphaNumeric(~str)
|
||||||
|
|
|
@ -39,6 +39,7 @@ enum FormatState {
|
||||||
|
|
||||||
/// Types of parameters a capability can use
|
/// Types of parameters a capability can use
|
||||||
#[deriving(Clone)]
|
#[deriving(Clone)]
|
||||||
|
#[allow(missing_doc)]
|
||||||
pub enum Param {
|
pub enum Param {
|
||||||
String(~str),
|
String(~str),
|
||||||
Number(int)
|
Number(int)
|
||||||
|
|
|
@ -116,6 +116,7 @@ struct UuidFields {
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Error details for string parsing failures
|
/// Error details for string parsing failures
|
||||||
|
#[allow(missing_doc)]
|
||||||
pub enum ParseError {
|
pub enum ParseError {
|
||||||
ErrorInvalidLength(uint),
|
ErrorInvalidLength(uint),
|
||||||
ErrorInvalidCharacter(char, uint),
|
ErrorInvalidCharacter(char, uint),
|
||||||
|
|
|
@ -1327,6 +1327,18 @@ impl MissingDocLintVisitor {
|
||||||
// otherwise, warn!
|
// otherwise, warn!
|
||||||
cx.span_lint(missing_doc, sp, msg);
|
cx.span_lint(missing_doc, sp, msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn check_struct(&mut self, cx: @mut Context, sdef: @ast::struct_def) {
|
||||||
|
for field in sdef.fields.iter() {
|
||||||
|
match field.node.kind {
|
||||||
|
ast::named_field(_, vis) if vis != ast::private => {
|
||||||
|
self.check_attrs(cx, field.node.attrs, field.span,
|
||||||
|
"missing documentation for a field");
|
||||||
|
}
|
||||||
|
ast::unnamed_field | ast::named_field(*) => {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Visitor<@mut Context> for MissingDocLintVisitor {
|
impl Visitor<@mut Context> for MissingDocLintVisitor {
|
||||||
|
@ -1371,35 +1383,49 @@ impl SubitemStoppableVisitor for MissingDocLintVisitor {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn visit_item_action(&mut self, it:@ast::item, cx:@mut Context) {
|
fn visit_item_action(&mut self, it:@ast::item, cx:@mut Context) {
|
||||||
|
if it.vis != ast::public {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
match it.node {
|
match it.node {
|
||||||
// Go ahead and match the fields here instead of using
|
// Go ahead and match the fields here instead of using
|
||||||
// visit_struct_field while we have access to the enclosing
|
// visit_struct_field while we have access to the enclosing
|
||||||
// struct's visibility
|
// struct's visibility
|
||||||
ast::item_struct(sdef, _) if it.vis == ast::public => {
|
ast::item_struct(sdef, _) => {
|
||||||
self.check_attrs(cx, it.attrs, it.span,
|
self.check_attrs(cx, it.attrs, it.span,
|
||||||
"missing documentation for a struct");
|
"missing documentation for a struct");
|
||||||
for field in sdef.fields.iter() {
|
self.check_struct(cx, sdef);
|
||||||
match field.node.kind {
|
|
||||||
ast::named_field(_, vis) if vis != ast::private => {
|
|
||||||
self.check_attrs(cx, field.node.attrs, field.span,
|
|
||||||
"missing documentation for a field");
|
|
||||||
}
|
|
||||||
ast::unnamed_field | ast::named_field(*) => {}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ast::item_trait(*) if it.vis == ast::public => {
|
ast::item_trait(*) => {
|
||||||
self.check_attrs(cx, it.attrs, it.span,
|
self.check_attrs(cx, it.attrs, it.span,
|
||||||
"missing documentation for a trait");
|
"missing documentation for a trait");
|
||||||
}
|
}
|
||||||
|
|
||||||
ast::item_fn(*) if it.vis == ast::public => {
|
ast::item_fn(*) => {
|
||||||
self.check_attrs(cx, it.attrs, it.span,
|
self.check_attrs(cx, it.attrs, it.span,
|
||||||
"missing documentation for a function");
|
"missing documentation for a function");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ast::item_enum(ref edef, _) => {
|
||||||
|
self.check_attrs(cx, it.attrs, it.span,
|
||||||
|
"missing documentation for an enum");
|
||||||
|
for variant in edef.variants.iter() {
|
||||||
|
if variant.node.vis == ast::private {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
self.check_attrs(cx, variant.node.attrs, variant.span,
|
||||||
|
"missing documentation for a variant");
|
||||||
|
match variant.node.kind {
|
||||||
|
ast::struct_variant_kind(sdef) => {
|
||||||
|
self.check_struct(cx, sdef);
|
||||||
|
}
|
||||||
|
_ => ()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,17 +61,20 @@ pub struct FormatSpec<'self> {
|
||||||
|
|
||||||
/// Enum describing where an argument for a format can be located.
|
/// Enum describing where an argument for a format can be located.
|
||||||
#[deriving(Eq)]
|
#[deriving(Eq)]
|
||||||
|
#[allow(missing_doc)]
|
||||||
pub enum Position<'self> {
|
pub enum Position<'self> {
|
||||||
ArgumentNext, ArgumentIs(uint), ArgumentNamed(&'self str)
|
ArgumentNext, ArgumentIs(uint), ArgumentNamed(&'self str)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Enum of alignments which are supported.
|
/// Enum of alignments which are supported.
|
||||||
#[deriving(Eq)]
|
#[deriving(Eq)]
|
||||||
|
#[allow(missing_doc)]
|
||||||
pub enum Alignment { AlignLeft, AlignRight, AlignUnknown }
|
pub enum Alignment { AlignLeft, AlignRight, AlignUnknown }
|
||||||
|
|
||||||
/// Various flags which can be applied to format strings, the meaning of these
|
/// Various flags which can be applied to format strings, the meaning of these
|
||||||
/// flags is defined by the formatters themselves.
|
/// flags is defined by the formatters themselves.
|
||||||
#[deriving(Eq)]
|
#[deriving(Eq)]
|
||||||
|
#[allow(missing_doc)]
|
||||||
pub enum Flag {
|
pub enum Flag {
|
||||||
FlagSignPlus,
|
FlagSignPlus,
|
||||||
FlagSignMinus,
|
FlagSignMinus,
|
||||||
|
@ -82,6 +85,7 @@ pub enum Flag {
|
||||||
/// A count is used for the precision and width parameters of an integer, and
|
/// A count is used for the precision and width parameters of an integer, and
|
||||||
/// can reference either an argument or a literal integer.
|
/// can reference either an argument or a literal integer.
|
||||||
#[deriving(Eq)]
|
#[deriving(Eq)]
|
||||||
|
#[allow(missing_doc)]
|
||||||
pub enum Count {
|
pub enum Count {
|
||||||
CountIs(uint),
|
CountIs(uint),
|
||||||
CountIsParam(uint),
|
CountIsParam(uint),
|
||||||
|
@ -126,6 +130,7 @@ pub struct PluralArm<'self> {
|
||||||
///
|
///
|
||||||
/// http://www.icu-project.org/apiref/icu4c/classicu_1_1PluralRules.html
|
/// http://www.icu-project.org/apiref/icu4c/classicu_1_1PluralRules.html
|
||||||
#[deriving(Eq, IterBytes)]
|
#[deriving(Eq, IterBytes)]
|
||||||
|
#[allow(missing_doc)]
|
||||||
pub enum PluralKeyword {
|
pub enum PluralKeyword {
|
||||||
Zero, One, Two, Few, Many
|
Zero, One, Two, Few, Many
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,6 +59,7 @@ use util;
|
||||||
*/
|
*/
|
||||||
pub type Key<T> = &'static KeyValue<T>;
|
pub type Key<T> = &'static KeyValue<T>;
|
||||||
|
|
||||||
|
#[allow(missing_doc)]
|
||||||
pub enum KeyValue<T> { Key }
|
pub enum KeyValue<T> { Key }
|
||||||
|
|
||||||
trait LocalData {}
|
trait LocalData {}
|
||||||
|
|
|
@ -56,6 +56,7 @@ use clone::DeepClone;
|
||||||
|
|
||||||
/// The option type
|
/// The option type
|
||||||
#[deriving(Clone, DeepClone, Eq)]
|
#[deriving(Clone, DeepClone, Eq)]
|
||||||
|
#[allow(missing_doc)]
|
||||||
pub enum Option<T> {
|
pub enum Option<T> {
|
||||||
None,
|
None,
|
||||||
Some(T),
|
Some(T),
|
||||||
|
|
|
@ -22,6 +22,7 @@ use to_bytes::{IterBytes, Cb};
|
||||||
/// A SendStr is a string that can hold either a ~str or a &'static str.
|
/// A SendStr is a string that can hold either a ~str or a &'static str.
|
||||||
/// This can be useful as an optimization when an allocation is sometimes
|
/// This can be useful as an optimization when an allocation is sometimes
|
||||||
/// needed but the common case is statically known.
|
/// needed but the common case is statically known.
|
||||||
|
#[allow(missing_doc)]
|
||||||
pub enum SendStr {
|
pub enum SendStr {
|
||||||
SendStrOwned(~str),
|
SendStrOwned(~str),
|
||||||
SendStrStatic(&'static str)
|
SendStrStatic(&'static str)
|
||||||
|
|
|
@ -77,6 +77,43 @@ mod a {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
enum Baz {
|
||||||
|
BazA {
|
||||||
|
a: int,
|
||||||
|
priv b: int
|
||||||
|
},
|
||||||
|
BarB
|
||||||
|
}
|
||||||
|
|
||||||
|
pub enum PubBaz { //~ ERROR: missing documentation
|
||||||
|
PubBazA { //~ ERROR: missing documentation
|
||||||
|
a: int, //~ ERROR: missing documentation
|
||||||
|
priv b: int
|
||||||
|
},
|
||||||
|
|
||||||
|
priv PubBazB
|
||||||
|
}
|
||||||
|
|
||||||
|
/// dox
|
||||||
|
pub enum PubBaz2 {
|
||||||
|
/// dox
|
||||||
|
PubBaz2A {
|
||||||
|
/// dox
|
||||||
|
a: int,
|
||||||
|
priv b: int
|
||||||
|
},
|
||||||
|
priv PubBaz2B
|
||||||
|
}
|
||||||
|
|
||||||
|
#[allow(missing_doc)]
|
||||||
|
pub enum PubBaz3 {
|
||||||
|
PubBaz3A {
|
||||||
|
a: int,
|
||||||
|
priv b: int
|
||||||
|
},
|
||||||
|
priv PubBaz3B
|
||||||
|
}
|
||||||
|
|
||||||
#[doc(hidden)]
|
#[doc(hidden)]
|
||||||
pub fn baz() {}
|
pub fn baz() {}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue