Skip to content

Commit 416a0d4

Browse files
committed
---
yaml --- r: 89687 b: refs/heads/master c: 57d1ed8 h: refs/heads/master i: 89685: 03308ca 89683: 114e155 89679: 0f7d408 v: v3
1 parent 0c89ed5 commit 416a0d4

File tree

164 files changed

+1976
-948
lines changed

Some content is hidden

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

164 files changed

+1976
-948
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: 2f1b4335cbb2673996c5331b2a69b209e2e673cd
2+
refs/heads/master: 57d1ed819b9e32a8e915ced9b5e130c299a46bca
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: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -678,6 +678,13 @@ 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+
681688
#. type: Bullet: ' * '
682689
#: doc/rust.md:326
683690
msgid ""
@@ -740,6 +747,7 @@ msgid ""
740747
"123u; // type uint\n"
741748
"123_u; // type uint\n"
742749
"0xff_u8; // type u8\n"
750+
"0o70_i16; // type i16\n"
743751
"0b1111_1111_1001_0000_i32; // type i32\n"
744752
"~~~~\n"
745753
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`), or binary "
852+
"be written in decimal (`144`), hexadecimal (`0x90`), octal (`0o70`), 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: 9 additions & 1 deletion
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 three forms:"
664+
msgid "An _integer literal_ has one of four forms:"
665665
msgstr ""
666666

667667
#. type: Bullet: ' * '
@@ -678,6 +678,13 @@ 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+
681688
#. type: Bullet: ' * '
682689
#: doc/rust.md:326
683690
msgid ""
@@ -740,6 +747,7 @@ msgid ""
740747
"123u; // type uint\n"
741748
"123_u; // type uint\n"
742749
"0xff_u8; // type u8\n"
750+
"0o70_i16; // type i16\n"
743751
"0b1111_1111_1001_0000_i32; // type i32\n"
744752
"~~~~\n"
745753
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`), or binary "
649+
"be written in decimal (`144`), hexadecimal (`0x90`), octal (`0o70`), 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: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -340,12 +340,14 @@ as they are differentiated by suffixes.
340340

341341
##### Integer literals
342342

343-
An _integer literal_ has one of three forms:
343+
An _integer literal_ has one of four 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.
349351
* A _binary literal_ starts with the character sequence `U+0030` `U+0062`
350352
(`0b`) and continues as any mixture binary digits and underscores.
351353

@@ -376,6 +378,7 @@ Examples of integer literals of various forms:
376378
123u; // type uint
377379
123_u; // type uint
378380
0xff_u8; // type u8
381+
0o70_i16; // type i16
379382
0b1111_1111_1001_0000_i32; // type i32
380383
~~~~
381384

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`), or
308+
Integers can be written in decimal (`144`), hexadecimal (`0x90`), octal (`0o70`), 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/mk/platform.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ CFG_RUN_TARG_i686-unknown-linux-gnu=$(call CFG_RUN_i686-unknown-linux-gnu,,$(2))
195195

196196
# arm-apple-darwin configuration
197197
ifeq ($(CFG_OSTYPE),apple-darwin)
198-
CFG_IOS_SDK = $(shell xcrun --show-sdk-path -sdk iphoneos)
199-
CFG_IOS_FLAGS = -target arm-apple-darwin -isysroot $(CFG_IOS_SDK) -I $(CFG_IOS_SDK)/usr/include -I $(CFG_IOS_SDK)/usr/include/c++/4.2.1 -I /usr/include
198+
CFG_IOS_SDK = $(shell xcrun --show-sdk-path -sdk iphoneos 2>/dev/null)
199+
CFG_IOS_FLAGS = -target arm-apple-darwin -isysroot $(CFG_IOS_SDK) -I$(CFG_IOS_SDK)/usr/include -I$(CFG_IOS_SDK)/usr/include/c++/4.2.1
200200
CC_arm-apple-darwin = $(shell xcrun -find -sdk iphoneos clang)
201201
CXX_arm-apple-darwin = $(shell xcrun -find -sdk iphoneos clang++)
202202
CPP_arm-apple-darwin = $(shell xcrun -find -sdk iphoneos clang++)

trunk/mk/rt.mk

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,13 @@ LIBUV_FLAGS_i386 = -m32 -fPIC -I$(S)src/etc/mingw-fix-include
2828
LIBUV_FLAGS_x86_64 = -m64 -fPIC
2929
ifeq ($(OSTYPE_$(1)), linux-androideabi)
3030
LIBUV_FLAGS_arm = -fPIC -DANDROID -std=gnu99
31+
else ifeq ($(OSTYPE_$(1)), apple-darwin)
32+
ifeq ($(HOST_$(1)), arm)
33+
IOS_SDK := $(shell xcrun --show-sdk-path -sdk iphoneos 2>/dev/null)
34+
LIBUV_FLAGS_arm := -fPIC -std=gnu99 -I$(IOS_SDK)/usr/include -I$(IOS_SDK)/usr/include/c++/4.2.1
35+
else
36+
LIBUV_FLAGS_arm := -fPIC -std=gnu99
37+
endif
3138
else
3239
LIBUV_FLAGS_arm = -fPIC -std=gnu99
3340
endif
@@ -84,7 +91,6 @@ endif
8491

8592
RUNTIME_CXXS_$(1)_$(2) := \
8693
rt/sync/lock_and_signal.cpp \
87-
rt/sync/rust_thread.cpp \
8894
rt/rust_builtin.cpp \
8995
rt/rust_upcall.cpp \
9096
rt/miniz.cpp \

trunk/src/compiletest/compiletest.rs

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,19 @@ pub fn mode_str(mode: mode) -> ~str {
220220
}
221221

222222
pub fn run_tests(config: &config) {
223+
if config.target == ~"arm-linux-androideabi" {
224+
match config.mode{
225+
mode_debug_info => {
226+
println("arm-linux-androideabi debug-info \
227+
test uses tcp 5039 port. please reserve it");
228+
//arm-linux-androideabi debug-info test uses remote debugger
229+
//so, we test 1 task at once
230+
os::setenv("RUST_TEST_TASKS","1");
231+
}
232+
_ =>{}
233+
}
234+
}
235+
223236
let opts = test_opts(config);
224237
let tests = make_tests(config);
225238
// sadly osx needs some file descriptor limits raised for running tests in

trunk/src/compiletest/errors.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,8 @@ 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.
5755
let kind = line.slice(start_kind, idx);
58-
let kind = kind.to_ascii().to_lower().to_str_ascii();
56+
let kind = kind.to_ascii().to_lower().into_str();
5957

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

trunk/src/compiletest/procsrv.rs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,3 +67,26 @@ pub fn run(lib_path: &str,
6767
err: str::from_utf8(output.error)
6868
}
6969
}
70+
71+
pub fn run_background(lib_path: &str,
72+
prog: &str,
73+
args: &[~str],
74+
env: ~[(~str, ~str)],
75+
input: Option<~str>) -> run::Process {
76+
77+
let env = env + target_env(lib_path, prog);
78+
let mut process = run::Process::new(prog, args, run::ProcessOptions {
79+
env: Some(env),
80+
dir: None,
81+
in_fd: None,
82+
out_fd: None,
83+
err_fd: None
84+
});
85+
86+
for input in input.iter() {
87+
process.input().write(input.as_bytes());
88+
}
89+
90+
return process;
91+
}
92+

trunk/src/compiletest/runtest.rs

Lines changed: 112 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,10 @@ use std::rt::io::File;
2626
use std::os;
2727
use std::str;
2828
use std::vec;
29+
use std::rt::io::net::tcp;
30+
use std::rt::io::net::ip::{Ipv4Addr, SocketAddr};
31+
use std::task;
32+
use std::rt::io::timer;
2933

3034
use extra::test::MetricMap;
3135

@@ -245,6 +249,7 @@ actual:\n\
245249
}
246250

247251
fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
252+
248253
// do not optimize debuginfo tests
249254
let mut config = match config.rustcflags {
250255
Some(ref flags) => config {
@@ -254,39 +259,125 @@ fn run_debuginfo_test(config: &config, props: &TestProps, testfile: &Path) {
254259
None => (*config).clone()
255260
};
256261
let config = &mut config;
257-
let cmds = props.debugger_cmds.connect("\n");
258262
let check_lines = &props.check_lines;
263+
let mut cmds = props.debugger_cmds.connect("\n");
259264

260265
// compile test file (it shoud have 'compile-flags:-g' in the header)
261266
let mut ProcRes = compile_test(config, props, testfile);
262267
if ProcRes.status != 0 {
263268
fatal_ProcRes(~"compilation failed!", &ProcRes);
264269
}
265270

266-
// write debugger script
267-
let script_str = [~"set charset UTF-8",
268-
cmds,
269-
~"quit\n"].connect("\n");
270-
debug!("script_str = {}", script_str);
271-
dump_output_file(config, testfile, script_str, "debugger.script");
272-
273-
// run debugger script with gdb
274-
#[cfg(windows)]
275-
fn debugger() -> ~str { ~"gdb.exe" }
276-
#[cfg(unix)]
277-
fn debugger() -> ~str { ~"gdb" }
278-
let debugger_script = make_out_name(config, testfile, "debugger.script");
279271
let exe_file = make_exe_name(config, testfile);
280-
// FIXME (#9639): This needs to handle non-utf8 paths
281-
let debugger_opts = ~[~"-quiet", ~"-batch", ~"-nx",
282-
~"-command=" + debugger_script.as_str().unwrap().to_owned(),
283-
exe_file.as_str().unwrap().to_owned()];
284-
let ProcArgs = ProcArgs {prog: debugger(), args: debugger_opts};
285-
ProcRes = compose_and_run(config, testfile, ProcArgs, ~[], "", None);
272+
273+
let mut ProcArgs;
274+
match config.target {
275+
~"arm-linux-androideabi" => {
276+
if (config.adb_device_status) {
277+
278+
cmds = cmds.replace("run","continue");
279+
280+
// write debugger script
281+
let script_str = [~"set charset UTF-8",
282+
format!("file {}",exe_file.as_str().unwrap().to_owned()),
283+
~"target remote :5039",
284+
cmds,
285+
~"quit"].connect("\n");
286+
debug!("script_str = {}", script_str);
287+
dump_output_file(config, testfile, script_str, "debugger.script");
288+
289+
290+
procsrv::run("", config.adb_path.clone(),
291+
[~"push", exe_file.as_str().unwrap().to_owned(), config.adb_test_dir.clone()],
292+
~[(~"",~"")], Some(~""));
293+
294+
procsrv::run("", config.adb_path,
295+
[~"forward", ~"tcp:5039", ~"tcp:5039"],
296+
~[(~"",~"")], Some(~""));
297+
298+
let adb_arg = format!("export LD_LIBRARY_PATH={}; gdbserver :5039 {}/{}",
299+
config.adb_test_dir.clone(), config.adb_test_dir.clone(),
300+
str::from_utf8(exe_file.filename().unwrap())).clone();
301+
302+
let mut process = procsrv::run_background("", config.adb_path.clone(),
303+
[~"shell",adb_arg.clone()],~[(~"",~"")], Some(~""));
304+
loop {
305+
//waiting 1 second for gdbserver start
306+
timer::sleep(1000);
307+
let result = do task::try {
308+
tcp::TcpStream::connect(
309+
SocketAddr { ip: Ipv4Addr(127, 0, 0, 1), port: 5039 });
310+
};
311+
if result.is_err() {
312+
continue;
313+
}
314+
break;
315+
}
316+
317+
let args = split_maybe_args(&config.rustcflags);
318+
let mut tool_path:~str = ~"";
319+
for arg in args.iter() {
320+
if arg.contains("--android-cross-path=") {
321+
tool_path = arg.replace("--android-cross-path=","");
322+
break;
323+
}
324+
}
325+
326+
if tool_path.equals(&~"") {
327+
fatal(~"cannot found android cross path");
328+
}
329+
330+
let debugger_script = make_out_name(config, testfile, "debugger.script");
331+
// FIXME (#9639): This needs to handle non-utf8 paths
332+
let debugger_opts = ~[~"-quiet", ~"-batch", ~"-nx",
333+
"-command=" + debugger_script.as_str().unwrap().to_owned()];
334+
335+
let procsrv::Result{ out, err, status }=
336+
procsrv::run("",
337+
tool_path.append("/bin/arm-linux-androideabi-gdb"),
338+
debugger_opts, ~[(~"",~"")], None);
339+
let cmdline = {
340+
let cmdline = make_cmdline("", "arm-linux-androideabi-gdb", debugger_opts);
341+
logv(config, format!("executing {}", cmdline));
342+
cmdline
343+
};
344+
345+
ProcRes = ProcRes {status: status,
346+
stdout: out,
347+
stderr: err,
348+
cmdline: cmdline};
349+
process.force_destroy();
350+
}
351+
}
352+
353+
_=> {
354+
// write debugger script
355+
let script_str = [~"set charset UTF-8",
356+
cmds,
357+
~"quit\n"].connect("\n");
358+
debug!("script_str = {}", script_str);
359+
dump_output_file(config, testfile, script_str, "debugger.script");
360+
361+
// run debugger script with gdb
362+
#[cfg(windows)]
363+
fn debugger() -> ~str { ~"gdb.exe" }
364+
#[cfg(unix)]
365+
fn debugger() -> ~str { ~"gdb" }
366+
367+
let debugger_script = make_out_name(config, testfile, "debugger.script");
368+
369+
// FIXME (#9639): This needs to handle non-utf8 paths
370+
let debugger_opts = ~[~"-quiet", ~"-batch", ~"-nx",
371+
"-command=" + debugger_script.as_str().unwrap().to_owned(),
372+
exe_file.as_str().unwrap().to_owned()];
373+
ProcArgs = ProcArgs {prog: debugger(), args: debugger_opts};
374+
ProcRes = compose_and_run(config, testfile, ProcArgs, ~[], "", None);
375+
}
376+
}
377+
286378
if ProcRes.status != 0 {
287379
fatal(~"gdb failed to execute");
288380
}
289-
290381
let num_check_lines = check_lines.len();
291382
if num_check_lines > 0 {
292383
// Allow check lines to leave parts unspecified (e.g., uninitialized
@@ -834,7 +925,6 @@ fn _arm_exec_compiled_test(config: &config, props: &TestProps,
834925
for tv in args.args.iter() {
835926
runargs.push(tv.to_owned());
836927
}
837-
838928
procsrv::run("", config.adb_path, runargs, ~[(~"",~"")], Some(~""));
839929
840930
// get exitcode of result

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

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

227+
<define-regex id="oct_digit" extended="true">
228+
[0-7]
229+
</define-regex>
230+
227231
<context id="number" style-ref="number">
228232
<match extended="true">
229233
((?&lt;=\.\.)|(?&lt;![\w\.]))
230234
(
231235
[1-9][0-9_]*\%{num_suffix}?|
232236
0[0-9_]*\%{num_suffix}?|
233237
0b[01_]+\%{int_suffix}?|
238+
0o(\%{oct_digit}|_)+\%{int_suffix}?|
234239
0x(\%{hex_digit}|_)+\%{int_suffix}?
235240
)
236241
((?![\w\.].)|(?=\.\.))

0 commit comments

Comments
 (0)