summary refs log tree commit diff
path: root/src/librustc/middle
AgeCommit message (Collapse)AuthorLines
2013-07-01auto merge of #7409 : alexcrichton/rust/threadsafe, r=cmrbors-6/+4
@catamorphism, this re-enables threadsafe rustpkg tests, @brson this will fail unless the bots have LLVM rebuilt, so this is a good indicator of whether that happened or not.
2013-07-01Turn on using LLVM threadsafelyAlex Crichton-6/+4
2013-07-01auto merge of #7443 : yjh0502/rust/fix_field_dup, r=huonwbors-0/+21
Check if there is duplicated field names in struct.
2013-07-01auto merge of #7521 : thestinger/rust/vec, r=Aatchbors-19/+37
continued from #7495
2013-06-30auto merge of #7487 : huonw/rust/vec-kill, r=cmrbors-65/+63
Continuation of #7430. I haven't removed the `map` method, since the replacement `v.iter().transform(f).collect::<~[SomeType]>()` is a little ridiculous at the moment.
2013-06-30pass exchange_malloc an alignment, not a tydescDaniel Micay-19/+37
2013-06-30auto merge of #7495 : thestinger/rust/exchange, r=cmrbors-79/+96
With these changes, exchange allocator headers are never initialized, read or written to. Removing the header will now just involve updating the code in trans using an offset to only do it if the type contained is managed. The only thing blocking removing the initialization of the last field in the header was ~fn since it uses it to store the dynamic size/types due to captures. I temporarily switched it to a `closure_exchange_alloc` lang item (it uses the same `exchange_free`) and #7496 is filed about removing that. Since the `exchange_free` call is now inlined all over the codebase, I don't think we should have an assert for null. It doesn't currently ever happen, but it would be fine if we started generating code that did do it. The `exchange_free` function also had a comment declaring that it must not fail, but a regular assert would cause a failure. I also removed the atomic counter because valgrind can already find these leaks, and we have valgrind bots now. Note that exchange free does not currently print an error an out-of-memory when it aborts, because our `io` code may allocate. We could probably get away with a `#[rust_stack]` call to a `stdio` function but it would be better to make a write system call.
2013-06-30add a closure_exchange_malloc lang itemDaniel Micay-71/+87
this makes the exchange allocation header completely unused, and leaves it uninitialized
2013-06-30stop copying the tydesc in unique box take glueDaniel Micay-9/+4
the only user of the tydesc is ~fn, and it doesn't use this glue code
2013-06-30Remove vec::{map, mapi, zip_map} and the methods, except for .map, since thisHuon Wilson-55/+54
is very common, and the replacement (.iter().transform().collect()) is very ugly.
2013-06-30Convert vec::dedup to a method.Huon Wilson-1/+1
2013-06-30Convert vec::{rposition, rposition_elem, position_elem, contains} to methods.Huon Wilson-8/+7
2013-06-30Remove vec::{rfind, rfind_between, find_between}, replaced by slices and ↵Huon Wilson-1/+1
iterator adapators.
2013-06-30auto merge of #7468 : cmr/rust/great_renaming, r=pcwaltonbors-286/+207
2013-06-30add a contains_managed intrinsicDaniel Micay-2/+8
2013-06-29auto merge of #7457 : Blei/rust/fix-ffi-floats, r=cmrbors-9/+5
Also contains a fix to help ctag pick up macro definitions.
2013-06-30Fixes #7377jihyun-0/+21
2013-06-29auto merge of #7452 : dotdash/rust/self_indirection, r=cmrbors-127/+82
Currently we pass all "self" arguments by reference, for the pointer variants this means that we end up with double indirection which causes a unnecessary performance hit. The fix itself is pretty straight-forward and just means that "self" needs to be handled like any other argument, except for by-value "self" which still needs to be passed by reference. This is because non-pointer types can't just be stuffed into the environment slot which is used to pass "self". What made things tricky is that there was also a bug in the typechecker where the method map entries are created. For type impls, that stored the base type instead of the actual self-type in the method map, e.g. Foo instead of &Foo for &self. That worked with pass-by-reference, but fails with pass-by-value which needs the real type. Code that makes use of methods seems to be about 10% faster with this change. Also, build times are reduced by about 4%. Fixes #4355, #4402, #5280, #4406 and #7285
2013-06-29Avoid double indirection for the "self" arg in methodsBjörn Steinbrink-78/+57
Currently we pass all "self" arguments by reference, for the pointer variants this means that we end up with double indirection which causes a unnecessary performance hit. The fix itself is pretty straight-forward and just means that "self" needs to be handled like any other argument, except for by-value "self" which still needs to be passed by reference. This is because non-pointer types can't just be stuffed into the environment slot which is used to pass "self". What made things tricky is that there was also a bug in the typechecker where the method map entries are created. For type impls, that stored the base type instead of the actual self-type in the method map, e.g. Foo instead of &Foo for &self. That worked with pass-by-reference, but fails with pass-by-value which needs the real type. Code that makes use of methods seems to be about 10% faster with this change. Also, build times are reduced by about 4%. Fixes #4355, #4402, #5280, #4406 and #7285
2013-06-29Fix handling of temp cleanups for the "self" argumentBjörn Steinbrink-25/+23
The code that tried to revoke the cleanup for the self argument tried to use "llself" to do so, but the cleanup might actually be registered with a different ValueRef due to e.g. casting. Currently, this is worked around by early revocation of the cleanup for self in trans_self_arg. To handle this correctly, we have to put the ValueRef for the cleanup into the MethodData, so trans_call_inner can use it to revoke the cleanup when it's actually supposed to.
2013-06-29Remove mutability from unique boxes in the ASTAlex Crichton-14/+15
2013-06-29Removing a lot of usage of '&const'Alex Crichton-41/+41
2013-06-29Warning cleanupCorey Richardson-9/+3
2013-06-29Fix merge falloutCorey Richardson-7/+10
2013-06-29Great renaming: propagate throughout the rest of the codebaseCorey Richardson-271/+195
2013-06-29Avoid extra casts for "self" argumentsBjörn Steinbrink-30/+8
"self" is always passed as an opaque box, so there's no point in using the concrete self type when translating the argument. All it does it causing the value to be casted back to an opaque box right away.
2013-06-29Add missing argument to a debug! call in trans_arg_exprBjörn Steinbrink-1/+1
2013-06-29auto merge of #7363 : bblum/rust/soundness, r=nikomatsakisbors-319/+89
The commit f9a5453 is meant to be a temporary hold-over. Whether or not there is added a way for the compiler to "implicitly borrow" stack closures in this way, there should be a codegen optimization that prevents having to traverse possibly-very-many function pointers to find the function you ultimately wanted to call. I tried to separate out the changes so this particular commit could be straight-up reverted if auto-borrowing happens in the future. r? @nikomatsakis
2013-06-29auto merge of #7244 : bblum/rust/once, r=nikomatsakisbors-27/+78
@graydon suggested that once closures not be part of the language for 1.0, but that they might be hidden behind a -Z compile flag as an "experimental feature" in case people decide they need them. Regardless of whether ```-Z once-fns``` is set, this PR will parse the ```once``` keyword and will prevent closures labelled with it from being called more than once. It will also permit moving out of captured vars in heap closures, just to let the runtime writers stop using ```Cell``` sooner. Setting ```-Z once-fns``` only toggles whether the move-out-from-capture privilege is also given for stack closures. r? @nikomatsakis
2013-06-29Trade stack closure copyability for type soundness.Ben Blum-14/+36
2013-06-29'Borrow' stack closures rather than copying them (e.g., "|x|f(x)"), in prep ↵Ben Blum-30/+30
for making them noncopyable.
2013-06-29Use more deriving(IterBytes) in librustc.Ben Blum-275/+23
2013-06-28auto merge of #7479 : mozilla/rust/rollup, r=thestingerbors-8/+6
22b7eb3 r=thestinger 28a3613 r=cmr a0c31ec r=bstrie ee7307e r=thestinger b9cf6a3 r=thestinger
2013-06-29librustc: fix #7467 for androidYoung-il Choi-5/+3
2013-06-29Rename #[mutable] to #[no_freeze]Brian Anderson-1/+1
2013-06-29Rename #[non_sendable] to #[no_send]Brian Anderson-2/+2
2013-06-28Drop the impl_id field from fn_ctxt.Michael Sullivan-38/+7
2013-06-28Drop an unused field from param_substs.Michael Sullivan-6/+3
2013-06-28Improve handling of trait bounds on a trait in default methods.Michael Sullivan-38/+92
This is work on #7460. It does not properly handle certain cross crate situations, because we don't properly export vtable resolution information.
2013-06-28Rework vtable_res to not be flattened. It is now a list of the resolutions ↵Michael Sullivan-90/+76
for each param.
2013-06-28Actually resolve trait bounds on impls. Closes #7266.Michael Sullivan-0/+28
2013-06-28Make calling methods parameterized on the trait work from default methods.Michael Sullivan-31/+117
This is done by adding a new notion of "vtable_self". We do not yet properly handle super traits. Closes #7183.
2013-06-28Make default method handling not choke on self region params. Closes #7341.Michael Sullivan-1/+6
2013-06-28librustc: don't skip ahead when computing register types of SSEFloatVectorsPhilipp Brüschweiler-9/+5
Also fixes an unrelated typo (found by comparing to the original code of the clay project) and some cleanup. Fixes #7415.
2013-06-28Rename Const/Owned in more placesJames Miller-1/+1
2013-06-28librustc: Fix even *MORE* merge fallout!Patrick Walton-2/+2
2013-06-28librustc: Fix even *more* merge fallout!Patrick Walton-5/+5
2013-06-28librustc: Fix more merge fallout.Patrick Walton-4/+5
2013-06-28librustc: Fix merge fallout and test cases.Patrick Walton-14/+38
2013-06-28Rewrite each_path to allow performance improvements in the future.Patrick Walton-208/+151
Instead of determining paths from the path tag, we iterate through modules' children recursively in the metadata. This will allow for lazy external module resolution.