about summary refs log tree commit diff
path: root/src/librustc/middle
AgeCommit message (Collapse)AuthorLines
2013-05-14Fix cosmetics for fail!() callsMarvin Löbel-8/+8
2013-05-14Use static string with fail!() and remove fail!(fmt!())Björn Steinbrink-111/+105
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-13auto merge of #6417 : pcwalton/rust/exprs-in-patterns, r=pcwaltonbors-460/+554
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-1/+69
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-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-460/+554
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-1/+72
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 #6389 : sonwow/rust/issue-3356, r=bstriebors-18/+18
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-10Remove the '<->' operator from the languageAlex Crichton-76/+4
2013-05-10auto merge of #6223 : alexcrichton/rust/issue-6183, r=pcwaltonbors-15/+520
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/+3
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-10renamed str::from_slice to str::to_ownedYoungsoo Son-1/+1
2013-05-10renamed vec::from_slice to vec::to_ownedYoungsoo Son-17/+17
2013-05-10auto merge of #6356 : dotdash/rust/strinterner, r=pcwaltonbors-118/+118
&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-10/+499
2013-05-10Implement a new protocol for `for` loops that's much more easily composableAlex Crichton-5/+30
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-163/+166
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-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
2013-05-09Issue the correct deref count for the implicit deref that occursNiko Matsakis-19/+67
as part of an autoslice operation (#6272). Fixes #6272.
2013-05-09auto merge of #6354 : Aatch/rust/uninit-intrinsic, r=graydonbors-1/+5
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.
2013-05-09auto merge of #6325 : sammykim/rust/lint-name, r=graydonbors-0/+8
Fix #3525.
2013-05-09Refactor representation of bounds to separate out BuiltinBounds intoNiko Matsakis-163/+166
its own type. 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.
2013-05-09Use a specialized string interner to reduce the need for owned stringsBjörn Steinbrink-118/+118
&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-09auto merge of #6345 : seanmoon/rust/fix-typos, r=sanxiynbors-3/+3
Hi there, Really enjoying Rust. Noticed a few typos so I searched around for a few more--here's some fixes. Ran `make check` and got `summary of 24 test runs: 4868 passed; 0 failed; 330 ignored`. Thanks! Sean
2013-05-09Add uninit intrinsicJames Miller-1/+5
2013-05-09librustc: rename vec::each(var) to var.eachYoungmin Yoo-48/+47
2013-05-08librustc: Fix merge fallout.Patrick Walton-7/+0
2013-05-08libcore: Fix tests.Patrick Walton-1/+1
2013-05-08librustc: Fix merge fallout.Patrick Walton-1/+1