Skip to content

Commit 143e613

Browse files
committed
---
yaml --- r: 66523 b: refs/heads/master c: af30fe2 h: refs/heads/master i: 66521: e83bb23 66519: d67170a v: v3
1 parent 329a41b commit 143e613

File tree

16 files changed

+73
-122
lines changed

16 files changed

+73
-122
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: e482856d76fba8d31ee114d4fb74f8c18f63e73c
2+
refs/heads/master: af30fe25a58c5eb1ac088f824b22621ed3652976
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 18e3db7392d2d0697b7e27d6d986139960144d85
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9

trunk/src/librustc/back/link.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -660,10 +660,9 @@ pub fn sanitize(s: &str) -> ~str {
660660
| '_' => result.push_char(c),
661661

662662
_ => {
663-
let mut tstr = ~"";
664-
do char::escape_unicode(c) |c| { tstr.push_char(c); }
665-
result.push_char('$');
666-
result.push_str(tstr.slice_from(1));
663+
if c > 'z' && char::is_XID_continue(c) {
664+
result.push_char(c);
665+
}
667666
}
668667
}
669668
}

trunk/src/librustc/middle/kind.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,9 @@ fn with_appropriate_checker(cx: Context, id: node_id,
198198
fn check_for_bare(cx: Context, fv: @freevar_entry) {
199199
cx.tcx.sess.span_err(
200200
fv.span,
201-
"attempted dynamic environment capture");
202-
}
201+
"can't capture dynamic environment in a fn item; \
202+
use the || { ... } closure form instead");
203+
} // same check is done in resolve.rs, but shouldn't be done
203204

204205
let fty = ty::node_id_to_type(cx.tcx, id);
205206
match ty::get(fty).sty {

trunk/src/librustc/middle/resolve.rs

Lines changed: 4 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3382,7 +3382,8 @@ impl Resolver {
33823382

33833383
self.session.span_err(
33843384
span,
3385-
"attempted dynamic environment-capture");
3385+
"can't capture dynamic environment in a fn item; \
3386+
use the || { ... } closure form instead");
33863387
} else {
33873388
// This was an attempt to use a type parameter outside
33883389
// its scope.
@@ -3404,7 +3405,8 @@ impl Resolver {
34043405

34053406
self.session.span_err(
34063407
span,
3407-
"attempted dynamic environment-capture");
3408+
"can't capture dynamic environment in a fn item; \
3409+
use the || { ... } closure form instead");
34083410
} else {
34093411
// This was an attempt to use a type parameter outside
34103412
// its scope.
@@ -3846,27 +3848,6 @@ impl Resolver {
38463848
generics: &Generics,
38473849
fields: &[@struct_field],
38483850
visitor: ResolveVisitor) {
3849-
let mut ident_map = HashMap::new::<ast::ident, @struct_field>();
3850-
for fields.iter().advance |&field| {
3851-
match field.node.kind {
3852-
named_field(ident, _) => {
3853-
match ident_map.find(&ident) {
3854-
Some(&prev_field) => {
3855-
let ident_str = self.session.str_of(ident);
3856-
self.session.span_err(field.span,
3857-
fmt!("field `%s` is already declared", ident_str));
3858-
self.session.span_note(prev_field.span,
3859-
"Previously declared here");
3860-
},
3861-
None => {
3862-
ident_map.insert(ident, field);
3863-
}
3864-
}
3865-
}
3866-
_ => ()
3867-
}
3868-
}
3869-
38703851
// If applicable, create a rib for the type parameters.
38713852
do self.with_type_parameter_rib(HasTypeParameters
38723853
(generics, id, 0,

trunk/src/librustc/middle/trans/base.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2901,10 +2901,6 @@ pub fn trans_crate(sess: session::Session,
29012901
reachable_map: @mut HashSet<ast::node_id>,
29022902
maps: astencode::Maps)
29032903
-> (ContextRef, ModuleRef, LinkMeta) {
2904-
// Before we touch LLVM, make sure that multithreading is enabled.
2905-
if unsafe { !llvm::LLVMRustStartMultithreading() } {
2906-
sess.bug("couldn't enable multi-threaded LLVM");
2907-
}
29082904
29092905
let mut symbol_hasher = hash::default_state();
29102906
let link_meta = link::build_link_meta(sess, crate, output, &mut symbol_hasher);
@@ -2919,6 +2915,12 @@ pub fn trans_crate(sess: session::Session,
29192915
// 1. http://llvm.org/bugs/show_bug.cgi?id=11479
29202916
let llmod_id = link_meta.name.to_owned() + ".rc";
29212917
2918+
// FIXME(#6511): get LLVM building with --enable-threads so this
2919+
// function can be called
2920+
// if !llvm::LLVMRustStartMultithreading() {
2921+
// sess.bug("couldn't enable multi-threaded LLVM");
2922+
// }
2923+
29222924
let ccx = @mut CrateContext::new(sess,
29232925
llmod_id,
29242926
tcx,

trunk/src/librusti/rusti.rs

Lines changed: 34 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -528,9 +528,6 @@ mod tests {
528528
}
529529
}
530530

531-
// FIXME: #7220 rusti on 32bit mac doesn't work.
532-
#[cfg(not(target_word_size="32"))]
533-
#[cfg(not(target_os="macos"))]
534531
fn run_program(prog: &str) {
535532
let mut r = repl();
536533
for prog.split_iter('\n').advance |cmd| {
@@ -539,66 +536,63 @@ mod tests {
539536
r = result.expect(fmt!("the command '%s' failed", cmd));
540537
}
541538
}
542-
#[cfg(target_word_size="32", target_os="macos")]
543-
fn run_program(_: &str) {}
544539

545540
#[test]
546-
fn super_basic() {
541+
// FIXME: #7220 rusti on 32bit mac doesn't work.
542+
#[cfg(not(target_word_size="32",
543+
target_os="macos"))]
544+
fn run_all() {
545+
// FIXME(#7071):
546+
// By default, unit tests are run in parallel. Rusti, on the other hand,
547+
// does not enjoy doing this. I suspect that it is because the LLVM
548+
// bindings are not thread-safe (when running parallel tests, some tests
549+
// were triggering assertions in LLVM (or segfaults). Hence, this
550+
// function exists to run everything serially (sadface).
551+
//
552+
// To get some interesting output, run with RUST_LOG=rusti::tests
553+
554+
debug!("hopefully this runs");
547555
run_program("");
548-
}
549556

550-
#[test]
551-
fn regression_5937() {
557+
debug!("regression test for #5937");
552558
run_program("use std::hashmap;");
553-
}
554559

555-
#[test]
556-
fn regression_5784() {
560+
debug!("regression test for #5784");
557561
run_program("let a = 3;");
558-
}
559562

560-
#[test] #[ignore]
561-
fn new_tasks() {
562563
// XXX: can't spawn new tasks because the JIT code is cleaned up
563564
// after the main function is done.
564-
run_program("
565-
spawn( || println(\"Please don't segfault\") );
566-
do spawn { println(\"Please?\"); }
567-
");
568-
}
565+
// debug!("regression test for #5803");
566+
// run_program("
567+
// spawn( || println(\"Please don't segfault\") );
568+
// do spawn { println(\"Please?\"); }
569+
// ");
569570

570-
#[test]
571-
fn inferred_integers_usable() {
571+
debug!("inferred integers are usable");
572572
run_program("let a = 2;\n()\n");
573573
run_program("
574574
let a = 3;
575575
let b = 4u;
576576
assert!((a as uint) + b == 7)
577577
");
578-
}
579578

580-
#[test]
581-
fn local_variables_allow_shadowing() {
579+
debug!("local variables can be shadowed");
582580
run_program("
583581
let a = 3;
584582
let a = 5;
585583
assert!(a == 5)
586584
");
587-
}
588585

589-
#[test]
590-
fn string_usable() {
586+
debug!("strings are usable");
591587
run_program("
592588
let a = ~\"\";
593589
let b = \"\";
594590
let c = @\"\";
595591
let d = a + b + c;
596592
assert!(d.len() == 0);
597593
");
598-
}
599594

600-
#[test]
601-
fn vectors_usable() {
595+
debug!("vectors are usable");
602596
run_program("
603597
let a = ~[1, 2, 3];
604598
let b = &[1, 2, 3];
@@ -607,19 +601,15 @@ mod tests {
607601
assert!(d.len() == 9);
608602
let e: &[int] = [];
609603
");
610-
}
611604

612-
#[test]
613-
fn structs_usable() {
605+
debug!("structs are usable");
614606
run_program("
615607
struct A{ a: int }
616608
let b = A{ a: 3 };
617609
assert!(b.a == 3)
618610
");
619-
}
620611

621-
#[test]
622-
fn mutable_variables_work() {
612+
debug!("mutable variables");
623613
run_program("
624614
let mut a = 3;
625615
a = 5;
@@ -628,37 +618,29 @@ mod tests {
628618
assert!(b.contains(&5))
629619
assert!(b.len() == 1)
630620
");
631-
}
632621

633-
#[test]
634-
fn functions_saved() {
622+
debug!("functions are cached");
635623
run_program("
636624
fn fib(x: int) -> int { if x < 2 {x} else { fib(x - 1) + fib(x - 2) } }
637625
let a = fib(3);
638626
let a = a + fib(4);
639627
assert!(a == 5)
640628
");
641-
}
642629

643-
#[test]
644-
fn modules_saved() {
630+
debug!("modules are cached");
645631
run_program("
646632
mod b { pub fn foo() -> uint { 3 } }
647633
assert!(b::foo() == 3)
648634
");
649-
}
650635

651-
#[test]
652-
fn multiple_functions() {
636+
debug!("multiple function definitions are allowed");
653637
run_program("
654638
fn f() {}
655639
fn f() {}
656640
f()
657641
");
658-
}
659642

660-
#[test]
661-
fn multiple_items_same_name() {
643+
debug!("multiple item definitions are allowed");
662644
run_program("
663645
fn f() {}
664646
mod f {}
@@ -675,6 +657,9 @@ mod tests {
675657
}
676658

677659
#[test]
660+
// FIXME: #7220 rusti on 32bit mac doesn't work.
661+
#[cfg(not(target_word_size="32",
662+
target_os="macos"))]
678663
fn exit_quits() {
679664
let mut r = repl();
680665
assert!(r.running);

trunk/src/librustpkg/tests.rs

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -307,10 +307,18 @@ fn frob_source_file(workspace: &Path, pkgid: &PkgId) {
307307
}
308308
}
309309

310-
// FIXME(#7249): these tests fail on multi-platform builds, so for now they're
311-
// only run one x86
310+
#[test] #[ignore] //FIXME(#7249)
311+
fn test_all() {
312+
// FIXME(#7071): these tests use rustc, so they can't be run in parallel
313+
// until this issue is resolved
314+
test_make_dir_rwx();
315+
test_install_valid();
316+
test_install_invalid();
317+
test_install_url();
318+
test_package_ids_must_be_relative_path_like();
319+
test_package_version();
320+
}
312321

313-
#[test] #[ignore(cfg(target_arch = "x86"))]
314322
fn test_make_dir_rwx() {
315323
let temp = &os::tmpdir();
316324
let dir = temp.push("quux");
@@ -323,7 +331,6 @@ fn test_make_dir_rwx() {
323331
assert!(os::remove_dir_recursive(&dir));
324332
}
325333

326-
#[test] #[ignore(cfg(target_arch = "x86"))]
327334
fn test_install_valid() {
328335
use path_util::installed_library_in_workspace;
329336

@@ -353,7 +360,6 @@ fn test_install_valid() {
353360
assert!(!os::path_exists(&bench));
354361
}
355362

356-
#[test] #[ignore(cfg(target_arch = "x86"))]
357363
fn test_install_invalid() {
358364
use conditions::nonexistent_package::cond;
359365
use cond1 = conditions::missing_pkg_files::cond;
@@ -376,7 +382,6 @@ fn test_install_invalid() {
376382
assert!(error_occurred && error1_occurred);
377383
}
378384

379-
#[test] #[ignore(cfg(target_arch = "x86"))]
380385
fn test_install_url() {
381386
let workspace = mkdtemp(&os::tmpdir(), "test").expect("couldn't create temp dir");
382387
let sysroot = test_sysroot();
@@ -412,7 +417,6 @@ fn test_install_url() {
412417
assert!(!os::path_exists(&bench));
413418
}
414419

415-
#[test] #[ignore(cfg(target_arch = "x86"))]
416420
fn test_package_ids_must_be_relative_path_like() {
417421
use conditions::bad_pkg_id::cond;
418422

@@ -453,7 +457,6 @@ fn test_package_ids_must_be_relative_path_like() {
453457
454458
}
455459
456-
#[test] #[ignore(cfg(target_arch = "x86"))]
457460
fn test_package_version() {
458461
let temp_pkg_id = PkgId::new("github.com/catamorphism/test_pkg_version");
459462
match temp_pkg_id.version {
@@ -476,8 +479,9 @@ fn test_package_version() {
476479
push("test_pkg_version")));
477480
}
478481
479-
// FIXME #7006: Fails on linux/mac for some reason
480-
#[test] #[ignore]
482+
// FIXME #7006: Fails on linux for some reason
483+
#[test]
484+
#[ignore]
481485
fn test_package_request_version() {
482486
let temp_pkg_id = PkgId::new("github.com/catamorphism/test_pkg_version#0.3");
483487
let temp = mk_empty_workspace(&LocalPath(Path("test_pkg_version")), &ExactRevision(~"0.3"));
Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +0,0 @@
1-
# If this file is modified, then llvm will be forcibly cleaned and then rebuilt.
2-
# The actual contents of this file do not matter, but to trigger a change on the
3-
# build bots then the contents should be changed so git updates the mtime.
4-
6-29-2013

trunk/src/test/compile-fail/bad-env-capture.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern: attempted dynamic environment-capture
11+
// error-pattern: can't capture dynamic environment in a fn item;
1212
fn foo() {
1313
let x: int;
1414
fn bar() { log(debug, x); }

trunk/src/test/compile-fail/bad-env-capture2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern: attempted dynamic environment-capture
11+
// error-pattern: can't capture dynamic environment in a fn item;
1212
fn foo(x: int) {
1313
fn bar() { log(debug, x); }
1414
}

trunk/src/test/compile-fail/bad-env-capture3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

11-
// error-pattern: attempted dynamic environment-capture
11+
// error-pattern: can't capture dynamic environment in a fn item;
1212
fn foo(x: int) {
1313
fn mth() {
1414
fn bar() { log(debug, x); }

trunk/src/test/compile-fail/capture1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// except according to those terms.
1111

1212

13-
// error-pattern: attempted dynamic environment-capture
13+
// error-pattern: can't capture dynamic environment in a fn item;
1414

1515
fn main() {
1616
let bar: int = 5;

0 commit comments

Comments
 (0)