Skip to content

Commit 69f02f2

Browse files
committed
---
yaml --- r: 82097 b: refs/heads/master c: aaeb760 h: refs/heads/master i: 82095: 767ac4a v: v3
1 parent 718591b commit 69f02f2

Some content is hidden

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

88 files changed

+722
-494
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: b7fe83d573d8073f7d663bee5c0b3e1493b9998d
2+
refs/heads/master: aaeb7605c9aeb09374563ac7a427dfbd7d1f7892
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6c08cc2db4f98e9f07ae7d50338396c4123c2f0a
55
refs/heads/try: 70152ff55722878cde684ee6462c14c65f2c4729

trunk/src/etc/emacs/rust-mode-tests.el

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,35 @@ This is some more text. Fee fie fo fum. Humpty dumpty sat on a wall.
196196
*very very very long string
197197
*/"))
198198

199+
(ert-deftest fill-paragraph-single-line-style-with-code-before ()
200+
(test-fill-paragraph
201+
"fn foo() { }
202+
/// This is my comment. This is more of my comment. This is even more."
203+
"fn foo() { }
204+
/// This is my comment. This is
205+
/// more of my comment. This is
206+
/// even more." 14))
207+
208+
(ert-deftest fill-paragraph-single-line-style-with-code-after ()
209+
(test-fill-paragraph
210+
"/// This is my comment. This is more of my comment. This is even more.
211+
fn foo() { }"
212+
"/// This is my comment. This is
213+
/// more of my comment. This is
214+
/// even more.
215+
fn foo() { }" 1 73))
216+
217+
(ert-deftest fill-paragraph-single-line-style-code-before-and-after ()
218+
(test-fill-paragraph
219+
"fn foo() { }
220+
/// This is my comment. This is more of my comment. This is even more.
221+
fn bar() { }"
222+
"fn foo() { }
223+
/// This is my comment. This is
224+
/// more of my comment. This is
225+
/// even more.
226+
fn bar() { }" 14 67))
227+
199228
(defun test-auto-fill (initial position inserted expected)
200229
(rust-test-manip-code
201230
initial

trunk/src/etc/emacs/rust-mode.el

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,8 @@
300300
(let
301301
((fill-paragraph-function
302302
(if (not (eq fill-paragraph-function 'rust-fill-paragraph))
303-
fill-paragraph-function)))
303+
fill-paragraph-function))
304+
(fill-paragraph-handle-comment t))
304305
(apply 'fill-paragraph args)
305306
t))))))
306307

trunk/src/libextra/base64.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ impl<'self> FromBase64 for &'self str {
200200
'0'..'9' => buf |= val + 0x04,
201201
'+'|'-' => buf |= 0x3E,
202202
'/'|'_' => buf |= 0x3F,
203-
'\r'|'\n' => loop,
203+
'\r'|'\n' => continue,
204204
'=' => break,
205205
_ => return Err(format!("Invalid character '{}' at position {}",
206206
self.char_at(idx), idx))

trunk/src/libextra/fileinput.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ impl io::Reader for FileInput {
303303
let b = r.read_byte();
304304

305305
if b < 0 {
306-
loop;
306+
continue;
307307
}
308308

309309
if b == '\n' as int {

trunk/src/libextra/getopts.rs

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

8686
/// Name of an option. Either a string or a single char.
8787
#[deriving(Clone, Eq)]
88-
#[allow(missing_doc)]
8988
pub enum Name {
9089
Long(~str),
9190
Short(char),
9291
}
9392

9493
/// Describes whether an option has an argument.
9594
#[deriving(Clone, Eq)]
96-
#[allow(missing_doc)]
9795
pub enum HasArg {
9896
Yes,
9997
No,
@@ -102,7 +100,6 @@ pub enum HasArg {
102100

103101
/// Describes how often an option may occur.
104102
#[deriving(Clone, Eq)]
105-
#[allow(missing_doc)]
106103
pub enum Occur {
107104
Req,
108105
Optional,
@@ -144,7 +141,6 @@ pub struct Matches {
144141
/// The type returned when the command line does not conform to the
145142
/// expected format. Pass this value to <fail_str> to get an error message.
146143
#[deriving(Clone, Eq, ToStr)]
147-
#[allow(missing_doc)]
148144
pub enum Fail_ {
149145
ArgumentMissing(~str),
150146
UnrecognizedOption(~str),
@@ -155,7 +151,6 @@ pub enum Fail_ {
155151

156152
/// The type of failure that occured.
157153
#[deriving(Eq)]
158-
#[allow(missing_doc)]
159154
pub enum FailType {
160155
ArgumentMissing_,
161156
UnrecognizedOption_,

trunk/src/libextra/glob.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ impl Pattern {
211211
let cs = parse_char_specifiers(chars.slice(i + 2, i + 3 + j));
212212
tokens.push(AnyExcept(cs));
213213
i += j + 4;
214-
loop;
214+
continue;
215215
}
216216
}
217217
}
@@ -222,7 +222,7 @@ impl Pattern {
222222
let cs = parse_char_specifiers(chars.slice(i + 1, i + 2 + j));
223223
tokens.push(AnyWithin(cs));
224224
i += j + 3;
225-
loop;
225+
continue;
226226
}
227227
}
228228
}

trunk/src/libextra/hex.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ impl<'self> FromHex for &'self str {
100100
'0'..'9' => buf |= byte - ('0' as u8),
101101
' '|'\r'|'\n'|'\t' => {
102102
buf >>= 4;
103-
loop
103+
continue
104104
}
105105
_ => return Err(format!("Invalid character '{}' at position {}",
106106
self.char_at(idx), idx))

trunk/src/libextra/list.rs

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

1414

1515
#[deriving(Clone, Eq)]
16-
#[allow(missing_doc)]
1716
pub enum List<T> {
1817
Cons(T, @List<T>),
1918
Nil,
2019
}
2120

2221
#[deriving(Eq)]
23-
#[allow(missing_doc)]
2422
pub enum MutList<T> {
2523
MutCons(T, @mut MutList<T>),
2624
MutNil,

trunk/src/libextra/num/bigint.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -413,7 +413,7 @@ impl Integer for BigUint {
413413
}
414414
if d0.is_zero() {
415415
n = 2;
416-
loop;
416+
continue;
417417
}
418418
n = 1;
419419
// FIXME(#6102): Assignment operator for BigInt causes ICE

trunk/src/libextra/priority_queue.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ impl<T:Ord> PriorityQueue<T> {
140140
let x = replace(&mut self.data[parent], init());
141141
move_val_init(&mut self.data[pos], x);
142142
pos = parent;
143-
loop
143+
continue
144144
}
145145
break
146146
}

trunk/src/libextra/semver.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ 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)]
4241
pub enum Identifier {
4342
Numeric(uint),
4443
AlphaNumeric(~str)

trunk/src/libextra/terminfo/parm.rs

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

4040
/// Types of parameters a capability can use
4141
#[deriving(Clone)]
42-
#[allow(missing_doc)]
4342
pub enum Param {
4443
String(~str),
4544
Number(int)

trunk/src/libextra/terminfo/parser/compiled.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,7 @@ pub fn parse(file: @Reader, longnames: bool) -> Result<~TermInfo, ~str> {
276276
for (i, v) in string_offsets.iter().enumerate() {
277277
let offset = *v;
278278
if offset == 0xFFFF { // non-entry
279-
loop;
279+
continue;
280280
}
281281

282282
let name = if snames[i] == "_" {
@@ -289,7 +289,7 @@ pub fn parse(file: @Reader, longnames: bool) -> Result<~TermInfo, ~str> {
289289
// undocumented: FFFE indicates cap@, which means the capability is not present
290290
// unsure if the handling for this is correct
291291
string_map.insert(name.to_owned(), ~[]);
292-
loop;
292+
continue;
293293
}
294294

295295

trunk/src/libextra/time.rs

Lines changed: 61 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,59 @@ fn do_strptime(s: &str, format: &str) -> Result<Tm, ~str> {
734734
}
735735

736736
fn do_strftime(format: &str, tm: &Tm) -> ~str {
737+
fn days_in_year(year: int) -> i32 {
738+
if ((year % 4 == 0) && ((year % 100 != 0) || (year % 400 == 0))) {
739+
366 /* Days in a leap year */
740+
} else {
741+
365 /* Days in a non-leap year */
742+
}
743+
}
744+
745+
fn iso_week_days(yday: i32, wday: i32) -> int {
746+
/* The number of days from the first day of the first ISO week of this
747+
* year to the year day YDAY with week day WDAY.
748+
* ISO weeks start on Monday. The first ISO week has the year's first
749+
* Thursday.
750+
* YDAY may be as small as yday_minimum.
751+
*/
752+
let yday: int = yday as int;
753+
let wday: int = wday as int;
754+
let iso_week_start_wday: int = 1; /* Monday */
755+
let iso_week1_wday: int = 4; /* Thursday */
756+
let yday_minimum: int = 366;
757+
/* Add enough to the first operand of % to make it nonnegative. */
758+
let big_enough_multiple_of_7: int = (yday_minimum / 7 + 2) * 7;
759+
760+
yday - (yday - wday + iso_week1_wday + big_enough_multiple_of_7) % 7
761+
+ iso_week1_wday - iso_week_start_wday
762+
}
763+
764+
fn iso_week(ch:char, tm: &Tm) -> ~str {
765+
let mut year: int = tm.tm_year as int + 1900;
766+
let mut days: int = iso_week_days (tm.tm_yday, tm.tm_wday);
767+
768+
if (days < 0) {
769+
/* This ISO week belongs to the previous year. */
770+
year -= 1;
771+
days = iso_week_days (tm.tm_yday + (days_in_year(year)), tm.tm_wday);
772+
} else {
773+
let d: int = iso_week_days (tm.tm_yday - (days_in_year(year)),
774+
tm.tm_wday);
775+
if (0 <= d) {
776+
/* This ISO week belongs to the next year. */
777+
year += 1;
778+
days = d;
779+
}
780+
}
781+
782+
match ch {
783+
'G' => format!("{}", year),
784+
'g' => format!("{:02d}", (year % 100 + 100) % 100),
785+
'V' => format!("{:02d}", days / 7 + 1),
786+
_ => ~""
787+
}
788+
}
789+
737790
fn parse_type(ch: char, tm: &Tm) -> ~str {
738791
//FIXME (#2350): Implement missing types.
739792
let die = || format!("strftime: can't understand this format {} ", ch);
@@ -812,8 +865,8 @@ fn do_strftime(format: &str, tm: &Tm) -> ~str {
812865
parse_type('m', tm),
813866
parse_type('d', tm))
814867
}
815-
//'G' {}
816-
//'g' {}
868+
'G' => iso_week('G', tm),
869+
'g' => iso_week('g', tm),
817870
'H' => format!("{:02d}", tm.tm_hour),
818871
'I' => {
819872
let mut h = tm.tm_hour;
@@ -855,12 +908,12 @@ fn do_strftime(format: &str, tm: &Tm) -> ~str {
855908
parse_type('S', tm))
856909
}
857910
't' => ~"\t",
858-
//'U' {}
911+
'U' => format!("{:02d}", (tm.tm_yday - tm.tm_wday + 7) / 7),
859912
'u' => {
860913
let i = tm.tm_wday as int;
861914
(if i == 0 { 7 } else { i }).to_str()
862915
}
863-
//'V' {}
916+
'V' => iso_week('V', tm),
864917
'v' => {
865918
format!("{}-{}-{}",
866919
parse_type('e', tm),
@@ -1222,8 +1275,8 @@ mod tests {
12221275
assert_eq!(local.strftime("%e"), ~"13");
12231276
assert_eq!(local.strftime("%f"), ~"000054321");
12241277
assert_eq!(local.strftime("%F"), ~"2009-02-13");
1225-
// assert!(local.strftime("%G") == "2009");
1226-
// assert!(local.strftime("%g") == "09");
1278+
assert_eq!(local.strftime("%G"), ~"2009");
1279+
assert_eq!(local.strftime("%g"), ~"09");
12271280
assert_eq!(local.strftime("%H"), ~"15");
12281281
assert_eq!(local.strftime("%I"), ~"03");
12291282
assert_eq!(local.strftime("%j"), ~"044");
@@ -1240,9 +1293,9 @@ mod tests {
12401293
assert_eq!(local.strftime("%s"), ~"1234567890");
12411294
assert_eq!(local.strftime("%T"), ~"15:31:30");
12421295
assert_eq!(local.strftime("%t"), ~"\t");
1243-
// assert!(local.strftime("%U") == "06");
1296+
assert_eq!(local.strftime("%U"), ~"06");
12441297
assert_eq!(local.strftime("%u"), ~"5");
1245-
// assert!(local.strftime("%V") == "07");
1298+
assert_eq!(local.strftime("%V"), ~"07");
12461299
assert_eq!(local.strftime("%v"), ~"13-Feb-2009");
12471300
// assert!(local.strftime("%W") == "06");
12481301
assert_eq!(local.strftime("%w"), ~"5");

trunk/src/libextra/url.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,12 +359,12 @@ pub fn query_to_str(query: &Query) -> ~str {
359359
pub fn get_scheme(rawurl: &str) -> Result<(~str, ~str), ~str> {
360360
for (i,c) in rawurl.iter().enumerate() {
361361
match c {
362-
'A' .. 'Z' | 'a' .. 'z' => loop,
362+
'A' .. 'Z' | 'a' .. 'z' => continue,
363363
'0' .. '9' | '+' | '-' | '.' => {
364364
if i == 0 {
365365
return Err(~"url: Scheme must begin with a letter.");
366366
}
367-
loop;
367+
continue;
368368
}
369369
':' => {
370370
if i == 0 {
@@ -420,7 +420,7 @@ fn get_authority(rawurl: &str) ->
420420
let mut end = len;
421421

422422
for (i,c) in rawurl.iter().enumerate() {
423-
if i < 2 { loop; } // ignore the leading //
423+
if i < 2 { continue; } // ignore the leading //
424424

425425
// deal with input class first
426426
match c {
@@ -558,7 +558,7 @@ fn get_path(rawurl: &str, authority: bool) ->
558558
'A' .. 'Z' | 'a' .. 'z' | '0' .. '9' | '&' |'\'' | '(' | ')' | '.'
559559
| '@' | ':' | '%' | '/' | '+' | '!' | '*' | ',' | ';' | '='
560560
| '_' | '-' => {
561-
loop;
561+
continue;
562562
}
563563
'?' | '#' => {
564564
end = i;

trunk/src/libextra/uuid.rs

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

118118
/// Error details for string parsing failures
119-
#[allow(missing_doc)]
120119
pub enum ParseError {
121120
ErrorInvalidLength(uint),
122121
ErrorInvalidCharacter(char, uint),

trunk/src/librust/rust.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ pub fn main() {
247247
os::set_exit_status(exit_code);
248248
return;
249249
}
250-
_ => loop
250+
_ => {}
251251
}
252252
}
253253
}

trunk/src/librustc/back/link.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ pub fn link_args(sess: Session,
10041004
for cratepath in r.iter() {
10051005
if cratepath.filetype() == Some(".rlib") {
10061006
args.push(cratepath.to_str());
1007-
loop;
1007+
continue;
10081008
}
10091009
let dir = cratepath.dirname();
10101010
if dir != ~"" { args.push(~"-L" + dir); }

trunk/src/librustc/lib/llvm.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
// LLVM wrappers are intended to be called from trans,
1212
// which already runs in a #[fixed_stack_segment]
1313
#[allow(cstack)];
14+
#[allow(non_uppercase_pattern_statics)];
1415

1516
use std::c_str::ToCStr;
1617
use std::hashmap::HashMap;

trunk/src/librustc/middle/borrowck/check_loans.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -263,8 +263,8 @@ impl<'self> CheckLoanCtxt<'self> {
263263
debug2!("illegal_if={:?}", illegal_if);
264264

265265
for restr in loan1.restrictions.iter() {
266-
if !restr.set.intersects(illegal_if) { loop; }
267-
if restr.loan_path != loan2.loan_path { loop; }
266+
if !restr.set.intersects(illegal_if) { continue; }
267+
if restr.loan_path != loan2.loan_path { continue; }
268268

269269
match (new_loan.mutbl, old_loan.mutbl) {
270270
(MutableMutability, MutableMutability) => {

trunk/src/librustc/middle/check_match.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ pub fn check_arms(cx: &MatchCheckCtxt, arms: &[Arm]) {
133133
_ => false
134134
}
135135
};
136+
136137
do walk_pat(*pat) |p| {
137138
if pat_matches_nan(p) {
138139
cx.tcx.sess.span_warn(p.span, "unmatchable NaN in pattern, \

0 commit comments

Comments
 (0)