Skip to content

Commit 18ebdfa

Browse files
committed
---
yaml --- r: 145249 b: refs/heads/try2 c: e199790 h: refs/heads/master i: 145247: 9563cea v: v3
1 parent b86ea92 commit 18ebdfa

Some content is hidden

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

68 files changed

+2363
-732
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 8f6552962772c40a9d18d9ec46419a99a123ad16
8+
refs/heads/try2: e199790bacb7a8a89065eff52b10b9eba78f0279
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/doc/rust.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ string_body : non_double_quote
248248
| '\x5c' [ '\x22' | common_escape ] ;
249249
250250
common_escape : '\x5c'
251-
| 'n' | 'r' | 't' | '0'
251+
| 'n' | 'r' | 't'
252252
| 'x' hex_digit 2
253253
| 'u' hex_digit 4
254254
| 'U' hex_digit 8 ;

branches/try2/mk/llvm.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ LLVM_STAMP_$(1) = $$(CFG_LLVM_BUILD_DIR_$(1))/llvm-auto-clean-stamp
2828

2929
$$(LLVM_CONFIG_$(1)): $$(LLVM_DEPS) $$(LLVM_STAMP_$(1))
3030
@$$(call E, make: llvm)
31-
$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) $$(CFG_LLVM_BUILD_ENV_$(1))
31+
$$(Q)$$(MAKE) -C $$(CFG_LLVM_BUILD_DIR_$(1)) $$(CFG_LLVM_BUILD_ENV)
3232
$$(Q)touch $$(LLVM_CONFIG_$(1))
3333
endif
3434

branches/try2/mk/platform.mk

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,6 @@ CFG_PATH_MUNGE_mips-unknown-linux-gnu := true
343343
CFG_LDPATH_mips-unknown-linux-gnu :=
344344
CFG_RUN_mips-unknown-linux-gnu=
345345
CFG_RUN_TARG_mips-unknown-linux-gnu=
346-
RUSTC_FLAGS_mips-unknown-linux-gnu := --linker=$(CXX_mips-unknown-linux-gnu) --target-cpu mips32r2 --target-feature +mips32r2,+o32
347346

348347
# i686-pc-mingw32 configuration
349348
CC_i686-pc-mingw32=$(CC)
@@ -353,7 +352,7 @@ AR_i686-pc-mingw32=$(AR)
353352
CFG_LIB_NAME_i686-pc-mingw32=$(1).dll
354353
CFG_LIB_GLOB_i686-pc-mingw32=$(1)-*.dll
355354
CFG_LIB_DSYM_GLOB_i686-pc-mingw32=$(1)-*.dylib.dSYM
356-
CFG_GCCISH_CFLAGS_i686-pc-mingw32 := -Wall -Werror -g -m32 -march=i686 -D_WIN32_WINNT=0x0600 -I$(CFG_SRC_DIR)src/etc/mingw-fix-include
355+
CFG_GCCISH_CFLAGS_i686-pc-mingw32 := -Wall -Werror -g -m32 -march=i686 -D_WIN32_WINNT=0x0600
357356
CFG_GCCISH_CXXFLAGS_i686-pc-mingw32 := -fno-rtti
358357
CFG_GCCISH_LINK_FLAGS_i686-pc-mingw32 := -shared -fPIC -g -m32
359358
CFG_GCCISH_DEF_FLAG_i686-pc-mingw32 :=
@@ -362,7 +361,6 @@ CFG_GCCISH_POST_LIB_FLAGS_i686-pc-mingw32 :=
362361
CFG_DEF_SUFFIX_i686-pc-mingw32 := .mingw32.def
363362
CFG_INSTALL_NAME_i686-pc-mingw32 =
364363
CFG_LIBUV_LINK_FLAGS_i686-pc-mingw32 := -lWs2_32 -lpsapi -liphlpapi
365-
CFG_LLVM_BUILD_ENV_i686-pc-mingw32 := CPATH=$(CFG_SRC_DIR)src/etc/mingw-fix-include
366364
CFG_EXE_SUFFIX_i686-pc-mingw32 := .exe
367365
CFG_WINDOWSY_i686-pc-mingw32 := 1
368366
CFG_UNIXY_i686-pc-mingw32 :=
@@ -481,7 +479,7 @@ define CFG_MAKE_TOOLCHAIN
481479
$$(CFG_GCCISH_DEF_FLAG_$(1))$$(3) $$(2) \
482480
$$(call CFG_INSTALL_NAME_$(1),$$(4))
483481

484-
ifeq ($$(findstring $(HOST_$(1)),arm mips),)
482+
ifneq ($(HOST_$(1)),arm)
485483

486484
# We're using llvm-mc as our assembler because it supports
487485
# .cfi pseudo-ops on mac
@@ -493,7 +491,7 @@ define CFG_MAKE_TOOLCHAIN
493491
-o=$$(1)
494492
else
495493

496-
# For the ARM and MIPS crosses, use the toolchain assembler
494+
# For the ARM crosses, use the toolchain assembler
497495
# XXX: We should be able to use the LLVM assembler
498496
CFG_ASSEMBLE_$(1)=$$(CC_$(1)) $$(CFG_DEPEND_FLAGS) $$(2) -c -o $$(1)
499497

branches/try2/mk/rt.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# working under these assumptions).
2525

2626
# Hack for passing flags into LIBUV, see below.
27-
LIBUV_FLAGS_i386 = -m32 -fPIC -I$(S)src/etc/mingw-fix-include
27+
LIBUV_FLAGS_i386 = -m32 -fPIC
2828
LIBUV_FLAGS_x86_64 = -m64 -fPIC
2929
ifeq ($(OSTYPE_$(1)), linux-androideabi)
3030
LIBUV_FLAGS_arm = -fPIC -DANDROID -std=gnu99

branches/try2/src/compiletest/compiletest.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ extern mod extra;
1717

1818
use std::os;
1919
use std::rt;
20+
use std::f64;
2021

2122
use extra::getopts;
2223
use extra::getopts::groups::{optopt, optflag, reqopt};
@@ -130,7 +131,7 @@ pub fn parse_config(args: ~[~str]) -> config {
130131
ratchet_noise_percent:
131132
getopts::opt_maybe_str(matches,
132133
"ratchet-noise-percent").map_move(|s|
133-
from_str::<f64>(s).unwrap()),
134+
f64::from_str(s).unwrap()),
134135
runtool: getopts::opt_maybe_str(matches, "runtool"),
135136
rustcflags: getopts::opt_maybe_str(matches, "rustcflags"),
136137
jit: getopts::opt_present(matches, "jit"),

branches/try2/src/etc/mingw-fix-include/README.txt

Lines changed: 0 additions & 6 deletions
This file was deleted.

branches/try2/src/etc/mingw-fix-include/bits/c++config.h

Lines changed: 0 additions & 8 deletions
This file was deleted.

branches/try2/src/etc/mingw-fix-include/winbase.h

Lines changed: 0 additions & 8 deletions
This file was deleted.

branches/try2/src/etc/mingw-fix-include/winsock2.h

Lines changed: 0 additions & 12 deletions
This file was deleted.

branches/try2/src/libextra/glob.rs

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,16 @@ fn list_dir_sorted(path: &Path) -> ~[Path] {
137137
/**
138138
* A compiled Unix shell style pattern.
139139
*/
140+
#[cfg(stage0)]
141+
#[deriving(Clone, Eq, TotalEq, Ord, TotalOrd, IterBytes)]
142+
pub struct Pattern {
143+
priv tokens: ~[PatternToken]
144+
}
145+
146+
/**
147+
* A compiled Unix shell style pattern.
148+
*/
149+
#[cfg(not(stage0))]
140150
#[deriving(Clone, Eq, TotalEq, Ord, TotalOrd, IterBytes, Default)]
141151
pub struct Pattern {
142152
priv tokens: ~[PatternToken]
@@ -455,10 +465,39 @@ fn is_sep(c: char) -> bool {
455465
}
456466
}
457467
468+
/**
469+
* Configuration options to modify the behaviour of `Pattern::matches_with(..)`
470+
*/
471+
#[cfg(stage0)]
472+
#[deriving(Clone, Eq, TotalEq, Ord, TotalOrd, IterBytes)]
473+
pub struct MatchOptions {
474+
475+
/**
476+
* Whether or not patterns should be matched in a case-sensitive manner. This
477+
* currently only considers upper/lower case relationships between ASCII characters,
478+
* but in future this might be extended to work with Unicode.
479+
*/
480+
case_sensitive: bool,
481+
482+
/**
483+
* If this is true then path-component separator characters (e.g. `/` on Posix)
484+
* must be matched by a literal `/`, rather than by `*` or `?` or `[...]`
485+
*/
486+
require_literal_separator: bool,
487+
488+
/**
489+
* If this is true then paths that contain components that start with a `.` will
490+
* not match unless the `.` appears literally in the pattern: `*`, `?` or `[...]`
491+
* will not match. This is useful because such files are conventionally considered
492+
* hidden on Unix systems and it might be desirable to skip them when listing files.
493+
*/
494+
require_literal_leading_dot: bool
495+
}
458496
459497
/**
460498
* Configuration options to modify the behaviour of `Pattern::matches_with(..)`
461499
*/
500+
#[cfg(not(stage0))]
462501
#[deriving(Clone, Eq, TotalEq, Ord, TotalOrd, IterBytes, Default)]
463502
pub struct MatchOptions {
464503

branches/try2/src/libextra/rl.rs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,25 @@ use std::libc::{c_char, c_int};
1313
use std::{local_data, str, rt};
1414
use std::unstable::finally::Finally;
1515

16+
#[cfg(stage0)]
17+
pub mod rustrt {
18+
use std::libc::{c_char, c_int};
19+
20+
extern {
21+
fn linenoise(prompt: *c_char) -> *c_char;
22+
fn linenoiseHistoryAdd(line: *c_char) -> c_int;
23+
fn linenoiseHistorySetMaxLen(len: c_int) -> c_int;
24+
fn linenoiseHistorySave(file: *c_char) -> c_int;
25+
fn linenoiseHistoryLoad(file: *c_char) -> c_int;
26+
fn linenoiseSetCompletionCallback(callback: *u8);
27+
fn linenoiseAddCompletion(completions: *(), line: *c_char);
28+
29+
fn rust_take_linenoise_lock();
30+
fn rust_drop_linenoise_lock();
31+
}
32+
}
33+
34+
#[cfg(not(stage0))]
1635
pub mod rustrt {
1736
use std::libc::{c_char, c_int};
1837

@@ -90,7 +109,7 @@ pub fn read(prompt: &str) -> Option<~str> {
90109

91110
pub type CompletionCb = @fn(~str, @fn(~str));
92111

93-
local_data_key!(complete_key: CompletionCb)
112+
static complete_key: local_data::Key<CompletionCb> = &local_data::Key;
94113

95114
/// Bind to the main completion callback in the current task.
96115
///

branches/try2/src/librustc/back/link.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,7 @@ pub mod jit {
190190

191191
// The stage1 compiler won't work, but that doesn't really matter. TLS
192192
// changed only very recently to allow storage of owned values.
193-
local_data_key!(engine_key: ~Engine)
193+
static engine_key: local_data::Key<~Engine> = &local_data::Key;
194194

195195
fn set_engine(engine: ~Engine) {
196196
local_data::set(engine_key, engine)

branches/try2/src/librustc/front/test.rs

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -293,6 +293,50 @@ fn mk_std(cx: &TestCtxt) -> ast::view_item {
293293
}
294294
}
295295

296+
#[cfg(stage0)]
297+
fn mk_test_module(cx: &TestCtxt) -> @ast::item {
298+
299+
// Link to extra
300+
let view_items = ~[mk_std(cx)];
301+
302+
// A constant vector of test descriptors.
303+
let tests = mk_tests(cx);
304+
305+
// The synthesized main function which will call the console test runner
306+
// with our list of tests
307+
let ext_cx = cx.ext_cx;
308+
let mainfn = (quote_item!(
309+
pub fn main() {
310+
#[main];
311+
extra::test::test_main_static(::std::os::args(), TESTS);
312+
}
313+
)).unwrap();
314+
315+
let testmod = ast::_mod {
316+
view_items: view_items,
317+
items: ~[mainfn, tests],
318+
};
319+
let item_ = ast::item_mod(testmod);
320+
321+
// This attribute tells resolve to let us call unexported functions
322+
let resolve_unexported_attr =
323+
attr::mk_attr(attr::mk_word_item(@"!resolve_unexported"));
324+
325+
let item = ast::item {
326+
ident: cx.sess.ident_of("__test"),
327+
attrs: ~[resolve_unexported_attr],
328+
id: ast::DUMMY_NODE_ID,
329+
node: item_,
330+
vis: ast::public,
331+
span: dummy_sp(),
332+
};
333+
334+
debug!("Synthetic test module:\n%s\n",
335+
pprust::item_to_str(@item.clone(), cx.sess.intr()));
336+
337+
return @item;
338+
}
339+
#[cfg(not(stage0))]
296340
fn mk_test_module(cx: &TestCtxt) -> @ast::item {
297341

298342
// Link to extra
@@ -363,6 +407,21 @@ fn path_node_global(ids: ~[ast::Ident]) -> ast::Path {
363407
}
364408
}
365409

410+
#[cfg(stage0)]
411+
fn mk_tests(cx: &TestCtxt) -> @ast::item {
412+
413+
let ext_cx = cx.ext_cx;
414+
415+
// The vector of test_descs for this crate
416+
let test_descs = mk_test_descs(cx);
417+
418+
(quote_item!(
419+
pub static TESTS : &'static [self::extra::test::TestDescAndFn] =
420+
$test_descs
421+
;
422+
)).unwrap()
423+
}
424+
#[cfg(not(stage0))]
366425
fn mk_tests(cx: &TestCtxt) -> @ast::item {
367426
// The vector of test_descs for this crate
368427
let test_descs = mk_test_descs(cx);
@@ -402,6 +461,63 @@ fn mk_test_descs(cx: &TestCtxt) -> @ast::Expr {
402461
}
403462
}
404463

464+
#[cfg(stage0)]
465+
fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> @ast::Expr {
466+
let span = test.span;
467+
let path = test.path.clone();
468+
469+
let ext_cx = cx.ext_cx;
470+
471+
debug!("encoding %s", ast_util::path_name_i(path));
472+
473+
let name_lit: ast::lit =
474+
nospan(ast::lit_str(ast_util::path_name_i(path).to_managed()));
475+
476+
let name_expr = @ast::Expr {
477+
id: ast::DUMMY_NODE_ID,
478+
node: ast::ExprLit(@name_lit),
479+
span: span
480+
};
481+
482+
let fn_path = path_node_global(path);
483+
484+
let fn_expr = @ast::Expr {
485+
id: ast::DUMMY_NODE_ID,
486+
node: ast::ExprPath(fn_path),
487+
span: span,
488+
};
489+
490+
let t_expr = if test.bench {
491+
quote_expr!( self::extra::test::StaticBenchFn($fn_expr) )
492+
} else {
493+
quote_expr!( self::extra::test::StaticTestFn($fn_expr) )
494+
};
495+
496+
let ignore_expr = if test.ignore {
497+
quote_expr!( true )
498+
} else {
499+
quote_expr!( false )
500+
};
501+
502+
let fail_expr = if test.should_fail {
503+
quote_expr!( true )
504+
} else {
505+
quote_expr!( false )
506+
};
507+
508+
let e = quote_expr!(
509+
self::extra::test::TestDescAndFn {
510+
desc: self::extra::test::TestDesc {
511+
name: self::extra::test::StaticTestName($name_expr),
512+
ignore: $ignore_expr,
513+
should_fail: $fail_expr
514+
},
515+
testfn: $t_expr,
516+
}
517+
);
518+
e
519+
}
520+
#[cfg(not(stage0))]
405521
fn mk_test_desc_and_fn_rec(cx: &TestCtxt, test: &Test) -> @ast::Expr {
406522
let span = test.span;
407523
let path = test.path.clone();

branches/try2/src/librustc/middle/const_eval.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ use syntax::visit;
1919
use syntax::visit::Visitor;
2020
use syntax::ast::*;
2121

22+
use std::float;
2223
use std::hashmap::{HashMap, HashSet};
2324

2425
//
@@ -475,9 +476,9 @@ pub fn lit_to_const(lit: &lit) -> const_val {
475476
lit_int(n, _) => const_int(n),
476477
lit_uint(n, _) => const_uint(n),
477478
lit_int_unsuffixed(n) => const_int(n),
478-
lit_float(n, _) => const_float(from_str::<float>(n).unwrap() as f64),
479+
lit_float(n, _) => const_float(float::from_str(n).unwrap() as f64),
479480
lit_float_unsuffixed(n) =>
480-
const_float(from_str::<float>(n).unwrap() as f64),
481+
const_float(float::from_str(n).unwrap() as f64),
481482
lit_nil => const_int(0i64),
482483
lit_bool(b) => const_bool(b)
483484
}

0 commit comments

Comments
 (0)