about summary refs log tree commit diff
path: root/src/librustc
AgeCommit message (Collapse)AuthorLines
2013-05-14Fix cosmetics for fail!() callsMarvin Löbel-16/+14
2013-05-14Use static string with fail!() and remove fail!(fmt!())Björn Steinbrink-144/+138
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-13Remove re-exports from libcore/core.rcAlex Crichton-3/+3
Also fix up all the fallout elsewhere throughout core. It's really nice being able to have the prelude.
2013-05-13auto merge of #6417 : pcwalton/rust/exprs-in-patterns, r=pcwaltonbors-464/+558
r? @graydon
2013-05-13auto merge of #6443 : cmr/rust/resolution, r=bstriebors-5/+20
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-5/+87
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-13TidyMatthijs Hofstra-1/+1
2013-05-13Use backticks to delineate paths/identifiersCorey Richardson-2/+2
2013-05-13Correct #[always_inline] -> #[inline(always)] and __attribute((...)) -> ↵Luqman Aden-1/+1
__attribute__((...)).
2013-05-13Better error for some unresolved importsCorey Richardson-5/+20
When trying to import nonexistent items from existing modules, specify that that is what happened, rather than just reporting "unresolved name".
2013-05-12auto merge of #6400 : cmr/rust/remove_useless_import_error, r=thestingerbors-1/+0
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-12librustc: Make `self` and `static` into keywordsPatrick Walton-464/+558
2013-05-13Removed unnecessary check from build.rsMatthijs Hofstra-4/+1
2013-05-12Adds atomic_load, atomic_load_acq, atomic_store, and atomic_store_rel ↵Matthijs Hofstra-5/+90
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-48/+69
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-11clean up the last bit of warningsCorey Richardson-3/+6
2013-05-11Warning policeTim Chevalier-5/+3
2013-05-11rustc: Don't call type_error_message() with ty_err as the expected typeTim Chevalier-48/+69
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-14/+14
2013-05-11auto merge of #6397 : cantsin/rust/rusti-fixes, r=catamorphismbors-2/+2
Fixes #6378 Don't pass the binary name to the LLVMRustExecuteJIT closure, otherwise it will leak memory; the binary name doesn't seem to be needed, anyhow.
2013-05-11auto merge of #6389 : sonwow/rust/issue-3356, r=bstriebors-28/+28
Fix for #3356
2013-05-11auto merge of #6385 : huonw/rust/rustc-dtor-struct-match, r=nikomatsakisbors-22/+38
**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-4/+4
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-11auto merge of #6384 : thomaslee/rust/issue-4202, r=catamorphismbors-0/+42
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 #6260 : alexcrichton/rust/issue-3466-no-swap, r=pcwaltonbors-76/+4
There may be a more efficient implementation of `core::util::swap_ptr`. The issue mentioned using `move_val_init`, but I couldn't figure out what that did, so I just used `copy_memory` a few times instead. I'm not exactly the best at reading LLVM generated by rust, but this does appear to be optimized away just as expected (when possible).
2013-05-10Remove the '<->' operator from the languageAlex Crichton-76/+4
2013-05-10auto merge of #6205 : brson/rust/flate, r=brsonbors-2/+2
r? @graydon I don't think this is necessary in core.
2013-05-10auto merge of #6223 : alexcrichton/rust/issue-6183, r=pcwaltonbors-24/+633
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-10Fix merge "failures"Alex Crichton-12/+20
2013-05-10Move flate from core to stdBrian Anderson-2/+2
2013-05-10more back-ticks, less colonsLenny222-14/+14
2013-05-10Remove redundant import errorCorey Richardson-1/+0
2013-05-10auto merge of #6380 : pcwalton/rust/core-text-ice, r=pcwaltonbors-19/+21
2013-05-10Fixes rusti crashes.James Tranovich-2/+2
Don't pass the binary name to the LLVMRustExecuteJIT closure; doesn't seem to be needed, anyhow.
2013-05-10renamed str::from_slice to str::to_ownedYoungsoo Son-9/+9
2013-05-10renamed vec::from_slice to vec::to_ownedYoungsoo Son-19/+19
2013-05-10auto merge of #6356 : dotdash/rust/strinterner, r=pcwaltonbors-137/+137
&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-22/+38
no moves. This check only works for `match`s, the checks (incorrectly) do not run for patterns in `let`s.
2013-05-10auto merge of #6347 : cmr/rust/unknown_module_resolve_error, r=catamorphismbors-1/+11
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-10rustc: Use the new `for` protocolAlex Crichton-19/+595
2013-05-10Implement a new protocol for `for` loops that's much more easily composableAlex Crichton-5/+30
2013-05-09Include static methods on traits in reexports.Tom Lee-0/+42
2013-05-09librustc: Fix ICE in core-text resulting from dynamic borrowing. ↵Patrick Walton-19/+21
rs=blocking-servo
2013-05-09auto merge of #6336 : nikomatsakis/rust/issue-6308-closure-bounds, ↵bors-207/+512
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-09auto merge of #6373 : nikomatsakis/rust/issue-6355-perf-regression, r=graydonbors-35/+76
Fix #6355 and #6272---we were not giving the correct index to the derefs that occur as part of the rooting process, resulting in extra copies and generally bogus behavior. Haven't quite produced the right test for this, but I thought I'd push the fix in the meantime. Test will follow shortly. r? @graydon
2013-05-09rustc: Add EnumSet testsNiko Matsakis-4/+149
2013-05-09Tweak error messageCorey Richardson-2/+2
Recommendation of @kud1ing
2013-05-09Better error message for certain classes of unresolved importsCorey Richardson-1/+11
2013-05-09Remove remnants of mutable fields from mem_categorization, borrowck.Niko Matsakis-16/+9