Skip to content

Commit 1743f7a

Browse files
committed
---
yaml --- r: 89681 b: refs/heads/master c: e6a1f6d h: refs/heads/master i: 89679: 0f7d408 v: v3
1 parent 7fef976 commit 1743f7a

File tree

23 files changed

+92
-189
lines changed

23 files changed

+92
-189
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: 075347b4453e4b4bc4dd2d2370e408e92041d4ce
2+
refs/heads/master: e6a1f6d7df80f1063116fa48d4971f6baca8daaa
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: a6d3e57dca68fde4effdda3e4ae2887aa535fcd6
55
refs/heads/try: b160761e35efcd1207112b3b782c06633cf441a8

trunk/doc/po/ja/rust.md.po

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -678,13 +678,6 @@ msgid ""
678678
"and continues as any mixture hex digits and underscores."
679679
msgstr ""
680680

681-
#. type: Bullet: ' * '
682-
#: doc/rust.md:326
683-
msgid ""
684-
"An _octal literal_ starts with the character sequence `U+0030` `U+006F` (`0o`) "
685-
"and continues as any mixture octal digits and underscores."
686-
msgstr ""
687-
688681
#. type: Bullet: ' * '
689682
#: doc/rust.md:326
690683
msgid ""
@@ -747,7 +740,6 @@ msgid ""
747740
"123u; // type uint\n"
748741
"123_u; // type uint\n"
749742
"0xff_u8; // type u8\n"
750-
"0o70_i16; // type i16\n"
751743
"0b1111_1111_1001_0000_i32; // type i32\n"
752744
"~~~~\n"
753745
msgstr ""

trunk/doc/po/ja/tutorial.md.po

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ msgstr "## プリミティブ型とリテラル"
849849
msgid ""
850850
"There are general signed and unsigned integer types, `int` and `uint`, as "
851851
"well as 8-, 16-, 32-, and 64-bit variants, `i8`, `u16`, etc. Integers can "
852-
"be written in decimal (`144`), hexadecimal (`0x90`), octal (`0o70`), or binary "
852+
"be written in decimal (`144`), hexadecimal (`0x90`), or binary "
853853
"(`0b10010000`) base. Each integral type has a corresponding literal suffix "
854854
"that can be used to indicate the type of a literal: `i` for `int`, `u` for "
855855
"`uint`, `i8` for the `i8` type."

trunk/doc/po/rust.md.pot

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,7 @@ msgstr ""
661661

662662
#. type: Plain text
663663
#: doc/rust.md:319
664-
msgid "An _integer literal_ has one of four forms:"
664+
msgid "An _integer literal_ has one of three forms:"
665665
msgstr ""
666666

667667
#. type: Bullet: ' * '
@@ -678,13 +678,6 @@ msgid ""
678678
"and continues as any mixture hex digits and underscores."
679679
msgstr ""
680680

681-
#. type: Bullet: ' * '
682-
#: doc/rust.md:326
683-
msgid ""
684-
"An _octal literal_ starts with the character sequence `U+0030` `U+006F` (`0o`) "
685-
"and continues as any mixture octal digits and underscores."
686-
msgstr ""
687-
688681
#. type: Bullet: ' * '
689682
#: doc/rust.md:326
690683
msgid ""
@@ -747,7 +740,6 @@ msgid ""
747740
"123u; // type uint\n"
748741
"123_u; // type uint\n"
749742
"0xff_u8; // type u8\n"
750-
"0o70_i16; // type i16\n"
751743
"0b1111_1111_1001_0000_i32; // type i32\n"
752744
"~~~~\n"
753745
msgstr ""

trunk/doc/po/tutorial.md.pot

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -646,7 +646,7 @@ msgstr ""
646646
msgid ""
647647
"There are general signed and unsigned integer types, `int` and `uint`, as "
648648
"well as 8-, 16-, 32-, and 64-bit variants, `i8`, `u16`, etc. Integers can "
649-
"be written in decimal (`144`), hexadecimal (`0x90`), octal (`0o70`), or binary "
649+
"be written in decimal (`144`), hexadecimal (`0x90`), or binary "
650650
"(`0b10010000`) base. Each integral type has a corresponding literal suffix "
651651
"that can be used to indicate the type of a literal: `i` for `int`, `u` for "
652652
"`uint`, `i8` for the `i8` type."

trunk/doc/rust.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -340,14 +340,12 @@ as they are differentiated by suffixes.
340340

341341
##### Integer literals
342342

343-
An _integer literal_ has one of four forms:
343+
An _integer literal_ has one of three forms:
344344

345345
* A _decimal literal_ starts with a *decimal digit* and continues with any
346346
mixture of *decimal digits* and _underscores_.
347347
* A _hex literal_ starts with the character sequence `U+0030` `U+0078`
348348
(`0x`) and continues as any mixture hex digits and underscores.
349-
* An _octal literal_ starts with the character sequence `U+0030` `U+006F`
350-
(`0o`) and continues as any mixture octal digits and underscores.
351349
* A _binary literal_ starts with the character sequence `U+0030` `U+0062`
352350
(`0b`) and continues as any mixture binary digits and underscores.
353351

@@ -378,7 +376,6 @@ Examples of integer literals of various forms:
378376
123u; // type uint
379377
123_u; // type uint
380378
0xff_u8; // type u8
381-
0o70_i16; // type i16
382379
0b1111_1111_1001_0000_i32; // type i32
383380
~~~~
384381

trunk/doc/tutorial.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ fn is_four(x: int) -> bool {
305305

306306
There are general signed and unsigned integer types, `int` and `uint`,
307307
as well as 8-, 16-, 32-, and 64-bit variants, `i8`, `u16`, etc.
308-
Integers can be written in decimal (`144`), hexadecimal (`0x90`), octal (`0o70`), or
308+
Integers can be written in decimal (`144`), hexadecimal (`0x90`), or
309309
binary (`0b10010000`) base. Each integral type has a corresponding literal
310310
suffix that can be used to indicate the type of a literal: `i` for `int`,
311311
`u` for `uint`, `i8` for the `i8` type.

trunk/src/compiletest/errors.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ fn parse_expected(line_num: uint, line: ~str) -> ~[ExpectedError] {
5252
let start_kind = idx;
5353
while idx < len && line[idx] != (' ' as u8) { idx += 1u; }
5454

55+
// FIXME: #4318 Instead of to_ascii and to_str_ascii, could use
56+
// to_ascii_consume and to_str_consume to not do a unnecessary copy.
5557
let kind = line.slice(start_kind, idx);
56-
let kind = kind.to_ascii().to_lower().into_str();
58+
let kind = kind.to_ascii().to_lower().to_str_ascii();
5759

5860
// Extract msg:
5961
while idx < len && line[idx] == (' ' as u8) { idx += 1u; }

trunk/src/etc/gedit/share/gtksourceview-3.0/language-specs/rust.lang

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -224,18 +224,13 @@
224224
[0-9a-fA-F]
225225
</define-regex>
226226

227-
<define-regex id="oct_digit" extended="true">
228-
[0-7]
229-
</define-regex>
230-
231227
<context id="number" style-ref="number">
232228
<match extended="true">
233229
((?&lt;=\.\.)|(?&lt;![\w\.]))
234230
(
235231
[1-9][0-9_]*\%{num_suffix}?|
236232
0[0-9_]*\%{num_suffix}?|
237233
0b[01_]+\%{int_suffix}?|
238-
0o(\%{oct_digit}|_)+\%{int_suffix}?|
239234
0x(\%{hex_digit}|_)+\%{int_suffix}?
240235
)
241236
((?![\w\.].)|(?=\.\.))

trunk/src/etc/kate/rust.xml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@
199199
<Detect2Chars char="/" char1="/" attribute="Comment" context="Commentar 1"/>
200200
<Detect2Chars char="/" char1="*" attribute="Comment" context="Commentar 2" beginRegion="Comment"/>
201201
<RegExpr String="0x[0-9a-fA-F_]+&rustIntSuf;" attribute="Number" context="#stay"/>
202-
<RegExpr String="0o[0-7_]+&rustIntSuf;" attribute="Number" context="#stay"/>
203202
<RegExpr String="0b[0-1_]+&rustIntSuf;" attribute="Number" context="#stay"/>
204203
<RegExpr String="[0-9][0-9_]*\.[0-9_]*([eE][+-]?[0-9_]+)?(f32|f64|f)?" attribute="Number" context="#stay"/>
205204
<RegExpr String="[0-9][0-9_]*&rustIntSuf;" attribute="Number" context="#stay"/>

trunk/src/etc/vim/syntax/rust.vim

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -161,9 +161,6 @@ syn match rustNumber display "\<[0-9][0-9_]*\(i\|i8\|i16\|i32\|i64\)\>"
161161
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\>"
162162
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\(u\|u8\|u16\|u32\|u64\)\>"
163163
syn match rustHexNumber display "\<0x[a-fA-F0-9_]\+\(i8\|i16\|i32\|i64\)\>"
164-
syn match rustOctNumber display "\<0o[0-7_]\+\>"
165-
syn match rustOctNumber display "\<0o[0-7_]\+\(u\|u8\|u16\|u32\|u64\)\>"
166-
syn match rustOctNumber display "\<0o[0-7_]\+\(i8\|i16\|i32\|i64\)\>"
167164
syn match rustBinNumber display "\<0b[01_]\+\>"
168165
syn match rustBinNumber display "\<0b[01_]\+\(u\|u8\|u16\|u32\|u64\)\>"
169166
syn match rustBinNumber display "\<0b[01_]\+\(i8\|i16\|i32\|i64\)\>"
@@ -201,7 +198,6 @@ syn region rustFoldBraces start="{" end="}" transparent fold
201198

202199
" Default highlighting {{{1
203200
hi def link rustHexNumber rustNumber
204-
hi def link rustOctNumber rustNumber
205201
hi def link rustBinNumber rustNumber
206202
hi def link rustIdentifierPrime rustIdentifier
207203
hi def link rustTrait rustType

trunk/src/libextra/sort.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -887,8 +887,12 @@ mod tests {
887887
// tjc: funny that we have to use parens
888888
fn ile(x: &(&'static str), y: &(&'static str)) -> bool
889889
{
890-
let x = x.to_ascii().to_lower().into_str();
891-
let y = y.to_ascii().to_lower().into_str();
890+
// FIXME: #4318 Instead of to_ascii and to_str_ascii, could use
891+
// to_ascii_move and to_str_move to not do a unnecessary clone.
892+
// (Actually, could just remove the to_str_* call, but needs an deriving(Ord) on
893+
// Ascii)
894+
let x = x.to_ascii().to_lower().to_str_ascii();
895+
let y = y.to_ascii().to_lower().to_str_ascii();
892896
x <= y
893897
}
894898

trunk/src/libextra/time.rs

Lines changed: 40 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -965,35 +965,8 @@ mod tests {
965965
use super::*;
966966
967967
use std::f64;
968+
use std::os;
968969
use std::result::{Err, Ok};
969-
use std::libc;
970-
971-
#[cfg(windows)]
972-
#[fixed_stack_segment]
973-
fn set_time_zone() {
974-
// Windows crt doesn't see any environment variable set by
975-
// `SetEnvironmentVariable`, which `os::setenv` internally uses.
976-
// It is why we use `putenv` here.
977-
extern {
978-
fn _putenv(envstring: *libc::c_char) -> libc::c_int;
979-
}
980-
981-
unsafe {
982-
// Windows does not understand "America/Los_Angeles".
983-
// PST+08 may look wrong, but not! "PST" indicates
984-
// the name of timezone. "+08" means UTC = local + 08.
985-
do "TZ=PST+08".with_c_str |env| {
986-
_putenv(env);
987-
}
988-
}
989-
tzset();
990-
}
991-
#[cfg(not(windows))]
992-
fn set_time_zone() {
993-
use std::os;
994-
os::setenv("TZ", "America/Los_Angeles");
995-
tzset();
996-
}
997970
998971
fn test_get_time() {
999972
static SOME_RECENT_DATE: i64 = 1325376000i64; // 2012-01-01T00:00:00Z
@@ -1034,54 +1007,57 @@ mod tests {
10341007
}
10351008

10361009
fn test_at_utc() {
1037-
set_time_zone();
1010+
os::setenv("TZ", "America/Los_Angeles");
1011+
tzset();
10381012

10391013
let time = Timespec::new(1234567890, 54321);
10401014
let utc = at_utc(time);
10411015

1042-
assert_eq!(utc.tm_sec, 30_i32);
1043-
assert_eq!(utc.tm_min, 31_i32);
1044-
assert_eq!(utc.tm_hour, 23_i32);
1045-
assert_eq!(utc.tm_mday, 13_i32);
1046-
assert_eq!(utc.tm_mon, 1_i32);
1047-
assert_eq!(utc.tm_year, 109_i32);
1048-
assert_eq!(utc.tm_wday, 5_i32);
1049-
assert_eq!(utc.tm_yday, 43_i32);
1050-
assert_eq!(utc.tm_isdst, 0_i32);
1051-
assert_eq!(utc.tm_gmtoff, 0_i32);
1052-
assert_eq!(utc.tm_zone, ~"UTC");
1053-
assert_eq!(utc.tm_nsec, 54321_i32);
1016+
assert!(utc.tm_sec == 30_i32);
1017+
assert!(utc.tm_min == 31_i32);
1018+
assert!(utc.tm_hour == 23_i32);
1019+
assert!(utc.tm_mday == 13_i32);
1020+
assert!(utc.tm_mon == 1_i32);
1021+
assert!(utc.tm_year == 109_i32);
1022+
assert!(utc.tm_wday == 5_i32);
1023+
assert!(utc.tm_yday == 43_i32);
1024+
assert!(utc.tm_isdst == 0_i32);
1025+
assert!(utc.tm_gmtoff == 0_i32);
1026+
assert!(utc.tm_zone == ~"UTC");
1027+
assert!(utc.tm_nsec == 54321_i32);
10541028
}
10551029
10561030
fn test_at() {
1057-
set_time_zone();
1031+
os::setenv("TZ", "America/Los_Angeles");
1032+
tzset();
10581033
10591034
let time = Timespec::new(1234567890, 54321);
10601035
let local = at(time);
10611036
10621037
error!("time_at: {:?}", local);
10631038
1064-
assert_eq!(local.tm_sec, 30_i32);
1065-
assert_eq!(local.tm_min, 31_i32);
1066-
assert_eq!(local.tm_hour, 15_i32);
1067-
assert_eq!(local.tm_mday, 13_i32);
1068-
assert_eq!(local.tm_mon, 1_i32);
1069-
assert_eq!(local.tm_year, 109_i32);
1070-
assert_eq!(local.tm_wday, 5_i32);
1071-
assert_eq!(local.tm_yday, 43_i32);
1072-
assert_eq!(local.tm_isdst, 0_i32);
1073-
assert_eq!(local.tm_gmtoff, -28800_i32);
1039+
assert!(local.tm_sec == 30_i32);
1040+
assert!(local.tm_min == 31_i32);
1041+
assert!(local.tm_hour == 15_i32);
1042+
assert!(local.tm_mday == 13_i32);
1043+
assert!(local.tm_mon == 1_i32);
1044+
assert!(local.tm_year == 109_i32);
1045+
assert!(local.tm_wday == 5_i32);
1046+
assert!(local.tm_yday == 43_i32);
1047+
assert!(local.tm_isdst == 0_i32);
1048+
assert!(local.tm_gmtoff == -28800_i32);
10741049
10751050
// FIXME (#2350): We should probably standardize on the timezone
10761051
// abbreviation.
10771052
let zone = &local.tm_zone;
10781053
assert!(*zone == ~"PST" || *zone == ~"Pacific Standard Time");
10791054
1080-
assert_eq!(local.tm_nsec, 54321_i32);
1055+
assert!(local.tm_nsec == 54321_i32);
10811056
}
10821057
10831058
fn test_to_timespec() {
1084-
set_time_zone();
1059+
os::setenv("TZ", "America/Los_Angeles");
1060+
tzset();
10851061
10861062
let time = Timespec::new(1234567890, 54321);
10871063
let utc = at_utc(time);
@@ -1091,7 +1067,8 @@ mod tests {
10911067
}
10921068
10931069
fn test_conversions() {
1094-
set_time_zone();
1070+
os::setenv("TZ", "America/Los_Angeles");
1071+
tzset();
10951072
10961073
let time = Timespec::new(1234567890, 54321);
10971074
let utc = at_utc(time);
@@ -1106,7 +1083,8 @@ mod tests {
11061083
}
11071084
11081085
fn test_strptime() {
1109-
set_time_zone();
1086+
os::setenv("TZ", "America/Los_Angeles");
1087+
tzset();
11101088
11111089
match strptime("", "") {
11121090
Ok(ref tm) => {
@@ -1270,7 +1248,8 @@ mod tests {
12701248
}
12711249

12721250
fn test_ctime() {
1273-
set_time_zone();
1251+
os::setenv("TZ", "America/Los_Angeles");
1252+
tzset();
12741253

12751254
let time = Timespec::new(1234567890, 54321);
12761255
let utc = at_utc(time);
@@ -1283,7 +1262,8 @@ mod tests {
12831262
}
12841263

12851264
fn test_strftime() {
1286-
set_time_zone();
1265+
os::setenv("TZ", "America/Los_Angeles");
1266+
tzset();
12871267

12881268
let time = Timespec::new(1234567890, 54321);
12891269
let utc = at_utc(time);
@@ -1343,7 +1323,8 @@ mod tests {
13431323
// abbreviation.
13441324
let rfc822 = local.rfc822();
13451325
let prefix = ~"Fri, 13 Feb 2009 15:31:30 ";
1346-
assert!(rfc822 == prefix + "PST" || rfc822 == prefix + "Pacific Standard Time");
1326+
assert!(rfc822 == prefix + "PST" ||
1327+
rfc822 == prefix + "Pacific Standard Time");
13471328

13481329
assert_eq!(local.ctime(), ~"Fri Feb 13 15:31:30 2009");
13491330
assert_eq!(local.rfc822z(), ~"Fri, 13 Feb 2009 15:31:30 -0800");

trunk/src/libextra/url.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012-2013 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -581,7 +581,7 @@ fn get_path(rawurl: &str, authority: bool) ->
581581
match c {
582582
'A' .. 'Z' | 'a' .. 'z' | '0' .. '9' | '&' |'\'' | '(' | ')' | '.'
583583
| '@' | ':' | '%' | '/' | '+' | '!' | '*' | ',' | ';' | '='
584-
| '_' | '-' | '~' => {
584+
| '_' | '-' => {
585585
continue;
586586
}
587587
'?' | '#' => {
@@ -824,15 +824,15 @@ mod tests {
824824
825825
#[test]
826826
fn test_url_parse() {
827-
let url = ~"http://user:[email protected]:8080/doc/~u?s=v#something";
827+
let url = ~"http://user:[email protected]:8080/doc?s=v#something";
828828

829829
let up = from_str(url);
830830
let u = up.unwrap();
831831
assert_eq!(&u.scheme, &~"http");
832832
assert_eq!(&u.user, &Some(UserInfo::new(~"user", Some(~"pass"))));
833833
assert_eq!(&u.host, &~"rust-lang.org");
834834
assert_eq!(&u.port, &Some(~"8080"));
835-
assert_eq!(&u.path, &~"/doc/~u");
835+
assert_eq!(&u.path, &~"/doc");
836836
assert_eq!(&u.query, &~[(~"s", ~"v")]);
837837
assert_eq!(&u.fragment, &Some(~"something"));
838838
}

trunk/src/librustc/driver/driver.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,8 +669,10 @@ pub fn build_session_options(binary: @str,
669669
for level in lint_levels.iter() {
670670
let level_name = lint::level_to_str(*level);
671671

672+
// FIXME: #4318 Instead of to_ascii and to_str_ascii, could use
673+
// to_ascii_move and to_str_move to not do a unnecessary copy.
672674
let level_short = level_name.slice_chars(0, 1);
673-
let level_short = level_short.to_ascii().to_upper().into_str();
675+
let level_short = level_short.to_ascii().to_upper().to_str_ascii();
674676
let flags = vec::append(matches.opt_strs(level_short),
675677
matches.opt_strs(level_name));
676678
for lint_name in flags.iter() {

0 commit comments

Comments
 (0)