Skip to content

Commit 6db179c

Browse files
committed
---
yaml --- r: 82875 b: refs/heads/auto c: 2076073 h: refs/heads/master i: 82873: ffda53d 82871: a8da686 v: v3
1 parent c6d2977 commit 6db179c

File tree

22 files changed

+229
-309
lines changed

22 files changed

+229
-309
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ refs/heads/try3: 9387340aab40a73e8424c48fd42f0c521a4875c0
1313
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
1414
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1515
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
16-
refs/heads/auto: d06043ba0b4f0ed871e5374aa0d6b37fa170dfc6
16+
refs/heads/auto: 20760739e9bbafc5a7abb0fe4249c5cf6d58ecef
1717
refs/heads/servo: af82457af293e2a842ba6b7759b70288da276167
1818
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1919
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336

branches/auto/src/libextra/extra.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,7 @@ Rust extras are part of the standard Rust distribution.
2626
url = "https://github.com/mozilla/rust/tree/master/src/libextra")];
2727

2828
#[doc(html_logo_url = "http://www.rust-lang.org/logos/rust-logo-128x128-blk.png",
29-
html_favicon_url = "http://www.rust-lang.org/favicon.ico",
30-
html_root_url = "http://static.rust-lang.org/doc/master")];
29+
html_favicon_url = "http://www.rust-lang.org/favicon.ico")];
3130

3231
#[comment = "Rust extras"];
3332
#[license = "MIT/ASL2"];

branches/auto/src/libextra/getopts.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,15 @@ use std::vec;
8585

8686
/// Name of an option. Either a string or a single char.
8787
#[deriving(Clone, Eq)]
88+
#[allow(missing_doc)]
8889
pub enum Name {
8990
Long(~str),
9091
Short(char),
9192
}
9293

9394
/// Describes whether an option has an argument.
9495
#[deriving(Clone, Eq)]
96+
#[allow(missing_doc)]
9597
pub enum HasArg {
9698
Yes,
9799
No,
@@ -100,6 +102,7 @@ pub enum HasArg {
100102

101103
/// Describes how often an option may occur.
102104
#[deriving(Clone, Eq)]
105+
#[allow(missing_doc)]
103106
pub enum Occur {
104107
Req,
105108
Optional,
@@ -141,6 +144,7 @@ pub struct Matches {
141144
/// The type returned when the command line does not conform to the
142145
/// expected format. Pass this value to <fail_str> to get an error message.
143146
#[deriving(Clone, Eq, ToStr)]
147+
#[allow(missing_doc)]
144148
pub enum Fail_ {
145149
ArgumentMissing(~str),
146150
UnrecognizedOption(~str),
@@ -151,6 +155,7 @@ pub enum Fail_ {
151155

152156
/// The type of failure that occured.
153157
#[deriving(Eq)]
158+
#[allow(missing_doc)]
154159
pub enum FailType {
155160
ArgumentMissing_,
156161
UnrecognizedOption_,

branches/auto/src/libextra/list.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,14 @@
1313

1414

1515
#[deriving(Clone, Eq)]
16+
#[allow(missing_doc)]
1617
pub enum List<T> {
1718
Cons(T, @List<T>),
1819
Nil,
1920
}
2021

2122
#[deriving(Eq)]
23+
#[allow(missing_doc)]
2224
pub enum MutList<T> {
2325
MutCons(T, @mut MutList<T>),
2426
MutNil,

branches/auto/src/libextra/semver.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ use std::to_str::ToStr;
3838
/// An identifier in the pre-release or build metadata. If the identifier can
3939
/// be parsed as a decimal value, it will be represented with `Numeric`.
4040
#[deriving(Clone, Eq)]
41+
#[allow(missing_doc)]
4142
pub enum Identifier {
4243
Numeric(uint),
4344
AlphaNumeric(~str)

branches/auto/src/libextra/terminfo/parm.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ enum FormatState {
3939

4040
/// Types of parameters a capability can use
4141
#[deriving(Clone)]
42+
#[allow(missing_doc)]
4243
pub enum Param {
4344
String(~str),
4445
Number(int)

branches/auto/src/libextra/time.rs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,6 @@ fn do_strftime(format: &str, tm: &Tm) -> ~str {
788788
}
789789

790790
fn parse_type(ch: char, tm: &Tm) -> ~str {
791-
//FIXME (#2350): Implement missing types.
792791
let die = || format!("strftime: can't understand this format {} ", ch);
793792
match ch {
794793
'A' => match tm.tm_wday as int {
@@ -920,10 +919,9 @@ fn do_strftime(format: &str, tm: &Tm) -> ~str {
920919
parse_type('b', tm),
921920
parse_type('Y', tm))
922921
}
923-
//'W' {}
922+
'W' => format!("{:02d}", (tm.tm_yday - (tm.tm_wday - 1 + 7) % 7 + 7)
923+
/ 7),
924924
'w' => (tm.tm_wday as int).to_str(),
925-
//'X' {}
926-
//'x' {}
927925
'Y' => (tm.tm_year as int + 1900).to_str(),
928926
'y' => format!("{:02d}", (tm.tm_year as int + 1900) % 100),
929927
'Z' => tm.tm_zone.clone(),
@@ -934,7 +932,7 @@ fn do_strftime(format: &str, tm: &Tm) -> ~str {
934932
m -= h * 60_i32;
935933
format!("{}{:02d}{:02d}", sign, h, m)
936934
}
937-
//'+' {}
935+
'+' => tm.rfc3339(),
938936
'%' => ~"%",
939937
_ => die()
940938
}
@@ -1297,12 +1295,13 @@ mod tests {
12971295
assert_eq!(local.strftime("%u"), ~"5");
12981296
assert_eq!(local.strftime("%V"), ~"07");
12991297
assert_eq!(local.strftime("%v"), ~"13-Feb-2009");
1300-
// assert!(local.strftime("%W") == "06");
1298+
assert_eq!(local.strftime("%W"), ~"06");
13011299
assert_eq!(local.strftime("%w"), ~"5");
1302-
// handle "%X"
1303-
// handle "%x"
1300+
assert_eq!(local.strftime("%X"), ~"15:31:30"); // FIXME (#2350): support locale
1301+
assert_eq!(local.strftime("%x"), ~"02/13/09"); // FIXME (#2350): support locale
13041302
assert_eq!(local.strftime("%Y"), ~"2009");
13051303
assert_eq!(local.strftime("%y"), ~"09");
1304+
assert_eq!(local.strftime("%+"), ~"2009-02-13T15:31:30-08:00");
13061305
13071306
// FIXME (#2350): We should probably standardize on the timezone
13081307
// abbreviation.

branches/auto/src/libextra/uuid.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,7 @@ struct UuidFields {
116116
}
117117

118118
/// Error details for string parsing failures
119+
#[allow(missing_doc)]
119120
pub enum ParseError {
120121
ErrorInvalidLength(uint),
121122
ErrorInvalidCharacter(char, uint),

branches/auto/src/librustc/middle/lint.rs

Lines changed: 38 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,6 +1351,18 @@ impl MissingDocLintVisitor {
13511351
// otherwise, warn!
13521352
cx.span_lint(missing_doc, sp, msg);
13531353
}
1354+
1355+
fn check_struct(&mut self, cx: @mut Context, sdef: @ast::struct_def) {
1356+
for field in sdef.fields.iter() {
1357+
match field.node.kind {
1358+
ast::named_field(_, vis) if vis != ast::private => {
1359+
self.check_attrs(cx, field.node.attrs, field.span,
1360+
"missing documentation for a field");
1361+
}
1362+
ast::unnamed_field | ast::named_field(*) => {}
1363+
}
1364+
}
1365+
}
13541366
}
13551367

13561368
impl Visitor<@mut Context> for MissingDocLintVisitor {
@@ -1395,35 +1407,49 @@ impl SubitemStoppableVisitor for MissingDocLintVisitor {
13951407
}
13961408

13971409
fn visit_item_action(&mut self, it:@ast::item, cx:@mut Context) {
1410+
if it.vis != ast::public {
1411+
return;
1412+
}
13981413

13991414
match it.node {
14001415
// Go ahead and match the fields here instead of using
14011416
// visit_struct_field while we have access to the enclosing
14021417
// struct's visibility
1403-
ast::item_struct(sdef, _) if it.vis == ast::public => {
1418+
ast::item_struct(sdef, _) => {
14041419
self.check_attrs(cx, it.attrs, it.span,
14051420
"missing documentation for a struct");
1406-
for field in sdef.fields.iter() {
1407-
match field.node.kind {
1408-
ast::named_field(_, vis) if vis != ast::private => {
1409-
self.check_attrs(cx, field.node.attrs, field.span,
1410-
"missing documentation for a field");
1411-
}
1412-
ast::unnamed_field | ast::named_field(*) => {}
1413-
}
1414-
}
1421+
self.check_struct(cx, sdef);
14151422
}
14161423

1417-
ast::item_trait(*) if it.vis == ast::public => {
1424+
ast::item_trait(*) => {
14181425
self.check_attrs(cx, it.attrs, it.span,
14191426
"missing documentation for a trait");
14201427
}
14211428

1422-
ast::item_fn(*) if it.vis == ast::public => {
1429+
ast::item_fn(*) => {
14231430
self.check_attrs(cx, it.attrs, it.span,
14241431
"missing documentation for a function");
14251432
}
14261433

1434+
ast::item_enum(ref edef, _) => {
1435+
self.check_attrs(cx, it.attrs, it.span,
1436+
"missing documentation for an enum");
1437+
for variant in edef.variants.iter() {
1438+
if variant.node.vis == ast::private {
1439+
continue;
1440+
}
1441+
1442+
self.check_attrs(cx, variant.node.attrs, variant.span,
1443+
"missing documentation for a variant");
1444+
match variant.node.kind {
1445+
ast::struct_variant_kind(sdef) => {
1446+
self.check_struct(cx, sdef);
1447+
}
1448+
_ => ()
1449+
}
1450+
}
1451+
}
1452+
14271453
_ => {}
14281454
}
14291455
}

branches/auto/src/librustc/middle/trans/intrinsic.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pub fn trans_intrinsic(ccx: @mut CrateContext,
6565
let val = Call(bcx, llfn, [a, b], []);
6666
let result = ExtractValue(bcx, val, 0);
6767
let overflow = ZExt(bcx, ExtractValue(bcx, val, 1), Type::bool());
68-
let ret = Load(bcx, Alloca(bcx, type_of::type_of(bcx.ccx(), t), ""));
68+
let ret = C_undef(type_of::type_of(bcx.ccx(), t));
6969
let ret = InsertValue(bcx, ret, result, 0);
7070
let ret = InsertValue(bcx, ret, overflow, 1);
7171

0 commit comments

Comments
 (0)