about summary refs log tree commit diff
path: root/src/test
AgeCommit message (Collapse)AuthorLines
2013-05-14Fix cosmetics for fail!() callsMarvin Löbel-3/+3
2013-05-14Use static string with fail!() and remove fail!(fmt!())Björn Steinbrink-92/+92
fail!() used to require owned strings but can handle static strings now. Also, it can pass its arguments to fmt!() on its own, no need for the caller to call fmt!() itself.
2013-05-14auto merge of #6441 : alexcrichton/rust/issue-5531, r=luqmanabors-1/+1
Also fix up all the fallout elsewhere throughout core. It's really nice being able to have the prelude. I'm not quite sure how resolution works with traits, but it seems to me like the public imports at the top-level of the core crate were leaking into the sub-crates, but that could also be working as intended. Regardless, things compile without the re-exports now.
2013-05-13auto merge of #6388 : recrack/rust/each2_mut, r=pcwaltonbors-0/+38
- vec.rs :add 'each2_mut function' - testsuit : run-pass/vec-each2_mut.rs
2013-05-13Remove re-exports from libcore/core.rcAlex Crichton-1/+1
Also fix up all the fallout elsewhere throughout core. It's really nice being able to have the prelude.
2013-05-13auto merge of #6387 : brson/rust/unstable, r=brsonbors-2/+2
r? @pcwalton * Move `SharedMutableState`, `LittleLock`, and `Exclusive` from `core::unstable` to `core::unstable::sync` * Modernize the `SharedMutableState` interface with methods * Rename `SharedMutableState` to `UnsafeAtomicRcBox` to match `RcBox`.
2013-05-13auto merge of #6417 : pcwalton/rust/exprs-in-patterns, r=pcwaltonbors-8/+10
r? @graydon
2013-05-13core: Move locks, atomic rc to unstable::syncBrian Anderson-2/+2
2013-05-13test: Fix broken benchmark testPatrick Walton-3/+3
2013-05-13auto merge of #6443 : cmr/rust/resolution, r=bstriebors-1/+1
When trying to import nonexistent items from existing modules, specify that that is what happened, rather than just reporting "unresolved name". Ideally the error would be reported on the span of the import... but I do not see a way to get a span there. Help appreciated :smile:
2013-05-13auto merge of #6437 : Thiez/rust/atomic, r=Aatchbors-0/+15
This pull request adds 4 atomic intrinsics to the compiler, in preparation for #5042. * `atomic_load(src: &int) -> int` performs an atomic sequentially consistent load. * `atomic_load_acq(src: &int) -> int` performs an atomic acquiring load. * `atomic_store(dst: &mut int, val: int)` performs an atomic sequentially consistent store. * `atomic_store_rel(dst: &mut int, val: int)` performs an atomic releasing store. For more information about the whole acquire/release thing: http://llvm.org/docs/Atomics.html r?
2013-05-13Better error for some unresolved importsCorey Richardson-1/+1
When trying to import nonexistent items from existing modules, specify that that is what happened, rather than just reporting "unresolved name".
2013-05-13Add vec.rs each2_mut testsuiteYoungmin Yoo-0/+38
2013-05-12auto merge of #6400 : cmr/rust/remove_useless_import_error, r=thestingerbors-2/+1
Every unresolved import is reported. An additional error message isn't useful and obscures (imo) the real errors: I need to take it into account when looking at the error count.
2013-05-12actually fix failing testCorey Richardson-1/+1
2013-05-12librustc: Make `self` and `static` into keywordsPatrick Walton-3/+3
2013-05-12libsyntax: Remove `extern mod foo { ... }` from the language.Patrick Walton-2/+4
2013-05-12Adds atomic_load, atomic_load_acq, atomic_store, and atomic_store_rel ↵Matthijs Hofstra-0/+15
intrinsics. The default versions (atomic_load and atomic_store) are sequentially consistent. The atomic_load_acq intrinsic acquires as described in [1]. The atomic_store_rel intrinsic releases as described in [1]. [1]: http://llvm.org/docs/Atomics.html
2013-05-12auto merge of #6427 : catamorphism/rust/issue-6319, r=nikomatsakisbors-1/+15
r? @nikomatsakis In #6319, several people mentioned they ran into a "computing fictitious type" ICE in trans. This turns out to be because some of my recent changes to typeck::check::_match resulted in type errors getting reported with ty_err as the expected type, which meant the errors were suppressed, and typechecking incorrectly succeeded (since the errors weren't recorded). Changed the error messages in these cases not to use an expected type at all, rather, printing out a string describing the type that was expected (which is what the code originally did). The result is a bit repetitive and the proliferation of error-reporting functions in typeck::infer is a bit annoying, but I thought it was important to fix this now; more cleanup can happen later.
2013-05-12Fix failing testCorey Richardson-2/+1
2013-05-11rustc: Don't call type_error_message() with ty_err as the expected typeTim Chevalier-1/+15
In #6319, several people mentioned they ran into a "computing fictitious type" ICE in trans. This turns out to be because some of my recent changes to typeck::check::_match resulted in type errors getting reported with ty_err as the expected type, which meant the errors were suppressed, and typechecking incorrectly succeeded (since the errors weren't recorded). Changed the error messages in these cases not to use an expected type at all, rather, printing out a string describing the type that was expected (which is what the code originally did). The result is a bit repetitive and the proliferation of error-reporting functions in typeck::infer is a bit annoying, but I thought it was important to fix this now; more cleanup can happen later.
2013-05-11auto merge of #6402 : kud1ing/rust/fixes, r=pcwaltonbors-20/+20
2013-05-11auto merge of #6389 : sonwow/rust/issue-3356, r=bstriebors-2/+2
Fix for #3356
2013-05-11auto merge of #6385 : huonw/rust/rustc-dtor-struct-match, r=nikomatsakisbors-1/+94
**Caveat**: With the current commit, this check only works for `match`s, the checks (incorrectly) do not run for patterns in `let`s, and invalid/unsafe code compiles. I don't know how to fix this, I experimented with some things to try to make let patterns and match patterns run on the same code (since this would presumably fix many of the other unsoundness issues of let-patterns, e.g. #6225), but I don't understand enough of the code. (I think I heard someone talking about a fix for `let` being in progress?) Fixes #6344 and #6341.
2013-05-11auto merge of #6383 : huonw/rust/rustc-expand-then-strip, r=thestingerbors-12/+3
This allows macros to create tests and benchmarks. This is possibly unsound (I've got no idea, but it seemed to work), and being able to programmatically generate benchmarks to compare several implementations of similar algorithms is nice.
2013-05-11Correct testcases that passed because fns with #[test] were stripped before ↵Huon Wilson-12/+3
expansion.
2013-05-11auto merge of #6384 : thomaslee/rust/issue-4202, r=catamorphismbors-0/+41
This fixes the issue described in #4202. From what I understood of the code, when we reexport a trait in a submodule using e.g. "pub use foo::SomeTrait", we were not previously making an effort to reexport the static methods on that trait. I'm new to the Rust code base (and the Rust language itself) so my approach may not be kosher, but this patch works by changing the encoder to include the static methods associated with traits. I couldn't see any tests for this area of the code, so I didn't really have any examples to go by. If tests are needed, I'm happy to work through that if I can get some assistance to do so.
2013-05-10auto merge of #6376 : nikomatsakis/rust/issue-6272-tests, r=graydonbors-0/+62
r? @graydon
2013-05-10auto merge of #6368 : catamorphism/rust/issue-5315, r=catamorphismbors-0/+43
2013-05-10Test case for issue #4202Tom Lee-0/+41
2013-05-10Fix tests with the swap operatorAlex Crichton-2/+2
2013-05-10Stop using the '<->' operatorAlex Crichton-89/+43
2013-05-10auto merge of #6223 : alexcrichton/rust/issue-6183, r=pcwaltonbors-36/+34
Closes #6183. The first commit changes the compiler's method of treating a `for` loop, and all the remaining commits are just dealing with the fallout. The biggest fallout was the `IterBytes` trait, although it's really a whole lot nicer now because all of the `iter_bytes_XX` methods are just and-ed together. Sadly there was a huge amount of stuff that's `cfg(stage0)` gated, but whoever lands the next snapshot is going to have a lot of fun deleting all this code!
2013-05-10test: Use the new `for` protocolAlex Crichton-36/+34
2013-05-10more back-ticks, less colonsLenny222-20/+20
2013-05-10auto merge of #6366 : catamorphism/rust/issue-3920, r=catamorphismbors-0/+17
r? @nikomatsakis as per #3920
2013-05-10renamed str::from_slice to str::to_ownedYoungsoo Son-2/+2
2013-05-10auto merge of #6329 : sonwow/rust/issue-6306, r=ILyoanbors-2/+2
Fix for #6306
2013-05-10Add some positive tests for dtor struct destructuringHuon Wilson-0/+46
2013-05-10Issue number on xfailed testHuon Wilson-1/+1
2013-05-10auto merge of #6356 : dotdash/rust/strinterner, r=pcwaltonbors-9/+9
&str can be turned into @~str on demand, using to_owned(), so for strings, we can create a specialized interner that accepts &str for intern() and find() but stores and returns @~str.
2013-05-10librustc: allow destructuring of structs with destructors if the pattern has ↵Huon Wilson-1/+48
no moves. This check only works for `match`s, the checks (incorrectly) do not run for patterns in `let`s.
2013-05-10A test file is fixedYoungsoo Son-2/+2
2013-05-10auto merge of #6347 : cmr/rust/unknown_module_resolve_error, r=catamorphismbors-1/+13
This improves error reporting for the following class of imports: ```rust use foo::bar; ``` Where foo, the topmost module, is unresolved. It now results in: ```text /tmp/foo.rs:1:4: 1:7 error: unresolved import. perhapsyou forgot an 'extern mod foo'? /tmp/foo.rs:1 use foo::bar; ^~~ /tmp/foo.rs:1:4: 1:12 error: failed to resolve import: foo::bar /tmp/foo.rs:1 use foo::bar; ^~~~~~~~ error: failed to resolve imports error: aborting due to 3 previous errors ``` This is the first of a series of changes I plan on making to unresolved name error messages.
2013-05-09auto merge of #6336 : nikomatsakis/rust/issue-6308-closure-bounds, ↵bors-6/+3
r=nikomatsakis Use a bitset to represent built-in bounds. There are several places in the language where only builtin bounds (aka kinds) will be accepted, e.g. on closures, destructor type parameters perhaps, and on trait types. r? @brson
2013-05-09fix formating and testsCorey Richardson-1/+1
2013-05-09compile-fail test for new unresolved import errorCorey Richardson-0/+12
2013-05-09testsuite: Test that init and forget are both unsafeTim Chevalier-0/+17
2013-05-09test: Add two tests for issue #6272.Niko Matsakis-0/+62
2013-05-09auto merge of #6354 : Aatch/rust/uninit-intrinsic, r=graydonbors-0/+19
Adds an `uninit` intrinsic. It's just an empty function, so llvm optimizes it down to nothing. I changed all of the `init` intrinsic usages to `uninit` where it seemed appropriate to.